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/profiles/2020-09-01/compute/mgmt/compute" 22 23// AccessURI a disk access SAS uri. 24type AccessURI struct { 25 autorest.Response `json:"-"` 26 // AccessSAS - READ-ONLY; A SAS uri for accessing a disk. 27 AccessSAS *string `json:"accessSAS,omitempty"` 28} 29 30// AdditionalCapabilities enables or disables a capability on the virtual machine or virtual machine scale 31// set. 32type AdditionalCapabilities struct { 33 // UltraSSDEnabled - The flag that enables or disables a capability to have one or more managed data disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed disks with storage account type UltraSSD_LRS can be added to a virtual machine or virtual machine scale set only if this property is enabled. 34 UltraSSDEnabled *bool `json:"ultraSSDEnabled,omitempty"` 35} 36 37// AdditionalUnattendContent specifies additional XML formatted information that can be included in the 38// Unattend.xml file, which is used by Windows Setup. Contents are defined by setting name, component name, 39// and the pass in which the content is applied. 40type AdditionalUnattendContent struct { 41 // PassName - The pass name. Currently, the only allowable value is OobeSystem. Possible values include: 'OobeSystem' 42 PassName PassNames `json:"passName,omitempty"` 43 // ComponentName - The component name. Currently, the only allowable value is Microsoft-Windows-Shell-Setup. Possible values include: 'MicrosoftWindowsShellSetup' 44 ComponentName ComponentNames `json:"componentName,omitempty"` 45 // SettingName - Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon. Possible values include: 'AutoLogon', 'FirstLogonCommands' 46 SettingName SettingNames `json:"settingName,omitempty"` 47 // 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. 48 Content *string `json:"content,omitempty"` 49} 50 51// APIEntityReference the API entity reference. 52type APIEntityReference struct { 53 // ID - The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... 54 ID *string `json:"id,omitempty"` 55} 56 57// APIError api error. 58type APIError struct { 59 // Details - The Api error details 60 Details *[]APIErrorBase `json:"details,omitempty"` 61 // Innererror - The Api inner error 62 Innererror *InnerError `json:"innererror,omitempty"` 63 // Code - The error code. 64 Code *string `json:"code,omitempty"` 65 // Target - The target of the particular error. 66 Target *string `json:"target,omitempty"` 67 // Message - The error message. 68 Message *string `json:"message,omitempty"` 69} 70 71// APIErrorBase api error base. 72type APIErrorBase struct { 73 // Code - The error code. 74 Code *string `json:"code,omitempty"` 75 // Target - The target of the particular error. 76 Target *string `json:"target,omitempty"` 77 // Message - The error message. 78 Message *string `json:"message,omitempty"` 79} 80 81// AutomaticOSUpgradePolicy the configuration parameters used for performing automatic OS upgrade. 82type AutomaticOSUpgradePolicy struct { 83 // EnableAutomaticOSUpgrade - Indicates whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer version of the OS image becomes available. Default value is false. <br><br> If this is set to true for Windows based scale sets, [enableAutomaticUpdates](https://docs.microsoft.com/dotnet/api/microsoft.azure.management.compute.models.windowsconfiguration.enableautomaticupdates?view=azure-dotnet) is automatically set to false and cannot be set to true. 84 EnableAutomaticOSUpgrade *bool `json:"enableAutomaticOSUpgrade,omitempty"` 85 // DisableAutomaticRollback - Whether OS image rollback feature should be disabled. Default value is false. 86 DisableAutomaticRollback *bool `json:"disableAutomaticRollback,omitempty"` 87} 88 89// AutomaticOSUpgradeProperties describes automatic OS upgrade properties on the image. 90type AutomaticOSUpgradeProperties struct { 91 // AutomaticOSUpgradeSupported - Specifies whether automatic OS upgrade is supported on the image. 92 AutomaticOSUpgradeSupported *bool `json:"automaticOSUpgradeSupported,omitempty"` 93} 94 95// AutomaticRepairsPolicy specifies the configuration parameters for automatic repairs on the virtual 96// machine scale set. 97type AutomaticRepairsPolicy struct { 98 // Enabled - Specifies whether automatic repairs should be enabled on the virtual machine scale set. The default value is false. 99 Enabled *bool `json:"enabled,omitempty"` 100 // GracePeriod - The amount of time for which automatic repairs are suspended due to a state change on VM. The grace time starts after the state change has completed. This helps avoid premature or accidental repairs. The time duration should be specified in ISO 8601 format. The minimum allowed grace period is 30 minutes (PT30M), which is also the default value. The maximum allowed grace period is 90 minutes (PT90M). 101 GracePeriod *string `json:"gracePeriod,omitempty"` 102} 103 104// AvailabilitySet specifies information about the availability set that the virtual machine should be 105// assigned to. Virtual machines specified in the same availability set are allocated to different nodes to 106// maximize availability. For more information about availability sets, see [Manage the availability of 107// virtual 108// machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). 109// <br><br> For more information on Azure planned maintenance, see [Planned maintenance for virtual 110// machines in 111// Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) 112// <br><br> Currently, a VM can only be added to availability set at creation time. An existing VM cannot 113// be added to an availability set. 114type AvailabilitySet struct { 115 autorest.Response `json:"-"` 116 *AvailabilitySetProperties `json:"properties,omitempty"` 117 // Sku - Sku of the availability set, only name is required to be set. See AvailabilitySetSkuTypes for possible set of values. Use 'Aligned' for virtual machines with managed disks and 'Classic' for virtual machines with unmanaged disks. Default value is 'Classic'. 118 Sku *Sku `json:"sku,omitempty"` 119 // ID - READ-ONLY; Resource Id 120 ID *string `json:"id,omitempty"` 121 // Name - READ-ONLY; Resource name 122 Name *string `json:"name,omitempty"` 123 // Type - READ-ONLY; Resource type 124 Type *string `json:"type,omitempty"` 125 // Location - Resource location 126 Location *string `json:"location,omitempty"` 127 // Tags - Resource tags 128 Tags map[string]*string `json:"tags"` 129} 130 131// MarshalJSON is the custom marshaler for AvailabilitySet. 132func (as AvailabilitySet) MarshalJSON() ([]byte, error) { 133 objectMap := make(map[string]interface{}) 134 if as.AvailabilitySetProperties != nil { 135 objectMap["properties"] = as.AvailabilitySetProperties 136 } 137 if as.Sku != nil { 138 objectMap["sku"] = as.Sku 139 } 140 if as.Location != nil { 141 objectMap["location"] = as.Location 142 } 143 if as.Tags != nil { 144 objectMap["tags"] = as.Tags 145 } 146 return json.Marshal(objectMap) 147} 148 149// UnmarshalJSON is the custom unmarshaler for AvailabilitySet struct. 150func (as *AvailabilitySet) UnmarshalJSON(body []byte) error { 151 var m map[string]*json.RawMessage 152 err := json.Unmarshal(body, &m) 153 if err != nil { 154 return err 155 } 156 for k, v := range m { 157 switch k { 158 case "properties": 159 if v != nil { 160 var availabilitySetProperties AvailabilitySetProperties 161 err = json.Unmarshal(*v, &availabilitySetProperties) 162 if err != nil { 163 return err 164 } 165 as.AvailabilitySetProperties = &availabilitySetProperties 166 } 167 case "sku": 168 if v != nil { 169 var sku Sku 170 err = json.Unmarshal(*v, &sku) 171 if err != nil { 172 return err 173 } 174 as.Sku = &sku 175 } 176 case "id": 177 if v != nil { 178 var ID string 179 err = json.Unmarshal(*v, &ID) 180 if err != nil { 181 return err 182 } 183 as.ID = &ID 184 } 185 case "name": 186 if v != nil { 187 var name string 188 err = json.Unmarshal(*v, &name) 189 if err != nil { 190 return err 191 } 192 as.Name = &name 193 } 194 case "type": 195 if v != nil { 196 var typeVar string 197 err = json.Unmarshal(*v, &typeVar) 198 if err != nil { 199 return err 200 } 201 as.Type = &typeVar 202 } 203 case "location": 204 if v != nil { 205 var location string 206 err = json.Unmarshal(*v, &location) 207 if err != nil { 208 return err 209 } 210 as.Location = &location 211 } 212 case "tags": 213 if v != nil { 214 var tags map[string]*string 215 err = json.Unmarshal(*v, &tags) 216 if err != nil { 217 return err 218 } 219 as.Tags = tags 220 } 221 } 222 } 223 224 return nil 225} 226 227// AvailabilitySetListResult the List Availability Set operation response. 228type AvailabilitySetListResult struct { 229 autorest.Response `json:"-"` 230 // Value - The list of availability sets 231 Value *[]AvailabilitySet `json:"value,omitempty"` 232 // NextLink - The URI to fetch the next page of AvailabilitySets. Call ListNext() with this URI to fetch the next page of AvailabilitySets. 233 NextLink *string `json:"nextLink,omitempty"` 234} 235 236// AvailabilitySetListResultIterator provides access to a complete listing of AvailabilitySet values. 237type AvailabilitySetListResultIterator struct { 238 i int 239 page AvailabilitySetListResultPage 240} 241 242// NextWithContext advances to the next value. If there was an error making 243// the request the iterator does not advance and the error is returned. 244func (iter *AvailabilitySetListResultIterator) NextWithContext(ctx context.Context) (err error) { 245 if tracing.IsEnabled() { 246 ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetListResultIterator.NextWithContext") 247 defer func() { 248 sc := -1 249 if iter.Response().Response.Response != nil { 250 sc = iter.Response().Response.Response.StatusCode 251 } 252 tracing.EndSpan(ctx, sc, err) 253 }() 254 } 255 iter.i++ 256 if iter.i < len(iter.page.Values()) { 257 return nil 258 } 259 err = iter.page.NextWithContext(ctx) 260 if err != nil { 261 iter.i-- 262 return err 263 } 264 iter.i = 0 265 return nil 266} 267 268// Next advances to the next value. If there was an error making 269// the request the iterator does not advance and the error is returned. 270// Deprecated: Use NextWithContext() instead. 271func (iter *AvailabilitySetListResultIterator) Next() error { 272 return iter.NextWithContext(context.Background()) 273} 274 275// NotDone returns true if the enumeration should be started or is not yet complete. 276func (iter AvailabilitySetListResultIterator) NotDone() bool { 277 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 278} 279 280// Response returns the raw server response from the last page request. 281func (iter AvailabilitySetListResultIterator) Response() AvailabilitySetListResult { 282 return iter.page.Response() 283} 284 285// Value returns the current value or a zero-initialized value if the 286// iterator has advanced beyond the end of the collection. 287func (iter AvailabilitySetListResultIterator) Value() AvailabilitySet { 288 if !iter.page.NotDone() { 289 return AvailabilitySet{} 290 } 291 return iter.page.Values()[iter.i] 292} 293 294// Creates a new instance of the AvailabilitySetListResultIterator type. 295func NewAvailabilitySetListResultIterator(page AvailabilitySetListResultPage) AvailabilitySetListResultIterator { 296 return AvailabilitySetListResultIterator{page: page} 297} 298 299// IsEmpty returns true if the ListResult contains no values. 300func (aslr AvailabilitySetListResult) IsEmpty() bool { 301 return aslr.Value == nil || len(*aslr.Value) == 0 302} 303 304// hasNextLink returns true if the NextLink is not empty. 305func (aslr AvailabilitySetListResult) hasNextLink() bool { 306 return aslr.NextLink != nil && len(*aslr.NextLink) != 0 307} 308 309// availabilitySetListResultPreparer prepares a request to retrieve the next set of results. 310// It returns nil if no more results exist. 311func (aslr AvailabilitySetListResult) availabilitySetListResultPreparer(ctx context.Context) (*http.Request, error) { 312 if !aslr.hasNextLink() { 313 return nil, nil 314 } 315 return autorest.Prepare((&http.Request{}).WithContext(ctx), 316 autorest.AsJSON(), 317 autorest.AsGet(), 318 autorest.WithBaseURL(to.String(aslr.NextLink))) 319} 320 321// AvailabilitySetListResultPage contains a page of AvailabilitySet values. 322type AvailabilitySetListResultPage struct { 323 fn func(context.Context, AvailabilitySetListResult) (AvailabilitySetListResult, error) 324 aslr AvailabilitySetListResult 325} 326 327// NextWithContext advances to the next page of values. If there was an error making 328// the request the page does not advance and the error is returned. 329func (page *AvailabilitySetListResultPage) NextWithContext(ctx context.Context) (err error) { 330 if tracing.IsEnabled() { 331 ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetListResultPage.NextWithContext") 332 defer func() { 333 sc := -1 334 if page.Response().Response.Response != nil { 335 sc = page.Response().Response.Response.StatusCode 336 } 337 tracing.EndSpan(ctx, sc, err) 338 }() 339 } 340 for { 341 next, err := page.fn(ctx, page.aslr) 342 if err != nil { 343 return err 344 } 345 page.aslr = next 346 if !next.hasNextLink() || !next.IsEmpty() { 347 break 348 } 349 } 350 return nil 351} 352 353// Next advances to the next page of values. If there was an error making 354// the request the page does not advance and the error is returned. 355// Deprecated: Use NextWithContext() instead. 356func (page *AvailabilitySetListResultPage) Next() error { 357 return page.NextWithContext(context.Background()) 358} 359 360// NotDone returns true if the page enumeration should be started or is not yet complete. 361func (page AvailabilitySetListResultPage) NotDone() bool { 362 return !page.aslr.IsEmpty() 363} 364 365// Response returns the raw server response from the last page request. 366func (page AvailabilitySetListResultPage) Response() AvailabilitySetListResult { 367 return page.aslr 368} 369 370// Values returns the slice of values for the current page or nil if there are no values. 371func (page AvailabilitySetListResultPage) Values() []AvailabilitySet { 372 if page.aslr.IsEmpty() { 373 return nil 374 } 375 return *page.aslr.Value 376} 377 378// Creates a new instance of the AvailabilitySetListResultPage type. 379func NewAvailabilitySetListResultPage(cur AvailabilitySetListResult, getNextPage func(context.Context, AvailabilitySetListResult) (AvailabilitySetListResult, error)) AvailabilitySetListResultPage { 380 return AvailabilitySetListResultPage{ 381 fn: getNextPage, 382 aslr: cur, 383 } 384} 385 386// AvailabilitySetProperties the instance view of a resource. 387type AvailabilitySetProperties struct { 388 // PlatformUpdateDomainCount - Update Domain count. 389 PlatformUpdateDomainCount *int32 `json:"platformUpdateDomainCount,omitempty"` 390 // PlatformFaultDomainCount - Fault Domain count. 391 PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` 392 // VirtualMachines - A list of references to all virtual machines in the availability set. 393 VirtualMachines *[]SubResource `json:"virtualMachines,omitempty"` 394 // ProximityPlacementGroup - Specifies information about the proximity placement group that the availability set should be assigned to. <br><br>Minimum api-version: 2018-04-01. 395 ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` 396 // Statuses - READ-ONLY; The resource status information. 397 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 398} 399 400// MarshalJSON is the custom marshaler for AvailabilitySetProperties. 401func (asp AvailabilitySetProperties) MarshalJSON() ([]byte, error) { 402 objectMap := make(map[string]interface{}) 403 if asp.PlatformUpdateDomainCount != nil { 404 objectMap["platformUpdateDomainCount"] = asp.PlatformUpdateDomainCount 405 } 406 if asp.PlatformFaultDomainCount != nil { 407 objectMap["platformFaultDomainCount"] = asp.PlatformFaultDomainCount 408 } 409 if asp.VirtualMachines != nil { 410 objectMap["virtualMachines"] = asp.VirtualMachines 411 } 412 if asp.ProximityPlacementGroup != nil { 413 objectMap["proximityPlacementGroup"] = asp.ProximityPlacementGroup 414 } 415 return json.Marshal(objectMap) 416} 417 418// AvailabilitySetUpdate specifies information about the availability set that the virtual machine should 419// be assigned to. Only tags may be updated. 420type AvailabilitySetUpdate struct { 421 *AvailabilitySetProperties `json:"properties,omitempty"` 422 // Sku - Sku of the availability set 423 Sku *Sku `json:"sku,omitempty"` 424 // Tags - Resource tags 425 Tags map[string]*string `json:"tags"` 426} 427 428// MarshalJSON is the custom marshaler for AvailabilitySetUpdate. 429func (asu AvailabilitySetUpdate) MarshalJSON() ([]byte, error) { 430 objectMap := make(map[string]interface{}) 431 if asu.AvailabilitySetProperties != nil { 432 objectMap["properties"] = asu.AvailabilitySetProperties 433 } 434 if asu.Sku != nil { 435 objectMap["sku"] = asu.Sku 436 } 437 if asu.Tags != nil { 438 objectMap["tags"] = asu.Tags 439 } 440 return json.Marshal(objectMap) 441} 442 443// UnmarshalJSON is the custom unmarshaler for AvailabilitySetUpdate struct. 444func (asu *AvailabilitySetUpdate) UnmarshalJSON(body []byte) error { 445 var m map[string]*json.RawMessage 446 err := json.Unmarshal(body, &m) 447 if err != nil { 448 return err 449 } 450 for k, v := range m { 451 switch k { 452 case "properties": 453 if v != nil { 454 var availabilitySetProperties AvailabilitySetProperties 455 err = json.Unmarshal(*v, &availabilitySetProperties) 456 if err != nil { 457 return err 458 } 459 asu.AvailabilitySetProperties = &availabilitySetProperties 460 } 461 case "sku": 462 if v != nil { 463 var sku Sku 464 err = json.Unmarshal(*v, &sku) 465 if err != nil { 466 return err 467 } 468 asu.Sku = &sku 469 } 470 case "tags": 471 if v != nil { 472 var tags map[string]*string 473 err = json.Unmarshal(*v, &tags) 474 if err != nil { 475 return err 476 } 477 asu.Tags = tags 478 } 479 } 480 } 481 482 return nil 483} 484 485// AvailablePatchSummary describes the properties of an virtual machine instance view for available patch 486// summary. 487type AvailablePatchSummary struct { 488 // Status - READ-ONLY; The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Failed", "Succeeded", or "CompletedWithWarnings.". Possible values include: 'PatchOperationStatusInProgress', 'PatchOperationStatusFailed', 'PatchOperationStatusSucceeded', 'PatchOperationStatusCompletedWithWarnings' 489 Status PatchOperationStatus `json:"status,omitempty"` 490 // AssessmentActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. 491 AssessmentActivityID *string `json:"assessmentActivityId,omitempty"` 492 // RebootPending - READ-ONLY; The overall reboot status of the VM. It will be true when partially installed patches require a reboot to complete installation but the reboot has not yet occurred. 493 RebootPending *bool `json:"rebootPending,omitempty"` 494 // CriticalAndSecurityPatchCount - READ-ONLY; The number of critical or security patches that have been detected as available and not yet installed. 495 CriticalAndSecurityPatchCount *int32 `json:"criticalAndSecurityPatchCount,omitempty"` 496 // OtherPatchCount - READ-ONLY; The number of all available patches excluding critical and security. 497 OtherPatchCount *int32 `json:"otherPatchCount,omitempty"` 498 // StartTime - READ-ONLY; The UTC timestamp when the operation began. 499 StartTime *date.Time `json:"startTime,omitempty"` 500 // LastModifiedTime - READ-ONLY; The UTC timestamp when the operation began. 501 LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` 502 // Error - READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. 503 Error *APIError `json:"error,omitempty"` 504} 505 506// BillingProfile specifies the billing related details of a Azure Spot VM or VMSS. <br><br>Minimum 507// api-version: 2019-03-01. 508type BillingProfile struct { 509 // MaxPrice - Specifies the maximum price you are willing to pay for a Azure Spot VM/VMSS. This price is in US Dollars. <br><br> This price will be compared with the current Azure Spot price for the VM size. Also, the prices are compared at the time of create/update of Azure Spot VM/VMSS and the operation will only succeed if the maxPrice is greater than the current Azure Spot price. <br><br> The maxPrice will also be used for evicting a Azure Spot VM/VMSS if the current Azure Spot price goes beyond the maxPrice after creation of VM/VMSS. <br><br> Possible values are: <br><br> - Any decimal value greater than zero. Example: 0.01538 <br><br> -1 – indicates default price to be up-to on-demand. <br><br> You can set the maxPrice to -1 to indicate that the Azure Spot VM/VMSS should not be evicted for price reasons. Also, the default max price is -1 if it is not provided by you. <br><br>Minimum api-version: 2019-03-01. 510 MaxPrice *float64 `json:"maxPrice,omitempty"` 511} 512 513// BootDiagnostics boot Diagnostics is a debugging feature which allows you to view Console Output and 514// Screenshot to diagnose VM status. <br><br> You can easily view the output of your console log. <br><br> 515// Azure also enables you to see a screenshot of the VM from the hypervisor. 516type BootDiagnostics struct { 517 // Enabled - Whether boot diagnostics should be enabled on the Virtual Machine. 518 Enabled *bool `json:"enabled,omitempty"` 519 // StorageURI - Uri of the storage account to use for placing the console output and screenshot. <br><br>If storageUri is not specified while enabling boot diagnostics, managed storage will be used. 520 StorageURI *string `json:"storageUri,omitempty"` 521} 522 523// BootDiagnosticsInstanceView the instance view of a virtual machine boot diagnostics. 524type BootDiagnosticsInstanceView struct { 525 // ConsoleScreenshotBlobURI - READ-ONLY; The console screenshot blob URI. <br><br>NOTE: This will **not** be set if boot diagnostics is currently enabled with managed storage. 526 ConsoleScreenshotBlobURI *string `json:"consoleScreenshotBlobUri,omitempty"` 527 // SerialConsoleLogBlobURI - READ-ONLY; The serial console log blob Uri. <br><br>NOTE: This will **not** be set if boot diagnostics is currently enabled with managed storage. 528 SerialConsoleLogBlobURI *string `json:"serialConsoleLogBlobUri,omitempty"` 529 // Status - READ-ONLY; The boot diagnostics status information for the VM. <br><br> NOTE: It will be set only if there are errors encountered in enabling boot diagnostics. 530 Status *InstanceViewStatus `json:"status,omitempty"` 531} 532 533// CloudError an error response from the Compute service. 534type CloudError struct { 535 Error *APIError `json:"error,omitempty"` 536} 537 538// CreationData data used when creating a disk. 539type CreationData struct { 540 // CreateOption - This enumerates the possible sources of a disk's creation. Possible values include: 'Empty', 'Attach', 'FromImage', 'Import', 'Copy', 'Restore', 'Upload' 541 CreateOption DiskCreateOption `json:"createOption,omitempty"` 542 // StorageAccountID - Required if createOption is Import. The Azure Resource Manager identifier of the storage account containing the blob to import as a disk. 543 StorageAccountID *string `json:"storageAccountId,omitempty"` 544 // ImageReference - Disk source information. 545 ImageReference *ImageDiskReference `json:"imageReference,omitempty"` 546 // SourceURI - If createOption is Import, this is the URI of a blob to be imported into a managed disk. 547 SourceURI *string `json:"sourceUri,omitempty"` 548 // SourceResourceID - If createOption is Copy, this is the ARM id of the source snapshot or disk. 549 SourceResourceID *string `json:"sourceResourceId,omitempty"` 550 // SourceUniqueID - READ-ONLY; If this field is set, this is the unique id identifying the source of this resource. 551 SourceUniqueID *string `json:"sourceUniqueId,omitempty"` 552 // UploadSizeBytes - If createOption is Upload, this is the size of the contents of the upload including the VHD footer. This value should be between 20972032 (20 MiB + 512 bytes for the VHD footer) and 35183298347520 bytes (32 TiB + 512 bytes for the VHD footer). 553 UploadSizeBytes *int64 `json:"uploadSizeBytes,omitempty"` 554} 555 556// MarshalJSON is the custom marshaler for CreationData. 557func (cd CreationData) MarshalJSON() ([]byte, error) { 558 objectMap := make(map[string]interface{}) 559 if cd.CreateOption != "" { 560 objectMap["createOption"] = cd.CreateOption 561 } 562 if cd.StorageAccountID != nil { 563 objectMap["storageAccountId"] = cd.StorageAccountID 564 } 565 if cd.ImageReference != nil { 566 objectMap["imageReference"] = cd.ImageReference 567 } 568 if cd.SourceURI != nil { 569 objectMap["sourceUri"] = cd.SourceURI 570 } 571 if cd.SourceResourceID != nil { 572 objectMap["sourceResourceId"] = cd.SourceResourceID 573 } 574 if cd.UploadSizeBytes != nil { 575 objectMap["uploadSizeBytes"] = cd.UploadSizeBytes 576 } 577 return json.Marshal(objectMap) 578} 579 580// DataDisk describes a data disk. 581type DataDisk struct { 582 // 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. 583 Lun *int32 `json:"lun,omitempty"` 584 // Name - The disk name. 585 Name *string `json:"name,omitempty"` 586 // Vhd - The virtual hard disk. 587 Vhd *VirtualHardDisk `json:"vhd,omitempty"` 588 // 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. 589 Image *VirtualHardDisk `json:"image,omitempty"` 590 // Caching - Specifies the caching requirements. <br><br> Possible values are: <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' 591 Caching CachingTypes `json:"caching,omitempty"` 592 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 593 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 594 // CreateOption - Specifies how the virtual machine should be created.<br><br> Possible values are:<br><br> **Attach** \u2013 This value is used when you are using a specialized disk to create the virtual machine.<br><br> **FromImage** \u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' 595 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 596 // 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 597 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 598 // ManagedDisk - The managed disk parameters. 599 ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` 600 // ToBeDetached - Specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset 601 ToBeDetached *bool `json:"toBeDetached,omitempty"` 602 // DiskIOPSReadWrite - READ-ONLY; Specifies the Read-Write IOPS for the managed disk when StorageAccountType is UltraSSD_LRS. Returned only for VirtualMachine ScaleSet VM disks. Can be updated only via updates to the VirtualMachine Scale Set. 603 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 604 // DiskMBpsReadWrite - READ-ONLY; Specifies the bandwidth in MB per second for the managed disk when StorageAccountType is UltraSSD_LRS. Returned only for VirtualMachine ScaleSet VM disks. Can be updated only via updates to the VirtualMachine Scale Set. 605 DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` 606} 607 608// MarshalJSON is the custom marshaler for DataDisk. 609func (dd DataDisk) MarshalJSON() ([]byte, error) { 610 objectMap := make(map[string]interface{}) 611 if dd.Lun != nil { 612 objectMap["lun"] = dd.Lun 613 } 614 if dd.Name != nil { 615 objectMap["name"] = dd.Name 616 } 617 if dd.Vhd != nil { 618 objectMap["vhd"] = dd.Vhd 619 } 620 if dd.Image != nil { 621 objectMap["image"] = dd.Image 622 } 623 if dd.Caching != "" { 624 objectMap["caching"] = dd.Caching 625 } 626 if dd.WriteAcceleratorEnabled != nil { 627 objectMap["writeAcceleratorEnabled"] = dd.WriteAcceleratorEnabled 628 } 629 if dd.CreateOption != "" { 630 objectMap["createOption"] = dd.CreateOption 631 } 632 if dd.DiskSizeGB != nil { 633 objectMap["diskSizeGB"] = dd.DiskSizeGB 634 } 635 if dd.ManagedDisk != nil { 636 objectMap["managedDisk"] = dd.ManagedDisk 637 } 638 if dd.ToBeDetached != nil { 639 objectMap["toBeDetached"] = dd.ToBeDetached 640 } 641 return json.Marshal(objectMap) 642} 643 644// DataDiskImage contains the data disk images information. 645type DataDiskImage struct { 646 // 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. 647 Lun *int32 `json:"lun,omitempty"` 648} 649 650// DedicatedHost specifies information about the Dedicated host. 651type DedicatedHost struct { 652 autorest.Response `json:"-"` 653 *DedicatedHostProperties `json:"properties,omitempty"` 654 // Sku - SKU of the dedicated host for Hardware Generation and VM family. Only name is required to be set. List Microsoft.Compute SKUs for a list of possible values. 655 Sku *Sku `json:"sku,omitempty"` 656 // ID - READ-ONLY; Resource Id 657 ID *string `json:"id,omitempty"` 658 // Name - READ-ONLY; Resource name 659 Name *string `json:"name,omitempty"` 660 // Type - READ-ONLY; Resource type 661 Type *string `json:"type,omitempty"` 662 // Location - Resource location 663 Location *string `json:"location,omitempty"` 664 // Tags - Resource tags 665 Tags map[string]*string `json:"tags"` 666} 667 668// MarshalJSON is the custom marshaler for DedicatedHost. 669func (dh DedicatedHost) MarshalJSON() ([]byte, error) { 670 objectMap := make(map[string]interface{}) 671 if dh.DedicatedHostProperties != nil { 672 objectMap["properties"] = dh.DedicatedHostProperties 673 } 674 if dh.Sku != nil { 675 objectMap["sku"] = dh.Sku 676 } 677 if dh.Location != nil { 678 objectMap["location"] = dh.Location 679 } 680 if dh.Tags != nil { 681 objectMap["tags"] = dh.Tags 682 } 683 return json.Marshal(objectMap) 684} 685 686// UnmarshalJSON is the custom unmarshaler for DedicatedHost struct. 687func (dh *DedicatedHost) UnmarshalJSON(body []byte) error { 688 var m map[string]*json.RawMessage 689 err := json.Unmarshal(body, &m) 690 if err != nil { 691 return err 692 } 693 for k, v := range m { 694 switch k { 695 case "properties": 696 if v != nil { 697 var dedicatedHostProperties DedicatedHostProperties 698 err = json.Unmarshal(*v, &dedicatedHostProperties) 699 if err != nil { 700 return err 701 } 702 dh.DedicatedHostProperties = &dedicatedHostProperties 703 } 704 case "sku": 705 if v != nil { 706 var sku Sku 707 err = json.Unmarshal(*v, &sku) 708 if err != nil { 709 return err 710 } 711 dh.Sku = &sku 712 } 713 case "id": 714 if v != nil { 715 var ID string 716 err = json.Unmarshal(*v, &ID) 717 if err != nil { 718 return err 719 } 720 dh.ID = &ID 721 } 722 case "name": 723 if v != nil { 724 var name string 725 err = json.Unmarshal(*v, &name) 726 if err != nil { 727 return err 728 } 729 dh.Name = &name 730 } 731 case "type": 732 if v != nil { 733 var typeVar string 734 err = json.Unmarshal(*v, &typeVar) 735 if err != nil { 736 return err 737 } 738 dh.Type = &typeVar 739 } 740 case "location": 741 if v != nil { 742 var location string 743 err = json.Unmarshal(*v, &location) 744 if err != nil { 745 return err 746 } 747 dh.Location = &location 748 } 749 case "tags": 750 if v != nil { 751 var tags map[string]*string 752 err = json.Unmarshal(*v, &tags) 753 if err != nil { 754 return err 755 } 756 dh.Tags = tags 757 } 758 } 759 } 760 761 return nil 762} 763 764// DedicatedHostAllocatableVM represents the dedicated host unutilized capacity in terms of a specific VM 765// size. 766type DedicatedHostAllocatableVM struct { 767 // VMSize - VM size in terms of which the unutilized capacity is represented. 768 VMSize *string `json:"vmSize,omitempty"` 769 // Count - Maximum number of VMs of size vmSize that can fit in the dedicated host's remaining capacity. 770 Count *float64 `json:"count,omitempty"` 771} 772 773// DedicatedHostAvailableCapacity dedicated host unutilized capacity. 774type DedicatedHostAvailableCapacity struct { 775 // AllocatableVMs - The unutilized capacity of the dedicated host represented in terms of each VM size that is allowed to be deployed to the dedicated host. 776 AllocatableVMs *[]DedicatedHostAllocatableVM `json:"allocatableVMs,omitempty"` 777} 778 779// DedicatedHostGroup specifies information about the dedicated host group that the dedicated hosts should 780// be assigned to. <br><br> Currently, a dedicated host can only be added to a dedicated host group at 781// creation time. An existing dedicated host cannot be added to another dedicated host group. 782type DedicatedHostGroup struct { 783 autorest.Response `json:"-"` 784 *DedicatedHostGroupProperties `json:"properties,omitempty"` 785 // Zones - Availability Zone to use for this host group. Only single zone is supported. The zone can be assigned only during creation. If not provided, the group supports all zones in the region. If provided, enforces each host in the group to be in the same zone. 786 Zones *[]string `json:"zones,omitempty"` 787 // ID - READ-ONLY; Resource Id 788 ID *string `json:"id,omitempty"` 789 // Name - READ-ONLY; Resource name 790 Name *string `json:"name,omitempty"` 791 // Type - READ-ONLY; Resource type 792 Type *string `json:"type,omitempty"` 793 // Location - Resource location 794 Location *string `json:"location,omitempty"` 795 // Tags - Resource tags 796 Tags map[string]*string `json:"tags"` 797} 798 799// MarshalJSON is the custom marshaler for DedicatedHostGroup. 800func (dhg DedicatedHostGroup) MarshalJSON() ([]byte, error) { 801 objectMap := make(map[string]interface{}) 802 if dhg.DedicatedHostGroupProperties != nil { 803 objectMap["properties"] = dhg.DedicatedHostGroupProperties 804 } 805 if dhg.Zones != nil { 806 objectMap["zones"] = dhg.Zones 807 } 808 if dhg.Location != nil { 809 objectMap["location"] = dhg.Location 810 } 811 if dhg.Tags != nil { 812 objectMap["tags"] = dhg.Tags 813 } 814 return json.Marshal(objectMap) 815} 816 817// UnmarshalJSON is the custom unmarshaler for DedicatedHostGroup struct. 818func (dhg *DedicatedHostGroup) UnmarshalJSON(body []byte) error { 819 var m map[string]*json.RawMessage 820 err := json.Unmarshal(body, &m) 821 if err != nil { 822 return err 823 } 824 for k, v := range m { 825 switch k { 826 case "properties": 827 if v != nil { 828 var dedicatedHostGroupProperties DedicatedHostGroupProperties 829 err = json.Unmarshal(*v, &dedicatedHostGroupProperties) 830 if err != nil { 831 return err 832 } 833 dhg.DedicatedHostGroupProperties = &dedicatedHostGroupProperties 834 } 835 case "zones": 836 if v != nil { 837 var zones []string 838 err = json.Unmarshal(*v, &zones) 839 if err != nil { 840 return err 841 } 842 dhg.Zones = &zones 843 } 844 case "id": 845 if v != nil { 846 var ID string 847 err = json.Unmarshal(*v, &ID) 848 if err != nil { 849 return err 850 } 851 dhg.ID = &ID 852 } 853 case "name": 854 if v != nil { 855 var name string 856 err = json.Unmarshal(*v, &name) 857 if err != nil { 858 return err 859 } 860 dhg.Name = &name 861 } 862 case "type": 863 if v != nil { 864 var typeVar string 865 err = json.Unmarshal(*v, &typeVar) 866 if err != nil { 867 return err 868 } 869 dhg.Type = &typeVar 870 } 871 case "location": 872 if v != nil { 873 var location string 874 err = json.Unmarshal(*v, &location) 875 if err != nil { 876 return err 877 } 878 dhg.Location = &location 879 } 880 case "tags": 881 if v != nil { 882 var tags map[string]*string 883 err = json.Unmarshal(*v, &tags) 884 if err != nil { 885 return err 886 } 887 dhg.Tags = tags 888 } 889 } 890 } 891 892 return nil 893} 894 895// DedicatedHostGroupInstanceView ... 896type DedicatedHostGroupInstanceView struct { 897 // Hosts - List of instance view of the dedicated hosts under the dedicated host group. 898 Hosts *[]DedicatedHostInstanceViewWithName `json:"hosts,omitempty"` 899} 900 901// DedicatedHostGroupListResult the List Dedicated Host Group with resource group response. 902type DedicatedHostGroupListResult struct { 903 autorest.Response `json:"-"` 904 // Value - The list of dedicated host groups 905 Value *[]DedicatedHostGroup `json:"value,omitempty"` 906 // NextLink - The URI to fetch the next page of Dedicated Host Groups. Call ListNext() with this URI to fetch the next page of Dedicated Host Groups. 907 NextLink *string `json:"nextLink,omitempty"` 908} 909 910// DedicatedHostGroupListResultIterator provides access to a complete listing of DedicatedHostGroup values. 911type DedicatedHostGroupListResultIterator struct { 912 i int 913 page DedicatedHostGroupListResultPage 914} 915 916// NextWithContext advances to the next value. If there was an error making 917// the request the iterator does not advance and the error is returned. 918func (iter *DedicatedHostGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { 919 if tracing.IsEnabled() { 920 ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupListResultIterator.NextWithContext") 921 defer func() { 922 sc := -1 923 if iter.Response().Response.Response != nil { 924 sc = iter.Response().Response.Response.StatusCode 925 } 926 tracing.EndSpan(ctx, sc, err) 927 }() 928 } 929 iter.i++ 930 if iter.i < len(iter.page.Values()) { 931 return nil 932 } 933 err = iter.page.NextWithContext(ctx) 934 if err != nil { 935 iter.i-- 936 return err 937 } 938 iter.i = 0 939 return nil 940} 941 942// Next advances to the next value. If there was an error making 943// the request the iterator does not advance and the error is returned. 944// Deprecated: Use NextWithContext() instead. 945func (iter *DedicatedHostGroupListResultIterator) Next() error { 946 return iter.NextWithContext(context.Background()) 947} 948 949// NotDone returns true if the enumeration should be started or is not yet complete. 950func (iter DedicatedHostGroupListResultIterator) NotDone() bool { 951 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 952} 953 954// Response returns the raw server response from the last page request. 955func (iter DedicatedHostGroupListResultIterator) Response() DedicatedHostGroupListResult { 956 return iter.page.Response() 957} 958 959// Value returns the current value or a zero-initialized value if the 960// iterator has advanced beyond the end of the collection. 961func (iter DedicatedHostGroupListResultIterator) Value() DedicatedHostGroup { 962 if !iter.page.NotDone() { 963 return DedicatedHostGroup{} 964 } 965 return iter.page.Values()[iter.i] 966} 967 968// Creates a new instance of the DedicatedHostGroupListResultIterator type. 969func NewDedicatedHostGroupListResultIterator(page DedicatedHostGroupListResultPage) DedicatedHostGroupListResultIterator { 970 return DedicatedHostGroupListResultIterator{page: page} 971} 972 973// IsEmpty returns true if the ListResult contains no values. 974func (dhglr DedicatedHostGroupListResult) IsEmpty() bool { 975 return dhglr.Value == nil || len(*dhglr.Value) == 0 976} 977 978// hasNextLink returns true if the NextLink is not empty. 979func (dhglr DedicatedHostGroupListResult) hasNextLink() bool { 980 return dhglr.NextLink != nil && len(*dhglr.NextLink) != 0 981} 982 983// dedicatedHostGroupListResultPreparer prepares a request to retrieve the next set of results. 984// It returns nil if no more results exist. 985func (dhglr DedicatedHostGroupListResult) dedicatedHostGroupListResultPreparer(ctx context.Context) (*http.Request, error) { 986 if !dhglr.hasNextLink() { 987 return nil, nil 988 } 989 return autorest.Prepare((&http.Request{}).WithContext(ctx), 990 autorest.AsJSON(), 991 autorest.AsGet(), 992 autorest.WithBaseURL(to.String(dhglr.NextLink))) 993} 994 995// DedicatedHostGroupListResultPage contains a page of DedicatedHostGroup values. 996type DedicatedHostGroupListResultPage struct { 997 fn func(context.Context, DedicatedHostGroupListResult) (DedicatedHostGroupListResult, error) 998 dhglr DedicatedHostGroupListResult 999} 1000 1001// NextWithContext advances to the next page of values. If there was an error making 1002// the request the page does not advance and the error is returned. 1003func (page *DedicatedHostGroupListResultPage) NextWithContext(ctx context.Context) (err error) { 1004 if tracing.IsEnabled() { 1005 ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupListResultPage.NextWithContext") 1006 defer func() { 1007 sc := -1 1008 if page.Response().Response.Response != nil { 1009 sc = page.Response().Response.Response.StatusCode 1010 } 1011 tracing.EndSpan(ctx, sc, err) 1012 }() 1013 } 1014 for { 1015 next, err := page.fn(ctx, page.dhglr) 1016 if err != nil { 1017 return err 1018 } 1019 page.dhglr = next 1020 if !next.hasNextLink() || !next.IsEmpty() { 1021 break 1022 } 1023 } 1024 return nil 1025} 1026 1027// Next advances to the next page of values. If there was an error making 1028// the request the page does not advance and the error is returned. 1029// Deprecated: Use NextWithContext() instead. 1030func (page *DedicatedHostGroupListResultPage) Next() error { 1031 return page.NextWithContext(context.Background()) 1032} 1033 1034// NotDone returns true if the page enumeration should be started or is not yet complete. 1035func (page DedicatedHostGroupListResultPage) NotDone() bool { 1036 return !page.dhglr.IsEmpty() 1037} 1038 1039// Response returns the raw server response from the last page request. 1040func (page DedicatedHostGroupListResultPage) Response() DedicatedHostGroupListResult { 1041 return page.dhglr 1042} 1043 1044// Values returns the slice of values for the current page or nil if there are no values. 1045func (page DedicatedHostGroupListResultPage) Values() []DedicatedHostGroup { 1046 if page.dhglr.IsEmpty() { 1047 return nil 1048 } 1049 return *page.dhglr.Value 1050} 1051 1052// Creates a new instance of the DedicatedHostGroupListResultPage type. 1053func NewDedicatedHostGroupListResultPage(cur DedicatedHostGroupListResult, getNextPage func(context.Context, DedicatedHostGroupListResult) (DedicatedHostGroupListResult, error)) DedicatedHostGroupListResultPage { 1054 return DedicatedHostGroupListResultPage{ 1055 fn: getNextPage, 1056 dhglr: cur, 1057 } 1058} 1059 1060// DedicatedHostGroupProperties dedicated Host Group Properties. 1061type DedicatedHostGroupProperties struct { 1062 // PlatformFaultDomainCount - Number of fault domains that the host group can span. 1063 PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` 1064 // Hosts - READ-ONLY; A list of references to all dedicated hosts in the dedicated host group. 1065 Hosts *[]SubResourceReadOnly `json:"hosts,omitempty"` 1066 // InstanceView - READ-ONLY; The dedicated host group instance view, which has the list of instance view of the dedicated hosts under the dedicated host group. 1067 InstanceView *DedicatedHostGroupInstanceView `json:"instanceView,omitempty"` 1068 // SupportAutomaticPlacement - Specifies whether virtual machines or virtual machine scale sets can be placed automatically on the dedicated host group. Automatic placement means resources are allocated on dedicated hosts, that are chosen by Azure, under the dedicated host group. The value is defaulted to 'false' when not provided. <br><br>Minimum api-version: 2020-06-01. 1069 SupportAutomaticPlacement *bool `json:"supportAutomaticPlacement,omitempty"` 1070} 1071 1072// MarshalJSON is the custom marshaler for DedicatedHostGroupProperties. 1073func (dhgp DedicatedHostGroupProperties) MarshalJSON() ([]byte, error) { 1074 objectMap := make(map[string]interface{}) 1075 if dhgp.PlatformFaultDomainCount != nil { 1076 objectMap["platformFaultDomainCount"] = dhgp.PlatformFaultDomainCount 1077 } 1078 if dhgp.SupportAutomaticPlacement != nil { 1079 objectMap["supportAutomaticPlacement"] = dhgp.SupportAutomaticPlacement 1080 } 1081 return json.Marshal(objectMap) 1082} 1083 1084// DedicatedHostGroupUpdate specifies information about the dedicated host group that the dedicated host 1085// should be assigned to. Only tags may be updated. 1086type DedicatedHostGroupUpdate struct { 1087 *DedicatedHostGroupProperties `json:"properties,omitempty"` 1088 // Zones - Availability Zone to use for this host group. Only single zone is supported. The zone can be assigned only during creation. If not provided, the group supports all zones in the region. If provided, enforces each host in the group to be in the same zone. 1089 Zones *[]string `json:"zones,omitempty"` 1090 // Tags - Resource tags 1091 Tags map[string]*string `json:"tags"` 1092} 1093 1094// MarshalJSON is the custom marshaler for DedicatedHostGroupUpdate. 1095func (dhgu DedicatedHostGroupUpdate) MarshalJSON() ([]byte, error) { 1096 objectMap := make(map[string]interface{}) 1097 if dhgu.DedicatedHostGroupProperties != nil { 1098 objectMap["properties"] = dhgu.DedicatedHostGroupProperties 1099 } 1100 if dhgu.Zones != nil { 1101 objectMap["zones"] = dhgu.Zones 1102 } 1103 if dhgu.Tags != nil { 1104 objectMap["tags"] = dhgu.Tags 1105 } 1106 return json.Marshal(objectMap) 1107} 1108 1109// UnmarshalJSON is the custom unmarshaler for DedicatedHostGroupUpdate struct. 1110func (dhgu *DedicatedHostGroupUpdate) UnmarshalJSON(body []byte) error { 1111 var m map[string]*json.RawMessage 1112 err := json.Unmarshal(body, &m) 1113 if err != nil { 1114 return err 1115 } 1116 for k, v := range m { 1117 switch k { 1118 case "properties": 1119 if v != nil { 1120 var dedicatedHostGroupProperties DedicatedHostGroupProperties 1121 err = json.Unmarshal(*v, &dedicatedHostGroupProperties) 1122 if err != nil { 1123 return err 1124 } 1125 dhgu.DedicatedHostGroupProperties = &dedicatedHostGroupProperties 1126 } 1127 case "zones": 1128 if v != nil { 1129 var zones []string 1130 err = json.Unmarshal(*v, &zones) 1131 if err != nil { 1132 return err 1133 } 1134 dhgu.Zones = &zones 1135 } 1136 case "tags": 1137 if v != nil { 1138 var tags map[string]*string 1139 err = json.Unmarshal(*v, &tags) 1140 if err != nil { 1141 return err 1142 } 1143 dhgu.Tags = tags 1144 } 1145 } 1146 } 1147 1148 return nil 1149} 1150 1151// DedicatedHostInstanceView the instance view of a dedicated host. 1152type DedicatedHostInstanceView struct { 1153 // AssetID - READ-ONLY; Specifies the unique id of the dedicated physical machine on which the dedicated host resides. 1154 AssetID *string `json:"assetId,omitempty"` 1155 // AvailableCapacity - Unutilized capacity of the dedicated host. 1156 AvailableCapacity *DedicatedHostAvailableCapacity `json:"availableCapacity,omitempty"` 1157 // Statuses - The resource status information. 1158 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 1159} 1160 1161// MarshalJSON is the custom marshaler for DedicatedHostInstanceView. 1162func (dhiv DedicatedHostInstanceView) MarshalJSON() ([]byte, error) { 1163 objectMap := make(map[string]interface{}) 1164 if dhiv.AvailableCapacity != nil { 1165 objectMap["availableCapacity"] = dhiv.AvailableCapacity 1166 } 1167 if dhiv.Statuses != nil { 1168 objectMap["statuses"] = dhiv.Statuses 1169 } 1170 return json.Marshal(objectMap) 1171} 1172 1173// DedicatedHostInstanceViewWithName the instance view of a dedicated host that includes the name of the 1174// dedicated host. It is used for the response to the instance view of a dedicated host group. 1175type DedicatedHostInstanceViewWithName struct { 1176 // Name - READ-ONLY; The name of the dedicated host. 1177 Name *string `json:"name,omitempty"` 1178 // AssetID - READ-ONLY; Specifies the unique id of the dedicated physical machine on which the dedicated host resides. 1179 AssetID *string `json:"assetId,omitempty"` 1180 // AvailableCapacity - Unutilized capacity of the dedicated host. 1181 AvailableCapacity *DedicatedHostAvailableCapacity `json:"availableCapacity,omitempty"` 1182 // Statuses - The resource status information. 1183 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 1184} 1185 1186// MarshalJSON is the custom marshaler for DedicatedHostInstanceViewWithName. 1187func (dhivwn DedicatedHostInstanceViewWithName) MarshalJSON() ([]byte, error) { 1188 objectMap := make(map[string]interface{}) 1189 if dhivwn.AvailableCapacity != nil { 1190 objectMap["availableCapacity"] = dhivwn.AvailableCapacity 1191 } 1192 if dhivwn.Statuses != nil { 1193 objectMap["statuses"] = dhivwn.Statuses 1194 } 1195 return json.Marshal(objectMap) 1196} 1197 1198// DedicatedHostListResult the list dedicated host operation response. 1199type DedicatedHostListResult struct { 1200 autorest.Response `json:"-"` 1201 // Value - The list of dedicated hosts 1202 Value *[]DedicatedHost `json:"value,omitempty"` 1203 // NextLink - The URI to fetch the next page of dedicated hosts. Call ListNext() with this URI to fetch the next page of dedicated hosts. 1204 NextLink *string `json:"nextLink,omitempty"` 1205} 1206 1207// DedicatedHostListResultIterator provides access to a complete listing of DedicatedHost values. 1208type DedicatedHostListResultIterator struct { 1209 i int 1210 page DedicatedHostListResultPage 1211} 1212 1213// NextWithContext advances to the next value. If there was an error making 1214// the request the iterator does not advance and the error is returned. 1215func (iter *DedicatedHostListResultIterator) NextWithContext(ctx context.Context) (err error) { 1216 if tracing.IsEnabled() { 1217 ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostListResultIterator.NextWithContext") 1218 defer func() { 1219 sc := -1 1220 if iter.Response().Response.Response != nil { 1221 sc = iter.Response().Response.Response.StatusCode 1222 } 1223 tracing.EndSpan(ctx, sc, err) 1224 }() 1225 } 1226 iter.i++ 1227 if iter.i < len(iter.page.Values()) { 1228 return nil 1229 } 1230 err = iter.page.NextWithContext(ctx) 1231 if err != nil { 1232 iter.i-- 1233 return err 1234 } 1235 iter.i = 0 1236 return nil 1237} 1238 1239// Next advances to the next value. If there was an error making 1240// the request the iterator does not advance and the error is returned. 1241// Deprecated: Use NextWithContext() instead. 1242func (iter *DedicatedHostListResultIterator) Next() error { 1243 return iter.NextWithContext(context.Background()) 1244} 1245 1246// NotDone returns true if the enumeration should be started or is not yet complete. 1247func (iter DedicatedHostListResultIterator) NotDone() bool { 1248 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1249} 1250 1251// Response returns the raw server response from the last page request. 1252func (iter DedicatedHostListResultIterator) Response() DedicatedHostListResult { 1253 return iter.page.Response() 1254} 1255 1256// Value returns the current value or a zero-initialized value if the 1257// iterator has advanced beyond the end of the collection. 1258func (iter DedicatedHostListResultIterator) Value() DedicatedHost { 1259 if !iter.page.NotDone() { 1260 return DedicatedHost{} 1261 } 1262 return iter.page.Values()[iter.i] 1263} 1264 1265// Creates a new instance of the DedicatedHostListResultIterator type. 1266func NewDedicatedHostListResultIterator(page DedicatedHostListResultPage) DedicatedHostListResultIterator { 1267 return DedicatedHostListResultIterator{page: page} 1268} 1269 1270// IsEmpty returns true if the ListResult contains no values. 1271func (dhlr DedicatedHostListResult) IsEmpty() bool { 1272 return dhlr.Value == nil || len(*dhlr.Value) == 0 1273} 1274 1275// hasNextLink returns true if the NextLink is not empty. 1276func (dhlr DedicatedHostListResult) hasNextLink() bool { 1277 return dhlr.NextLink != nil && len(*dhlr.NextLink) != 0 1278} 1279 1280// dedicatedHostListResultPreparer prepares a request to retrieve the next set of results. 1281// It returns nil if no more results exist. 1282func (dhlr DedicatedHostListResult) dedicatedHostListResultPreparer(ctx context.Context) (*http.Request, error) { 1283 if !dhlr.hasNextLink() { 1284 return nil, nil 1285 } 1286 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1287 autorest.AsJSON(), 1288 autorest.AsGet(), 1289 autorest.WithBaseURL(to.String(dhlr.NextLink))) 1290} 1291 1292// DedicatedHostListResultPage contains a page of DedicatedHost values. 1293type DedicatedHostListResultPage struct { 1294 fn func(context.Context, DedicatedHostListResult) (DedicatedHostListResult, error) 1295 dhlr DedicatedHostListResult 1296} 1297 1298// NextWithContext advances to the next page of values. If there was an error making 1299// the request the page does not advance and the error is returned. 1300func (page *DedicatedHostListResultPage) NextWithContext(ctx context.Context) (err error) { 1301 if tracing.IsEnabled() { 1302 ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostListResultPage.NextWithContext") 1303 defer func() { 1304 sc := -1 1305 if page.Response().Response.Response != nil { 1306 sc = page.Response().Response.Response.StatusCode 1307 } 1308 tracing.EndSpan(ctx, sc, err) 1309 }() 1310 } 1311 for { 1312 next, err := page.fn(ctx, page.dhlr) 1313 if err != nil { 1314 return err 1315 } 1316 page.dhlr = next 1317 if !next.hasNextLink() || !next.IsEmpty() { 1318 break 1319 } 1320 } 1321 return nil 1322} 1323 1324// Next advances to the next page of values. If there was an error making 1325// the request the page does not advance and the error is returned. 1326// Deprecated: Use NextWithContext() instead. 1327func (page *DedicatedHostListResultPage) Next() error { 1328 return page.NextWithContext(context.Background()) 1329} 1330 1331// NotDone returns true if the page enumeration should be started or is not yet complete. 1332func (page DedicatedHostListResultPage) NotDone() bool { 1333 return !page.dhlr.IsEmpty() 1334} 1335 1336// Response returns the raw server response from the last page request. 1337func (page DedicatedHostListResultPage) Response() DedicatedHostListResult { 1338 return page.dhlr 1339} 1340 1341// Values returns the slice of values for the current page or nil if there are no values. 1342func (page DedicatedHostListResultPage) Values() []DedicatedHost { 1343 if page.dhlr.IsEmpty() { 1344 return nil 1345 } 1346 return *page.dhlr.Value 1347} 1348 1349// Creates a new instance of the DedicatedHostListResultPage type. 1350func NewDedicatedHostListResultPage(cur DedicatedHostListResult, getNextPage func(context.Context, DedicatedHostListResult) (DedicatedHostListResult, error)) DedicatedHostListResultPage { 1351 return DedicatedHostListResultPage{ 1352 fn: getNextPage, 1353 dhlr: cur, 1354 } 1355} 1356 1357// DedicatedHostProperties properties of the dedicated host. 1358type DedicatedHostProperties struct { 1359 // PlatformFaultDomain - Fault domain of the dedicated host within a dedicated host group. 1360 PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` 1361 // AutoReplaceOnFailure - Specifies whether the dedicated host should be replaced automatically in case of a failure. The value is defaulted to 'true' when not provided. 1362 AutoReplaceOnFailure *bool `json:"autoReplaceOnFailure,omitempty"` 1363 // HostID - READ-ONLY; A unique id generated and assigned to the dedicated host by the platform. <br><br> Does not change throughout the lifetime of the host. 1364 HostID *string `json:"hostId,omitempty"` 1365 // VirtualMachines - READ-ONLY; A list of references to all virtual machines in the Dedicated Host. 1366 VirtualMachines *[]SubResourceReadOnly `json:"virtualMachines,omitempty"` 1367 // LicenseType - Specifies the software license type that will be applied to the VMs deployed on the dedicated host. <br><br> Possible values are: <br><br> **None** <br><br> **Windows_Server_Hybrid** <br><br> **Windows_Server_Perpetual** <br><br> Default: **None**. Possible values include: 'DedicatedHostLicenseTypesNone', 'DedicatedHostLicenseTypesWindowsServerHybrid', 'DedicatedHostLicenseTypesWindowsServerPerpetual' 1368 LicenseType DedicatedHostLicenseTypes `json:"licenseType,omitempty"` 1369 // ProvisioningTime - READ-ONLY; The date when the host was first provisioned. 1370 ProvisioningTime *date.Time `json:"provisioningTime,omitempty"` 1371 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 1372 ProvisioningState *string `json:"provisioningState,omitempty"` 1373 // InstanceView - READ-ONLY; The dedicated host instance view. 1374 InstanceView *DedicatedHostInstanceView `json:"instanceView,omitempty"` 1375} 1376 1377// MarshalJSON is the custom marshaler for DedicatedHostProperties. 1378func (dhp DedicatedHostProperties) MarshalJSON() ([]byte, error) { 1379 objectMap := make(map[string]interface{}) 1380 if dhp.PlatformFaultDomain != nil { 1381 objectMap["platformFaultDomain"] = dhp.PlatformFaultDomain 1382 } 1383 if dhp.AutoReplaceOnFailure != nil { 1384 objectMap["autoReplaceOnFailure"] = dhp.AutoReplaceOnFailure 1385 } 1386 if dhp.LicenseType != "" { 1387 objectMap["licenseType"] = dhp.LicenseType 1388 } 1389 return json.Marshal(objectMap) 1390} 1391 1392// DedicatedHostsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 1393// long-running operation. 1394type DedicatedHostsCreateOrUpdateFuture struct { 1395 azure.FutureAPI 1396 // Result returns the result of the asynchronous operation. 1397 // If the operation has not completed it will return an error. 1398 Result func(DedicatedHostsClient) (DedicatedHost, error) 1399} 1400 1401// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1402func (future *DedicatedHostsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 1403 var azFuture azure.Future 1404 if err := json.Unmarshal(body, &azFuture); err != nil { 1405 return err 1406 } 1407 future.FutureAPI = &azFuture 1408 future.Result = future.result 1409 return nil 1410} 1411 1412// result is the default implementation for DedicatedHostsCreateOrUpdateFuture.Result. 1413func (future *DedicatedHostsCreateOrUpdateFuture) result(client DedicatedHostsClient) (dh DedicatedHost, err error) { 1414 var done bool 1415 done, err = future.DoneWithContext(context.Background(), client) 1416 if err != nil { 1417 err = autorest.NewErrorWithError(err, "compute.DedicatedHostsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 1418 return 1419 } 1420 if !done { 1421 err = azure.NewAsyncOpIncompleteError("compute.DedicatedHostsCreateOrUpdateFuture") 1422 return 1423 } 1424 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1425 if dh.Response.Response, err = future.GetResult(sender); err == nil && dh.Response.Response.StatusCode != http.StatusNoContent { 1426 dh, err = client.CreateOrUpdateResponder(dh.Response.Response) 1427 if err != nil { 1428 err = autorest.NewErrorWithError(err, "compute.DedicatedHostsCreateOrUpdateFuture", "Result", dh.Response.Response, "Failure responding to request") 1429 } 1430 } 1431 return 1432} 1433 1434// DedicatedHostsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 1435// operation. 1436type DedicatedHostsDeleteFuture struct { 1437 azure.FutureAPI 1438 // Result returns the result of the asynchronous operation. 1439 // If the operation has not completed it will return an error. 1440 Result func(DedicatedHostsClient) (autorest.Response, error) 1441} 1442 1443// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1444func (future *DedicatedHostsDeleteFuture) UnmarshalJSON(body []byte) error { 1445 var azFuture azure.Future 1446 if err := json.Unmarshal(body, &azFuture); err != nil { 1447 return err 1448 } 1449 future.FutureAPI = &azFuture 1450 future.Result = future.result 1451 return nil 1452} 1453 1454// result is the default implementation for DedicatedHostsDeleteFuture.Result. 1455func (future *DedicatedHostsDeleteFuture) result(client DedicatedHostsClient) (ar autorest.Response, err error) { 1456 var done bool 1457 done, err = future.DoneWithContext(context.Background(), client) 1458 if err != nil { 1459 err = autorest.NewErrorWithError(err, "compute.DedicatedHostsDeleteFuture", "Result", future.Response(), "Polling failure") 1460 return 1461 } 1462 if !done { 1463 err = azure.NewAsyncOpIncompleteError("compute.DedicatedHostsDeleteFuture") 1464 return 1465 } 1466 ar.Response = future.Response() 1467 return 1468} 1469 1470// DedicatedHostsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 1471// operation. 1472type DedicatedHostsUpdateFuture struct { 1473 azure.FutureAPI 1474 // Result returns the result of the asynchronous operation. 1475 // If the operation has not completed it will return an error. 1476 Result func(DedicatedHostsClient) (DedicatedHost, error) 1477} 1478 1479// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1480func (future *DedicatedHostsUpdateFuture) UnmarshalJSON(body []byte) error { 1481 var azFuture azure.Future 1482 if err := json.Unmarshal(body, &azFuture); err != nil { 1483 return err 1484 } 1485 future.FutureAPI = &azFuture 1486 future.Result = future.result 1487 return nil 1488} 1489 1490// result is the default implementation for DedicatedHostsUpdateFuture.Result. 1491func (future *DedicatedHostsUpdateFuture) result(client DedicatedHostsClient) (dh DedicatedHost, err error) { 1492 var done bool 1493 done, err = future.DoneWithContext(context.Background(), client) 1494 if err != nil { 1495 err = autorest.NewErrorWithError(err, "compute.DedicatedHostsUpdateFuture", "Result", future.Response(), "Polling failure") 1496 return 1497 } 1498 if !done { 1499 err = azure.NewAsyncOpIncompleteError("compute.DedicatedHostsUpdateFuture") 1500 return 1501 } 1502 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1503 if dh.Response.Response, err = future.GetResult(sender); err == nil && dh.Response.Response.StatusCode != http.StatusNoContent { 1504 dh, err = client.UpdateResponder(dh.Response.Response) 1505 if err != nil { 1506 err = autorest.NewErrorWithError(err, "compute.DedicatedHostsUpdateFuture", "Result", dh.Response.Response, "Failure responding to request") 1507 } 1508 } 1509 return 1510} 1511 1512// DedicatedHostUpdate specifies information about the dedicated host. Only tags, autoReplaceOnFailure and 1513// licenseType may be updated. 1514type DedicatedHostUpdate struct { 1515 *DedicatedHostProperties `json:"properties,omitempty"` 1516 // Tags - Resource tags 1517 Tags map[string]*string `json:"tags"` 1518} 1519 1520// MarshalJSON is the custom marshaler for DedicatedHostUpdate. 1521func (dhu DedicatedHostUpdate) MarshalJSON() ([]byte, error) { 1522 objectMap := make(map[string]interface{}) 1523 if dhu.DedicatedHostProperties != nil { 1524 objectMap["properties"] = dhu.DedicatedHostProperties 1525 } 1526 if dhu.Tags != nil { 1527 objectMap["tags"] = dhu.Tags 1528 } 1529 return json.Marshal(objectMap) 1530} 1531 1532// UnmarshalJSON is the custom unmarshaler for DedicatedHostUpdate struct. 1533func (dhu *DedicatedHostUpdate) UnmarshalJSON(body []byte) error { 1534 var m map[string]*json.RawMessage 1535 err := json.Unmarshal(body, &m) 1536 if err != nil { 1537 return err 1538 } 1539 for k, v := range m { 1540 switch k { 1541 case "properties": 1542 if v != nil { 1543 var dedicatedHostProperties DedicatedHostProperties 1544 err = json.Unmarshal(*v, &dedicatedHostProperties) 1545 if err != nil { 1546 return err 1547 } 1548 dhu.DedicatedHostProperties = &dedicatedHostProperties 1549 } 1550 case "tags": 1551 if v != nil { 1552 var tags map[string]*string 1553 err = json.Unmarshal(*v, &tags) 1554 if err != nil { 1555 return err 1556 } 1557 dhu.Tags = tags 1558 } 1559 } 1560 } 1561 1562 return nil 1563} 1564 1565// DiagnosticsProfile specifies the boot diagnostic settings state. <br><br>Minimum api-version: 1566// 2015-06-15. 1567type DiagnosticsProfile struct { 1568 // 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. 1569 BootDiagnostics *BootDiagnostics `json:"bootDiagnostics,omitempty"` 1570} 1571 1572// DiffDiskSettings describes the parameters of ephemeral disk settings that can be specified for operating 1573// system disk. <br><br> NOTE: The ephemeral disk settings can only be specified for managed disk. 1574type DiffDiskSettings struct { 1575 // Option - Specifies the ephemeral disk settings for operating system disk. Possible values include: 'Local' 1576 Option DiffDiskOptions `json:"option,omitempty"` 1577 // Placement - Specifies the ephemeral disk placement for operating system disk.<br><br> Possible values are: <br><br> **CacheDisk** <br><br> **ResourceDisk** <br><br> Default: **CacheDisk** if one is configured for the VM size otherwise **ResourceDisk** is used.<br><br> Refer to VM size documentation for Windows VM at https://docs.microsoft.com/en-us/azure/virtual-machines/windows/sizes and Linux VM at https://docs.microsoft.com/en-us/azure/virtual-machines/linux/sizes to check which VM sizes exposes a cache disk. Possible values include: 'CacheDisk', 'ResourceDisk' 1578 Placement DiffDiskPlacement `json:"placement,omitempty"` 1579} 1580 1581// DisallowedConfiguration specifies the disallowed configuration for a virtual machine image. 1582type DisallowedConfiguration struct { 1583 // VMDiskType - VM disk types which are disallowed. Possible values include: 'VMDiskTypesNone', 'VMDiskTypesUnmanaged' 1584 VMDiskType VMDiskTypes `json:"vmDiskType,omitempty"` 1585} 1586 1587// Disk disk resource. 1588type Disk struct { 1589 autorest.Response `json:"-"` 1590 // ManagedBy - READ-ONLY; A relative URI containing the ID of the VM that has the disk attached. 1591 ManagedBy *string `json:"managedBy,omitempty"` 1592 Sku *DiskSku `json:"sku,omitempty"` 1593 // Zones - The Logical zone list for Disk. 1594 Zones *[]string `json:"zones,omitempty"` 1595 *DiskProperties `json:"properties,omitempty"` 1596 // ID - READ-ONLY; Resource Id 1597 ID *string `json:"id,omitempty"` 1598 // Name - READ-ONLY; Resource name 1599 Name *string `json:"name,omitempty"` 1600 // Type - READ-ONLY; Resource type 1601 Type *string `json:"type,omitempty"` 1602 // Location - Resource location 1603 Location *string `json:"location,omitempty"` 1604 // Tags - Resource tags 1605 Tags map[string]*string `json:"tags"` 1606} 1607 1608// MarshalJSON is the custom marshaler for Disk. 1609func (d Disk) MarshalJSON() ([]byte, error) { 1610 objectMap := make(map[string]interface{}) 1611 if d.Sku != nil { 1612 objectMap["sku"] = d.Sku 1613 } 1614 if d.Zones != nil { 1615 objectMap["zones"] = d.Zones 1616 } 1617 if d.DiskProperties != nil { 1618 objectMap["properties"] = d.DiskProperties 1619 } 1620 if d.Location != nil { 1621 objectMap["location"] = d.Location 1622 } 1623 if d.Tags != nil { 1624 objectMap["tags"] = d.Tags 1625 } 1626 return json.Marshal(objectMap) 1627} 1628 1629// UnmarshalJSON is the custom unmarshaler for Disk struct. 1630func (d *Disk) UnmarshalJSON(body []byte) error { 1631 var m map[string]*json.RawMessage 1632 err := json.Unmarshal(body, &m) 1633 if err != nil { 1634 return err 1635 } 1636 for k, v := range m { 1637 switch k { 1638 case "managedBy": 1639 if v != nil { 1640 var managedBy string 1641 err = json.Unmarshal(*v, &managedBy) 1642 if err != nil { 1643 return err 1644 } 1645 d.ManagedBy = &managedBy 1646 } 1647 case "sku": 1648 if v != nil { 1649 var sku DiskSku 1650 err = json.Unmarshal(*v, &sku) 1651 if err != nil { 1652 return err 1653 } 1654 d.Sku = &sku 1655 } 1656 case "zones": 1657 if v != nil { 1658 var zones []string 1659 err = json.Unmarshal(*v, &zones) 1660 if err != nil { 1661 return err 1662 } 1663 d.Zones = &zones 1664 } 1665 case "properties": 1666 if v != nil { 1667 var diskProperties DiskProperties 1668 err = json.Unmarshal(*v, &diskProperties) 1669 if err != nil { 1670 return err 1671 } 1672 d.DiskProperties = &diskProperties 1673 } 1674 case "id": 1675 if v != nil { 1676 var ID string 1677 err = json.Unmarshal(*v, &ID) 1678 if err != nil { 1679 return err 1680 } 1681 d.ID = &ID 1682 } 1683 case "name": 1684 if v != nil { 1685 var name string 1686 err = json.Unmarshal(*v, &name) 1687 if err != nil { 1688 return err 1689 } 1690 d.Name = &name 1691 } 1692 case "type": 1693 if v != nil { 1694 var typeVar string 1695 err = json.Unmarshal(*v, &typeVar) 1696 if err != nil { 1697 return err 1698 } 1699 d.Type = &typeVar 1700 } 1701 case "location": 1702 if v != nil { 1703 var location string 1704 err = json.Unmarshal(*v, &location) 1705 if err != nil { 1706 return err 1707 } 1708 d.Location = &location 1709 } 1710 case "tags": 1711 if v != nil { 1712 var tags map[string]*string 1713 err = json.Unmarshal(*v, &tags) 1714 if err != nil { 1715 return err 1716 } 1717 d.Tags = tags 1718 } 1719 } 1720 } 1721 1722 return nil 1723} 1724 1725// DiskEncryptionSet disk encryption set resource. 1726type DiskEncryptionSet struct { 1727 autorest.Response `json:"-"` 1728 Identity *EncryptionSetIdentity `json:"identity,omitempty"` 1729 *EncryptionSetProperties `json:"properties,omitempty"` 1730 // ID - READ-ONLY; Resource Id 1731 ID *string `json:"id,omitempty"` 1732 // Name - READ-ONLY; Resource name 1733 Name *string `json:"name,omitempty"` 1734 // Type - READ-ONLY; Resource type 1735 Type *string `json:"type,omitempty"` 1736 // Location - Resource location 1737 Location *string `json:"location,omitempty"` 1738 // Tags - Resource tags 1739 Tags map[string]*string `json:"tags"` 1740} 1741 1742// MarshalJSON is the custom marshaler for DiskEncryptionSet. 1743func (desVar DiskEncryptionSet) MarshalJSON() ([]byte, error) { 1744 objectMap := make(map[string]interface{}) 1745 if desVar.Identity != nil { 1746 objectMap["identity"] = desVar.Identity 1747 } 1748 if desVar.EncryptionSetProperties != nil { 1749 objectMap["properties"] = desVar.EncryptionSetProperties 1750 } 1751 if desVar.Location != nil { 1752 objectMap["location"] = desVar.Location 1753 } 1754 if desVar.Tags != nil { 1755 objectMap["tags"] = desVar.Tags 1756 } 1757 return json.Marshal(objectMap) 1758} 1759 1760// UnmarshalJSON is the custom unmarshaler for DiskEncryptionSet struct. 1761func (desVar *DiskEncryptionSet) UnmarshalJSON(body []byte) error { 1762 var m map[string]*json.RawMessage 1763 err := json.Unmarshal(body, &m) 1764 if err != nil { 1765 return err 1766 } 1767 for k, v := range m { 1768 switch k { 1769 case "identity": 1770 if v != nil { 1771 var identity EncryptionSetIdentity 1772 err = json.Unmarshal(*v, &identity) 1773 if err != nil { 1774 return err 1775 } 1776 desVar.Identity = &identity 1777 } 1778 case "properties": 1779 if v != nil { 1780 var encryptionSetProperties EncryptionSetProperties 1781 err = json.Unmarshal(*v, &encryptionSetProperties) 1782 if err != nil { 1783 return err 1784 } 1785 desVar.EncryptionSetProperties = &encryptionSetProperties 1786 } 1787 case "id": 1788 if v != nil { 1789 var ID string 1790 err = json.Unmarshal(*v, &ID) 1791 if err != nil { 1792 return err 1793 } 1794 desVar.ID = &ID 1795 } 1796 case "name": 1797 if v != nil { 1798 var name string 1799 err = json.Unmarshal(*v, &name) 1800 if err != nil { 1801 return err 1802 } 1803 desVar.Name = &name 1804 } 1805 case "type": 1806 if v != nil { 1807 var typeVar string 1808 err = json.Unmarshal(*v, &typeVar) 1809 if err != nil { 1810 return err 1811 } 1812 desVar.Type = &typeVar 1813 } 1814 case "location": 1815 if v != nil { 1816 var location string 1817 err = json.Unmarshal(*v, &location) 1818 if err != nil { 1819 return err 1820 } 1821 desVar.Location = &location 1822 } 1823 case "tags": 1824 if v != nil { 1825 var tags map[string]*string 1826 err = json.Unmarshal(*v, &tags) 1827 if err != nil { 1828 return err 1829 } 1830 desVar.Tags = tags 1831 } 1832 } 1833 } 1834 1835 return nil 1836} 1837 1838// DiskEncryptionSetList the List disk encryption set operation response. 1839type DiskEncryptionSetList struct { 1840 autorest.Response `json:"-"` 1841 // Value - A list of disk encryption sets. 1842 Value *[]DiskEncryptionSet `json:"value,omitempty"` 1843 // NextLink - The uri to fetch the next page of disk encryption sets. Call ListNext() with this to fetch the next page of disk encryption sets. 1844 NextLink *string `json:"nextLink,omitempty"` 1845} 1846 1847// DiskEncryptionSetListIterator provides access to a complete listing of DiskEncryptionSet values. 1848type DiskEncryptionSetListIterator struct { 1849 i int 1850 page DiskEncryptionSetListPage 1851} 1852 1853// NextWithContext advances to the next value. If there was an error making 1854// the request the iterator does not advance and the error is returned. 1855func (iter *DiskEncryptionSetListIterator) NextWithContext(ctx context.Context) (err error) { 1856 if tracing.IsEnabled() { 1857 ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetListIterator.NextWithContext") 1858 defer func() { 1859 sc := -1 1860 if iter.Response().Response.Response != nil { 1861 sc = iter.Response().Response.Response.StatusCode 1862 } 1863 tracing.EndSpan(ctx, sc, err) 1864 }() 1865 } 1866 iter.i++ 1867 if iter.i < len(iter.page.Values()) { 1868 return nil 1869 } 1870 err = iter.page.NextWithContext(ctx) 1871 if err != nil { 1872 iter.i-- 1873 return err 1874 } 1875 iter.i = 0 1876 return nil 1877} 1878 1879// Next advances to the next value. If there was an error making 1880// the request the iterator does not advance and the error is returned. 1881// Deprecated: Use NextWithContext() instead. 1882func (iter *DiskEncryptionSetListIterator) Next() error { 1883 return iter.NextWithContext(context.Background()) 1884} 1885 1886// NotDone returns true if the enumeration should be started or is not yet complete. 1887func (iter DiskEncryptionSetListIterator) NotDone() bool { 1888 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1889} 1890 1891// Response returns the raw server response from the last page request. 1892func (iter DiskEncryptionSetListIterator) Response() DiskEncryptionSetList { 1893 return iter.page.Response() 1894} 1895 1896// Value returns the current value or a zero-initialized value if the 1897// iterator has advanced beyond the end of the collection. 1898func (iter DiskEncryptionSetListIterator) Value() DiskEncryptionSet { 1899 if !iter.page.NotDone() { 1900 return DiskEncryptionSet{} 1901 } 1902 return iter.page.Values()[iter.i] 1903} 1904 1905// Creates a new instance of the DiskEncryptionSetListIterator type. 1906func NewDiskEncryptionSetListIterator(page DiskEncryptionSetListPage) DiskEncryptionSetListIterator { 1907 return DiskEncryptionSetListIterator{page: page} 1908} 1909 1910// IsEmpty returns true if the ListResult contains no values. 1911func (desl DiskEncryptionSetList) IsEmpty() bool { 1912 return desl.Value == nil || len(*desl.Value) == 0 1913} 1914 1915// hasNextLink returns true if the NextLink is not empty. 1916func (desl DiskEncryptionSetList) hasNextLink() bool { 1917 return desl.NextLink != nil && len(*desl.NextLink) != 0 1918} 1919 1920// diskEncryptionSetListPreparer prepares a request to retrieve the next set of results. 1921// It returns nil if no more results exist. 1922func (desl DiskEncryptionSetList) diskEncryptionSetListPreparer(ctx context.Context) (*http.Request, error) { 1923 if !desl.hasNextLink() { 1924 return nil, nil 1925 } 1926 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1927 autorest.AsJSON(), 1928 autorest.AsGet(), 1929 autorest.WithBaseURL(to.String(desl.NextLink))) 1930} 1931 1932// DiskEncryptionSetListPage contains a page of DiskEncryptionSet values. 1933type DiskEncryptionSetListPage struct { 1934 fn func(context.Context, DiskEncryptionSetList) (DiskEncryptionSetList, error) 1935 desl DiskEncryptionSetList 1936} 1937 1938// NextWithContext advances to the next page of values. If there was an error making 1939// the request the page does not advance and the error is returned. 1940func (page *DiskEncryptionSetListPage) NextWithContext(ctx context.Context) (err error) { 1941 if tracing.IsEnabled() { 1942 ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetListPage.NextWithContext") 1943 defer func() { 1944 sc := -1 1945 if page.Response().Response.Response != nil { 1946 sc = page.Response().Response.Response.StatusCode 1947 } 1948 tracing.EndSpan(ctx, sc, err) 1949 }() 1950 } 1951 for { 1952 next, err := page.fn(ctx, page.desl) 1953 if err != nil { 1954 return err 1955 } 1956 page.desl = next 1957 if !next.hasNextLink() || !next.IsEmpty() { 1958 break 1959 } 1960 } 1961 return nil 1962} 1963 1964// Next 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. 1966// Deprecated: Use NextWithContext() instead. 1967func (page *DiskEncryptionSetListPage) Next() error { 1968 return page.NextWithContext(context.Background()) 1969} 1970 1971// NotDone returns true if the page enumeration should be started or is not yet complete. 1972func (page DiskEncryptionSetListPage) NotDone() bool { 1973 return !page.desl.IsEmpty() 1974} 1975 1976// Response returns the raw server response from the last page request. 1977func (page DiskEncryptionSetListPage) Response() DiskEncryptionSetList { 1978 return page.desl 1979} 1980 1981// Values returns the slice of values for the current page or nil if there are no values. 1982func (page DiskEncryptionSetListPage) Values() []DiskEncryptionSet { 1983 if page.desl.IsEmpty() { 1984 return nil 1985 } 1986 return *page.desl.Value 1987} 1988 1989// Creates a new instance of the DiskEncryptionSetListPage type. 1990func NewDiskEncryptionSetListPage(cur DiskEncryptionSetList, getNextPage func(context.Context, DiskEncryptionSetList) (DiskEncryptionSetList, error)) DiskEncryptionSetListPage { 1991 return DiskEncryptionSetListPage{ 1992 fn: getNextPage, 1993 desl: cur, 1994 } 1995} 1996 1997// DiskEncryptionSetParameters describes the parameter of customer managed disk encryption set resource id 1998// that can be specified for disk. <br><br> NOTE: The disk encryption set resource id can only be specified 1999// for managed disk. Please refer https://aka.ms/mdssewithcmkoverview for more details. 2000type DiskEncryptionSetParameters struct { 2001 // ID - Resource Id 2002 ID *string `json:"id,omitempty"` 2003} 2004 2005// DiskEncryptionSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 2006// long-running operation. 2007type DiskEncryptionSetsCreateOrUpdateFuture struct { 2008 azure.FutureAPI 2009 // Result returns the result of the asynchronous operation. 2010 // If the operation has not completed it will return an error. 2011 Result func(DiskEncryptionSetsClient) (DiskEncryptionSet, error) 2012} 2013 2014// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2015func (future *DiskEncryptionSetsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 2016 var azFuture azure.Future 2017 if err := json.Unmarshal(body, &azFuture); err != nil { 2018 return err 2019 } 2020 future.FutureAPI = &azFuture 2021 future.Result = future.result 2022 return nil 2023} 2024 2025// result is the default implementation for DiskEncryptionSetsCreateOrUpdateFuture.Result. 2026func (future *DiskEncryptionSetsCreateOrUpdateFuture) result(client DiskEncryptionSetsClient) (desVar DiskEncryptionSet, err error) { 2027 var done bool 2028 done, err = future.DoneWithContext(context.Background(), client) 2029 if err != nil { 2030 err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 2031 return 2032 } 2033 if !done { 2034 err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsCreateOrUpdateFuture") 2035 return 2036 } 2037 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2038 if desVar.Response.Response, err = future.GetResult(sender); err == nil && desVar.Response.Response.StatusCode != http.StatusNoContent { 2039 desVar, err = client.CreateOrUpdateResponder(desVar.Response.Response) 2040 if err != nil { 2041 err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsCreateOrUpdateFuture", "Result", desVar.Response.Response, "Failure responding to request") 2042 } 2043 } 2044 return 2045} 2046 2047// DiskEncryptionSetsDeleteFuture an abstraction for monitoring and retrieving the results of a 2048// long-running operation. 2049type DiskEncryptionSetsDeleteFuture struct { 2050 azure.FutureAPI 2051 // Result returns the result of the asynchronous operation. 2052 // If the operation has not completed it will return an error. 2053 Result func(DiskEncryptionSetsClient) (autorest.Response, error) 2054} 2055 2056// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2057func (future *DiskEncryptionSetsDeleteFuture) UnmarshalJSON(body []byte) error { 2058 var azFuture azure.Future 2059 if err := json.Unmarshal(body, &azFuture); err != nil { 2060 return err 2061 } 2062 future.FutureAPI = &azFuture 2063 future.Result = future.result 2064 return nil 2065} 2066 2067// result is the default implementation for DiskEncryptionSetsDeleteFuture.Result. 2068func (future *DiskEncryptionSetsDeleteFuture) result(client DiskEncryptionSetsClient) (ar autorest.Response, err error) { 2069 var done bool 2070 done, err = future.DoneWithContext(context.Background(), client) 2071 if err != nil { 2072 err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsDeleteFuture", "Result", future.Response(), "Polling failure") 2073 return 2074 } 2075 if !done { 2076 err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsDeleteFuture") 2077 return 2078 } 2079 ar.Response = future.Response() 2080 return 2081} 2082 2083// DiskEncryptionSetsUpdateFuture an abstraction for monitoring and retrieving the results of a 2084// long-running operation. 2085type DiskEncryptionSetsUpdateFuture struct { 2086 azure.FutureAPI 2087 // Result returns the result of the asynchronous operation. 2088 // If the operation has not completed it will return an error. 2089 Result func(DiskEncryptionSetsClient) (DiskEncryptionSet, error) 2090} 2091 2092// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2093func (future *DiskEncryptionSetsUpdateFuture) UnmarshalJSON(body []byte) error { 2094 var azFuture azure.Future 2095 if err := json.Unmarshal(body, &azFuture); err != nil { 2096 return err 2097 } 2098 future.FutureAPI = &azFuture 2099 future.Result = future.result 2100 return nil 2101} 2102 2103// result is the default implementation for DiskEncryptionSetsUpdateFuture.Result. 2104func (future *DiskEncryptionSetsUpdateFuture) result(client DiskEncryptionSetsClient) (desVar DiskEncryptionSet, err error) { 2105 var done bool 2106 done, err = future.DoneWithContext(context.Background(), client) 2107 if err != nil { 2108 err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsUpdateFuture", "Result", future.Response(), "Polling failure") 2109 return 2110 } 2111 if !done { 2112 err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsUpdateFuture") 2113 return 2114 } 2115 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2116 if desVar.Response.Response, err = future.GetResult(sender); err == nil && desVar.Response.Response.StatusCode != http.StatusNoContent { 2117 desVar, err = client.UpdateResponder(desVar.Response.Response) 2118 if err != nil { 2119 err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsUpdateFuture", "Result", desVar.Response.Response, "Failure responding to request") 2120 } 2121 } 2122 return 2123} 2124 2125// DiskEncryptionSettings describes a Encryption Settings for a Disk 2126type DiskEncryptionSettings struct { 2127 // DiskEncryptionKey - Specifies the location of the disk encryption key, which is a Key Vault Secret. 2128 DiskEncryptionKey *KeyVaultSecretReference `json:"diskEncryptionKey,omitempty"` 2129 // KeyEncryptionKey - Specifies the location of the key encryption key in Key Vault. 2130 KeyEncryptionKey *KeyVaultKeyReference `json:"keyEncryptionKey,omitempty"` 2131 // Enabled - Specifies whether disk encryption should be enabled on the virtual machine. 2132 Enabled *bool `json:"enabled,omitempty"` 2133} 2134 2135// DiskEncryptionSetUpdate disk encryption set update resource. 2136type DiskEncryptionSetUpdate struct { 2137 *DiskEncryptionSetUpdateProperties `json:"properties,omitempty"` 2138 // Tags - Resource tags 2139 Tags map[string]*string `json:"tags"` 2140} 2141 2142// MarshalJSON is the custom marshaler for DiskEncryptionSetUpdate. 2143func (desu DiskEncryptionSetUpdate) MarshalJSON() ([]byte, error) { 2144 objectMap := make(map[string]interface{}) 2145 if desu.DiskEncryptionSetUpdateProperties != nil { 2146 objectMap["properties"] = desu.DiskEncryptionSetUpdateProperties 2147 } 2148 if desu.Tags != nil { 2149 objectMap["tags"] = desu.Tags 2150 } 2151 return json.Marshal(objectMap) 2152} 2153 2154// UnmarshalJSON is the custom unmarshaler for DiskEncryptionSetUpdate struct. 2155func (desu *DiskEncryptionSetUpdate) UnmarshalJSON(body []byte) error { 2156 var m map[string]*json.RawMessage 2157 err := json.Unmarshal(body, &m) 2158 if err != nil { 2159 return err 2160 } 2161 for k, v := range m { 2162 switch k { 2163 case "properties": 2164 if v != nil { 2165 var diskEncryptionSetUpdateProperties DiskEncryptionSetUpdateProperties 2166 err = json.Unmarshal(*v, &diskEncryptionSetUpdateProperties) 2167 if err != nil { 2168 return err 2169 } 2170 desu.DiskEncryptionSetUpdateProperties = &diskEncryptionSetUpdateProperties 2171 } 2172 case "tags": 2173 if v != nil { 2174 var tags map[string]*string 2175 err = json.Unmarshal(*v, &tags) 2176 if err != nil { 2177 return err 2178 } 2179 desu.Tags = tags 2180 } 2181 } 2182 } 2183 2184 return nil 2185} 2186 2187// DiskEncryptionSetUpdateProperties disk encryption set resource update properties. 2188type DiskEncryptionSetUpdateProperties struct { 2189 ActiveKey *KeyVaultAndKeyReference `json:"activeKey,omitempty"` 2190} 2191 2192// DiskInstanceView the instance view of the disk. 2193type DiskInstanceView struct { 2194 // Name - The disk name. 2195 Name *string `json:"name,omitempty"` 2196 // EncryptionSettings - Specifies the encryption settings for the OS Disk. <br><br> Minimum api-version: 2015-06-15 2197 EncryptionSettings *[]DiskEncryptionSettings `json:"encryptionSettings,omitempty"` 2198 // Statuses - The resource status information. 2199 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 2200} 2201 2202// DiskList the List Disks operation response. 2203type DiskList struct { 2204 autorest.Response `json:"-"` 2205 // Value - A list of disks. 2206 Value *[]Disk `json:"value,omitempty"` 2207 // NextLink - The uri to fetch the next page of disks. Call ListNext() with this to fetch the next page of disks. 2208 NextLink *string `json:"nextLink,omitempty"` 2209} 2210 2211// DiskListIterator provides access to a complete listing of Disk values. 2212type DiskListIterator struct { 2213 i int 2214 page DiskListPage 2215} 2216 2217// NextWithContext advances to the next value. If there was an error making 2218// the request the iterator does not advance and the error is returned. 2219func (iter *DiskListIterator) NextWithContext(ctx context.Context) (err error) { 2220 if tracing.IsEnabled() { 2221 ctx = tracing.StartSpan(ctx, fqdn+"/DiskListIterator.NextWithContext") 2222 defer func() { 2223 sc := -1 2224 if iter.Response().Response.Response != nil { 2225 sc = iter.Response().Response.Response.StatusCode 2226 } 2227 tracing.EndSpan(ctx, sc, err) 2228 }() 2229 } 2230 iter.i++ 2231 if iter.i < len(iter.page.Values()) { 2232 return nil 2233 } 2234 err = iter.page.NextWithContext(ctx) 2235 if err != nil { 2236 iter.i-- 2237 return err 2238 } 2239 iter.i = 0 2240 return nil 2241} 2242 2243// Next advances to the next value. If there was an error making 2244// the request the iterator does not advance and the error is returned. 2245// Deprecated: Use NextWithContext() instead. 2246func (iter *DiskListIterator) Next() error { 2247 return iter.NextWithContext(context.Background()) 2248} 2249 2250// NotDone returns true if the enumeration should be started or is not yet complete. 2251func (iter DiskListIterator) NotDone() bool { 2252 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2253} 2254 2255// Response returns the raw server response from the last page request. 2256func (iter DiskListIterator) Response() DiskList { 2257 return iter.page.Response() 2258} 2259 2260// Value returns the current value or a zero-initialized value if the 2261// iterator has advanced beyond the end of the collection. 2262func (iter DiskListIterator) Value() Disk { 2263 if !iter.page.NotDone() { 2264 return Disk{} 2265 } 2266 return iter.page.Values()[iter.i] 2267} 2268 2269// Creates a new instance of the DiskListIterator type. 2270func NewDiskListIterator(page DiskListPage) DiskListIterator { 2271 return DiskListIterator{page: page} 2272} 2273 2274// IsEmpty returns true if the ListResult contains no values. 2275func (dl DiskList) IsEmpty() bool { 2276 return dl.Value == nil || len(*dl.Value) == 0 2277} 2278 2279// hasNextLink returns true if the NextLink is not empty. 2280func (dl DiskList) hasNextLink() bool { 2281 return dl.NextLink != nil && len(*dl.NextLink) != 0 2282} 2283 2284// diskListPreparer prepares a request to retrieve the next set of results. 2285// It returns nil if no more results exist. 2286func (dl DiskList) diskListPreparer(ctx context.Context) (*http.Request, error) { 2287 if !dl.hasNextLink() { 2288 return nil, nil 2289 } 2290 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2291 autorest.AsJSON(), 2292 autorest.AsGet(), 2293 autorest.WithBaseURL(to.String(dl.NextLink))) 2294} 2295 2296// DiskListPage contains a page of Disk values. 2297type DiskListPage struct { 2298 fn func(context.Context, DiskList) (DiskList, error) 2299 dl DiskList 2300} 2301 2302// NextWithContext advances to the next page of values. If there was an error making 2303// the request the page does not advance and the error is returned. 2304func (page *DiskListPage) NextWithContext(ctx context.Context) (err error) { 2305 if tracing.IsEnabled() { 2306 ctx = tracing.StartSpan(ctx, fqdn+"/DiskListPage.NextWithContext") 2307 defer func() { 2308 sc := -1 2309 if page.Response().Response.Response != nil { 2310 sc = page.Response().Response.Response.StatusCode 2311 } 2312 tracing.EndSpan(ctx, sc, err) 2313 }() 2314 } 2315 for { 2316 next, err := page.fn(ctx, page.dl) 2317 if err != nil { 2318 return err 2319 } 2320 page.dl = next 2321 if !next.hasNextLink() || !next.IsEmpty() { 2322 break 2323 } 2324 } 2325 return nil 2326} 2327 2328// Next advances to the next page of values. If there was an error making 2329// the request the page does not advance and the error is returned. 2330// Deprecated: Use NextWithContext() instead. 2331func (page *DiskListPage) Next() error { 2332 return page.NextWithContext(context.Background()) 2333} 2334 2335// NotDone returns true if the page enumeration should be started or is not yet complete. 2336func (page DiskListPage) NotDone() bool { 2337 return !page.dl.IsEmpty() 2338} 2339 2340// Response returns the raw server response from the last page request. 2341func (page DiskListPage) Response() DiskList { 2342 return page.dl 2343} 2344 2345// Values returns the slice of values for the current page or nil if there are no values. 2346func (page DiskListPage) Values() []Disk { 2347 if page.dl.IsEmpty() { 2348 return nil 2349 } 2350 return *page.dl.Value 2351} 2352 2353// Creates a new instance of the DiskListPage type. 2354func NewDiskListPage(cur DiskList, getNextPage func(context.Context, DiskList) (DiskList, error)) DiskListPage { 2355 return DiskListPage{ 2356 fn: getNextPage, 2357 dl: cur, 2358 } 2359} 2360 2361// DiskProperties disk resource properties. 2362type DiskProperties struct { 2363 // TimeCreated - READ-ONLY; The time when the disk was created. 2364 TimeCreated *date.Time `json:"timeCreated,omitempty"` 2365 // OsType - The Operating System type. Possible values include: 'Windows', 'Linux' 2366 OsType OperatingSystemTypes `json:"osType,omitempty"` 2367 // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'V1', 'V2' 2368 HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` 2369 // CreationData - Disk source information. CreationData information cannot be changed after the disk has been created. 2370 CreationData *CreationData `json:"creationData,omitempty"` 2371 // DiskSizeGB - If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. 2372 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 2373 // DiskSizeBytes - READ-ONLY; The size of the disk in bytes. This field is read only. 2374 DiskSizeBytes *int64 `json:"diskSizeBytes,omitempty"` 2375 // UniqueID - READ-ONLY; Unique Guid identifying the resource. 2376 UniqueID *string `json:"uniqueId,omitempty"` 2377 // EncryptionSettingsCollection - Encryption settings collection used for Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. 2378 EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` 2379 // ProvisioningState - READ-ONLY; The disk provisioning state. 2380 ProvisioningState *string `json:"provisioningState,omitempty"` 2381 // DiskIOPSReadWrite - The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. 2382 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 2383 // DiskMBpsReadWrite - The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. 2384 DiskMBpsReadWrite *int32 `json:"diskMBpsReadWrite,omitempty"` 2385 // DiskState - READ-ONLY; The state of the disk. Possible values include: 'Unattached', 'Attached', 'Reserved', 'ActiveSAS', 'ReadyToUpload', 'ActiveUpload' 2386 DiskState DiskState `json:"diskState,omitempty"` 2387 // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 2388 Encryption *Encryption `json:"encryption,omitempty"` 2389} 2390 2391// MarshalJSON is the custom marshaler for DiskProperties. 2392func (dp DiskProperties) MarshalJSON() ([]byte, error) { 2393 objectMap := make(map[string]interface{}) 2394 if dp.OsType != "" { 2395 objectMap["osType"] = dp.OsType 2396 } 2397 if dp.HyperVGeneration != "" { 2398 objectMap["hyperVGeneration"] = dp.HyperVGeneration 2399 } 2400 if dp.CreationData != nil { 2401 objectMap["creationData"] = dp.CreationData 2402 } 2403 if dp.DiskSizeGB != nil { 2404 objectMap["diskSizeGB"] = dp.DiskSizeGB 2405 } 2406 if dp.EncryptionSettingsCollection != nil { 2407 objectMap["encryptionSettingsCollection"] = dp.EncryptionSettingsCollection 2408 } 2409 if dp.DiskIOPSReadWrite != nil { 2410 objectMap["diskIOPSReadWrite"] = dp.DiskIOPSReadWrite 2411 } 2412 if dp.DiskMBpsReadWrite != nil { 2413 objectMap["diskMBpsReadWrite"] = dp.DiskMBpsReadWrite 2414 } 2415 if dp.Encryption != nil { 2416 objectMap["encryption"] = dp.Encryption 2417 } 2418 return json.Marshal(objectMap) 2419} 2420 2421// DisksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 2422// operation. 2423type DisksCreateOrUpdateFuture struct { 2424 azure.FutureAPI 2425 // Result returns the result of the asynchronous operation. 2426 // If the operation has not completed it will return an error. 2427 Result func(DisksClient) (Disk, error) 2428} 2429 2430// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2431func (future *DisksCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 2432 var azFuture azure.Future 2433 if err := json.Unmarshal(body, &azFuture); err != nil { 2434 return err 2435 } 2436 future.FutureAPI = &azFuture 2437 future.Result = future.result 2438 return nil 2439} 2440 2441// result is the default implementation for DisksCreateOrUpdateFuture.Result. 2442func (future *DisksCreateOrUpdateFuture) result(client DisksClient) (d Disk, err error) { 2443 var done bool 2444 done, err = future.DoneWithContext(context.Background(), client) 2445 if err != nil { 2446 err = autorest.NewErrorWithError(err, "compute.DisksCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 2447 return 2448 } 2449 if !done { 2450 err = azure.NewAsyncOpIncompleteError("compute.DisksCreateOrUpdateFuture") 2451 return 2452 } 2453 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2454 if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent { 2455 d, err = client.CreateOrUpdateResponder(d.Response.Response) 2456 if err != nil { 2457 err = autorest.NewErrorWithError(err, "compute.DisksCreateOrUpdateFuture", "Result", d.Response.Response, "Failure responding to request") 2458 } 2459 } 2460 return 2461} 2462 2463// DisksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 2464type DisksDeleteFuture struct { 2465 azure.FutureAPI 2466 // Result returns the result of the asynchronous operation. 2467 // If the operation has not completed it will return an error. 2468 Result func(DisksClient) (autorest.Response, error) 2469} 2470 2471// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2472func (future *DisksDeleteFuture) UnmarshalJSON(body []byte) error { 2473 var azFuture azure.Future 2474 if err := json.Unmarshal(body, &azFuture); err != nil { 2475 return err 2476 } 2477 future.FutureAPI = &azFuture 2478 future.Result = future.result 2479 return nil 2480} 2481 2482// result is the default implementation for DisksDeleteFuture.Result. 2483func (future *DisksDeleteFuture) result(client DisksClient) (ar autorest.Response, err error) { 2484 var done bool 2485 done, err = future.DoneWithContext(context.Background(), client) 2486 if err != nil { 2487 err = autorest.NewErrorWithError(err, "compute.DisksDeleteFuture", "Result", future.Response(), "Polling failure") 2488 return 2489 } 2490 if !done { 2491 err = azure.NewAsyncOpIncompleteError("compute.DisksDeleteFuture") 2492 return 2493 } 2494 ar.Response = future.Response() 2495 return 2496} 2497 2498// DisksGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running 2499// operation. 2500type DisksGrantAccessFuture struct { 2501 azure.FutureAPI 2502 // Result returns the result of the asynchronous operation. 2503 // If the operation has not completed it will return an error. 2504 Result func(DisksClient) (AccessURI, error) 2505} 2506 2507// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2508func (future *DisksGrantAccessFuture) UnmarshalJSON(body []byte) error { 2509 var azFuture azure.Future 2510 if err := json.Unmarshal(body, &azFuture); err != nil { 2511 return err 2512 } 2513 future.FutureAPI = &azFuture 2514 future.Result = future.result 2515 return nil 2516} 2517 2518// result is the default implementation for DisksGrantAccessFuture.Result. 2519func (future *DisksGrantAccessFuture) result(client DisksClient) (au AccessURI, err error) { 2520 var done bool 2521 done, err = future.DoneWithContext(context.Background(), client) 2522 if err != nil { 2523 err = autorest.NewErrorWithError(err, "compute.DisksGrantAccessFuture", "Result", future.Response(), "Polling failure") 2524 return 2525 } 2526 if !done { 2527 err = azure.NewAsyncOpIncompleteError("compute.DisksGrantAccessFuture") 2528 return 2529 } 2530 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2531 if au.Response.Response, err = future.GetResult(sender); err == nil && au.Response.Response.StatusCode != http.StatusNoContent { 2532 au, err = client.GrantAccessResponder(au.Response.Response) 2533 if err != nil { 2534 err = autorest.NewErrorWithError(err, "compute.DisksGrantAccessFuture", "Result", au.Response.Response, "Failure responding to request") 2535 } 2536 } 2537 return 2538} 2539 2540// DiskSku the disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, or UltraSSD_LRS. 2541type DiskSku struct { 2542 // Name - The sku name. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS', 'UltraSSDLRS' 2543 Name DiskStorageAccountTypes `json:"name,omitempty"` 2544 // Tier - READ-ONLY; The sku tier. 2545 Tier *string `json:"tier,omitempty"` 2546} 2547 2548// MarshalJSON is the custom marshaler for DiskSku. 2549func (ds DiskSku) MarshalJSON() ([]byte, error) { 2550 objectMap := make(map[string]interface{}) 2551 if ds.Name != "" { 2552 objectMap["name"] = ds.Name 2553 } 2554 return json.Marshal(objectMap) 2555} 2556 2557// DisksRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running 2558// operation. 2559type DisksRevokeAccessFuture struct { 2560 azure.FutureAPI 2561 // Result returns the result of the asynchronous operation. 2562 // If the operation has not completed it will return an error. 2563 Result func(DisksClient) (autorest.Response, error) 2564} 2565 2566// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2567func (future *DisksRevokeAccessFuture) UnmarshalJSON(body []byte) error { 2568 var azFuture azure.Future 2569 if err := json.Unmarshal(body, &azFuture); err != nil { 2570 return err 2571 } 2572 future.FutureAPI = &azFuture 2573 future.Result = future.result 2574 return nil 2575} 2576 2577// result is the default implementation for DisksRevokeAccessFuture.Result. 2578func (future *DisksRevokeAccessFuture) result(client DisksClient) (ar autorest.Response, err error) { 2579 var done bool 2580 done, err = future.DoneWithContext(context.Background(), client) 2581 if err != nil { 2582 err = autorest.NewErrorWithError(err, "compute.DisksRevokeAccessFuture", "Result", future.Response(), "Polling failure") 2583 return 2584 } 2585 if !done { 2586 err = azure.NewAsyncOpIncompleteError("compute.DisksRevokeAccessFuture") 2587 return 2588 } 2589 ar.Response = future.Response() 2590 return 2591} 2592 2593// DisksUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. 2594type DisksUpdateFuture struct { 2595 azure.FutureAPI 2596 // Result returns the result of the asynchronous operation. 2597 // If the operation has not completed it will return an error. 2598 Result func(DisksClient) (Disk, error) 2599} 2600 2601// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2602func (future *DisksUpdateFuture) UnmarshalJSON(body []byte) error { 2603 var azFuture azure.Future 2604 if err := json.Unmarshal(body, &azFuture); err != nil { 2605 return err 2606 } 2607 future.FutureAPI = &azFuture 2608 future.Result = future.result 2609 return nil 2610} 2611 2612// result is the default implementation for DisksUpdateFuture.Result. 2613func (future *DisksUpdateFuture) result(client DisksClient) (d Disk, err error) { 2614 var done bool 2615 done, err = future.DoneWithContext(context.Background(), client) 2616 if err != nil { 2617 err = autorest.NewErrorWithError(err, "compute.DisksUpdateFuture", "Result", future.Response(), "Polling failure") 2618 return 2619 } 2620 if !done { 2621 err = azure.NewAsyncOpIncompleteError("compute.DisksUpdateFuture") 2622 return 2623 } 2624 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2625 if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent { 2626 d, err = client.UpdateResponder(d.Response.Response) 2627 if err != nil { 2628 err = autorest.NewErrorWithError(err, "compute.DisksUpdateFuture", "Result", d.Response.Response, "Failure responding to request") 2629 } 2630 } 2631 return 2632} 2633 2634// DiskUpdate disk update resource. 2635type DiskUpdate struct { 2636 *DiskUpdateProperties `json:"properties,omitempty"` 2637 // Tags - Resource tags 2638 Tags map[string]*string `json:"tags"` 2639 Sku *DiskSku `json:"sku,omitempty"` 2640} 2641 2642// MarshalJSON is the custom marshaler for DiskUpdate. 2643func (du DiskUpdate) MarshalJSON() ([]byte, error) { 2644 objectMap := make(map[string]interface{}) 2645 if du.DiskUpdateProperties != nil { 2646 objectMap["properties"] = du.DiskUpdateProperties 2647 } 2648 if du.Tags != nil { 2649 objectMap["tags"] = du.Tags 2650 } 2651 if du.Sku != nil { 2652 objectMap["sku"] = du.Sku 2653 } 2654 return json.Marshal(objectMap) 2655} 2656 2657// UnmarshalJSON is the custom unmarshaler for DiskUpdate struct. 2658func (du *DiskUpdate) UnmarshalJSON(body []byte) error { 2659 var m map[string]*json.RawMessage 2660 err := json.Unmarshal(body, &m) 2661 if err != nil { 2662 return err 2663 } 2664 for k, v := range m { 2665 switch k { 2666 case "properties": 2667 if v != nil { 2668 var diskUpdateProperties DiskUpdateProperties 2669 err = json.Unmarshal(*v, &diskUpdateProperties) 2670 if err != nil { 2671 return err 2672 } 2673 du.DiskUpdateProperties = &diskUpdateProperties 2674 } 2675 case "tags": 2676 if v != nil { 2677 var tags map[string]*string 2678 err = json.Unmarshal(*v, &tags) 2679 if err != nil { 2680 return err 2681 } 2682 du.Tags = tags 2683 } 2684 case "sku": 2685 if v != nil { 2686 var sku DiskSku 2687 err = json.Unmarshal(*v, &sku) 2688 if err != nil { 2689 return err 2690 } 2691 du.Sku = &sku 2692 } 2693 } 2694 } 2695 2696 return nil 2697} 2698 2699// DiskUpdateProperties disk resource update properties. 2700type DiskUpdateProperties struct { 2701 // OsType - the Operating System type. Possible values include: 'Windows', 'Linux' 2702 OsType OperatingSystemTypes `json:"osType,omitempty"` 2703 // DiskSizeGB - If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. 2704 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 2705 // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. 2706 EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` 2707 // DiskIOPSReadWrite - The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. 2708 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 2709 // DiskMBpsReadWrite - The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. 2710 DiskMBpsReadWrite *int32 `json:"diskMBpsReadWrite,omitempty"` 2711 // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 2712 Encryption *Encryption `json:"encryption,omitempty"` 2713} 2714 2715// Encryption encryption at rest settings for disk or snapshot 2716type Encryption struct { 2717 // DiskEncryptionSetID - ResourceId of the disk encryption set to use for enabling encryption at rest. 2718 DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` 2719 // Type - The type of key used to encrypt the data of the disk. Possible values include: 'EncryptionAtRestWithPlatformKey', 'EncryptionAtRestWithCustomerKey' 2720 Type EncryptionType `json:"type,omitempty"` 2721} 2722 2723// EncryptionSetIdentity the managed identity for the disk encryption set. It should be given permission on 2724// the key vault before it can be used to encrypt disks. 2725type EncryptionSetIdentity struct { 2726 // Type - The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is supported. Possible values include: 'SystemAssigned' 2727 Type DiskEncryptionSetIdentityType `json:"type,omitempty"` 2728 // PrincipalID - READ-ONLY; The object id of the Managed Identity Resource. This will be sent to the RP from ARM via the x-ms-identity-principal-id header in the PUT request if the resource has a systemAssigned(implicit) identity 2729 PrincipalID *string `json:"principalId,omitempty"` 2730 // TenantID - READ-ONLY; The tenant id of the Managed Identity Resource. This will be sent to the RP from ARM via the x-ms-client-tenant-id header in the PUT request if the resource has a systemAssigned(implicit) identity 2731 TenantID *string `json:"tenantId,omitempty"` 2732} 2733 2734// MarshalJSON is the custom marshaler for EncryptionSetIdentity. 2735func (esi EncryptionSetIdentity) MarshalJSON() ([]byte, error) { 2736 objectMap := make(map[string]interface{}) 2737 if esi.Type != "" { 2738 objectMap["type"] = esi.Type 2739 } 2740 return json.Marshal(objectMap) 2741} 2742 2743// EncryptionSetProperties ... 2744type EncryptionSetProperties struct { 2745 // ActiveKey - The key vault key which is currently used by this disk encryption set. 2746 ActiveKey *KeyVaultAndKeyReference `json:"activeKey,omitempty"` 2747 // PreviousKeys - READ-ONLY; A readonly collection of key vault keys previously used by this disk encryption set while a key rotation is in progress. It will be empty if there is no ongoing key rotation. 2748 PreviousKeys *[]KeyVaultAndKeyReference `json:"previousKeys,omitempty"` 2749 // ProvisioningState - READ-ONLY; The disk encryption set provisioning state. 2750 ProvisioningState *string `json:"provisioningState,omitempty"` 2751} 2752 2753// MarshalJSON is the custom marshaler for EncryptionSetProperties. 2754func (esp EncryptionSetProperties) MarshalJSON() ([]byte, error) { 2755 objectMap := make(map[string]interface{}) 2756 if esp.ActiveKey != nil { 2757 objectMap["activeKey"] = esp.ActiveKey 2758 } 2759 return json.Marshal(objectMap) 2760} 2761 2762// EncryptionSettingsCollection encryption settings for disk or snapshot 2763type EncryptionSettingsCollection struct { 2764 // Enabled - Set this flag to true and provide DiskEncryptionKey and optional KeyEncryptionKey to enable encryption. Set this flag to false and remove DiskEncryptionKey and KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the request object, the existing settings remain unchanged. 2765 Enabled *bool `json:"enabled,omitempty"` 2766 // EncryptionSettings - A collection of encryption settings, one for each disk volume. 2767 EncryptionSettings *[]EncryptionSettingsElement `json:"encryptionSettings,omitempty"` 2768 // EncryptionSettingsVersion - Describes what type of encryption is used for the disks. Once this field is set, it cannot be overwritten. '1.0' corresponds to Azure Disk Encryption with AAD app.'1.1' corresponds to Azure Disk Encryption. 2769 EncryptionSettingsVersion *string `json:"encryptionSettingsVersion,omitempty"` 2770} 2771 2772// EncryptionSettingsElement encryption settings for one disk volume. 2773type EncryptionSettingsElement struct { 2774 // DiskEncryptionKey - Key Vault Secret Url and vault id of the disk encryption key 2775 DiskEncryptionKey *KeyVaultAndSecretReference `json:"diskEncryptionKey,omitempty"` 2776 // KeyEncryptionKey - Key Vault Key Url and vault id of the key encryption key. KeyEncryptionKey is optional and when provided is used to unwrap the disk encryption key. 2777 KeyEncryptionKey *KeyVaultAndKeyReference `json:"keyEncryptionKey,omitempty"` 2778} 2779 2780// GrantAccessData data used for requesting a SAS. 2781type GrantAccessData struct { 2782 // Access - Possible values include: 'None', 'Read', 'Write' 2783 Access AccessLevel `json:"access,omitempty"` 2784 // DurationInSeconds - Time duration in seconds until the SAS access expires. 2785 DurationInSeconds *int32 `json:"durationInSeconds,omitempty"` 2786} 2787 2788// HardwareProfile specifies the hardware settings for the virtual machine. 2789type HardwareProfile struct { 2790 // VMSize - Specifies the size of the virtual machine. For more information about virtual machine sizes, see [Sizes for virtual machines](https://docs.microsoft.com/en-us/azure/virtual-machines/sizes). <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/en-us/rest/api/compute/resourceskus/list) <br><br> [List all available virtual machine sizes for resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). <br><br> This list of sizes is no longer updated and the **VirtualMachineSizeTypes** string constants will be removed from the subsequent REST API specification. Use [List all available virtual machine sizes in a region]( https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list) to get the latest sizes. Possible values include: 'BasicA0', 'BasicA1', 'BasicA2', 'BasicA3', 'BasicA4', 'StandardA0', 'StandardA1', 'StandardA2', 'StandardA3', 'StandardA4', 'StandardA5', 'StandardA6', 'StandardA7', 'StandardA8', 'StandardA9', 'StandardA10', 'StandardA11', 'StandardA1V2', 'StandardA2V2', 'StandardA4V2', 'StandardA8V2', 'StandardA2mV2', 'StandardA4mV2', 'StandardA8mV2', 'StandardB1s', 'StandardB1ms', 'StandardB2s', 'StandardB2ms', 'StandardB4ms', 'StandardB8ms', 'StandardD1', 'StandardD2', 'StandardD3', 'StandardD4', 'StandardD11', 'StandardD12', 'StandardD13', 'StandardD14', 'StandardD1V2', 'StandardD2V2', 'StandardD3V2', 'StandardD4V2', 'StandardD5V2', 'StandardD2V3', 'StandardD4V3', 'StandardD8V3', 'StandardD16V3', 'StandardD32V3', 'StandardD64V3', 'StandardD2sV3', 'StandardD4sV3', 'StandardD8sV3', 'StandardD16sV3', 'StandardD32sV3', 'StandardD64sV3', 'StandardD11V2', 'StandardD12V2', 'StandardD13V2', 'StandardD14V2', 'StandardD15V2', 'StandardDS1', 'StandardDS2', 'StandardDS3', 'StandardDS4', 'StandardDS11', 'StandardDS12', 'StandardDS13', 'StandardDS14', 'StandardDS1V2', 'StandardDS2V2', 'StandardDS3V2', 'StandardDS4V2', 'StandardDS5V2', 'StandardDS11V2', 'StandardDS12V2', 'StandardDS13V2', 'StandardDS14V2', 'StandardDS15V2', 'StandardDS134V2', 'StandardDS132V2', 'StandardDS148V2', 'StandardDS144V2', 'StandardE2V3', 'StandardE4V3', 'StandardE8V3', 'StandardE16V3', 'StandardE32V3', 'StandardE64V3', 'StandardE2sV3', 'StandardE4sV3', 'StandardE8sV3', 'StandardE16sV3', 'StandardE32sV3', 'StandardE64sV3', 'StandardE3216V3', 'StandardE328sV3', 'StandardE6432sV3', 'StandardE6416sV3', 'StandardF1', 'StandardF2', 'StandardF4', 'StandardF8', 'StandardF16', 'StandardF1s', 'StandardF2s', 'StandardF4s', 'StandardF8s', 'StandardF16s', 'StandardF2sV2', 'StandardF4sV2', 'StandardF8sV2', 'StandardF16sV2', 'StandardF32sV2', 'StandardF64sV2', 'StandardF72sV2', 'StandardG1', 'StandardG2', 'StandardG3', 'StandardG4', 'StandardG5', 'StandardGS1', 'StandardGS2', 'StandardGS3', 'StandardGS4', 'StandardGS5', 'StandardGS48', 'StandardGS44', 'StandardGS516', 'StandardGS58', 'StandardH8', 'StandardH16', 'StandardH8m', 'StandardH16m', 'StandardH16r', 'StandardH16mr', 'StandardL4s', 'StandardL8s', 'StandardL16s', 'StandardL32s', 'StandardM64s', 'StandardM64ms', 'StandardM128s', 'StandardM128ms', 'StandardM6432ms', 'StandardM6416ms', 'StandardM12864ms', 'StandardM12832ms', 'StandardNC6', 'StandardNC12', 'StandardNC24', 'StandardNC24r', 'StandardNC6sV2', 'StandardNC12sV2', 'StandardNC24sV2', 'StandardNC24rsV2', 'StandardNC6sV3', 'StandardNC12sV3', 'StandardNC24sV3', 'StandardNC24rsV3', 'StandardND6s', 'StandardND12s', 'StandardND24s', 'StandardND24rs', 'StandardNV6', 'StandardNV12', 'StandardNV24' 2791 VMSize VirtualMachineSizeTypes `json:"vmSize,omitempty"` 2792} 2793 2794// Image the source user image virtual hard disk. The virtual hard disk will be copied before being 2795// attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not 2796// exist. 2797type Image struct { 2798 autorest.Response `json:"-"` 2799 *ImageProperties `json:"properties,omitempty"` 2800 // ID - READ-ONLY; Resource Id 2801 ID *string `json:"id,omitempty"` 2802 // Name - READ-ONLY; Resource name 2803 Name *string `json:"name,omitempty"` 2804 // Type - READ-ONLY; Resource type 2805 Type *string `json:"type,omitempty"` 2806 // Location - Resource location 2807 Location *string `json:"location,omitempty"` 2808 // Tags - Resource tags 2809 Tags map[string]*string `json:"tags"` 2810} 2811 2812// MarshalJSON is the custom marshaler for Image. 2813func (i Image) MarshalJSON() ([]byte, error) { 2814 objectMap := make(map[string]interface{}) 2815 if i.ImageProperties != nil { 2816 objectMap["properties"] = i.ImageProperties 2817 } 2818 if i.Location != nil { 2819 objectMap["location"] = i.Location 2820 } 2821 if i.Tags != nil { 2822 objectMap["tags"] = i.Tags 2823 } 2824 return json.Marshal(objectMap) 2825} 2826 2827// UnmarshalJSON is the custom unmarshaler for Image struct. 2828func (i *Image) UnmarshalJSON(body []byte) error { 2829 var m map[string]*json.RawMessage 2830 err := json.Unmarshal(body, &m) 2831 if err != nil { 2832 return err 2833 } 2834 for k, v := range m { 2835 switch k { 2836 case "properties": 2837 if v != nil { 2838 var imageProperties ImageProperties 2839 err = json.Unmarshal(*v, &imageProperties) 2840 if err != nil { 2841 return err 2842 } 2843 i.ImageProperties = &imageProperties 2844 } 2845 case "id": 2846 if v != nil { 2847 var ID string 2848 err = json.Unmarshal(*v, &ID) 2849 if err != nil { 2850 return err 2851 } 2852 i.ID = &ID 2853 } 2854 case "name": 2855 if v != nil { 2856 var name string 2857 err = json.Unmarshal(*v, &name) 2858 if err != nil { 2859 return err 2860 } 2861 i.Name = &name 2862 } 2863 case "type": 2864 if v != nil { 2865 var typeVar string 2866 err = json.Unmarshal(*v, &typeVar) 2867 if err != nil { 2868 return err 2869 } 2870 i.Type = &typeVar 2871 } 2872 case "location": 2873 if v != nil { 2874 var location string 2875 err = json.Unmarshal(*v, &location) 2876 if err != nil { 2877 return err 2878 } 2879 i.Location = &location 2880 } 2881 case "tags": 2882 if v != nil { 2883 var tags map[string]*string 2884 err = json.Unmarshal(*v, &tags) 2885 if err != nil { 2886 return err 2887 } 2888 i.Tags = tags 2889 } 2890 } 2891 } 2892 2893 return nil 2894} 2895 2896// ImageDataDisk describes a data disk. 2897type ImageDataDisk struct { 2898 // 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. 2899 Lun *int32 `json:"lun,omitempty"` 2900 // Snapshot - The snapshot. 2901 Snapshot *SubResource `json:"snapshot,omitempty"` 2902 // ManagedDisk - The managedDisk. 2903 ManagedDisk *SubResource `json:"managedDisk,omitempty"` 2904 // BlobURI - The Virtual Hard Disk. 2905 BlobURI *string `json:"blobUri,omitempty"` 2906 // Caching - Specifies the caching requirements. <br><br> Possible values are: <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' 2907 Caching CachingTypes `json:"caching,omitempty"` 2908 // DiskSizeGB - Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image. <br><br> This value cannot be larger than 1023 GB 2909 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 2910 // StorageAccountType - Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values include: 'StorageAccountTypesStandardLRS', 'StorageAccountTypesPremiumLRS', 'StorageAccountTypesStandardSSDLRS', 'StorageAccountTypesUltraSSDLRS' 2911 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 2912 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. 2913 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 2914} 2915 2916// ImageDisk describes a image disk. 2917type ImageDisk struct { 2918 // Snapshot - The snapshot. 2919 Snapshot *SubResource `json:"snapshot,omitempty"` 2920 // ManagedDisk - The managedDisk. 2921 ManagedDisk *SubResource `json:"managedDisk,omitempty"` 2922 // BlobURI - The Virtual Hard Disk. 2923 BlobURI *string `json:"blobUri,omitempty"` 2924 // Caching - Specifies the caching requirements. <br><br> Possible values are: <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' 2925 Caching CachingTypes `json:"caching,omitempty"` 2926 // DiskSizeGB - Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image. <br><br> This value cannot be larger than 1023 GB 2927 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 2928 // StorageAccountType - Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values include: 'StorageAccountTypesStandardLRS', 'StorageAccountTypesPremiumLRS', 'StorageAccountTypesStandardSSDLRS', 'StorageAccountTypesUltraSSDLRS' 2929 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 2930 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. 2931 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 2932} 2933 2934// ImageDiskReference the source image used for creating the disk. 2935type ImageDiskReference struct { 2936 // ID - A relative uri containing either a Platform Image Repository or user image reference. 2937 ID *string `json:"id,omitempty"` 2938 // Lun - If the disk is created from an image's data disk, this is an index that indicates which of the data disks in the image to use. For OS disks, this field is null. 2939 Lun *int32 `json:"lun,omitempty"` 2940} 2941 2942// ImageListResult the List Image operation response. 2943type ImageListResult struct { 2944 autorest.Response `json:"-"` 2945 // Value - The list of Images. 2946 Value *[]Image `json:"value,omitempty"` 2947 // NextLink - The uri to fetch the next page of Images. Call ListNext() with this to fetch the next page of Images. 2948 NextLink *string `json:"nextLink,omitempty"` 2949} 2950 2951// ImageListResultIterator provides access to a complete listing of Image values. 2952type ImageListResultIterator struct { 2953 i int 2954 page ImageListResultPage 2955} 2956 2957// NextWithContext advances to the next value. If there was an error making 2958// the request the iterator does not advance and the error is returned. 2959func (iter *ImageListResultIterator) NextWithContext(ctx context.Context) (err error) { 2960 if tracing.IsEnabled() { 2961 ctx = tracing.StartSpan(ctx, fqdn+"/ImageListResultIterator.NextWithContext") 2962 defer func() { 2963 sc := -1 2964 if iter.Response().Response.Response != nil { 2965 sc = iter.Response().Response.Response.StatusCode 2966 } 2967 tracing.EndSpan(ctx, sc, err) 2968 }() 2969 } 2970 iter.i++ 2971 if iter.i < len(iter.page.Values()) { 2972 return nil 2973 } 2974 err = iter.page.NextWithContext(ctx) 2975 if err != nil { 2976 iter.i-- 2977 return err 2978 } 2979 iter.i = 0 2980 return nil 2981} 2982 2983// Next advances to the next value. If there was an error making 2984// the request the iterator does not advance and the error is returned. 2985// Deprecated: Use NextWithContext() instead. 2986func (iter *ImageListResultIterator) Next() error { 2987 return iter.NextWithContext(context.Background()) 2988} 2989 2990// NotDone returns true if the enumeration should be started or is not yet complete. 2991func (iter ImageListResultIterator) NotDone() bool { 2992 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2993} 2994 2995// Response returns the raw server response from the last page request. 2996func (iter ImageListResultIterator) Response() ImageListResult { 2997 return iter.page.Response() 2998} 2999 3000// Value returns the current value or a zero-initialized value if the 3001// iterator has advanced beyond the end of the collection. 3002func (iter ImageListResultIterator) Value() Image { 3003 if !iter.page.NotDone() { 3004 return Image{} 3005 } 3006 return iter.page.Values()[iter.i] 3007} 3008 3009// Creates a new instance of the ImageListResultIterator type. 3010func NewImageListResultIterator(page ImageListResultPage) ImageListResultIterator { 3011 return ImageListResultIterator{page: page} 3012} 3013 3014// IsEmpty returns true if the ListResult contains no values. 3015func (ilr ImageListResult) IsEmpty() bool { 3016 return ilr.Value == nil || len(*ilr.Value) == 0 3017} 3018 3019// hasNextLink returns true if the NextLink is not empty. 3020func (ilr ImageListResult) hasNextLink() bool { 3021 return ilr.NextLink != nil && len(*ilr.NextLink) != 0 3022} 3023 3024// imageListResultPreparer prepares a request to retrieve the next set of results. 3025// It returns nil if no more results exist. 3026func (ilr ImageListResult) imageListResultPreparer(ctx context.Context) (*http.Request, error) { 3027 if !ilr.hasNextLink() { 3028 return nil, nil 3029 } 3030 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3031 autorest.AsJSON(), 3032 autorest.AsGet(), 3033 autorest.WithBaseURL(to.String(ilr.NextLink))) 3034} 3035 3036// ImageListResultPage contains a page of Image values. 3037type ImageListResultPage struct { 3038 fn func(context.Context, ImageListResult) (ImageListResult, error) 3039 ilr ImageListResult 3040} 3041 3042// NextWithContext advances to the next page of values. If there was an error making 3043// the request the page does not advance and the error is returned. 3044func (page *ImageListResultPage) NextWithContext(ctx context.Context) (err error) { 3045 if tracing.IsEnabled() { 3046 ctx = tracing.StartSpan(ctx, fqdn+"/ImageListResultPage.NextWithContext") 3047 defer func() { 3048 sc := -1 3049 if page.Response().Response.Response != nil { 3050 sc = page.Response().Response.Response.StatusCode 3051 } 3052 tracing.EndSpan(ctx, sc, err) 3053 }() 3054 } 3055 for { 3056 next, err := page.fn(ctx, page.ilr) 3057 if err != nil { 3058 return err 3059 } 3060 page.ilr = next 3061 if !next.hasNextLink() || !next.IsEmpty() { 3062 break 3063 } 3064 } 3065 return nil 3066} 3067 3068// Next advances to the next page of values. If there was an error making 3069// the request the page does not advance and the error is returned. 3070// Deprecated: Use NextWithContext() instead. 3071func (page *ImageListResultPage) Next() error { 3072 return page.NextWithContext(context.Background()) 3073} 3074 3075// NotDone returns true if the page enumeration should be started or is not yet complete. 3076func (page ImageListResultPage) NotDone() bool { 3077 return !page.ilr.IsEmpty() 3078} 3079 3080// Response returns the raw server response from the last page request. 3081func (page ImageListResultPage) Response() ImageListResult { 3082 return page.ilr 3083} 3084 3085// Values returns the slice of values for the current page or nil if there are no values. 3086func (page ImageListResultPage) Values() []Image { 3087 if page.ilr.IsEmpty() { 3088 return nil 3089 } 3090 return *page.ilr.Value 3091} 3092 3093// Creates a new instance of the ImageListResultPage type. 3094func NewImageListResultPage(cur ImageListResult, getNextPage func(context.Context, ImageListResult) (ImageListResult, error)) ImageListResultPage { 3095 return ImageListResultPage{ 3096 fn: getNextPage, 3097 ilr: cur, 3098 } 3099} 3100 3101// ImageOSDisk describes an Operating System disk. 3102type ImageOSDisk struct { 3103 // OsType - This property allows you to specify the type of the OS that is included in the disk if creating a VM from a custom image. <br><br> Possible values are: <br><br> **Windows** <br><br> **Linux**. Possible values include: 'Windows', 'Linux' 3104 OsType OperatingSystemTypes `json:"osType,omitempty"` 3105 // OsState - The OS State. Possible values include: 'Generalized', 'Specialized' 3106 OsState OperatingSystemStateTypes `json:"osState,omitempty"` 3107 // Snapshot - The snapshot. 3108 Snapshot *SubResource `json:"snapshot,omitempty"` 3109 // ManagedDisk - The managedDisk. 3110 ManagedDisk *SubResource `json:"managedDisk,omitempty"` 3111 // BlobURI - The Virtual Hard Disk. 3112 BlobURI *string `json:"blobUri,omitempty"` 3113 // Caching - Specifies the caching requirements. <br><br> Possible values are: <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' 3114 Caching CachingTypes `json:"caching,omitempty"` 3115 // DiskSizeGB - Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image. <br><br> This value cannot be larger than 1023 GB 3116 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 3117 // StorageAccountType - Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values include: 'StorageAccountTypesStandardLRS', 'StorageAccountTypesPremiumLRS', 'StorageAccountTypesStandardSSDLRS', 'StorageAccountTypesUltraSSDLRS' 3118 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 3119 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. 3120 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 3121} 3122 3123// ImageProperties describes the properties of an Image. 3124type ImageProperties struct { 3125 // SourceVirtualMachine - The source virtual machine from which Image is created. 3126 SourceVirtualMachine *SubResource `json:"sourceVirtualMachine,omitempty"` 3127 // StorageProfile - Specifies the storage settings for the virtual machine disks. 3128 StorageProfile *ImageStorageProfile `json:"storageProfile,omitempty"` 3129 // ProvisioningState - READ-ONLY; The provisioning state. 3130 ProvisioningState *string `json:"provisioningState,omitempty"` 3131 // HyperVGeneration - Gets the HyperVGenerationType of the VirtualMachine created from the image. Possible values include: 'HyperVGenerationTypesV1', 'HyperVGenerationTypesV2' 3132 HyperVGeneration HyperVGenerationTypes `json:"hyperVGeneration,omitempty"` 3133} 3134 3135// MarshalJSON is the custom marshaler for ImageProperties. 3136func (IP ImageProperties) MarshalJSON() ([]byte, error) { 3137 objectMap := make(map[string]interface{}) 3138 if IP.SourceVirtualMachine != nil { 3139 objectMap["sourceVirtualMachine"] = IP.SourceVirtualMachine 3140 } 3141 if IP.StorageProfile != nil { 3142 objectMap["storageProfile"] = IP.StorageProfile 3143 } 3144 if IP.HyperVGeneration != "" { 3145 objectMap["hyperVGeneration"] = IP.HyperVGeneration 3146 } 3147 return json.Marshal(objectMap) 3148} 3149 3150// ImageReference specifies information about the image to use. You can specify information about platform 3151// images, marketplace images, or virtual machine images. This element is required when you want to use a 3152// platform image, marketplace image, or virtual machine image, but is not used in other creation 3153// operations. NOTE: Image reference publisher and offer can only be set when you create the scale set. 3154type ImageReference struct { 3155 // Publisher - The image publisher. 3156 Publisher *string `json:"publisher,omitempty"` 3157 // Offer - Specifies the offer of the platform image or marketplace image used to create the virtual machine. 3158 Offer *string `json:"offer,omitempty"` 3159 // Sku - The image SKU. 3160 Sku *string `json:"sku,omitempty"` 3161 // 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. 3162 Version *string `json:"version,omitempty"` 3163 // ExactVersion - READ-ONLY; Specifies in decimal numbers, the version of platform image or marketplace image used to create the virtual machine. This readonly field differs from 'version', only if the value specified in 'version' field is 'latest'. 3164 ExactVersion *string `json:"exactVersion,omitempty"` 3165 // ID - Resource Id 3166 ID *string `json:"id,omitempty"` 3167} 3168 3169// MarshalJSON is the custom marshaler for ImageReference. 3170func (ir ImageReference) MarshalJSON() ([]byte, error) { 3171 objectMap := make(map[string]interface{}) 3172 if ir.Publisher != nil { 3173 objectMap["publisher"] = ir.Publisher 3174 } 3175 if ir.Offer != nil { 3176 objectMap["offer"] = ir.Offer 3177 } 3178 if ir.Sku != nil { 3179 objectMap["sku"] = ir.Sku 3180 } 3181 if ir.Version != nil { 3182 objectMap["version"] = ir.Version 3183 } 3184 if ir.ID != nil { 3185 objectMap["id"] = ir.ID 3186 } 3187 return json.Marshal(objectMap) 3188} 3189 3190// ImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 3191// operation. 3192type ImagesCreateOrUpdateFuture struct { 3193 azure.FutureAPI 3194 // Result returns the result of the asynchronous operation. 3195 // If the operation has not completed it will return an error. 3196 Result func(ImagesClient) (Image, error) 3197} 3198 3199// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3200func (future *ImagesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 3201 var azFuture azure.Future 3202 if err := json.Unmarshal(body, &azFuture); err != nil { 3203 return err 3204 } 3205 future.FutureAPI = &azFuture 3206 future.Result = future.result 3207 return nil 3208} 3209 3210// result is the default implementation for ImagesCreateOrUpdateFuture.Result. 3211func (future *ImagesCreateOrUpdateFuture) result(client ImagesClient) (i Image, err error) { 3212 var done bool 3213 done, err = future.DoneWithContext(context.Background(), client) 3214 if err != nil { 3215 err = autorest.NewErrorWithError(err, "compute.ImagesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 3216 return 3217 } 3218 if !done { 3219 err = azure.NewAsyncOpIncompleteError("compute.ImagesCreateOrUpdateFuture") 3220 return 3221 } 3222 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3223 if i.Response.Response, err = future.GetResult(sender); err == nil && i.Response.Response.StatusCode != http.StatusNoContent { 3224 i, err = client.CreateOrUpdateResponder(i.Response.Response) 3225 if err != nil { 3226 err = autorest.NewErrorWithError(err, "compute.ImagesCreateOrUpdateFuture", "Result", i.Response.Response, "Failure responding to request") 3227 } 3228 } 3229 return 3230} 3231 3232// ImagesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 3233type ImagesDeleteFuture struct { 3234 azure.FutureAPI 3235 // Result returns the result of the asynchronous operation. 3236 // If the operation has not completed it will return an error. 3237 Result func(ImagesClient) (autorest.Response, error) 3238} 3239 3240// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3241func (future *ImagesDeleteFuture) UnmarshalJSON(body []byte) error { 3242 var azFuture azure.Future 3243 if err := json.Unmarshal(body, &azFuture); err != nil { 3244 return err 3245 } 3246 future.FutureAPI = &azFuture 3247 future.Result = future.result 3248 return nil 3249} 3250 3251// result is the default implementation for ImagesDeleteFuture.Result. 3252func (future *ImagesDeleteFuture) result(client ImagesClient) (ar autorest.Response, err error) { 3253 var done bool 3254 done, err = future.DoneWithContext(context.Background(), client) 3255 if err != nil { 3256 err = autorest.NewErrorWithError(err, "compute.ImagesDeleteFuture", "Result", future.Response(), "Polling failure") 3257 return 3258 } 3259 if !done { 3260 err = azure.NewAsyncOpIncompleteError("compute.ImagesDeleteFuture") 3261 return 3262 } 3263 ar.Response = future.Response() 3264 return 3265} 3266 3267// ImageStorageProfile describes a storage profile. 3268type ImageStorageProfile struct { 3269 // 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). 3270 OsDisk *ImageOSDisk `json:"osDisk,omitempty"` 3271 // 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). 3272 DataDisks *[]ImageDataDisk `json:"dataDisks,omitempty"` 3273 // ZoneResilient - Specifies whether an image is zone resilient or not. Default is false. Zone resilient images can be created only in regions that provide Zone Redundant Storage (ZRS). 3274 ZoneResilient *bool `json:"zoneResilient,omitempty"` 3275} 3276 3277// ImagesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. 3278type ImagesUpdateFuture struct { 3279 azure.FutureAPI 3280 // Result returns the result of the asynchronous operation. 3281 // If the operation has not completed it will return an error. 3282 Result func(ImagesClient) (Image, error) 3283} 3284 3285// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3286func (future *ImagesUpdateFuture) UnmarshalJSON(body []byte) error { 3287 var azFuture azure.Future 3288 if err := json.Unmarshal(body, &azFuture); err != nil { 3289 return err 3290 } 3291 future.FutureAPI = &azFuture 3292 future.Result = future.result 3293 return nil 3294} 3295 3296// result is the default implementation for ImagesUpdateFuture.Result. 3297func (future *ImagesUpdateFuture) result(client ImagesClient) (i Image, err error) { 3298 var done bool 3299 done, err = future.DoneWithContext(context.Background(), client) 3300 if err != nil { 3301 err = autorest.NewErrorWithError(err, "compute.ImagesUpdateFuture", "Result", future.Response(), "Polling failure") 3302 return 3303 } 3304 if !done { 3305 err = azure.NewAsyncOpIncompleteError("compute.ImagesUpdateFuture") 3306 return 3307 } 3308 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3309 if i.Response.Response, err = future.GetResult(sender); err == nil && i.Response.Response.StatusCode != http.StatusNoContent { 3310 i, err = client.UpdateResponder(i.Response.Response) 3311 if err != nil { 3312 err = autorest.NewErrorWithError(err, "compute.ImagesUpdateFuture", "Result", i.Response.Response, "Failure responding to request") 3313 } 3314 } 3315 return 3316} 3317 3318// ImageUpdate the source user image virtual hard disk. Only tags may be updated. 3319type ImageUpdate struct { 3320 *ImageProperties `json:"properties,omitempty"` 3321 // Tags - Resource tags 3322 Tags map[string]*string `json:"tags"` 3323} 3324 3325// MarshalJSON is the custom marshaler for ImageUpdate. 3326func (iu ImageUpdate) MarshalJSON() ([]byte, error) { 3327 objectMap := make(map[string]interface{}) 3328 if iu.ImageProperties != nil { 3329 objectMap["properties"] = iu.ImageProperties 3330 } 3331 if iu.Tags != nil { 3332 objectMap["tags"] = iu.Tags 3333 } 3334 return json.Marshal(objectMap) 3335} 3336 3337// UnmarshalJSON is the custom unmarshaler for ImageUpdate struct. 3338func (iu *ImageUpdate) UnmarshalJSON(body []byte) error { 3339 var m map[string]*json.RawMessage 3340 err := json.Unmarshal(body, &m) 3341 if err != nil { 3342 return err 3343 } 3344 for k, v := range m { 3345 switch k { 3346 case "properties": 3347 if v != nil { 3348 var imageProperties ImageProperties 3349 err = json.Unmarshal(*v, &imageProperties) 3350 if err != nil { 3351 return err 3352 } 3353 iu.ImageProperties = &imageProperties 3354 } 3355 case "tags": 3356 if v != nil { 3357 var tags map[string]*string 3358 err = json.Unmarshal(*v, &tags) 3359 if err != nil { 3360 return err 3361 } 3362 iu.Tags = tags 3363 } 3364 } 3365 } 3366 3367 return nil 3368} 3369 3370// InnerError inner error details. 3371type InnerError struct { 3372 // Exceptiontype - The exception type. 3373 Exceptiontype *string `json:"exceptiontype,omitempty"` 3374 // Errordetail - The internal error message or exception dump. 3375 Errordetail *string `json:"errordetail,omitempty"` 3376} 3377 3378// InstanceViewStatus instance view status. 3379type InstanceViewStatus struct { 3380 // Code - The status code. 3381 Code *string `json:"code,omitempty"` 3382 // Level - The level code. Possible values include: 'Info', 'Warning', 'Error' 3383 Level StatusLevelTypes `json:"level,omitempty"` 3384 // DisplayStatus - The short localizable label for the status. 3385 DisplayStatus *string `json:"displayStatus,omitempty"` 3386 // Message - The detailed status message, including for alerts and error messages. 3387 Message *string `json:"message,omitempty"` 3388 // Time - The time of the status. 3389 Time *date.Time `json:"time,omitempty"` 3390} 3391 3392// KeyVaultAndKeyReference key Vault Key Url and vault id of KeK, KeK is optional and when provided is used 3393// to unwrap the encryptionKey 3394type KeyVaultAndKeyReference struct { 3395 // SourceVault - Resource id of the KeyVault containing the key or secret 3396 SourceVault *SourceVault `json:"sourceVault,omitempty"` 3397 // KeyURL - Url pointing to a key or secret in KeyVault 3398 KeyURL *string `json:"keyUrl,omitempty"` 3399} 3400 3401// KeyVaultAndSecretReference key Vault Secret Url and vault id of the encryption key 3402type KeyVaultAndSecretReference struct { 3403 // SourceVault - Resource id of the KeyVault containing the key or secret 3404 SourceVault *SourceVault `json:"sourceVault,omitempty"` 3405 // SecretURL - Url pointing to a key or secret in KeyVault 3406 SecretURL *string `json:"secretUrl,omitempty"` 3407} 3408 3409// KeyVaultKeyReference describes a reference to Key Vault Key 3410type KeyVaultKeyReference struct { 3411 // KeyURL - The URL referencing a key encryption key in Key Vault. 3412 KeyURL *string `json:"keyUrl,omitempty"` 3413 // SourceVault - The relative URL of the Key Vault containing the key. 3414 SourceVault *SubResource `json:"sourceVault,omitempty"` 3415} 3416 3417// KeyVaultSecretReference describes a reference to Key Vault Secret 3418type KeyVaultSecretReference struct { 3419 // SecretURL - The URL referencing a secret in a Key Vault. 3420 SecretURL *string `json:"secretUrl,omitempty"` 3421 // SourceVault - The relative URL of the Key Vault containing the secret. 3422 SourceVault *SubResource `json:"sourceVault,omitempty"` 3423} 3424 3425// LastPatchInstallationSummary describes the properties of the last installed patch summary. 3426type LastPatchInstallationSummary struct { 3427 // Status - READ-ONLY; The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Failed", "Succeeded", or "CompletedWithWarnings.". Possible values include: 'PatchOperationStatusInProgress', 'PatchOperationStatusFailed', 'PatchOperationStatusSucceeded', 'PatchOperationStatusCompletedWithWarnings' 3428 Status PatchOperationStatus `json:"status,omitempty"` 3429 // InstallationActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. 3430 InstallationActivityID *string `json:"installationActivityId,omitempty"` 3431 // MaintenanceWindowExceeded - READ-ONLY; Describes whether the operation ran out of time before it completed all its intended actions 3432 MaintenanceWindowExceeded *bool `json:"maintenanceWindowExceeded,omitempty"` 3433 // RebootStatus - READ-ONLY; The reboot status of the machine after the patch operation. It will be in "NotNeeded" status if reboot is not needed after the patch operation. "Required" will be the status once the patch is applied and machine is required to reboot. "Started" will be the reboot status when the machine has started to reboot. "Failed" will be the status if the machine is failed to reboot. "Completed" will be the status once the machine is rebooted successfully. Possible values include: 'RebootStatusNotNeeded', 'RebootStatusRequired', 'RebootStatusStarted', 'RebootStatusFailed', 'RebootStatusCompleted' 3434 RebootStatus RebootStatus `json:"rebootStatus,omitempty"` 3435 // NotSelectedPatchCount - READ-ONLY; The number of all available patches but not going to be installed because it didn't match a classification or inclusion list entry. 3436 NotSelectedPatchCount *int32 `json:"notSelectedPatchCount,omitempty"` 3437 // ExcludedPatchCount - READ-ONLY; The number of all available patches but excluded explicitly by a customer-specified exclusion list match. 3438 ExcludedPatchCount *int32 `json:"excludedPatchCount,omitempty"` 3439 // PendingPatchCount - READ-ONLY; The number of all available patches expected to be installed over the course of the patch installation operation. 3440 PendingPatchCount *int32 `json:"pendingPatchCount,omitempty"` 3441 // InstalledPatchCount - READ-ONLY; The count of patches that successfully installed. 3442 InstalledPatchCount *int32 `json:"installedPatchCount,omitempty"` 3443 // FailedPatchCount - READ-ONLY; The count of patches that failed installation. 3444 FailedPatchCount *int32 `json:"failedPatchCount,omitempty"` 3445 // StartTime - READ-ONLY; The UTC timestamp when the operation began. 3446 StartTime *date.Time `json:"startTime,omitempty"` 3447 // LastModifiedTime - READ-ONLY; The UTC timestamp when the operation began. 3448 LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` 3449 // StartedBy - READ-ONLY; The person or system account that started the operation 3450 StartedBy *string `json:"startedBy,omitempty"` 3451 // Error - READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. 3452 Error *APIError `json:"error,omitempty"` 3453} 3454 3455// LinuxConfiguration specifies the Linux operating system settings on the virtual machine. <br><br>For a 3456// list of supported Linux distributions, see [Linux on Azure-Endorsed 3457// Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) 3458// <br><br> For running non-endorsed distributions, see [Information for Non-Endorsed 3459// Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). 3460type LinuxConfiguration struct { 3461 // DisablePasswordAuthentication - Specifies whether password authentication should be disabled. 3462 DisablePasswordAuthentication *bool `json:"disablePasswordAuthentication,omitempty"` 3463 // SSH - Specifies the ssh key configuration for a Linux OS. 3464 SSH *SSHConfiguration `json:"ssh,omitempty"` 3465 // 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. 3466 ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` 3467} 3468 3469// ListUsagesResult the List Usages operation response. 3470type ListUsagesResult struct { 3471 autorest.Response `json:"-"` 3472 // Value - The list of compute resource usages. 3473 Value *[]Usage `json:"value,omitempty"` 3474 // 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. 3475 NextLink *string `json:"nextLink,omitempty"` 3476} 3477 3478// ListUsagesResultIterator provides access to a complete listing of Usage values. 3479type ListUsagesResultIterator struct { 3480 i int 3481 page ListUsagesResultPage 3482} 3483 3484// NextWithContext advances to the next value. If there was an error making 3485// the request the iterator does not advance and the error is returned. 3486func (iter *ListUsagesResultIterator) NextWithContext(ctx context.Context) (err error) { 3487 if tracing.IsEnabled() { 3488 ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultIterator.NextWithContext") 3489 defer func() { 3490 sc := -1 3491 if iter.Response().Response.Response != nil { 3492 sc = iter.Response().Response.Response.StatusCode 3493 } 3494 tracing.EndSpan(ctx, sc, err) 3495 }() 3496 } 3497 iter.i++ 3498 if iter.i < len(iter.page.Values()) { 3499 return nil 3500 } 3501 err = iter.page.NextWithContext(ctx) 3502 if err != nil { 3503 iter.i-- 3504 return err 3505 } 3506 iter.i = 0 3507 return nil 3508} 3509 3510// Next advances to the next value. If there was an error making 3511// the request the iterator does not advance and the error is returned. 3512// Deprecated: Use NextWithContext() instead. 3513func (iter *ListUsagesResultIterator) Next() error { 3514 return iter.NextWithContext(context.Background()) 3515} 3516 3517// NotDone returns true if the enumeration should be started or is not yet complete. 3518func (iter ListUsagesResultIterator) NotDone() bool { 3519 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3520} 3521 3522// Response returns the raw server response from the last page request. 3523func (iter ListUsagesResultIterator) Response() ListUsagesResult { 3524 return iter.page.Response() 3525} 3526 3527// Value returns the current value or a zero-initialized value if the 3528// iterator has advanced beyond the end of the collection. 3529func (iter ListUsagesResultIterator) Value() Usage { 3530 if !iter.page.NotDone() { 3531 return Usage{} 3532 } 3533 return iter.page.Values()[iter.i] 3534} 3535 3536// Creates a new instance of the ListUsagesResultIterator type. 3537func NewListUsagesResultIterator(page ListUsagesResultPage) ListUsagesResultIterator { 3538 return ListUsagesResultIterator{page: page} 3539} 3540 3541// IsEmpty returns true if the ListResult contains no values. 3542func (lur ListUsagesResult) IsEmpty() bool { 3543 return lur.Value == nil || len(*lur.Value) == 0 3544} 3545 3546// hasNextLink returns true if the NextLink is not empty. 3547func (lur ListUsagesResult) hasNextLink() bool { 3548 return lur.NextLink != nil && len(*lur.NextLink) != 0 3549} 3550 3551// listUsagesResultPreparer prepares a request to retrieve the next set of results. 3552// It returns nil if no more results exist. 3553func (lur ListUsagesResult) listUsagesResultPreparer(ctx context.Context) (*http.Request, error) { 3554 if !lur.hasNextLink() { 3555 return nil, nil 3556 } 3557 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3558 autorest.AsJSON(), 3559 autorest.AsGet(), 3560 autorest.WithBaseURL(to.String(lur.NextLink))) 3561} 3562 3563// ListUsagesResultPage contains a page of Usage values. 3564type ListUsagesResultPage struct { 3565 fn func(context.Context, ListUsagesResult) (ListUsagesResult, error) 3566 lur ListUsagesResult 3567} 3568 3569// NextWithContext advances to the next page of values. If there was an error making 3570// the request the page does not advance and the error is returned. 3571func (page *ListUsagesResultPage) NextWithContext(ctx context.Context) (err error) { 3572 if tracing.IsEnabled() { 3573 ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultPage.NextWithContext") 3574 defer func() { 3575 sc := -1 3576 if page.Response().Response.Response != nil { 3577 sc = page.Response().Response.Response.StatusCode 3578 } 3579 tracing.EndSpan(ctx, sc, err) 3580 }() 3581 } 3582 for { 3583 next, err := page.fn(ctx, page.lur) 3584 if err != nil { 3585 return err 3586 } 3587 page.lur = next 3588 if !next.hasNextLink() || !next.IsEmpty() { 3589 break 3590 } 3591 } 3592 return nil 3593} 3594 3595// Next advances to the next page of values. If there was an error making 3596// the request the page does not advance and the error is returned. 3597// Deprecated: Use NextWithContext() instead. 3598func (page *ListUsagesResultPage) Next() error { 3599 return page.NextWithContext(context.Background()) 3600} 3601 3602// NotDone returns true if the page enumeration should be started or is not yet complete. 3603func (page ListUsagesResultPage) NotDone() bool { 3604 return !page.lur.IsEmpty() 3605} 3606 3607// Response returns the raw server response from the last page request. 3608func (page ListUsagesResultPage) Response() ListUsagesResult { 3609 return page.lur 3610} 3611 3612// Values returns the slice of values for the current page or nil if there are no values. 3613func (page ListUsagesResultPage) Values() []Usage { 3614 if page.lur.IsEmpty() { 3615 return nil 3616 } 3617 return *page.lur.Value 3618} 3619 3620// Creates a new instance of the ListUsagesResultPage type. 3621func NewListUsagesResultPage(cur ListUsagesResult, getNextPage func(context.Context, ListUsagesResult) (ListUsagesResult, error)) ListUsagesResultPage { 3622 return ListUsagesResultPage{ 3623 fn: getNextPage, 3624 lur: cur, 3625 } 3626} 3627 3628// ListVirtualMachineExtensionImage ... 3629type ListVirtualMachineExtensionImage struct { 3630 autorest.Response `json:"-"` 3631 Value *[]VirtualMachineExtensionImage `json:"value,omitempty"` 3632} 3633 3634// ListVirtualMachineImageResource ... 3635type ListVirtualMachineImageResource struct { 3636 autorest.Response `json:"-"` 3637 Value *[]VirtualMachineImageResource `json:"value,omitempty"` 3638} 3639 3640// LogAnalyticsExportRequestRateByIntervalFuture an abstraction for monitoring and retrieving the results 3641// of a long-running operation. 3642type LogAnalyticsExportRequestRateByIntervalFuture struct { 3643 azure.FutureAPI 3644 // Result returns the result of the asynchronous operation. 3645 // If the operation has not completed it will return an error. 3646 Result func(LogAnalyticsClient) (LogAnalyticsOperationResult, error) 3647} 3648 3649// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3650func (future *LogAnalyticsExportRequestRateByIntervalFuture) UnmarshalJSON(body []byte) error { 3651 var azFuture azure.Future 3652 if err := json.Unmarshal(body, &azFuture); err != nil { 3653 return err 3654 } 3655 future.FutureAPI = &azFuture 3656 future.Result = future.result 3657 return nil 3658} 3659 3660// result is the default implementation for LogAnalyticsExportRequestRateByIntervalFuture.Result. 3661func (future *LogAnalyticsExportRequestRateByIntervalFuture) result(client LogAnalyticsClient) (laor LogAnalyticsOperationResult, err error) { 3662 var done bool 3663 done, err = future.DoneWithContext(context.Background(), client) 3664 if err != nil { 3665 err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportRequestRateByIntervalFuture", "Result", future.Response(), "Polling failure") 3666 return 3667 } 3668 if !done { 3669 err = azure.NewAsyncOpIncompleteError("compute.LogAnalyticsExportRequestRateByIntervalFuture") 3670 return 3671 } 3672 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3673 if laor.Response.Response, err = future.GetResult(sender); err == nil && laor.Response.Response.StatusCode != http.StatusNoContent { 3674 laor, err = client.ExportRequestRateByIntervalResponder(laor.Response.Response) 3675 if err != nil { 3676 err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportRequestRateByIntervalFuture", "Result", laor.Response.Response, "Failure responding to request") 3677 } 3678 } 3679 return 3680} 3681 3682// LogAnalyticsExportThrottledRequestsFuture an abstraction for monitoring and retrieving the results of a 3683// long-running operation. 3684type LogAnalyticsExportThrottledRequestsFuture struct { 3685 azure.FutureAPI 3686 // Result returns the result of the asynchronous operation. 3687 // If the operation has not completed it will return an error. 3688 Result func(LogAnalyticsClient) (LogAnalyticsOperationResult, error) 3689} 3690 3691// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3692func (future *LogAnalyticsExportThrottledRequestsFuture) UnmarshalJSON(body []byte) error { 3693 var azFuture azure.Future 3694 if err := json.Unmarshal(body, &azFuture); err != nil { 3695 return err 3696 } 3697 future.FutureAPI = &azFuture 3698 future.Result = future.result 3699 return nil 3700} 3701 3702// result is the default implementation for LogAnalyticsExportThrottledRequestsFuture.Result. 3703func (future *LogAnalyticsExportThrottledRequestsFuture) result(client LogAnalyticsClient) (laor LogAnalyticsOperationResult, err error) { 3704 var done bool 3705 done, err = future.DoneWithContext(context.Background(), client) 3706 if err != nil { 3707 err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportThrottledRequestsFuture", "Result", future.Response(), "Polling failure") 3708 return 3709 } 3710 if !done { 3711 err = azure.NewAsyncOpIncompleteError("compute.LogAnalyticsExportThrottledRequestsFuture") 3712 return 3713 } 3714 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3715 if laor.Response.Response, err = future.GetResult(sender); err == nil && laor.Response.Response.StatusCode != http.StatusNoContent { 3716 laor, err = client.ExportThrottledRequestsResponder(laor.Response.Response) 3717 if err != nil { 3718 err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportThrottledRequestsFuture", "Result", laor.Response.Response, "Failure responding to request") 3719 } 3720 } 3721 return 3722} 3723 3724// LogAnalyticsInputBase api input base class for LogAnalytics Api. 3725type LogAnalyticsInputBase struct { 3726 // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. 3727 BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` 3728 // FromTime - From time of the query 3729 FromTime *date.Time `json:"fromTime,omitempty"` 3730 // ToTime - To time of the query 3731 ToTime *date.Time `json:"toTime,omitempty"` 3732 // GroupByThrottlePolicy - Group query result by Throttle Policy applied. 3733 GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` 3734 // GroupByOperationName - Group query result by Operation Name. 3735 GroupByOperationName *bool `json:"groupByOperationName,omitempty"` 3736 // GroupByResourceName - Group query result by Resource Name. 3737 GroupByResourceName *bool `json:"groupByResourceName,omitempty"` 3738 // GroupByClientApplicationID - Group query result by Client Application ID. 3739 GroupByClientApplicationID *bool `json:"groupByClientApplicationId,omitempty"` 3740 // GroupByUserAgent - Group query result by User Agent. 3741 GroupByUserAgent *bool `json:"groupByUserAgent,omitempty"` 3742} 3743 3744// LogAnalyticsOperationResult logAnalytics operation status response 3745type LogAnalyticsOperationResult struct { 3746 autorest.Response `json:"-"` 3747 // Properties - READ-ONLY; LogAnalyticsOutput 3748 Properties *LogAnalyticsOutput `json:"properties,omitempty"` 3749} 3750 3751// LogAnalyticsOutput logAnalytics output properties 3752type LogAnalyticsOutput struct { 3753 // Output - READ-ONLY; Output file Uri path to blob container. 3754 Output *string `json:"output,omitempty"` 3755} 3756 3757// MaintenanceRedeployStatus maintenance Operation Status. 3758type MaintenanceRedeployStatus struct { 3759 // IsCustomerInitiatedMaintenanceAllowed - True, if customer is allowed to perform Maintenance. 3760 IsCustomerInitiatedMaintenanceAllowed *bool `json:"isCustomerInitiatedMaintenanceAllowed,omitempty"` 3761 // PreMaintenanceWindowStartTime - Start Time for the Pre Maintenance Window. 3762 PreMaintenanceWindowStartTime *date.Time `json:"preMaintenanceWindowStartTime,omitempty"` 3763 // PreMaintenanceWindowEndTime - End Time for the Pre Maintenance Window. 3764 PreMaintenanceWindowEndTime *date.Time `json:"preMaintenanceWindowEndTime,omitempty"` 3765 // MaintenanceWindowStartTime - Start Time for the Maintenance Window. 3766 MaintenanceWindowStartTime *date.Time `json:"maintenanceWindowStartTime,omitempty"` 3767 // MaintenanceWindowEndTime - End Time for the Maintenance Window. 3768 MaintenanceWindowEndTime *date.Time `json:"maintenanceWindowEndTime,omitempty"` 3769 // LastOperationResultCode - The Last Maintenance Operation Result Code. Possible values include: 'MaintenanceOperationResultCodeTypesNone', 'MaintenanceOperationResultCodeTypesRetryLater', 'MaintenanceOperationResultCodeTypesMaintenanceAborted', 'MaintenanceOperationResultCodeTypesMaintenanceCompleted' 3770 LastOperationResultCode MaintenanceOperationResultCodeTypes `json:"lastOperationResultCode,omitempty"` 3771 // LastOperationMessage - Message returned for the last Maintenance Operation. 3772 LastOperationMessage *string `json:"lastOperationMessage,omitempty"` 3773} 3774 3775// ManagedDiskParameters the parameters of a managed disk. 3776type ManagedDiskParameters struct { 3777 // StorageAccountType - Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values include: 'StorageAccountTypesStandardLRS', 'StorageAccountTypesPremiumLRS', 'StorageAccountTypesStandardSSDLRS', 'StorageAccountTypesUltraSSDLRS' 3778 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 3779 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed disk. 3780 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 3781 // ID - Resource Id 3782 ID *string `json:"id,omitempty"` 3783} 3784 3785// NetworkInterfaceReference describes a network interface reference. 3786type NetworkInterfaceReference struct { 3787 *NetworkInterfaceReferenceProperties `json:"properties,omitempty"` 3788 // ID - Resource Id 3789 ID *string `json:"id,omitempty"` 3790} 3791 3792// MarshalJSON is the custom marshaler for NetworkInterfaceReference. 3793func (nir NetworkInterfaceReference) MarshalJSON() ([]byte, error) { 3794 objectMap := make(map[string]interface{}) 3795 if nir.NetworkInterfaceReferenceProperties != nil { 3796 objectMap["properties"] = nir.NetworkInterfaceReferenceProperties 3797 } 3798 if nir.ID != nil { 3799 objectMap["id"] = nir.ID 3800 } 3801 return json.Marshal(objectMap) 3802} 3803 3804// UnmarshalJSON is the custom unmarshaler for NetworkInterfaceReference struct. 3805func (nir *NetworkInterfaceReference) UnmarshalJSON(body []byte) error { 3806 var m map[string]*json.RawMessage 3807 err := json.Unmarshal(body, &m) 3808 if err != nil { 3809 return err 3810 } 3811 for k, v := range m { 3812 switch k { 3813 case "properties": 3814 if v != nil { 3815 var networkInterfaceReferenceProperties NetworkInterfaceReferenceProperties 3816 err = json.Unmarshal(*v, &networkInterfaceReferenceProperties) 3817 if err != nil { 3818 return err 3819 } 3820 nir.NetworkInterfaceReferenceProperties = &networkInterfaceReferenceProperties 3821 } 3822 case "id": 3823 if v != nil { 3824 var ID string 3825 err = json.Unmarshal(*v, &ID) 3826 if err != nil { 3827 return err 3828 } 3829 nir.ID = &ID 3830 } 3831 } 3832 } 3833 3834 return nil 3835} 3836 3837// NetworkInterfaceReferenceProperties describes a network interface reference properties. 3838type NetworkInterfaceReferenceProperties struct { 3839 // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. 3840 Primary *bool `json:"primary,omitempty"` 3841} 3842 3843// NetworkProfile specifies the network interfaces of the virtual machine. 3844type NetworkProfile struct { 3845 // NetworkInterfaces - Specifies the list of resource Ids for the network interfaces associated with the virtual machine. 3846 NetworkInterfaces *[]NetworkInterfaceReference `json:"networkInterfaces,omitempty"` 3847} 3848 3849// OperationListResult the List Compute Operation operation response. 3850type OperationListResult struct { 3851 autorest.Response `json:"-"` 3852 // Value - READ-ONLY; The list of compute operations 3853 Value *[]OperationValue `json:"value,omitempty"` 3854} 3855 3856// OperationValue describes the properties of a Compute Operation value. 3857type OperationValue struct { 3858 // Origin - READ-ONLY; The origin of the compute operation. 3859 Origin *string `json:"origin,omitempty"` 3860 // Name - READ-ONLY; The name of the compute operation. 3861 Name *string `json:"name,omitempty"` 3862 *OperationValueDisplay `json:"display,omitempty"` 3863} 3864 3865// MarshalJSON is the custom marshaler for OperationValue. 3866func (ov OperationValue) MarshalJSON() ([]byte, error) { 3867 objectMap := make(map[string]interface{}) 3868 if ov.OperationValueDisplay != nil { 3869 objectMap["display"] = ov.OperationValueDisplay 3870 } 3871 return json.Marshal(objectMap) 3872} 3873 3874// UnmarshalJSON is the custom unmarshaler for OperationValue struct. 3875func (ov *OperationValue) UnmarshalJSON(body []byte) error { 3876 var m map[string]*json.RawMessage 3877 err := json.Unmarshal(body, &m) 3878 if err != nil { 3879 return err 3880 } 3881 for k, v := range m { 3882 switch k { 3883 case "origin": 3884 if v != nil { 3885 var origin string 3886 err = json.Unmarshal(*v, &origin) 3887 if err != nil { 3888 return err 3889 } 3890 ov.Origin = &origin 3891 } 3892 case "name": 3893 if v != nil { 3894 var name string 3895 err = json.Unmarshal(*v, &name) 3896 if err != nil { 3897 return err 3898 } 3899 ov.Name = &name 3900 } 3901 case "display": 3902 if v != nil { 3903 var operationValueDisplay OperationValueDisplay 3904 err = json.Unmarshal(*v, &operationValueDisplay) 3905 if err != nil { 3906 return err 3907 } 3908 ov.OperationValueDisplay = &operationValueDisplay 3909 } 3910 } 3911 } 3912 3913 return nil 3914} 3915 3916// OperationValueDisplay describes the properties of a Compute Operation Value Display. 3917type OperationValueDisplay struct { 3918 // Operation - READ-ONLY; The display name of the compute operation. 3919 Operation *string `json:"operation,omitempty"` 3920 // Resource - READ-ONLY; The display name of the resource the operation applies to. 3921 Resource *string `json:"resource,omitempty"` 3922 // Description - READ-ONLY; The description of the operation. 3923 Description *string `json:"description,omitempty"` 3924 // Provider - READ-ONLY; The resource provider for the operation. 3925 Provider *string `json:"provider,omitempty"` 3926} 3927 3928// OrchestrationServiceStateInput the input for OrchestrationServiceState 3929type OrchestrationServiceStateInput struct { 3930 // ServiceName - The name of the service. Possible values include: 'AutomaticRepairs' 3931 ServiceName OrchestrationServiceNames `json:"serviceName,omitempty"` 3932 // Action - The action to be performed. Possible values include: 'Resume', 'Suspend' 3933 Action OrchestrationServiceStateAction `json:"action,omitempty"` 3934} 3935 3936// OrchestrationServiceSummary summary for an orchestration service of a virtual machine scale set. 3937type OrchestrationServiceSummary struct { 3938 // ServiceName - READ-ONLY; The name of the service. Possible values include: 'AutomaticRepairs', 'DummyOrchestrationServiceName' 3939 ServiceName OrchestrationServiceNames `json:"serviceName,omitempty"` 3940 // ServiceState - READ-ONLY; The current state of the service. Possible values include: 'NotRunning', 'Running', 'Suspended' 3941 ServiceState OrchestrationServiceState `json:"serviceState,omitempty"` 3942} 3943 3944// OSDisk specifies information about the operating system disk used by the virtual machine. <br><br> For 3945// more information about disks, see [About disks and VHDs for Azure virtual 3946// machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). 3947type OSDisk struct { 3948 // 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' 3949 OsType OperatingSystemTypes `json:"osType,omitempty"` 3950 // EncryptionSettings - Specifies the encryption settings for the OS Disk. <br><br> Minimum api-version: 2015-06-15 3951 EncryptionSettings *DiskEncryptionSettings `json:"encryptionSettings,omitempty"` 3952 // Name - The disk name. 3953 Name *string `json:"name,omitempty"` 3954 // Vhd - The virtual hard disk. 3955 Vhd *VirtualHardDisk `json:"vhd,omitempty"` 3956 // 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. 3957 Image *VirtualHardDisk `json:"image,omitempty"` 3958 // Caching - Specifies the caching requirements. <br><br> Possible values are: <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** <br><br> Default: **None** for Standard storage. **ReadOnly** for Premium storage. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' 3959 Caching CachingTypes `json:"caching,omitempty"` 3960 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 3961 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 3962 // DiffDiskSettings - Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine. 3963 DiffDiskSettings *DiffDiskSettings `json:"diffDiskSettings,omitempty"` 3964 // CreateOption - Specifies how the virtual machine should be created.<br><br> Possible values are:<br><br> **Attach** \u2013 This value is used when you are using a specialized disk to create the virtual machine.<br><br> **FromImage** \u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' 3965 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 3966 // 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 3967 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 3968 // ManagedDisk - The managed disk parameters. 3969 ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` 3970} 3971 3972// OSDiskImage contains the os disk image information. 3973type OSDiskImage struct { 3974 // OperatingSystem - The operating system of the osDiskImage. Possible values include: 'Windows', 'Linux' 3975 OperatingSystem OperatingSystemTypes `json:"operatingSystem,omitempty"` 3976} 3977 3978// OSProfile specifies the operating system settings for the virtual machine. Some of the settings cannot 3979// be changed once VM is provisioned. 3980type OSProfile struct { 3981 // 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). 3982 ComputerName *string `json:"computerName,omitempty"` 3983 // AdminUsername - Specifies the name of the administrator account. <br><br> This property cannot be updated after the VM is created. <br><br> **Windows-only restriction:** Cannot end in "." <br><br> **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". <br><br> **Minimum-length (Linux):** 1 character <br><br> **Max-length (Linux):** 64 characters <br><br> **Max-length (Windows):** 20 characters <br><br><li> For root access to the Linux VM, see [Using root privileges on Linux virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)<br><li> For a list of built-in system users on Linux that should not be used in this field, see [Selecting User Names for Linux on Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) 3984 AdminUsername *string `json:"adminUsername,omitempty"` 3985 // 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) 3986 AdminPassword *string `json:"adminPassword,omitempty"` 3987 // CustomData - Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array is 65535 bytes. <br><br> **Note: Do not pass any secrets or passwords in customData property** <br><br> This property cannot be updated after the VM is created. <br><br> customData is passed to the VM to be saved as a file, for more information see [Custom Data on Azure VMs](https://azure.microsoft.com/en-us/blog/custom-data-and-cloud-init-on-windows-azure/) <br><br> For using cloud-init for your Linux VM, see [Using cloud-init to customize a Linux VM during creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) 3988 CustomData *string `json:"customData,omitempty"` 3989 // WindowsConfiguration - Specifies Windows operating system settings on the virtual machine. 3990 WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` 3991 // 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). 3992 LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` 3993 // Secrets - Specifies set of certificates that should be installed onto the virtual machine. 3994 Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` 3995 // AllowExtensionOperations - Specifies whether extension operations should be allowed on the virtual machine. <br><br>This may only be set to False when no extensions are present on the virtual machine. 3996 AllowExtensionOperations *bool `json:"allowExtensionOperations,omitempty"` 3997 // RequireGuestProvisionSignal - Specifies whether the guest provision signal is required to infer provision success of the virtual machine. **Note: This property is for private testing only, and all customers must not set the property to false.** 3998 RequireGuestProvisionSignal *bool `json:"requireGuestProvisionSignal,omitempty"` 3999} 4000 4001// PatchSettings ... 4002type PatchSettings struct { 4003 // PatchMode - Specifies the mode of in-guest patching to IaaS virtual machine.<br /><br /> Possible values are:<br /><br /> **Manual** - You control the application of patches to a virtual machine. You do this by applying patches manually inside the VM. In this mode, automatic updates are disabled; the property WindowsConfiguration.enableAutomaticUpdates must be false<br /><br /> **AutomaticByOS** - The virtual machine will automatically be updated by the OS. The property WindowsConfiguration.enableAutomaticUpdates must be true. <br /><br /> **AutomaticByPlatform** - the virtual machine will automatically updated by the platform. The properties provisionVMAgent and WindowsConfiguration.enableAutomaticUpdates must be true. Possible values include: 'Manual', 'AutomaticByOS', 'AutomaticByPlatform' 4004 PatchMode InGuestPatchMode `json:"patchMode,omitempty"` 4005} 4006 4007// Plan specifies information about the marketplace image used to create the virtual machine. This element 4008// is only used for marketplace images. Before you can use a marketplace image from an API, you must enable 4009// the image for programmatic use. In the Azure portal, find the marketplace image that you want to use 4010// and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and 4011// then click **Save**. 4012type Plan struct { 4013 // Name - The plan ID. 4014 Name *string `json:"name,omitempty"` 4015 // Publisher - The publisher ID. 4016 Publisher *string `json:"publisher,omitempty"` 4017 // Product - Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. 4018 Product *string `json:"product,omitempty"` 4019 // PromotionCode - The promotion code. 4020 PromotionCode *string `json:"promotionCode,omitempty"` 4021} 4022 4023// ProximityPlacementGroup specifies information about the proximity placement group. 4024type ProximityPlacementGroup struct { 4025 autorest.Response `json:"-"` 4026 // ProximityPlacementGroupProperties - Describes the properties of a Proximity Placement Group. 4027 *ProximityPlacementGroupProperties `json:"properties,omitempty"` 4028 // ID - READ-ONLY; Resource Id 4029 ID *string `json:"id,omitempty"` 4030 // Name - READ-ONLY; Resource name 4031 Name *string `json:"name,omitempty"` 4032 // Type - READ-ONLY; Resource type 4033 Type *string `json:"type,omitempty"` 4034 // Location - Resource location 4035 Location *string `json:"location,omitempty"` 4036 // Tags - Resource tags 4037 Tags map[string]*string `json:"tags"` 4038} 4039 4040// MarshalJSON is the custom marshaler for ProximityPlacementGroup. 4041func (ppg ProximityPlacementGroup) MarshalJSON() ([]byte, error) { 4042 objectMap := make(map[string]interface{}) 4043 if ppg.ProximityPlacementGroupProperties != nil { 4044 objectMap["properties"] = ppg.ProximityPlacementGroupProperties 4045 } 4046 if ppg.Location != nil { 4047 objectMap["location"] = ppg.Location 4048 } 4049 if ppg.Tags != nil { 4050 objectMap["tags"] = ppg.Tags 4051 } 4052 return json.Marshal(objectMap) 4053} 4054 4055// UnmarshalJSON is the custom unmarshaler for ProximityPlacementGroup struct. 4056func (ppg *ProximityPlacementGroup) UnmarshalJSON(body []byte) error { 4057 var m map[string]*json.RawMessage 4058 err := json.Unmarshal(body, &m) 4059 if err != nil { 4060 return err 4061 } 4062 for k, v := range m { 4063 switch k { 4064 case "properties": 4065 if v != nil { 4066 var proximityPlacementGroupProperties ProximityPlacementGroupProperties 4067 err = json.Unmarshal(*v, &proximityPlacementGroupProperties) 4068 if err != nil { 4069 return err 4070 } 4071 ppg.ProximityPlacementGroupProperties = &proximityPlacementGroupProperties 4072 } 4073 case "id": 4074 if v != nil { 4075 var ID string 4076 err = json.Unmarshal(*v, &ID) 4077 if err != nil { 4078 return err 4079 } 4080 ppg.ID = &ID 4081 } 4082 case "name": 4083 if v != nil { 4084 var name string 4085 err = json.Unmarshal(*v, &name) 4086 if err != nil { 4087 return err 4088 } 4089 ppg.Name = &name 4090 } 4091 case "type": 4092 if v != nil { 4093 var typeVar string 4094 err = json.Unmarshal(*v, &typeVar) 4095 if err != nil { 4096 return err 4097 } 4098 ppg.Type = &typeVar 4099 } 4100 case "location": 4101 if v != nil { 4102 var location string 4103 err = json.Unmarshal(*v, &location) 4104 if err != nil { 4105 return err 4106 } 4107 ppg.Location = &location 4108 } 4109 case "tags": 4110 if v != nil { 4111 var tags map[string]*string 4112 err = json.Unmarshal(*v, &tags) 4113 if err != nil { 4114 return err 4115 } 4116 ppg.Tags = tags 4117 } 4118 } 4119 } 4120 4121 return nil 4122} 4123 4124// ProximityPlacementGroupListResult the List Proximity Placement Group operation response. 4125type ProximityPlacementGroupListResult struct { 4126 autorest.Response `json:"-"` 4127 // Value - The list of proximity placement groups 4128 Value *[]ProximityPlacementGroup `json:"value,omitempty"` 4129 // NextLink - The URI to fetch the next page of proximity placement groups. 4130 NextLink *string `json:"nextLink,omitempty"` 4131} 4132 4133// ProximityPlacementGroupListResultIterator provides access to a complete listing of 4134// ProximityPlacementGroup values. 4135type ProximityPlacementGroupListResultIterator struct { 4136 i int 4137 page ProximityPlacementGroupListResultPage 4138} 4139 4140// NextWithContext advances to the next value. If there was an error making 4141// the request the iterator does not advance and the error is returned. 4142func (iter *ProximityPlacementGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { 4143 if tracing.IsEnabled() { 4144 ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupListResultIterator.NextWithContext") 4145 defer func() { 4146 sc := -1 4147 if iter.Response().Response.Response != nil { 4148 sc = iter.Response().Response.Response.StatusCode 4149 } 4150 tracing.EndSpan(ctx, sc, err) 4151 }() 4152 } 4153 iter.i++ 4154 if iter.i < len(iter.page.Values()) { 4155 return nil 4156 } 4157 err = iter.page.NextWithContext(ctx) 4158 if err != nil { 4159 iter.i-- 4160 return err 4161 } 4162 iter.i = 0 4163 return nil 4164} 4165 4166// Next advances to the next value. If there was an error making 4167// the request the iterator does not advance and the error is returned. 4168// Deprecated: Use NextWithContext() instead. 4169func (iter *ProximityPlacementGroupListResultIterator) Next() error { 4170 return iter.NextWithContext(context.Background()) 4171} 4172 4173// NotDone returns true if the enumeration should be started or is not yet complete. 4174func (iter ProximityPlacementGroupListResultIterator) NotDone() bool { 4175 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4176} 4177 4178// Response returns the raw server response from the last page request. 4179func (iter ProximityPlacementGroupListResultIterator) Response() ProximityPlacementGroupListResult { 4180 return iter.page.Response() 4181} 4182 4183// Value returns the current value or a zero-initialized value if the 4184// iterator has advanced beyond the end of the collection. 4185func (iter ProximityPlacementGroupListResultIterator) Value() ProximityPlacementGroup { 4186 if !iter.page.NotDone() { 4187 return ProximityPlacementGroup{} 4188 } 4189 return iter.page.Values()[iter.i] 4190} 4191 4192// Creates a new instance of the ProximityPlacementGroupListResultIterator type. 4193func NewProximityPlacementGroupListResultIterator(page ProximityPlacementGroupListResultPage) ProximityPlacementGroupListResultIterator { 4194 return ProximityPlacementGroupListResultIterator{page: page} 4195} 4196 4197// IsEmpty returns true if the ListResult contains no values. 4198func (ppglr ProximityPlacementGroupListResult) IsEmpty() bool { 4199 return ppglr.Value == nil || len(*ppglr.Value) == 0 4200} 4201 4202// hasNextLink returns true if the NextLink is not empty. 4203func (ppglr ProximityPlacementGroupListResult) hasNextLink() bool { 4204 return ppglr.NextLink != nil && len(*ppglr.NextLink) != 0 4205} 4206 4207// proximityPlacementGroupListResultPreparer prepares a request to retrieve the next set of results. 4208// It returns nil if no more results exist. 4209func (ppglr ProximityPlacementGroupListResult) proximityPlacementGroupListResultPreparer(ctx context.Context) (*http.Request, error) { 4210 if !ppglr.hasNextLink() { 4211 return nil, nil 4212 } 4213 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4214 autorest.AsJSON(), 4215 autorest.AsGet(), 4216 autorest.WithBaseURL(to.String(ppglr.NextLink))) 4217} 4218 4219// ProximityPlacementGroupListResultPage contains a page of ProximityPlacementGroup values. 4220type ProximityPlacementGroupListResultPage struct { 4221 fn func(context.Context, ProximityPlacementGroupListResult) (ProximityPlacementGroupListResult, error) 4222 ppglr ProximityPlacementGroupListResult 4223} 4224 4225// NextWithContext advances to the next page of values. If there was an error making 4226// the request the page does not advance and the error is returned. 4227func (page *ProximityPlacementGroupListResultPage) NextWithContext(ctx context.Context) (err error) { 4228 if tracing.IsEnabled() { 4229 ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupListResultPage.NextWithContext") 4230 defer func() { 4231 sc := -1 4232 if page.Response().Response.Response != nil { 4233 sc = page.Response().Response.Response.StatusCode 4234 } 4235 tracing.EndSpan(ctx, sc, err) 4236 }() 4237 } 4238 for { 4239 next, err := page.fn(ctx, page.ppglr) 4240 if err != nil { 4241 return err 4242 } 4243 page.ppglr = next 4244 if !next.hasNextLink() || !next.IsEmpty() { 4245 break 4246 } 4247 } 4248 return nil 4249} 4250 4251// Next advances to the next page of values. If there was an error making 4252// the request the page does not advance and the error is returned. 4253// Deprecated: Use NextWithContext() instead. 4254func (page *ProximityPlacementGroupListResultPage) Next() error { 4255 return page.NextWithContext(context.Background()) 4256} 4257 4258// NotDone returns true if the page enumeration should be started or is not yet complete. 4259func (page ProximityPlacementGroupListResultPage) NotDone() bool { 4260 return !page.ppglr.IsEmpty() 4261} 4262 4263// Response returns the raw server response from the last page request. 4264func (page ProximityPlacementGroupListResultPage) Response() ProximityPlacementGroupListResult { 4265 return page.ppglr 4266} 4267 4268// Values returns the slice of values for the current page or nil if there are no values. 4269func (page ProximityPlacementGroupListResultPage) Values() []ProximityPlacementGroup { 4270 if page.ppglr.IsEmpty() { 4271 return nil 4272 } 4273 return *page.ppglr.Value 4274} 4275 4276// Creates a new instance of the ProximityPlacementGroupListResultPage type. 4277func NewProximityPlacementGroupListResultPage(cur ProximityPlacementGroupListResult, getNextPage func(context.Context, ProximityPlacementGroupListResult) (ProximityPlacementGroupListResult, error)) ProximityPlacementGroupListResultPage { 4278 return ProximityPlacementGroupListResultPage{ 4279 fn: getNextPage, 4280 ppglr: cur, 4281 } 4282} 4283 4284// ProximityPlacementGroupProperties describes the properties of a Proximity Placement Group. 4285type ProximityPlacementGroupProperties struct { 4286 // ProximityPlacementGroupType - Specifies the type of the proximity placement group. <br><br> Possible values are: <br><br> **Standard** : Co-locate resources within an Azure region or Availability Zone. <br><br> **Ultra** : For future use. Possible values include: 'Standard', 'Ultra' 4287 ProximityPlacementGroupType ProximityPlacementGroupType `json:"proximityPlacementGroupType,omitempty"` 4288 // VirtualMachines - READ-ONLY; A list of references to all virtual machines in the proximity placement group. 4289 VirtualMachines *[]SubResourceWithColocationStatus `json:"virtualMachines,omitempty"` 4290 // VirtualMachineScaleSets - READ-ONLY; A list of references to all virtual machine scale sets in the proximity placement group. 4291 VirtualMachineScaleSets *[]SubResourceWithColocationStatus `json:"virtualMachineScaleSets,omitempty"` 4292 // AvailabilitySets - READ-ONLY; A list of references to all availability sets in the proximity placement group. 4293 AvailabilitySets *[]SubResourceWithColocationStatus `json:"availabilitySets,omitempty"` 4294 // ColocationStatus - Describes colocation status of the Proximity Placement Group. 4295 ColocationStatus *InstanceViewStatus `json:"colocationStatus,omitempty"` 4296} 4297 4298// MarshalJSON is the custom marshaler for ProximityPlacementGroupProperties. 4299func (ppgp ProximityPlacementGroupProperties) MarshalJSON() ([]byte, error) { 4300 objectMap := make(map[string]interface{}) 4301 if ppgp.ProximityPlacementGroupType != "" { 4302 objectMap["proximityPlacementGroupType"] = ppgp.ProximityPlacementGroupType 4303 } 4304 if ppgp.ColocationStatus != nil { 4305 objectMap["colocationStatus"] = ppgp.ColocationStatus 4306 } 4307 return json.Marshal(objectMap) 4308} 4309 4310// ProximityPlacementGroupUpdate specifies information about the proximity placement group. 4311type ProximityPlacementGroupUpdate struct { 4312 // Tags - Resource tags 4313 Tags map[string]*string `json:"tags"` 4314} 4315 4316// MarshalJSON is the custom marshaler for ProximityPlacementGroupUpdate. 4317func (ppgu ProximityPlacementGroupUpdate) MarshalJSON() ([]byte, error) { 4318 objectMap := make(map[string]interface{}) 4319 if ppgu.Tags != nil { 4320 objectMap["tags"] = ppgu.Tags 4321 } 4322 return json.Marshal(objectMap) 4323} 4324 4325// PurchasePlan used for establishing the purchase context of any 3rd Party artifact through MarketPlace. 4326type PurchasePlan struct { 4327 // Publisher - The publisher ID. 4328 Publisher *string `json:"publisher,omitempty"` 4329 // Name - The plan ID. 4330 Name *string `json:"name,omitempty"` 4331 // Product - Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. 4332 Product *string `json:"product,omitempty"` 4333} 4334 4335// RecoveryWalkResponse response after calling a manual recovery walk 4336type RecoveryWalkResponse struct { 4337 autorest.Response `json:"-"` 4338 // WalkPerformed - READ-ONLY; Whether the recovery walk was performed 4339 WalkPerformed *bool `json:"walkPerformed,omitempty"` 4340 // NextPlatformUpdateDomain - READ-ONLY; The next update domain that needs to be walked. Null means walk spanning all update domains has been completed 4341 NextPlatformUpdateDomain *int32 `json:"nextPlatformUpdateDomain,omitempty"` 4342} 4343 4344// RequestRateByIntervalInput api request input for LogAnalytics getRequestRateByInterval Api. 4345type RequestRateByIntervalInput struct { 4346 // IntervalLength - Interval value in minutes used to create LogAnalytics call rate logs. Possible values include: 'ThreeMins', 'FiveMins', 'ThirtyMins', 'SixtyMins' 4347 IntervalLength IntervalInMins `json:"intervalLength,omitempty"` 4348 // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. 4349 BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` 4350 // FromTime - From time of the query 4351 FromTime *date.Time `json:"fromTime,omitempty"` 4352 // ToTime - To time of the query 4353 ToTime *date.Time `json:"toTime,omitempty"` 4354 // GroupByThrottlePolicy - Group query result by Throttle Policy applied. 4355 GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` 4356 // GroupByOperationName - Group query result by Operation Name. 4357 GroupByOperationName *bool `json:"groupByOperationName,omitempty"` 4358 // GroupByResourceName - Group query result by Resource Name. 4359 GroupByResourceName *bool `json:"groupByResourceName,omitempty"` 4360 // GroupByClientApplicationID - Group query result by Client Application ID. 4361 GroupByClientApplicationID *bool `json:"groupByClientApplicationId,omitempty"` 4362 // GroupByUserAgent - Group query result by User Agent. 4363 GroupByUserAgent *bool `json:"groupByUserAgent,omitempty"` 4364} 4365 4366// Resource the Resource model definition. 4367type Resource struct { 4368 // ID - READ-ONLY; Resource Id 4369 ID *string `json:"id,omitempty"` 4370 // Name - READ-ONLY; Resource name 4371 Name *string `json:"name,omitempty"` 4372 // Type - READ-ONLY; Resource type 4373 Type *string `json:"type,omitempty"` 4374 // Location - Resource location 4375 Location *string `json:"location,omitempty"` 4376 // Tags - Resource tags 4377 Tags map[string]*string `json:"tags"` 4378} 4379 4380// MarshalJSON is the custom marshaler for Resource. 4381func (r Resource) MarshalJSON() ([]byte, error) { 4382 objectMap := make(map[string]interface{}) 4383 if r.Location != nil { 4384 objectMap["location"] = r.Location 4385 } 4386 if r.Tags != nil { 4387 objectMap["tags"] = r.Tags 4388 } 4389 return json.Marshal(objectMap) 4390} 4391 4392// RetrieveBootDiagnosticsDataResult the SAS URIs of the console screenshot and serial log blobs. 4393type RetrieveBootDiagnosticsDataResult struct { 4394 autorest.Response `json:"-"` 4395 // ConsoleScreenshotBlobURI - READ-ONLY; The console screenshot blob URI 4396 ConsoleScreenshotBlobURI *string `json:"consoleScreenshotBlobUri,omitempty"` 4397 // SerialConsoleLogBlobURI - READ-ONLY; The serial console log blob URI. 4398 SerialConsoleLogBlobURI *string `json:"serialConsoleLogBlobUri,omitempty"` 4399} 4400 4401// RollbackStatusInfo information about rollback on failed VM instances after a OS Upgrade operation. 4402type RollbackStatusInfo struct { 4403 // SuccessfullyRolledbackInstanceCount - READ-ONLY; The number of instances which have been successfully rolled back. 4404 SuccessfullyRolledbackInstanceCount *int32 `json:"successfullyRolledbackInstanceCount,omitempty"` 4405 // FailedRolledbackInstanceCount - READ-ONLY; The number of instances which failed to rollback. 4406 FailedRolledbackInstanceCount *int32 `json:"failedRolledbackInstanceCount,omitempty"` 4407 // RollbackError - READ-ONLY; Error details if OS rollback failed. 4408 RollbackError *APIError `json:"rollbackError,omitempty"` 4409} 4410 4411// RollingUpgradePolicy the configuration parameters used while performing a rolling upgrade. 4412type RollingUpgradePolicy struct { 4413 // MaxBatchInstancePercent - The maximum percent of total virtual machine instances that will be upgraded simultaneously by the rolling upgrade in one batch. As this is a maximum, unhealthy instances in previous or future batches can cause the percentage of instances in a batch to decrease to ensure higher reliability. The default value for this parameter is 20%. 4414 MaxBatchInstancePercent *int32 `json:"maxBatchInstancePercent,omitempty"` 4415 // MaxUnhealthyInstancePercent - The maximum percentage of the total virtual machine instances in the scale set that can be simultaneously unhealthy, either as a result of being upgraded, or by being found in an unhealthy state by the virtual machine health checks before the rolling upgrade aborts. This constraint will be checked prior to starting any batch. The default value for this parameter is 20%. 4416 MaxUnhealthyInstancePercent *int32 `json:"maxUnhealthyInstancePercent,omitempty"` 4417 // MaxUnhealthyUpgradedInstancePercent - The maximum percentage of upgraded virtual machine instances that can be found to be in an unhealthy state. This check will happen after each batch is upgraded. If this percentage is ever exceeded, the rolling update aborts. The default value for this parameter is 20%. 4418 MaxUnhealthyUpgradedInstancePercent *int32 `json:"maxUnhealthyUpgradedInstancePercent,omitempty"` 4419 // PauseTimeBetweenBatches - The wait time between completing the update for all virtual machines in one batch and starting the next batch. The time duration should be specified in ISO 8601 format. The default value is 0 seconds (PT0S). 4420 PauseTimeBetweenBatches *string `json:"pauseTimeBetweenBatches,omitempty"` 4421} 4422 4423// RollingUpgradeProgressInfo information about the number of virtual machine instances in each upgrade 4424// state. 4425type RollingUpgradeProgressInfo struct { 4426 // SuccessfulInstanceCount - READ-ONLY; The number of instances that have been successfully upgraded. 4427 SuccessfulInstanceCount *int32 `json:"successfulInstanceCount,omitempty"` 4428 // FailedInstanceCount - READ-ONLY; The number of instances that have failed to be upgraded successfully. 4429 FailedInstanceCount *int32 `json:"failedInstanceCount,omitempty"` 4430 // InProgressInstanceCount - READ-ONLY; The number of instances that are currently being upgraded. 4431 InProgressInstanceCount *int32 `json:"inProgressInstanceCount,omitempty"` 4432 // PendingInstanceCount - READ-ONLY; The number of instances that have not yet begun to be upgraded. 4433 PendingInstanceCount *int32 `json:"pendingInstanceCount,omitempty"` 4434} 4435 4436// RollingUpgradeRunningStatus information about the current running state of the overall upgrade. 4437type RollingUpgradeRunningStatus struct { 4438 // Code - READ-ONLY; Code indicating the current status of the upgrade. Possible values include: 'RollingForward', 'Cancelled', 'Completed', 'Faulted' 4439 Code RollingUpgradeStatusCode `json:"code,omitempty"` 4440 // StartTime - READ-ONLY; Start time of the upgrade. 4441 StartTime *date.Time `json:"startTime,omitempty"` 4442 // LastAction - READ-ONLY; The last action performed on the rolling upgrade. Possible values include: 'Start', 'Cancel' 4443 LastAction RollingUpgradeActionType `json:"lastAction,omitempty"` 4444 // LastActionTime - READ-ONLY; Last action time of the upgrade. 4445 LastActionTime *date.Time `json:"lastActionTime,omitempty"` 4446} 4447 4448// RollingUpgradeStatusInfo the status of the latest virtual machine scale set rolling upgrade. 4449type RollingUpgradeStatusInfo struct { 4450 autorest.Response `json:"-"` 4451 *RollingUpgradeStatusInfoProperties `json:"properties,omitempty"` 4452 // ID - READ-ONLY; Resource Id 4453 ID *string `json:"id,omitempty"` 4454 // Name - READ-ONLY; Resource name 4455 Name *string `json:"name,omitempty"` 4456 // Type - READ-ONLY; Resource type 4457 Type *string `json:"type,omitempty"` 4458 // Location - Resource location 4459 Location *string `json:"location,omitempty"` 4460 // Tags - Resource tags 4461 Tags map[string]*string `json:"tags"` 4462} 4463 4464// MarshalJSON is the custom marshaler for RollingUpgradeStatusInfo. 4465func (rusi RollingUpgradeStatusInfo) MarshalJSON() ([]byte, error) { 4466 objectMap := make(map[string]interface{}) 4467 if rusi.RollingUpgradeStatusInfoProperties != nil { 4468 objectMap["properties"] = rusi.RollingUpgradeStatusInfoProperties 4469 } 4470 if rusi.Location != nil { 4471 objectMap["location"] = rusi.Location 4472 } 4473 if rusi.Tags != nil { 4474 objectMap["tags"] = rusi.Tags 4475 } 4476 return json.Marshal(objectMap) 4477} 4478 4479// UnmarshalJSON is the custom unmarshaler for RollingUpgradeStatusInfo struct. 4480func (rusi *RollingUpgradeStatusInfo) UnmarshalJSON(body []byte) error { 4481 var m map[string]*json.RawMessage 4482 err := json.Unmarshal(body, &m) 4483 if err != nil { 4484 return err 4485 } 4486 for k, v := range m { 4487 switch k { 4488 case "properties": 4489 if v != nil { 4490 var rollingUpgradeStatusInfoProperties RollingUpgradeStatusInfoProperties 4491 err = json.Unmarshal(*v, &rollingUpgradeStatusInfoProperties) 4492 if err != nil { 4493 return err 4494 } 4495 rusi.RollingUpgradeStatusInfoProperties = &rollingUpgradeStatusInfoProperties 4496 } 4497 case "id": 4498 if v != nil { 4499 var ID string 4500 err = json.Unmarshal(*v, &ID) 4501 if err != nil { 4502 return err 4503 } 4504 rusi.ID = &ID 4505 } 4506 case "name": 4507 if v != nil { 4508 var name string 4509 err = json.Unmarshal(*v, &name) 4510 if err != nil { 4511 return err 4512 } 4513 rusi.Name = &name 4514 } 4515 case "type": 4516 if v != nil { 4517 var typeVar string 4518 err = json.Unmarshal(*v, &typeVar) 4519 if err != nil { 4520 return err 4521 } 4522 rusi.Type = &typeVar 4523 } 4524 case "location": 4525 if v != nil { 4526 var location string 4527 err = json.Unmarshal(*v, &location) 4528 if err != nil { 4529 return err 4530 } 4531 rusi.Location = &location 4532 } 4533 case "tags": 4534 if v != nil { 4535 var tags map[string]*string 4536 err = json.Unmarshal(*v, &tags) 4537 if err != nil { 4538 return err 4539 } 4540 rusi.Tags = tags 4541 } 4542 } 4543 } 4544 4545 return nil 4546} 4547 4548// RollingUpgradeStatusInfoProperties the status of the latest virtual machine scale set rolling upgrade. 4549type RollingUpgradeStatusInfoProperties struct { 4550 // Policy - READ-ONLY; The rolling upgrade policies applied for this upgrade. 4551 Policy *RollingUpgradePolicy `json:"policy,omitempty"` 4552 // RunningStatus - READ-ONLY; Information about the current running state of the overall upgrade. 4553 RunningStatus *RollingUpgradeRunningStatus `json:"runningStatus,omitempty"` 4554 // Progress - READ-ONLY; Information about the number of virtual machine instances in each upgrade state. 4555 Progress *RollingUpgradeProgressInfo `json:"progress,omitempty"` 4556 // Error - READ-ONLY; Error details for this upgrade, if there are any. 4557 Error *APIError `json:"error,omitempty"` 4558} 4559 4560// ScaleInPolicy describes a scale-in policy for a virtual machine scale set. 4561type ScaleInPolicy struct { 4562 // Rules - The rules to be followed when scaling-in a virtual machine scale set. <br><br> Possible values are: <br><br> **Default** When a virtual machine scale set is scaled in, the scale set will first be balanced across zones if it is a zonal scale set. Then, it will be balanced across Fault Domains as far as possible. Within each Fault Domain, the virtual machines chosen for removal will be the newest ones that are not protected from scale-in. <br><br> **OldestVM** When a virtual machine scale set is being scaled-in, the oldest virtual machines that are not protected from scale-in will be chosen for removal. For zonal virtual machine scale sets, the scale set will first be balanced across zones. Within each zone, the oldest virtual machines that are not protected will be chosen for removal. <br><br> **NewestVM** When a virtual machine scale set is being scaled-in, the newest virtual machines that are not protected from scale-in will be chosen for removal. For zonal virtual machine scale sets, the scale set will first be balanced across zones. Within each zone, the newest virtual machines that are not protected will be chosen for removal. <br><br> 4563 Rules *[]VirtualMachineScaleSetScaleInRules `json:"rules,omitempty"` 4564} 4565 4566// ScheduledEventsProfile ... 4567type ScheduledEventsProfile struct { 4568 // TerminateNotificationProfile - Specifies Terminate Scheduled Event related configurations. 4569 TerminateNotificationProfile *TerminateNotificationProfile `json:"terminateNotificationProfile,omitempty"` 4570} 4571 4572// SecurityProfile specifies the Security profile settings for the virtual machine or virtual machine scale 4573// set. 4574type SecurityProfile struct { 4575 // EncryptionAtHost - This property can be used by user in the request to enable or disable the Host Encryption for the virtual machine or virtual machine scale set. This will enable the encryption for all the disks including Resource/Temp disk at host itself. <br><br> Default: The Encryption at host will be disabled unless this property is set to true for the resource. 4576 EncryptionAtHost *bool `json:"encryptionAtHost,omitempty"` 4577} 4578 4579// Sku describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware 4580// the scale set is currently on, you need to deallocate the VMs in the scale set before you modify the SKU 4581// name. 4582type Sku struct { 4583 // Name - The sku name. 4584 Name *string `json:"name,omitempty"` 4585 // Tier - Specifies the tier of virtual machines in a scale set.<br /><br /> Possible Values:<br /><br /> **Standard**<br /><br /> **Basic** 4586 Tier *string `json:"tier,omitempty"` 4587 // Capacity - Specifies the number of virtual machines in the scale set. 4588 Capacity *int64 `json:"capacity,omitempty"` 4589} 4590 4591// Snapshot snapshot resource. 4592type Snapshot struct { 4593 autorest.Response `json:"-"` 4594 // ManagedBy - READ-ONLY; Unused. Always Null. 4595 ManagedBy *string `json:"managedBy,omitempty"` 4596 Sku *SnapshotSku `json:"sku,omitempty"` 4597 *SnapshotProperties `json:"properties,omitempty"` 4598 // ID - READ-ONLY; Resource Id 4599 ID *string `json:"id,omitempty"` 4600 // Name - READ-ONLY; Resource name 4601 Name *string `json:"name,omitempty"` 4602 // Type - READ-ONLY; Resource type 4603 Type *string `json:"type,omitempty"` 4604 // Location - Resource location 4605 Location *string `json:"location,omitempty"` 4606 // Tags - Resource tags 4607 Tags map[string]*string `json:"tags"` 4608} 4609 4610// MarshalJSON is the custom marshaler for Snapshot. 4611func (s Snapshot) MarshalJSON() ([]byte, error) { 4612 objectMap := make(map[string]interface{}) 4613 if s.Sku != nil { 4614 objectMap["sku"] = s.Sku 4615 } 4616 if s.SnapshotProperties != nil { 4617 objectMap["properties"] = s.SnapshotProperties 4618 } 4619 if s.Location != nil { 4620 objectMap["location"] = s.Location 4621 } 4622 if s.Tags != nil { 4623 objectMap["tags"] = s.Tags 4624 } 4625 return json.Marshal(objectMap) 4626} 4627 4628// UnmarshalJSON is the custom unmarshaler for Snapshot struct. 4629func (s *Snapshot) UnmarshalJSON(body []byte) error { 4630 var m map[string]*json.RawMessage 4631 err := json.Unmarshal(body, &m) 4632 if err != nil { 4633 return err 4634 } 4635 for k, v := range m { 4636 switch k { 4637 case "managedBy": 4638 if v != nil { 4639 var managedBy string 4640 err = json.Unmarshal(*v, &managedBy) 4641 if err != nil { 4642 return err 4643 } 4644 s.ManagedBy = &managedBy 4645 } 4646 case "sku": 4647 if v != nil { 4648 var sku SnapshotSku 4649 err = json.Unmarshal(*v, &sku) 4650 if err != nil { 4651 return err 4652 } 4653 s.Sku = &sku 4654 } 4655 case "properties": 4656 if v != nil { 4657 var snapshotProperties SnapshotProperties 4658 err = json.Unmarshal(*v, &snapshotProperties) 4659 if err != nil { 4660 return err 4661 } 4662 s.SnapshotProperties = &snapshotProperties 4663 } 4664 case "id": 4665 if v != nil { 4666 var ID string 4667 err = json.Unmarshal(*v, &ID) 4668 if err != nil { 4669 return err 4670 } 4671 s.ID = &ID 4672 } 4673 case "name": 4674 if v != nil { 4675 var name string 4676 err = json.Unmarshal(*v, &name) 4677 if err != nil { 4678 return err 4679 } 4680 s.Name = &name 4681 } 4682 case "type": 4683 if v != nil { 4684 var typeVar string 4685 err = json.Unmarshal(*v, &typeVar) 4686 if err != nil { 4687 return err 4688 } 4689 s.Type = &typeVar 4690 } 4691 case "location": 4692 if v != nil { 4693 var location string 4694 err = json.Unmarshal(*v, &location) 4695 if err != nil { 4696 return err 4697 } 4698 s.Location = &location 4699 } 4700 case "tags": 4701 if v != nil { 4702 var tags map[string]*string 4703 err = json.Unmarshal(*v, &tags) 4704 if err != nil { 4705 return err 4706 } 4707 s.Tags = tags 4708 } 4709 } 4710 } 4711 4712 return nil 4713} 4714 4715// SnapshotList the List Snapshots operation response. 4716type SnapshotList struct { 4717 autorest.Response `json:"-"` 4718 // Value - A list of snapshots. 4719 Value *[]Snapshot `json:"value,omitempty"` 4720 // NextLink - The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the next page of snapshots. 4721 NextLink *string `json:"nextLink,omitempty"` 4722} 4723 4724// SnapshotListIterator provides access to a complete listing of Snapshot values. 4725type SnapshotListIterator struct { 4726 i int 4727 page SnapshotListPage 4728} 4729 4730// NextWithContext advances to the next value. If there was an error making 4731// the request the iterator does not advance and the error is returned. 4732func (iter *SnapshotListIterator) NextWithContext(ctx context.Context) (err error) { 4733 if tracing.IsEnabled() { 4734 ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotListIterator.NextWithContext") 4735 defer func() { 4736 sc := -1 4737 if iter.Response().Response.Response != nil { 4738 sc = iter.Response().Response.Response.StatusCode 4739 } 4740 tracing.EndSpan(ctx, sc, err) 4741 }() 4742 } 4743 iter.i++ 4744 if iter.i < len(iter.page.Values()) { 4745 return nil 4746 } 4747 err = iter.page.NextWithContext(ctx) 4748 if err != nil { 4749 iter.i-- 4750 return err 4751 } 4752 iter.i = 0 4753 return nil 4754} 4755 4756// Next advances to the next value. If there was an error making 4757// the request the iterator does not advance and the error is returned. 4758// Deprecated: Use NextWithContext() instead. 4759func (iter *SnapshotListIterator) Next() error { 4760 return iter.NextWithContext(context.Background()) 4761} 4762 4763// NotDone returns true if the enumeration should be started or is not yet complete. 4764func (iter SnapshotListIterator) NotDone() bool { 4765 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4766} 4767 4768// Response returns the raw server response from the last page request. 4769func (iter SnapshotListIterator) Response() SnapshotList { 4770 return iter.page.Response() 4771} 4772 4773// Value returns the current value or a zero-initialized value if the 4774// iterator has advanced beyond the end of the collection. 4775func (iter SnapshotListIterator) Value() Snapshot { 4776 if !iter.page.NotDone() { 4777 return Snapshot{} 4778 } 4779 return iter.page.Values()[iter.i] 4780} 4781 4782// Creates a new instance of the SnapshotListIterator type. 4783func NewSnapshotListIterator(page SnapshotListPage) SnapshotListIterator { 4784 return SnapshotListIterator{page: page} 4785} 4786 4787// IsEmpty returns true if the ListResult contains no values. 4788func (sl SnapshotList) IsEmpty() bool { 4789 return sl.Value == nil || len(*sl.Value) == 0 4790} 4791 4792// hasNextLink returns true if the NextLink is not empty. 4793func (sl SnapshotList) hasNextLink() bool { 4794 return sl.NextLink != nil && len(*sl.NextLink) != 0 4795} 4796 4797// snapshotListPreparer prepares a request to retrieve the next set of results. 4798// It returns nil if no more results exist. 4799func (sl SnapshotList) snapshotListPreparer(ctx context.Context) (*http.Request, error) { 4800 if !sl.hasNextLink() { 4801 return nil, nil 4802 } 4803 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4804 autorest.AsJSON(), 4805 autorest.AsGet(), 4806 autorest.WithBaseURL(to.String(sl.NextLink))) 4807} 4808 4809// SnapshotListPage contains a page of Snapshot values. 4810type SnapshotListPage struct { 4811 fn func(context.Context, SnapshotList) (SnapshotList, error) 4812 sl SnapshotList 4813} 4814 4815// NextWithContext advances to the next page of values. If there was an error making 4816// the request the page does not advance and the error is returned. 4817func (page *SnapshotListPage) NextWithContext(ctx context.Context) (err error) { 4818 if tracing.IsEnabled() { 4819 ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotListPage.NextWithContext") 4820 defer func() { 4821 sc := -1 4822 if page.Response().Response.Response != nil { 4823 sc = page.Response().Response.Response.StatusCode 4824 } 4825 tracing.EndSpan(ctx, sc, err) 4826 }() 4827 } 4828 for { 4829 next, err := page.fn(ctx, page.sl) 4830 if err != nil { 4831 return err 4832 } 4833 page.sl = next 4834 if !next.hasNextLink() || !next.IsEmpty() { 4835 break 4836 } 4837 } 4838 return nil 4839} 4840 4841// Next advances to the next page of values. If there was an error making 4842// the request the page does not advance and the error is returned. 4843// Deprecated: Use NextWithContext() instead. 4844func (page *SnapshotListPage) Next() error { 4845 return page.NextWithContext(context.Background()) 4846} 4847 4848// NotDone returns true if the page enumeration should be started or is not yet complete. 4849func (page SnapshotListPage) NotDone() bool { 4850 return !page.sl.IsEmpty() 4851} 4852 4853// Response returns the raw server response from the last page request. 4854func (page SnapshotListPage) Response() SnapshotList { 4855 return page.sl 4856} 4857 4858// Values returns the slice of values for the current page or nil if there are no values. 4859func (page SnapshotListPage) Values() []Snapshot { 4860 if page.sl.IsEmpty() { 4861 return nil 4862 } 4863 return *page.sl.Value 4864} 4865 4866// Creates a new instance of the SnapshotListPage type. 4867func NewSnapshotListPage(cur SnapshotList, getNextPage func(context.Context, SnapshotList) (SnapshotList, error)) SnapshotListPage { 4868 return SnapshotListPage{ 4869 fn: getNextPage, 4870 sl: cur, 4871 } 4872} 4873 4874// SnapshotProperties snapshot resource properties. 4875type SnapshotProperties struct { 4876 // TimeCreated - READ-ONLY; The time when the disk was created. 4877 TimeCreated *date.Time `json:"timeCreated,omitempty"` 4878 // OsType - The Operating System type. Possible values include: 'Windows', 'Linux' 4879 OsType OperatingSystemTypes `json:"osType,omitempty"` 4880 // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'V1', 'V2' 4881 HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` 4882 // CreationData - Disk source information. CreationData information cannot be changed after the disk has been created. 4883 CreationData *CreationData `json:"creationData,omitempty"` 4884 // DiskSizeGB - If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. 4885 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 4886 // DiskSizeBytes - READ-ONLY; The size of the disk in bytes. This field is read only. 4887 DiskSizeBytes *int64 `json:"diskSizeBytes,omitempty"` 4888 // UniqueID - READ-ONLY; Unique Guid identifying the resource. 4889 UniqueID *string `json:"uniqueId,omitempty"` 4890 // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. 4891 EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` 4892 // ProvisioningState - READ-ONLY; The disk provisioning state. 4893 ProvisioningState *string `json:"provisioningState,omitempty"` 4894 // Incremental - Whether a snapshot is incremental. Incremental snapshots on the same disk occupy less space than full snapshots and can be diffed. 4895 Incremental *bool `json:"incremental,omitempty"` 4896 // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 4897 Encryption *Encryption `json:"encryption,omitempty"` 4898} 4899 4900// MarshalJSON is the custom marshaler for SnapshotProperties. 4901func (sp SnapshotProperties) MarshalJSON() ([]byte, error) { 4902 objectMap := make(map[string]interface{}) 4903 if sp.OsType != "" { 4904 objectMap["osType"] = sp.OsType 4905 } 4906 if sp.HyperVGeneration != "" { 4907 objectMap["hyperVGeneration"] = sp.HyperVGeneration 4908 } 4909 if sp.CreationData != nil { 4910 objectMap["creationData"] = sp.CreationData 4911 } 4912 if sp.DiskSizeGB != nil { 4913 objectMap["diskSizeGB"] = sp.DiskSizeGB 4914 } 4915 if sp.EncryptionSettingsCollection != nil { 4916 objectMap["encryptionSettingsCollection"] = sp.EncryptionSettingsCollection 4917 } 4918 if sp.Incremental != nil { 4919 objectMap["incremental"] = sp.Incremental 4920 } 4921 if sp.Encryption != nil { 4922 objectMap["encryption"] = sp.Encryption 4923 } 4924 return json.Marshal(objectMap) 4925} 4926 4927// SnapshotsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 4928// operation. 4929type SnapshotsCreateOrUpdateFuture struct { 4930 azure.FutureAPI 4931 // Result returns the result of the asynchronous operation. 4932 // If the operation has not completed it will return an error. 4933 Result func(SnapshotsClient) (Snapshot, error) 4934} 4935 4936// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4937func (future *SnapshotsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 4938 var azFuture azure.Future 4939 if err := json.Unmarshal(body, &azFuture); err != nil { 4940 return err 4941 } 4942 future.FutureAPI = &azFuture 4943 future.Result = future.result 4944 return nil 4945} 4946 4947// result is the default implementation for SnapshotsCreateOrUpdateFuture.Result. 4948func (future *SnapshotsCreateOrUpdateFuture) result(client SnapshotsClient) (s Snapshot, err error) { 4949 var done bool 4950 done, err = future.DoneWithContext(context.Background(), client) 4951 if err != nil { 4952 err = autorest.NewErrorWithError(err, "compute.SnapshotsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 4953 return 4954 } 4955 if !done { 4956 err = azure.NewAsyncOpIncompleteError("compute.SnapshotsCreateOrUpdateFuture") 4957 return 4958 } 4959 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4960 if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { 4961 s, err = client.CreateOrUpdateResponder(s.Response.Response) 4962 if err != nil { 4963 err = autorest.NewErrorWithError(err, "compute.SnapshotsCreateOrUpdateFuture", "Result", s.Response.Response, "Failure responding to request") 4964 } 4965 } 4966 return 4967} 4968 4969// SnapshotsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 4970// operation. 4971type SnapshotsDeleteFuture struct { 4972 azure.FutureAPI 4973 // Result returns the result of the asynchronous operation. 4974 // If the operation has not completed it will return an error. 4975 Result func(SnapshotsClient) (autorest.Response, error) 4976} 4977 4978// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4979func (future *SnapshotsDeleteFuture) UnmarshalJSON(body []byte) error { 4980 var azFuture azure.Future 4981 if err := json.Unmarshal(body, &azFuture); err != nil { 4982 return err 4983 } 4984 future.FutureAPI = &azFuture 4985 future.Result = future.result 4986 return nil 4987} 4988 4989// result is the default implementation for SnapshotsDeleteFuture.Result. 4990func (future *SnapshotsDeleteFuture) result(client SnapshotsClient) (ar autorest.Response, err error) { 4991 var done bool 4992 done, err = future.DoneWithContext(context.Background(), client) 4993 if err != nil { 4994 err = autorest.NewErrorWithError(err, "compute.SnapshotsDeleteFuture", "Result", future.Response(), "Polling failure") 4995 return 4996 } 4997 if !done { 4998 err = azure.NewAsyncOpIncompleteError("compute.SnapshotsDeleteFuture") 4999 return 5000 } 5001 ar.Response = future.Response() 5002 return 5003} 5004 5005// SnapshotsGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running 5006// operation. 5007type SnapshotsGrantAccessFuture struct { 5008 azure.FutureAPI 5009 // Result returns the result of the asynchronous operation. 5010 // If the operation has not completed it will return an error. 5011 Result func(SnapshotsClient) (AccessURI, error) 5012} 5013 5014// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5015func (future *SnapshotsGrantAccessFuture) UnmarshalJSON(body []byte) error { 5016 var azFuture azure.Future 5017 if err := json.Unmarshal(body, &azFuture); err != nil { 5018 return err 5019 } 5020 future.FutureAPI = &azFuture 5021 future.Result = future.result 5022 return nil 5023} 5024 5025// result is the default implementation for SnapshotsGrantAccessFuture.Result. 5026func (future *SnapshotsGrantAccessFuture) result(client SnapshotsClient) (au AccessURI, err error) { 5027 var done bool 5028 done, err = future.DoneWithContext(context.Background(), client) 5029 if err != nil { 5030 err = autorest.NewErrorWithError(err, "compute.SnapshotsGrantAccessFuture", "Result", future.Response(), "Polling failure") 5031 return 5032 } 5033 if !done { 5034 err = azure.NewAsyncOpIncompleteError("compute.SnapshotsGrantAccessFuture") 5035 return 5036 } 5037 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5038 if au.Response.Response, err = future.GetResult(sender); err == nil && au.Response.Response.StatusCode != http.StatusNoContent { 5039 au, err = client.GrantAccessResponder(au.Response.Response) 5040 if err != nil { 5041 err = autorest.NewErrorWithError(err, "compute.SnapshotsGrantAccessFuture", "Result", au.Response.Response, "Failure responding to request") 5042 } 5043 } 5044 return 5045} 5046 5047// SnapshotSku the snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. 5048type SnapshotSku struct { 5049 // Name - The sku name. Possible values include: 'SnapshotStorageAccountTypesStandardLRS', 'SnapshotStorageAccountTypesPremiumLRS', 'SnapshotStorageAccountTypesStandardZRS' 5050 Name SnapshotStorageAccountTypes `json:"name,omitempty"` 5051 // Tier - READ-ONLY; The sku tier. 5052 Tier *string `json:"tier,omitempty"` 5053} 5054 5055// MarshalJSON is the custom marshaler for SnapshotSku. 5056func (ss SnapshotSku) MarshalJSON() ([]byte, error) { 5057 objectMap := make(map[string]interface{}) 5058 if ss.Name != "" { 5059 objectMap["name"] = ss.Name 5060 } 5061 return json.Marshal(objectMap) 5062} 5063 5064// SnapshotsRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running 5065// operation. 5066type SnapshotsRevokeAccessFuture struct { 5067 azure.FutureAPI 5068 // Result returns the result of the asynchronous operation. 5069 // If the operation has not completed it will return an error. 5070 Result func(SnapshotsClient) (autorest.Response, error) 5071} 5072 5073// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5074func (future *SnapshotsRevokeAccessFuture) UnmarshalJSON(body []byte) error { 5075 var azFuture azure.Future 5076 if err := json.Unmarshal(body, &azFuture); err != nil { 5077 return err 5078 } 5079 future.FutureAPI = &azFuture 5080 future.Result = future.result 5081 return nil 5082} 5083 5084// result is the default implementation for SnapshotsRevokeAccessFuture.Result. 5085func (future *SnapshotsRevokeAccessFuture) result(client SnapshotsClient) (ar autorest.Response, err error) { 5086 var done bool 5087 done, err = future.DoneWithContext(context.Background(), client) 5088 if err != nil { 5089 err = autorest.NewErrorWithError(err, "compute.SnapshotsRevokeAccessFuture", "Result", future.Response(), "Polling failure") 5090 return 5091 } 5092 if !done { 5093 err = azure.NewAsyncOpIncompleteError("compute.SnapshotsRevokeAccessFuture") 5094 return 5095 } 5096 ar.Response = future.Response() 5097 return 5098} 5099 5100// SnapshotsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 5101// operation. 5102type SnapshotsUpdateFuture struct { 5103 azure.FutureAPI 5104 // Result returns the result of the asynchronous operation. 5105 // If the operation has not completed it will return an error. 5106 Result func(SnapshotsClient) (Snapshot, error) 5107} 5108 5109// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5110func (future *SnapshotsUpdateFuture) UnmarshalJSON(body []byte) error { 5111 var azFuture azure.Future 5112 if err := json.Unmarshal(body, &azFuture); err != nil { 5113 return err 5114 } 5115 future.FutureAPI = &azFuture 5116 future.Result = future.result 5117 return nil 5118} 5119 5120// result is the default implementation for SnapshotsUpdateFuture.Result. 5121func (future *SnapshotsUpdateFuture) result(client SnapshotsClient) (s Snapshot, err error) { 5122 var done bool 5123 done, err = future.DoneWithContext(context.Background(), client) 5124 if err != nil { 5125 err = autorest.NewErrorWithError(err, "compute.SnapshotsUpdateFuture", "Result", future.Response(), "Polling failure") 5126 return 5127 } 5128 if !done { 5129 err = azure.NewAsyncOpIncompleteError("compute.SnapshotsUpdateFuture") 5130 return 5131 } 5132 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5133 if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { 5134 s, err = client.UpdateResponder(s.Response.Response) 5135 if err != nil { 5136 err = autorest.NewErrorWithError(err, "compute.SnapshotsUpdateFuture", "Result", s.Response.Response, "Failure responding to request") 5137 } 5138 } 5139 return 5140} 5141 5142// SnapshotUpdate snapshot update resource. 5143type SnapshotUpdate struct { 5144 *SnapshotUpdateProperties `json:"properties,omitempty"` 5145 // Tags - Resource tags 5146 Tags map[string]*string `json:"tags"` 5147 Sku *SnapshotSku `json:"sku,omitempty"` 5148} 5149 5150// MarshalJSON is the custom marshaler for SnapshotUpdate. 5151func (su SnapshotUpdate) MarshalJSON() ([]byte, error) { 5152 objectMap := make(map[string]interface{}) 5153 if su.SnapshotUpdateProperties != nil { 5154 objectMap["properties"] = su.SnapshotUpdateProperties 5155 } 5156 if su.Tags != nil { 5157 objectMap["tags"] = su.Tags 5158 } 5159 if su.Sku != nil { 5160 objectMap["sku"] = su.Sku 5161 } 5162 return json.Marshal(objectMap) 5163} 5164 5165// UnmarshalJSON is the custom unmarshaler for SnapshotUpdate struct. 5166func (su *SnapshotUpdate) UnmarshalJSON(body []byte) error { 5167 var m map[string]*json.RawMessage 5168 err := json.Unmarshal(body, &m) 5169 if err != nil { 5170 return err 5171 } 5172 for k, v := range m { 5173 switch k { 5174 case "properties": 5175 if v != nil { 5176 var snapshotUpdateProperties SnapshotUpdateProperties 5177 err = json.Unmarshal(*v, &snapshotUpdateProperties) 5178 if err != nil { 5179 return err 5180 } 5181 su.SnapshotUpdateProperties = &snapshotUpdateProperties 5182 } 5183 case "tags": 5184 if v != nil { 5185 var tags map[string]*string 5186 err = json.Unmarshal(*v, &tags) 5187 if err != nil { 5188 return err 5189 } 5190 su.Tags = tags 5191 } 5192 case "sku": 5193 if v != nil { 5194 var sku SnapshotSku 5195 err = json.Unmarshal(*v, &sku) 5196 if err != nil { 5197 return err 5198 } 5199 su.Sku = &sku 5200 } 5201 } 5202 } 5203 5204 return nil 5205} 5206 5207// SnapshotUpdateProperties snapshot resource update properties. 5208type SnapshotUpdateProperties struct { 5209 // OsType - the Operating System type. Possible values include: 'Windows', 'Linux' 5210 OsType OperatingSystemTypes `json:"osType,omitempty"` 5211 // DiskSizeGB - If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. 5212 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 5213 // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. 5214 EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` 5215 // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 5216 Encryption *Encryption `json:"encryption,omitempty"` 5217} 5218 5219// SourceVault the vault id is an Azure Resource Manager Resource id in the form 5220// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName} 5221type SourceVault struct { 5222 // ID - Resource Id 5223 ID *string `json:"id,omitempty"` 5224} 5225 5226// SSHConfiguration SSH configuration for Linux based VMs running on Azure 5227type SSHConfiguration struct { 5228 // PublicKeys - The list of SSH public keys used to authenticate with linux based VMs. 5229 PublicKeys *[]SSHPublicKey `json:"publicKeys,omitempty"` 5230} 5231 5232// SSHPublicKey contains information about SSH certificate public key and the path on the Linux VM where 5233// the public key is placed. 5234type SSHPublicKey struct { 5235 // 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 5236 Path *string `json:"path,omitempty"` 5237 // 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/en-us/azure/virtual-machines/linux/mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). 5238 KeyData *string `json:"keyData,omitempty"` 5239} 5240 5241// SSHPublicKeyGenerateKeyPairResult response from generation of an SSH key pair. 5242type SSHPublicKeyGenerateKeyPairResult struct { 5243 autorest.Response `json:"-"` 5244 // PrivateKey - Private key portion of the key pair used to authenticate to a virtual machine through ssh. The private key is returned in RFC3447 format and should be treated as a secret. 5245 PrivateKey *string `json:"privateKey,omitempty"` 5246 // PublicKey - Public key portion of the key pair used to authenticate to a virtual machine through ssh. The public key is in ssh-rsa format. 5247 PublicKey *string `json:"publicKey,omitempty"` 5248 // ID - The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{SshPublicKeyName} 5249 ID *string `json:"id,omitempty"` 5250} 5251 5252// SSHPublicKeyResource specifies information about the SSH public key. 5253type SSHPublicKeyResource struct { 5254 autorest.Response `json:"-"` 5255 // SSHPublicKeyResourceProperties - Properties of the SSH public key. 5256 *SSHPublicKeyResourceProperties `json:"properties,omitempty"` 5257 // ID - READ-ONLY; Resource Id 5258 ID *string `json:"id,omitempty"` 5259 // Name - READ-ONLY; Resource name 5260 Name *string `json:"name,omitempty"` 5261 // Type - READ-ONLY; Resource type 5262 Type *string `json:"type,omitempty"` 5263 // Location - Resource location 5264 Location *string `json:"location,omitempty"` 5265 // Tags - Resource tags 5266 Tags map[string]*string `json:"tags"` 5267} 5268 5269// MarshalJSON is the custom marshaler for SSHPublicKeyResource. 5270func (spkr SSHPublicKeyResource) MarshalJSON() ([]byte, error) { 5271 objectMap := make(map[string]interface{}) 5272 if spkr.SSHPublicKeyResourceProperties != nil { 5273 objectMap["properties"] = spkr.SSHPublicKeyResourceProperties 5274 } 5275 if spkr.Location != nil { 5276 objectMap["location"] = spkr.Location 5277 } 5278 if spkr.Tags != nil { 5279 objectMap["tags"] = spkr.Tags 5280 } 5281 return json.Marshal(objectMap) 5282} 5283 5284// UnmarshalJSON is the custom unmarshaler for SSHPublicKeyResource struct. 5285func (spkr *SSHPublicKeyResource) UnmarshalJSON(body []byte) error { 5286 var m map[string]*json.RawMessage 5287 err := json.Unmarshal(body, &m) 5288 if err != nil { 5289 return err 5290 } 5291 for k, v := range m { 5292 switch k { 5293 case "properties": 5294 if v != nil { 5295 var SSHPublicKeyResourceProperties SSHPublicKeyResourceProperties 5296 err = json.Unmarshal(*v, &SSHPublicKeyResourceProperties) 5297 if err != nil { 5298 return err 5299 } 5300 spkr.SSHPublicKeyResourceProperties = &SSHPublicKeyResourceProperties 5301 } 5302 case "id": 5303 if v != nil { 5304 var ID string 5305 err = json.Unmarshal(*v, &ID) 5306 if err != nil { 5307 return err 5308 } 5309 spkr.ID = &ID 5310 } 5311 case "name": 5312 if v != nil { 5313 var name string 5314 err = json.Unmarshal(*v, &name) 5315 if err != nil { 5316 return err 5317 } 5318 spkr.Name = &name 5319 } 5320 case "type": 5321 if v != nil { 5322 var typeVar string 5323 err = json.Unmarshal(*v, &typeVar) 5324 if err != nil { 5325 return err 5326 } 5327 spkr.Type = &typeVar 5328 } 5329 case "location": 5330 if v != nil { 5331 var location string 5332 err = json.Unmarshal(*v, &location) 5333 if err != nil { 5334 return err 5335 } 5336 spkr.Location = &location 5337 } 5338 case "tags": 5339 if v != nil { 5340 var tags map[string]*string 5341 err = json.Unmarshal(*v, &tags) 5342 if err != nil { 5343 return err 5344 } 5345 spkr.Tags = tags 5346 } 5347 } 5348 } 5349 5350 return nil 5351} 5352 5353// SSHPublicKeyResourceProperties properties of the SSH public key. 5354type SSHPublicKeyResourceProperties struct { 5355 // PublicKey - SSH public key used to authenticate to a virtual machine through ssh. If this property is not initially provided when the resource is created, the publicKey property will be populated when generateKeyPair is called. If the public key is provided upon resource creation, the provided public key needs to be at least 2048-bit and in ssh-rsa format. 5356 PublicKey *string `json:"publicKey,omitempty"` 5357} 5358 5359// SSHPublicKeysGroupListResult the list SSH public keys operation response. 5360type SSHPublicKeysGroupListResult struct { 5361 autorest.Response `json:"-"` 5362 // Value - The list of SSH public keys 5363 Value *[]SSHPublicKeyResource `json:"value,omitempty"` 5364 // NextLink - The URI to fetch the next page of SSH public keys. Call ListNext() with this URI to fetch the next page of SSH public keys. 5365 NextLink *string `json:"nextLink,omitempty"` 5366} 5367 5368// SSHPublicKeysGroupListResultIterator provides access to a complete listing of SSHPublicKeyResource 5369// values. 5370type SSHPublicKeysGroupListResultIterator struct { 5371 i int 5372 page SSHPublicKeysGroupListResultPage 5373} 5374 5375// NextWithContext advances to the next value. If there was an error making 5376// the request the iterator does not advance and the error is returned. 5377func (iter *SSHPublicKeysGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { 5378 if tracing.IsEnabled() { 5379 ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysGroupListResultIterator.NextWithContext") 5380 defer func() { 5381 sc := -1 5382 if iter.Response().Response.Response != nil { 5383 sc = iter.Response().Response.Response.StatusCode 5384 } 5385 tracing.EndSpan(ctx, sc, err) 5386 }() 5387 } 5388 iter.i++ 5389 if iter.i < len(iter.page.Values()) { 5390 return nil 5391 } 5392 err = iter.page.NextWithContext(ctx) 5393 if err != nil { 5394 iter.i-- 5395 return err 5396 } 5397 iter.i = 0 5398 return nil 5399} 5400 5401// Next advances to the next value. If there was an error making 5402// the request the iterator does not advance and the error is returned. 5403// Deprecated: Use NextWithContext() instead. 5404func (iter *SSHPublicKeysGroupListResultIterator) Next() error { 5405 return iter.NextWithContext(context.Background()) 5406} 5407 5408// NotDone returns true if the enumeration should be started or is not yet complete. 5409func (iter SSHPublicKeysGroupListResultIterator) NotDone() bool { 5410 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5411} 5412 5413// Response returns the raw server response from the last page request. 5414func (iter SSHPublicKeysGroupListResultIterator) Response() SSHPublicKeysGroupListResult { 5415 return iter.page.Response() 5416} 5417 5418// Value returns the current value or a zero-initialized value if the 5419// iterator has advanced beyond the end of the collection. 5420func (iter SSHPublicKeysGroupListResultIterator) Value() SSHPublicKeyResource { 5421 if !iter.page.NotDone() { 5422 return SSHPublicKeyResource{} 5423 } 5424 return iter.page.Values()[iter.i] 5425} 5426 5427// Creates a new instance of the SSHPublicKeysGroupListResultIterator type. 5428func NewSSHPublicKeysGroupListResultIterator(page SSHPublicKeysGroupListResultPage) SSHPublicKeysGroupListResultIterator { 5429 return SSHPublicKeysGroupListResultIterator{page: page} 5430} 5431 5432// IsEmpty returns true if the ListResult contains no values. 5433func (spkglr SSHPublicKeysGroupListResult) IsEmpty() bool { 5434 return spkglr.Value == nil || len(*spkglr.Value) == 0 5435} 5436 5437// hasNextLink returns true if the NextLink is not empty. 5438func (spkglr SSHPublicKeysGroupListResult) hasNextLink() bool { 5439 return spkglr.NextLink != nil && len(*spkglr.NextLink) != 0 5440} 5441 5442// sSHPublicKeysGroupListResultPreparer prepares a request to retrieve the next set of results. 5443// It returns nil if no more results exist. 5444func (spkglr SSHPublicKeysGroupListResult) sSHPublicKeysGroupListResultPreparer(ctx context.Context) (*http.Request, error) { 5445 if !spkglr.hasNextLink() { 5446 return nil, nil 5447 } 5448 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5449 autorest.AsJSON(), 5450 autorest.AsGet(), 5451 autorest.WithBaseURL(to.String(spkglr.NextLink))) 5452} 5453 5454// SSHPublicKeysGroupListResultPage contains a page of SSHPublicKeyResource values. 5455type SSHPublicKeysGroupListResultPage struct { 5456 fn func(context.Context, SSHPublicKeysGroupListResult) (SSHPublicKeysGroupListResult, error) 5457 spkglr SSHPublicKeysGroupListResult 5458} 5459 5460// NextWithContext advances to the next page of values. If there was an error making 5461// the request the page does not advance and the error is returned. 5462func (page *SSHPublicKeysGroupListResultPage) NextWithContext(ctx context.Context) (err error) { 5463 if tracing.IsEnabled() { 5464 ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysGroupListResultPage.NextWithContext") 5465 defer func() { 5466 sc := -1 5467 if page.Response().Response.Response != nil { 5468 sc = page.Response().Response.Response.StatusCode 5469 } 5470 tracing.EndSpan(ctx, sc, err) 5471 }() 5472 } 5473 for { 5474 next, err := page.fn(ctx, page.spkglr) 5475 if err != nil { 5476 return err 5477 } 5478 page.spkglr = next 5479 if !next.hasNextLink() || !next.IsEmpty() { 5480 break 5481 } 5482 } 5483 return nil 5484} 5485 5486// Next advances to the next page of values. If there was an error making 5487// the request the page does not advance and the error is returned. 5488// Deprecated: Use NextWithContext() instead. 5489func (page *SSHPublicKeysGroupListResultPage) Next() error { 5490 return page.NextWithContext(context.Background()) 5491} 5492 5493// NotDone returns true if the page enumeration should be started or is not yet complete. 5494func (page SSHPublicKeysGroupListResultPage) NotDone() bool { 5495 return !page.spkglr.IsEmpty() 5496} 5497 5498// Response returns the raw server response from the last page request. 5499func (page SSHPublicKeysGroupListResultPage) Response() SSHPublicKeysGroupListResult { 5500 return page.spkglr 5501} 5502 5503// Values returns the slice of values for the current page or nil if there are no values. 5504func (page SSHPublicKeysGroupListResultPage) Values() []SSHPublicKeyResource { 5505 if page.spkglr.IsEmpty() { 5506 return nil 5507 } 5508 return *page.spkglr.Value 5509} 5510 5511// Creates a new instance of the SSHPublicKeysGroupListResultPage type. 5512func NewSSHPublicKeysGroupListResultPage(cur SSHPublicKeysGroupListResult, getNextPage func(context.Context, SSHPublicKeysGroupListResult) (SSHPublicKeysGroupListResult, error)) SSHPublicKeysGroupListResultPage { 5513 return SSHPublicKeysGroupListResultPage{ 5514 fn: getNextPage, 5515 spkglr: cur, 5516 } 5517} 5518 5519// SSHPublicKeyUpdateResource specifies information about the SSH public key. 5520type SSHPublicKeyUpdateResource struct { 5521 // SSHPublicKeyResourceProperties - Properties of the SSH public key. 5522 *SSHPublicKeyResourceProperties `json:"properties,omitempty"` 5523 // Tags - Resource tags 5524 Tags map[string]*string `json:"tags"` 5525} 5526 5527// MarshalJSON is the custom marshaler for SSHPublicKeyUpdateResource. 5528func (spkur SSHPublicKeyUpdateResource) MarshalJSON() ([]byte, error) { 5529 objectMap := make(map[string]interface{}) 5530 if spkur.SSHPublicKeyResourceProperties != nil { 5531 objectMap["properties"] = spkur.SSHPublicKeyResourceProperties 5532 } 5533 if spkur.Tags != nil { 5534 objectMap["tags"] = spkur.Tags 5535 } 5536 return json.Marshal(objectMap) 5537} 5538 5539// UnmarshalJSON is the custom unmarshaler for SSHPublicKeyUpdateResource struct. 5540func (spkur *SSHPublicKeyUpdateResource) UnmarshalJSON(body []byte) error { 5541 var m map[string]*json.RawMessage 5542 err := json.Unmarshal(body, &m) 5543 if err != nil { 5544 return err 5545 } 5546 for k, v := range m { 5547 switch k { 5548 case "properties": 5549 if v != nil { 5550 var SSHPublicKeyResourceProperties SSHPublicKeyResourceProperties 5551 err = json.Unmarshal(*v, &SSHPublicKeyResourceProperties) 5552 if err != nil { 5553 return err 5554 } 5555 spkur.SSHPublicKeyResourceProperties = &SSHPublicKeyResourceProperties 5556 } 5557 case "tags": 5558 if v != nil { 5559 var tags map[string]*string 5560 err = json.Unmarshal(*v, &tags) 5561 if err != nil { 5562 return err 5563 } 5564 spkur.Tags = tags 5565 } 5566 } 5567 } 5568 5569 return nil 5570} 5571 5572// StorageProfile specifies the storage settings for the virtual machine disks. 5573type StorageProfile struct { 5574 // 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. 5575 ImageReference *ImageReference `json:"imageReference,omitempty"` 5576 // 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). 5577 OsDisk *OSDisk `json:"osDisk,omitempty"` 5578 // 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). 5579 DataDisks *[]DataDisk `json:"dataDisks,omitempty"` 5580} 5581 5582// SubResource ... 5583type SubResource struct { 5584 // ID - Resource Id 5585 ID *string `json:"id,omitempty"` 5586} 5587 5588// SubResourceReadOnly ... 5589type SubResourceReadOnly struct { 5590 // ID - READ-ONLY; Resource Id 5591 ID *string `json:"id,omitempty"` 5592} 5593 5594// SubResourceWithColocationStatus ... 5595type SubResourceWithColocationStatus struct { 5596 // ColocationStatus - Describes colocation status of a resource in the Proximity Placement Group. 5597 ColocationStatus *InstanceViewStatus `json:"colocationStatus,omitempty"` 5598 // ID - Resource Id 5599 ID *string `json:"id,omitempty"` 5600} 5601 5602// TerminateNotificationProfile ... 5603type TerminateNotificationProfile struct { 5604 // NotBeforeTimeout - Configurable length of time a Virtual Machine being deleted will have to potentially approve the Terminate Scheduled Event before the event is auto approved (timed out). The configuration must be specified in ISO 8601 format, the default value is 5 minutes (PT5M) 5605 NotBeforeTimeout *string `json:"notBeforeTimeout,omitempty"` 5606 // Enable - Specifies whether the Terminate Scheduled event is enabled or disabled. 5607 Enable *bool `json:"enable,omitempty"` 5608} 5609 5610// ThrottledRequestsInput api request input for LogAnalytics getThrottledRequests Api. 5611type ThrottledRequestsInput struct { 5612 // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. 5613 BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` 5614 // FromTime - From time of the query 5615 FromTime *date.Time `json:"fromTime,omitempty"` 5616 // ToTime - To time of the query 5617 ToTime *date.Time `json:"toTime,omitempty"` 5618 // GroupByThrottlePolicy - Group query result by Throttle Policy applied. 5619 GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` 5620 // GroupByOperationName - Group query result by Operation Name. 5621 GroupByOperationName *bool `json:"groupByOperationName,omitempty"` 5622 // GroupByResourceName - Group query result by Resource Name. 5623 GroupByResourceName *bool `json:"groupByResourceName,omitempty"` 5624 // GroupByClientApplicationID - Group query result by Client Application ID. 5625 GroupByClientApplicationID *bool `json:"groupByClientApplicationId,omitempty"` 5626 // GroupByUserAgent - Group query result by User Agent. 5627 GroupByUserAgent *bool `json:"groupByUserAgent,omitempty"` 5628} 5629 5630// UpdateResource the Update Resource model definition. 5631type UpdateResource struct { 5632 // Tags - Resource tags 5633 Tags map[string]*string `json:"tags"` 5634} 5635 5636// MarshalJSON is the custom marshaler for UpdateResource. 5637func (ur UpdateResource) MarshalJSON() ([]byte, error) { 5638 objectMap := make(map[string]interface{}) 5639 if ur.Tags != nil { 5640 objectMap["tags"] = ur.Tags 5641 } 5642 return json.Marshal(objectMap) 5643} 5644 5645// UpgradeOperationHistoricalStatusInfo virtual Machine Scale Set OS Upgrade History operation response. 5646type UpgradeOperationHistoricalStatusInfo struct { 5647 // Properties - READ-ONLY; Information about the properties of the upgrade operation. 5648 Properties *UpgradeOperationHistoricalStatusInfoProperties `json:"properties,omitempty"` 5649 // Type - READ-ONLY; Resource type 5650 Type *string `json:"type,omitempty"` 5651 // Location - READ-ONLY; Resource location 5652 Location *string `json:"location,omitempty"` 5653} 5654 5655// UpgradeOperationHistoricalStatusInfoProperties describes each OS upgrade on the Virtual Machine Scale 5656// Set. 5657type UpgradeOperationHistoricalStatusInfoProperties struct { 5658 // RunningStatus - READ-ONLY; Information about the overall status of the upgrade operation. 5659 RunningStatus *UpgradeOperationHistoryStatus `json:"runningStatus,omitempty"` 5660 // Progress - READ-ONLY; Counts of the VMs in each state. 5661 Progress *RollingUpgradeProgressInfo `json:"progress,omitempty"` 5662 // Error - READ-ONLY; Error Details for this upgrade if there are any. 5663 Error *APIError `json:"error,omitempty"` 5664 // StartedBy - READ-ONLY; Invoker of the Upgrade Operation. Possible values include: 'Unknown', 'User', 'Platform' 5665 StartedBy UpgradeOperationInvoker `json:"startedBy,omitempty"` 5666 // TargetImageReference - READ-ONLY; Image Reference details 5667 TargetImageReference *ImageReference `json:"targetImageReference,omitempty"` 5668 // RollbackInfo - READ-ONLY; Information about OS rollback if performed 5669 RollbackInfo *RollbackStatusInfo `json:"rollbackInfo,omitempty"` 5670} 5671 5672// UpgradeOperationHistoryStatus information about the current running state of the overall upgrade. 5673type UpgradeOperationHistoryStatus struct { 5674 // Code - READ-ONLY; Code indicating the current status of the upgrade. Possible values include: 'UpgradeStateRollingForward', 'UpgradeStateCancelled', 'UpgradeStateCompleted', 'UpgradeStateFaulted' 5675 Code UpgradeState `json:"code,omitempty"` 5676 // StartTime - READ-ONLY; Start time of the upgrade. 5677 StartTime *date.Time `json:"startTime,omitempty"` 5678 // EndTime - READ-ONLY; End time of the upgrade. 5679 EndTime *date.Time `json:"endTime,omitempty"` 5680} 5681 5682// UpgradePolicy describes an upgrade policy - automatic, manual, or rolling. 5683type UpgradePolicy struct { 5684 // 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: 'UpgradeModeAutomatic', 'UpgradeModeManual', 'UpgradeModeRolling' 5685 Mode UpgradeMode `json:"mode,omitempty"` 5686 // RollingUpgradePolicy - The configuration parameters used while performing a rolling upgrade. 5687 RollingUpgradePolicy *RollingUpgradePolicy `json:"rollingUpgradePolicy,omitempty"` 5688 // AutomaticOSUpgradePolicy - Configuration parameters used for performing automatic OS Upgrade. 5689 AutomaticOSUpgradePolicy *AutomaticOSUpgradePolicy `json:"automaticOSUpgradePolicy,omitempty"` 5690} 5691 5692// Usage describes Compute Resource Usage. 5693type Usage struct { 5694 // Unit - An enum describing the unit of usage measurement. 5695 Unit *string `json:"unit,omitempty"` 5696 // CurrentValue - The current usage of the resource. 5697 CurrentValue *int32 `json:"currentValue,omitempty"` 5698 // Limit - The maximum permitted usage of the resource. 5699 Limit *int64 `json:"limit,omitempty"` 5700 // Name - The name of the type of usage. 5701 Name *UsageName `json:"name,omitempty"` 5702} 5703 5704// UsageName the Usage Names. 5705type UsageName struct { 5706 // Value - The name of the resource. 5707 Value *string `json:"value,omitempty"` 5708 // LocalizedValue - The localized name of the resource. 5709 LocalizedValue *string `json:"localizedValue,omitempty"` 5710} 5711 5712// VaultCertificate describes a single certificate reference in a Key Vault, and where the certificate 5713// should reside on the VM. 5714type VaultCertificate struct { 5715 // 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>} 5716 CertificateURL *string `json:"certificateUrl,omitempty"` 5717 // 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. 5718 CertificateStore *string `json:"certificateStore,omitempty"` 5719} 5720 5721// VaultSecretGroup describes a set of certificates which are all in the same Key Vault. 5722type VaultSecretGroup struct { 5723 // SourceVault - The relative URL of the Key Vault containing all of the certificates in VaultCertificates. 5724 SourceVault *SubResource `json:"sourceVault,omitempty"` 5725 // VaultCertificates - The list of key vault references in SourceVault which contain certificates. 5726 VaultCertificates *[]VaultCertificate `json:"vaultCertificates,omitempty"` 5727} 5728 5729// VirtualHardDisk describes the uri of a disk. 5730type VirtualHardDisk struct { 5731 // URI - Specifies the virtual hard disk's uri. 5732 URI *string `json:"uri,omitempty"` 5733} 5734 5735// VirtualMachine describes a Virtual Machine. 5736type VirtualMachine struct { 5737 autorest.Response `json:"-"` 5738 // 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**. 5739 Plan *Plan `json:"plan,omitempty"` 5740 *VirtualMachineProperties `json:"properties,omitempty"` 5741 // Resources - READ-ONLY; The virtual machine child extension resources. 5742 Resources *[]VirtualMachineExtension `json:"resources,omitempty"` 5743 // Identity - The identity of the virtual machine, if configured. 5744 Identity *VirtualMachineIdentity `json:"identity,omitempty"` 5745 // Zones - The virtual machine zones. 5746 Zones *[]string `json:"zones,omitempty"` 5747 // ID - READ-ONLY; Resource Id 5748 ID *string `json:"id,omitempty"` 5749 // Name - READ-ONLY; Resource name 5750 Name *string `json:"name,omitempty"` 5751 // Type - READ-ONLY; Resource type 5752 Type *string `json:"type,omitempty"` 5753 // Location - Resource location 5754 Location *string `json:"location,omitempty"` 5755 // Tags - Resource tags 5756 Tags map[string]*string `json:"tags"` 5757} 5758 5759// MarshalJSON is the custom marshaler for VirtualMachine. 5760func (VM VirtualMachine) MarshalJSON() ([]byte, error) { 5761 objectMap := make(map[string]interface{}) 5762 if VM.Plan != nil { 5763 objectMap["plan"] = VM.Plan 5764 } 5765 if VM.VirtualMachineProperties != nil { 5766 objectMap["properties"] = VM.VirtualMachineProperties 5767 } 5768 if VM.Identity != nil { 5769 objectMap["identity"] = VM.Identity 5770 } 5771 if VM.Zones != nil { 5772 objectMap["zones"] = VM.Zones 5773 } 5774 if VM.Location != nil { 5775 objectMap["location"] = VM.Location 5776 } 5777 if VM.Tags != nil { 5778 objectMap["tags"] = VM.Tags 5779 } 5780 return json.Marshal(objectMap) 5781} 5782 5783// UnmarshalJSON is the custom unmarshaler for VirtualMachine struct. 5784func (VM *VirtualMachine) UnmarshalJSON(body []byte) error { 5785 var m map[string]*json.RawMessage 5786 err := json.Unmarshal(body, &m) 5787 if err != nil { 5788 return err 5789 } 5790 for k, v := range m { 5791 switch k { 5792 case "plan": 5793 if v != nil { 5794 var plan Plan 5795 err = json.Unmarshal(*v, &plan) 5796 if err != nil { 5797 return err 5798 } 5799 VM.Plan = &plan 5800 } 5801 case "properties": 5802 if v != nil { 5803 var virtualMachineProperties VirtualMachineProperties 5804 err = json.Unmarshal(*v, &virtualMachineProperties) 5805 if err != nil { 5806 return err 5807 } 5808 VM.VirtualMachineProperties = &virtualMachineProperties 5809 } 5810 case "resources": 5811 if v != nil { 5812 var resources []VirtualMachineExtension 5813 err = json.Unmarshal(*v, &resources) 5814 if err != nil { 5815 return err 5816 } 5817 VM.Resources = &resources 5818 } 5819 case "identity": 5820 if v != nil { 5821 var identity VirtualMachineIdentity 5822 err = json.Unmarshal(*v, &identity) 5823 if err != nil { 5824 return err 5825 } 5826 VM.Identity = &identity 5827 } 5828 case "zones": 5829 if v != nil { 5830 var zones []string 5831 err = json.Unmarshal(*v, &zones) 5832 if err != nil { 5833 return err 5834 } 5835 VM.Zones = &zones 5836 } 5837 case "id": 5838 if v != nil { 5839 var ID string 5840 err = json.Unmarshal(*v, &ID) 5841 if err != nil { 5842 return err 5843 } 5844 VM.ID = &ID 5845 } 5846 case "name": 5847 if v != nil { 5848 var name string 5849 err = json.Unmarshal(*v, &name) 5850 if err != nil { 5851 return err 5852 } 5853 VM.Name = &name 5854 } 5855 case "type": 5856 if v != nil { 5857 var typeVar string 5858 err = json.Unmarshal(*v, &typeVar) 5859 if err != nil { 5860 return err 5861 } 5862 VM.Type = &typeVar 5863 } 5864 case "location": 5865 if v != nil { 5866 var location string 5867 err = json.Unmarshal(*v, &location) 5868 if err != nil { 5869 return err 5870 } 5871 VM.Location = &location 5872 } 5873 case "tags": 5874 if v != nil { 5875 var tags map[string]*string 5876 err = json.Unmarshal(*v, &tags) 5877 if err != nil { 5878 return err 5879 } 5880 VM.Tags = tags 5881 } 5882 } 5883 } 5884 5885 return nil 5886} 5887 5888// VirtualMachineAgentInstanceView the instance view of the VM Agent running on the virtual machine. 5889type VirtualMachineAgentInstanceView struct { 5890 // VMAgentVersion - The VM Agent full version. 5891 VMAgentVersion *string `json:"vmAgentVersion,omitempty"` 5892 // ExtensionHandlers - The virtual machine extension handler instance view. 5893 ExtensionHandlers *[]VirtualMachineExtensionHandlerInstanceView `json:"extensionHandlers,omitempty"` 5894 // Statuses - The resource status information. 5895 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 5896} 5897 5898// VirtualMachineAssessPatchesResult describes the properties of an AssessPatches result. 5899type VirtualMachineAssessPatchesResult struct { 5900 autorest.Response `json:"-"` 5901 // Status - READ-ONLY; The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Failed", "Succeeded", or "CompletedWithWarnings.". Possible values include: 'PatchOperationStatusInProgress', 'PatchOperationStatusFailed', 'PatchOperationStatusSucceeded', 'PatchOperationStatusCompletedWithWarnings' 5902 Status PatchOperationStatus `json:"status,omitempty"` 5903 // AssessmentActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. 5904 AssessmentActivityID *string `json:"assessmentActivityId,omitempty"` 5905 // RebootPending - READ-ONLY; The overall reboot status of the VM. It will be true when partially installed patches require a reboot to complete installation but the reboot has not yet occurred. 5906 RebootPending *bool `json:"rebootPending,omitempty"` 5907 // CriticalAndSecurityPatchCount - READ-ONLY; The number of critical or security patches that have been detected as available and not yet installed. 5908 CriticalAndSecurityPatchCount *int32 `json:"criticalAndSecurityPatchCount,omitempty"` 5909 // OtherPatchCount - READ-ONLY; The number of all available patches excluding critical and security. 5910 OtherPatchCount *int32 `json:"otherPatchCount,omitempty"` 5911 // StartDateTime - READ-ONLY; The UTC timestamp when the operation began. 5912 StartDateTime *date.Time `json:"startDateTime,omitempty"` 5913 // Patches - READ-ONLY; The list of patches that have been detected as available for installation. 5914 Patches *[]VirtualMachineSoftwarePatchProperties `json:"patches,omitempty"` 5915 // Error - READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. 5916 Error *APIError `json:"error,omitempty"` 5917} 5918 5919// VirtualMachineCaptureParameters capture Virtual Machine parameters. 5920type VirtualMachineCaptureParameters struct { 5921 // VhdPrefix - The captured virtual hard disk's name prefix. 5922 VhdPrefix *string `json:"vhdPrefix,omitempty"` 5923 // DestinationContainerName - The destination container name. 5924 DestinationContainerName *string `json:"destinationContainerName,omitempty"` 5925 // OverwriteVhds - Specifies whether to overwrite the destination virtual hard disk, in case of conflict. 5926 OverwriteVhds *bool `json:"overwriteVhds,omitempty"` 5927} 5928 5929// VirtualMachineCaptureResult output of virtual machine capture operation. 5930type VirtualMachineCaptureResult struct { 5931 autorest.Response `json:"-"` 5932 // Schema - READ-ONLY; the schema of the captured virtual machine 5933 Schema *string `json:"$schema,omitempty"` 5934 // ContentVersion - READ-ONLY; the version of the content 5935 ContentVersion *string `json:"contentVersion,omitempty"` 5936 // Parameters - READ-ONLY; parameters of the captured virtual machine 5937 Parameters interface{} `json:"parameters,omitempty"` 5938 // Resources - READ-ONLY; a list of resource items of the captured virtual machine 5939 Resources *[]interface{} `json:"resources,omitempty"` 5940 // ID - Resource Id 5941 ID *string `json:"id,omitempty"` 5942} 5943 5944// MarshalJSON is the custom marshaler for VirtualMachineCaptureResult. 5945func (vmcr VirtualMachineCaptureResult) MarshalJSON() ([]byte, error) { 5946 objectMap := make(map[string]interface{}) 5947 if vmcr.ID != nil { 5948 objectMap["id"] = vmcr.ID 5949 } 5950 return json.Marshal(objectMap) 5951} 5952 5953// VirtualMachineExtension describes a Virtual Machine Extension. 5954type VirtualMachineExtension struct { 5955 autorest.Response `json:"-"` 5956 *VirtualMachineExtensionProperties `json:"properties,omitempty"` 5957 // ID - READ-ONLY; Resource Id 5958 ID *string `json:"id,omitempty"` 5959 // Name - READ-ONLY; Resource name 5960 Name *string `json:"name,omitempty"` 5961 // Type - READ-ONLY; Resource type 5962 Type *string `json:"type,omitempty"` 5963 // Location - Resource location 5964 Location *string `json:"location,omitempty"` 5965 // Tags - Resource tags 5966 Tags map[string]*string `json:"tags"` 5967} 5968 5969// MarshalJSON is the custom marshaler for VirtualMachineExtension. 5970func (vme VirtualMachineExtension) MarshalJSON() ([]byte, error) { 5971 objectMap := make(map[string]interface{}) 5972 if vme.VirtualMachineExtensionProperties != nil { 5973 objectMap["properties"] = vme.VirtualMachineExtensionProperties 5974 } 5975 if vme.Location != nil { 5976 objectMap["location"] = vme.Location 5977 } 5978 if vme.Tags != nil { 5979 objectMap["tags"] = vme.Tags 5980 } 5981 return json.Marshal(objectMap) 5982} 5983 5984// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtension struct. 5985func (vme *VirtualMachineExtension) UnmarshalJSON(body []byte) error { 5986 var m map[string]*json.RawMessage 5987 err := json.Unmarshal(body, &m) 5988 if err != nil { 5989 return err 5990 } 5991 for k, v := range m { 5992 switch k { 5993 case "properties": 5994 if v != nil { 5995 var virtualMachineExtensionProperties VirtualMachineExtensionProperties 5996 err = json.Unmarshal(*v, &virtualMachineExtensionProperties) 5997 if err != nil { 5998 return err 5999 } 6000 vme.VirtualMachineExtensionProperties = &virtualMachineExtensionProperties 6001 } 6002 case "id": 6003 if v != nil { 6004 var ID string 6005 err = json.Unmarshal(*v, &ID) 6006 if err != nil { 6007 return err 6008 } 6009 vme.ID = &ID 6010 } 6011 case "name": 6012 if v != nil { 6013 var name string 6014 err = json.Unmarshal(*v, &name) 6015 if err != nil { 6016 return err 6017 } 6018 vme.Name = &name 6019 } 6020 case "type": 6021 if v != nil { 6022 var typeVar string 6023 err = json.Unmarshal(*v, &typeVar) 6024 if err != nil { 6025 return err 6026 } 6027 vme.Type = &typeVar 6028 } 6029 case "location": 6030 if v != nil { 6031 var location string 6032 err = json.Unmarshal(*v, &location) 6033 if err != nil { 6034 return err 6035 } 6036 vme.Location = &location 6037 } 6038 case "tags": 6039 if v != nil { 6040 var tags map[string]*string 6041 err = json.Unmarshal(*v, &tags) 6042 if err != nil { 6043 return err 6044 } 6045 vme.Tags = tags 6046 } 6047 } 6048 } 6049 6050 return nil 6051} 6052 6053// VirtualMachineExtensionHandlerInstanceView the instance view of a virtual machine extension handler. 6054type VirtualMachineExtensionHandlerInstanceView struct { 6055 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 6056 Type *string `json:"type,omitempty"` 6057 // TypeHandlerVersion - Specifies the version of the script handler. 6058 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 6059 // Status - The extension handler status. 6060 Status *InstanceViewStatus `json:"status,omitempty"` 6061} 6062 6063// VirtualMachineExtensionImage describes a Virtual Machine Extension Image. 6064type VirtualMachineExtensionImage struct { 6065 autorest.Response `json:"-"` 6066 *VirtualMachineExtensionImageProperties `json:"properties,omitempty"` 6067 // ID - READ-ONLY; Resource Id 6068 ID *string `json:"id,omitempty"` 6069 // Name - READ-ONLY; Resource name 6070 Name *string `json:"name,omitempty"` 6071 // Type - READ-ONLY; Resource type 6072 Type *string `json:"type,omitempty"` 6073 // Location - Resource location 6074 Location *string `json:"location,omitempty"` 6075 // Tags - Resource tags 6076 Tags map[string]*string `json:"tags"` 6077} 6078 6079// MarshalJSON is the custom marshaler for VirtualMachineExtensionImage. 6080func (vmei VirtualMachineExtensionImage) MarshalJSON() ([]byte, error) { 6081 objectMap := make(map[string]interface{}) 6082 if vmei.VirtualMachineExtensionImageProperties != nil { 6083 objectMap["properties"] = vmei.VirtualMachineExtensionImageProperties 6084 } 6085 if vmei.Location != nil { 6086 objectMap["location"] = vmei.Location 6087 } 6088 if vmei.Tags != nil { 6089 objectMap["tags"] = vmei.Tags 6090 } 6091 return json.Marshal(objectMap) 6092} 6093 6094// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtensionImage struct. 6095func (vmei *VirtualMachineExtensionImage) UnmarshalJSON(body []byte) error { 6096 var m map[string]*json.RawMessage 6097 err := json.Unmarshal(body, &m) 6098 if err != nil { 6099 return err 6100 } 6101 for k, v := range m { 6102 switch k { 6103 case "properties": 6104 if v != nil { 6105 var virtualMachineExtensionImageProperties VirtualMachineExtensionImageProperties 6106 err = json.Unmarshal(*v, &virtualMachineExtensionImageProperties) 6107 if err != nil { 6108 return err 6109 } 6110 vmei.VirtualMachineExtensionImageProperties = &virtualMachineExtensionImageProperties 6111 } 6112 case "id": 6113 if v != nil { 6114 var ID string 6115 err = json.Unmarshal(*v, &ID) 6116 if err != nil { 6117 return err 6118 } 6119 vmei.ID = &ID 6120 } 6121 case "name": 6122 if v != nil { 6123 var name string 6124 err = json.Unmarshal(*v, &name) 6125 if err != nil { 6126 return err 6127 } 6128 vmei.Name = &name 6129 } 6130 case "type": 6131 if v != nil { 6132 var typeVar string 6133 err = json.Unmarshal(*v, &typeVar) 6134 if err != nil { 6135 return err 6136 } 6137 vmei.Type = &typeVar 6138 } 6139 case "location": 6140 if v != nil { 6141 var location string 6142 err = json.Unmarshal(*v, &location) 6143 if err != nil { 6144 return err 6145 } 6146 vmei.Location = &location 6147 } 6148 case "tags": 6149 if v != nil { 6150 var tags map[string]*string 6151 err = json.Unmarshal(*v, &tags) 6152 if err != nil { 6153 return err 6154 } 6155 vmei.Tags = tags 6156 } 6157 } 6158 } 6159 6160 return nil 6161} 6162 6163// VirtualMachineExtensionImageProperties describes the properties of a Virtual Machine Extension Image. 6164type VirtualMachineExtensionImageProperties struct { 6165 // OperatingSystem - The operating system this extension supports. 6166 OperatingSystem *string `json:"operatingSystem,omitempty"` 6167 // ComputeRole - The type of role (IaaS or PaaS) this extension supports. 6168 ComputeRole *string `json:"computeRole,omitempty"` 6169 // HandlerSchema - The schema defined by publisher, where extension consumers should provide settings in a matching schema. 6170 HandlerSchema *string `json:"handlerSchema,omitempty"` 6171 // 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. 6172 VMScaleSetEnabled *bool `json:"vmScaleSetEnabled,omitempty"` 6173 // SupportsMultipleExtensions - Whether the handler can support multiple extensions. 6174 SupportsMultipleExtensions *bool `json:"supportsMultipleExtensions,omitempty"` 6175} 6176 6177// VirtualMachineExtensionInstanceView the instance view of a virtual machine extension. 6178type VirtualMachineExtensionInstanceView struct { 6179 // Name - The virtual machine extension name. 6180 Name *string `json:"name,omitempty"` 6181 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 6182 Type *string `json:"type,omitempty"` 6183 // TypeHandlerVersion - Specifies the version of the script handler. 6184 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 6185 // Substatuses - The resource status information. 6186 Substatuses *[]InstanceViewStatus `json:"substatuses,omitempty"` 6187 // Statuses - The resource status information. 6188 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 6189} 6190 6191// VirtualMachineExtensionProperties describes the properties of a Virtual Machine Extension. 6192type VirtualMachineExtensionProperties struct { 6193 // ForceUpdateTag - How the extension handler should be forced to update even if the extension configuration has not changed. 6194 ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` 6195 // Publisher - The name of the extension handler publisher. 6196 Publisher *string `json:"publisher,omitempty"` 6197 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 6198 Type *string `json:"type,omitempty"` 6199 // TypeHandlerVersion - Specifies the version of the script handler. 6200 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 6201 // 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. 6202 AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` 6203 // EnableAutomaticUpgrade - Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. 6204 EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` 6205 // Settings - Json formatted public settings for the extension. 6206 Settings interface{} `json:"settings,omitempty"` 6207 // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. 6208 ProtectedSettings interface{} `json:"protectedSettings,omitempty"` 6209 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 6210 ProvisioningState *string `json:"provisioningState,omitempty"` 6211 // InstanceView - The virtual machine extension instance view. 6212 InstanceView *VirtualMachineExtensionInstanceView `json:"instanceView,omitempty"` 6213} 6214 6215// MarshalJSON is the custom marshaler for VirtualMachineExtensionProperties. 6216func (vmep VirtualMachineExtensionProperties) MarshalJSON() ([]byte, error) { 6217 objectMap := make(map[string]interface{}) 6218 if vmep.ForceUpdateTag != nil { 6219 objectMap["forceUpdateTag"] = vmep.ForceUpdateTag 6220 } 6221 if vmep.Publisher != nil { 6222 objectMap["publisher"] = vmep.Publisher 6223 } 6224 if vmep.Type != nil { 6225 objectMap["type"] = vmep.Type 6226 } 6227 if vmep.TypeHandlerVersion != nil { 6228 objectMap["typeHandlerVersion"] = vmep.TypeHandlerVersion 6229 } 6230 if vmep.AutoUpgradeMinorVersion != nil { 6231 objectMap["autoUpgradeMinorVersion"] = vmep.AutoUpgradeMinorVersion 6232 } 6233 if vmep.EnableAutomaticUpgrade != nil { 6234 objectMap["enableAutomaticUpgrade"] = vmep.EnableAutomaticUpgrade 6235 } 6236 if vmep.Settings != nil { 6237 objectMap["settings"] = vmep.Settings 6238 } 6239 if vmep.ProtectedSettings != nil { 6240 objectMap["protectedSettings"] = vmep.ProtectedSettings 6241 } 6242 if vmep.InstanceView != nil { 6243 objectMap["instanceView"] = vmep.InstanceView 6244 } 6245 return json.Marshal(objectMap) 6246} 6247 6248// VirtualMachineExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of 6249// a long-running operation. 6250type VirtualMachineExtensionsCreateOrUpdateFuture struct { 6251 azure.FutureAPI 6252 // Result returns the result of the asynchronous operation. 6253 // If the operation has not completed it will return an error. 6254 Result func(VirtualMachineExtensionsClient) (VirtualMachineExtension, error) 6255} 6256 6257// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6258func (future *VirtualMachineExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 6259 var azFuture azure.Future 6260 if err := json.Unmarshal(body, &azFuture); err != nil { 6261 return err 6262 } 6263 future.FutureAPI = &azFuture 6264 future.Result = future.result 6265 return nil 6266} 6267 6268// result is the default implementation for VirtualMachineExtensionsCreateOrUpdateFuture.Result. 6269func (future *VirtualMachineExtensionsCreateOrUpdateFuture) result(client VirtualMachineExtensionsClient) (vme VirtualMachineExtension, err error) { 6270 var done bool 6271 done, err = future.DoneWithContext(context.Background(), client) 6272 if err != nil { 6273 err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 6274 return 6275 } 6276 if !done { 6277 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsCreateOrUpdateFuture") 6278 return 6279 } 6280 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6281 if vme.Response.Response, err = future.GetResult(sender); err == nil && vme.Response.Response.StatusCode != http.StatusNoContent { 6282 vme, err = client.CreateOrUpdateResponder(vme.Response.Response) 6283 if err != nil { 6284 err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsCreateOrUpdateFuture", "Result", vme.Response.Response, "Failure responding to request") 6285 } 6286 } 6287 return 6288} 6289 6290// VirtualMachineExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of a 6291// long-running operation. 6292type VirtualMachineExtensionsDeleteFuture struct { 6293 azure.FutureAPI 6294 // Result returns the result of the asynchronous operation. 6295 // If the operation has not completed it will return an error. 6296 Result func(VirtualMachineExtensionsClient) (autorest.Response, error) 6297} 6298 6299// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6300func (future *VirtualMachineExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { 6301 var azFuture azure.Future 6302 if err := json.Unmarshal(body, &azFuture); err != nil { 6303 return err 6304 } 6305 future.FutureAPI = &azFuture 6306 future.Result = future.result 6307 return nil 6308} 6309 6310// result is the default implementation for VirtualMachineExtensionsDeleteFuture.Result. 6311func (future *VirtualMachineExtensionsDeleteFuture) result(client VirtualMachineExtensionsClient) (ar autorest.Response, err error) { 6312 var done bool 6313 done, err = future.DoneWithContext(context.Background(), client) 6314 if err != nil { 6315 err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") 6316 return 6317 } 6318 if !done { 6319 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsDeleteFuture") 6320 return 6321 } 6322 ar.Response = future.Response() 6323 return 6324} 6325 6326// VirtualMachineExtensionsListResult the List Extension operation response 6327type VirtualMachineExtensionsListResult struct { 6328 autorest.Response `json:"-"` 6329 // Value - The list of extensions 6330 Value *[]VirtualMachineExtension `json:"value,omitempty"` 6331} 6332 6333// VirtualMachineExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of a 6334// long-running operation. 6335type VirtualMachineExtensionsUpdateFuture struct { 6336 azure.FutureAPI 6337 // Result returns the result of the asynchronous operation. 6338 // If the operation has not completed it will return an error. 6339 Result func(VirtualMachineExtensionsClient) (VirtualMachineExtension, error) 6340} 6341 6342// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6343func (future *VirtualMachineExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { 6344 var azFuture azure.Future 6345 if err := json.Unmarshal(body, &azFuture); err != nil { 6346 return err 6347 } 6348 future.FutureAPI = &azFuture 6349 future.Result = future.result 6350 return nil 6351} 6352 6353// result is the default implementation for VirtualMachineExtensionsUpdateFuture.Result. 6354func (future *VirtualMachineExtensionsUpdateFuture) result(client VirtualMachineExtensionsClient) (vme VirtualMachineExtension, err error) { 6355 var done bool 6356 done, err = future.DoneWithContext(context.Background(), client) 6357 if err != nil { 6358 err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsUpdateFuture", "Result", future.Response(), "Polling failure") 6359 return 6360 } 6361 if !done { 6362 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsUpdateFuture") 6363 return 6364 } 6365 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6366 if vme.Response.Response, err = future.GetResult(sender); err == nil && vme.Response.Response.StatusCode != http.StatusNoContent { 6367 vme, err = client.UpdateResponder(vme.Response.Response) 6368 if err != nil { 6369 err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsUpdateFuture", "Result", vme.Response.Response, "Failure responding to request") 6370 } 6371 } 6372 return 6373} 6374 6375// VirtualMachineExtensionUpdate describes a Virtual Machine Extension. 6376type VirtualMachineExtensionUpdate struct { 6377 *VirtualMachineExtensionUpdateProperties `json:"properties,omitempty"` 6378 // Tags - Resource tags 6379 Tags map[string]*string `json:"tags"` 6380} 6381 6382// MarshalJSON is the custom marshaler for VirtualMachineExtensionUpdate. 6383func (vmeu VirtualMachineExtensionUpdate) MarshalJSON() ([]byte, error) { 6384 objectMap := make(map[string]interface{}) 6385 if vmeu.VirtualMachineExtensionUpdateProperties != nil { 6386 objectMap["properties"] = vmeu.VirtualMachineExtensionUpdateProperties 6387 } 6388 if vmeu.Tags != nil { 6389 objectMap["tags"] = vmeu.Tags 6390 } 6391 return json.Marshal(objectMap) 6392} 6393 6394// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtensionUpdate struct. 6395func (vmeu *VirtualMachineExtensionUpdate) UnmarshalJSON(body []byte) error { 6396 var m map[string]*json.RawMessage 6397 err := json.Unmarshal(body, &m) 6398 if err != nil { 6399 return err 6400 } 6401 for k, v := range m { 6402 switch k { 6403 case "properties": 6404 if v != nil { 6405 var virtualMachineExtensionUpdateProperties VirtualMachineExtensionUpdateProperties 6406 err = json.Unmarshal(*v, &virtualMachineExtensionUpdateProperties) 6407 if err != nil { 6408 return err 6409 } 6410 vmeu.VirtualMachineExtensionUpdateProperties = &virtualMachineExtensionUpdateProperties 6411 } 6412 case "tags": 6413 if v != nil { 6414 var tags map[string]*string 6415 err = json.Unmarshal(*v, &tags) 6416 if err != nil { 6417 return err 6418 } 6419 vmeu.Tags = tags 6420 } 6421 } 6422 } 6423 6424 return nil 6425} 6426 6427// VirtualMachineExtensionUpdateProperties describes the properties of a Virtual Machine Extension. 6428type VirtualMachineExtensionUpdateProperties struct { 6429 // ForceUpdateTag - How the extension handler should be forced to update even if the extension configuration has not changed. 6430 ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` 6431 // Publisher - The name of the extension handler publisher. 6432 Publisher *string `json:"publisher,omitempty"` 6433 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 6434 Type *string `json:"type,omitempty"` 6435 // TypeHandlerVersion - Specifies the version of the script handler. 6436 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 6437 // 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. 6438 AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` 6439 // EnableAutomaticUpgrade - Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. 6440 EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` 6441 // Settings - Json formatted public settings for the extension. 6442 Settings interface{} `json:"settings,omitempty"` 6443 // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. 6444 ProtectedSettings interface{} `json:"protectedSettings,omitempty"` 6445} 6446 6447// VirtualMachineHealthStatus the health status of the VM. 6448type VirtualMachineHealthStatus struct { 6449 // Status - READ-ONLY; The health status information for the VM. 6450 Status *InstanceViewStatus `json:"status,omitempty"` 6451} 6452 6453// VirtualMachineIdentity identity for the virtual machine. 6454type VirtualMachineIdentity struct { 6455 // PrincipalID - READ-ONLY; The principal id of virtual machine identity. This property will only be provided for a system assigned identity. 6456 PrincipalID *string `json:"principalId,omitempty"` 6457 // TenantID - READ-ONLY; The tenant id associated with the virtual machine. This property will only be provided for a system assigned identity. 6458 TenantID *string `json:"tenantId,omitempty"` 6459 // Type - The type of identity used for the virtual machine. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine. Possible values include: 'ResourceIdentityTypeSystemAssigned', 'ResourceIdentityTypeUserAssigned', 'ResourceIdentityTypeSystemAssignedUserAssigned', 'ResourceIdentityTypeNone' 6460 Type ResourceIdentityType `json:"type,omitempty"` 6461 // UserAssignedIdentities - The list of user identities associated with the Virtual Machine. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. 6462 UserAssignedIdentities map[string]*VirtualMachineIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` 6463} 6464 6465// MarshalJSON is the custom marshaler for VirtualMachineIdentity. 6466func (vmi VirtualMachineIdentity) MarshalJSON() ([]byte, error) { 6467 objectMap := make(map[string]interface{}) 6468 if vmi.Type != "" { 6469 objectMap["type"] = vmi.Type 6470 } 6471 if vmi.UserAssignedIdentities != nil { 6472 objectMap["userAssignedIdentities"] = vmi.UserAssignedIdentities 6473 } 6474 return json.Marshal(objectMap) 6475} 6476 6477// VirtualMachineIdentityUserAssignedIdentitiesValue ... 6478type VirtualMachineIdentityUserAssignedIdentitiesValue struct { 6479 // PrincipalID - READ-ONLY; The principal id of user assigned identity. 6480 PrincipalID *string `json:"principalId,omitempty"` 6481 // ClientID - READ-ONLY; The client id of user assigned identity. 6482 ClientID *string `json:"clientId,omitempty"` 6483} 6484 6485// VirtualMachineImage describes a Virtual Machine Image. 6486type VirtualMachineImage struct { 6487 autorest.Response `json:"-"` 6488 *VirtualMachineImageProperties `json:"properties,omitempty"` 6489 // Name - The name of the resource. 6490 Name *string `json:"name,omitempty"` 6491 // Location - The supported Azure location of the resource. 6492 Location *string `json:"location,omitempty"` 6493 // 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). 6494 Tags map[string]*string `json:"tags"` 6495 // ID - Resource Id 6496 ID *string `json:"id,omitempty"` 6497} 6498 6499// MarshalJSON is the custom marshaler for VirtualMachineImage. 6500func (vmi VirtualMachineImage) MarshalJSON() ([]byte, error) { 6501 objectMap := make(map[string]interface{}) 6502 if vmi.VirtualMachineImageProperties != nil { 6503 objectMap["properties"] = vmi.VirtualMachineImageProperties 6504 } 6505 if vmi.Name != nil { 6506 objectMap["name"] = vmi.Name 6507 } 6508 if vmi.Location != nil { 6509 objectMap["location"] = vmi.Location 6510 } 6511 if vmi.Tags != nil { 6512 objectMap["tags"] = vmi.Tags 6513 } 6514 if vmi.ID != nil { 6515 objectMap["id"] = vmi.ID 6516 } 6517 return json.Marshal(objectMap) 6518} 6519 6520// UnmarshalJSON is the custom unmarshaler for VirtualMachineImage struct. 6521func (vmi *VirtualMachineImage) UnmarshalJSON(body []byte) error { 6522 var m map[string]*json.RawMessage 6523 err := json.Unmarshal(body, &m) 6524 if err != nil { 6525 return err 6526 } 6527 for k, v := range m { 6528 switch k { 6529 case "properties": 6530 if v != nil { 6531 var virtualMachineImageProperties VirtualMachineImageProperties 6532 err = json.Unmarshal(*v, &virtualMachineImageProperties) 6533 if err != nil { 6534 return err 6535 } 6536 vmi.VirtualMachineImageProperties = &virtualMachineImageProperties 6537 } 6538 case "name": 6539 if v != nil { 6540 var name string 6541 err = json.Unmarshal(*v, &name) 6542 if err != nil { 6543 return err 6544 } 6545 vmi.Name = &name 6546 } 6547 case "location": 6548 if v != nil { 6549 var location string 6550 err = json.Unmarshal(*v, &location) 6551 if err != nil { 6552 return err 6553 } 6554 vmi.Location = &location 6555 } 6556 case "tags": 6557 if v != nil { 6558 var tags map[string]*string 6559 err = json.Unmarshal(*v, &tags) 6560 if err != nil { 6561 return err 6562 } 6563 vmi.Tags = tags 6564 } 6565 case "id": 6566 if v != nil { 6567 var ID string 6568 err = json.Unmarshal(*v, &ID) 6569 if err != nil { 6570 return err 6571 } 6572 vmi.ID = &ID 6573 } 6574 } 6575 } 6576 6577 return nil 6578} 6579 6580// VirtualMachineImageProperties describes the properties of a Virtual Machine Image. 6581type VirtualMachineImageProperties struct { 6582 Plan *PurchasePlan `json:"plan,omitempty"` 6583 OsDiskImage *OSDiskImage `json:"osDiskImage,omitempty"` 6584 DataDiskImages *[]DataDiskImage `json:"dataDiskImages,omitempty"` 6585 AutomaticOSUpgradeProperties *AutomaticOSUpgradeProperties `json:"automaticOSUpgradeProperties,omitempty"` 6586 // HyperVGeneration - Possible values include: 'HyperVGenerationTypesV1', 'HyperVGenerationTypesV2' 6587 HyperVGeneration HyperVGenerationTypes `json:"hyperVGeneration,omitempty"` 6588 // Disallowed - Specifies disallowed configuration for the VirtualMachine created from the image 6589 Disallowed *DisallowedConfiguration `json:"disallowed,omitempty"` 6590} 6591 6592// VirtualMachineImageResource virtual machine image resource information. 6593type VirtualMachineImageResource struct { 6594 // Name - The name of the resource. 6595 Name *string `json:"name,omitempty"` 6596 // Location - The supported Azure location of the resource. 6597 Location *string `json:"location,omitempty"` 6598 // 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). 6599 Tags map[string]*string `json:"tags"` 6600 // ID - Resource Id 6601 ID *string `json:"id,omitempty"` 6602} 6603 6604// MarshalJSON is the custom marshaler for VirtualMachineImageResource. 6605func (vmir VirtualMachineImageResource) MarshalJSON() ([]byte, error) { 6606 objectMap := make(map[string]interface{}) 6607 if vmir.Name != nil { 6608 objectMap["name"] = vmir.Name 6609 } 6610 if vmir.Location != nil { 6611 objectMap["location"] = vmir.Location 6612 } 6613 if vmir.Tags != nil { 6614 objectMap["tags"] = vmir.Tags 6615 } 6616 if vmir.ID != nil { 6617 objectMap["id"] = vmir.ID 6618 } 6619 return json.Marshal(objectMap) 6620} 6621 6622// VirtualMachineInstanceView the instance view of a virtual machine. 6623type VirtualMachineInstanceView struct { 6624 autorest.Response `json:"-"` 6625 // PlatformUpdateDomain - Specifies the update domain of the virtual machine. 6626 PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` 6627 // PlatformFaultDomain - Specifies the fault domain of the virtual machine. 6628 PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` 6629 // ComputerName - The computer name assigned to the virtual machine. 6630 ComputerName *string `json:"computerName,omitempty"` 6631 // OsName - The Operating System running on the virtual machine. 6632 OsName *string `json:"osName,omitempty"` 6633 // OsVersion - The version of Operating System running on the virtual machine. 6634 OsVersion *string `json:"osVersion,omitempty"` 6635 // HyperVGeneration - Specifies the HyperVGeneration Type associated with a resource. Possible values include: 'HyperVGenerationTypeV1', 'HyperVGenerationTypeV2' 6636 HyperVGeneration HyperVGenerationType `json:"hyperVGeneration,omitempty"` 6637 // RdpThumbPrint - The Remote desktop certificate thumbprint. 6638 RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"` 6639 // VMAgent - The VM Agent running on the virtual machine. 6640 VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"` 6641 // MaintenanceRedeployStatus - The Maintenance Operation status on the virtual machine. 6642 MaintenanceRedeployStatus *MaintenanceRedeployStatus `json:"maintenanceRedeployStatus,omitempty"` 6643 // Disks - The virtual machine disk information. 6644 Disks *[]DiskInstanceView `json:"disks,omitempty"` 6645 // Extensions - The extensions information. 6646 Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` 6647 // VMHealth - READ-ONLY; The health status for the VM. 6648 VMHealth *VirtualMachineHealthStatus `json:"vmHealth,omitempty"` 6649 // 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. 6650 BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` 6651 // AssignedHost - READ-ONLY; Resource id of the dedicated host, on which the virtual machine is allocated through automatic placement, when the virtual machine is associated with a dedicated host group that has automatic placement enabled. <br><br>Minimum api-version: 2020-06-01. 6652 AssignedHost *string `json:"assignedHost,omitempty"` 6653 // Statuses - The resource status information. 6654 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 6655 // PatchStatus - The status of virtual machine patch operations. 6656 PatchStatus *VirtualMachinePatchStatus `json:"patchStatus,omitempty"` 6657} 6658 6659// MarshalJSON is the custom marshaler for VirtualMachineInstanceView. 6660func (vmiv VirtualMachineInstanceView) MarshalJSON() ([]byte, error) { 6661 objectMap := make(map[string]interface{}) 6662 if vmiv.PlatformUpdateDomain != nil { 6663 objectMap["platformUpdateDomain"] = vmiv.PlatformUpdateDomain 6664 } 6665 if vmiv.PlatformFaultDomain != nil { 6666 objectMap["platformFaultDomain"] = vmiv.PlatformFaultDomain 6667 } 6668 if vmiv.ComputerName != nil { 6669 objectMap["computerName"] = vmiv.ComputerName 6670 } 6671 if vmiv.OsName != nil { 6672 objectMap["osName"] = vmiv.OsName 6673 } 6674 if vmiv.OsVersion != nil { 6675 objectMap["osVersion"] = vmiv.OsVersion 6676 } 6677 if vmiv.HyperVGeneration != "" { 6678 objectMap["hyperVGeneration"] = vmiv.HyperVGeneration 6679 } 6680 if vmiv.RdpThumbPrint != nil { 6681 objectMap["rdpThumbPrint"] = vmiv.RdpThumbPrint 6682 } 6683 if vmiv.VMAgent != nil { 6684 objectMap["vmAgent"] = vmiv.VMAgent 6685 } 6686 if vmiv.MaintenanceRedeployStatus != nil { 6687 objectMap["maintenanceRedeployStatus"] = vmiv.MaintenanceRedeployStatus 6688 } 6689 if vmiv.Disks != nil { 6690 objectMap["disks"] = vmiv.Disks 6691 } 6692 if vmiv.Extensions != nil { 6693 objectMap["extensions"] = vmiv.Extensions 6694 } 6695 if vmiv.BootDiagnostics != nil { 6696 objectMap["bootDiagnostics"] = vmiv.BootDiagnostics 6697 } 6698 if vmiv.Statuses != nil { 6699 objectMap["statuses"] = vmiv.Statuses 6700 } 6701 if vmiv.PatchStatus != nil { 6702 objectMap["patchStatus"] = vmiv.PatchStatus 6703 } 6704 return json.Marshal(objectMap) 6705} 6706 6707// VirtualMachineListResult the List Virtual Machine operation response. 6708type VirtualMachineListResult struct { 6709 autorest.Response `json:"-"` 6710 // Value - The list of virtual machines. 6711 Value *[]VirtualMachine `json:"value,omitempty"` 6712 // NextLink - The URI to fetch the next page of VMs. Call ListNext() with this URI to fetch the next page of Virtual Machines. 6713 NextLink *string `json:"nextLink,omitempty"` 6714} 6715 6716// VirtualMachineListResultIterator provides access to a complete listing of VirtualMachine values. 6717type VirtualMachineListResultIterator struct { 6718 i int 6719 page VirtualMachineListResultPage 6720} 6721 6722// NextWithContext advances to the next value. If there was an error making 6723// the request the iterator does not advance and the error is returned. 6724func (iter *VirtualMachineListResultIterator) NextWithContext(ctx context.Context) (err error) { 6725 if tracing.IsEnabled() { 6726 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineListResultIterator.NextWithContext") 6727 defer func() { 6728 sc := -1 6729 if iter.Response().Response.Response != nil { 6730 sc = iter.Response().Response.Response.StatusCode 6731 } 6732 tracing.EndSpan(ctx, sc, err) 6733 }() 6734 } 6735 iter.i++ 6736 if iter.i < len(iter.page.Values()) { 6737 return nil 6738 } 6739 err = iter.page.NextWithContext(ctx) 6740 if err != nil { 6741 iter.i-- 6742 return err 6743 } 6744 iter.i = 0 6745 return nil 6746} 6747 6748// Next advances to the next value. If there was an error making 6749// the request the iterator does not advance and the error is returned. 6750// Deprecated: Use NextWithContext() instead. 6751func (iter *VirtualMachineListResultIterator) Next() error { 6752 return iter.NextWithContext(context.Background()) 6753} 6754 6755// NotDone returns true if the enumeration should be started or is not yet complete. 6756func (iter VirtualMachineListResultIterator) NotDone() bool { 6757 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6758} 6759 6760// Response returns the raw server response from the last page request. 6761func (iter VirtualMachineListResultIterator) Response() VirtualMachineListResult { 6762 return iter.page.Response() 6763} 6764 6765// Value returns the current value or a zero-initialized value if the 6766// iterator has advanced beyond the end of the collection. 6767func (iter VirtualMachineListResultIterator) Value() VirtualMachine { 6768 if !iter.page.NotDone() { 6769 return VirtualMachine{} 6770 } 6771 return iter.page.Values()[iter.i] 6772} 6773 6774// Creates a new instance of the VirtualMachineListResultIterator type. 6775func NewVirtualMachineListResultIterator(page VirtualMachineListResultPage) VirtualMachineListResultIterator { 6776 return VirtualMachineListResultIterator{page: page} 6777} 6778 6779// IsEmpty returns true if the ListResult contains no values. 6780func (vmlr VirtualMachineListResult) IsEmpty() bool { 6781 return vmlr.Value == nil || len(*vmlr.Value) == 0 6782} 6783 6784// hasNextLink returns true if the NextLink is not empty. 6785func (vmlr VirtualMachineListResult) hasNextLink() bool { 6786 return vmlr.NextLink != nil && len(*vmlr.NextLink) != 0 6787} 6788 6789// virtualMachineListResultPreparer prepares a request to retrieve the next set of results. 6790// It returns nil if no more results exist. 6791func (vmlr VirtualMachineListResult) virtualMachineListResultPreparer(ctx context.Context) (*http.Request, error) { 6792 if !vmlr.hasNextLink() { 6793 return nil, nil 6794 } 6795 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6796 autorest.AsJSON(), 6797 autorest.AsGet(), 6798 autorest.WithBaseURL(to.String(vmlr.NextLink))) 6799} 6800 6801// VirtualMachineListResultPage contains a page of VirtualMachine values. 6802type VirtualMachineListResultPage struct { 6803 fn func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error) 6804 vmlr VirtualMachineListResult 6805} 6806 6807// NextWithContext advances to the next page of values. If there was an error making 6808// the request the page does not advance and the error is returned. 6809func (page *VirtualMachineListResultPage) NextWithContext(ctx context.Context) (err error) { 6810 if tracing.IsEnabled() { 6811 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineListResultPage.NextWithContext") 6812 defer func() { 6813 sc := -1 6814 if page.Response().Response.Response != nil { 6815 sc = page.Response().Response.Response.StatusCode 6816 } 6817 tracing.EndSpan(ctx, sc, err) 6818 }() 6819 } 6820 for { 6821 next, err := page.fn(ctx, page.vmlr) 6822 if err != nil { 6823 return err 6824 } 6825 page.vmlr = next 6826 if !next.hasNextLink() || !next.IsEmpty() { 6827 break 6828 } 6829 } 6830 return nil 6831} 6832 6833// Next advances to the next page of values. If there was an error making 6834// the request the page does not advance and the error is returned. 6835// Deprecated: Use NextWithContext() instead. 6836func (page *VirtualMachineListResultPage) Next() error { 6837 return page.NextWithContext(context.Background()) 6838} 6839 6840// NotDone returns true if the page enumeration should be started or is not yet complete. 6841func (page VirtualMachineListResultPage) NotDone() bool { 6842 return !page.vmlr.IsEmpty() 6843} 6844 6845// Response returns the raw server response from the last page request. 6846func (page VirtualMachineListResultPage) Response() VirtualMachineListResult { 6847 return page.vmlr 6848} 6849 6850// Values returns the slice of values for the current page or nil if there are no values. 6851func (page VirtualMachineListResultPage) Values() []VirtualMachine { 6852 if page.vmlr.IsEmpty() { 6853 return nil 6854 } 6855 return *page.vmlr.Value 6856} 6857 6858// Creates a new instance of the VirtualMachineListResultPage type. 6859func NewVirtualMachineListResultPage(cur VirtualMachineListResult, getNextPage func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error)) VirtualMachineListResultPage { 6860 return VirtualMachineListResultPage{ 6861 fn: getNextPage, 6862 vmlr: cur, 6863 } 6864} 6865 6866// VirtualMachinePatchStatus the status of virtual machine patch operations. 6867type VirtualMachinePatchStatus struct { 6868 // AvailablePatchSummary - The available patch summary of the latest assessment operation for the virtual machine. 6869 AvailablePatchSummary *AvailablePatchSummary `json:"availablePatchSummary,omitempty"` 6870 // LastPatchInstallationSummary - The installation summary of the latest installation operation for the virtual machine. 6871 LastPatchInstallationSummary *LastPatchInstallationSummary `json:"lastPatchInstallationSummary,omitempty"` 6872} 6873 6874// VirtualMachineProperties describes the properties of a Virtual Machine. 6875type VirtualMachineProperties struct { 6876 // HardwareProfile - Specifies the hardware settings for the virtual machine. 6877 HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` 6878 // StorageProfile - Specifies the storage settings for the virtual machine disks. 6879 StorageProfile *StorageProfile `json:"storageProfile,omitempty"` 6880 // AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the virtual machine. 6881 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 6882 // OsProfile - Specifies the operating system settings used while creating the virtual machine. Some of the settings cannot be changed once VM is provisioned. 6883 OsProfile *OSProfile `json:"osProfile,omitempty"` 6884 // NetworkProfile - Specifies the network interfaces of the virtual machine. 6885 NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` 6886 // SecurityProfile - Specifies the Security related profile settings for the virtual machine. 6887 SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` 6888 // DiagnosticsProfile - Specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. 6889 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 6890 // AvailabilitySet - Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see [Manage the availability of virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). <br><br> For more information on Azure planned maintenance, see [Planned maintenance for virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) <br><br> Currently, a VM can only be added to availability set at creation time. The availability set to which the VM is being added should be under the same resource group as the availability set resource. An existing VM cannot be added to an availability set. <br><br>This property cannot exist along with a non-null properties.virtualMachineScaleSet reference. 6891 AvailabilitySet *SubResource `json:"availabilitySet,omitempty"` 6892 // VirtualMachineScaleSet - Specifies information about the virtual machine scale set that the virtual machine should be assigned to. Virtual machines specified in the same virtual machine scale set are allocated to different nodes to maximize availability. Currently, a VM can only be added to virtual machine scale set at creation time. An existing VM cannot be added to a virtual machine scale set. <br><br>This property cannot exist along with a non-null properties.availabilitySet reference. <br><br>Minimum api‐version: 2019‐03‐01 6893 VirtualMachineScaleSet *SubResource `json:"virtualMachineScaleSet,omitempty"` 6894 // ProximityPlacementGroup - Specifies information about the proximity placement group that the virtual machine should be assigned to. <br><br>Minimum api-version: 2018-04-01. 6895 ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` 6896 // Priority - Specifies the priority for the virtual machine. <br><br>Minimum api-version: 2019-03-01. Possible values include: 'Regular', 'Low', 'Spot' 6897 Priority VirtualMachinePriorityTypes `json:"priority,omitempty"` 6898 // EvictionPolicy - Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set. <br><br>For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01. <br><br>For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. Possible values include: 'Deallocate', 'Delete' 6899 EvictionPolicy VirtualMachineEvictionPolicyTypes `json:"evictionPolicy,omitempty"` 6900 // BillingProfile - Specifies the billing related details of a Azure Spot virtual machine. <br><br>Minimum api-version: 2019-03-01. 6901 BillingProfile *BillingProfile `json:"billingProfile,omitempty"` 6902 // Host - Specifies information about the dedicated host that the virtual machine resides in. <br><br>Minimum api-version: 2018-10-01. 6903 Host *SubResource `json:"host,omitempty"` 6904 // HostGroup - Specifies information about the dedicated host group that the virtual machine resides in. <br><br>Minimum api-version: 2020-06-01. <br><br>NOTE: User cannot specify both host and hostGroup properties. 6905 HostGroup *SubResource `json:"hostGroup,omitempty"` 6906 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 6907 ProvisioningState *string `json:"provisioningState,omitempty"` 6908 // InstanceView - READ-ONLY; The virtual machine instance view. 6909 InstanceView *VirtualMachineInstanceView `json:"instanceView,omitempty"` 6910 // LicenseType - Specifies that the image or disk that is being used was licensed on-premises. <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) <br><br> [Azure Hybrid Use Benefit for Linux Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> Minimum api-version: 2015-06-15 6911 LicenseType *string `json:"licenseType,omitempty"` 6912 // 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. 6913 VMID *string `json:"vmId,omitempty"` 6914 // ExtensionsTimeBudget - Specifies the time alloted for all extensions to start. The time duration should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. The default value is 90 minutes (PT1H30M). <br><br> Minimum api-version: 2020-06-01 6915 ExtensionsTimeBudget *string `json:"extensionsTimeBudget,omitempty"` 6916} 6917 6918// MarshalJSON is the custom marshaler for VirtualMachineProperties. 6919func (vmp VirtualMachineProperties) MarshalJSON() ([]byte, error) { 6920 objectMap := make(map[string]interface{}) 6921 if vmp.HardwareProfile != nil { 6922 objectMap["hardwareProfile"] = vmp.HardwareProfile 6923 } 6924 if vmp.StorageProfile != nil { 6925 objectMap["storageProfile"] = vmp.StorageProfile 6926 } 6927 if vmp.AdditionalCapabilities != nil { 6928 objectMap["additionalCapabilities"] = vmp.AdditionalCapabilities 6929 } 6930 if vmp.OsProfile != nil { 6931 objectMap["osProfile"] = vmp.OsProfile 6932 } 6933 if vmp.NetworkProfile != nil { 6934 objectMap["networkProfile"] = vmp.NetworkProfile 6935 } 6936 if vmp.SecurityProfile != nil { 6937 objectMap["securityProfile"] = vmp.SecurityProfile 6938 } 6939 if vmp.DiagnosticsProfile != nil { 6940 objectMap["diagnosticsProfile"] = vmp.DiagnosticsProfile 6941 } 6942 if vmp.AvailabilitySet != nil { 6943 objectMap["availabilitySet"] = vmp.AvailabilitySet 6944 } 6945 if vmp.VirtualMachineScaleSet != nil { 6946 objectMap["virtualMachineScaleSet"] = vmp.VirtualMachineScaleSet 6947 } 6948 if vmp.ProximityPlacementGroup != nil { 6949 objectMap["proximityPlacementGroup"] = vmp.ProximityPlacementGroup 6950 } 6951 if vmp.Priority != "" { 6952 objectMap["priority"] = vmp.Priority 6953 } 6954 if vmp.EvictionPolicy != "" { 6955 objectMap["evictionPolicy"] = vmp.EvictionPolicy 6956 } 6957 if vmp.BillingProfile != nil { 6958 objectMap["billingProfile"] = vmp.BillingProfile 6959 } 6960 if vmp.Host != nil { 6961 objectMap["host"] = vmp.Host 6962 } 6963 if vmp.HostGroup != nil { 6964 objectMap["hostGroup"] = vmp.HostGroup 6965 } 6966 if vmp.LicenseType != nil { 6967 objectMap["licenseType"] = vmp.LicenseType 6968 } 6969 if vmp.ExtensionsTimeBudget != nil { 6970 objectMap["extensionsTimeBudget"] = vmp.ExtensionsTimeBudget 6971 } 6972 return json.Marshal(objectMap) 6973} 6974 6975// VirtualMachineReimageParameters parameters for Reimaging Virtual Machine. NOTE: Virtual Machine OS disk 6976// will always be reimaged 6977type VirtualMachineReimageParameters struct { 6978 // TempDisk - Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage parameter is only supported for VM/VMSS with Ephemeral OS disk. 6979 TempDisk *bool `json:"tempDisk,omitempty"` 6980} 6981 6982// VirtualMachinesAssessPatchesFuture an abstraction for monitoring and retrieving the results of a 6983// long-running operation. 6984type VirtualMachinesAssessPatchesFuture struct { 6985 azure.FutureAPI 6986 // Result returns the result of the asynchronous operation. 6987 // If the operation has not completed it will return an error. 6988 Result func(VirtualMachinesClient) (VirtualMachineAssessPatchesResult, error) 6989} 6990 6991// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6992func (future *VirtualMachinesAssessPatchesFuture) UnmarshalJSON(body []byte) error { 6993 var azFuture azure.Future 6994 if err := json.Unmarshal(body, &azFuture); err != nil { 6995 return err 6996 } 6997 future.FutureAPI = &azFuture 6998 future.Result = future.result 6999 return nil 7000} 7001 7002// result is the default implementation for VirtualMachinesAssessPatchesFuture.Result. 7003func (future *VirtualMachinesAssessPatchesFuture) result(client VirtualMachinesClient) (vmapr VirtualMachineAssessPatchesResult, err error) { 7004 var done bool 7005 done, err = future.DoneWithContext(context.Background(), client) 7006 if err != nil { 7007 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesAssessPatchesFuture", "Result", future.Response(), "Polling failure") 7008 return 7009 } 7010 if !done { 7011 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesAssessPatchesFuture") 7012 return 7013 } 7014 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7015 if vmapr.Response.Response, err = future.GetResult(sender); err == nil && vmapr.Response.Response.StatusCode != http.StatusNoContent { 7016 vmapr, err = client.AssessPatchesResponder(vmapr.Response.Response) 7017 if err != nil { 7018 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesAssessPatchesFuture", "Result", vmapr.Response.Response, "Failure responding to request") 7019 } 7020 } 7021 return 7022} 7023 7024// VirtualMachineScaleSet describes a Virtual Machine Scale Set. 7025type VirtualMachineScaleSet struct { 7026 autorest.Response `json:"-"` 7027 // Sku - The virtual machine scale set sku. 7028 Sku *Sku `json:"sku,omitempty"` 7029 // 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**. 7030 Plan *Plan `json:"plan,omitempty"` 7031 *VirtualMachineScaleSetProperties `json:"properties,omitempty"` 7032 // Identity - The identity of the virtual machine scale set, if configured. 7033 Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"` 7034 // Zones - The virtual machine scale set zones. NOTE: Availability zones can only be set when you create the scale set 7035 Zones *[]string `json:"zones,omitempty"` 7036 // ID - READ-ONLY; Resource Id 7037 ID *string `json:"id,omitempty"` 7038 // Name - READ-ONLY; Resource name 7039 Name *string `json:"name,omitempty"` 7040 // Type - READ-ONLY; Resource type 7041 Type *string `json:"type,omitempty"` 7042 // Location - Resource location 7043 Location *string `json:"location,omitempty"` 7044 // Tags - Resource tags 7045 Tags map[string]*string `json:"tags"` 7046} 7047 7048// MarshalJSON is the custom marshaler for VirtualMachineScaleSet. 7049func (vmss VirtualMachineScaleSet) MarshalJSON() ([]byte, error) { 7050 objectMap := make(map[string]interface{}) 7051 if vmss.Sku != nil { 7052 objectMap["sku"] = vmss.Sku 7053 } 7054 if vmss.Plan != nil { 7055 objectMap["plan"] = vmss.Plan 7056 } 7057 if vmss.VirtualMachineScaleSetProperties != nil { 7058 objectMap["properties"] = vmss.VirtualMachineScaleSetProperties 7059 } 7060 if vmss.Identity != nil { 7061 objectMap["identity"] = vmss.Identity 7062 } 7063 if vmss.Zones != nil { 7064 objectMap["zones"] = vmss.Zones 7065 } 7066 if vmss.Location != nil { 7067 objectMap["location"] = vmss.Location 7068 } 7069 if vmss.Tags != nil { 7070 objectMap["tags"] = vmss.Tags 7071 } 7072 return json.Marshal(objectMap) 7073} 7074 7075// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSet struct. 7076func (vmss *VirtualMachineScaleSet) UnmarshalJSON(body []byte) error { 7077 var m map[string]*json.RawMessage 7078 err := json.Unmarshal(body, &m) 7079 if err != nil { 7080 return err 7081 } 7082 for k, v := range m { 7083 switch k { 7084 case "sku": 7085 if v != nil { 7086 var sku Sku 7087 err = json.Unmarshal(*v, &sku) 7088 if err != nil { 7089 return err 7090 } 7091 vmss.Sku = &sku 7092 } 7093 case "plan": 7094 if v != nil { 7095 var plan Plan 7096 err = json.Unmarshal(*v, &plan) 7097 if err != nil { 7098 return err 7099 } 7100 vmss.Plan = &plan 7101 } 7102 case "properties": 7103 if v != nil { 7104 var virtualMachineScaleSetProperties VirtualMachineScaleSetProperties 7105 err = json.Unmarshal(*v, &virtualMachineScaleSetProperties) 7106 if err != nil { 7107 return err 7108 } 7109 vmss.VirtualMachineScaleSetProperties = &virtualMachineScaleSetProperties 7110 } 7111 case "identity": 7112 if v != nil { 7113 var identity VirtualMachineScaleSetIdentity 7114 err = json.Unmarshal(*v, &identity) 7115 if err != nil { 7116 return err 7117 } 7118 vmss.Identity = &identity 7119 } 7120 case "zones": 7121 if v != nil { 7122 var zones []string 7123 err = json.Unmarshal(*v, &zones) 7124 if err != nil { 7125 return err 7126 } 7127 vmss.Zones = &zones 7128 } 7129 case "id": 7130 if v != nil { 7131 var ID string 7132 err = json.Unmarshal(*v, &ID) 7133 if err != nil { 7134 return err 7135 } 7136 vmss.ID = &ID 7137 } 7138 case "name": 7139 if v != nil { 7140 var name string 7141 err = json.Unmarshal(*v, &name) 7142 if err != nil { 7143 return err 7144 } 7145 vmss.Name = &name 7146 } 7147 case "type": 7148 if v != nil { 7149 var typeVar string 7150 err = json.Unmarshal(*v, &typeVar) 7151 if err != nil { 7152 return err 7153 } 7154 vmss.Type = &typeVar 7155 } 7156 case "location": 7157 if v != nil { 7158 var location string 7159 err = json.Unmarshal(*v, &location) 7160 if err != nil { 7161 return err 7162 } 7163 vmss.Location = &location 7164 } 7165 case "tags": 7166 if v != nil { 7167 var tags map[string]*string 7168 err = json.Unmarshal(*v, &tags) 7169 if err != nil { 7170 return err 7171 } 7172 vmss.Tags = tags 7173 } 7174 } 7175 } 7176 7177 return nil 7178} 7179 7180// VirtualMachineScaleSetDataDisk describes a virtual machine scale set data disk. 7181type VirtualMachineScaleSetDataDisk struct { 7182 // Name - The disk name. 7183 Name *string `json:"name,omitempty"` 7184 // 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. 7185 Lun *int32 `json:"lun,omitempty"` 7186 // Caching - Specifies the caching requirements. <br><br> Possible values are: <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' 7187 Caching CachingTypes `json:"caching,omitempty"` 7188 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 7189 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 7190 // CreateOption - The create option. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' 7191 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 7192 // 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 7193 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 7194 // ManagedDisk - The managed disk parameters. 7195 ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` 7196 // DiskIOPSReadWrite - Specifies the Read-Write IOPS for the managed disk. Should be used only when StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on diskSizeGB. 7197 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 7198 // DiskMBpsReadWrite - Specifies the bandwidth in MB per second for the managed disk. Should be used only when StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on diskSizeGB. 7199 DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` 7200} 7201 7202// VirtualMachineScaleSetExtension describes a Virtual Machine Scale Set Extension. 7203type VirtualMachineScaleSetExtension struct { 7204 autorest.Response `json:"-"` 7205 // Name - The name of the extension. 7206 Name *string `json:"name,omitempty"` 7207 // Type - READ-ONLY; Resource type 7208 Type *string `json:"type,omitempty"` 7209 *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"` 7210 // ID - READ-ONLY; Resource Id 7211 ID *string `json:"id,omitempty"` 7212} 7213 7214// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtension. 7215func (vmsse VirtualMachineScaleSetExtension) MarshalJSON() ([]byte, error) { 7216 objectMap := make(map[string]interface{}) 7217 if vmsse.Name != nil { 7218 objectMap["name"] = vmsse.Name 7219 } 7220 if vmsse.VirtualMachineScaleSetExtensionProperties != nil { 7221 objectMap["properties"] = vmsse.VirtualMachineScaleSetExtensionProperties 7222 } 7223 return json.Marshal(objectMap) 7224} 7225 7226// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetExtension struct. 7227func (vmsse *VirtualMachineScaleSetExtension) UnmarshalJSON(body []byte) error { 7228 var m map[string]*json.RawMessage 7229 err := json.Unmarshal(body, &m) 7230 if err != nil { 7231 return err 7232 } 7233 for k, v := range m { 7234 switch k { 7235 case "name": 7236 if v != nil { 7237 var name string 7238 err = json.Unmarshal(*v, &name) 7239 if err != nil { 7240 return err 7241 } 7242 vmsse.Name = &name 7243 } 7244 case "type": 7245 if v != nil { 7246 var typeVar string 7247 err = json.Unmarshal(*v, &typeVar) 7248 if err != nil { 7249 return err 7250 } 7251 vmsse.Type = &typeVar 7252 } 7253 case "properties": 7254 if v != nil { 7255 var virtualMachineScaleSetExtensionProperties VirtualMachineScaleSetExtensionProperties 7256 err = json.Unmarshal(*v, &virtualMachineScaleSetExtensionProperties) 7257 if err != nil { 7258 return err 7259 } 7260 vmsse.VirtualMachineScaleSetExtensionProperties = &virtualMachineScaleSetExtensionProperties 7261 } 7262 case "id": 7263 if v != nil { 7264 var ID string 7265 err = json.Unmarshal(*v, &ID) 7266 if err != nil { 7267 return err 7268 } 7269 vmsse.ID = &ID 7270 } 7271 } 7272 } 7273 7274 return nil 7275} 7276 7277// VirtualMachineScaleSetExtensionListResult the List VM scale set extension operation response. 7278type VirtualMachineScaleSetExtensionListResult struct { 7279 autorest.Response `json:"-"` 7280 // Value - The list of VM scale set extensions. 7281 Value *[]VirtualMachineScaleSetExtension `json:"value,omitempty"` 7282 // NextLink - The uri to fetch the next page of VM scale set extensions. Call ListNext() with this to fetch the next page of VM scale set extensions. 7283 NextLink *string `json:"nextLink,omitempty"` 7284} 7285 7286// VirtualMachineScaleSetExtensionListResultIterator provides access to a complete listing of 7287// VirtualMachineScaleSetExtension values. 7288type VirtualMachineScaleSetExtensionListResultIterator struct { 7289 i int 7290 page VirtualMachineScaleSetExtensionListResultPage 7291} 7292 7293// NextWithContext advances to the next value. If there was an error making 7294// the request the iterator does not advance and the error is returned. 7295func (iter *VirtualMachineScaleSetExtensionListResultIterator) NextWithContext(ctx context.Context) (err error) { 7296 if tracing.IsEnabled() { 7297 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionListResultIterator.NextWithContext") 7298 defer func() { 7299 sc := -1 7300 if iter.Response().Response.Response != nil { 7301 sc = iter.Response().Response.Response.StatusCode 7302 } 7303 tracing.EndSpan(ctx, sc, err) 7304 }() 7305 } 7306 iter.i++ 7307 if iter.i < len(iter.page.Values()) { 7308 return nil 7309 } 7310 err = iter.page.NextWithContext(ctx) 7311 if err != nil { 7312 iter.i-- 7313 return err 7314 } 7315 iter.i = 0 7316 return nil 7317} 7318 7319// Next advances to the next value. If there was an error making 7320// the request the iterator does not advance and the error is returned. 7321// Deprecated: Use NextWithContext() instead. 7322func (iter *VirtualMachineScaleSetExtensionListResultIterator) Next() error { 7323 return iter.NextWithContext(context.Background()) 7324} 7325 7326// NotDone returns true if the enumeration should be started or is not yet complete. 7327func (iter VirtualMachineScaleSetExtensionListResultIterator) NotDone() bool { 7328 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7329} 7330 7331// Response returns the raw server response from the last page request. 7332func (iter VirtualMachineScaleSetExtensionListResultIterator) Response() VirtualMachineScaleSetExtensionListResult { 7333 return iter.page.Response() 7334} 7335 7336// Value returns the current value or a zero-initialized value if the 7337// iterator has advanced beyond the end of the collection. 7338func (iter VirtualMachineScaleSetExtensionListResultIterator) Value() VirtualMachineScaleSetExtension { 7339 if !iter.page.NotDone() { 7340 return VirtualMachineScaleSetExtension{} 7341 } 7342 return iter.page.Values()[iter.i] 7343} 7344 7345// Creates a new instance of the VirtualMachineScaleSetExtensionListResultIterator type. 7346func NewVirtualMachineScaleSetExtensionListResultIterator(page VirtualMachineScaleSetExtensionListResultPage) VirtualMachineScaleSetExtensionListResultIterator { 7347 return VirtualMachineScaleSetExtensionListResultIterator{page: page} 7348} 7349 7350// IsEmpty returns true if the ListResult contains no values. 7351func (vmsselr VirtualMachineScaleSetExtensionListResult) IsEmpty() bool { 7352 return vmsselr.Value == nil || len(*vmsselr.Value) == 0 7353} 7354 7355// hasNextLink returns true if the NextLink is not empty. 7356func (vmsselr VirtualMachineScaleSetExtensionListResult) hasNextLink() bool { 7357 return vmsselr.NextLink != nil && len(*vmsselr.NextLink) != 0 7358} 7359 7360// virtualMachineScaleSetExtensionListResultPreparer prepares a request to retrieve the next set of results. 7361// It returns nil if no more results exist. 7362func (vmsselr VirtualMachineScaleSetExtensionListResult) virtualMachineScaleSetExtensionListResultPreparer(ctx context.Context) (*http.Request, error) { 7363 if !vmsselr.hasNextLink() { 7364 return nil, nil 7365 } 7366 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7367 autorest.AsJSON(), 7368 autorest.AsGet(), 7369 autorest.WithBaseURL(to.String(vmsselr.NextLink))) 7370} 7371 7372// VirtualMachineScaleSetExtensionListResultPage contains a page of VirtualMachineScaleSetExtension values. 7373type VirtualMachineScaleSetExtensionListResultPage struct { 7374 fn func(context.Context, VirtualMachineScaleSetExtensionListResult) (VirtualMachineScaleSetExtensionListResult, error) 7375 vmsselr VirtualMachineScaleSetExtensionListResult 7376} 7377 7378// NextWithContext advances to the next page of values. If there was an error making 7379// the request the page does not advance and the error is returned. 7380func (page *VirtualMachineScaleSetExtensionListResultPage) NextWithContext(ctx context.Context) (err error) { 7381 if tracing.IsEnabled() { 7382 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionListResultPage.NextWithContext") 7383 defer func() { 7384 sc := -1 7385 if page.Response().Response.Response != nil { 7386 sc = page.Response().Response.Response.StatusCode 7387 } 7388 tracing.EndSpan(ctx, sc, err) 7389 }() 7390 } 7391 for { 7392 next, err := page.fn(ctx, page.vmsselr) 7393 if err != nil { 7394 return err 7395 } 7396 page.vmsselr = next 7397 if !next.hasNextLink() || !next.IsEmpty() { 7398 break 7399 } 7400 } 7401 return nil 7402} 7403 7404// Next advances to the next page of values. If there was an error making 7405// the request the page does not advance and the error is returned. 7406// Deprecated: Use NextWithContext() instead. 7407func (page *VirtualMachineScaleSetExtensionListResultPage) Next() error { 7408 return page.NextWithContext(context.Background()) 7409} 7410 7411// NotDone returns true if the page enumeration should be started or is not yet complete. 7412func (page VirtualMachineScaleSetExtensionListResultPage) NotDone() bool { 7413 return !page.vmsselr.IsEmpty() 7414} 7415 7416// Response returns the raw server response from the last page request. 7417func (page VirtualMachineScaleSetExtensionListResultPage) Response() VirtualMachineScaleSetExtensionListResult { 7418 return page.vmsselr 7419} 7420 7421// Values returns the slice of values for the current page or nil if there are no values. 7422func (page VirtualMachineScaleSetExtensionListResultPage) Values() []VirtualMachineScaleSetExtension { 7423 if page.vmsselr.IsEmpty() { 7424 return nil 7425 } 7426 return *page.vmsselr.Value 7427} 7428 7429// Creates a new instance of the VirtualMachineScaleSetExtensionListResultPage type. 7430func NewVirtualMachineScaleSetExtensionListResultPage(cur VirtualMachineScaleSetExtensionListResult, getNextPage func(context.Context, VirtualMachineScaleSetExtensionListResult) (VirtualMachineScaleSetExtensionListResult, error)) VirtualMachineScaleSetExtensionListResultPage { 7431 return VirtualMachineScaleSetExtensionListResultPage{ 7432 fn: getNextPage, 7433 vmsselr: cur, 7434 } 7435} 7436 7437// VirtualMachineScaleSetExtensionProfile describes a virtual machine scale set extension profile. 7438type VirtualMachineScaleSetExtensionProfile struct { 7439 // Extensions - The virtual machine scale set child extension resources. 7440 Extensions *[]VirtualMachineScaleSetExtension `json:"extensions,omitempty"` 7441 // ExtensionsTimeBudget - Specifies the time alloted for all extensions to start. The time duration should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. The default value is 90 minutes (PT1H30M). <br><br> Minimum api-version: 2020-06-01 7442 ExtensionsTimeBudget *string `json:"extensionsTimeBudget,omitempty"` 7443} 7444 7445// VirtualMachineScaleSetExtensionProperties describes the properties of a Virtual Machine Scale Set 7446// Extension. 7447type VirtualMachineScaleSetExtensionProperties struct { 7448 // ForceUpdateTag - If a value is provided and is different from the previous value, the extension handler will be forced to update even if the extension configuration has not changed. 7449 ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` 7450 // Publisher - The name of the extension handler publisher. 7451 Publisher *string `json:"publisher,omitempty"` 7452 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 7453 Type *string `json:"type,omitempty"` 7454 // TypeHandlerVersion - Specifies the version of the script handler. 7455 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 7456 // 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. 7457 AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` 7458 // EnableAutomaticUpgrade - Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. 7459 EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` 7460 // Settings - Json formatted public settings for the extension. 7461 Settings interface{} `json:"settings,omitempty"` 7462 // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. 7463 ProtectedSettings interface{} `json:"protectedSettings,omitempty"` 7464 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 7465 ProvisioningState *string `json:"provisioningState,omitempty"` 7466 // ProvisionAfterExtensions - Collection of extension names after which this extension needs to be provisioned. 7467 ProvisionAfterExtensions *[]string `json:"provisionAfterExtensions,omitempty"` 7468} 7469 7470// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtensionProperties. 7471func (vmssep VirtualMachineScaleSetExtensionProperties) MarshalJSON() ([]byte, error) { 7472 objectMap := make(map[string]interface{}) 7473 if vmssep.ForceUpdateTag != nil { 7474 objectMap["forceUpdateTag"] = vmssep.ForceUpdateTag 7475 } 7476 if vmssep.Publisher != nil { 7477 objectMap["publisher"] = vmssep.Publisher 7478 } 7479 if vmssep.Type != nil { 7480 objectMap["type"] = vmssep.Type 7481 } 7482 if vmssep.TypeHandlerVersion != nil { 7483 objectMap["typeHandlerVersion"] = vmssep.TypeHandlerVersion 7484 } 7485 if vmssep.AutoUpgradeMinorVersion != nil { 7486 objectMap["autoUpgradeMinorVersion"] = vmssep.AutoUpgradeMinorVersion 7487 } 7488 if vmssep.EnableAutomaticUpgrade != nil { 7489 objectMap["enableAutomaticUpgrade"] = vmssep.EnableAutomaticUpgrade 7490 } 7491 if vmssep.Settings != nil { 7492 objectMap["settings"] = vmssep.Settings 7493 } 7494 if vmssep.ProtectedSettings != nil { 7495 objectMap["protectedSettings"] = vmssep.ProtectedSettings 7496 } 7497 if vmssep.ProvisionAfterExtensions != nil { 7498 objectMap["provisionAfterExtensions"] = vmssep.ProvisionAfterExtensions 7499 } 7500 return json.Marshal(objectMap) 7501} 7502 7503// VirtualMachineScaleSetExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the 7504// results of a long-running operation. 7505type VirtualMachineScaleSetExtensionsCreateOrUpdateFuture struct { 7506 azure.FutureAPI 7507 // Result returns the result of the asynchronous operation. 7508 // If the operation has not completed it will return an error. 7509 Result func(VirtualMachineScaleSetExtensionsClient) (VirtualMachineScaleSetExtension, error) 7510} 7511 7512// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7513func (future *VirtualMachineScaleSetExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 7514 var azFuture azure.Future 7515 if err := json.Unmarshal(body, &azFuture); err != nil { 7516 return err 7517 } 7518 future.FutureAPI = &azFuture 7519 future.Result = future.result 7520 return nil 7521} 7522 7523// result is the default implementation for VirtualMachineScaleSetExtensionsCreateOrUpdateFuture.Result. 7524func (future *VirtualMachineScaleSetExtensionsCreateOrUpdateFuture) result(client VirtualMachineScaleSetExtensionsClient) (vmsse VirtualMachineScaleSetExtension, err error) { 7525 var done bool 7526 done, err = future.DoneWithContext(context.Background(), client) 7527 if err != nil { 7528 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 7529 return 7530 } 7531 if !done { 7532 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture") 7533 return 7534 } 7535 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7536 if vmsse.Response.Response, err = future.GetResult(sender); err == nil && vmsse.Response.Response.StatusCode != http.StatusNoContent { 7537 vmsse, err = client.CreateOrUpdateResponder(vmsse.Response.Response) 7538 if err != nil { 7539 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture", "Result", vmsse.Response.Response, "Failure responding to request") 7540 } 7541 } 7542 return 7543} 7544 7545// VirtualMachineScaleSetExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of 7546// a long-running operation. 7547type VirtualMachineScaleSetExtensionsDeleteFuture struct { 7548 azure.FutureAPI 7549 // Result returns the result of the asynchronous operation. 7550 // If the operation has not completed it will return an error. 7551 Result func(VirtualMachineScaleSetExtensionsClient) (autorest.Response, error) 7552} 7553 7554// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7555func (future *VirtualMachineScaleSetExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { 7556 var azFuture azure.Future 7557 if err := json.Unmarshal(body, &azFuture); err != nil { 7558 return err 7559 } 7560 future.FutureAPI = &azFuture 7561 future.Result = future.result 7562 return nil 7563} 7564 7565// result is the default implementation for VirtualMachineScaleSetExtensionsDeleteFuture.Result. 7566func (future *VirtualMachineScaleSetExtensionsDeleteFuture) result(client VirtualMachineScaleSetExtensionsClient) (ar autorest.Response, err error) { 7567 var done bool 7568 done, err = future.DoneWithContext(context.Background(), client) 7569 if err != nil { 7570 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") 7571 return 7572 } 7573 if !done { 7574 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsDeleteFuture") 7575 return 7576 } 7577 ar.Response = future.Response() 7578 return 7579} 7580 7581// VirtualMachineScaleSetExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of 7582// a long-running operation. 7583type VirtualMachineScaleSetExtensionsUpdateFuture struct { 7584 azure.FutureAPI 7585 // Result returns the result of the asynchronous operation. 7586 // If the operation has not completed it will return an error. 7587 Result func(VirtualMachineScaleSetExtensionsClient) (VirtualMachineScaleSetExtension, error) 7588} 7589 7590// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7591func (future *VirtualMachineScaleSetExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { 7592 var azFuture azure.Future 7593 if err := json.Unmarshal(body, &azFuture); err != nil { 7594 return err 7595 } 7596 future.FutureAPI = &azFuture 7597 future.Result = future.result 7598 return nil 7599} 7600 7601// result is the default implementation for VirtualMachineScaleSetExtensionsUpdateFuture.Result. 7602func (future *VirtualMachineScaleSetExtensionsUpdateFuture) result(client VirtualMachineScaleSetExtensionsClient) (vmsse VirtualMachineScaleSetExtension, err error) { 7603 var done bool 7604 done, err = future.DoneWithContext(context.Background(), client) 7605 if err != nil { 7606 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsUpdateFuture", "Result", future.Response(), "Polling failure") 7607 return 7608 } 7609 if !done { 7610 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsUpdateFuture") 7611 return 7612 } 7613 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7614 if vmsse.Response.Response, err = future.GetResult(sender); err == nil && vmsse.Response.Response.StatusCode != http.StatusNoContent { 7615 vmsse, err = client.UpdateResponder(vmsse.Response.Response) 7616 if err != nil { 7617 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsUpdateFuture", "Result", vmsse.Response.Response, "Failure responding to request") 7618 } 7619 } 7620 return 7621} 7622 7623// VirtualMachineScaleSetExtensionUpdate describes a Virtual Machine Scale Set Extension. 7624type VirtualMachineScaleSetExtensionUpdate struct { 7625 // Name - READ-ONLY; The name of the extension. 7626 Name *string `json:"name,omitempty"` 7627 // Type - READ-ONLY; Resource type 7628 Type *string `json:"type,omitempty"` 7629 *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"` 7630 // ID - READ-ONLY; Resource Id 7631 ID *string `json:"id,omitempty"` 7632} 7633 7634// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtensionUpdate. 7635func (vmsseu VirtualMachineScaleSetExtensionUpdate) MarshalJSON() ([]byte, error) { 7636 objectMap := make(map[string]interface{}) 7637 if vmsseu.VirtualMachineScaleSetExtensionProperties != nil { 7638 objectMap["properties"] = vmsseu.VirtualMachineScaleSetExtensionProperties 7639 } 7640 return json.Marshal(objectMap) 7641} 7642 7643// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetExtensionUpdate struct. 7644func (vmsseu *VirtualMachineScaleSetExtensionUpdate) UnmarshalJSON(body []byte) error { 7645 var m map[string]*json.RawMessage 7646 err := json.Unmarshal(body, &m) 7647 if err != nil { 7648 return err 7649 } 7650 for k, v := range m { 7651 switch k { 7652 case "name": 7653 if v != nil { 7654 var name string 7655 err = json.Unmarshal(*v, &name) 7656 if err != nil { 7657 return err 7658 } 7659 vmsseu.Name = &name 7660 } 7661 case "type": 7662 if v != nil { 7663 var typeVar string 7664 err = json.Unmarshal(*v, &typeVar) 7665 if err != nil { 7666 return err 7667 } 7668 vmsseu.Type = &typeVar 7669 } 7670 case "properties": 7671 if v != nil { 7672 var virtualMachineScaleSetExtensionProperties VirtualMachineScaleSetExtensionProperties 7673 err = json.Unmarshal(*v, &virtualMachineScaleSetExtensionProperties) 7674 if err != nil { 7675 return err 7676 } 7677 vmsseu.VirtualMachineScaleSetExtensionProperties = &virtualMachineScaleSetExtensionProperties 7678 } 7679 case "id": 7680 if v != nil { 7681 var ID string 7682 err = json.Unmarshal(*v, &ID) 7683 if err != nil { 7684 return err 7685 } 7686 vmsseu.ID = &ID 7687 } 7688 } 7689 } 7690 7691 return nil 7692} 7693 7694// VirtualMachineScaleSetIdentity identity for the virtual machine scale set. 7695type VirtualMachineScaleSetIdentity struct { 7696 // PrincipalID - READ-ONLY; The principal id of virtual machine scale set identity. This property will only be provided for a system assigned identity. 7697 PrincipalID *string `json:"principalId,omitempty"` 7698 // TenantID - READ-ONLY; The tenant id associated with the virtual machine scale set. This property will only be provided for a system assigned identity. 7699 TenantID *string `json:"tenantId,omitempty"` 7700 // Type - The type of identity used for the virtual machine scale set. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine scale set. Possible values include: 'ResourceIdentityTypeSystemAssigned', 'ResourceIdentityTypeUserAssigned', 'ResourceIdentityTypeSystemAssignedUserAssigned', 'ResourceIdentityTypeNone' 7701 Type ResourceIdentityType `json:"type,omitempty"` 7702 // UserAssignedIdentities - The list of user identities associated with the virtual machine scale set. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. 7703 UserAssignedIdentities map[string]*VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` 7704} 7705 7706// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIdentity. 7707func (vmssi VirtualMachineScaleSetIdentity) MarshalJSON() ([]byte, error) { 7708 objectMap := make(map[string]interface{}) 7709 if vmssi.Type != "" { 7710 objectMap["type"] = vmssi.Type 7711 } 7712 if vmssi.UserAssignedIdentities != nil { 7713 objectMap["userAssignedIdentities"] = vmssi.UserAssignedIdentities 7714 } 7715 return json.Marshal(objectMap) 7716} 7717 7718// VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue ... 7719type VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue struct { 7720 // PrincipalID - READ-ONLY; The principal id of user assigned identity. 7721 PrincipalID *string `json:"principalId,omitempty"` 7722 // ClientID - READ-ONLY; The client id of user assigned identity. 7723 ClientID *string `json:"clientId,omitempty"` 7724} 7725 7726// VirtualMachineScaleSetInstanceView the instance view of a virtual machine scale set. 7727type VirtualMachineScaleSetInstanceView struct { 7728 autorest.Response `json:"-"` 7729 // VirtualMachine - READ-ONLY; The instance view status summary for the virtual machine scale set. 7730 VirtualMachine *VirtualMachineScaleSetInstanceViewStatusesSummary `json:"virtualMachine,omitempty"` 7731 // Extensions - READ-ONLY; The extensions information. 7732 Extensions *[]VirtualMachineScaleSetVMExtensionsSummary `json:"extensions,omitempty"` 7733 // Statuses - The resource status information. 7734 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 7735 // OrchestrationServices - READ-ONLY; The orchestration services information. 7736 OrchestrationServices *[]OrchestrationServiceSummary `json:"orchestrationServices,omitempty"` 7737} 7738 7739// MarshalJSON is the custom marshaler for VirtualMachineScaleSetInstanceView. 7740func (vmssiv VirtualMachineScaleSetInstanceView) MarshalJSON() ([]byte, error) { 7741 objectMap := make(map[string]interface{}) 7742 if vmssiv.Statuses != nil { 7743 objectMap["statuses"] = vmssiv.Statuses 7744 } 7745 return json.Marshal(objectMap) 7746} 7747 7748// VirtualMachineScaleSetInstanceViewStatusesSummary instance view statuses summary for virtual machines of 7749// a virtual machine scale set. 7750type VirtualMachineScaleSetInstanceViewStatusesSummary struct { 7751 // StatusesSummary - READ-ONLY; The extensions information. 7752 StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` 7753} 7754 7755// VirtualMachineScaleSetIPConfiguration describes a virtual machine scale set network profile's IP 7756// configuration. 7757type VirtualMachineScaleSetIPConfiguration struct { 7758 // Name - The IP configuration name. 7759 Name *string `json:"name,omitempty"` 7760 *VirtualMachineScaleSetIPConfigurationProperties `json:"properties,omitempty"` 7761 // ID - Resource Id 7762 ID *string `json:"id,omitempty"` 7763} 7764 7765// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIPConfiguration. 7766func (vmssic VirtualMachineScaleSetIPConfiguration) MarshalJSON() ([]byte, error) { 7767 objectMap := make(map[string]interface{}) 7768 if vmssic.Name != nil { 7769 objectMap["name"] = vmssic.Name 7770 } 7771 if vmssic.VirtualMachineScaleSetIPConfigurationProperties != nil { 7772 objectMap["properties"] = vmssic.VirtualMachineScaleSetIPConfigurationProperties 7773 } 7774 if vmssic.ID != nil { 7775 objectMap["id"] = vmssic.ID 7776 } 7777 return json.Marshal(objectMap) 7778} 7779 7780// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetIPConfiguration struct. 7781func (vmssic *VirtualMachineScaleSetIPConfiguration) UnmarshalJSON(body []byte) error { 7782 var m map[string]*json.RawMessage 7783 err := json.Unmarshal(body, &m) 7784 if err != nil { 7785 return err 7786 } 7787 for k, v := range m { 7788 switch k { 7789 case "name": 7790 if v != nil { 7791 var name string 7792 err = json.Unmarshal(*v, &name) 7793 if err != nil { 7794 return err 7795 } 7796 vmssic.Name = &name 7797 } 7798 case "properties": 7799 if v != nil { 7800 var virtualMachineScaleSetIPConfigurationProperties VirtualMachineScaleSetIPConfigurationProperties 7801 err = json.Unmarshal(*v, &virtualMachineScaleSetIPConfigurationProperties) 7802 if err != nil { 7803 return err 7804 } 7805 vmssic.VirtualMachineScaleSetIPConfigurationProperties = &virtualMachineScaleSetIPConfigurationProperties 7806 } 7807 case "id": 7808 if v != nil { 7809 var ID string 7810 err = json.Unmarshal(*v, &ID) 7811 if err != nil { 7812 return err 7813 } 7814 vmssic.ID = &ID 7815 } 7816 } 7817 } 7818 7819 return nil 7820} 7821 7822// VirtualMachineScaleSetIPConfigurationProperties describes a virtual machine scale set network profile's 7823// IP configuration properties. 7824type VirtualMachineScaleSetIPConfigurationProperties struct { 7825 // Subnet - Specifies the identifier of the subnet. 7826 Subnet *APIEntityReference `json:"subnet,omitempty"` 7827 // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. 7828 Primary *bool `json:"primary,omitempty"` 7829 // PublicIPAddressConfiguration - The publicIPAddressConfiguration. 7830 PublicIPAddressConfiguration *VirtualMachineScaleSetPublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` 7831 // PrivateIPAddressVersion - Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' 7832 PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` 7833 // ApplicationGatewayBackendAddressPools - Specifies an array of references to backend address pools of application gateways. A scale set can reference backend address pools of multiple application gateways. Multiple scale sets cannot use the same application gateway. 7834 ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` 7835 // ApplicationSecurityGroups - Specifies an array of references to application security group. 7836 ApplicationSecurityGroups *[]SubResource `json:"applicationSecurityGroups,omitempty"` 7837 // LoadBalancerBackendAddressPools - Specifies an array of references to backend address pools of load balancers. A scale set can reference backend address pools of one public and one internal load balancer. Multiple scale sets cannot use the same basic sku load balancer. 7838 LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` 7839 // LoadBalancerInboundNatPools - Specifies an array of references to inbound Nat pools of the load balancers. A scale set can reference inbound nat pools of one public and one internal load balancer. Multiple scale sets cannot use the same basic sku load balancer. 7840 LoadBalancerInboundNatPools *[]SubResource `json:"loadBalancerInboundNatPools,omitempty"` 7841} 7842 7843// VirtualMachineScaleSetIPTag contains the IP tag associated with the public IP address. 7844type VirtualMachineScaleSetIPTag struct { 7845 // IPTagType - IP tag type. Example: FirstPartyUsage. 7846 IPTagType *string `json:"ipTagType,omitempty"` 7847 // Tag - IP tag associated with the public IP. Example: SQL, Storage etc. 7848 Tag *string `json:"tag,omitempty"` 7849} 7850 7851// VirtualMachineScaleSetListOSUpgradeHistory list of Virtual Machine Scale Set OS Upgrade History 7852// operation response. 7853type VirtualMachineScaleSetListOSUpgradeHistory struct { 7854 autorest.Response `json:"-"` 7855 // Value - The list of OS upgrades performed on the virtual machine scale set. 7856 Value *[]UpgradeOperationHistoricalStatusInfo `json:"value,omitempty"` 7857 // NextLink - The uri to fetch the next page of OS Upgrade History. Call ListNext() with this to fetch the next page of history of upgrades. 7858 NextLink *string `json:"nextLink,omitempty"` 7859} 7860 7861// VirtualMachineScaleSetListOSUpgradeHistoryIterator provides access to a complete listing of 7862// UpgradeOperationHistoricalStatusInfo values. 7863type VirtualMachineScaleSetListOSUpgradeHistoryIterator struct { 7864 i int 7865 page VirtualMachineScaleSetListOSUpgradeHistoryPage 7866} 7867 7868// NextWithContext advances to the next value. If there was an error making 7869// the request the iterator does not advance and the error is returned. 7870func (iter *VirtualMachineScaleSetListOSUpgradeHistoryIterator) NextWithContext(ctx context.Context) (err error) { 7871 if tracing.IsEnabled() { 7872 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListOSUpgradeHistoryIterator.NextWithContext") 7873 defer func() { 7874 sc := -1 7875 if iter.Response().Response.Response != nil { 7876 sc = iter.Response().Response.Response.StatusCode 7877 } 7878 tracing.EndSpan(ctx, sc, err) 7879 }() 7880 } 7881 iter.i++ 7882 if iter.i < len(iter.page.Values()) { 7883 return nil 7884 } 7885 err = iter.page.NextWithContext(ctx) 7886 if err != nil { 7887 iter.i-- 7888 return err 7889 } 7890 iter.i = 0 7891 return nil 7892} 7893 7894// Next advances to the next value. If there was an error making 7895// the request the iterator does not advance and the error is returned. 7896// Deprecated: Use NextWithContext() instead. 7897func (iter *VirtualMachineScaleSetListOSUpgradeHistoryIterator) Next() error { 7898 return iter.NextWithContext(context.Background()) 7899} 7900 7901// NotDone returns true if the enumeration should be started or is not yet complete. 7902func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) NotDone() bool { 7903 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7904} 7905 7906// Response returns the raw server response from the last page request. 7907func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) Response() VirtualMachineScaleSetListOSUpgradeHistory { 7908 return iter.page.Response() 7909} 7910 7911// Value returns the current value or a zero-initialized value if the 7912// iterator has advanced beyond the end of the collection. 7913func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) Value() UpgradeOperationHistoricalStatusInfo { 7914 if !iter.page.NotDone() { 7915 return UpgradeOperationHistoricalStatusInfo{} 7916 } 7917 return iter.page.Values()[iter.i] 7918} 7919 7920// Creates a new instance of the VirtualMachineScaleSetListOSUpgradeHistoryIterator type. 7921func NewVirtualMachineScaleSetListOSUpgradeHistoryIterator(page VirtualMachineScaleSetListOSUpgradeHistoryPage) VirtualMachineScaleSetListOSUpgradeHistoryIterator { 7922 return VirtualMachineScaleSetListOSUpgradeHistoryIterator{page: page} 7923} 7924 7925// IsEmpty returns true if the ListResult contains no values. 7926func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) IsEmpty() bool { 7927 return vmsslouh.Value == nil || len(*vmsslouh.Value) == 0 7928} 7929 7930// hasNextLink returns true if the NextLink is not empty. 7931func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) hasNextLink() bool { 7932 return vmsslouh.NextLink != nil && len(*vmsslouh.NextLink) != 0 7933} 7934 7935// virtualMachineScaleSetListOSUpgradeHistoryPreparer prepares a request to retrieve the next set of results. 7936// It returns nil if no more results exist. 7937func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) virtualMachineScaleSetListOSUpgradeHistoryPreparer(ctx context.Context) (*http.Request, error) { 7938 if !vmsslouh.hasNextLink() { 7939 return nil, nil 7940 } 7941 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7942 autorest.AsJSON(), 7943 autorest.AsGet(), 7944 autorest.WithBaseURL(to.String(vmsslouh.NextLink))) 7945} 7946 7947// VirtualMachineScaleSetListOSUpgradeHistoryPage contains a page of UpgradeOperationHistoricalStatusInfo 7948// values. 7949type VirtualMachineScaleSetListOSUpgradeHistoryPage struct { 7950 fn func(context.Context, VirtualMachineScaleSetListOSUpgradeHistory) (VirtualMachineScaleSetListOSUpgradeHistory, error) 7951 vmsslouh VirtualMachineScaleSetListOSUpgradeHistory 7952} 7953 7954// NextWithContext advances to the next page of values. If there was an error making 7955// the request the page does not advance and the error is returned. 7956func (page *VirtualMachineScaleSetListOSUpgradeHistoryPage) NextWithContext(ctx context.Context) (err error) { 7957 if tracing.IsEnabled() { 7958 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListOSUpgradeHistoryPage.NextWithContext") 7959 defer func() { 7960 sc := -1 7961 if page.Response().Response.Response != nil { 7962 sc = page.Response().Response.Response.StatusCode 7963 } 7964 tracing.EndSpan(ctx, sc, err) 7965 }() 7966 } 7967 for { 7968 next, err := page.fn(ctx, page.vmsslouh) 7969 if err != nil { 7970 return err 7971 } 7972 page.vmsslouh = next 7973 if !next.hasNextLink() || !next.IsEmpty() { 7974 break 7975 } 7976 } 7977 return nil 7978} 7979 7980// Next advances to the next page of values. If there was an error making 7981// the request the page does not advance and the error is returned. 7982// Deprecated: Use NextWithContext() instead. 7983func (page *VirtualMachineScaleSetListOSUpgradeHistoryPage) Next() error { 7984 return page.NextWithContext(context.Background()) 7985} 7986 7987// NotDone returns true if the page enumeration should be started or is not yet complete. 7988func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) NotDone() bool { 7989 return !page.vmsslouh.IsEmpty() 7990} 7991 7992// Response returns the raw server response from the last page request. 7993func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) Response() VirtualMachineScaleSetListOSUpgradeHistory { 7994 return page.vmsslouh 7995} 7996 7997// Values returns the slice of values for the current page or nil if there are no values. 7998func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) Values() []UpgradeOperationHistoricalStatusInfo { 7999 if page.vmsslouh.IsEmpty() { 8000 return nil 8001 } 8002 return *page.vmsslouh.Value 8003} 8004 8005// Creates a new instance of the VirtualMachineScaleSetListOSUpgradeHistoryPage type. 8006func NewVirtualMachineScaleSetListOSUpgradeHistoryPage(cur VirtualMachineScaleSetListOSUpgradeHistory, getNextPage func(context.Context, VirtualMachineScaleSetListOSUpgradeHistory) (VirtualMachineScaleSetListOSUpgradeHistory, error)) VirtualMachineScaleSetListOSUpgradeHistoryPage { 8007 return VirtualMachineScaleSetListOSUpgradeHistoryPage{ 8008 fn: getNextPage, 8009 vmsslouh: cur, 8010 } 8011} 8012 8013// VirtualMachineScaleSetListResult the List Virtual Machine operation response. 8014type VirtualMachineScaleSetListResult struct { 8015 autorest.Response `json:"-"` 8016 // Value - The list of virtual machine scale sets. 8017 Value *[]VirtualMachineScaleSet `json:"value,omitempty"` 8018 // NextLink - The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with this to fetch the next page of VMSS. 8019 NextLink *string `json:"nextLink,omitempty"` 8020} 8021 8022// VirtualMachineScaleSetListResultIterator provides access to a complete listing of VirtualMachineScaleSet 8023// values. 8024type VirtualMachineScaleSetListResultIterator struct { 8025 i int 8026 page VirtualMachineScaleSetListResultPage 8027} 8028 8029// NextWithContext advances to the next value. If there was an error making 8030// the request the iterator does not advance and the error is returned. 8031func (iter *VirtualMachineScaleSetListResultIterator) NextWithContext(ctx context.Context) (err error) { 8032 if tracing.IsEnabled() { 8033 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListResultIterator.NextWithContext") 8034 defer func() { 8035 sc := -1 8036 if iter.Response().Response.Response != nil { 8037 sc = iter.Response().Response.Response.StatusCode 8038 } 8039 tracing.EndSpan(ctx, sc, err) 8040 }() 8041 } 8042 iter.i++ 8043 if iter.i < len(iter.page.Values()) { 8044 return nil 8045 } 8046 err = iter.page.NextWithContext(ctx) 8047 if err != nil { 8048 iter.i-- 8049 return err 8050 } 8051 iter.i = 0 8052 return nil 8053} 8054 8055// Next advances to the next value. If there was an error making 8056// the request the iterator does not advance and the error is returned. 8057// Deprecated: Use NextWithContext() instead. 8058func (iter *VirtualMachineScaleSetListResultIterator) Next() error { 8059 return iter.NextWithContext(context.Background()) 8060} 8061 8062// NotDone returns true if the enumeration should be started or is not yet complete. 8063func (iter VirtualMachineScaleSetListResultIterator) NotDone() bool { 8064 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8065} 8066 8067// Response returns the raw server response from the last page request. 8068func (iter VirtualMachineScaleSetListResultIterator) Response() VirtualMachineScaleSetListResult { 8069 return iter.page.Response() 8070} 8071 8072// Value returns the current value or a zero-initialized value if the 8073// iterator has advanced beyond the end of the collection. 8074func (iter VirtualMachineScaleSetListResultIterator) Value() VirtualMachineScaleSet { 8075 if !iter.page.NotDone() { 8076 return VirtualMachineScaleSet{} 8077 } 8078 return iter.page.Values()[iter.i] 8079} 8080 8081// Creates a new instance of the VirtualMachineScaleSetListResultIterator type. 8082func NewVirtualMachineScaleSetListResultIterator(page VirtualMachineScaleSetListResultPage) VirtualMachineScaleSetListResultIterator { 8083 return VirtualMachineScaleSetListResultIterator{page: page} 8084} 8085 8086// IsEmpty returns true if the ListResult contains no values. 8087func (vmsslr VirtualMachineScaleSetListResult) IsEmpty() bool { 8088 return vmsslr.Value == nil || len(*vmsslr.Value) == 0 8089} 8090 8091// hasNextLink returns true if the NextLink is not empty. 8092func (vmsslr VirtualMachineScaleSetListResult) hasNextLink() bool { 8093 return vmsslr.NextLink != nil && len(*vmsslr.NextLink) != 0 8094} 8095 8096// virtualMachineScaleSetListResultPreparer prepares a request to retrieve the next set of results. 8097// It returns nil if no more results exist. 8098func (vmsslr VirtualMachineScaleSetListResult) virtualMachineScaleSetListResultPreparer(ctx context.Context) (*http.Request, error) { 8099 if !vmsslr.hasNextLink() { 8100 return nil, nil 8101 } 8102 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8103 autorest.AsJSON(), 8104 autorest.AsGet(), 8105 autorest.WithBaseURL(to.String(vmsslr.NextLink))) 8106} 8107 8108// VirtualMachineScaleSetListResultPage contains a page of VirtualMachineScaleSet values. 8109type VirtualMachineScaleSetListResultPage struct { 8110 fn func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error) 8111 vmsslr VirtualMachineScaleSetListResult 8112} 8113 8114// NextWithContext advances to the next page of values. If there was an error making 8115// the request the page does not advance and the error is returned. 8116func (page *VirtualMachineScaleSetListResultPage) NextWithContext(ctx context.Context) (err error) { 8117 if tracing.IsEnabled() { 8118 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListResultPage.NextWithContext") 8119 defer func() { 8120 sc := -1 8121 if page.Response().Response.Response != nil { 8122 sc = page.Response().Response.Response.StatusCode 8123 } 8124 tracing.EndSpan(ctx, sc, err) 8125 }() 8126 } 8127 for { 8128 next, err := page.fn(ctx, page.vmsslr) 8129 if err != nil { 8130 return err 8131 } 8132 page.vmsslr = next 8133 if !next.hasNextLink() || !next.IsEmpty() { 8134 break 8135 } 8136 } 8137 return nil 8138} 8139 8140// Next advances to the next page of values. If there was an error making 8141// the request the page does not advance and the error is returned. 8142// Deprecated: Use NextWithContext() instead. 8143func (page *VirtualMachineScaleSetListResultPage) Next() error { 8144 return page.NextWithContext(context.Background()) 8145} 8146 8147// NotDone returns true if the page enumeration should be started or is not yet complete. 8148func (page VirtualMachineScaleSetListResultPage) NotDone() bool { 8149 return !page.vmsslr.IsEmpty() 8150} 8151 8152// Response returns the raw server response from the last page request. 8153func (page VirtualMachineScaleSetListResultPage) Response() VirtualMachineScaleSetListResult { 8154 return page.vmsslr 8155} 8156 8157// Values returns the slice of values for the current page or nil if there are no values. 8158func (page VirtualMachineScaleSetListResultPage) Values() []VirtualMachineScaleSet { 8159 if page.vmsslr.IsEmpty() { 8160 return nil 8161 } 8162 return *page.vmsslr.Value 8163} 8164 8165// Creates a new instance of the VirtualMachineScaleSetListResultPage type. 8166func NewVirtualMachineScaleSetListResultPage(cur VirtualMachineScaleSetListResult, getNextPage func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error)) VirtualMachineScaleSetListResultPage { 8167 return VirtualMachineScaleSetListResultPage{ 8168 fn: getNextPage, 8169 vmsslr: cur, 8170 } 8171} 8172 8173// VirtualMachineScaleSetListSkusResult the Virtual Machine Scale Set List Skus operation response. 8174type VirtualMachineScaleSetListSkusResult struct { 8175 autorest.Response `json:"-"` 8176 // Value - The list of skus available for the virtual machine scale set. 8177 Value *[]VirtualMachineScaleSetSku `json:"value,omitempty"` 8178 // 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. 8179 NextLink *string `json:"nextLink,omitempty"` 8180} 8181 8182// VirtualMachineScaleSetListSkusResultIterator provides access to a complete listing of 8183// VirtualMachineScaleSetSku values. 8184type VirtualMachineScaleSetListSkusResultIterator struct { 8185 i int 8186 page VirtualMachineScaleSetListSkusResultPage 8187} 8188 8189// NextWithContext advances to the next value. If there was an error making 8190// the request the iterator does not advance and the error is returned. 8191func (iter *VirtualMachineScaleSetListSkusResultIterator) NextWithContext(ctx context.Context) (err error) { 8192 if tracing.IsEnabled() { 8193 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListSkusResultIterator.NextWithContext") 8194 defer func() { 8195 sc := -1 8196 if iter.Response().Response.Response != nil { 8197 sc = iter.Response().Response.Response.StatusCode 8198 } 8199 tracing.EndSpan(ctx, sc, err) 8200 }() 8201 } 8202 iter.i++ 8203 if iter.i < len(iter.page.Values()) { 8204 return nil 8205 } 8206 err = iter.page.NextWithContext(ctx) 8207 if err != nil { 8208 iter.i-- 8209 return err 8210 } 8211 iter.i = 0 8212 return nil 8213} 8214 8215// Next advances to the next value. If there was an error making 8216// the request the iterator does not advance and the error is returned. 8217// Deprecated: Use NextWithContext() instead. 8218func (iter *VirtualMachineScaleSetListSkusResultIterator) Next() error { 8219 return iter.NextWithContext(context.Background()) 8220} 8221 8222// NotDone returns true if the enumeration should be started or is not yet complete. 8223func (iter VirtualMachineScaleSetListSkusResultIterator) NotDone() bool { 8224 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8225} 8226 8227// Response returns the raw server response from the last page request. 8228func (iter VirtualMachineScaleSetListSkusResultIterator) Response() VirtualMachineScaleSetListSkusResult { 8229 return iter.page.Response() 8230} 8231 8232// Value returns the current value or a zero-initialized value if the 8233// iterator has advanced beyond the end of the collection. 8234func (iter VirtualMachineScaleSetListSkusResultIterator) Value() VirtualMachineScaleSetSku { 8235 if !iter.page.NotDone() { 8236 return VirtualMachineScaleSetSku{} 8237 } 8238 return iter.page.Values()[iter.i] 8239} 8240 8241// Creates a new instance of the VirtualMachineScaleSetListSkusResultIterator type. 8242func NewVirtualMachineScaleSetListSkusResultIterator(page VirtualMachineScaleSetListSkusResultPage) VirtualMachineScaleSetListSkusResultIterator { 8243 return VirtualMachineScaleSetListSkusResultIterator{page: page} 8244} 8245 8246// IsEmpty returns true if the ListResult contains no values. 8247func (vmsslsr VirtualMachineScaleSetListSkusResult) IsEmpty() bool { 8248 return vmsslsr.Value == nil || len(*vmsslsr.Value) == 0 8249} 8250 8251// hasNextLink returns true if the NextLink is not empty. 8252func (vmsslsr VirtualMachineScaleSetListSkusResult) hasNextLink() bool { 8253 return vmsslsr.NextLink != nil && len(*vmsslsr.NextLink) != 0 8254} 8255 8256// virtualMachineScaleSetListSkusResultPreparer prepares a request to retrieve the next set of results. 8257// It returns nil if no more results exist. 8258func (vmsslsr VirtualMachineScaleSetListSkusResult) virtualMachineScaleSetListSkusResultPreparer(ctx context.Context) (*http.Request, error) { 8259 if !vmsslsr.hasNextLink() { 8260 return nil, nil 8261 } 8262 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8263 autorest.AsJSON(), 8264 autorest.AsGet(), 8265 autorest.WithBaseURL(to.String(vmsslsr.NextLink))) 8266} 8267 8268// VirtualMachineScaleSetListSkusResultPage contains a page of VirtualMachineScaleSetSku values. 8269type VirtualMachineScaleSetListSkusResultPage struct { 8270 fn func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error) 8271 vmsslsr VirtualMachineScaleSetListSkusResult 8272} 8273 8274// NextWithContext advances to the next page of values. If there was an error making 8275// the request the page does not advance and the error is returned. 8276func (page *VirtualMachineScaleSetListSkusResultPage) NextWithContext(ctx context.Context) (err error) { 8277 if tracing.IsEnabled() { 8278 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListSkusResultPage.NextWithContext") 8279 defer func() { 8280 sc := -1 8281 if page.Response().Response.Response != nil { 8282 sc = page.Response().Response.Response.StatusCode 8283 } 8284 tracing.EndSpan(ctx, sc, err) 8285 }() 8286 } 8287 for { 8288 next, err := page.fn(ctx, page.vmsslsr) 8289 if err != nil { 8290 return err 8291 } 8292 page.vmsslsr = next 8293 if !next.hasNextLink() || !next.IsEmpty() { 8294 break 8295 } 8296 } 8297 return nil 8298} 8299 8300// Next advances to the next page of values. If there was an error making 8301// the request the page does not advance and the error is returned. 8302// Deprecated: Use NextWithContext() instead. 8303func (page *VirtualMachineScaleSetListSkusResultPage) Next() error { 8304 return page.NextWithContext(context.Background()) 8305} 8306 8307// NotDone returns true if the page enumeration should be started or is not yet complete. 8308func (page VirtualMachineScaleSetListSkusResultPage) NotDone() bool { 8309 return !page.vmsslsr.IsEmpty() 8310} 8311 8312// Response returns the raw server response from the last page request. 8313func (page VirtualMachineScaleSetListSkusResultPage) Response() VirtualMachineScaleSetListSkusResult { 8314 return page.vmsslsr 8315} 8316 8317// Values returns the slice of values for the current page or nil if there are no values. 8318func (page VirtualMachineScaleSetListSkusResultPage) Values() []VirtualMachineScaleSetSku { 8319 if page.vmsslsr.IsEmpty() { 8320 return nil 8321 } 8322 return *page.vmsslsr.Value 8323} 8324 8325// Creates a new instance of the VirtualMachineScaleSetListSkusResultPage type. 8326func NewVirtualMachineScaleSetListSkusResultPage(cur VirtualMachineScaleSetListSkusResult, getNextPage func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error)) VirtualMachineScaleSetListSkusResultPage { 8327 return VirtualMachineScaleSetListSkusResultPage{ 8328 fn: getNextPage, 8329 vmsslsr: cur, 8330 } 8331} 8332 8333// VirtualMachineScaleSetListWithLinkResult the List Virtual Machine operation response. 8334type VirtualMachineScaleSetListWithLinkResult struct { 8335 autorest.Response `json:"-"` 8336 // Value - The list of virtual machine scale sets. 8337 Value *[]VirtualMachineScaleSet `json:"value,omitempty"` 8338 // 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. 8339 NextLink *string `json:"nextLink,omitempty"` 8340} 8341 8342// VirtualMachineScaleSetListWithLinkResultIterator provides access to a complete listing of 8343// VirtualMachineScaleSet values. 8344type VirtualMachineScaleSetListWithLinkResultIterator struct { 8345 i int 8346 page VirtualMachineScaleSetListWithLinkResultPage 8347} 8348 8349// NextWithContext advances to the next value. If there was an error making 8350// the request the iterator does not advance and the error is returned. 8351func (iter *VirtualMachineScaleSetListWithLinkResultIterator) NextWithContext(ctx context.Context) (err error) { 8352 if tracing.IsEnabled() { 8353 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListWithLinkResultIterator.NextWithContext") 8354 defer func() { 8355 sc := -1 8356 if iter.Response().Response.Response != nil { 8357 sc = iter.Response().Response.Response.StatusCode 8358 } 8359 tracing.EndSpan(ctx, sc, err) 8360 }() 8361 } 8362 iter.i++ 8363 if iter.i < len(iter.page.Values()) { 8364 return nil 8365 } 8366 err = iter.page.NextWithContext(ctx) 8367 if err != nil { 8368 iter.i-- 8369 return err 8370 } 8371 iter.i = 0 8372 return nil 8373} 8374 8375// Next advances to the next value. If there was an error making 8376// the request the iterator does not advance and the error is returned. 8377// Deprecated: Use NextWithContext() instead. 8378func (iter *VirtualMachineScaleSetListWithLinkResultIterator) Next() error { 8379 return iter.NextWithContext(context.Background()) 8380} 8381 8382// NotDone returns true if the enumeration should be started or is not yet complete. 8383func (iter VirtualMachineScaleSetListWithLinkResultIterator) NotDone() bool { 8384 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8385} 8386 8387// Response returns the raw server response from the last page request. 8388func (iter VirtualMachineScaleSetListWithLinkResultIterator) Response() VirtualMachineScaleSetListWithLinkResult { 8389 return iter.page.Response() 8390} 8391 8392// Value returns the current value or a zero-initialized value if the 8393// iterator has advanced beyond the end of the collection. 8394func (iter VirtualMachineScaleSetListWithLinkResultIterator) Value() VirtualMachineScaleSet { 8395 if !iter.page.NotDone() { 8396 return VirtualMachineScaleSet{} 8397 } 8398 return iter.page.Values()[iter.i] 8399} 8400 8401// Creates a new instance of the VirtualMachineScaleSetListWithLinkResultIterator type. 8402func NewVirtualMachineScaleSetListWithLinkResultIterator(page VirtualMachineScaleSetListWithLinkResultPage) VirtualMachineScaleSetListWithLinkResultIterator { 8403 return VirtualMachineScaleSetListWithLinkResultIterator{page: page} 8404} 8405 8406// IsEmpty returns true if the ListResult contains no values. 8407func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) IsEmpty() bool { 8408 return vmsslwlr.Value == nil || len(*vmsslwlr.Value) == 0 8409} 8410 8411// hasNextLink returns true if the NextLink is not empty. 8412func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) hasNextLink() bool { 8413 return vmsslwlr.NextLink != nil && len(*vmsslwlr.NextLink) != 0 8414} 8415 8416// virtualMachineScaleSetListWithLinkResultPreparer prepares a request to retrieve the next set of results. 8417// It returns nil if no more results exist. 8418func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) virtualMachineScaleSetListWithLinkResultPreparer(ctx context.Context) (*http.Request, error) { 8419 if !vmsslwlr.hasNextLink() { 8420 return nil, nil 8421 } 8422 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8423 autorest.AsJSON(), 8424 autorest.AsGet(), 8425 autorest.WithBaseURL(to.String(vmsslwlr.NextLink))) 8426} 8427 8428// VirtualMachineScaleSetListWithLinkResultPage contains a page of VirtualMachineScaleSet values. 8429type VirtualMachineScaleSetListWithLinkResultPage struct { 8430 fn func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error) 8431 vmsslwlr VirtualMachineScaleSetListWithLinkResult 8432} 8433 8434// NextWithContext advances to the next page of values. If there was an error making 8435// the request the page does not advance and the error is returned. 8436func (page *VirtualMachineScaleSetListWithLinkResultPage) NextWithContext(ctx context.Context) (err error) { 8437 if tracing.IsEnabled() { 8438 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListWithLinkResultPage.NextWithContext") 8439 defer func() { 8440 sc := -1 8441 if page.Response().Response.Response != nil { 8442 sc = page.Response().Response.Response.StatusCode 8443 } 8444 tracing.EndSpan(ctx, sc, err) 8445 }() 8446 } 8447 for { 8448 next, err := page.fn(ctx, page.vmsslwlr) 8449 if err != nil { 8450 return err 8451 } 8452 page.vmsslwlr = next 8453 if !next.hasNextLink() || !next.IsEmpty() { 8454 break 8455 } 8456 } 8457 return nil 8458} 8459 8460// Next advances to the next page of values. If there was an error making 8461// the request the page does not advance and the error is returned. 8462// Deprecated: Use NextWithContext() instead. 8463func (page *VirtualMachineScaleSetListWithLinkResultPage) Next() error { 8464 return page.NextWithContext(context.Background()) 8465} 8466 8467// NotDone returns true if the page enumeration should be started or is not yet complete. 8468func (page VirtualMachineScaleSetListWithLinkResultPage) NotDone() bool { 8469 return !page.vmsslwlr.IsEmpty() 8470} 8471 8472// Response returns the raw server response from the last page request. 8473func (page VirtualMachineScaleSetListWithLinkResultPage) Response() VirtualMachineScaleSetListWithLinkResult { 8474 return page.vmsslwlr 8475} 8476 8477// Values returns the slice of values for the current page or nil if there are no values. 8478func (page VirtualMachineScaleSetListWithLinkResultPage) Values() []VirtualMachineScaleSet { 8479 if page.vmsslwlr.IsEmpty() { 8480 return nil 8481 } 8482 return *page.vmsslwlr.Value 8483} 8484 8485// Creates a new instance of the VirtualMachineScaleSetListWithLinkResultPage type. 8486func NewVirtualMachineScaleSetListWithLinkResultPage(cur VirtualMachineScaleSetListWithLinkResult, getNextPage func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error)) VirtualMachineScaleSetListWithLinkResultPage { 8487 return VirtualMachineScaleSetListWithLinkResultPage{ 8488 fn: getNextPage, 8489 vmsslwlr: cur, 8490 } 8491} 8492 8493// VirtualMachineScaleSetManagedDiskParameters describes the parameters of a ScaleSet managed disk. 8494type VirtualMachineScaleSetManagedDiskParameters struct { 8495 // StorageAccountType - Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values include: 'StorageAccountTypesStandardLRS', 'StorageAccountTypesPremiumLRS', 'StorageAccountTypesStandardSSDLRS', 'StorageAccountTypesUltraSSDLRS' 8496 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 8497 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed disk. 8498 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 8499} 8500 8501// VirtualMachineScaleSetNetworkConfiguration describes a virtual machine scale set network profile's 8502// network configurations. 8503type VirtualMachineScaleSetNetworkConfiguration struct { 8504 // Name - The network configuration name. 8505 Name *string `json:"name,omitempty"` 8506 *VirtualMachineScaleSetNetworkConfigurationProperties `json:"properties,omitempty"` 8507 // ID - Resource Id 8508 ID *string `json:"id,omitempty"` 8509} 8510 8511// MarshalJSON is the custom marshaler for VirtualMachineScaleSetNetworkConfiguration. 8512func (vmssnc VirtualMachineScaleSetNetworkConfiguration) MarshalJSON() ([]byte, error) { 8513 objectMap := make(map[string]interface{}) 8514 if vmssnc.Name != nil { 8515 objectMap["name"] = vmssnc.Name 8516 } 8517 if vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties != nil { 8518 objectMap["properties"] = vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties 8519 } 8520 if vmssnc.ID != nil { 8521 objectMap["id"] = vmssnc.ID 8522 } 8523 return json.Marshal(objectMap) 8524} 8525 8526// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetNetworkConfiguration struct. 8527func (vmssnc *VirtualMachineScaleSetNetworkConfiguration) UnmarshalJSON(body []byte) error { 8528 var m map[string]*json.RawMessage 8529 err := json.Unmarshal(body, &m) 8530 if err != nil { 8531 return err 8532 } 8533 for k, v := range m { 8534 switch k { 8535 case "name": 8536 if v != nil { 8537 var name string 8538 err = json.Unmarshal(*v, &name) 8539 if err != nil { 8540 return err 8541 } 8542 vmssnc.Name = &name 8543 } 8544 case "properties": 8545 if v != nil { 8546 var virtualMachineScaleSetNetworkConfigurationProperties VirtualMachineScaleSetNetworkConfigurationProperties 8547 err = json.Unmarshal(*v, &virtualMachineScaleSetNetworkConfigurationProperties) 8548 if err != nil { 8549 return err 8550 } 8551 vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties = &virtualMachineScaleSetNetworkConfigurationProperties 8552 } 8553 case "id": 8554 if v != nil { 8555 var ID string 8556 err = json.Unmarshal(*v, &ID) 8557 if err != nil { 8558 return err 8559 } 8560 vmssnc.ID = &ID 8561 } 8562 } 8563 } 8564 8565 return nil 8566} 8567 8568// VirtualMachineScaleSetNetworkConfigurationDNSSettings describes a virtual machines scale sets network 8569// configuration's DNS settings. 8570type VirtualMachineScaleSetNetworkConfigurationDNSSettings struct { 8571 // DNSServers - List of DNS servers IP addresses 8572 DNSServers *[]string `json:"dnsServers,omitempty"` 8573} 8574 8575// VirtualMachineScaleSetNetworkConfigurationProperties describes a virtual machine scale set network 8576// profile's IP configuration. 8577type VirtualMachineScaleSetNetworkConfigurationProperties struct { 8578 // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. 8579 Primary *bool `json:"primary,omitempty"` 8580 // EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled. 8581 EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` 8582 // EnableFpga - Specifies whether the network interface is FPGA networking-enabled. 8583 EnableFpga *bool `json:"enableFpga,omitempty"` 8584 // NetworkSecurityGroup - The network security group. 8585 NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` 8586 // DNSSettings - The dns settings to be applied on the network interfaces. 8587 DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings `json:"dnsSettings,omitempty"` 8588 // IPConfigurations - Specifies the IP configurations of the network interface. 8589 IPConfigurations *[]VirtualMachineScaleSetIPConfiguration `json:"ipConfigurations,omitempty"` 8590 // EnableIPForwarding - Whether IP forwarding enabled on this NIC. 8591 EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` 8592} 8593 8594// VirtualMachineScaleSetNetworkProfile describes a virtual machine scale set network profile. 8595type VirtualMachineScaleSetNetworkProfile struct { 8596 // HealthProbe - A reference to a load balancer probe used to determine the health of an instance in the virtual machine scale set. The reference will be in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. 8597 HealthProbe *APIEntityReference `json:"healthProbe,omitempty"` 8598 // NetworkInterfaceConfigurations - The list of network configurations. 8599 NetworkInterfaceConfigurations *[]VirtualMachineScaleSetNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` 8600} 8601 8602// VirtualMachineScaleSetOSDisk describes a virtual machine scale set operating system disk. 8603type VirtualMachineScaleSetOSDisk struct { 8604 // Name - The disk name. 8605 Name *string `json:"name,omitempty"` 8606 // Caching - Specifies the caching requirements. <br><br> Possible values are: <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' 8607 Caching CachingTypes `json:"caching,omitempty"` 8608 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 8609 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 8610 // CreateOption - Specifies how the virtual machines in the scale set should be created.<br><br> The only allowed value is: **FromImage** \u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' 8611 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 8612 // DiffDiskSettings - Specifies the ephemeral disk Settings for the operating system disk used by the virtual machine scale set. 8613 DiffDiskSettings *DiffDiskSettings `json:"diffDiskSettings,omitempty"` 8614 // DiskSizeGB - Specifies the size of the operating system disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image. <br><br> This value cannot be larger than 1023 GB 8615 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 8616 // 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' 8617 OsType OperatingSystemTypes `json:"osType,omitempty"` 8618 // Image - Specifies information about the unmanaged user image to base the scale set on. 8619 Image *VirtualHardDisk `json:"image,omitempty"` 8620 // VhdContainers - Specifies the container urls that are used to store operating system disks for the scale set. 8621 VhdContainers *[]string `json:"vhdContainers,omitempty"` 8622 // ManagedDisk - The managed disk parameters. 8623 ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` 8624} 8625 8626// VirtualMachineScaleSetOSProfile describes a virtual machine scale set OS profile. 8627type VirtualMachineScaleSetOSProfile struct { 8628 // 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. 8629 ComputerNamePrefix *string `json:"computerNamePrefix,omitempty"` 8630 // 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) 8631 AdminUsername *string `json:"adminUsername,omitempty"` 8632 // 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) 8633 AdminPassword *string `json:"adminPassword,omitempty"` 8634 // 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) 8635 CustomData *string `json:"customData,omitempty"` 8636 // WindowsConfiguration - Specifies Windows operating system settings on the virtual machine. 8637 WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` 8638 // 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). 8639 LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` 8640 // Secrets - Specifies set of certificates that should be installed onto the virtual machines in the scale set. 8641 Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` 8642} 8643 8644// VirtualMachineScaleSetProperties describes the properties of a Virtual Machine Scale Set. 8645type VirtualMachineScaleSetProperties struct { 8646 // UpgradePolicy - The upgrade policy. 8647 UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` 8648 // AutomaticRepairsPolicy - Policy for automatic repairs. 8649 AutomaticRepairsPolicy *AutomaticRepairsPolicy `json:"automaticRepairsPolicy,omitempty"` 8650 // VirtualMachineProfile - The virtual machine profile. 8651 VirtualMachineProfile *VirtualMachineScaleSetVMProfile `json:"virtualMachineProfile,omitempty"` 8652 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 8653 ProvisioningState *string `json:"provisioningState,omitempty"` 8654 // Overprovision - Specifies whether the Virtual Machine Scale Set should be overprovisioned. 8655 Overprovision *bool `json:"overprovision,omitempty"` 8656 // DoNotRunExtensionsOnOverprovisionedVMs - When Overprovision is enabled, extensions are launched only on the requested number of VMs which are finally kept. This property will hence ensure that the extensions do not run on the extra overprovisioned VMs. 8657 DoNotRunExtensionsOnOverprovisionedVMs *bool `json:"doNotRunExtensionsOnOverprovisionedVMs,omitempty"` 8658 // UniqueID - READ-ONLY; Specifies the ID which uniquely identifies a Virtual Machine Scale Set. 8659 UniqueID *string `json:"uniqueId,omitempty"` 8660 // SinglePlacementGroup - When true this limits the scale set to a single placement group, of max size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be modified to false. However, if singlePlacementGroup is false, it may not be modified to true. 8661 SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"` 8662 // ZoneBalance - Whether to force strictly even Virtual Machine distribution cross x-zones in case there is zone outage. 8663 ZoneBalance *bool `json:"zoneBalance,omitempty"` 8664 // PlatformFaultDomainCount - Fault Domain count for each placement group. 8665 PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` 8666 // ProximityPlacementGroup - Specifies information about the proximity placement group that the virtual machine scale set should be assigned to. <br><br>Minimum api-version: 2018-04-01. 8667 ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` 8668 // HostGroup - Specifies information about the dedicated host group that the virtual machine scale set resides in. <br><br>Minimum api-version: 2020-06-01. 8669 HostGroup *SubResource `json:"hostGroup,omitempty"` 8670 // AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the Virtual Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have the capability to support attaching managed data disks with UltraSSD_LRS storage account type. 8671 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 8672 // ScaleInPolicy - Specifies the scale-in policy that decides which virtual machines are chosen for removal when a Virtual Machine Scale Set is scaled-in. 8673 ScaleInPolicy *ScaleInPolicy `json:"scaleInPolicy,omitempty"` 8674} 8675 8676// MarshalJSON is the custom marshaler for VirtualMachineScaleSetProperties. 8677func (vmssp VirtualMachineScaleSetProperties) MarshalJSON() ([]byte, error) { 8678 objectMap := make(map[string]interface{}) 8679 if vmssp.UpgradePolicy != nil { 8680 objectMap["upgradePolicy"] = vmssp.UpgradePolicy 8681 } 8682 if vmssp.AutomaticRepairsPolicy != nil { 8683 objectMap["automaticRepairsPolicy"] = vmssp.AutomaticRepairsPolicy 8684 } 8685 if vmssp.VirtualMachineProfile != nil { 8686 objectMap["virtualMachineProfile"] = vmssp.VirtualMachineProfile 8687 } 8688 if vmssp.Overprovision != nil { 8689 objectMap["overprovision"] = vmssp.Overprovision 8690 } 8691 if vmssp.DoNotRunExtensionsOnOverprovisionedVMs != nil { 8692 objectMap["doNotRunExtensionsOnOverprovisionedVMs"] = vmssp.DoNotRunExtensionsOnOverprovisionedVMs 8693 } 8694 if vmssp.SinglePlacementGroup != nil { 8695 objectMap["singlePlacementGroup"] = vmssp.SinglePlacementGroup 8696 } 8697 if vmssp.ZoneBalance != nil { 8698 objectMap["zoneBalance"] = vmssp.ZoneBalance 8699 } 8700 if vmssp.PlatformFaultDomainCount != nil { 8701 objectMap["platformFaultDomainCount"] = vmssp.PlatformFaultDomainCount 8702 } 8703 if vmssp.ProximityPlacementGroup != nil { 8704 objectMap["proximityPlacementGroup"] = vmssp.ProximityPlacementGroup 8705 } 8706 if vmssp.HostGroup != nil { 8707 objectMap["hostGroup"] = vmssp.HostGroup 8708 } 8709 if vmssp.AdditionalCapabilities != nil { 8710 objectMap["additionalCapabilities"] = vmssp.AdditionalCapabilities 8711 } 8712 if vmssp.ScaleInPolicy != nil { 8713 objectMap["scaleInPolicy"] = vmssp.ScaleInPolicy 8714 } 8715 return json.Marshal(objectMap) 8716} 8717 8718// VirtualMachineScaleSetPublicIPAddressConfiguration describes a virtual machines scale set IP 8719// Configuration's PublicIPAddress configuration 8720type VirtualMachineScaleSetPublicIPAddressConfiguration struct { 8721 // Name - The publicIP address configuration name. 8722 Name *string `json:"name,omitempty"` 8723 *VirtualMachineScaleSetPublicIPAddressConfigurationProperties `json:"properties,omitempty"` 8724} 8725 8726// MarshalJSON is the custom marshaler for VirtualMachineScaleSetPublicIPAddressConfiguration. 8727func (vmsspiac VirtualMachineScaleSetPublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { 8728 objectMap := make(map[string]interface{}) 8729 if vmsspiac.Name != nil { 8730 objectMap["name"] = vmsspiac.Name 8731 } 8732 if vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties != nil { 8733 objectMap["properties"] = vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties 8734 } 8735 return json.Marshal(objectMap) 8736} 8737 8738// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetPublicIPAddressConfiguration struct. 8739func (vmsspiac *VirtualMachineScaleSetPublicIPAddressConfiguration) UnmarshalJSON(body []byte) error { 8740 var m map[string]*json.RawMessage 8741 err := json.Unmarshal(body, &m) 8742 if err != nil { 8743 return err 8744 } 8745 for k, v := range m { 8746 switch k { 8747 case "name": 8748 if v != nil { 8749 var name string 8750 err = json.Unmarshal(*v, &name) 8751 if err != nil { 8752 return err 8753 } 8754 vmsspiac.Name = &name 8755 } 8756 case "properties": 8757 if v != nil { 8758 var virtualMachineScaleSetPublicIPAddressConfigurationProperties VirtualMachineScaleSetPublicIPAddressConfigurationProperties 8759 err = json.Unmarshal(*v, &virtualMachineScaleSetPublicIPAddressConfigurationProperties) 8760 if err != nil { 8761 return err 8762 } 8763 vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties = &virtualMachineScaleSetPublicIPAddressConfigurationProperties 8764 } 8765 } 8766 } 8767 8768 return nil 8769} 8770 8771// VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings describes a virtual machines scale sets 8772// network configuration's DNS settings. 8773type VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings struct { 8774 // DomainNameLabel - The Domain name label.The concatenation of the domain name label and vm index will be the domain name labels of the PublicIPAddress resources that will be created 8775 DomainNameLabel *string `json:"domainNameLabel,omitempty"` 8776} 8777 8778// VirtualMachineScaleSetPublicIPAddressConfigurationProperties describes a virtual machines scale set IP 8779// Configuration's PublicIPAddress configuration 8780type VirtualMachineScaleSetPublicIPAddressConfigurationProperties struct { 8781 // IdleTimeoutInMinutes - The idle timeout of the public IP address. 8782 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` 8783 // DNSSettings - The dns settings to be applied on the publicIP addresses . 8784 DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings `json:"dnsSettings,omitempty"` 8785 // IPTags - The list of IP tags associated with the public IP address. 8786 IPTags *[]VirtualMachineScaleSetIPTag `json:"ipTags,omitempty"` 8787 // PublicIPPrefix - The PublicIPPrefix from which to allocate publicIP addresses. 8788 PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` 8789 // PublicIPAddressVersion - Available from Api-Version 2019-07-01 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' 8790 PublicIPAddressVersion IPVersion `json:"publicIPAddressVersion,omitempty"` 8791} 8792 8793// VirtualMachineScaleSetReimageParameters describes a Virtual Machine Scale Set VM Reimage Parameters. 8794type VirtualMachineScaleSetReimageParameters struct { 8795 // 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. 8796 InstanceIds *[]string `json:"instanceIds,omitempty"` 8797 // TempDisk - Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage parameter is only supported for VM/VMSS with Ephemeral OS disk. 8798 TempDisk *bool `json:"tempDisk,omitempty"` 8799} 8800 8801// VirtualMachineScaleSetRollingUpgradesCancelFuture an abstraction for monitoring and retrieving the 8802// results of a long-running operation. 8803type VirtualMachineScaleSetRollingUpgradesCancelFuture struct { 8804 azure.FutureAPI 8805 // Result returns the result of the asynchronous operation. 8806 // If the operation has not completed it will return an error. 8807 Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) 8808} 8809 8810// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8811func (future *VirtualMachineScaleSetRollingUpgradesCancelFuture) UnmarshalJSON(body []byte) error { 8812 var azFuture azure.Future 8813 if err := json.Unmarshal(body, &azFuture); err != nil { 8814 return err 8815 } 8816 future.FutureAPI = &azFuture 8817 future.Result = future.result 8818 return nil 8819} 8820 8821// result is the default implementation for VirtualMachineScaleSetRollingUpgradesCancelFuture.Result. 8822func (future *VirtualMachineScaleSetRollingUpgradesCancelFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { 8823 var done bool 8824 done, err = future.DoneWithContext(context.Background(), client) 8825 if err != nil { 8826 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesCancelFuture", "Result", future.Response(), "Polling failure") 8827 return 8828 } 8829 if !done { 8830 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesCancelFuture") 8831 return 8832 } 8833 ar.Response = future.Response() 8834 return 8835} 8836 8837// VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture an abstraction for monitoring and 8838// retrieving the results of a long-running operation. 8839type VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture struct { 8840 azure.FutureAPI 8841 // Result returns the result of the asynchronous operation. 8842 // If the operation has not completed it will return an error. 8843 Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) 8844} 8845 8846// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8847func (future *VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture) UnmarshalJSON(body []byte) error { 8848 var azFuture azure.Future 8849 if err := json.Unmarshal(body, &azFuture); err != nil { 8850 return err 8851 } 8852 future.FutureAPI = &azFuture 8853 future.Result = future.result 8854 return nil 8855} 8856 8857// result is the default implementation for VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture.Result. 8858func (future *VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { 8859 var done bool 8860 done, err = future.DoneWithContext(context.Background(), client) 8861 if err != nil { 8862 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture", "Result", future.Response(), "Polling failure") 8863 return 8864 } 8865 if !done { 8866 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture") 8867 return 8868 } 8869 ar.Response = future.Response() 8870 return 8871} 8872 8873// VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture an abstraction for monitoring and retrieving 8874// the results of a long-running operation. 8875type VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture struct { 8876 azure.FutureAPI 8877 // Result returns the result of the asynchronous operation. 8878 // If the operation has not completed it will return an error. 8879 Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) 8880} 8881 8882// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8883func (future *VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture) UnmarshalJSON(body []byte) error { 8884 var azFuture azure.Future 8885 if err := json.Unmarshal(body, &azFuture); err != nil { 8886 return err 8887 } 8888 future.FutureAPI = &azFuture 8889 future.Result = future.result 8890 return nil 8891} 8892 8893// result is the default implementation for VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture.Result. 8894func (future *VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { 8895 var done bool 8896 done, err = future.DoneWithContext(context.Background(), client) 8897 if err != nil { 8898 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture", "Result", future.Response(), "Polling failure") 8899 return 8900 } 8901 if !done { 8902 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture") 8903 return 8904 } 8905 ar.Response = future.Response() 8906 return 8907} 8908 8909// VirtualMachineScaleSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of 8910// a long-running operation. 8911type VirtualMachineScaleSetsCreateOrUpdateFuture struct { 8912 azure.FutureAPI 8913 // Result returns the result of the asynchronous operation. 8914 // If the operation has not completed it will return an error. 8915 Result func(VirtualMachineScaleSetsClient) (VirtualMachineScaleSet, error) 8916} 8917 8918// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8919func (future *VirtualMachineScaleSetsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 8920 var azFuture azure.Future 8921 if err := json.Unmarshal(body, &azFuture); err != nil { 8922 return err 8923 } 8924 future.FutureAPI = &azFuture 8925 future.Result = future.result 8926 return nil 8927} 8928 8929// result is the default implementation for VirtualMachineScaleSetsCreateOrUpdateFuture.Result. 8930func (future *VirtualMachineScaleSetsCreateOrUpdateFuture) result(client VirtualMachineScaleSetsClient) (vmss VirtualMachineScaleSet, err error) { 8931 var done bool 8932 done, err = future.DoneWithContext(context.Background(), client) 8933 if err != nil { 8934 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 8935 return 8936 } 8937 if !done { 8938 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsCreateOrUpdateFuture") 8939 return 8940 } 8941 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8942 if vmss.Response.Response, err = future.GetResult(sender); err == nil && vmss.Response.Response.StatusCode != http.StatusNoContent { 8943 vmss, err = client.CreateOrUpdateResponder(vmss.Response.Response) 8944 if err != nil { 8945 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsCreateOrUpdateFuture", "Result", vmss.Response.Response, "Failure responding to request") 8946 } 8947 } 8948 return 8949} 8950 8951// VirtualMachineScaleSetsDeallocateFuture an abstraction for monitoring and retrieving the results of a 8952// long-running operation. 8953type VirtualMachineScaleSetsDeallocateFuture struct { 8954 azure.FutureAPI 8955 // Result returns the result of the asynchronous operation. 8956 // If the operation has not completed it will return an error. 8957 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 8958} 8959 8960// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8961func (future *VirtualMachineScaleSetsDeallocateFuture) UnmarshalJSON(body []byte) error { 8962 var azFuture azure.Future 8963 if err := json.Unmarshal(body, &azFuture); err != nil { 8964 return err 8965 } 8966 future.FutureAPI = &azFuture 8967 future.Result = future.result 8968 return nil 8969} 8970 8971// result is the default implementation for VirtualMachineScaleSetsDeallocateFuture.Result. 8972func (future *VirtualMachineScaleSetsDeallocateFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 8973 var done bool 8974 done, err = future.DoneWithContext(context.Background(), client) 8975 if err != nil { 8976 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeallocateFuture", "Result", future.Response(), "Polling failure") 8977 return 8978 } 8979 if !done { 8980 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeallocateFuture") 8981 return 8982 } 8983 ar.Response = future.Response() 8984 return 8985} 8986 8987// VirtualMachineScaleSetsDeleteFuture an abstraction for monitoring and retrieving the results of a 8988// long-running operation. 8989type VirtualMachineScaleSetsDeleteFuture struct { 8990 azure.FutureAPI 8991 // Result returns the result of the asynchronous operation. 8992 // If the operation has not completed it will return an error. 8993 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 8994} 8995 8996// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8997func (future *VirtualMachineScaleSetsDeleteFuture) UnmarshalJSON(body []byte) error { 8998 var azFuture azure.Future 8999 if err := json.Unmarshal(body, &azFuture); err != nil { 9000 return err 9001 } 9002 future.FutureAPI = &azFuture 9003 future.Result = future.result 9004 return nil 9005} 9006 9007// result is the default implementation for VirtualMachineScaleSetsDeleteFuture.Result. 9008func (future *VirtualMachineScaleSetsDeleteFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 9009 var done bool 9010 done, err = future.DoneWithContext(context.Background(), client) 9011 if err != nil { 9012 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeleteFuture", "Result", future.Response(), "Polling failure") 9013 return 9014 } 9015 if !done { 9016 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeleteFuture") 9017 return 9018 } 9019 ar.Response = future.Response() 9020 return 9021} 9022 9023// VirtualMachineScaleSetsDeleteInstancesFuture an abstraction for monitoring and retrieving the results of 9024// a long-running operation. 9025type VirtualMachineScaleSetsDeleteInstancesFuture struct { 9026 azure.FutureAPI 9027 // Result returns the result of the asynchronous operation. 9028 // If the operation has not completed it will return an error. 9029 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 9030} 9031 9032// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9033func (future *VirtualMachineScaleSetsDeleteInstancesFuture) UnmarshalJSON(body []byte) error { 9034 var azFuture azure.Future 9035 if err := json.Unmarshal(body, &azFuture); err != nil { 9036 return err 9037 } 9038 future.FutureAPI = &azFuture 9039 future.Result = future.result 9040 return nil 9041} 9042 9043// result is the default implementation for VirtualMachineScaleSetsDeleteInstancesFuture.Result. 9044func (future *VirtualMachineScaleSetsDeleteInstancesFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 9045 var done bool 9046 done, err = future.DoneWithContext(context.Background(), client) 9047 if err != nil { 9048 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeleteInstancesFuture", "Result", future.Response(), "Polling failure") 9049 return 9050 } 9051 if !done { 9052 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeleteInstancesFuture") 9053 return 9054 } 9055 ar.Response = future.Response() 9056 return 9057} 9058 9059// VirtualMachineScaleSetSku describes an available virtual machine scale set sku. 9060type VirtualMachineScaleSetSku struct { 9061 // ResourceType - READ-ONLY; The type of resource the sku applies to. 9062 ResourceType *string `json:"resourceType,omitempty"` 9063 // Sku - READ-ONLY; The Sku. 9064 Sku *Sku `json:"sku,omitempty"` 9065 // Capacity - READ-ONLY; Specifies the number of virtual machines in the scale set. 9066 Capacity *VirtualMachineScaleSetSkuCapacity `json:"capacity,omitempty"` 9067} 9068 9069// VirtualMachineScaleSetSkuCapacity describes scaling information of a sku. 9070type VirtualMachineScaleSetSkuCapacity struct { 9071 // Minimum - READ-ONLY; The minimum capacity. 9072 Minimum *int64 `json:"minimum,omitempty"` 9073 // Maximum - READ-ONLY; The maximum capacity that can be set. 9074 Maximum *int64 `json:"maximum,omitempty"` 9075 // DefaultCapacity - READ-ONLY; The default capacity. 9076 DefaultCapacity *int64 `json:"defaultCapacity,omitempty"` 9077 // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'VirtualMachineScaleSetSkuScaleTypeAutomatic', 'VirtualMachineScaleSetSkuScaleTypeNone' 9078 ScaleType VirtualMachineScaleSetSkuScaleType `json:"scaleType,omitempty"` 9079} 9080 9081// VirtualMachineScaleSetsPerformMaintenanceFuture an abstraction for monitoring and retrieving the results 9082// of a long-running operation. 9083type VirtualMachineScaleSetsPerformMaintenanceFuture struct { 9084 azure.FutureAPI 9085 // Result returns the result of the asynchronous operation. 9086 // If the operation has not completed it will return an error. 9087 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 9088} 9089 9090// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9091func (future *VirtualMachineScaleSetsPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { 9092 var azFuture azure.Future 9093 if err := json.Unmarshal(body, &azFuture); err != nil { 9094 return err 9095 } 9096 future.FutureAPI = &azFuture 9097 future.Result = future.result 9098 return nil 9099} 9100 9101// result is the default implementation for VirtualMachineScaleSetsPerformMaintenanceFuture.Result. 9102func (future *VirtualMachineScaleSetsPerformMaintenanceFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 9103 var done bool 9104 done, err = future.DoneWithContext(context.Background(), client) 9105 if err != nil { 9106 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsPerformMaintenanceFuture", "Result", future.Response(), "Polling failure") 9107 return 9108 } 9109 if !done { 9110 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsPerformMaintenanceFuture") 9111 return 9112 } 9113 ar.Response = future.Response() 9114 return 9115} 9116 9117// VirtualMachineScaleSetsPowerOffFuture an abstraction for monitoring and retrieving the results of a 9118// long-running operation. 9119type VirtualMachineScaleSetsPowerOffFuture struct { 9120 azure.FutureAPI 9121 // Result returns the result of the asynchronous operation. 9122 // If the operation has not completed it will return an error. 9123 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 9124} 9125 9126// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9127func (future *VirtualMachineScaleSetsPowerOffFuture) UnmarshalJSON(body []byte) error { 9128 var azFuture azure.Future 9129 if err := json.Unmarshal(body, &azFuture); err != nil { 9130 return err 9131 } 9132 future.FutureAPI = &azFuture 9133 future.Result = future.result 9134 return nil 9135} 9136 9137// result is the default implementation for VirtualMachineScaleSetsPowerOffFuture.Result. 9138func (future *VirtualMachineScaleSetsPowerOffFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 9139 var done bool 9140 done, err = future.DoneWithContext(context.Background(), client) 9141 if err != nil { 9142 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsPowerOffFuture", "Result", future.Response(), "Polling failure") 9143 return 9144 } 9145 if !done { 9146 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsPowerOffFuture") 9147 return 9148 } 9149 ar.Response = future.Response() 9150 return 9151} 9152 9153// VirtualMachineScaleSetsRedeployFuture an abstraction for monitoring and retrieving the results of a 9154// long-running operation. 9155type VirtualMachineScaleSetsRedeployFuture struct { 9156 azure.FutureAPI 9157 // Result returns the result of the asynchronous operation. 9158 // If the operation has not completed it will return an error. 9159 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 9160} 9161 9162// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9163func (future *VirtualMachineScaleSetsRedeployFuture) UnmarshalJSON(body []byte) error { 9164 var azFuture azure.Future 9165 if err := json.Unmarshal(body, &azFuture); err != nil { 9166 return err 9167 } 9168 future.FutureAPI = &azFuture 9169 future.Result = future.result 9170 return nil 9171} 9172 9173// result is the default implementation for VirtualMachineScaleSetsRedeployFuture.Result. 9174func (future *VirtualMachineScaleSetsRedeployFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 9175 var done bool 9176 done, err = future.DoneWithContext(context.Background(), client) 9177 if err != nil { 9178 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsRedeployFuture", "Result", future.Response(), "Polling failure") 9179 return 9180 } 9181 if !done { 9182 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsRedeployFuture") 9183 return 9184 } 9185 ar.Response = future.Response() 9186 return 9187} 9188 9189// VirtualMachineScaleSetsReimageAllFuture an abstraction for monitoring and retrieving the results of a 9190// long-running operation. 9191type VirtualMachineScaleSetsReimageAllFuture struct { 9192 azure.FutureAPI 9193 // Result returns the result of the asynchronous operation. 9194 // If the operation has not completed it will return an error. 9195 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 9196} 9197 9198// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9199func (future *VirtualMachineScaleSetsReimageAllFuture) UnmarshalJSON(body []byte) error { 9200 var azFuture azure.Future 9201 if err := json.Unmarshal(body, &azFuture); err != nil { 9202 return err 9203 } 9204 future.FutureAPI = &azFuture 9205 future.Result = future.result 9206 return nil 9207} 9208 9209// result is the default implementation for VirtualMachineScaleSetsReimageAllFuture.Result. 9210func (future *VirtualMachineScaleSetsReimageAllFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 9211 var done bool 9212 done, err = future.DoneWithContext(context.Background(), client) 9213 if err != nil { 9214 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsReimageAllFuture", "Result", future.Response(), "Polling failure") 9215 return 9216 } 9217 if !done { 9218 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsReimageAllFuture") 9219 return 9220 } 9221 ar.Response = future.Response() 9222 return 9223} 9224 9225// VirtualMachineScaleSetsReimageFuture an abstraction for monitoring and retrieving the results of a 9226// long-running operation. 9227type VirtualMachineScaleSetsReimageFuture struct { 9228 azure.FutureAPI 9229 // Result returns the result of the asynchronous operation. 9230 // If the operation has not completed it will return an error. 9231 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 9232} 9233 9234// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9235func (future *VirtualMachineScaleSetsReimageFuture) UnmarshalJSON(body []byte) error { 9236 var azFuture azure.Future 9237 if err := json.Unmarshal(body, &azFuture); err != nil { 9238 return err 9239 } 9240 future.FutureAPI = &azFuture 9241 future.Result = future.result 9242 return nil 9243} 9244 9245// result is the default implementation for VirtualMachineScaleSetsReimageFuture.Result. 9246func (future *VirtualMachineScaleSetsReimageFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 9247 var done bool 9248 done, err = future.DoneWithContext(context.Background(), client) 9249 if err != nil { 9250 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsReimageFuture", "Result", future.Response(), "Polling failure") 9251 return 9252 } 9253 if !done { 9254 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsReimageFuture") 9255 return 9256 } 9257 ar.Response = future.Response() 9258 return 9259} 9260 9261// VirtualMachineScaleSetsRestartFuture an abstraction for monitoring and retrieving the results of a 9262// long-running operation. 9263type VirtualMachineScaleSetsRestartFuture struct { 9264 azure.FutureAPI 9265 // Result returns the result of the asynchronous operation. 9266 // If the operation has not completed it will return an error. 9267 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 9268} 9269 9270// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9271func (future *VirtualMachineScaleSetsRestartFuture) UnmarshalJSON(body []byte) error { 9272 var azFuture azure.Future 9273 if err := json.Unmarshal(body, &azFuture); err != nil { 9274 return err 9275 } 9276 future.FutureAPI = &azFuture 9277 future.Result = future.result 9278 return nil 9279} 9280 9281// result is the default implementation for VirtualMachineScaleSetsRestartFuture.Result. 9282func (future *VirtualMachineScaleSetsRestartFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 9283 var done bool 9284 done, err = future.DoneWithContext(context.Background(), client) 9285 if err != nil { 9286 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsRestartFuture", "Result", future.Response(), "Polling failure") 9287 return 9288 } 9289 if !done { 9290 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsRestartFuture") 9291 return 9292 } 9293 ar.Response = future.Response() 9294 return 9295} 9296 9297// VirtualMachineScaleSetsSetOrchestrationServiceStateFuture an abstraction for monitoring and retrieving 9298// the results of a long-running operation. 9299type VirtualMachineScaleSetsSetOrchestrationServiceStateFuture struct { 9300 azure.FutureAPI 9301 // Result returns the result of the asynchronous operation. 9302 // If the operation has not completed it will return an error. 9303 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 9304} 9305 9306// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9307func (future *VirtualMachineScaleSetsSetOrchestrationServiceStateFuture) UnmarshalJSON(body []byte) error { 9308 var azFuture azure.Future 9309 if err := json.Unmarshal(body, &azFuture); err != nil { 9310 return err 9311 } 9312 future.FutureAPI = &azFuture 9313 future.Result = future.result 9314 return nil 9315} 9316 9317// result is the default implementation for VirtualMachineScaleSetsSetOrchestrationServiceStateFuture.Result. 9318func (future *VirtualMachineScaleSetsSetOrchestrationServiceStateFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 9319 var done bool 9320 done, err = future.DoneWithContext(context.Background(), client) 9321 if err != nil { 9322 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsSetOrchestrationServiceStateFuture", "Result", future.Response(), "Polling failure") 9323 return 9324 } 9325 if !done { 9326 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsSetOrchestrationServiceStateFuture") 9327 return 9328 } 9329 ar.Response = future.Response() 9330 return 9331} 9332 9333// VirtualMachineScaleSetsStartFuture an abstraction for monitoring and retrieving the results of a 9334// long-running operation. 9335type VirtualMachineScaleSetsStartFuture struct { 9336 azure.FutureAPI 9337 // Result returns the result of the asynchronous operation. 9338 // If the operation has not completed it will return an error. 9339 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 9340} 9341 9342// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9343func (future *VirtualMachineScaleSetsStartFuture) UnmarshalJSON(body []byte) error { 9344 var azFuture azure.Future 9345 if err := json.Unmarshal(body, &azFuture); err != nil { 9346 return err 9347 } 9348 future.FutureAPI = &azFuture 9349 future.Result = future.result 9350 return nil 9351} 9352 9353// result is the default implementation for VirtualMachineScaleSetsStartFuture.Result. 9354func (future *VirtualMachineScaleSetsStartFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 9355 var done bool 9356 done, err = future.DoneWithContext(context.Background(), client) 9357 if err != nil { 9358 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsStartFuture", "Result", future.Response(), "Polling failure") 9359 return 9360 } 9361 if !done { 9362 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsStartFuture") 9363 return 9364 } 9365 ar.Response = future.Response() 9366 return 9367} 9368 9369// VirtualMachineScaleSetStorageProfile describes a virtual machine scale set storage profile. 9370type VirtualMachineScaleSetStorageProfile struct { 9371 // 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. 9372 ImageReference *ImageReference `json:"imageReference,omitempty"` 9373 // OsDisk - Specifies information about the operating system disk used by the virtual machines in the scale set. <br><br> For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). 9374 OsDisk *VirtualMachineScaleSetOSDisk `json:"osDisk,omitempty"` 9375 // DataDisks - Specifies the parameters that are used to add data disks to the virtual machines in the scale set. <br><br> For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). 9376 DataDisks *[]VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"` 9377} 9378 9379// VirtualMachineScaleSetsUpdateFuture an abstraction for monitoring and retrieving the results of a 9380// long-running operation. 9381type VirtualMachineScaleSetsUpdateFuture struct { 9382 azure.FutureAPI 9383 // Result returns the result of the asynchronous operation. 9384 // If the operation has not completed it will return an error. 9385 Result func(VirtualMachineScaleSetsClient) (VirtualMachineScaleSet, error) 9386} 9387 9388// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9389func (future *VirtualMachineScaleSetsUpdateFuture) UnmarshalJSON(body []byte) error { 9390 var azFuture azure.Future 9391 if err := json.Unmarshal(body, &azFuture); err != nil { 9392 return err 9393 } 9394 future.FutureAPI = &azFuture 9395 future.Result = future.result 9396 return nil 9397} 9398 9399// result is the default implementation for VirtualMachineScaleSetsUpdateFuture.Result. 9400func (future *VirtualMachineScaleSetsUpdateFuture) result(client VirtualMachineScaleSetsClient) (vmss VirtualMachineScaleSet, err error) { 9401 var done bool 9402 done, err = future.DoneWithContext(context.Background(), client) 9403 if err != nil { 9404 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateFuture", "Result", future.Response(), "Polling failure") 9405 return 9406 } 9407 if !done { 9408 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsUpdateFuture") 9409 return 9410 } 9411 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9412 if vmss.Response.Response, err = future.GetResult(sender); err == nil && vmss.Response.Response.StatusCode != http.StatusNoContent { 9413 vmss, err = client.UpdateResponder(vmss.Response.Response) 9414 if err != nil { 9415 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateFuture", "Result", vmss.Response.Response, "Failure responding to request") 9416 } 9417 } 9418 return 9419} 9420 9421// VirtualMachineScaleSetsUpdateInstancesFuture an abstraction for monitoring and retrieving the results of 9422// a long-running operation. 9423type VirtualMachineScaleSetsUpdateInstancesFuture struct { 9424 azure.FutureAPI 9425 // Result returns the result of the asynchronous operation. 9426 // If the operation has not completed it will return an error. 9427 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 9428} 9429 9430// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9431func (future *VirtualMachineScaleSetsUpdateInstancesFuture) UnmarshalJSON(body []byte) error { 9432 var azFuture azure.Future 9433 if err := json.Unmarshal(body, &azFuture); err != nil { 9434 return err 9435 } 9436 future.FutureAPI = &azFuture 9437 future.Result = future.result 9438 return nil 9439} 9440 9441// result is the default implementation for VirtualMachineScaleSetsUpdateInstancesFuture.Result. 9442func (future *VirtualMachineScaleSetsUpdateInstancesFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 9443 var done bool 9444 done, err = future.DoneWithContext(context.Background(), client) 9445 if err != nil { 9446 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateInstancesFuture", "Result", future.Response(), "Polling failure") 9447 return 9448 } 9449 if !done { 9450 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsUpdateInstancesFuture") 9451 return 9452 } 9453 ar.Response = future.Response() 9454 return 9455} 9456 9457// VirtualMachineScaleSetUpdate describes a Virtual Machine Scale Set. 9458type VirtualMachineScaleSetUpdate struct { 9459 // Sku - The virtual machine scale set sku. 9460 Sku *Sku `json:"sku,omitempty"` 9461 // Plan - The purchase plan when deploying a virtual machine scale set from VM Marketplace images. 9462 Plan *Plan `json:"plan,omitempty"` 9463 *VirtualMachineScaleSetUpdateProperties `json:"properties,omitempty"` 9464 // Identity - The identity of the virtual machine scale set, if configured. 9465 Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"` 9466 // Tags - Resource tags 9467 Tags map[string]*string `json:"tags"` 9468} 9469 9470// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdate. 9471func (vmssu VirtualMachineScaleSetUpdate) MarshalJSON() ([]byte, error) { 9472 objectMap := make(map[string]interface{}) 9473 if vmssu.Sku != nil { 9474 objectMap["sku"] = vmssu.Sku 9475 } 9476 if vmssu.Plan != nil { 9477 objectMap["plan"] = vmssu.Plan 9478 } 9479 if vmssu.VirtualMachineScaleSetUpdateProperties != nil { 9480 objectMap["properties"] = vmssu.VirtualMachineScaleSetUpdateProperties 9481 } 9482 if vmssu.Identity != nil { 9483 objectMap["identity"] = vmssu.Identity 9484 } 9485 if vmssu.Tags != nil { 9486 objectMap["tags"] = vmssu.Tags 9487 } 9488 return json.Marshal(objectMap) 9489} 9490 9491// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdate struct. 9492func (vmssu *VirtualMachineScaleSetUpdate) UnmarshalJSON(body []byte) error { 9493 var m map[string]*json.RawMessage 9494 err := json.Unmarshal(body, &m) 9495 if err != nil { 9496 return err 9497 } 9498 for k, v := range m { 9499 switch k { 9500 case "sku": 9501 if v != nil { 9502 var sku Sku 9503 err = json.Unmarshal(*v, &sku) 9504 if err != nil { 9505 return err 9506 } 9507 vmssu.Sku = &sku 9508 } 9509 case "plan": 9510 if v != nil { 9511 var plan Plan 9512 err = json.Unmarshal(*v, &plan) 9513 if err != nil { 9514 return err 9515 } 9516 vmssu.Plan = &plan 9517 } 9518 case "properties": 9519 if v != nil { 9520 var virtualMachineScaleSetUpdateProperties VirtualMachineScaleSetUpdateProperties 9521 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateProperties) 9522 if err != nil { 9523 return err 9524 } 9525 vmssu.VirtualMachineScaleSetUpdateProperties = &virtualMachineScaleSetUpdateProperties 9526 } 9527 case "identity": 9528 if v != nil { 9529 var identity VirtualMachineScaleSetIdentity 9530 err = json.Unmarshal(*v, &identity) 9531 if err != nil { 9532 return err 9533 } 9534 vmssu.Identity = &identity 9535 } 9536 case "tags": 9537 if v != nil { 9538 var tags map[string]*string 9539 err = json.Unmarshal(*v, &tags) 9540 if err != nil { 9541 return err 9542 } 9543 vmssu.Tags = tags 9544 } 9545 } 9546 } 9547 9548 return nil 9549} 9550 9551// VirtualMachineScaleSetUpdateIPConfiguration describes a virtual machine scale set network profile's IP 9552// configuration. NOTE: The subnet of a scale set may be modified as long as the original subnet and the 9553// new subnet are in the same virtual network 9554type VirtualMachineScaleSetUpdateIPConfiguration struct { 9555 // Name - The IP configuration name. 9556 Name *string `json:"name,omitempty"` 9557 *VirtualMachineScaleSetUpdateIPConfigurationProperties `json:"properties,omitempty"` 9558 // ID - Resource Id 9559 ID *string `json:"id,omitempty"` 9560} 9561 9562// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdateIPConfiguration. 9563func (vmssuic VirtualMachineScaleSetUpdateIPConfiguration) MarshalJSON() ([]byte, error) { 9564 objectMap := make(map[string]interface{}) 9565 if vmssuic.Name != nil { 9566 objectMap["name"] = vmssuic.Name 9567 } 9568 if vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties != nil { 9569 objectMap["properties"] = vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties 9570 } 9571 if vmssuic.ID != nil { 9572 objectMap["id"] = vmssuic.ID 9573 } 9574 return json.Marshal(objectMap) 9575} 9576 9577// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdateIPConfiguration struct. 9578func (vmssuic *VirtualMachineScaleSetUpdateIPConfiguration) UnmarshalJSON(body []byte) error { 9579 var m map[string]*json.RawMessage 9580 err := json.Unmarshal(body, &m) 9581 if err != nil { 9582 return err 9583 } 9584 for k, v := range m { 9585 switch k { 9586 case "name": 9587 if v != nil { 9588 var name string 9589 err = json.Unmarshal(*v, &name) 9590 if err != nil { 9591 return err 9592 } 9593 vmssuic.Name = &name 9594 } 9595 case "properties": 9596 if v != nil { 9597 var virtualMachineScaleSetUpdateIPConfigurationProperties VirtualMachineScaleSetUpdateIPConfigurationProperties 9598 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateIPConfigurationProperties) 9599 if err != nil { 9600 return err 9601 } 9602 vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties = &virtualMachineScaleSetUpdateIPConfigurationProperties 9603 } 9604 case "id": 9605 if v != nil { 9606 var ID string 9607 err = json.Unmarshal(*v, &ID) 9608 if err != nil { 9609 return err 9610 } 9611 vmssuic.ID = &ID 9612 } 9613 } 9614 } 9615 9616 return nil 9617} 9618 9619// VirtualMachineScaleSetUpdateIPConfigurationProperties describes a virtual machine scale set network 9620// profile's IP configuration properties. 9621type VirtualMachineScaleSetUpdateIPConfigurationProperties struct { 9622 // Subnet - The subnet. 9623 Subnet *APIEntityReference `json:"subnet,omitempty"` 9624 // Primary - Specifies the primary IP Configuration in case the network interface has more than one IP Configuration. 9625 Primary *bool `json:"primary,omitempty"` 9626 // PublicIPAddressConfiguration - The publicIPAddressConfiguration. 9627 PublicIPAddressConfiguration *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` 9628 // PrivateIPAddressVersion - Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' 9629 PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` 9630 // ApplicationGatewayBackendAddressPools - The application gateway backend address pools. 9631 ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` 9632 // ApplicationSecurityGroups - Specifies an array of references to application security group. 9633 ApplicationSecurityGroups *[]SubResource `json:"applicationSecurityGroups,omitempty"` 9634 // LoadBalancerBackendAddressPools - The load balancer backend address pools. 9635 LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` 9636 // LoadBalancerInboundNatPools - The load balancer inbound nat pools. 9637 LoadBalancerInboundNatPools *[]SubResource `json:"loadBalancerInboundNatPools,omitempty"` 9638} 9639 9640// VirtualMachineScaleSetUpdateNetworkConfiguration describes a virtual machine scale set network profile's 9641// network configurations. 9642type VirtualMachineScaleSetUpdateNetworkConfiguration struct { 9643 // Name - The network configuration name. 9644 Name *string `json:"name,omitempty"` 9645 *VirtualMachineScaleSetUpdateNetworkConfigurationProperties `json:"properties,omitempty"` 9646 // ID - Resource Id 9647 ID *string `json:"id,omitempty"` 9648} 9649 9650// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdateNetworkConfiguration. 9651func (vmssunc VirtualMachineScaleSetUpdateNetworkConfiguration) MarshalJSON() ([]byte, error) { 9652 objectMap := make(map[string]interface{}) 9653 if vmssunc.Name != nil { 9654 objectMap["name"] = vmssunc.Name 9655 } 9656 if vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties != nil { 9657 objectMap["properties"] = vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties 9658 } 9659 if vmssunc.ID != nil { 9660 objectMap["id"] = vmssunc.ID 9661 } 9662 return json.Marshal(objectMap) 9663} 9664 9665// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdateNetworkConfiguration struct. 9666func (vmssunc *VirtualMachineScaleSetUpdateNetworkConfiguration) UnmarshalJSON(body []byte) error { 9667 var m map[string]*json.RawMessage 9668 err := json.Unmarshal(body, &m) 9669 if err != nil { 9670 return err 9671 } 9672 for k, v := range m { 9673 switch k { 9674 case "name": 9675 if v != nil { 9676 var name string 9677 err = json.Unmarshal(*v, &name) 9678 if err != nil { 9679 return err 9680 } 9681 vmssunc.Name = &name 9682 } 9683 case "properties": 9684 if v != nil { 9685 var virtualMachineScaleSetUpdateNetworkConfigurationProperties VirtualMachineScaleSetUpdateNetworkConfigurationProperties 9686 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateNetworkConfigurationProperties) 9687 if err != nil { 9688 return err 9689 } 9690 vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties = &virtualMachineScaleSetUpdateNetworkConfigurationProperties 9691 } 9692 case "id": 9693 if v != nil { 9694 var ID string 9695 err = json.Unmarshal(*v, &ID) 9696 if err != nil { 9697 return err 9698 } 9699 vmssunc.ID = &ID 9700 } 9701 } 9702 } 9703 9704 return nil 9705} 9706 9707// VirtualMachineScaleSetUpdateNetworkConfigurationProperties describes a virtual machine scale set 9708// updatable network profile's IP configuration.Use this object for updating network profile's IP 9709// Configuration. 9710type VirtualMachineScaleSetUpdateNetworkConfigurationProperties struct { 9711 // Primary - Whether this is a primary NIC on a virtual machine. 9712 Primary *bool `json:"primary,omitempty"` 9713 // EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled. 9714 EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` 9715 // EnableFpga - Specifies whether the network interface is FPGA networking-enabled. 9716 EnableFpga *bool `json:"enableFpga,omitempty"` 9717 // NetworkSecurityGroup - The network security group. 9718 NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` 9719 // DNSSettings - The dns settings to be applied on the network interfaces. 9720 DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings `json:"dnsSettings,omitempty"` 9721 // IPConfigurations - The virtual machine scale set IP Configuration. 9722 IPConfigurations *[]VirtualMachineScaleSetUpdateIPConfiguration `json:"ipConfigurations,omitempty"` 9723 // EnableIPForwarding - Whether IP forwarding enabled on this NIC. 9724 EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` 9725} 9726 9727// VirtualMachineScaleSetUpdateNetworkProfile describes a virtual machine scale set network profile. 9728type VirtualMachineScaleSetUpdateNetworkProfile struct { 9729 // HealthProbe - A reference to a load balancer probe used to determine the health of an instance in the virtual machine scale set. The reference will be in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. 9730 HealthProbe *APIEntityReference `json:"healthProbe,omitempty"` 9731 // NetworkInterfaceConfigurations - The list of network configurations. 9732 NetworkInterfaceConfigurations *[]VirtualMachineScaleSetUpdateNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` 9733} 9734 9735// VirtualMachineScaleSetUpdateOSDisk describes virtual machine scale set operating system disk Update 9736// Object. This should be used for Updating VMSS OS Disk. 9737type VirtualMachineScaleSetUpdateOSDisk struct { 9738 // Caching - The caching type. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' 9739 Caching CachingTypes `json:"caching,omitempty"` 9740 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 9741 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 9742 // DiskSizeGB - Specifies the size of the operating system disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image. <br><br> This value cannot be larger than 1023 GB 9743 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 9744 // 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. 9745 Image *VirtualHardDisk `json:"image,omitempty"` 9746 // VhdContainers - The list of virtual hard disk container uris. 9747 VhdContainers *[]string `json:"vhdContainers,omitempty"` 9748 // ManagedDisk - The managed disk parameters. 9749 ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` 9750} 9751 9752// VirtualMachineScaleSetUpdateOSProfile describes a virtual machine scale set OS profile. 9753type VirtualMachineScaleSetUpdateOSProfile struct { 9754 // CustomData - A base-64 encoded string of custom data. 9755 CustomData *string `json:"customData,omitempty"` 9756 // WindowsConfiguration - The Windows Configuration of the OS profile. 9757 WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` 9758 // LinuxConfiguration - The Linux Configuration of the OS profile. 9759 LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` 9760 // Secrets - The List of certificates for addition to the VM. 9761 Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` 9762} 9763 9764// VirtualMachineScaleSetUpdateProperties describes the properties of a Virtual Machine Scale Set. 9765type VirtualMachineScaleSetUpdateProperties struct { 9766 // UpgradePolicy - The upgrade policy. 9767 UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` 9768 // AutomaticRepairsPolicy - Policy for automatic repairs. 9769 AutomaticRepairsPolicy *AutomaticRepairsPolicy `json:"automaticRepairsPolicy,omitempty"` 9770 // VirtualMachineProfile - The virtual machine profile. 9771 VirtualMachineProfile *VirtualMachineScaleSetUpdateVMProfile `json:"virtualMachineProfile,omitempty"` 9772 // Overprovision - Specifies whether the Virtual Machine Scale Set should be overprovisioned. 9773 Overprovision *bool `json:"overprovision,omitempty"` 9774 // DoNotRunExtensionsOnOverprovisionedVMs - When Overprovision is enabled, extensions are launched only on the requested number of VMs which are finally kept. This property will hence ensure that the extensions do not run on the extra overprovisioned VMs. 9775 DoNotRunExtensionsOnOverprovisionedVMs *bool `json:"doNotRunExtensionsOnOverprovisionedVMs,omitempty"` 9776 // SinglePlacementGroup - When true this limits the scale set to a single placement group, of max size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be modified to false. However, if singlePlacementGroup is false, it may not be modified to true. 9777 SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"` 9778 // AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the Virtual Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have the capability to support attaching managed data disks with UltraSSD_LRS storage account type. 9779 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 9780 // ScaleInPolicy - Specifies the scale-in policy that decides which virtual machines are chosen for removal when a Virtual Machine Scale Set is scaled-in. 9781 ScaleInPolicy *ScaleInPolicy `json:"scaleInPolicy,omitempty"` 9782 // ProximityPlacementGroup - Specifies information about the proximity placement group that the virtual machine scale set should be assigned to. <br><br>Minimum api-version: 2018-04-01. 9783 ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` 9784} 9785 9786// VirtualMachineScaleSetUpdatePublicIPAddressConfiguration describes a virtual machines scale set IP 9787// Configuration's PublicIPAddress configuration 9788type VirtualMachineScaleSetUpdatePublicIPAddressConfiguration struct { 9789 // Name - The publicIP address configuration name. 9790 Name *string `json:"name,omitempty"` 9791 *VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties `json:"properties,omitempty"` 9792} 9793 9794// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdatePublicIPAddressConfiguration. 9795func (vmssupiac VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { 9796 objectMap := make(map[string]interface{}) 9797 if vmssupiac.Name != nil { 9798 objectMap["name"] = vmssupiac.Name 9799 } 9800 if vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties != nil { 9801 objectMap["properties"] = vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties 9802 } 9803 return json.Marshal(objectMap) 9804} 9805 9806// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdatePublicIPAddressConfiguration struct. 9807func (vmssupiac *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) UnmarshalJSON(body []byte) error { 9808 var m map[string]*json.RawMessage 9809 err := json.Unmarshal(body, &m) 9810 if err != nil { 9811 return err 9812 } 9813 for k, v := range m { 9814 switch k { 9815 case "name": 9816 if v != nil { 9817 var name string 9818 err = json.Unmarshal(*v, &name) 9819 if err != nil { 9820 return err 9821 } 9822 vmssupiac.Name = &name 9823 } 9824 case "properties": 9825 if v != nil { 9826 var virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties 9827 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties) 9828 if err != nil { 9829 return err 9830 } 9831 vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties = &virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties 9832 } 9833 } 9834 } 9835 9836 return nil 9837} 9838 9839// VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties describes a virtual machines scale 9840// set IP Configuration's PublicIPAddress configuration 9841type VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties struct { 9842 // IdleTimeoutInMinutes - The idle timeout of the public IP address. 9843 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` 9844 // DNSSettings - The dns settings to be applied on the publicIP addresses . 9845 DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings `json:"dnsSettings,omitempty"` 9846} 9847 9848// VirtualMachineScaleSetUpdateStorageProfile describes a virtual machine scale set storage profile. 9849type VirtualMachineScaleSetUpdateStorageProfile struct { 9850 // ImageReference - The image reference. 9851 ImageReference *ImageReference `json:"imageReference,omitempty"` 9852 // OsDisk - The OS disk. 9853 OsDisk *VirtualMachineScaleSetUpdateOSDisk `json:"osDisk,omitempty"` 9854 // DataDisks - The data disks. 9855 DataDisks *[]VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"` 9856} 9857 9858// VirtualMachineScaleSetUpdateVMProfile describes a virtual machine scale set virtual machine profile. 9859type VirtualMachineScaleSetUpdateVMProfile struct { 9860 // OsProfile - The virtual machine scale set OS profile. 9861 OsProfile *VirtualMachineScaleSetUpdateOSProfile `json:"osProfile,omitempty"` 9862 // StorageProfile - The virtual machine scale set storage profile. 9863 StorageProfile *VirtualMachineScaleSetUpdateStorageProfile `json:"storageProfile,omitempty"` 9864 // NetworkProfile - The virtual machine scale set network profile. 9865 NetworkProfile *VirtualMachineScaleSetUpdateNetworkProfile `json:"networkProfile,omitempty"` 9866 // SecurityProfile - The virtual machine scale set Security profile 9867 SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` 9868 // DiagnosticsProfile - The virtual machine scale set diagnostics profile. 9869 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 9870 // ExtensionProfile - The virtual machine scale set extension profile. 9871 ExtensionProfile *VirtualMachineScaleSetExtensionProfile `json:"extensionProfile,omitempty"` 9872 // LicenseType - The license type, which is for bring your own license scenario. 9873 LicenseType *string `json:"licenseType,omitempty"` 9874 // BillingProfile - Specifies the billing related details of a Azure Spot VMSS. <br><br>Minimum api-version: 2019-03-01. 9875 BillingProfile *BillingProfile `json:"billingProfile,omitempty"` 9876 // ScheduledEventsProfile - Specifies Scheduled Event related configurations. 9877 ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` 9878} 9879 9880// VirtualMachineScaleSetVM describes a virtual machine scale set virtual machine. 9881type VirtualMachineScaleSetVM struct { 9882 autorest.Response `json:"-"` 9883 // InstanceID - READ-ONLY; The virtual machine instance ID. 9884 InstanceID *string `json:"instanceId,omitempty"` 9885 // Sku - READ-ONLY; The virtual machine SKU. 9886 Sku *Sku `json:"sku,omitempty"` 9887 *VirtualMachineScaleSetVMProperties `json:"properties,omitempty"` 9888 // 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**. 9889 Plan *Plan `json:"plan,omitempty"` 9890 // Resources - READ-ONLY; The virtual machine child extension resources. 9891 Resources *[]VirtualMachineExtension `json:"resources,omitempty"` 9892 // Zones - READ-ONLY; The virtual machine zones. 9893 Zones *[]string `json:"zones,omitempty"` 9894 // ID - READ-ONLY; Resource Id 9895 ID *string `json:"id,omitempty"` 9896 // Name - READ-ONLY; Resource name 9897 Name *string `json:"name,omitempty"` 9898 // Type - READ-ONLY; Resource type 9899 Type *string `json:"type,omitempty"` 9900 // Location - Resource location 9901 Location *string `json:"location,omitempty"` 9902 // Tags - Resource tags 9903 Tags map[string]*string `json:"tags"` 9904} 9905 9906// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVM. 9907func (vmssv VirtualMachineScaleSetVM) MarshalJSON() ([]byte, error) { 9908 objectMap := make(map[string]interface{}) 9909 if vmssv.VirtualMachineScaleSetVMProperties != nil { 9910 objectMap["properties"] = vmssv.VirtualMachineScaleSetVMProperties 9911 } 9912 if vmssv.Plan != nil { 9913 objectMap["plan"] = vmssv.Plan 9914 } 9915 if vmssv.Location != nil { 9916 objectMap["location"] = vmssv.Location 9917 } 9918 if vmssv.Tags != nil { 9919 objectMap["tags"] = vmssv.Tags 9920 } 9921 return json.Marshal(objectMap) 9922} 9923 9924// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetVM struct. 9925func (vmssv *VirtualMachineScaleSetVM) UnmarshalJSON(body []byte) error { 9926 var m map[string]*json.RawMessage 9927 err := json.Unmarshal(body, &m) 9928 if err != nil { 9929 return err 9930 } 9931 for k, v := range m { 9932 switch k { 9933 case "instanceId": 9934 if v != nil { 9935 var instanceID string 9936 err = json.Unmarshal(*v, &instanceID) 9937 if err != nil { 9938 return err 9939 } 9940 vmssv.InstanceID = &instanceID 9941 } 9942 case "sku": 9943 if v != nil { 9944 var sku Sku 9945 err = json.Unmarshal(*v, &sku) 9946 if err != nil { 9947 return err 9948 } 9949 vmssv.Sku = &sku 9950 } 9951 case "properties": 9952 if v != nil { 9953 var virtualMachineScaleSetVMProperties VirtualMachineScaleSetVMProperties 9954 err = json.Unmarshal(*v, &virtualMachineScaleSetVMProperties) 9955 if err != nil { 9956 return err 9957 } 9958 vmssv.VirtualMachineScaleSetVMProperties = &virtualMachineScaleSetVMProperties 9959 } 9960 case "plan": 9961 if v != nil { 9962 var plan Plan 9963 err = json.Unmarshal(*v, &plan) 9964 if err != nil { 9965 return err 9966 } 9967 vmssv.Plan = &plan 9968 } 9969 case "resources": 9970 if v != nil { 9971 var resources []VirtualMachineExtension 9972 err = json.Unmarshal(*v, &resources) 9973 if err != nil { 9974 return err 9975 } 9976 vmssv.Resources = &resources 9977 } 9978 case "zones": 9979 if v != nil { 9980 var zones []string 9981 err = json.Unmarshal(*v, &zones) 9982 if err != nil { 9983 return err 9984 } 9985 vmssv.Zones = &zones 9986 } 9987 case "id": 9988 if v != nil { 9989 var ID string 9990 err = json.Unmarshal(*v, &ID) 9991 if err != nil { 9992 return err 9993 } 9994 vmssv.ID = &ID 9995 } 9996 case "name": 9997 if v != nil { 9998 var name string 9999 err = json.Unmarshal(*v, &name) 10000 if err != nil { 10001 return err 10002 } 10003 vmssv.Name = &name 10004 } 10005 case "type": 10006 if v != nil { 10007 var typeVar string 10008 err = json.Unmarshal(*v, &typeVar) 10009 if err != nil { 10010 return err 10011 } 10012 vmssv.Type = &typeVar 10013 } 10014 case "location": 10015 if v != nil { 10016 var location string 10017 err = json.Unmarshal(*v, &location) 10018 if err != nil { 10019 return err 10020 } 10021 vmssv.Location = &location 10022 } 10023 case "tags": 10024 if v != nil { 10025 var tags map[string]*string 10026 err = json.Unmarshal(*v, &tags) 10027 if err != nil { 10028 return err 10029 } 10030 vmssv.Tags = tags 10031 } 10032 } 10033 } 10034 10035 return nil 10036} 10037 10038// VirtualMachineScaleSetVMExtension describes a VMSS VM Extension. 10039type VirtualMachineScaleSetVMExtension struct { 10040 autorest.Response `json:"-"` 10041 // Name - READ-ONLY; The name of the extension. 10042 Name *string `json:"name,omitempty"` 10043 // Type - READ-ONLY; Resource type 10044 Type *string `json:"type,omitempty"` 10045 *VirtualMachineExtensionProperties `json:"properties,omitempty"` 10046 // ID - READ-ONLY; Resource Id 10047 ID *string `json:"id,omitempty"` 10048} 10049 10050// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMExtension. 10051func (vmssve VirtualMachineScaleSetVMExtension) MarshalJSON() ([]byte, error) { 10052 objectMap := make(map[string]interface{}) 10053 if vmssve.VirtualMachineExtensionProperties != nil { 10054 objectMap["properties"] = vmssve.VirtualMachineExtensionProperties 10055 } 10056 return json.Marshal(objectMap) 10057} 10058 10059// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetVMExtension struct. 10060func (vmssve *VirtualMachineScaleSetVMExtension) UnmarshalJSON(body []byte) error { 10061 var m map[string]*json.RawMessage 10062 err := json.Unmarshal(body, &m) 10063 if err != nil { 10064 return err 10065 } 10066 for k, v := range m { 10067 switch k { 10068 case "name": 10069 if v != nil { 10070 var name string 10071 err = json.Unmarshal(*v, &name) 10072 if err != nil { 10073 return err 10074 } 10075 vmssve.Name = &name 10076 } 10077 case "type": 10078 if v != nil { 10079 var typeVar string 10080 err = json.Unmarshal(*v, &typeVar) 10081 if err != nil { 10082 return err 10083 } 10084 vmssve.Type = &typeVar 10085 } 10086 case "properties": 10087 if v != nil { 10088 var virtualMachineExtensionProperties VirtualMachineExtensionProperties 10089 err = json.Unmarshal(*v, &virtualMachineExtensionProperties) 10090 if err != nil { 10091 return err 10092 } 10093 vmssve.VirtualMachineExtensionProperties = &virtualMachineExtensionProperties 10094 } 10095 case "id": 10096 if v != nil { 10097 var ID string 10098 err = json.Unmarshal(*v, &ID) 10099 if err != nil { 10100 return err 10101 } 10102 vmssve.ID = &ID 10103 } 10104 } 10105 } 10106 10107 return nil 10108} 10109 10110// VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the 10111// results of a long-running operation. 10112type VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture struct { 10113 azure.FutureAPI 10114 // Result returns the result of the asynchronous operation. 10115 // If the operation has not completed it will return an error. 10116 Result func(VirtualMachineScaleSetVMExtensionsClient) (VirtualMachineScaleSetVMExtension, error) 10117} 10118 10119// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10120func (future *VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 10121 var azFuture azure.Future 10122 if err := json.Unmarshal(body, &azFuture); err != nil { 10123 return err 10124 } 10125 future.FutureAPI = &azFuture 10126 future.Result = future.result 10127 return nil 10128} 10129 10130// result is the default implementation for VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture.Result. 10131func (future *VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture) result(client VirtualMachineScaleSetVMExtensionsClient) (vmssve VirtualMachineScaleSetVMExtension, err error) { 10132 var done bool 10133 done, err = future.DoneWithContext(context.Background(), client) 10134 if err != nil { 10135 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 10136 return 10137 } 10138 if !done { 10139 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture") 10140 return 10141 } 10142 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10143 if vmssve.Response.Response, err = future.GetResult(sender); err == nil && vmssve.Response.Response.StatusCode != http.StatusNoContent { 10144 vmssve, err = client.CreateOrUpdateResponder(vmssve.Response.Response) 10145 if err != nil { 10146 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture", "Result", vmssve.Response.Response, "Failure responding to request") 10147 } 10148 } 10149 return 10150} 10151 10152// VirtualMachineScaleSetVMExtensionsDeleteFuture an abstraction for monitoring and retrieving the results 10153// of a long-running operation. 10154type VirtualMachineScaleSetVMExtensionsDeleteFuture struct { 10155 azure.FutureAPI 10156 // Result returns the result of the asynchronous operation. 10157 // If the operation has not completed it will return an error. 10158 Result func(VirtualMachineScaleSetVMExtensionsClient) (autorest.Response, error) 10159} 10160 10161// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10162func (future *VirtualMachineScaleSetVMExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { 10163 var azFuture azure.Future 10164 if err := json.Unmarshal(body, &azFuture); err != nil { 10165 return err 10166 } 10167 future.FutureAPI = &azFuture 10168 future.Result = future.result 10169 return nil 10170} 10171 10172// result is the default implementation for VirtualMachineScaleSetVMExtensionsDeleteFuture.Result. 10173func (future *VirtualMachineScaleSetVMExtensionsDeleteFuture) result(client VirtualMachineScaleSetVMExtensionsClient) (ar autorest.Response, err error) { 10174 var done bool 10175 done, err = future.DoneWithContext(context.Background(), client) 10176 if err != nil { 10177 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") 10178 return 10179 } 10180 if !done { 10181 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsDeleteFuture") 10182 return 10183 } 10184 ar.Response = future.Response() 10185 return 10186} 10187 10188// VirtualMachineScaleSetVMExtensionsListResult the List VMSS VM Extension operation response 10189type VirtualMachineScaleSetVMExtensionsListResult struct { 10190 autorest.Response `json:"-"` 10191 // Value - The list of VMSS VM extensions 10192 Value *[]VirtualMachineScaleSetVMExtension `json:"value,omitempty"` 10193} 10194 10195// VirtualMachineScaleSetVMExtensionsSummary extensions summary for virtual machines of a virtual machine 10196// scale set. 10197type VirtualMachineScaleSetVMExtensionsSummary struct { 10198 // Name - READ-ONLY; The extension name. 10199 Name *string `json:"name,omitempty"` 10200 // StatusesSummary - READ-ONLY; The extensions information. 10201 StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` 10202} 10203 10204// VirtualMachineScaleSetVMExtensionsUpdateFuture an abstraction for monitoring and retrieving the results 10205// of a long-running operation. 10206type VirtualMachineScaleSetVMExtensionsUpdateFuture struct { 10207 azure.FutureAPI 10208 // Result returns the result of the asynchronous operation. 10209 // If the operation has not completed it will return an error. 10210 Result func(VirtualMachineScaleSetVMExtensionsClient) (VirtualMachineScaleSetVMExtension, error) 10211} 10212 10213// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10214func (future *VirtualMachineScaleSetVMExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { 10215 var azFuture azure.Future 10216 if err := json.Unmarshal(body, &azFuture); err != nil { 10217 return err 10218 } 10219 future.FutureAPI = &azFuture 10220 future.Result = future.result 10221 return nil 10222} 10223 10224// result is the default implementation for VirtualMachineScaleSetVMExtensionsUpdateFuture.Result. 10225func (future *VirtualMachineScaleSetVMExtensionsUpdateFuture) result(client VirtualMachineScaleSetVMExtensionsClient) (vmssve VirtualMachineScaleSetVMExtension, err error) { 10226 var done bool 10227 done, err = future.DoneWithContext(context.Background(), client) 10228 if err != nil { 10229 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsUpdateFuture", "Result", future.Response(), "Polling failure") 10230 return 10231 } 10232 if !done { 10233 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsUpdateFuture") 10234 return 10235 } 10236 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10237 if vmssve.Response.Response, err = future.GetResult(sender); err == nil && vmssve.Response.Response.StatusCode != http.StatusNoContent { 10238 vmssve, err = client.UpdateResponder(vmssve.Response.Response) 10239 if err != nil { 10240 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsUpdateFuture", "Result", vmssve.Response.Response, "Failure responding to request") 10241 } 10242 } 10243 return 10244} 10245 10246// VirtualMachineScaleSetVMExtensionUpdate describes a VMSS VM Extension. 10247type VirtualMachineScaleSetVMExtensionUpdate struct { 10248 // Name - READ-ONLY; The name of the extension. 10249 Name *string `json:"name,omitempty"` 10250 // Type - READ-ONLY; Resource type 10251 Type *string `json:"type,omitempty"` 10252 *VirtualMachineExtensionUpdateProperties `json:"properties,omitempty"` 10253 // ID - READ-ONLY; Resource Id 10254 ID *string `json:"id,omitempty"` 10255} 10256 10257// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMExtensionUpdate. 10258func (vmssveu VirtualMachineScaleSetVMExtensionUpdate) MarshalJSON() ([]byte, error) { 10259 objectMap := make(map[string]interface{}) 10260 if vmssveu.VirtualMachineExtensionUpdateProperties != nil { 10261 objectMap["properties"] = vmssveu.VirtualMachineExtensionUpdateProperties 10262 } 10263 return json.Marshal(objectMap) 10264} 10265 10266// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetVMExtensionUpdate struct. 10267func (vmssveu *VirtualMachineScaleSetVMExtensionUpdate) UnmarshalJSON(body []byte) error { 10268 var m map[string]*json.RawMessage 10269 err := json.Unmarshal(body, &m) 10270 if err != nil { 10271 return err 10272 } 10273 for k, v := range m { 10274 switch k { 10275 case "name": 10276 if v != nil { 10277 var name string 10278 err = json.Unmarshal(*v, &name) 10279 if err != nil { 10280 return err 10281 } 10282 vmssveu.Name = &name 10283 } 10284 case "type": 10285 if v != nil { 10286 var typeVar string 10287 err = json.Unmarshal(*v, &typeVar) 10288 if err != nil { 10289 return err 10290 } 10291 vmssveu.Type = &typeVar 10292 } 10293 case "properties": 10294 if v != nil { 10295 var virtualMachineExtensionUpdateProperties VirtualMachineExtensionUpdateProperties 10296 err = json.Unmarshal(*v, &virtualMachineExtensionUpdateProperties) 10297 if err != nil { 10298 return err 10299 } 10300 vmssveu.VirtualMachineExtensionUpdateProperties = &virtualMachineExtensionUpdateProperties 10301 } 10302 case "id": 10303 if v != nil { 10304 var ID string 10305 err = json.Unmarshal(*v, &ID) 10306 if err != nil { 10307 return err 10308 } 10309 vmssveu.ID = &ID 10310 } 10311 } 10312 } 10313 10314 return nil 10315} 10316 10317// VirtualMachineScaleSetVMInstanceIDs specifies a list of virtual machine instance IDs from the VM scale 10318// set. 10319type VirtualMachineScaleSetVMInstanceIDs struct { 10320 // 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. 10321 InstanceIds *[]string `json:"instanceIds,omitempty"` 10322} 10323 10324// VirtualMachineScaleSetVMInstanceRequiredIDs specifies a list of virtual machine instance IDs from the VM 10325// scale set. 10326type VirtualMachineScaleSetVMInstanceRequiredIDs struct { 10327 // InstanceIds - The virtual machine scale set instance ids. 10328 InstanceIds *[]string `json:"instanceIds,omitempty"` 10329} 10330 10331// VirtualMachineScaleSetVMInstanceView the instance view of a virtual machine scale set VM. 10332type VirtualMachineScaleSetVMInstanceView struct { 10333 autorest.Response `json:"-"` 10334 // PlatformUpdateDomain - The Update Domain count. 10335 PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` 10336 // PlatformFaultDomain - The Fault Domain count. 10337 PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` 10338 // RdpThumbPrint - The Remote desktop certificate thumbprint. 10339 RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"` 10340 // VMAgent - The VM Agent running on the virtual machine. 10341 VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"` 10342 // MaintenanceRedeployStatus - The Maintenance Operation status on the virtual machine. 10343 MaintenanceRedeployStatus *MaintenanceRedeployStatus `json:"maintenanceRedeployStatus,omitempty"` 10344 // Disks - The disks information. 10345 Disks *[]DiskInstanceView `json:"disks,omitempty"` 10346 // Extensions - The extensions information. 10347 Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` 10348 // VMHealth - READ-ONLY; The health status for the VM. 10349 VMHealth *VirtualMachineHealthStatus `json:"vmHealth,omitempty"` 10350 // 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. 10351 BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` 10352 // Statuses - The resource status information. 10353 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 10354 // AssignedHost - READ-ONLY; Resource id of the dedicated host, on which the virtual machine is allocated through automatic placement, when the virtual machine is associated with a dedicated host group that has automatic placement enabled. <br><br>Minimum api-version: 2020-06-01. 10355 AssignedHost *string `json:"assignedHost,omitempty"` 10356 // PlacementGroupID - The placement group in which the VM is running. If the VM is deallocated it will not have a placementGroupId. 10357 PlacementGroupID *string `json:"placementGroupId,omitempty"` 10358} 10359 10360// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMInstanceView. 10361func (vmssviv VirtualMachineScaleSetVMInstanceView) MarshalJSON() ([]byte, error) { 10362 objectMap := make(map[string]interface{}) 10363 if vmssviv.PlatformUpdateDomain != nil { 10364 objectMap["platformUpdateDomain"] = vmssviv.PlatformUpdateDomain 10365 } 10366 if vmssviv.PlatformFaultDomain != nil { 10367 objectMap["platformFaultDomain"] = vmssviv.PlatformFaultDomain 10368 } 10369 if vmssviv.RdpThumbPrint != nil { 10370 objectMap["rdpThumbPrint"] = vmssviv.RdpThumbPrint 10371 } 10372 if vmssviv.VMAgent != nil { 10373 objectMap["vmAgent"] = vmssviv.VMAgent 10374 } 10375 if vmssviv.MaintenanceRedeployStatus != nil { 10376 objectMap["maintenanceRedeployStatus"] = vmssviv.MaintenanceRedeployStatus 10377 } 10378 if vmssviv.Disks != nil { 10379 objectMap["disks"] = vmssviv.Disks 10380 } 10381 if vmssviv.Extensions != nil { 10382 objectMap["extensions"] = vmssviv.Extensions 10383 } 10384 if vmssviv.BootDiagnostics != nil { 10385 objectMap["bootDiagnostics"] = vmssviv.BootDiagnostics 10386 } 10387 if vmssviv.Statuses != nil { 10388 objectMap["statuses"] = vmssviv.Statuses 10389 } 10390 if vmssviv.PlacementGroupID != nil { 10391 objectMap["placementGroupId"] = vmssviv.PlacementGroupID 10392 } 10393 return json.Marshal(objectMap) 10394} 10395 10396// VirtualMachineScaleSetVMListResult the List Virtual Machine Scale Set VMs operation response. 10397type VirtualMachineScaleSetVMListResult struct { 10398 autorest.Response `json:"-"` 10399 // Value - The list of virtual machine scale sets VMs. 10400 Value *[]VirtualMachineScaleSetVM `json:"value,omitempty"` 10401 // 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 10402 NextLink *string `json:"nextLink,omitempty"` 10403} 10404 10405// VirtualMachineScaleSetVMListResultIterator provides access to a complete listing of 10406// VirtualMachineScaleSetVM values. 10407type VirtualMachineScaleSetVMListResultIterator struct { 10408 i int 10409 page VirtualMachineScaleSetVMListResultPage 10410} 10411 10412// NextWithContext advances to the next value. If there was an error making 10413// the request the iterator does not advance and the error is returned. 10414func (iter *VirtualMachineScaleSetVMListResultIterator) NextWithContext(ctx context.Context) (err error) { 10415 if tracing.IsEnabled() { 10416 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMListResultIterator.NextWithContext") 10417 defer func() { 10418 sc := -1 10419 if iter.Response().Response.Response != nil { 10420 sc = iter.Response().Response.Response.StatusCode 10421 } 10422 tracing.EndSpan(ctx, sc, err) 10423 }() 10424 } 10425 iter.i++ 10426 if iter.i < len(iter.page.Values()) { 10427 return nil 10428 } 10429 err = iter.page.NextWithContext(ctx) 10430 if err != nil { 10431 iter.i-- 10432 return err 10433 } 10434 iter.i = 0 10435 return nil 10436} 10437 10438// Next advances to the next value. If there was an error making 10439// the request the iterator does not advance and the error is returned. 10440// Deprecated: Use NextWithContext() instead. 10441func (iter *VirtualMachineScaleSetVMListResultIterator) Next() error { 10442 return iter.NextWithContext(context.Background()) 10443} 10444 10445// NotDone returns true if the enumeration should be started or is not yet complete. 10446func (iter VirtualMachineScaleSetVMListResultIterator) NotDone() bool { 10447 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10448} 10449 10450// Response returns the raw server response from the last page request. 10451func (iter VirtualMachineScaleSetVMListResultIterator) Response() VirtualMachineScaleSetVMListResult { 10452 return iter.page.Response() 10453} 10454 10455// Value returns the current value or a zero-initialized value if the 10456// iterator has advanced beyond the end of the collection. 10457func (iter VirtualMachineScaleSetVMListResultIterator) Value() VirtualMachineScaleSetVM { 10458 if !iter.page.NotDone() { 10459 return VirtualMachineScaleSetVM{} 10460 } 10461 return iter.page.Values()[iter.i] 10462} 10463 10464// Creates a new instance of the VirtualMachineScaleSetVMListResultIterator type. 10465func NewVirtualMachineScaleSetVMListResultIterator(page VirtualMachineScaleSetVMListResultPage) VirtualMachineScaleSetVMListResultIterator { 10466 return VirtualMachineScaleSetVMListResultIterator{page: page} 10467} 10468 10469// IsEmpty returns true if the ListResult contains no values. 10470func (vmssvlr VirtualMachineScaleSetVMListResult) IsEmpty() bool { 10471 return vmssvlr.Value == nil || len(*vmssvlr.Value) == 0 10472} 10473 10474// hasNextLink returns true if the NextLink is not empty. 10475func (vmssvlr VirtualMachineScaleSetVMListResult) hasNextLink() bool { 10476 return vmssvlr.NextLink != nil && len(*vmssvlr.NextLink) != 0 10477} 10478 10479// virtualMachineScaleSetVMListResultPreparer prepares a request to retrieve the next set of results. 10480// It returns nil if no more results exist. 10481func (vmssvlr VirtualMachineScaleSetVMListResult) virtualMachineScaleSetVMListResultPreparer(ctx context.Context) (*http.Request, error) { 10482 if !vmssvlr.hasNextLink() { 10483 return nil, nil 10484 } 10485 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10486 autorest.AsJSON(), 10487 autorest.AsGet(), 10488 autorest.WithBaseURL(to.String(vmssvlr.NextLink))) 10489} 10490 10491// VirtualMachineScaleSetVMListResultPage contains a page of VirtualMachineScaleSetVM values. 10492type VirtualMachineScaleSetVMListResultPage struct { 10493 fn func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error) 10494 vmssvlr VirtualMachineScaleSetVMListResult 10495} 10496 10497// NextWithContext advances to the next page of values. If there was an error making 10498// the request the page does not advance and the error is returned. 10499func (page *VirtualMachineScaleSetVMListResultPage) NextWithContext(ctx context.Context) (err error) { 10500 if tracing.IsEnabled() { 10501 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMListResultPage.NextWithContext") 10502 defer func() { 10503 sc := -1 10504 if page.Response().Response.Response != nil { 10505 sc = page.Response().Response.Response.StatusCode 10506 } 10507 tracing.EndSpan(ctx, sc, err) 10508 }() 10509 } 10510 for { 10511 next, err := page.fn(ctx, page.vmssvlr) 10512 if err != nil { 10513 return err 10514 } 10515 page.vmssvlr = next 10516 if !next.hasNextLink() || !next.IsEmpty() { 10517 break 10518 } 10519 } 10520 return nil 10521} 10522 10523// Next advances to the next page of values. If there was an error making 10524// the request the page does not advance and the error is returned. 10525// Deprecated: Use NextWithContext() instead. 10526func (page *VirtualMachineScaleSetVMListResultPage) Next() error { 10527 return page.NextWithContext(context.Background()) 10528} 10529 10530// NotDone returns true if the page enumeration should be started or is not yet complete. 10531func (page VirtualMachineScaleSetVMListResultPage) NotDone() bool { 10532 return !page.vmssvlr.IsEmpty() 10533} 10534 10535// Response returns the raw server response from the last page request. 10536func (page VirtualMachineScaleSetVMListResultPage) Response() VirtualMachineScaleSetVMListResult { 10537 return page.vmssvlr 10538} 10539 10540// Values returns the slice of values for the current page or nil if there are no values. 10541func (page VirtualMachineScaleSetVMListResultPage) Values() []VirtualMachineScaleSetVM { 10542 if page.vmssvlr.IsEmpty() { 10543 return nil 10544 } 10545 return *page.vmssvlr.Value 10546} 10547 10548// Creates a new instance of the VirtualMachineScaleSetVMListResultPage type. 10549func NewVirtualMachineScaleSetVMListResultPage(cur VirtualMachineScaleSetVMListResult, getNextPage func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error)) VirtualMachineScaleSetVMListResultPage { 10550 return VirtualMachineScaleSetVMListResultPage{ 10551 fn: getNextPage, 10552 vmssvlr: cur, 10553 } 10554} 10555 10556// VirtualMachineScaleSetVMNetworkProfileConfiguration describes a virtual machine scale set VM network 10557// profile. 10558type VirtualMachineScaleSetVMNetworkProfileConfiguration struct { 10559 // NetworkInterfaceConfigurations - The list of network configurations. 10560 NetworkInterfaceConfigurations *[]VirtualMachineScaleSetNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` 10561} 10562 10563// VirtualMachineScaleSetVMProfile describes a virtual machine scale set virtual machine profile. 10564type VirtualMachineScaleSetVMProfile struct { 10565 // OsProfile - Specifies the operating system settings for the virtual machines in the scale set. 10566 OsProfile *VirtualMachineScaleSetOSProfile `json:"osProfile,omitempty"` 10567 // StorageProfile - Specifies the storage settings for the virtual machine disks. 10568 StorageProfile *VirtualMachineScaleSetStorageProfile `json:"storageProfile,omitempty"` 10569 // NetworkProfile - Specifies properties of the network interfaces of the virtual machines in the scale set. 10570 NetworkProfile *VirtualMachineScaleSetNetworkProfile `json:"networkProfile,omitempty"` 10571 // SecurityProfile - Specifies the Security related profile settings for the virtual machines in the scale set. 10572 SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` 10573 // DiagnosticsProfile - Specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. 10574 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 10575 // ExtensionProfile - Specifies a collection of settings for extensions installed on virtual machines in the scale set. 10576 ExtensionProfile *VirtualMachineScaleSetExtensionProfile `json:"extensionProfile,omitempty"` 10577 // LicenseType - Specifies that the image or disk that is being used was licensed on-premises. <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) <br><br> [Azure Hybrid Use Benefit for Linux Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> Minimum api-version: 2015-06-15 10578 LicenseType *string `json:"licenseType,omitempty"` 10579 // Priority - Specifies the priority for the virtual machines in the scale set. <br><br>Minimum api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low', 'Spot' 10580 Priority VirtualMachinePriorityTypes `json:"priority,omitempty"` 10581 // EvictionPolicy - Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set. <br><br>For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01. <br><br>For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. Possible values include: 'Deallocate', 'Delete' 10582 EvictionPolicy VirtualMachineEvictionPolicyTypes `json:"evictionPolicy,omitempty"` 10583 // BillingProfile - Specifies the billing related details of a Azure Spot VMSS. <br><br>Minimum api-version: 2019-03-01. 10584 BillingProfile *BillingProfile `json:"billingProfile,omitempty"` 10585 // ScheduledEventsProfile - Specifies Scheduled Event related configurations. 10586 ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` 10587} 10588 10589// VirtualMachineScaleSetVMProperties describes the properties of a virtual machine scale set virtual 10590// machine. 10591type VirtualMachineScaleSetVMProperties struct { 10592 // LatestModelApplied - READ-ONLY; Specifies whether the latest model has been applied to the virtual machine. 10593 LatestModelApplied *bool `json:"latestModelApplied,omitempty"` 10594 // VMID - READ-ONLY; Azure VM unique ID. 10595 VMID *string `json:"vmId,omitempty"` 10596 // InstanceView - READ-ONLY; The virtual machine instance view. 10597 InstanceView *VirtualMachineScaleSetVMInstanceView `json:"instanceView,omitempty"` 10598 // HardwareProfile - Specifies the hardware settings for the virtual machine. 10599 HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` 10600 // StorageProfile - Specifies the storage settings for the virtual machine disks. 10601 StorageProfile *StorageProfile `json:"storageProfile,omitempty"` 10602 // AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the virtual machine in the scale set. For instance: whether the virtual machine has the capability to support attaching managed data disks with UltraSSD_LRS storage account type. 10603 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 10604 // OsProfile - Specifies the operating system settings for the virtual machine. 10605 OsProfile *OSProfile `json:"osProfile,omitempty"` 10606 // SecurityProfile - Specifies the Security related profile settings for the virtual machine. 10607 SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` 10608 // NetworkProfile - Specifies the network interfaces of the virtual machine. 10609 NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` 10610 // NetworkProfileConfiguration - Specifies the network profile configuration of the virtual machine. 10611 NetworkProfileConfiguration *VirtualMachineScaleSetVMNetworkProfileConfiguration `json:"networkProfileConfiguration,omitempty"` 10612 // DiagnosticsProfile - Specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. 10613 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 10614 // 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. 10615 AvailabilitySet *SubResource `json:"availabilitySet,omitempty"` 10616 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 10617 ProvisioningState *string `json:"provisioningState,omitempty"` 10618 // LicenseType - Specifies that the image or disk that is being used was licensed on-premises. <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) <br><br> [Azure Hybrid Use Benefit for Linux Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> Minimum api-version: 2015-06-15 10619 LicenseType *string `json:"licenseType,omitempty"` 10620 // ModelDefinitionApplied - READ-ONLY; Specifies whether the model applied to the virtual machine is the model of the virtual machine scale set or the customized model for the virtual machine. 10621 ModelDefinitionApplied *string `json:"modelDefinitionApplied,omitempty"` 10622 // ProtectionPolicy - Specifies the protection policy of the virtual machine. 10623 ProtectionPolicy *VirtualMachineScaleSetVMProtectionPolicy `json:"protectionPolicy,omitempty"` 10624} 10625 10626// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMProperties. 10627func (vmssvp VirtualMachineScaleSetVMProperties) MarshalJSON() ([]byte, error) { 10628 objectMap := make(map[string]interface{}) 10629 if vmssvp.HardwareProfile != nil { 10630 objectMap["hardwareProfile"] = vmssvp.HardwareProfile 10631 } 10632 if vmssvp.StorageProfile != nil { 10633 objectMap["storageProfile"] = vmssvp.StorageProfile 10634 } 10635 if vmssvp.AdditionalCapabilities != nil { 10636 objectMap["additionalCapabilities"] = vmssvp.AdditionalCapabilities 10637 } 10638 if vmssvp.OsProfile != nil { 10639 objectMap["osProfile"] = vmssvp.OsProfile 10640 } 10641 if vmssvp.SecurityProfile != nil { 10642 objectMap["securityProfile"] = vmssvp.SecurityProfile 10643 } 10644 if vmssvp.NetworkProfile != nil { 10645 objectMap["networkProfile"] = vmssvp.NetworkProfile 10646 } 10647 if vmssvp.NetworkProfileConfiguration != nil { 10648 objectMap["networkProfileConfiguration"] = vmssvp.NetworkProfileConfiguration 10649 } 10650 if vmssvp.DiagnosticsProfile != nil { 10651 objectMap["diagnosticsProfile"] = vmssvp.DiagnosticsProfile 10652 } 10653 if vmssvp.AvailabilitySet != nil { 10654 objectMap["availabilitySet"] = vmssvp.AvailabilitySet 10655 } 10656 if vmssvp.LicenseType != nil { 10657 objectMap["licenseType"] = vmssvp.LicenseType 10658 } 10659 if vmssvp.ProtectionPolicy != nil { 10660 objectMap["protectionPolicy"] = vmssvp.ProtectionPolicy 10661 } 10662 return json.Marshal(objectMap) 10663} 10664 10665// VirtualMachineScaleSetVMProtectionPolicy the protection policy of a virtual machine scale set VM. 10666type VirtualMachineScaleSetVMProtectionPolicy struct { 10667 // ProtectFromScaleIn - Indicates that the virtual machine scale set VM shouldn't be considered for deletion during a scale-in operation. 10668 ProtectFromScaleIn *bool `json:"protectFromScaleIn,omitempty"` 10669 // ProtectFromScaleSetActions - Indicates that model updates or actions (including scale-in) initiated on the virtual machine scale set should not be applied to the virtual machine scale set VM. 10670 ProtectFromScaleSetActions *bool `json:"protectFromScaleSetActions,omitempty"` 10671} 10672 10673// VirtualMachineScaleSetVMReimageParameters describes a Virtual Machine Scale Set VM Reimage Parameters. 10674type VirtualMachineScaleSetVMReimageParameters struct { 10675 // TempDisk - Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage parameter is only supported for VM/VMSS with Ephemeral OS disk. 10676 TempDisk *bool `json:"tempDisk,omitempty"` 10677} 10678 10679// VirtualMachineScaleSetVMsDeallocateFuture an abstraction for monitoring and retrieving the results of a 10680// long-running operation. 10681type VirtualMachineScaleSetVMsDeallocateFuture struct { 10682 azure.FutureAPI 10683 // Result returns the result of the asynchronous operation. 10684 // If the operation has not completed it will return an error. 10685 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 10686} 10687 10688// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10689func (future *VirtualMachineScaleSetVMsDeallocateFuture) UnmarshalJSON(body []byte) error { 10690 var azFuture azure.Future 10691 if err := json.Unmarshal(body, &azFuture); err != nil { 10692 return err 10693 } 10694 future.FutureAPI = &azFuture 10695 future.Result = future.result 10696 return nil 10697} 10698 10699// result is the default implementation for VirtualMachineScaleSetVMsDeallocateFuture.Result. 10700func (future *VirtualMachineScaleSetVMsDeallocateFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 10701 var done bool 10702 done, err = future.DoneWithContext(context.Background(), client) 10703 if err != nil { 10704 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsDeallocateFuture", "Result", future.Response(), "Polling failure") 10705 return 10706 } 10707 if !done { 10708 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsDeallocateFuture") 10709 return 10710 } 10711 ar.Response = future.Response() 10712 return 10713} 10714 10715// VirtualMachineScaleSetVMsDeleteFuture an abstraction for monitoring and retrieving the results of a 10716// long-running operation. 10717type VirtualMachineScaleSetVMsDeleteFuture struct { 10718 azure.FutureAPI 10719 // Result returns the result of the asynchronous operation. 10720 // If the operation has not completed it will return an error. 10721 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 10722} 10723 10724// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10725func (future *VirtualMachineScaleSetVMsDeleteFuture) UnmarshalJSON(body []byte) error { 10726 var azFuture azure.Future 10727 if err := json.Unmarshal(body, &azFuture); err != nil { 10728 return err 10729 } 10730 future.FutureAPI = &azFuture 10731 future.Result = future.result 10732 return nil 10733} 10734 10735// result is the default implementation for VirtualMachineScaleSetVMsDeleteFuture.Result. 10736func (future *VirtualMachineScaleSetVMsDeleteFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 10737 var done bool 10738 done, err = future.DoneWithContext(context.Background(), client) 10739 if err != nil { 10740 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsDeleteFuture", "Result", future.Response(), "Polling failure") 10741 return 10742 } 10743 if !done { 10744 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsDeleteFuture") 10745 return 10746 } 10747 ar.Response = future.Response() 10748 return 10749} 10750 10751// VirtualMachineScaleSetVMsPerformMaintenanceFuture an abstraction for monitoring and retrieving the 10752// results of a long-running operation. 10753type VirtualMachineScaleSetVMsPerformMaintenanceFuture struct { 10754 azure.FutureAPI 10755 // Result returns the result of the asynchronous operation. 10756 // If the operation has not completed it will return an error. 10757 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 10758} 10759 10760// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10761func (future *VirtualMachineScaleSetVMsPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { 10762 var azFuture azure.Future 10763 if err := json.Unmarshal(body, &azFuture); err != nil { 10764 return err 10765 } 10766 future.FutureAPI = &azFuture 10767 future.Result = future.result 10768 return nil 10769} 10770 10771// result is the default implementation for VirtualMachineScaleSetVMsPerformMaintenanceFuture.Result. 10772func (future *VirtualMachineScaleSetVMsPerformMaintenanceFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 10773 var done bool 10774 done, err = future.DoneWithContext(context.Background(), client) 10775 if err != nil { 10776 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsPerformMaintenanceFuture", "Result", future.Response(), "Polling failure") 10777 return 10778 } 10779 if !done { 10780 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsPerformMaintenanceFuture") 10781 return 10782 } 10783 ar.Response = future.Response() 10784 return 10785} 10786 10787// VirtualMachineScaleSetVMsPowerOffFuture an abstraction for monitoring and retrieving the results of a 10788// long-running operation. 10789type VirtualMachineScaleSetVMsPowerOffFuture struct { 10790 azure.FutureAPI 10791 // Result returns the result of the asynchronous operation. 10792 // If the operation has not completed it will return an error. 10793 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 10794} 10795 10796// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10797func (future *VirtualMachineScaleSetVMsPowerOffFuture) UnmarshalJSON(body []byte) error { 10798 var azFuture azure.Future 10799 if err := json.Unmarshal(body, &azFuture); err != nil { 10800 return err 10801 } 10802 future.FutureAPI = &azFuture 10803 future.Result = future.result 10804 return nil 10805} 10806 10807// result is the default implementation for VirtualMachineScaleSetVMsPowerOffFuture.Result. 10808func (future *VirtualMachineScaleSetVMsPowerOffFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 10809 var done bool 10810 done, err = future.DoneWithContext(context.Background(), client) 10811 if err != nil { 10812 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsPowerOffFuture", "Result", future.Response(), "Polling failure") 10813 return 10814 } 10815 if !done { 10816 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsPowerOffFuture") 10817 return 10818 } 10819 ar.Response = future.Response() 10820 return 10821} 10822 10823// VirtualMachineScaleSetVMsRedeployFuture an abstraction for monitoring and retrieving the results of a 10824// long-running operation. 10825type VirtualMachineScaleSetVMsRedeployFuture struct { 10826 azure.FutureAPI 10827 // Result returns the result of the asynchronous operation. 10828 // If the operation has not completed it will return an error. 10829 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 10830} 10831 10832// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10833func (future *VirtualMachineScaleSetVMsRedeployFuture) UnmarshalJSON(body []byte) error { 10834 var azFuture azure.Future 10835 if err := json.Unmarshal(body, &azFuture); err != nil { 10836 return err 10837 } 10838 future.FutureAPI = &azFuture 10839 future.Result = future.result 10840 return nil 10841} 10842 10843// result is the default implementation for VirtualMachineScaleSetVMsRedeployFuture.Result. 10844func (future *VirtualMachineScaleSetVMsRedeployFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 10845 var done bool 10846 done, err = future.DoneWithContext(context.Background(), client) 10847 if err != nil { 10848 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRedeployFuture", "Result", future.Response(), "Polling failure") 10849 return 10850 } 10851 if !done { 10852 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRedeployFuture") 10853 return 10854 } 10855 ar.Response = future.Response() 10856 return 10857} 10858 10859// VirtualMachineScaleSetVMsReimageAllFuture an abstraction for monitoring and retrieving the results of a 10860// long-running operation. 10861type VirtualMachineScaleSetVMsReimageAllFuture struct { 10862 azure.FutureAPI 10863 // Result returns the result of the asynchronous operation. 10864 // If the operation has not completed it will return an error. 10865 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 10866} 10867 10868// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10869func (future *VirtualMachineScaleSetVMsReimageAllFuture) UnmarshalJSON(body []byte) error { 10870 var azFuture azure.Future 10871 if err := json.Unmarshal(body, &azFuture); err != nil { 10872 return err 10873 } 10874 future.FutureAPI = &azFuture 10875 future.Result = future.result 10876 return nil 10877} 10878 10879// result is the default implementation for VirtualMachineScaleSetVMsReimageAllFuture.Result. 10880func (future *VirtualMachineScaleSetVMsReimageAllFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 10881 var done bool 10882 done, err = future.DoneWithContext(context.Background(), client) 10883 if err != nil { 10884 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsReimageAllFuture", "Result", future.Response(), "Polling failure") 10885 return 10886 } 10887 if !done { 10888 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsReimageAllFuture") 10889 return 10890 } 10891 ar.Response = future.Response() 10892 return 10893} 10894 10895// VirtualMachineScaleSetVMsReimageFuture an abstraction for monitoring and retrieving the results of a 10896// long-running operation. 10897type VirtualMachineScaleSetVMsReimageFuture struct { 10898 azure.FutureAPI 10899 // Result returns the result of the asynchronous operation. 10900 // If the operation has not completed it will return an error. 10901 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 10902} 10903 10904// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10905func (future *VirtualMachineScaleSetVMsReimageFuture) UnmarshalJSON(body []byte) error { 10906 var azFuture azure.Future 10907 if err := json.Unmarshal(body, &azFuture); err != nil { 10908 return err 10909 } 10910 future.FutureAPI = &azFuture 10911 future.Result = future.result 10912 return nil 10913} 10914 10915// result is the default implementation for VirtualMachineScaleSetVMsReimageFuture.Result. 10916func (future *VirtualMachineScaleSetVMsReimageFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 10917 var done bool 10918 done, err = future.DoneWithContext(context.Background(), client) 10919 if err != nil { 10920 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsReimageFuture", "Result", future.Response(), "Polling failure") 10921 return 10922 } 10923 if !done { 10924 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsReimageFuture") 10925 return 10926 } 10927 ar.Response = future.Response() 10928 return 10929} 10930 10931// VirtualMachineScaleSetVMsRestartFuture an abstraction for monitoring and retrieving the results of a 10932// long-running operation. 10933type VirtualMachineScaleSetVMsRestartFuture struct { 10934 azure.FutureAPI 10935 // Result returns the result of the asynchronous operation. 10936 // If the operation has not completed it will return an error. 10937 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 10938} 10939 10940// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10941func (future *VirtualMachineScaleSetVMsRestartFuture) UnmarshalJSON(body []byte) error { 10942 var azFuture azure.Future 10943 if err := json.Unmarshal(body, &azFuture); err != nil { 10944 return err 10945 } 10946 future.FutureAPI = &azFuture 10947 future.Result = future.result 10948 return nil 10949} 10950 10951// result is the default implementation for VirtualMachineScaleSetVMsRestartFuture.Result. 10952func (future *VirtualMachineScaleSetVMsRestartFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 10953 var done bool 10954 done, err = future.DoneWithContext(context.Background(), client) 10955 if err != nil { 10956 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRestartFuture", "Result", future.Response(), "Polling failure") 10957 return 10958 } 10959 if !done { 10960 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRestartFuture") 10961 return 10962 } 10963 ar.Response = future.Response() 10964 return 10965} 10966 10967// VirtualMachineScaleSetVMsStartFuture an abstraction for monitoring and retrieving the results of a 10968// long-running operation. 10969type VirtualMachineScaleSetVMsStartFuture struct { 10970 azure.FutureAPI 10971 // Result returns the result of the asynchronous operation. 10972 // If the operation has not completed it will return an error. 10973 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 10974} 10975 10976// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10977func (future *VirtualMachineScaleSetVMsStartFuture) UnmarshalJSON(body []byte) error { 10978 var azFuture azure.Future 10979 if err := json.Unmarshal(body, &azFuture); err != nil { 10980 return err 10981 } 10982 future.FutureAPI = &azFuture 10983 future.Result = future.result 10984 return nil 10985} 10986 10987// result is the default implementation for VirtualMachineScaleSetVMsStartFuture.Result. 10988func (future *VirtualMachineScaleSetVMsStartFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 10989 var done bool 10990 done, err = future.DoneWithContext(context.Background(), client) 10991 if err != nil { 10992 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsStartFuture", "Result", future.Response(), "Polling failure") 10993 return 10994 } 10995 if !done { 10996 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsStartFuture") 10997 return 10998 } 10999 ar.Response = future.Response() 11000 return 11001} 11002 11003// VirtualMachineScaleSetVMsUpdateFuture an abstraction for monitoring and retrieving the results of a 11004// long-running operation. 11005type VirtualMachineScaleSetVMsUpdateFuture struct { 11006 azure.FutureAPI 11007 // Result returns the result of the asynchronous operation. 11008 // If the operation has not completed it will return an error. 11009 Result func(VirtualMachineScaleSetVMsClient) (VirtualMachineScaleSetVM, error) 11010} 11011 11012// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11013func (future *VirtualMachineScaleSetVMsUpdateFuture) UnmarshalJSON(body []byte) error { 11014 var azFuture azure.Future 11015 if err := json.Unmarshal(body, &azFuture); err != nil { 11016 return err 11017 } 11018 future.FutureAPI = &azFuture 11019 future.Result = future.result 11020 return nil 11021} 11022 11023// result is the default implementation for VirtualMachineScaleSetVMsUpdateFuture.Result. 11024func (future *VirtualMachineScaleSetVMsUpdateFuture) result(client VirtualMachineScaleSetVMsClient) (vmssv VirtualMachineScaleSetVM, err error) { 11025 var done bool 11026 done, err = future.DoneWithContext(context.Background(), client) 11027 if err != nil { 11028 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsUpdateFuture", "Result", future.Response(), "Polling failure") 11029 return 11030 } 11031 if !done { 11032 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsUpdateFuture") 11033 return 11034 } 11035 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11036 if vmssv.Response.Response, err = future.GetResult(sender); err == nil && vmssv.Response.Response.StatusCode != http.StatusNoContent { 11037 vmssv, err = client.UpdateResponder(vmssv.Response.Response) 11038 if err != nil { 11039 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsUpdateFuture", "Result", vmssv.Response.Response, "Failure responding to request") 11040 } 11041 } 11042 return 11043} 11044 11045// VirtualMachinesCaptureFuture an abstraction for monitoring and retrieving the results of a long-running 11046// operation. 11047type VirtualMachinesCaptureFuture struct { 11048 azure.FutureAPI 11049 // Result returns the result of the asynchronous operation. 11050 // If the operation has not completed it will return an error. 11051 Result func(VirtualMachinesClient) (VirtualMachineCaptureResult, error) 11052} 11053 11054// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11055func (future *VirtualMachinesCaptureFuture) UnmarshalJSON(body []byte) error { 11056 var azFuture azure.Future 11057 if err := json.Unmarshal(body, &azFuture); err != nil { 11058 return err 11059 } 11060 future.FutureAPI = &azFuture 11061 future.Result = future.result 11062 return nil 11063} 11064 11065// result is the default implementation for VirtualMachinesCaptureFuture.Result. 11066func (future *VirtualMachinesCaptureFuture) result(client VirtualMachinesClient) (vmcr VirtualMachineCaptureResult, err error) { 11067 var done bool 11068 done, err = future.DoneWithContext(context.Background(), client) 11069 if err != nil { 11070 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCaptureFuture", "Result", future.Response(), "Polling failure") 11071 return 11072 } 11073 if !done { 11074 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesCaptureFuture") 11075 return 11076 } 11077 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11078 if vmcr.Response.Response, err = future.GetResult(sender); err == nil && vmcr.Response.Response.StatusCode != http.StatusNoContent { 11079 vmcr, err = client.CaptureResponder(vmcr.Response.Response) 11080 if err != nil { 11081 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCaptureFuture", "Result", vmcr.Response.Response, "Failure responding to request") 11082 } 11083 } 11084 return 11085} 11086 11087// VirtualMachinesConvertToManagedDisksFuture an abstraction for monitoring and retrieving the results of a 11088// long-running operation. 11089type VirtualMachinesConvertToManagedDisksFuture struct { 11090 azure.FutureAPI 11091 // Result returns the result of the asynchronous operation. 11092 // If the operation has not completed it will return an error. 11093 Result func(VirtualMachinesClient) (autorest.Response, error) 11094} 11095 11096// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11097func (future *VirtualMachinesConvertToManagedDisksFuture) UnmarshalJSON(body []byte) error { 11098 var azFuture azure.Future 11099 if err := json.Unmarshal(body, &azFuture); err != nil { 11100 return err 11101 } 11102 future.FutureAPI = &azFuture 11103 future.Result = future.result 11104 return nil 11105} 11106 11107// result is the default implementation for VirtualMachinesConvertToManagedDisksFuture.Result. 11108func (future *VirtualMachinesConvertToManagedDisksFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 11109 var done bool 11110 done, err = future.DoneWithContext(context.Background(), client) 11111 if err != nil { 11112 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesConvertToManagedDisksFuture", "Result", future.Response(), "Polling failure") 11113 return 11114 } 11115 if !done { 11116 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesConvertToManagedDisksFuture") 11117 return 11118 } 11119 ar.Response = future.Response() 11120 return 11121} 11122 11123// VirtualMachinesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 11124// long-running operation. 11125type VirtualMachinesCreateOrUpdateFuture struct { 11126 azure.FutureAPI 11127 // Result returns the result of the asynchronous operation. 11128 // If the operation has not completed it will return an error. 11129 Result func(VirtualMachinesClient) (VirtualMachine, error) 11130} 11131 11132// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11133func (future *VirtualMachinesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 11134 var azFuture azure.Future 11135 if err := json.Unmarshal(body, &azFuture); err != nil { 11136 return err 11137 } 11138 future.FutureAPI = &azFuture 11139 future.Result = future.result 11140 return nil 11141} 11142 11143// result is the default implementation for VirtualMachinesCreateOrUpdateFuture.Result. 11144func (future *VirtualMachinesCreateOrUpdateFuture) result(client VirtualMachinesClient) (VM VirtualMachine, err error) { 11145 var done bool 11146 done, err = future.DoneWithContext(context.Background(), client) 11147 if err != nil { 11148 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 11149 return 11150 } 11151 if !done { 11152 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesCreateOrUpdateFuture") 11153 return 11154 } 11155 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11156 if VM.Response.Response, err = future.GetResult(sender); err == nil && VM.Response.Response.StatusCode != http.StatusNoContent { 11157 VM, err = client.CreateOrUpdateResponder(VM.Response.Response) 11158 if err != nil { 11159 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCreateOrUpdateFuture", "Result", VM.Response.Response, "Failure responding to request") 11160 } 11161 } 11162 return 11163} 11164 11165// VirtualMachinesDeallocateFuture an abstraction for monitoring and retrieving the results of a 11166// long-running operation. 11167type VirtualMachinesDeallocateFuture struct { 11168 azure.FutureAPI 11169 // Result returns the result of the asynchronous operation. 11170 // If the operation has not completed it will return an error. 11171 Result func(VirtualMachinesClient) (autorest.Response, error) 11172} 11173 11174// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11175func (future *VirtualMachinesDeallocateFuture) UnmarshalJSON(body []byte) error { 11176 var azFuture azure.Future 11177 if err := json.Unmarshal(body, &azFuture); err != nil { 11178 return err 11179 } 11180 future.FutureAPI = &azFuture 11181 future.Result = future.result 11182 return nil 11183} 11184 11185// result is the default implementation for VirtualMachinesDeallocateFuture.Result. 11186func (future *VirtualMachinesDeallocateFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 11187 var done bool 11188 done, err = future.DoneWithContext(context.Background(), client) 11189 if err != nil { 11190 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesDeallocateFuture", "Result", future.Response(), "Polling failure") 11191 return 11192 } 11193 if !done { 11194 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesDeallocateFuture") 11195 return 11196 } 11197 ar.Response = future.Response() 11198 return 11199} 11200 11201// VirtualMachinesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 11202// operation. 11203type VirtualMachinesDeleteFuture struct { 11204 azure.FutureAPI 11205 // Result returns the result of the asynchronous operation. 11206 // If the operation has not completed it will return an error. 11207 Result func(VirtualMachinesClient) (autorest.Response, error) 11208} 11209 11210// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11211func (future *VirtualMachinesDeleteFuture) UnmarshalJSON(body []byte) error { 11212 var azFuture azure.Future 11213 if err := json.Unmarshal(body, &azFuture); err != nil { 11214 return err 11215 } 11216 future.FutureAPI = &azFuture 11217 future.Result = future.result 11218 return nil 11219} 11220 11221// result is the default implementation for VirtualMachinesDeleteFuture.Result. 11222func (future *VirtualMachinesDeleteFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 11223 var done bool 11224 done, err = future.DoneWithContext(context.Background(), client) 11225 if err != nil { 11226 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesDeleteFuture", "Result", future.Response(), "Polling failure") 11227 return 11228 } 11229 if !done { 11230 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesDeleteFuture") 11231 return 11232 } 11233 ar.Response = future.Response() 11234 return 11235} 11236 11237// VirtualMachineSize describes the properties of a VM size. 11238type VirtualMachineSize struct { 11239 // Name - The name of the virtual machine size. 11240 Name *string `json:"name,omitempty"` 11241 // NumberOfCores - The number of cores supported by the virtual machine size. 11242 NumberOfCores *int32 `json:"numberOfCores,omitempty"` 11243 // OsDiskSizeInMB - The OS disk size, in MB, allowed by the virtual machine size. 11244 OsDiskSizeInMB *int32 `json:"osDiskSizeInMB,omitempty"` 11245 // ResourceDiskSizeInMB - The resource disk size, in MB, allowed by the virtual machine size. 11246 ResourceDiskSizeInMB *int32 `json:"resourceDiskSizeInMB,omitempty"` 11247 // MemoryInMB - The amount of memory, in MB, supported by the virtual machine size. 11248 MemoryInMB *int32 `json:"memoryInMB,omitempty"` 11249 // MaxDataDiskCount - The maximum number of data disks that can be attached to the virtual machine size. 11250 MaxDataDiskCount *int32 `json:"maxDataDiskCount,omitempty"` 11251} 11252 11253// VirtualMachineSizeListResult the List Virtual Machine operation response. 11254type VirtualMachineSizeListResult struct { 11255 autorest.Response `json:"-"` 11256 // Value - The list of virtual machine sizes. 11257 Value *[]VirtualMachineSize `json:"value,omitempty"` 11258} 11259 11260// VirtualMachineSoftwarePatchProperties describes the properties of a Virtual Machine software patch. 11261type VirtualMachineSoftwarePatchProperties struct { 11262 // PatchID - READ-ONLY; A unique identifier for the patch. 11263 PatchID *string `json:"patchId,omitempty"` 11264 // Name - READ-ONLY; The friendly name of the patch. 11265 Name *string `json:"name,omitempty"` 11266 // Version - READ-ONLY; The version number of the patch. This property applies only to Linux patches. 11267 Version *string `json:"version,omitempty"` 11268 // Kbid - READ-ONLY; The KBID of the patch. Only applies to Windows patches. 11269 Kbid *string `json:"kbid,omitempty"` 11270 // Classifications - READ-ONLY; The classification(s) of the patch as provided by the patch publisher. 11271 Classifications *[]string `json:"classifications,omitempty"` 11272 // RebootBehavior - READ-ONLY; Describes the reboot requirements of the patch. Possible values include: 'NeverReboots', 'AlwaysRequiresReboot', 'CanRequestReboot' 11273 RebootBehavior SoftwareUpdateRebootBehavior `json:"rebootBehavior,omitempty"` 11274 // ActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. 11275 ActivityID *string `json:"activityId,omitempty"` 11276 // PublishedDate - READ-ONLY; The UTC timestamp when the repository published this patch. 11277 PublishedDate *date.Time `json:"publishedDate,omitempty"` 11278 // LastModifiedDateTime - READ-ONLY; The UTC timestamp of the last update to this patch record. 11279 LastModifiedDateTime *date.Time `json:"lastModifiedDateTime,omitempty"` 11280 // AssessmentState - READ-ONLY; Describes the outcome of an install operation for a given patch. Possible values include: 'Installed', 'Failed', 'Excluded', 'NotSelected', 'Pending', 'Available' 11281 AssessmentState PatchAssessmentState `json:"assessmentState,omitempty"` 11282} 11283 11284// VirtualMachinesPerformMaintenanceFuture an abstraction for monitoring and retrieving the results of a 11285// long-running operation. 11286type VirtualMachinesPerformMaintenanceFuture struct { 11287 azure.FutureAPI 11288 // Result returns the result of the asynchronous operation. 11289 // If the operation has not completed it will return an error. 11290 Result func(VirtualMachinesClient) (autorest.Response, error) 11291} 11292 11293// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11294func (future *VirtualMachinesPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { 11295 var azFuture azure.Future 11296 if err := json.Unmarshal(body, &azFuture); err != nil { 11297 return err 11298 } 11299 future.FutureAPI = &azFuture 11300 future.Result = future.result 11301 return nil 11302} 11303 11304// result is the default implementation for VirtualMachinesPerformMaintenanceFuture.Result. 11305func (future *VirtualMachinesPerformMaintenanceFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 11306 var done bool 11307 done, err = future.DoneWithContext(context.Background(), client) 11308 if err != nil { 11309 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesPerformMaintenanceFuture", "Result", future.Response(), "Polling failure") 11310 return 11311 } 11312 if !done { 11313 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesPerformMaintenanceFuture") 11314 return 11315 } 11316 ar.Response = future.Response() 11317 return 11318} 11319 11320// VirtualMachinesPowerOffFuture an abstraction for monitoring and retrieving the results of a long-running 11321// operation. 11322type VirtualMachinesPowerOffFuture struct { 11323 azure.FutureAPI 11324 // Result returns the result of the asynchronous operation. 11325 // If the operation has not completed it will return an error. 11326 Result func(VirtualMachinesClient) (autorest.Response, error) 11327} 11328 11329// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11330func (future *VirtualMachinesPowerOffFuture) UnmarshalJSON(body []byte) error { 11331 var azFuture azure.Future 11332 if err := json.Unmarshal(body, &azFuture); err != nil { 11333 return err 11334 } 11335 future.FutureAPI = &azFuture 11336 future.Result = future.result 11337 return nil 11338} 11339 11340// result is the default implementation for VirtualMachinesPowerOffFuture.Result. 11341func (future *VirtualMachinesPowerOffFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 11342 var done bool 11343 done, err = future.DoneWithContext(context.Background(), client) 11344 if err != nil { 11345 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesPowerOffFuture", "Result", future.Response(), "Polling failure") 11346 return 11347 } 11348 if !done { 11349 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesPowerOffFuture") 11350 return 11351 } 11352 ar.Response = future.Response() 11353 return 11354} 11355 11356// VirtualMachinesReapplyFuture an abstraction for monitoring and retrieving the results of a long-running 11357// operation. 11358type VirtualMachinesReapplyFuture struct { 11359 azure.FutureAPI 11360 // Result returns the result of the asynchronous operation. 11361 // If the operation has not completed it will return an error. 11362 Result func(VirtualMachinesClient) (autorest.Response, error) 11363} 11364 11365// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11366func (future *VirtualMachinesReapplyFuture) UnmarshalJSON(body []byte) error { 11367 var azFuture azure.Future 11368 if err := json.Unmarshal(body, &azFuture); err != nil { 11369 return err 11370 } 11371 future.FutureAPI = &azFuture 11372 future.Result = future.result 11373 return nil 11374} 11375 11376// result is the default implementation for VirtualMachinesReapplyFuture.Result. 11377func (future *VirtualMachinesReapplyFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 11378 var done bool 11379 done, err = future.DoneWithContext(context.Background(), client) 11380 if err != nil { 11381 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesReapplyFuture", "Result", future.Response(), "Polling failure") 11382 return 11383 } 11384 if !done { 11385 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesReapplyFuture") 11386 return 11387 } 11388 ar.Response = future.Response() 11389 return 11390} 11391 11392// VirtualMachinesRedeployFuture an abstraction for monitoring and retrieving the results of a long-running 11393// operation. 11394type VirtualMachinesRedeployFuture struct { 11395 azure.FutureAPI 11396 // Result returns the result of the asynchronous operation. 11397 // If the operation has not completed it will return an error. 11398 Result func(VirtualMachinesClient) (autorest.Response, error) 11399} 11400 11401// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11402func (future *VirtualMachinesRedeployFuture) UnmarshalJSON(body []byte) error { 11403 var azFuture azure.Future 11404 if err := json.Unmarshal(body, &azFuture); err != nil { 11405 return err 11406 } 11407 future.FutureAPI = &azFuture 11408 future.Result = future.result 11409 return nil 11410} 11411 11412// result is the default implementation for VirtualMachinesRedeployFuture.Result. 11413func (future *VirtualMachinesRedeployFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 11414 var done bool 11415 done, err = future.DoneWithContext(context.Background(), client) 11416 if err != nil { 11417 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRedeployFuture", "Result", future.Response(), "Polling failure") 11418 return 11419 } 11420 if !done { 11421 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRedeployFuture") 11422 return 11423 } 11424 ar.Response = future.Response() 11425 return 11426} 11427 11428// VirtualMachinesReimageFuture an abstraction for monitoring and retrieving the results of a long-running 11429// operation. 11430type VirtualMachinesReimageFuture struct { 11431 azure.FutureAPI 11432 // Result returns the result of the asynchronous operation. 11433 // If the operation has not completed it will return an error. 11434 Result func(VirtualMachinesClient) (autorest.Response, error) 11435} 11436 11437// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11438func (future *VirtualMachinesReimageFuture) UnmarshalJSON(body []byte) error { 11439 var azFuture azure.Future 11440 if err := json.Unmarshal(body, &azFuture); err != nil { 11441 return err 11442 } 11443 future.FutureAPI = &azFuture 11444 future.Result = future.result 11445 return nil 11446} 11447 11448// result is the default implementation for VirtualMachinesReimageFuture.Result. 11449func (future *VirtualMachinesReimageFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 11450 var done bool 11451 done, err = future.DoneWithContext(context.Background(), client) 11452 if err != nil { 11453 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesReimageFuture", "Result", future.Response(), "Polling failure") 11454 return 11455 } 11456 if !done { 11457 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesReimageFuture") 11458 return 11459 } 11460 ar.Response = future.Response() 11461 return 11462} 11463 11464// VirtualMachinesRestartFuture an abstraction for monitoring and retrieving the results of a long-running 11465// operation. 11466type VirtualMachinesRestartFuture struct { 11467 azure.FutureAPI 11468 // Result returns the result of the asynchronous operation. 11469 // If the operation has not completed it will return an error. 11470 Result func(VirtualMachinesClient) (autorest.Response, error) 11471} 11472 11473// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11474func (future *VirtualMachinesRestartFuture) UnmarshalJSON(body []byte) error { 11475 var azFuture azure.Future 11476 if err := json.Unmarshal(body, &azFuture); err != nil { 11477 return err 11478 } 11479 future.FutureAPI = &azFuture 11480 future.Result = future.result 11481 return nil 11482} 11483 11484// result is the default implementation for VirtualMachinesRestartFuture.Result. 11485func (future *VirtualMachinesRestartFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 11486 var done bool 11487 done, err = future.DoneWithContext(context.Background(), client) 11488 if err != nil { 11489 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRestartFuture", "Result", future.Response(), "Polling failure") 11490 return 11491 } 11492 if !done { 11493 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRestartFuture") 11494 return 11495 } 11496 ar.Response = future.Response() 11497 return 11498} 11499 11500// VirtualMachinesStartFuture an abstraction for monitoring and retrieving the results of a long-running 11501// operation. 11502type VirtualMachinesStartFuture struct { 11503 azure.FutureAPI 11504 // Result returns the result of the asynchronous operation. 11505 // If the operation has not completed it will return an error. 11506 Result func(VirtualMachinesClient) (autorest.Response, error) 11507} 11508 11509// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11510func (future *VirtualMachinesStartFuture) UnmarshalJSON(body []byte) error { 11511 var azFuture azure.Future 11512 if err := json.Unmarshal(body, &azFuture); err != nil { 11513 return err 11514 } 11515 future.FutureAPI = &azFuture 11516 future.Result = future.result 11517 return nil 11518} 11519 11520// result is the default implementation for VirtualMachinesStartFuture.Result. 11521func (future *VirtualMachinesStartFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 11522 var done bool 11523 done, err = future.DoneWithContext(context.Background(), client) 11524 if err != nil { 11525 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesStartFuture", "Result", future.Response(), "Polling failure") 11526 return 11527 } 11528 if !done { 11529 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesStartFuture") 11530 return 11531 } 11532 ar.Response = future.Response() 11533 return 11534} 11535 11536// VirtualMachineStatusCodeCount the status code and count of the virtual machine scale set instance view 11537// status summary. 11538type VirtualMachineStatusCodeCount struct { 11539 // Code - READ-ONLY; The instance view status code. 11540 Code *string `json:"code,omitempty"` 11541 // Count - READ-ONLY; The number of instances having a particular status code. 11542 Count *int32 `json:"count,omitempty"` 11543} 11544 11545// VirtualMachinesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 11546// operation. 11547type VirtualMachinesUpdateFuture struct { 11548 azure.FutureAPI 11549 // Result returns the result of the asynchronous operation. 11550 // If the operation has not completed it will return an error. 11551 Result func(VirtualMachinesClient) (VirtualMachine, error) 11552} 11553 11554// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11555func (future *VirtualMachinesUpdateFuture) UnmarshalJSON(body []byte) error { 11556 var azFuture azure.Future 11557 if err := json.Unmarshal(body, &azFuture); err != nil { 11558 return err 11559 } 11560 future.FutureAPI = &azFuture 11561 future.Result = future.result 11562 return nil 11563} 11564 11565// result is the default implementation for VirtualMachinesUpdateFuture.Result. 11566func (future *VirtualMachinesUpdateFuture) result(client VirtualMachinesClient) (VM VirtualMachine, err error) { 11567 var done bool 11568 done, err = future.DoneWithContext(context.Background(), client) 11569 if err != nil { 11570 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesUpdateFuture", "Result", future.Response(), "Polling failure") 11571 return 11572 } 11573 if !done { 11574 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesUpdateFuture") 11575 return 11576 } 11577 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11578 if VM.Response.Response, err = future.GetResult(sender); err == nil && VM.Response.Response.StatusCode != http.StatusNoContent { 11579 VM, err = client.UpdateResponder(VM.Response.Response) 11580 if err != nil { 11581 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesUpdateFuture", "Result", VM.Response.Response, "Failure responding to request") 11582 } 11583 } 11584 return 11585} 11586 11587// VirtualMachineUpdate describes a Virtual Machine Update. 11588type VirtualMachineUpdate struct { 11589 // 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**. 11590 Plan *Plan `json:"plan,omitempty"` 11591 *VirtualMachineProperties `json:"properties,omitempty"` 11592 // Identity - The identity of the virtual machine, if configured. 11593 Identity *VirtualMachineIdentity `json:"identity,omitempty"` 11594 // Zones - The virtual machine zones. 11595 Zones *[]string `json:"zones,omitempty"` 11596 // Tags - Resource tags 11597 Tags map[string]*string `json:"tags"` 11598} 11599 11600// MarshalJSON is the custom marshaler for VirtualMachineUpdate. 11601func (vmu VirtualMachineUpdate) MarshalJSON() ([]byte, error) { 11602 objectMap := make(map[string]interface{}) 11603 if vmu.Plan != nil { 11604 objectMap["plan"] = vmu.Plan 11605 } 11606 if vmu.VirtualMachineProperties != nil { 11607 objectMap["properties"] = vmu.VirtualMachineProperties 11608 } 11609 if vmu.Identity != nil { 11610 objectMap["identity"] = vmu.Identity 11611 } 11612 if vmu.Zones != nil { 11613 objectMap["zones"] = vmu.Zones 11614 } 11615 if vmu.Tags != nil { 11616 objectMap["tags"] = vmu.Tags 11617 } 11618 return json.Marshal(objectMap) 11619} 11620 11621// UnmarshalJSON is the custom unmarshaler for VirtualMachineUpdate struct. 11622func (vmu *VirtualMachineUpdate) UnmarshalJSON(body []byte) error { 11623 var m map[string]*json.RawMessage 11624 err := json.Unmarshal(body, &m) 11625 if err != nil { 11626 return err 11627 } 11628 for k, v := range m { 11629 switch k { 11630 case "plan": 11631 if v != nil { 11632 var plan Plan 11633 err = json.Unmarshal(*v, &plan) 11634 if err != nil { 11635 return err 11636 } 11637 vmu.Plan = &plan 11638 } 11639 case "properties": 11640 if v != nil { 11641 var virtualMachineProperties VirtualMachineProperties 11642 err = json.Unmarshal(*v, &virtualMachineProperties) 11643 if err != nil { 11644 return err 11645 } 11646 vmu.VirtualMachineProperties = &virtualMachineProperties 11647 } 11648 case "identity": 11649 if v != nil { 11650 var identity VirtualMachineIdentity 11651 err = json.Unmarshal(*v, &identity) 11652 if err != nil { 11653 return err 11654 } 11655 vmu.Identity = &identity 11656 } 11657 case "zones": 11658 if v != nil { 11659 var zones []string 11660 err = json.Unmarshal(*v, &zones) 11661 if err != nil { 11662 return err 11663 } 11664 vmu.Zones = &zones 11665 } 11666 case "tags": 11667 if v != nil { 11668 var tags map[string]*string 11669 err = json.Unmarshal(*v, &tags) 11670 if err != nil { 11671 return err 11672 } 11673 vmu.Tags = tags 11674 } 11675 } 11676 } 11677 11678 return nil 11679} 11680 11681// VMScaleSetConvertToSinglePlacementGroupInput ... 11682type VMScaleSetConvertToSinglePlacementGroupInput struct { 11683 // ActivePlacementGroupID - Id of the placement group in which you want future virtual machine instances to be placed. To query placement group Id, please use Virtual Machine Scale Set VMs - Get API. If not provided, the platform will choose one with maximum number of virtual machine instances. 11684 ActivePlacementGroupID *string `json:"activePlacementGroupId,omitempty"` 11685} 11686 11687// WindowsConfiguration specifies Windows operating system settings on the virtual machine. 11688type WindowsConfiguration struct { 11689 // 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. 11690 ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` 11691 // EnableAutomaticUpdates - Indicates whether Automatic Updates is enabled for the Windows virtual machine. Default value is true. <br><br> For virtual machine scale sets, this property can be updated and updates will take effect on OS reprovisioning. 11692 EnableAutomaticUpdates *bool `json:"enableAutomaticUpdates,omitempty"` 11693 // TimeZone - Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time". <br><br> Possible values can be [TimeZoneInfo.Id](https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id) value from time zones returned by [TimeZoneInfo.GetSystemTimeZones](https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.getsystemtimezones). 11694 TimeZone *string `json:"timeZone,omitempty"` 11695 // AdditionalUnattendContent - Specifies additional base-64 encoded XML formatted information that can be included in the Unattend.xml file, which is used by Windows Setup. 11696 AdditionalUnattendContent *[]AdditionalUnattendContent `json:"additionalUnattendContent,omitempty"` 11697 // PatchSettings - Specifies settings related to in-guest patching (KBs). 11698 PatchSettings *PatchSettings `json:"patchSettings,omitempty"` 11699 // WinRM - Specifies the Windows Remote Management listeners. This enables remote Windows PowerShell. 11700 WinRM *WinRMConfiguration `json:"winRM,omitempty"` 11701} 11702 11703// WinRMConfiguration describes Windows Remote Management configuration of the VM 11704type WinRMConfiguration struct { 11705 // Listeners - The list of Windows Remote Management listeners 11706 Listeners *[]WinRMListener `json:"listeners,omitempty"` 11707} 11708 11709// WinRMListener describes Protocol and thumbprint of Windows Remote Management listener 11710type WinRMListener struct { 11711 // Protocol - Specifies the protocol of WinRM listener. <br><br> Possible values are: <br>**http** <br><br> **https**. Possible values include: 'HTTP', 'HTTPS' 11712 Protocol ProtocolTypes `json:"protocol,omitempty"` 11713 // 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>} 11714 CertificateURL *string `json:"certificateUrl,omitempty"` 11715} 11716