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 "io" 18 "net/http" 19) 20 21// The package's fully qualified name. 22const fqdn = "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-03-01/compute" 23 24// AccessURI a disk access SAS uri. 25type AccessURI struct { 26 autorest.Response `json:"-"` 27 // AccessSAS - READ-ONLY; A SAS uri for accessing a disk. 28 AccessSAS *string `json:"accessSAS,omitempty"` 29} 30 31// MarshalJSON is the custom marshaler for AccessURI. 32func (au AccessURI) MarshalJSON() ([]byte, error) { 33 objectMap := make(map[string]interface{}) 34 return json.Marshal(objectMap) 35} 36 37// AdditionalCapabilities enables or disables a capability on the virtual machine or virtual machine scale 38// set. 39type AdditionalCapabilities struct { 40 // 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. 41 UltraSSDEnabled *bool `json:"ultraSSDEnabled,omitempty"` 42} 43 44// AdditionalUnattendContent specifies additional XML formatted information that can be included in the 45// Unattend.xml file, which is used by Windows Setup. Contents are defined by setting name, component name, 46// and the pass in which the content is applied. 47type AdditionalUnattendContent struct { 48 // PassName - The pass name. Currently, the only allowable value is OobeSystem. Possible values include: 'PassNamesOobeSystem' 49 PassName PassNames `json:"passName,omitempty"` 50 // ComponentName - The component name. Currently, the only allowable value is Microsoft-Windows-Shell-Setup. Possible values include: 'ComponentNamesMicrosoftWindowsShellSetup' 51 ComponentName ComponentNames `json:"componentName,omitempty"` 52 // SettingName - Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon. Possible values include: 'SettingNamesAutoLogon', 'SettingNamesFirstLogonCommands' 53 SettingName SettingNames `json:"settingName,omitempty"` 54 // 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. 55 Content *string `json:"content,omitempty"` 56} 57 58// APIEntityReference the API entity reference. 59type APIEntityReference struct { 60 // ID - The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... 61 ID *string `json:"id,omitempty"` 62} 63 64// APIError api error. 65type APIError struct { 66 // Details - The Api error details 67 Details *[]APIErrorBase `json:"details,omitempty"` 68 // Innererror - The Api inner error 69 Innererror *InnerError `json:"innererror,omitempty"` 70 // Code - The error code. 71 Code *string `json:"code,omitempty"` 72 // Target - The target of the particular error. 73 Target *string `json:"target,omitempty"` 74 // Message - The error message. 75 Message *string `json:"message,omitempty"` 76} 77 78// APIErrorBase api error base. 79type APIErrorBase struct { 80 // Code - The error code. 81 Code *string `json:"code,omitempty"` 82 // Target - The target of the particular error. 83 Target *string `json:"target,omitempty"` 84 // Message - The error message. 85 Message *string `json:"message,omitempty"` 86} 87 88// AutomaticOSUpgradePolicy the configuration parameters used for performing automatic OS upgrade. 89type AutomaticOSUpgradePolicy struct { 90 // 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. 91 EnableAutomaticOSUpgrade *bool `json:"enableAutomaticOSUpgrade,omitempty"` 92 // DisableAutomaticRollback - Whether OS image rollback feature should be disabled. Default value is false. 93 DisableAutomaticRollback *bool `json:"disableAutomaticRollback,omitempty"` 94} 95 96// AutomaticOSUpgradeProperties describes automatic OS upgrade properties on the image. 97type AutomaticOSUpgradeProperties struct { 98 // AutomaticOSUpgradeSupported - Specifies whether automatic OS upgrade is supported on the image. 99 AutomaticOSUpgradeSupported *bool `json:"automaticOSUpgradeSupported,omitempty"` 100} 101 102// AutomaticRepairsPolicy specifies the configuration parameters for automatic repairs on the virtual 103// machine scale set. 104type AutomaticRepairsPolicy struct { 105 // Enabled - Specifies whether automatic repairs should be enabled on the virtual machine scale set. The default value is false. 106 Enabled *bool `json:"enabled,omitempty"` 107 // 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). 108 GracePeriod *string `json:"gracePeriod,omitempty"` 109} 110 111// AvailabilitySet specifies information about the availability set that the virtual machine should be 112// assigned to. Virtual machines specified in the same availability set are allocated to different nodes to 113// maximize availability. For more information about availability sets, see [Availability sets 114// overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). <br><br> For 115// more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in 116// Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates) <br><br> Currently, a 117// VM can only be added to availability set at creation time. An existing VM cannot be added to an 118// availability set. 119type AvailabilitySet struct { 120 autorest.Response `json:"-"` 121 *AvailabilitySetProperties `json:"properties,omitempty"` 122 // 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'. 123 Sku *Sku `json:"sku,omitempty"` 124 // ID - READ-ONLY; Resource Id 125 ID *string `json:"id,omitempty"` 126 // Name - READ-ONLY; Resource name 127 Name *string `json:"name,omitempty"` 128 // Type - READ-ONLY; Resource type 129 Type *string `json:"type,omitempty"` 130 // Location - Resource location 131 Location *string `json:"location,omitempty"` 132 // Tags - Resource tags 133 Tags map[string]*string `json:"tags"` 134} 135 136// MarshalJSON is the custom marshaler for AvailabilitySet. 137func (as AvailabilitySet) MarshalJSON() ([]byte, error) { 138 objectMap := make(map[string]interface{}) 139 if as.AvailabilitySetProperties != nil { 140 objectMap["properties"] = as.AvailabilitySetProperties 141 } 142 if as.Sku != nil { 143 objectMap["sku"] = as.Sku 144 } 145 if as.Location != nil { 146 objectMap["location"] = as.Location 147 } 148 if as.Tags != nil { 149 objectMap["tags"] = as.Tags 150 } 151 return json.Marshal(objectMap) 152} 153 154// UnmarshalJSON is the custom unmarshaler for AvailabilitySet struct. 155func (as *AvailabilitySet) UnmarshalJSON(body []byte) error { 156 var m map[string]*json.RawMessage 157 err := json.Unmarshal(body, &m) 158 if err != nil { 159 return err 160 } 161 for k, v := range m { 162 switch k { 163 case "properties": 164 if v != nil { 165 var availabilitySetProperties AvailabilitySetProperties 166 err = json.Unmarshal(*v, &availabilitySetProperties) 167 if err != nil { 168 return err 169 } 170 as.AvailabilitySetProperties = &availabilitySetProperties 171 } 172 case "sku": 173 if v != nil { 174 var sku Sku 175 err = json.Unmarshal(*v, &sku) 176 if err != nil { 177 return err 178 } 179 as.Sku = &sku 180 } 181 case "id": 182 if v != nil { 183 var ID string 184 err = json.Unmarshal(*v, &ID) 185 if err != nil { 186 return err 187 } 188 as.ID = &ID 189 } 190 case "name": 191 if v != nil { 192 var name string 193 err = json.Unmarshal(*v, &name) 194 if err != nil { 195 return err 196 } 197 as.Name = &name 198 } 199 case "type": 200 if v != nil { 201 var typeVar string 202 err = json.Unmarshal(*v, &typeVar) 203 if err != nil { 204 return err 205 } 206 as.Type = &typeVar 207 } 208 case "location": 209 if v != nil { 210 var location string 211 err = json.Unmarshal(*v, &location) 212 if err != nil { 213 return err 214 } 215 as.Location = &location 216 } 217 case "tags": 218 if v != nil { 219 var tags map[string]*string 220 err = json.Unmarshal(*v, &tags) 221 if err != nil { 222 return err 223 } 224 as.Tags = tags 225 } 226 } 227 } 228 229 return nil 230} 231 232// AvailabilitySetListResult the List Availability Set operation response. 233type AvailabilitySetListResult struct { 234 autorest.Response `json:"-"` 235 // Value - The list of availability sets 236 Value *[]AvailabilitySet `json:"value,omitempty"` 237 // NextLink - The URI to fetch the next page of AvailabilitySets. Call ListNext() with this URI to fetch the next page of AvailabilitySets. 238 NextLink *string `json:"nextLink,omitempty"` 239} 240 241// AvailabilitySetListResultIterator provides access to a complete listing of AvailabilitySet values. 242type AvailabilitySetListResultIterator struct { 243 i int 244 page AvailabilitySetListResultPage 245} 246 247// NextWithContext advances to the next value. If there was an error making 248// the request the iterator does not advance and the error is returned. 249func (iter *AvailabilitySetListResultIterator) NextWithContext(ctx context.Context) (err error) { 250 if tracing.IsEnabled() { 251 ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetListResultIterator.NextWithContext") 252 defer func() { 253 sc := -1 254 if iter.Response().Response.Response != nil { 255 sc = iter.Response().Response.Response.StatusCode 256 } 257 tracing.EndSpan(ctx, sc, err) 258 }() 259 } 260 iter.i++ 261 if iter.i < len(iter.page.Values()) { 262 return nil 263 } 264 err = iter.page.NextWithContext(ctx) 265 if err != nil { 266 iter.i-- 267 return err 268 } 269 iter.i = 0 270 return nil 271} 272 273// Next advances to the next value. If there was an error making 274// the request the iterator does not advance and the error is returned. 275// Deprecated: Use NextWithContext() instead. 276func (iter *AvailabilitySetListResultIterator) Next() error { 277 return iter.NextWithContext(context.Background()) 278} 279 280// NotDone returns true if the enumeration should be started or is not yet complete. 281func (iter AvailabilitySetListResultIterator) NotDone() bool { 282 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 283} 284 285// Response returns the raw server response from the last page request. 286func (iter AvailabilitySetListResultIterator) Response() AvailabilitySetListResult { 287 return iter.page.Response() 288} 289 290// Value returns the current value or a zero-initialized value if the 291// iterator has advanced beyond the end of the collection. 292func (iter AvailabilitySetListResultIterator) Value() AvailabilitySet { 293 if !iter.page.NotDone() { 294 return AvailabilitySet{} 295 } 296 return iter.page.Values()[iter.i] 297} 298 299// Creates a new instance of the AvailabilitySetListResultIterator type. 300func NewAvailabilitySetListResultIterator(page AvailabilitySetListResultPage) AvailabilitySetListResultIterator { 301 return AvailabilitySetListResultIterator{page: page} 302} 303 304// IsEmpty returns true if the ListResult contains no values. 305func (aslr AvailabilitySetListResult) IsEmpty() bool { 306 return aslr.Value == nil || len(*aslr.Value) == 0 307} 308 309// hasNextLink returns true if the NextLink is not empty. 310func (aslr AvailabilitySetListResult) hasNextLink() bool { 311 return aslr.NextLink != nil && len(*aslr.NextLink) != 0 312} 313 314// availabilitySetListResultPreparer prepares a request to retrieve the next set of results. 315// It returns nil if no more results exist. 316func (aslr AvailabilitySetListResult) availabilitySetListResultPreparer(ctx context.Context) (*http.Request, error) { 317 if !aslr.hasNextLink() { 318 return nil, nil 319 } 320 return autorest.Prepare((&http.Request{}).WithContext(ctx), 321 autorest.AsJSON(), 322 autorest.AsGet(), 323 autorest.WithBaseURL(to.String(aslr.NextLink))) 324} 325 326// AvailabilitySetListResultPage contains a page of AvailabilitySet values. 327type AvailabilitySetListResultPage struct { 328 fn func(context.Context, AvailabilitySetListResult) (AvailabilitySetListResult, error) 329 aslr AvailabilitySetListResult 330} 331 332// NextWithContext advances to the next page of values. If there was an error making 333// the request the page does not advance and the error is returned. 334func (page *AvailabilitySetListResultPage) NextWithContext(ctx context.Context) (err error) { 335 if tracing.IsEnabled() { 336 ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetListResultPage.NextWithContext") 337 defer func() { 338 sc := -1 339 if page.Response().Response.Response != nil { 340 sc = page.Response().Response.Response.StatusCode 341 } 342 tracing.EndSpan(ctx, sc, err) 343 }() 344 } 345 for { 346 next, err := page.fn(ctx, page.aslr) 347 if err != nil { 348 return err 349 } 350 page.aslr = next 351 if !next.hasNextLink() || !next.IsEmpty() { 352 break 353 } 354 } 355 return nil 356} 357 358// Next advances to the next page of values. If there was an error making 359// the request the page does not advance and the error is returned. 360// Deprecated: Use NextWithContext() instead. 361func (page *AvailabilitySetListResultPage) Next() error { 362 return page.NextWithContext(context.Background()) 363} 364 365// NotDone returns true if the page enumeration should be started or is not yet complete. 366func (page AvailabilitySetListResultPage) NotDone() bool { 367 return !page.aslr.IsEmpty() 368} 369 370// Response returns the raw server response from the last page request. 371func (page AvailabilitySetListResultPage) Response() AvailabilitySetListResult { 372 return page.aslr 373} 374 375// Values returns the slice of values for the current page or nil if there are no values. 376func (page AvailabilitySetListResultPage) Values() []AvailabilitySet { 377 if page.aslr.IsEmpty() { 378 return nil 379 } 380 return *page.aslr.Value 381} 382 383// Creates a new instance of the AvailabilitySetListResultPage type. 384func NewAvailabilitySetListResultPage(cur AvailabilitySetListResult, getNextPage func(context.Context, AvailabilitySetListResult) (AvailabilitySetListResult, error)) AvailabilitySetListResultPage { 385 return AvailabilitySetListResultPage{ 386 fn: getNextPage, 387 aslr: cur, 388 } 389} 390 391// AvailabilitySetProperties the instance view of a resource. 392type AvailabilitySetProperties struct { 393 // PlatformUpdateDomainCount - Update Domain count. 394 PlatformUpdateDomainCount *int32 `json:"platformUpdateDomainCount,omitempty"` 395 // PlatformFaultDomainCount - Fault Domain count. 396 PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` 397 // VirtualMachines - A list of references to all virtual machines in the availability set. 398 VirtualMachines *[]SubResource `json:"virtualMachines,omitempty"` 399 // ProximityPlacementGroup - Specifies information about the proximity placement group that the availability set should be assigned to. <br><br>Minimum api-version: 2018-04-01. 400 ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` 401 // Statuses - READ-ONLY; The resource status information. 402 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 403} 404 405// MarshalJSON is the custom marshaler for AvailabilitySetProperties. 406func (asp AvailabilitySetProperties) MarshalJSON() ([]byte, error) { 407 objectMap := make(map[string]interface{}) 408 if asp.PlatformUpdateDomainCount != nil { 409 objectMap["platformUpdateDomainCount"] = asp.PlatformUpdateDomainCount 410 } 411 if asp.PlatformFaultDomainCount != nil { 412 objectMap["platformFaultDomainCount"] = asp.PlatformFaultDomainCount 413 } 414 if asp.VirtualMachines != nil { 415 objectMap["virtualMachines"] = asp.VirtualMachines 416 } 417 if asp.ProximityPlacementGroup != nil { 418 objectMap["proximityPlacementGroup"] = asp.ProximityPlacementGroup 419 } 420 return json.Marshal(objectMap) 421} 422 423// AvailabilitySetUpdate specifies information about the availability set that the virtual machine should 424// be assigned to. Only tags may be updated. 425type AvailabilitySetUpdate struct { 426 *AvailabilitySetProperties `json:"properties,omitempty"` 427 // Sku - Sku of the availability set 428 Sku *Sku `json:"sku,omitempty"` 429 // Tags - Resource tags 430 Tags map[string]*string `json:"tags"` 431} 432 433// MarshalJSON is the custom marshaler for AvailabilitySetUpdate. 434func (asu AvailabilitySetUpdate) MarshalJSON() ([]byte, error) { 435 objectMap := make(map[string]interface{}) 436 if asu.AvailabilitySetProperties != nil { 437 objectMap["properties"] = asu.AvailabilitySetProperties 438 } 439 if asu.Sku != nil { 440 objectMap["sku"] = asu.Sku 441 } 442 if asu.Tags != nil { 443 objectMap["tags"] = asu.Tags 444 } 445 return json.Marshal(objectMap) 446} 447 448// UnmarshalJSON is the custom unmarshaler for AvailabilitySetUpdate struct. 449func (asu *AvailabilitySetUpdate) UnmarshalJSON(body []byte) error { 450 var m map[string]*json.RawMessage 451 err := json.Unmarshal(body, &m) 452 if err != nil { 453 return err 454 } 455 for k, v := range m { 456 switch k { 457 case "properties": 458 if v != nil { 459 var availabilitySetProperties AvailabilitySetProperties 460 err = json.Unmarshal(*v, &availabilitySetProperties) 461 if err != nil { 462 return err 463 } 464 asu.AvailabilitySetProperties = &availabilitySetProperties 465 } 466 case "sku": 467 if v != nil { 468 var sku Sku 469 err = json.Unmarshal(*v, &sku) 470 if err != nil { 471 return err 472 } 473 asu.Sku = &sku 474 } 475 case "tags": 476 if v != nil { 477 var tags map[string]*string 478 err = json.Unmarshal(*v, &tags) 479 if err != nil { 480 return err 481 } 482 asu.Tags = tags 483 } 484 } 485 } 486 487 return nil 488} 489 490// AvailablePatchSummary describes the properties of an virtual machine instance view for available patch 491// summary. 492type AvailablePatchSummary struct { 493 // 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 "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings.". Possible values include: 'PatchOperationStatusUnknown', 'PatchOperationStatusInProgress', 'PatchOperationStatusFailed', 'PatchOperationStatusSucceeded', 'PatchOperationStatusCompletedWithWarnings' 494 Status PatchOperationStatus `json:"status,omitempty"` 495 // AssessmentActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. 496 AssessmentActivityID *string `json:"assessmentActivityId,omitempty"` 497 // 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. 498 RebootPending *bool `json:"rebootPending,omitempty"` 499 // CriticalAndSecurityPatchCount - READ-ONLY; The number of critical or security patches that have been detected as available and not yet installed. 500 CriticalAndSecurityPatchCount *int32 `json:"criticalAndSecurityPatchCount,omitempty"` 501 // OtherPatchCount - READ-ONLY; The number of all available patches excluding critical and security. 502 OtherPatchCount *int32 `json:"otherPatchCount,omitempty"` 503 // StartTime - READ-ONLY; The UTC timestamp when the operation began. 504 StartTime *date.Time `json:"startTime,omitempty"` 505 // LastModifiedTime - READ-ONLY; The UTC timestamp when the operation began. 506 LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` 507 // Error - READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. 508 Error *APIError `json:"error,omitempty"` 509} 510 511// MarshalJSON is the custom marshaler for AvailablePatchSummary. 512func (aps AvailablePatchSummary) MarshalJSON() ([]byte, error) { 513 objectMap := make(map[string]interface{}) 514 return json.Marshal(objectMap) 515} 516 517// BillingProfile specifies the billing related details of a Azure Spot VM or VMSS. <br><br>Minimum 518// api-version: 2019-03-01. 519type BillingProfile struct { 520 // 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. 521 MaxPrice *float64 `json:"maxPrice,omitempty"` 522} 523 524// BootDiagnostics boot Diagnostics is a debugging feature which allows you to view Console Output and 525// Screenshot to diagnose VM status. <br><br> You can easily view the output of your console log. <br><br> 526// Azure also enables you to see a screenshot of the VM from the hypervisor. 527type BootDiagnostics struct { 528 // Enabled - Whether boot diagnostics should be enabled on the Virtual Machine. 529 Enabled *bool `json:"enabled,omitempty"` 530 // 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. 531 StorageURI *string `json:"storageUri,omitempty"` 532} 533 534// BootDiagnosticsInstanceView the instance view of a virtual machine boot diagnostics. 535type BootDiagnosticsInstanceView struct { 536 // 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. 537 ConsoleScreenshotBlobURI *string `json:"consoleScreenshotBlobUri,omitempty"` 538 // 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. 539 SerialConsoleLogBlobURI *string `json:"serialConsoleLogBlobUri,omitempty"` 540 // 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. 541 Status *InstanceViewStatus `json:"status,omitempty"` 542} 543 544// MarshalJSON is the custom marshaler for BootDiagnosticsInstanceView. 545func (bdiv BootDiagnosticsInstanceView) MarshalJSON() ([]byte, error) { 546 objectMap := make(map[string]interface{}) 547 return json.Marshal(objectMap) 548} 549 550// CloudError an error response from the Compute service. 551type CloudError struct { 552 Error *APIError `json:"error,omitempty"` 553} 554 555// CloudService describes the cloud service. 556type CloudService struct { 557 autorest.Response `json:"-"` 558 // ID - READ-ONLY; Resource Id. 559 ID *string `json:"id,omitempty"` 560 // Name - READ-ONLY; Resource name. 561 Name *string `json:"name,omitempty"` 562 // Type - READ-ONLY; Resource type. 563 Type *string `json:"type,omitempty"` 564 // Location - Resource location. 565 Location *string `json:"location,omitempty"` 566 // Tags - Resource tags. 567 Tags map[string]*string `json:"tags"` 568 Properties *CloudServiceProperties `json:"properties,omitempty"` 569} 570 571// MarshalJSON is the custom marshaler for CloudService. 572func (cs CloudService) MarshalJSON() ([]byte, error) { 573 objectMap := make(map[string]interface{}) 574 if cs.Location != nil { 575 objectMap["location"] = cs.Location 576 } 577 if cs.Tags != nil { 578 objectMap["tags"] = cs.Tags 579 } 580 if cs.Properties != nil { 581 objectMap["properties"] = cs.Properties 582 } 583 return json.Marshal(objectMap) 584} 585 586// CloudServiceExtensionProfile describes a cloud service extension profile. 587type CloudServiceExtensionProfile struct { 588 // Extensions - List of extensions for the cloud service. 589 Extensions *[]Extension `json:"extensions,omitempty"` 590} 591 592// CloudServiceExtensionProperties extension Properties. 593type CloudServiceExtensionProperties struct { 594 // Publisher - The name of the extension handler publisher. 595 Publisher *string `json:"publisher,omitempty"` 596 // Type - Specifies the type of the extension. 597 Type *string `json:"type,omitempty"` 598 // TypeHandlerVersion - Specifies the version of the extension. Specifies the version of the extension. If this element is not specified or an asterisk (*) is used as the value, the latest version of the extension is used. If the value is specified with a major version number and an asterisk as the minor version number (X.), the latest minor version of the specified major version is selected. If a major version number and a minor version number are specified (X.Y), the specific extension version is selected. If a version is specified, an auto-upgrade is performed on the role instance. 599 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 600 // AutoUpgradeMinorVersion - Explicitly specify whether platform can automatically upgrade typeHandlerVersion to higher minor versions when they become available. 601 AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` 602 // Settings - Public settings for the extension. For JSON extensions, this is the JSON settings for the extension. For XML Extension (like RDP), this is the XML setting for the extension. 603 Settings *string `json:"settings,omitempty"` 604 // ProtectedSettings - Protected settings for the extension which are encrypted before sent to the role instance. 605 ProtectedSettings *string `json:"protectedSettings,omitempty"` 606 ProtectedSettingsFromKeyVault *CloudServiceVaultAndSecretReference `json:"protectedSettingsFromKeyVault,omitempty"` 607 // ForceUpdateTag - Tag to force apply the provided public and protected settings. 608 // Changing the tag value allows for re-running the extension without changing any of the public or protected settings. 609 // If forceUpdateTag is not changed, updates to public or protected settings would still be applied by the handler. 610 // If neither forceUpdateTag nor any of public or protected settings change, extension would flow to the role instance with the same sequence-number, and 611 // it is up to handler implementation whether to re-run it or not 612 ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` 613 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 614 ProvisioningState *string `json:"provisioningState,omitempty"` 615 // RolesAppliedTo - Optional list of roles to apply this extension. If property is not specified or '*' is specified, extension is applied to all roles in the cloud service. 616 RolesAppliedTo *[]string `json:"rolesAppliedTo,omitempty"` 617} 618 619// MarshalJSON is the custom marshaler for CloudServiceExtensionProperties. 620func (csep CloudServiceExtensionProperties) MarshalJSON() ([]byte, error) { 621 objectMap := make(map[string]interface{}) 622 if csep.Publisher != nil { 623 objectMap["publisher"] = csep.Publisher 624 } 625 if csep.Type != nil { 626 objectMap["type"] = csep.Type 627 } 628 if csep.TypeHandlerVersion != nil { 629 objectMap["typeHandlerVersion"] = csep.TypeHandlerVersion 630 } 631 if csep.AutoUpgradeMinorVersion != nil { 632 objectMap["autoUpgradeMinorVersion"] = csep.AutoUpgradeMinorVersion 633 } 634 if csep.Settings != nil { 635 objectMap["settings"] = csep.Settings 636 } 637 if csep.ProtectedSettings != nil { 638 objectMap["protectedSettings"] = csep.ProtectedSettings 639 } 640 if csep.ProtectedSettingsFromKeyVault != nil { 641 objectMap["protectedSettingsFromKeyVault"] = csep.ProtectedSettingsFromKeyVault 642 } 643 if csep.ForceUpdateTag != nil { 644 objectMap["forceUpdateTag"] = csep.ForceUpdateTag 645 } 646 if csep.RolesAppliedTo != nil { 647 objectMap["rolesAppliedTo"] = csep.RolesAppliedTo 648 } 649 return json.Marshal(objectMap) 650} 651 652// CloudServiceInstanceView instanceView of CloudService as a whole 653type CloudServiceInstanceView struct { 654 autorest.Response `json:"-"` 655 RoleInstance *InstanceViewStatusesSummary `json:"roleInstance,omitempty"` 656 // SdkVersion - READ-ONLY; The version of the SDK that was used to generate the package for the cloud service. 657 SdkVersion *string `json:"sdkVersion,omitempty"` 658 // PrivateIds - READ-ONLY; Specifies a list of unique identifiers generated internally for the cloud service. <br /><br /> NOTE: If you are using Azure Diagnostics extension, this property can be used as 'DeploymentId' for querying details. 659 PrivateIds *[]string `json:"privateIds,omitempty"` 660 // Statuses - READ-ONLY 661 Statuses *[]ResourceInstanceViewStatus `json:"statuses,omitempty"` 662} 663 664// MarshalJSON is the custom marshaler for CloudServiceInstanceView. 665func (csiv CloudServiceInstanceView) MarshalJSON() ([]byte, error) { 666 objectMap := make(map[string]interface{}) 667 if csiv.RoleInstance != nil { 668 objectMap["roleInstance"] = csiv.RoleInstance 669 } 670 return json.Marshal(objectMap) 671} 672 673// CloudServiceListResult ... 674type CloudServiceListResult struct { 675 autorest.Response `json:"-"` 676 Value *[]CloudService `json:"value,omitempty"` 677 NextLink *string `json:"nextLink,omitempty"` 678} 679 680// CloudServiceListResultIterator provides access to a complete listing of CloudService values. 681type CloudServiceListResultIterator struct { 682 i int 683 page CloudServiceListResultPage 684} 685 686// NextWithContext advances to the next value. If there was an error making 687// the request the iterator does not advance and the error is returned. 688func (iter *CloudServiceListResultIterator) NextWithContext(ctx context.Context) (err error) { 689 if tracing.IsEnabled() { 690 ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceListResultIterator.NextWithContext") 691 defer func() { 692 sc := -1 693 if iter.Response().Response.Response != nil { 694 sc = iter.Response().Response.Response.StatusCode 695 } 696 tracing.EndSpan(ctx, sc, err) 697 }() 698 } 699 iter.i++ 700 if iter.i < len(iter.page.Values()) { 701 return nil 702 } 703 err = iter.page.NextWithContext(ctx) 704 if err != nil { 705 iter.i-- 706 return err 707 } 708 iter.i = 0 709 return nil 710} 711 712// Next advances to the next value. If there was an error making 713// the request the iterator does not advance and the error is returned. 714// Deprecated: Use NextWithContext() instead. 715func (iter *CloudServiceListResultIterator) Next() error { 716 return iter.NextWithContext(context.Background()) 717} 718 719// NotDone returns true if the enumeration should be started or is not yet complete. 720func (iter CloudServiceListResultIterator) NotDone() bool { 721 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 722} 723 724// Response returns the raw server response from the last page request. 725func (iter CloudServiceListResultIterator) Response() CloudServiceListResult { 726 return iter.page.Response() 727} 728 729// Value returns the current value or a zero-initialized value if the 730// iterator has advanced beyond the end of the collection. 731func (iter CloudServiceListResultIterator) Value() CloudService { 732 if !iter.page.NotDone() { 733 return CloudService{} 734 } 735 return iter.page.Values()[iter.i] 736} 737 738// Creates a new instance of the CloudServiceListResultIterator type. 739func NewCloudServiceListResultIterator(page CloudServiceListResultPage) CloudServiceListResultIterator { 740 return CloudServiceListResultIterator{page: page} 741} 742 743// IsEmpty returns true if the ListResult contains no values. 744func (cslr CloudServiceListResult) IsEmpty() bool { 745 return cslr.Value == nil || len(*cslr.Value) == 0 746} 747 748// hasNextLink returns true if the NextLink is not empty. 749func (cslr CloudServiceListResult) hasNextLink() bool { 750 return cslr.NextLink != nil && len(*cslr.NextLink) != 0 751} 752 753// cloudServiceListResultPreparer prepares a request to retrieve the next set of results. 754// It returns nil if no more results exist. 755func (cslr CloudServiceListResult) cloudServiceListResultPreparer(ctx context.Context) (*http.Request, error) { 756 if !cslr.hasNextLink() { 757 return nil, nil 758 } 759 return autorest.Prepare((&http.Request{}).WithContext(ctx), 760 autorest.AsJSON(), 761 autorest.AsGet(), 762 autorest.WithBaseURL(to.String(cslr.NextLink))) 763} 764 765// CloudServiceListResultPage contains a page of CloudService values. 766type CloudServiceListResultPage struct { 767 fn func(context.Context, CloudServiceListResult) (CloudServiceListResult, error) 768 cslr CloudServiceListResult 769} 770 771// NextWithContext advances to the next page of values. If there was an error making 772// the request the page does not advance and the error is returned. 773func (page *CloudServiceListResultPage) NextWithContext(ctx context.Context) (err error) { 774 if tracing.IsEnabled() { 775 ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceListResultPage.NextWithContext") 776 defer func() { 777 sc := -1 778 if page.Response().Response.Response != nil { 779 sc = page.Response().Response.Response.StatusCode 780 } 781 tracing.EndSpan(ctx, sc, err) 782 }() 783 } 784 for { 785 next, err := page.fn(ctx, page.cslr) 786 if err != nil { 787 return err 788 } 789 page.cslr = next 790 if !next.hasNextLink() || !next.IsEmpty() { 791 break 792 } 793 } 794 return nil 795} 796 797// Next advances to the next page of values. If there was an error making 798// the request the page does not advance and the error is returned. 799// Deprecated: Use NextWithContext() instead. 800func (page *CloudServiceListResultPage) Next() error { 801 return page.NextWithContext(context.Background()) 802} 803 804// NotDone returns true if the page enumeration should be started or is not yet complete. 805func (page CloudServiceListResultPage) NotDone() bool { 806 return !page.cslr.IsEmpty() 807} 808 809// Response returns the raw server response from the last page request. 810func (page CloudServiceListResultPage) Response() CloudServiceListResult { 811 return page.cslr 812} 813 814// Values returns the slice of values for the current page or nil if there are no values. 815func (page CloudServiceListResultPage) Values() []CloudService { 816 if page.cslr.IsEmpty() { 817 return nil 818 } 819 return *page.cslr.Value 820} 821 822// Creates a new instance of the CloudServiceListResultPage type. 823func NewCloudServiceListResultPage(cur CloudServiceListResult, getNextPage func(context.Context, CloudServiceListResult) (CloudServiceListResult, error)) CloudServiceListResultPage { 824 return CloudServiceListResultPage{ 825 fn: getNextPage, 826 cslr: cur, 827 } 828} 829 830// CloudServiceNetworkProfile network Profile for the cloud service. 831type CloudServiceNetworkProfile struct { 832 // LoadBalancerConfigurations - List of Load balancer configurations. Cloud service can have up to two load balancer configurations, corresponding to a Public Load Balancer and an Internal Load Balancer. 833 LoadBalancerConfigurations *[]LoadBalancerConfiguration `json:"loadBalancerConfigurations,omitempty"` 834 // SwappableCloudService - The id reference of the cloud service containing the target IP with which the subject cloud service can perform a swap. This property cannot be updated once it is set. The swappable cloud service referred by this id must be present otherwise an error will be thrown. 835 SwappableCloudService *SubResource `json:"swappableCloudService,omitempty"` 836} 837 838// CloudServiceOsProfile describes the OS profile for the cloud service. 839type CloudServiceOsProfile struct { 840 // Secrets - Specifies set of certificates that should be installed onto the role instances. 841 Secrets *[]CloudServiceVaultSecretGroup `json:"secrets,omitempty"` 842} 843 844// CloudServiceProperties cloud service properties 845type CloudServiceProperties struct { 846 // PackageURL - Specifies a URL that refers to the location of the service package in the Blob service. The service package URL can be Shared Access Signature (SAS) URI from any storage account. 847 // This is a write-only property and is not returned in GET calls. 848 PackageURL *string `json:"packageUrl,omitempty"` 849 // Configuration - Specifies the XML service configuration (.cscfg) for the cloud service. 850 Configuration *string `json:"configuration,omitempty"` 851 // ConfigurationURL - Specifies a URL that refers to the location of the service configuration in the Blob service. The service package URL can be Shared Access Signature (SAS) URI from any storage account. 852 // This is a write-only property and is not returned in GET calls. 853 ConfigurationURL *string `json:"configurationUrl,omitempty"` 854 // StartCloudService - (Optional) Indicates whether to start the cloud service immediately after it is created. The default value is `true`. 855 // If false, the service model is still deployed, but the code is not run immediately. Instead, the service is PoweredOff until you call Start, at which time the service will be started. A deployed service still incurs charges, even if it is poweredoff. 856 StartCloudService *bool `json:"startCloudService,omitempty"` 857 // AllowModelOverride - (Optional) Indicates whether the role sku properties (roleProfile.roles.sku) specified in the model/template should override the role instance count and vm size specified in the .cscfg and .csdef respectively. 858 // The default value is `false`. 859 AllowModelOverride *bool `json:"allowModelOverride,omitempty"` 860 // UpgradeMode - Possible values include: 'CloudServiceUpgradeModeAuto', 'CloudServiceUpgradeModeManual', 'CloudServiceUpgradeModeSimultaneous' 861 UpgradeMode CloudServiceUpgradeMode `json:"upgradeMode,omitempty"` 862 RoleProfile *CloudServiceRoleProfile `json:"roleProfile,omitempty"` 863 OsProfile *CloudServiceOsProfile `json:"osProfile,omitempty"` 864 NetworkProfile *CloudServiceNetworkProfile `json:"networkProfile,omitempty"` 865 ExtensionProfile *CloudServiceExtensionProfile `json:"extensionProfile,omitempty"` 866 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 867 ProvisioningState *string `json:"provisioningState,omitempty"` 868 // UniqueID - READ-ONLY; The unique identifier for the cloud service. 869 UniqueID *string `json:"uniqueId,omitempty"` 870} 871 872// MarshalJSON is the custom marshaler for CloudServiceProperties. 873func (csp CloudServiceProperties) MarshalJSON() ([]byte, error) { 874 objectMap := make(map[string]interface{}) 875 if csp.PackageURL != nil { 876 objectMap["packageUrl"] = csp.PackageURL 877 } 878 if csp.Configuration != nil { 879 objectMap["configuration"] = csp.Configuration 880 } 881 if csp.ConfigurationURL != nil { 882 objectMap["configurationUrl"] = csp.ConfigurationURL 883 } 884 if csp.StartCloudService != nil { 885 objectMap["startCloudService"] = csp.StartCloudService 886 } 887 if csp.AllowModelOverride != nil { 888 objectMap["allowModelOverride"] = csp.AllowModelOverride 889 } 890 if csp.UpgradeMode != "" { 891 objectMap["upgradeMode"] = csp.UpgradeMode 892 } 893 if csp.RoleProfile != nil { 894 objectMap["roleProfile"] = csp.RoleProfile 895 } 896 if csp.OsProfile != nil { 897 objectMap["osProfile"] = csp.OsProfile 898 } 899 if csp.NetworkProfile != nil { 900 objectMap["networkProfile"] = csp.NetworkProfile 901 } 902 if csp.ExtensionProfile != nil { 903 objectMap["extensionProfile"] = csp.ExtensionProfile 904 } 905 return json.Marshal(objectMap) 906} 907 908// CloudServiceRole describes a role of the cloud service. 909type CloudServiceRole struct { 910 autorest.Response `json:"-"` 911 // ID - READ-ONLY; Resource id 912 ID *string `json:"id,omitempty"` 913 // Name - READ-ONLY; Resource name 914 Name *string `json:"name,omitempty"` 915 // Type - READ-ONLY; Resource type 916 Type *string `json:"type,omitempty"` 917 // Location - READ-ONLY; Resource location 918 Location *string `json:"location,omitempty"` 919 Sku *CloudServiceRoleSku `json:"sku,omitempty"` 920 Properties *CloudServiceRoleProperties `json:"properties,omitempty"` 921} 922 923// MarshalJSON is the custom marshaler for CloudServiceRole. 924func (csr CloudServiceRole) MarshalJSON() ([]byte, error) { 925 objectMap := make(map[string]interface{}) 926 if csr.Sku != nil { 927 objectMap["sku"] = csr.Sku 928 } 929 if csr.Properties != nil { 930 objectMap["properties"] = csr.Properties 931 } 932 return json.Marshal(objectMap) 933} 934 935// CloudServiceRoleInstancesDeleteFuture an abstraction for monitoring and retrieving the results of a 936// long-running operation. 937type CloudServiceRoleInstancesDeleteFuture struct { 938 azure.FutureAPI 939 // Result returns the result of the asynchronous operation. 940 // If the operation has not completed it will return an error. 941 Result func(CloudServiceRoleInstancesClient) (autorest.Response, error) 942} 943 944// UnmarshalJSON is the custom unmarshaller for CreateFuture. 945func (future *CloudServiceRoleInstancesDeleteFuture) UnmarshalJSON(body []byte) error { 946 var azFuture azure.Future 947 if err := json.Unmarshal(body, &azFuture); err != nil { 948 return err 949 } 950 future.FutureAPI = &azFuture 951 future.Result = future.result 952 return nil 953} 954 955// result is the default implementation for CloudServiceRoleInstancesDeleteFuture.Result. 956func (future *CloudServiceRoleInstancesDeleteFuture) result(client CloudServiceRoleInstancesClient) (ar autorest.Response, err error) { 957 var done bool 958 done, err = future.DoneWithContext(context.Background(), client) 959 if err != nil { 960 err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesDeleteFuture", "Result", future.Response(), "Polling failure") 961 return 962 } 963 if !done { 964 ar.Response = future.Response() 965 err = azure.NewAsyncOpIncompleteError("compute.CloudServiceRoleInstancesDeleteFuture") 966 return 967 } 968 ar.Response = future.Response() 969 return 970} 971 972// CloudServiceRoleInstancesRebuildFuture an abstraction for monitoring and retrieving the results of a 973// long-running operation. 974type CloudServiceRoleInstancesRebuildFuture struct { 975 azure.FutureAPI 976 // Result returns the result of the asynchronous operation. 977 // If the operation has not completed it will return an error. 978 Result func(CloudServiceRoleInstancesClient) (autorest.Response, error) 979} 980 981// UnmarshalJSON is the custom unmarshaller for CreateFuture. 982func (future *CloudServiceRoleInstancesRebuildFuture) UnmarshalJSON(body []byte) error { 983 var azFuture azure.Future 984 if err := json.Unmarshal(body, &azFuture); err != nil { 985 return err 986 } 987 future.FutureAPI = &azFuture 988 future.Result = future.result 989 return nil 990} 991 992// result is the default implementation for CloudServiceRoleInstancesRebuildFuture.Result. 993func (future *CloudServiceRoleInstancesRebuildFuture) result(client CloudServiceRoleInstancesClient) (ar autorest.Response, err error) { 994 var done bool 995 done, err = future.DoneWithContext(context.Background(), client) 996 if err != nil { 997 err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesRebuildFuture", "Result", future.Response(), "Polling failure") 998 return 999 } 1000 if !done { 1001 ar.Response = future.Response() 1002 err = azure.NewAsyncOpIncompleteError("compute.CloudServiceRoleInstancesRebuildFuture") 1003 return 1004 } 1005 ar.Response = future.Response() 1006 return 1007} 1008 1009// CloudServiceRoleInstancesReimageFuture an abstraction for monitoring and retrieving the results of a 1010// long-running operation. 1011type CloudServiceRoleInstancesReimageFuture struct { 1012 azure.FutureAPI 1013 // Result returns the result of the asynchronous operation. 1014 // If the operation has not completed it will return an error. 1015 Result func(CloudServiceRoleInstancesClient) (autorest.Response, error) 1016} 1017 1018// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1019func (future *CloudServiceRoleInstancesReimageFuture) UnmarshalJSON(body []byte) error { 1020 var azFuture azure.Future 1021 if err := json.Unmarshal(body, &azFuture); err != nil { 1022 return err 1023 } 1024 future.FutureAPI = &azFuture 1025 future.Result = future.result 1026 return nil 1027} 1028 1029// result is the default implementation for CloudServiceRoleInstancesReimageFuture.Result. 1030func (future *CloudServiceRoleInstancesReimageFuture) result(client CloudServiceRoleInstancesClient) (ar autorest.Response, err error) { 1031 var done bool 1032 done, err = future.DoneWithContext(context.Background(), client) 1033 if err != nil { 1034 err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesReimageFuture", "Result", future.Response(), "Polling failure") 1035 return 1036 } 1037 if !done { 1038 ar.Response = future.Response() 1039 err = azure.NewAsyncOpIncompleteError("compute.CloudServiceRoleInstancesReimageFuture") 1040 return 1041 } 1042 ar.Response = future.Response() 1043 return 1044} 1045 1046// CloudServiceRoleInstancesRestartFuture an abstraction for monitoring and retrieving the results of a 1047// long-running operation. 1048type CloudServiceRoleInstancesRestartFuture struct { 1049 azure.FutureAPI 1050 // Result returns the result of the asynchronous operation. 1051 // If the operation has not completed it will return an error. 1052 Result func(CloudServiceRoleInstancesClient) (autorest.Response, error) 1053} 1054 1055// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1056func (future *CloudServiceRoleInstancesRestartFuture) UnmarshalJSON(body []byte) error { 1057 var azFuture azure.Future 1058 if err := json.Unmarshal(body, &azFuture); err != nil { 1059 return err 1060 } 1061 future.FutureAPI = &azFuture 1062 future.Result = future.result 1063 return nil 1064} 1065 1066// result is the default implementation for CloudServiceRoleInstancesRestartFuture.Result. 1067func (future *CloudServiceRoleInstancesRestartFuture) result(client CloudServiceRoleInstancesClient) (ar autorest.Response, err error) { 1068 var done bool 1069 done, err = future.DoneWithContext(context.Background(), client) 1070 if err != nil { 1071 err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesRestartFuture", "Result", future.Response(), "Polling failure") 1072 return 1073 } 1074 if !done { 1075 ar.Response = future.Response() 1076 err = azure.NewAsyncOpIncompleteError("compute.CloudServiceRoleInstancesRestartFuture") 1077 return 1078 } 1079 ar.Response = future.Response() 1080 return 1081} 1082 1083// CloudServiceRoleListResult ... 1084type CloudServiceRoleListResult struct { 1085 autorest.Response `json:"-"` 1086 Value *[]CloudServiceRole `json:"value,omitempty"` 1087 NextLink *string `json:"nextLink,omitempty"` 1088} 1089 1090// CloudServiceRoleListResultIterator provides access to a complete listing of CloudServiceRole values. 1091type CloudServiceRoleListResultIterator struct { 1092 i int 1093 page CloudServiceRoleListResultPage 1094} 1095 1096// NextWithContext advances to the next value. If there was an error making 1097// the request the iterator does not advance and the error is returned. 1098func (iter *CloudServiceRoleListResultIterator) NextWithContext(ctx context.Context) (err error) { 1099 if tracing.IsEnabled() { 1100 ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleListResultIterator.NextWithContext") 1101 defer func() { 1102 sc := -1 1103 if iter.Response().Response.Response != nil { 1104 sc = iter.Response().Response.Response.StatusCode 1105 } 1106 tracing.EndSpan(ctx, sc, err) 1107 }() 1108 } 1109 iter.i++ 1110 if iter.i < len(iter.page.Values()) { 1111 return nil 1112 } 1113 err = iter.page.NextWithContext(ctx) 1114 if err != nil { 1115 iter.i-- 1116 return err 1117 } 1118 iter.i = 0 1119 return nil 1120} 1121 1122// Next advances to the next value. If there was an error making 1123// the request the iterator does not advance and the error is returned. 1124// Deprecated: Use NextWithContext() instead. 1125func (iter *CloudServiceRoleListResultIterator) Next() error { 1126 return iter.NextWithContext(context.Background()) 1127} 1128 1129// NotDone returns true if the enumeration should be started or is not yet complete. 1130func (iter CloudServiceRoleListResultIterator) NotDone() bool { 1131 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1132} 1133 1134// Response returns the raw server response from the last page request. 1135func (iter CloudServiceRoleListResultIterator) Response() CloudServiceRoleListResult { 1136 return iter.page.Response() 1137} 1138 1139// Value returns the current value or a zero-initialized value if the 1140// iterator has advanced beyond the end of the collection. 1141func (iter CloudServiceRoleListResultIterator) Value() CloudServiceRole { 1142 if !iter.page.NotDone() { 1143 return CloudServiceRole{} 1144 } 1145 return iter.page.Values()[iter.i] 1146} 1147 1148// Creates a new instance of the CloudServiceRoleListResultIterator type. 1149func NewCloudServiceRoleListResultIterator(page CloudServiceRoleListResultPage) CloudServiceRoleListResultIterator { 1150 return CloudServiceRoleListResultIterator{page: page} 1151} 1152 1153// IsEmpty returns true if the ListResult contains no values. 1154func (csrlr CloudServiceRoleListResult) IsEmpty() bool { 1155 return csrlr.Value == nil || len(*csrlr.Value) == 0 1156} 1157 1158// hasNextLink returns true if the NextLink is not empty. 1159func (csrlr CloudServiceRoleListResult) hasNextLink() bool { 1160 return csrlr.NextLink != nil && len(*csrlr.NextLink) != 0 1161} 1162 1163// cloudServiceRoleListResultPreparer prepares a request to retrieve the next set of results. 1164// It returns nil if no more results exist. 1165func (csrlr CloudServiceRoleListResult) cloudServiceRoleListResultPreparer(ctx context.Context) (*http.Request, error) { 1166 if !csrlr.hasNextLink() { 1167 return nil, nil 1168 } 1169 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1170 autorest.AsJSON(), 1171 autorest.AsGet(), 1172 autorest.WithBaseURL(to.String(csrlr.NextLink))) 1173} 1174 1175// CloudServiceRoleListResultPage contains a page of CloudServiceRole values. 1176type CloudServiceRoleListResultPage struct { 1177 fn func(context.Context, CloudServiceRoleListResult) (CloudServiceRoleListResult, error) 1178 csrlr CloudServiceRoleListResult 1179} 1180 1181// NextWithContext advances to the next page of values. If there was an error making 1182// the request the page does not advance and the error is returned. 1183func (page *CloudServiceRoleListResultPage) NextWithContext(ctx context.Context) (err error) { 1184 if tracing.IsEnabled() { 1185 ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleListResultPage.NextWithContext") 1186 defer func() { 1187 sc := -1 1188 if page.Response().Response.Response != nil { 1189 sc = page.Response().Response.Response.StatusCode 1190 } 1191 tracing.EndSpan(ctx, sc, err) 1192 }() 1193 } 1194 for { 1195 next, err := page.fn(ctx, page.csrlr) 1196 if err != nil { 1197 return err 1198 } 1199 page.csrlr = next 1200 if !next.hasNextLink() || !next.IsEmpty() { 1201 break 1202 } 1203 } 1204 return nil 1205} 1206 1207// Next advances to the next page of values. If there was an error making 1208// the request the page does not advance and the error is returned. 1209// Deprecated: Use NextWithContext() instead. 1210func (page *CloudServiceRoleListResultPage) Next() error { 1211 return page.NextWithContext(context.Background()) 1212} 1213 1214// NotDone returns true if the page enumeration should be started or is not yet complete. 1215func (page CloudServiceRoleListResultPage) NotDone() bool { 1216 return !page.csrlr.IsEmpty() 1217} 1218 1219// Response returns the raw server response from the last page request. 1220func (page CloudServiceRoleListResultPage) Response() CloudServiceRoleListResult { 1221 return page.csrlr 1222} 1223 1224// Values returns the slice of values for the current page or nil if there are no values. 1225func (page CloudServiceRoleListResultPage) Values() []CloudServiceRole { 1226 if page.csrlr.IsEmpty() { 1227 return nil 1228 } 1229 return *page.csrlr.Value 1230} 1231 1232// Creates a new instance of the CloudServiceRoleListResultPage type. 1233func NewCloudServiceRoleListResultPage(cur CloudServiceRoleListResult, getNextPage func(context.Context, CloudServiceRoleListResult) (CloudServiceRoleListResult, error)) CloudServiceRoleListResultPage { 1234 return CloudServiceRoleListResultPage{ 1235 fn: getNextPage, 1236 csrlr: cur, 1237 } 1238} 1239 1240// CloudServiceRoleProfile describes the role profile for the cloud service. 1241type CloudServiceRoleProfile struct { 1242 // Roles - List of roles for the cloud service. 1243 Roles *[]CloudServiceRoleProfileProperties `json:"roles,omitempty"` 1244} 1245 1246// CloudServiceRoleProfileProperties describes the role properties. 1247type CloudServiceRoleProfileProperties struct { 1248 // Name - Resource name. 1249 Name *string `json:"name,omitempty"` 1250 Sku *CloudServiceRoleSku `json:"sku,omitempty"` 1251} 1252 1253// CloudServiceRoleProperties ... 1254type CloudServiceRoleProperties struct { 1255 // UniqueID - READ-ONLY; Specifies the ID which uniquely identifies a cloud service role. 1256 UniqueID *string `json:"uniqueId,omitempty"` 1257} 1258 1259// MarshalJSON is the custom marshaler for CloudServiceRoleProperties. 1260func (csrp CloudServiceRoleProperties) MarshalJSON() ([]byte, error) { 1261 objectMap := make(map[string]interface{}) 1262 return json.Marshal(objectMap) 1263} 1264 1265// CloudServiceRoleSku describes the cloud service role sku. 1266type CloudServiceRoleSku struct { 1267 // Name - The sku name. NOTE: If the new SKU is not supported on the hardware the cloud service is currently on, you need to delete and recreate the cloud service or move back to the old sku. 1268 Name *string `json:"name,omitempty"` 1269 // Tier - Specifies the tier of the cloud service. Possible Values are <br /><br /> **Standard** <br /><br /> **Basic** 1270 Tier *string `json:"tier,omitempty"` 1271 // Capacity - Specifies the number of role instances in the cloud service. 1272 Capacity *int64 `json:"capacity,omitempty"` 1273} 1274 1275// CloudServicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 1276// long-running operation. 1277type CloudServicesCreateOrUpdateFuture struct { 1278 azure.FutureAPI 1279 // Result returns the result of the asynchronous operation. 1280 // If the operation has not completed it will return an error. 1281 Result func(CloudServicesClient) (CloudService, error) 1282} 1283 1284// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1285func (future *CloudServicesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 1286 var azFuture azure.Future 1287 if err := json.Unmarshal(body, &azFuture); err != nil { 1288 return err 1289 } 1290 future.FutureAPI = &azFuture 1291 future.Result = future.result 1292 return nil 1293} 1294 1295// result is the default implementation for CloudServicesCreateOrUpdateFuture.Result. 1296func (future *CloudServicesCreateOrUpdateFuture) result(client CloudServicesClient) (cs CloudService, err error) { 1297 var done bool 1298 done, err = future.DoneWithContext(context.Background(), client) 1299 if err != nil { 1300 err = autorest.NewErrorWithError(err, "compute.CloudServicesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 1301 return 1302 } 1303 if !done { 1304 cs.Response.Response = future.Response() 1305 err = azure.NewAsyncOpIncompleteError("compute.CloudServicesCreateOrUpdateFuture") 1306 return 1307 } 1308 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1309 if cs.Response.Response, err = future.GetResult(sender); err == nil && cs.Response.Response.StatusCode != http.StatusNoContent { 1310 cs, err = client.CreateOrUpdateResponder(cs.Response.Response) 1311 if err != nil { 1312 err = autorest.NewErrorWithError(err, "compute.CloudServicesCreateOrUpdateFuture", "Result", cs.Response.Response, "Failure responding to request") 1313 } 1314 } 1315 return 1316} 1317 1318// CloudServicesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 1319// operation. 1320type CloudServicesDeleteFuture struct { 1321 azure.FutureAPI 1322 // Result returns the result of the asynchronous operation. 1323 // If the operation has not completed it will return an error. 1324 Result func(CloudServicesClient) (autorest.Response, error) 1325} 1326 1327// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1328func (future *CloudServicesDeleteFuture) UnmarshalJSON(body []byte) error { 1329 var azFuture azure.Future 1330 if err := json.Unmarshal(body, &azFuture); err != nil { 1331 return err 1332 } 1333 future.FutureAPI = &azFuture 1334 future.Result = future.result 1335 return nil 1336} 1337 1338// result is the default implementation for CloudServicesDeleteFuture.Result. 1339func (future *CloudServicesDeleteFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { 1340 var done bool 1341 done, err = future.DoneWithContext(context.Background(), client) 1342 if err != nil { 1343 err = autorest.NewErrorWithError(err, "compute.CloudServicesDeleteFuture", "Result", future.Response(), "Polling failure") 1344 return 1345 } 1346 if !done { 1347 ar.Response = future.Response() 1348 err = azure.NewAsyncOpIncompleteError("compute.CloudServicesDeleteFuture") 1349 return 1350 } 1351 ar.Response = future.Response() 1352 return 1353} 1354 1355// CloudServicesDeleteInstancesFuture an abstraction for monitoring and retrieving the results of a 1356// long-running operation. 1357type CloudServicesDeleteInstancesFuture struct { 1358 azure.FutureAPI 1359 // Result returns the result of the asynchronous operation. 1360 // If the operation has not completed it will return an error. 1361 Result func(CloudServicesClient) (autorest.Response, error) 1362} 1363 1364// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1365func (future *CloudServicesDeleteInstancesFuture) UnmarshalJSON(body []byte) error { 1366 var azFuture azure.Future 1367 if err := json.Unmarshal(body, &azFuture); err != nil { 1368 return err 1369 } 1370 future.FutureAPI = &azFuture 1371 future.Result = future.result 1372 return nil 1373} 1374 1375// result is the default implementation for CloudServicesDeleteInstancesFuture.Result. 1376func (future *CloudServicesDeleteInstancesFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { 1377 var done bool 1378 done, err = future.DoneWithContext(context.Background(), client) 1379 if err != nil { 1380 err = autorest.NewErrorWithError(err, "compute.CloudServicesDeleteInstancesFuture", "Result", future.Response(), "Polling failure") 1381 return 1382 } 1383 if !done { 1384 ar.Response = future.Response() 1385 err = azure.NewAsyncOpIncompleteError("compute.CloudServicesDeleteInstancesFuture") 1386 return 1387 } 1388 ar.Response = future.Response() 1389 return 1390} 1391 1392// CloudServicesPowerOffFuture an abstraction for monitoring and retrieving the results of a long-running 1393// operation. 1394type CloudServicesPowerOffFuture 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(CloudServicesClient) (autorest.Response, error) 1399} 1400 1401// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1402func (future *CloudServicesPowerOffFuture) 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 CloudServicesPowerOffFuture.Result. 1413func (future *CloudServicesPowerOffFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { 1414 var done bool 1415 done, err = future.DoneWithContext(context.Background(), client) 1416 if err != nil { 1417 err = autorest.NewErrorWithError(err, "compute.CloudServicesPowerOffFuture", "Result", future.Response(), "Polling failure") 1418 return 1419 } 1420 if !done { 1421 ar.Response = future.Response() 1422 err = azure.NewAsyncOpIncompleteError("compute.CloudServicesPowerOffFuture") 1423 return 1424 } 1425 ar.Response = future.Response() 1426 return 1427} 1428 1429// CloudServicesRebuildFuture an abstraction for monitoring and retrieving the results of a long-running 1430// operation. 1431type CloudServicesRebuildFuture struct { 1432 azure.FutureAPI 1433 // Result returns the result of the asynchronous operation. 1434 // If the operation has not completed it will return an error. 1435 Result func(CloudServicesClient) (autorest.Response, error) 1436} 1437 1438// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1439func (future *CloudServicesRebuildFuture) UnmarshalJSON(body []byte) error { 1440 var azFuture azure.Future 1441 if err := json.Unmarshal(body, &azFuture); err != nil { 1442 return err 1443 } 1444 future.FutureAPI = &azFuture 1445 future.Result = future.result 1446 return nil 1447} 1448 1449// result is the default implementation for CloudServicesRebuildFuture.Result. 1450func (future *CloudServicesRebuildFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { 1451 var done bool 1452 done, err = future.DoneWithContext(context.Background(), client) 1453 if err != nil { 1454 err = autorest.NewErrorWithError(err, "compute.CloudServicesRebuildFuture", "Result", future.Response(), "Polling failure") 1455 return 1456 } 1457 if !done { 1458 ar.Response = future.Response() 1459 err = azure.NewAsyncOpIncompleteError("compute.CloudServicesRebuildFuture") 1460 return 1461 } 1462 ar.Response = future.Response() 1463 return 1464} 1465 1466// CloudServicesReimageFuture an abstraction for monitoring and retrieving the results of a long-running 1467// operation. 1468type CloudServicesReimageFuture struct { 1469 azure.FutureAPI 1470 // Result returns the result of the asynchronous operation. 1471 // If the operation has not completed it will return an error. 1472 Result func(CloudServicesClient) (autorest.Response, error) 1473} 1474 1475// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1476func (future *CloudServicesReimageFuture) UnmarshalJSON(body []byte) error { 1477 var azFuture azure.Future 1478 if err := json.Unmarshal(body, &azFuture); err != nil { 1479 return err 1480 } 1481 future.FutureAPI = &azFuture 1482 future.Result = future.result 1483 return nil 1484} 1485 1486// result is the default implementation for CloudServicesReimageFuture.Result. 1487func (future *CloudServicesReimageFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { 1488 var done bool 1489 done, err = future.DoneWithContext(context.Background(), client) 1490 if err != nil { 1491 err = autorest.NewErrorWithError(err, "compute.CloudServicesReimageFuture", "Result", future.Response(), "Polling failure") 1492 return 1493 } 1494 if !done { 1495 ar.Response = future.Response() 1496 err = azure.NewAsyncOpIncompleteError("compute.CloudServicesReimageFuture") 1497 return 1498 } 1499 ar.Response = future.Response() 1500 return 1501} 1502 1503// CloudServicesRestartFuture an abstraction for monitoring and retrieving the results of a long-running 1504// operation. 1505type CloudServicesRestartFuture struct { 1506 azure.FutureAPI 1507 // Result returns the result of the asynchronous operation. 1508 // If the operation has not completed it will return an error. 1509 Result func(CloudServicesClient) (autorest.Response, error) 1510} 1511 1512// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1513func (future *CloudServicesRestartFuture) UnmarshalJSON(body []byte) error { 1514 var azFuture azure.Future 1515 if err := json.Unmarshal(body, &azFuture); err != nil { 1516 return err 1517 } 1518 future.FutureAPI = &azFuture 1519 future.Result = future.result 1520 return nil 1521} 1522 1523// result is the default implementation for CloudServicesRestartFuture.Result. 1524func (future *CloudServicesRestartFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { 1525 var done bool 1526 done, err = future.DoneWithContext(context.Background(), client) 1527 if err != nil { 1528 err = autorest.NewErrorWithError(err, "compute.CloudServicesRestartFuture", "Result", future.Response(), "Polling failure") 1529 return 1530 } 1531 if !done { 1532 ar.Response = future.Response() 1533 err = azure.NewAsyncOpIncompleteError("compute.CloudServicesRestartFuture") 1534 return 1535 } 1536 ar.Response = future.Response() 1537 return 1538} 1539 1540// CloudServicesStartFuture an abstraction for monitoring and retrieving the results of a long-running 1541// operation. 1542type CloudServicesStartFuture struct { 1543 azure.FutureAPI 1544 // Result returns the result of the asynchronous operation. 1545 // If the operation has not completed it will return an error. 1546 Result func(CloudServicesClient) (autorest.Response, error) 1547} 1548 1549// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1550func (future *CloudServicesStartFuture) UnmarshalJSON(body []byte) error { 1551 var azFuture azure.Future 1552 if err := json.Unmarshal(body, &azFuture); err != nil { 1553 return err 1554 } 1555 future.FutureAPI = &azFuture 1556 future.Result = future.result 1557 return nil 1558} 1559 1560// result is the default implementation for CloudServicesStartFuture.Result. 1561func (future *CloudServicesStartFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { 1562 var done bool 1563 done, err = future.DoneWithContext(context.Background(), client) 1564 if err != nil { 1565 err = autorest.NewErrorWithError(err, "compute.CloudServicesStartFuture", "Result", future.Response(), "Polling failure") 1566 return 1567 } 1568 if !done { 1569 ar.Response = future.Response() 1570 err = azure.NewAsyncOpIncompleteError("compute.CloudServicesStartFuture") 1571 return 1572 } 1573 ar.Response = future.Response() 1574 return 1575} 1576 1577// CloudServicesUpdateDomainWalkUpdateDomainFuture an abstraction for monitoring and retrieving the results 1578// of a long-running operation. 1579type CloudServicesUpdateDomainWalkUpdateDomainFuture struct { 1580 azure.FutureAPI 1581 // Result returns the result of the asynchronous operation. 1582 // If the operation has not completed it will return an error. 1583 Result func(CloudServicesUpdateDomainClient) (autorest.Response, error) 1584} 1585 1586// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1587func (future *CloudServicesUpdateDomainWalkUpdateDomainFuture) UnmarshalJSON(body []byte) error { 1588 var azFuture azure.Future 1589 if err := json.Unmarshal(body, &azFuture); err != nil { 1590 return err 1591 } 1592 future.FutureAPI = &azFuture 1593 future.Result = future.result 1594 return nil 1595} 1596 1597// result is the default implementation for CloudServicesUpdateDomainWalkUpdateDomainFuture.Result. 1598func (future *CloudServicesUpdateDomainWalkUpdateDomainFuture) result(client CloudServicesUpdateDomainClient) (ar autorest.Response, err error) { 1599 var done bool 1600 done, err = future.DoneWithContext(context.Background(), client) 1601 if err != nil { 1602 err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateDomainWalkUpdateDomainFuture", "Result", future.Response(), "Polling failure") 1603 return 1604 } 1605 if !done { 1606 ar.Response = future.Response() 1607 err = azure.NewAsyncOpIncompleteError("compute.CloudServicesUpdateDomainWalkUpdateDomainFuture") 1608 return 1609 } 1610 ar.Response = future.Response() 1611 return 1612} 1613 1614// CloudServicesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 1615// operation. 1616type CloudServicesUpdateFuture struct { 1617 azure.FutureAPI 1618 // Result returns the result of the asynchronous operation. 1619 // If the operation has not completed it will return an error. 1620 Result func(CloudServicesClient) (CloudService, error) 1621} 1622 1623// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1624func (future *CloudServicesUpdateFuture) UnmarshalJSON(body []byte) error { 1625 var azFuture azure.Future 1626 if err := json.Unmarshal(body, &azFuture); err != nil { 1627 return err 1628 } 1629 future.FutureAPI = &azFuture 1630 future.Result = future.result 1631 return nil 1632} 1633 1634// result is the default implementation for CloudServicesUpdateFuture.Result. 1635func (future *CloudServicesUpdateFuture) result(client CloudServicesClient) (cs CloudService, err error) { 1636 var done bool 1637 done, err = future.DoneWithContext(context.Background(), client) 1638 if err != nil { 1639 err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateFuture", "Result", future.Response(), "Polling failure") 1640 return 1641 } 1642 if !done { 1643 cs.Response.Response = future.Response() 1644 err = azure.NewAsyncOpIncompleteError("compute.CloudServicesUpdateFuture") 1645 return 1646 } 1647 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1648 if cs.Response.Response, err = future.GetResult(sender); err == nil && cs.Response.Response.StatusCode != http.StatusNoContent { 1649 cs, err = client.UpdateResponder(cs.Response.Response) 1650 if err != nil { 1651 err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateFuture", "Result", cs.Response.Response, "Failure responding to request") 1652 } 1653 } 1654 return 1655} 1656 1657// CloudServiceUpdate ... 1658type CloudServiceUpdate struct { 1659 // Tags - Resource tags 1660 Tags map[string]*string `json:"tags"` 1661} 1662 1663// MarshalJSON is the custom marshaler for CloudServiceUpdate. 1664func (csu CloudServiceUpdate) MarshalJSON() ([]byte, error) { 1665 objectMap := make(map[string]interface{}) 1666 if csu.Tags != nil { 1667 objectMap["tags"] = csu.Tags 1668 } 1669 return json.Marshal(objectMap) 1670} 1671 1672// CloudServiceVaultAndSecretReference ... 1673type CloudServiceVaultAndSecretReference struct { 1674 SourceVault *SubResource `json:"sourceVault,omitempty"` 1675 SecretURL *string `json:"secretUrl,omitempty"` 1676} 1677 1678// CloudServiceVaultCertificate describes a single certificate reference in a Key Vault, and where the 1679// certificate should reside on the role instance. 1680type CloudServiceVaultCertificate struct { 1681 // CertificateURL - This is the URL of a certificate that has been uploaded to Key Vault as a secret. 1682 CertificateURL *string `json:"certificateUrl,omitempty"` 1683} 1684 1685// CloudServiceVaultSecretGroup describes a set of certificates which are all in the same Key Vault. 1686type CloudServiceVaultSecretGroup struct { 1687 // SourceVault - The relative URL of the Key Vault containing all of the certificates in VaultCertificates. 1688 SourceVault *SubResource `json:"sourceVault,omitempty"` 1689 // VaultCertificates - The list of key vault references in SourceVault which contain certificates. 1690 VaultCertificates *[]CloudServiceVaultCertificate `json:"vaultCertificates,omitempty"` 1691} 1692 1693// CreationData data used when creating a disk. 1694type CreationData struct { 1695 // CreateOption - This enumerates the possible sources of a disk's creation. Possible values include: 'DiskCreateOptionEmpty', 'DiskCreateOptionAttach', 'DiskCreateOptionFromImage', 'DiskCreateOptionImport', 'DiskCreateOptionCopy', 'DiskCreateOptionRestore', 'DiskCreateOptionUpload' 1696 CreateOption DiskCreateOption `json:"createOption,omitempty"` 1697 // StorageAccountID - Required if createOption is Import. The Azure Resource Manager identifier of the storage account containing the blob to import as a disk. 1698 StorageAccountID *string `json:"storageAccountId,omitempty"` 1699 // ImageReference - Disk source information. 1700 ImageReference *ImageDiskReference `json:"imageReference,omitempty"` 1701 // GalleryImageReference - Required if creating from a Gallery Image. The id of the ImageDiskReference will be the ARM id of the shared galley image version from which to create a disk. 1702 GalleryImageReference *ImageDiskReference `json:"galleryImageReference,omitempty"` 1703 // SourceURI - If createOption is Import, this is the URI of a blob to be imported into a managed disk. 1704 SourceURI *string `json:"sourceUri,omitempty"` 1705 // SourceResourceID - If createOption is Copy, this is the ARM id of the source snapshot or disk. 1706 SourceResourceID *string `json:"sourceResourceId,omitempty"` 1707 // SourceUniqueID - READ-ONLY; If this field is set, this is the unique id identifying the source of this resource. 1708 SourceUniqueID *string `json:"sourceUniqueId,omitempty"` 1709 // 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). 1710 UploadSizeBytes *int64 `json:"uploadSizeBytes,omitempty"` 1711 // LogicalSectorSize - Logical sector size in bytes for Ultra disks. Supported values are 512 ad 4096. 4096 is the default. 1712 LogicalSectorSize *int32 `json:"logicalSectorSize,omitempty"` 1713} 1714 1715// MarshalJSON is the custom marshaler for CreationData. 1716func (cd CreationData) MarshalJSON() ([]byte, error) { 1717 objectMap := make(map[string]interface{}) 1718 if cd.CreateOption != "" { 1719 objectMap["createOption"] = cd.CreateOption 1720 } 1721 if cd.StorageAccountID != nil { 1722 objectMap["storageAccountId"] = cd.StorageAccountID 1723 } 1724 if cd.ImageReference != nil { 1725 objectMap["imageReference"] = cd.ImageReference 1726 } 1727 if cd.GalleryImageReference != nil { 1728 objectMap["galleryImageReference"] = cd.GalleryImageReference 1729 } 1730 if cd.SourceURI != nil { 1731 objectMap["sourceUri"] = cd.SourceURI 1732 } 1733 if cd.SourceResourceID != nil { 1734 objectMap["sourceResourceId"] = cd.SourceResourceID 1735 } 1736 if cd.UploadSizeBytes != nil { 1737 objectMap["uploadSizeBytes"] = cd.UploadSizeBytes 1738 } 1739 if cd.LogicalSectorSize != nil { 1740 objectMap["logicalSectorSize"] = cd.LogicalSectorSize 1741 } 1742 return json.Marshal(objectMap) 1743} 1744 1745// DataDisk describes a data disk. 1746type DataDisk struct { 1747 // 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. 1748 Lun *int32 `json:"lun,omitempty"` 1749 // Name - The disk name. 1750 Name *string `json:"name,omitempty"` 1751 // Vhd - The virtual hard disk. 1752 Vhd *VirtualHardDisk `json:"vhd,omitempty"` 1753 // 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. 1754 Image *VirtualHardDisk `json:"image,omitempty"` 1755 // 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' 1756 Caching CachingTypes `json:"caching,omitempty"` 1757 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 1758 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 1759 // 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' 1760 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 1761 // 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 1762 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 1763 // ManagedDisk - The managed disk parameters. 1764 ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` 1765 // ToBeDetached - Specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset 1766 ToBeDetached *bool `json:"toBeDetached,omitempty"` 1767 // 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. 1768 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 1769 // 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. 1770 DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` 1771 // DetachOption - Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the virtual machine. Supported values: **ForceDetach**. <br><br> detachOption: **ForceDetach** is applicable only for managed data disks. If a previous detachment attempt of the data disk did not complete due to an unexpected failure from the virtual machine and the disk is still not released then use force-detach as a last resort option to detach the disk forcibly from the VM. All writes might not have been flushed when using this detach behavior. <br><br> This feature is still in preview mode and is not supported for VirtualMachineScaleSet. To force-detach a data disk update toBeDetached to 'true' along with setting detachOption: 'ForceDetach'. Possible values include: 'DiskDetachOptionTypesForceDetach' 1772 DetachOption DiskDetachOptionTypes `json:"detachOption,omitempty"` 1773 // DeleteOption - Specifies whether data disk should be deleted or detached upon VM deletion.<br><br> Possible values: <br><br> **Delete** If this value is used, the data disk is deleted when VM is deleted.<br><br> **Detach** If this value is used, the data disk is retained after VM is deleted.<br><br> The default value is set to **detach**. Possible values include: 'DiskDeleteOptionTypesDelete', 'DiskDeleteOptionTypesDetach' 1774 DeleteOption DiskDeleteOptionTypes `json:"deleteOption,omitempty"` 1775} 1776 1777// MarshalJSON is the custom marshaler for DataDisk. 1778func (dd DataDisk) MarshalJSON() ([]byte, error) { 1779 objectMap := make(map[string]interface{}) 1780 if dd.Lun != nil { 1781 objectMap["lun"] = dd.Lun 1782 } 1783 if dd.Name != nil { 1784 objectMap["name"] = dd.Name 1785 } 1786 if dd.Vhd != nil { 1787 objectMap["vhd"] = dd.Vhd 1788 } 1789 if dd.Image != nil { 1790 objectMap["image"] = dd.Image 1791 } 1792 if dd.Caching != "" { 1793 objectMap["caching"] = dd.Caching 1794 } 1795 if dd.WriteAcceleratorEnabled != nil { 1796 objectMap["writeAcceleratorEnabled"] = dd.WriteAcceleratorEnabled 1797 } 1798 if dd.CreateOption != "" { 1799 objectMap["createOption"] = dd.CreateOption 1800 } 1801 if dd.DiskSizeGB != nil { 1802 objectMap["diskSizeGB"] = dd.DiskSizeGB 1803 } 1804 if dd.ManagedDisk != nil { 1805 objectMap["managedDisk"] = dd.ManagedDisk 1806 } 1807 if dd.ToBeDetached != nil { 1808 objectMap["toBeDetached"] = dd.ToBeDetached 1809 } 1810 if dd.DetachOption != "" { 1811 objectMap["detachOption"] = dd.DetachOption 1812 } 1813 if dd.DeleteOption != "" { 1814 objectMap["deleteOption"] = dd.DeleteOption 1815 } 1816 return json.Marshal(objectMap) 1817} 1818 1819// DataDiskImage contains the data disk images information. 1820type DataDiskImage struct { 1821 // 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. 1822 Lun *int32 `json:"lun,omitempty"` 1823} 1824 1825// MarshalJSON is the custom marshaler for DataDiskImage. 1826func (ddi DataDiskImage) MarshalJSON() ([]byte, error) { 1827 objectMap := make(map[string]interface{}) 1828 return json.Marshal(objectMap) 1829} 1830 1831// DataDiskImageEncryption contains encryption settings for a data disk image. 1832type DataDiskImageEncryption struct { 1833 // Lun - This property specifies the logical unit number of the data disk. This value is used to identify data disks within the Virtual Machine and therefore must be unique for each data disk attached to the Virtual Machine. 1834 Lun *int32 `json:"lun,omitempty"` 1835 // DiskEncryptionSetID - A relative URI containing the resource ID of the disk encryption set. 1836 DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` 1837} 1838 1839// DedicatedHost specifies information about the Dedicated host. 1840type DedicatedHost struct { 1841 autorest.Response `json:"-"` 1842 *DedicatedHostProperties `json:"properties,omitempty"` 1843 // 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. 1844 Sku *Sku `json:"sku,omitempty"` 1845 // ID - READ-ONLY; Resource Id 1846 ID *string `json:"id,omitempty"` 1847 // Name - READ-ONLY; Resource name 1848 Name *string `json:"name,omitempty"` 1849 // Type - READ-ONLY; Resource type 1850 Type *string `json:"type,omitempty"` 1851 // Location - Resource location 1852 Location *string `json:"location,omitempty"` 1853 // Tags - Resource tags 1854 Tags map[string]*string `json:"tags"` 1855} 1856 1857// MarshalJSON is the custom marshaler for DedicatedHost. 1858func (dh DedicatedHost) MarshalJSON() ([]byte, error) { 1859 objectMap := make(map[string]interface{}) 1860 if dh.DedicatedHostProperties != nil { 1861 objectMap["properties"] = dh.DedicatedHostProperties 1862 } 1863 if dh.Sku != nil { 1864 objectMap["sku"] = dh.Sku 1865 } 1866 if dh.Location != nil { 1867 objectMap["location"] = dh.Location 1868 } 1869 if dh.Tags != nil { 1870 objectMap["tags"] = dh.Tags 1871 } 1872 return json.Marshal(objectMap) 1873} 1874 1875// UnmarshalJSON is the custom unmarshaler for DedicatedHost struct. 1876func (dh *DedicatedHost) UnmarshalJSON(body []byte) error { 1877 var m map[string]*json.RawMessage 1878 err := json.Unmarshal(body, &m) 1879 if err != nil { 1880 return err 1881 } 1882 for k, v := range m { 1883 switch k { 1884 case "properties": 1885 if v != nil { 1886 var dedicatedHostProperties DedicatedHostProperties 1887 err = json.Unmarshal(*v, &dedicatedHostProperties) 1888 if err != nil { 1889 return err 1890 } 1891 dh.DedicatedHostProperties = &dedicatedHostProperties 1892 } 1893 case "sku": 1894 if v != nil { 1895 var sku Sku 1896 err = json.Unmarshal(*v, &sku) 1897 if err != nil { 1898 return err 1899 } 1900 dh.Sku = &sku 1901 } 1902 case "id": 1903 if v != nil { 1904 var ID string 1905 err = json.Unmarshal(*v, &ID) 1906 if err != nil { 1907 return err 1908 } 1909 dh.ID = &ID 1910 } 1911 case "name": 1912 if v != nil { 1913 var name string 1914 err = json.Unmarshal(*v, &name) 1915 if err != nil { 1916 return err 1917 } 1918 dh.Name = &name 1919 } 1920 case "type": 1921 if v != nil { 1922 var typeVar string 1923 err = json.Unmarshal(*v, &typeVar) 1924 if err != nil { 1925 return err 1926 } 1927 dh.Type = &typeVar 1928 } 1929 case "location": 1930 if v != nil { 1931 var location string 1932 err = json.Unmarshal(*v, &location) 1933 if err != nil { 1934 return err 1935 } 1936 dh.Location = &location 1937 } 1938 case "tags": 1939 if v != nil { 1940 var tags map[string]*string 1941 err = json.Unmarshal(*v, &tags) 1942 if err != nil { 1943 return err 1944 } 1945 dh.Tags = tags 1946 } 1947 } 1948 } 1949 1950 return nil 1951} 1952 1953// DedicatedHostAllocatableVM represents the dedicated host unutilized capacity in terms of a specific VM 1954// size. 1955type DedicatedHostAllocatableVM struct { 1956 // VMSize - VM size in terms of which the unutilized capacity is represented. 1957 VMSize *string `json:"vmSize,omitempty"` 1958 // Count - Maximum number of VMs of size vmSize that can fit in the dedicated host's remaining capacity. 1959 Count *float64 `json:"count,omitempty"` 1960} 1961 1962// DedicatedHostAvailableCapacity dedicated host unutilized capacity. 1963type DedicatedHostAvailableCapacity struct { 1964 // 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. 1965 AllocatableVMs *[]DedicatedHostAllocatableVM `json:"allocatableVMs,omitempty"` 1966} 1967 1968// DedicatedHostGroup specifies information about the dedicated host group that the dedicated hosts should 1969// be assigned to. <br><br> Currently, a dedicated host can only be added to a dedicated host group at 1970// creation time. An existing dedicated host cannot be added to another dedicated host group. 1971type DedicatedHostGroup struct { 1972 autorest.Response `json:"-"` 1973 *DedicatedHostGroupProperties `json:"properties,omitempty"` 1974 // 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. 1975 Zones *[]string `json:"zones,omitempty"` 1976 // ID - READ-ONLY; Resource Id 1977 ID *string `json:"id,omitempty"` 1978 // Name - READ-ONLY; Resource name 1979 Name *string `json:"name,omitempty"` 1980 // Type - READ-ONLY; Resource type 1981 Type *string `json:"type,omitempty"` 1982 // Location - Resource location 1983 Location *string `json:"location,omitempty"` 1984 // Tags - Resource tags 1985 Tags map[string]*string `json:"tags"` 1986} 1987 1988// MarshalJSON is the custom marshaler for DedicatedHostGroup. 1989func (dhg DedicatedHostGroup) MarshalJSON() ([]byte, error) { 1990 objectMap := make(map[string]interface{}) 1991 if dhg.DedicatedHostGroupProperties != nil { 1992 objectMap["properties"] = dhg.DedicatedHostGroupProperties 1993 } 1994 if dhg.Zones != nil { 1995 objectMap["zones"] = dhg.Zones 1996 } 1997 if dhg.Location != nil { 1998 objectMap["location"] = dhg.Location 1999 } 2000 if dhg.Tags != nil { 2001 objectMap["tags"] = dhg.Tags 2002 } 2003 return json.Marshal(objectMap) 2004} 2005 2006// UnmarshalJSON is the custom unmarshaler for DedicatedHostGroup struct. 2007func (dhg *DedicatedHostGroup) UnmarshalJSON(body []byte) error { 2008 var m map[string]*json.RawMessage 2009 err := json.Unmarshal(body, &m) 2010 if err != nil { 2011 return err 2012 } 2013 for k, v := range m { 2014 switch k { 2015 case "properties": 2016 if v != nil { 2017 var dedicatedHostGroupProperties DedicatedHostGroupProperties 2018 err = json.Unmarshal(*v, &dedicatedHostGroupProperties) 2019 if err != nil { 2020 return err 2021 } 2022 dhg.DedicatedHostGroupProperties = &dedicatedHostGroupProperties 2023 } 2024 case "zones": 2025 if v != nil { 2026 var zones []string 2027 err = json.Unmarshal(*v, &zones) 2028 if err != nil { 2029 return err 2030 } 2031 dhg.Zones = &zones 2032 } 2033 case "id": 2034 if v != nil { 2035 var ID string 2036 err = json.Unmarshal(*v, &ID) 2037 if err != nil { 2038 return err 2039 } 2040 dhg.ID = &ID 2041 } 2042 case "name": 2043 if v != nil { 2044 var name string 2045 err = json.Unmarshal(*v, &name) 2046 if err != nil { 2047 return err 2048 } 2049 dhg.Name = &name 2050 } 2051 case "type": 2052 if v != nil { 2053 var typeVar string 2054 err = json.Unmarshal(*v, &typeVar) 2055 if err != nil { 2056 return err 2057 } 2058 dhg.Type = &typeVar 2059 } 2060 case "location": 2061 if v != nil { 2062 var location string 2063 err = json.Unmarshal(*v, &location) 2064 if err != nil { 2065 return err 2066 } 2067 dhg.Location = &location 2068 } 2069 case "tags": 2070 if v != nil { 2071 var tags map[string]*string 2072 err = json.Unmarshal(*v, &tags) 2073 if err != nil { 2074 return err 2075 } 2076 dhg.Tags = tags 2077 } 2078 } 2079 } 2080 2081 return nil 2082} 2083 2084// DedicatedHostGroupInstanceView ... 2085type DedicatedHostGroupInstanceView struct { 2086 // Hosts - List of instance view of the dedicated hosts under the dedicated host group. 2087 Hosts *[]DedicatedHostInstanceViewWithName `json:"hosts,omitempty"` 2088} 2089 2090// DedicatedHostGroupListResult the List Dedicated Host Group with resource group response. 2091type DedicatedHostGroupListResult struct { 2092 autorest.Response `json:"-"` 2093 // Value - The list of dedicated host groups 2094 Value *[]DedicatedHostGroup `json:"value,omitempty"` 2095 // 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. 2096 NextLink *string `json:"nextLink,omitempty"` 2097} 2098 2099// DedicatedHostGroupListResultIterator provides access to a complete listing of DedicatedHostGroup values. 2100type DedicatedHostGroupListResultIterator struct { 2101 i int 2102 page DedicatedHostGroupListResultPage 2103} 2104 2105// NextWithContext advances to the next value. If there was an error making 2106// the request the iterator does not advance and the error is returned. 2107func (iter *DedicatedHostGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { 2108 if tracing.IsEnabled() { 2109 ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupListResultIterator.NextWithContext") 2110 defer func() { 2111 sc := -1 2112 if iter.Response().Response.Response != nil { 2113 sc = iter.Response().Response.Response.StatusCode 2114 } 2115 tracing.EndSpan(ctx, sc, err) 2116 }() 2117 } 2118 iter.i++ 2119 if iter.i < len(iter.page.Values()) { 2120 return nil 2121 } 2122 err = iter.page.NextWithContext(ctx) 2123 if err != nil { 2124 iter.i-- 2125 return err 2126 } 2127 iter.i = 0 2128 return nil 2129} 2130 2131// Next advances to the next value. If there was an error making 2132// the request the iterator does not advance and the error is returned. 2133// Deprecated: Use NextWithContext() instead. 2134func (iter *DedicatedHostGroupListResultIterator) Next() error { 2135 return iter.NextWithContext(context.Background()) 2136} 2137 2138// NotDone returns true if the enumeration should be started or is not yet complete. 2139func (iter DedicatedHostGroupListResultIterator) NotDone() bool { 2140 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2141} 2142 2143// Response returns the raw server response from the last page request. 2144func (iter DedicatedHostGroupListResultIterator) Response() DedicatedHostGroupListResult { 2145 return iter.page.Response() 2146} 2147 2148// Value returns the current value or a zero-initialized value if the 2149// iterator has advanced beyond the end of the collection. 2150func (iter DedicatedHostGroupListResultIterator) Value() DedicatedHostGroup { 2151 if !iter.page.NotDone() { 2152 return DedicatedHostGroup{} 2153 } 2154 return iter.page.Values()[iter.i] 2155} 2156 2157// Creates a new instance of the DedicatedHostGroupListResultIterator type. 2158func NewDedicatedHostGroupListResultIterator(page DedicatedHostGroupListResultPage) DedicatedHostGroupListResultIterator { 2159 return DedicatedHostGroupListResultIterator{page: page} 2160} 2161 2162// IsEmpty returns true if the ListResult contains no values. 2163func (dhglr DedicatedHostGroupListResult) IsEmpty() bool { 2164 return dhglr.Value == nil || len(*dhglr.Value) == 0 2165} 2166 2167// hasNextLink returns true if the NextLink is not empty. 2168func (dhglr DedicatedHostGroupListResult) hasNextLink() bool { 2169 return dhglr.NextLink != nil && len(*dhglr.NextLink) != 0 2170} 2171 2172// dedicatedHostGroupListResultPreparer prepares a request to retrieve the next set of results. 2173// It returns nil if no more results exist. 2174func (dhglr DedicatedHostGroupListResult) dedicatedHostGroupListResultPreparer(ctx context.Context) (*http.Request, error) { 2175 if !dhglr.hasNextLink() { 2176 return nil, nil 2177 } 2178 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2179 autorest.AsJSON(), 2180 autorest.AsGet(), 2181 autorest.WithBaseURL(to.String(dhglr.NextLink))) 2182} 2183 2184// DedicatedHostGroupListResultPage contains a page of DedicatedHostGroup values. 2185type DedicatedHostGroupListResultPage struct { 2186 fn func(context.Context, DedicatedHostGroupListResult) (DedicatedHostGroupListResult, error) 2187 dhglr DedicatedHostGroupListResult 2188} 2189 2190// NextWithContext advances to the next page of values. If there was an error making 2191// the request the page does not advance and the error is returned. 2192func (page *DedicatedHostGroupListResultPage) NextWithContext(ctx context.Context) (err error) { 2193 if tracing.IsEnabled() { 2194 ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupListResultPage.NextWithContext") 2195 defer func() { 2196 sc := -1 2197 if page.Response().Response.Response != nil { 2198 sc = page.Response().Response.Response.StatusCode 2199 } 2200 tracing.EndSpan(ctx, sc, err) 2201 }() 2202 } 2203 for { 2204 next, err := page.fn(ctx, page.dhglr) 2205 if err != nil { 2206 return err 2207 } 2208 page.dhglr = next 2209 if !next.hasNextLink() || !next.IsEmpty() { 2210 break 2211 } 2212 } 2213 return nil 2214} 2215 2216// Next advances to the next page of values. If there was an error making 2217// the request the page does not advance and the error is returned. 2218// Deprecated: Use NextWithContext() instead. 2219func (page *DedicatedHostGroupListResultPage) Next() error { 2220 return page.NextWithContext(context.Background()) 2221} 2222 2223// NotDone returns true if the page enumeration should be started or is not yet complete. 2224func (page DedicatedHostGroupListResultPage) NotDone() bool { 2225 return !page.dhglr.IsEmpty() 2226} 2227 2228// Response returns the raw server response from the last page request. 2229func (page DedicatedHostGroupListResultPage) Response() DedicatedHostGroupListResult { 2230 return page.dhglr 2231} 2232 2233// Values returns the slice of values for the current page or nil if there are no values. 2234func (page DedicatedHostGroupListResultPage) Values() []DedicatedHostGroup { 2235 if page.dhglr.IsEmpty() { 2236 return nil 2237 } 2238 return *page.dhglr.Value 2239} 2240 2241// Creates a new instance of the DedicatedHostGroupListResultPage type. 2242func NewDedicatedHostGroupListResultPage(cur DedicatedHostGroupListResult, getNextPage func(context.Context, DedicatedHostGroupListResult) (DedicatedHostGroupListResult, error)) DedicatedHostGroupListResultPage { 2243 return DedicatedHostGroupListResultPage{ 2244 fn: getNextPage, 2245 dhglr: cur, 2246 } 2247} 2248 2249// DedicatedHostGroupProperties dedicated Host Group Properties. 2250type DedicatedHostGroupProperties struct { 2251 // PlatformFaultDomainCount - Number of fault domains that the host group can span. 2252 PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` 2253 // Hosts - READ-ONLY; A list of references to all dedicated hosts in the dedicated host group. 2254 Hosts *[]SubResourceReadOnly `json:"hosts,omitempty"` 2255 // 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. 2256 InstanceView *DedicatedHostGroupInstanceView `json:"instanceView,omitempty"` 2257 // 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. 2258 SupportAutomaticPlacement *bool `json:"supportAutomaticPlacement,omitempty"` 2259} 2260 2261// MarshalJSON is the custom marshaler for DedicatedHostGroupProperties. 2262func (dhgp DedicatedHostGroupProperties) MarshalJSON() ([]byte, error) { 2263 objectMap := make(map[string]interface{}) 2264 if dhgp.PlatformFaultDomainCount != nil { 2265 objectMap["platformFaultDomainCount"] = dhgp.PlatformFaultDomainCount 2266 } 2267 if dhgp.SupportAutomaticPlacement != nil { 2268 objectMap["supportAutomaticPlacement"] = dhgp.SupportAutomaticPlacement 2269 } 2270 return json.Marshal(objectMap) 2271} 2272 2273// DedicatedHostGroupUpdate specifies information about the dedicated host group that the dedicated host 2274// should be assigned to. Only tags may be updated. 2275type DedicatedHostGroupUpdate struct { 2276 *DedicatedHostGroupProperties `json:"properties,omitempty"` 2277 // 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. 2278 Zones *[]string `json:"zones,omitempty"` 2279 // Tags - Resource tags 2280 Tags map[string]*string `json:"tags"` 2281} 2282 2283// MarshalJSON is the custom marshaler for DedicatedHostGroupUpdate. 2284func (dhgu DedicatedHostGroupUpdate) MarshalJSON() ([]byte, error) { 2285 objectMap := make(map[string]interface{}) 2286 if dhgu.DedicatedHostGroupProperties != nil { 2287 objectMap["properties"] = dhgu.DedicatedHostGroupProperties 2288 } 2289 if dhgu.Zones != nil { 2290 objectMap["zones"] = dhgu.Zones 2291 } 2292 if dhgu.Tags != nil { 2293 objectMap["tags"] = dhgu.Tags 2294 } 2295 return json.Marshal(objectMap) 2296} 2297 2298// UnmarshalJSON is the custom unmarshaler for DedicatedHostGroupUpdate struct. 2299func (dhgu *DedicatedHostGroupUpdate) UnmarshalJSON(body []byte) error { 2300 var m map[string]*json.RawMessage 2301 err := json.Unmarshal(body, &m) 2302 if err != nil { 2303 return err 2304 } 2305 for k, v := range m { 2306 switch k { 2307 case "properties": 2308 if v != nil { 2309 var dedicatedHostGroupProperties DedicatedHostGroupProperties 2310 err = json.Unmarshal(*v, &dedicatedHostGroupProperties) 2311 if err != nil { 2312 return err 2313 } 2314 dhgu.DedicatedHostGroupProperties = &dedicatedHostGroupProperties 2315 } 2316 case "zones": 2317 if v != nil { 2318 var zones []string 2319 err = json.Unmarshal(*v, &zones) 2320 if err != nil { 2321 return err 2322 } 2323 dhgu.Zones = &zones 2324 } 2325 case "tags": 2326 if v != nil { 2327 var tags map[string]*string 2328 err = json.Unmarshal(*v, &tags) 2329 if err != nil { 2330 return err 2331 } 2332 dhgu.Tags = tags 2333 } 2334 } 2335 } 2336 2337 return nil 2338} 2339 2340// DedicatedHostInstanceView the instance view of a dedicated host. 2341type DedicatedHostInstanceView struct { 2342 // AssetID - READ-ONLY; Specifies the unique id of the dedicated physical machine on which the dedicated host resides. 2343 AssetID *string `json:"assetId,omitempty"` 2344 // AvailableCapacity - Unutilized capacity of the dedicated host. 2345 AvailableCapacity *DedicatedHostAvailableCapacity `json:"availableCapacity,omitempty"` 2346 // Statuses - The resource status information. 2347 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 2348} 2349 2350// MarshalJSON is the custom marshaler for DedicatedHostInstanceView. 2351func (dhiv DedicatedHostInstanceView) MarshalJSON() ([]byte, error) { 2352 objectMap := make(map[string]interface{}) 2353 if dhiv.AvailableCapacity != nil { 2354 objectMap["availableCapacity"] = dhiv.AvailableCapacity 2355 } 2356 if dhiv.Statuses != nil { 2357 objectMap["statuses"] = dhiv.Statuses 2358 } 2359 return json.Marshal(objectMap) 2360} 2361 2362// DedicatedHostInstanceViewWithName the instance view of a dedicated host that includes the name of the 2363// dedicated host. It is used for the response to the instance view of a dedicated host group. 2364type DedicatedHostInstanceViewWithName struct { 2365 // Name - READ-ONLY; The name of the dedicated host. 2366 Name *string `json:"name,omitempty"` 2367 // AssetID - READ-ONLY; Specifies the unique id of the dedicated physical machine on which the dedicated host resides. 2368 AssetID *string `json:"assetId,omitempty"` 2369 // AvailableCapacity - Unutilized capacity of the dedicated host. 2370 AvailableCapacity *DedicatedHostAvailableCapacity `json:"availableCapacity,omitempty"` 2371 // Statuses - The resource status information. 2372 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 2373} 2374 2375// MarshalJSON is the custom marshaler for DedicatedHostInstanceViewWithName. 2376func (dhivwn DedicatedHostInstanceViewWithName) MarshalJSON() ([]byte, error) { 2377 objectMap := make(map[string]interface{}) 2378 if dhivwn.AvailableCapacity != nil { 2379 objectMap["availableCapacity"] = dhivwn.AvailableCapacity 2380 } 2381 if dhivwn.Statuses != nil { 2382 objectMap["statuses"] = dhivwn.Statuses 2383 } 2384 return json.Marshal(objectMap) 2385} 2386 2387// DedicatedHostListResult the list dedicated host operation response. 2388type DedicatedHostListResult struct { 2389 autorest.Response `json:"-"` 2390 // Value - The list of dedicated hosts 2391 Value *[]DedicatedHost `json:"value,omitempty"` 2392 // NextLink - The URI to fetch the next page of dedicated hosts. Call ListNext() with this URI to fetch the next page of dedicated hosts. 2393 NextLink *string `json:"nextLink,omitempty"` 2394} 2395 2396// DedicatedHostListResultIterator provides access to a complete listing of DedicatedHost values. 2397type DedicatedHostListResultIterator struct { 2398 i int 2399 page DedicatedHostListResultPage 2400} 2401 2402// NextWithContext advances to the next value. If there was an error making 2403// the request the iterator does not advance and the error is returned. 2404func (iter *DedicatedHostListResultIterator) NextWithContext(ctx context.Context) (err error) { 2405 if tracing.IsEnabled() { 2406 ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostListResultIterator.NextWithContext") 2407 defer func() { 2408 sc := -1 2409 if iter.Response().Response.Response != nil { 2410 sc = iter.Response().Response.Response.StatusCode 2411 } 2412 tracing.EndSpan(ctx, sc, err) 2413 }() 2414 } 2415 iter.i++ 2416 if iter.i < len(iter.page.Values()) { 2417 return nil 2418 } 2419 err = iter.page.NextWithContext(ctx) 2420 if err != nil { 2421 iter.i-- 2422 return err 2423 } 2424 iter.i = 0 2425 return nil 2426} 2427 2428// Next advances to the next value. If there was an error making 2429// the request the iterator does not advance and the error is returned. 2430// Deprecated: Use NextWithContext() instead. 2431func (iter *DedicatedHostListResultIterator) Next() error { 2432 return iter.NextWithContext(context.Background()) 2433} 2434 2435// NotDone returns true if the enumeration should be started or is not yet complete. 2436func (iter DedicatedHostListResultIterator) NotDone() bool { 2437 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2438} 2439 2440// Response returns the raw server response from the last page request. 2441func (iter DedicatedHostListResultIterator) Response() DedicatedHostListResult { 2442 return iter.page.Response() 2443} 2444 2445// Value returns the current value or a zero-initialized value if the 2446// iterator has advanced beyond the end of the collection. 2447func (iter DedicatedHostListResultIterator) Value() DedicatedHost { 2448 if !iter.page.NotDone() { 2449 return DedicatedHost{} 2450 } 2451 return iter.page.Values()[iter.i] 2452} 2453 2454// Creates a new instance of the DedicatedHostListResultIterator type. 2455func NewDedicatedHostListResultIterator(page DedicatedHostListResultPage) DedicatedHostListResultIterator { 2456 return DedicatedHostListResultIterator{page: page} 2457} 2458 2459// IsEmpty returns true if the ListResult contains no values. 2460func (dhlr DedicatedHostListResult) IsEmpty() bool { 2461 return dhlr.Value == nil || len(*dhlr.Value) == 0 2462} 2463 2464// hasNextLink returns true if the NextLink is not empty. 2465func (dhlr DedicatedHostListResult) hasNextLink() bool { 2466 return dhlr.NextLink != nil && len(*dhlr.NextLink) != 0 2467} 2468 2469// dedicatedHostListResultPreparer prepares a request to retrieve the next set of results. 2470// It returns nil if no more results exist. 2471func (dhlr DedicatedHostListResult) dedicatedHostListResultPreparer(ctx context.Context) (*http.Request, error) { 2472 if !dhlr.hasNextLink() { 2473 return nil, nil 2474 } 2475 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2476 autorest.AsJSON(), 2477 autorest.AsGet(), 2478 autorest.WithBaseURL(to.String(dhlr.NextLink))) 2479} 2480 2481// DedicatedHostListResultPage contains a page of DedicatedHost values. 2482type DedicatedHostListResultPage struct { 2483 fn func(context.Context, DedicatedHostListResult) (DedicatedHostListResult, error) 2484 dhlr DedicatedHostListResult 2485} 2486 2487// NextWithContext advances to the next page of values. If there was an error making 2488// the request the page does not advance and the error is returned. 2489func (page *DedicatedHostListResultPage) NextWithContext(ctx context.Context) (err error) { 2490 if tracing.IsEnabled() { 2491 ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostListResultPage.NextWithContext") 2492 defer func() { 2493 sc := -1 2494 if page.Response().Response.Response != nil { 2495 sc = page.Response().Response.Response.StatusCode 2496 } 2497 tracing.EndSpan(ctx, sc, err) 2498 }() 2499 } 2500 for { 2501 next, err := page.fn(ctx, page.dhlr) 2502 if err != nil { 2503 return err 2504 } 2505 page.dhlr = next 2506 if !next.hasNextLink() || !next.IsEmpty() { 2507 break 2508 } 2509 } 2510 return nil 2511} 2512 2513// Next advances to the next page of values. If there was an error making 2514// the request the page does not advance and the error is returned. 2515// Deprecated: Use NextWithContext() instead. 2516func (page *DedicatedHostListResultPage) Next() error { 2517 return page.NextWithContext(context.Background()) 2518} 2519 2520// NotDone returns true if the page enumeration should be started or is not yet complete. 2521func (page DedicatedHostListResultPage) NotDone() bool { 2522 return !page.dhlr.IsEmpty() 2523} 2524 2525// Response returns the raw server response from the last page request. 2526func (page DedicatedHostListResultPage) Response() DedicatedHostListResult { 2527 return page.dhlr 2528} 2529 2530// Values returns the slice of values for the current page or nil if there are no values. 2531func (page DedicatedHostListResultPage) Values() []DedicatedHost { 2532 if page.dhlr.IsEmpty() { 2533 return nil 2534 } 2535 return *page.dhlr.Value 2536} 2537 2538// Creates a new instance of the DedicatedHostListResultPage type. 2539func NewDedicatedHostListResultPage(cur DedicatedHostListResult, getNextPage func(context.Context, DedicatedHostListResult) (DedicatedHostListResult, error)) DedicatedHostListResultPage { 2540 return DedicatedHostListResultPage{ 2541 fn: getNextPage, 2542 dhlr: cur, 2543 } 2544} 2545 2546// DedicatedHostProperties properties of the dedicated host. 2547type DedicatedHostProperties struct { 2548 // PlatformFaultDomain - Fault domain of the dedicated host within a dedicated host group. 2549 PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` 2550 // AutoReplaceOnFailure - Specifies whether the dedicated host should be replaced automatically in case of a failure. The value is defaulted to 'true' when not provided. 2551 AutoReplaceOnFailure *bool `json:"autoReplaceOnFailure,omitempty"` 2552 // 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. 2553 HostID *string `json:"hostId,omitempty"` 2554 // VirtualMachines - READ-ONLY; A list of references to all virtual machines in the Dedicated Host. 2555 VirtualMachines *[]SubResourceReadOnly `json:"virtualMachines,omitempty"` 2556 // 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' 2557 LicenseType DedicatedHostLicenseTypes `json:"licenseType,omitempty"` 2558 // ProvisioningTime - READ-ONLY; The date when the host was first provisioned. 2559 ProvisioningTime *date.Time `json:"provisioningTime,omitempty"` 2560 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 2561 ProvisioningState *string `json:"provisioningState,omitempty"` 2562 // InstanceView - READ-ONLY; The dedicated host instance view. 2563 InstanceView *DedicatedHostInstanceView `json:"instanceView,omitempty"` 2564} 2565 2566// MarshalJSON is the custom marshaler for DedicatedHostProperties. 2567func (dhp DedicatedHostProperties) MarshalJSON() ([]byte, error) { 2568 objectMap := make(map[string]interface{}) 2569 if dhp.PlatformFaultDomain != nil { 2570 objectMap["platformFaultDomain"] = dhp.PlatformFaultDomain 2571 } 2572 if dhp.AutoReplaceOnFailure != nil { 2573 objectMap["autoReplaceOnFailure"] = dhp.AutoReplaceOnFailure 2574 } 2575 if dhp.LicenseType != "" { 2576 objectMap["licenseType"] = dhp.LicenseType 2577 } 2578 return json.Marshal(objectMap) 2579} 2580 2581// DedicatedHostsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 2582// long-running operation. 2583type DedicatedHostsCreateOrUpdateFuture struct { 2584 azure.FutureAPI 2585 // Result returns the result of the asynchronous operation. 2586 // If the operation has not completed it will return an error. 2587 Result func(DedicatedHostsClient) (DedicatedHost, error) 2588} 2589 2590// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2591func (future *DedicatedHostsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 2592 var azFuture azure.Future 2593 if err := json.Unmarshal(body, &azFuture); err != nil { 2594 return err 2595 } 2596 future.FutureAPI = &azFuture 2597 future.Result = future.result 2598 return nil 2599} 2600 2601// result is the default implementation for DedicatedHostsCreateOrUpdateFuture.Result. 2602func (future *DedicatedHostsCreateOrUpdateFuture) result(client DedicatedHostsClient) (dh DedicatedHost, err error) { 2603 var done bool 2604 done, err = future.DoneWithContext(context.Background(), client) 2605 if err != nil { 2606 err = autorest.NewErrorWithError(err, "compute.DedicatedHostsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 2607 return 2608 } 2609 if !done { 2610 dh.Response.Response = future.Response() 2611 err = azure.NewAsyncOpIncompleteError("compute.DedicatedHostsCreateOrUpdateFuture") 2612 return 2613 } 2614 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2615 if dh.Response.Response, err = future.GetResult(sender); err == nil && dh.Response.Response.StatusCode != http.StatusNoContent { 2616 dh, err = client.CreateOrUpdateResponder(dh.Response.Response) 2617 if err != nil { 2618 err = autorest.NewErrorWithError(err, "compute.DedicatedHostsCreateOrUpdateFuture", "Result", dh.Response.Response, "Failure responding to request") 2619 } 2620 } 2621 return 2622} 2623 2624// DedicatedHostsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 2625// operation. 2626type DedicatedHostsDeleteFuture struct { 2627 azure.FutureAPI 2628 // Result returns the result of the asynchronous operation. 2629 // If the operation has not completed it will return an error. 2630 Result func(DedicatedHostsClient) (autorest.Response, error) 2631} 2632 2633// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2634func (future *DedicatedHostsDeleteFuture) UnmarshalJSON(body []byte) error { 2635 var azFuture azure.Future 2636 if err := json.Unmarshal(body, &azFuture); err != nil { 2637 return err 2638 } 2639 future.FutureAPI = &azFuture 2640 future.Result = future.result 2641 return nil 2642} 2643 2644// result is the default implementation for DedicatedHostsDeleteFuture.Result. 2645func (future *DedicatedHostsDeleteFuture) result(client DedicatedHostsClient) (ar autorest.Response, err error) { 2646 var done bool 2647 done, err = future.DoneWithContext(context.Background(), client) 2648 if err != nil { 2649 err = autorest.NewErrorWithError(err, "compute.DedicatedHostsDeleteFuture", "Result", future.Response(), "Polling failure") 2650 return 2651 } 2652 if !done { 2653 ar.Response = future.Response() 2654 err = azure.NewAsyncOpIncompleteError("compute.DedicatedHostsDeleteFuture") 2655 return 2656 } 2657 ar.Response = future.Response() 2658 return 2659} 2660 2661// DedicatedHostsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 2662// operation. 2663type DedicatedHostsUpdateFuture struct { 2664 azure.FutureAPI 2665 // Result returns the result of the asynchronous operation. 2666 // If the operation has not completed it will return an error. 2667 Result func(DedicatedHostsClient) (DedicatedHost, error) 2668} 2669 2670// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2671func (future *DedicatedHostsUpdateFuture) UnmarshalJSON(body []byte) error { 2672 var azFuture azure.Future 2673 if err := json.Unmarshal(body, &azFuture); err != nil { 2674 return err 2675 } 2676 future.FutureAPI = &azFuture 2677 future.Result = future.result 2678 return nil 2679} 2680 2681// result is the default implementation for DedicatedHostsUpdateFuture.Result. 2682func (future *DedicatedHostsUpdateFuture) result(client DedicatedHostsClient) (dh DedicatedHost, err error) { 2683 var done bool 2684 done, err = future.DoneWithContext(context.Background(), client) 2685 if err != nil { 2686 err = autorest.NewErrorWithError(err, "compute.DedicatedHostsUpdateFuture", "Result", future.Response(), "Polling failure") 2687 return 2688 } 2689 if !done { 2690 dh.Response.Response = future.Response() 2691 err = azure.NewAsyncOpIncompleteError("compute.DedicatedHostsUpdateFuture") 2692 return 2693 } 2694 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2695 if dh.Response.Response, err = future.GetResult(sender); err == nil && dh.Response.Response.StatusCode != http.StatusNoContent { 2696 dh, err = client.UpdateResponder(dh.Response.Response) 2697 if err != nil { 2698 err = autorest.NewErrorWithError(err, "compute.DedicatedHostsUpdateFuture", "Result", dh.Response.Response, "Failure responding to request") 2699 } 2700 } 2701 return 2702} 2703 2704// DedicatedHostUpdate specifies information about the dedicated host. Only tags, autoReplaceOnFailure and 2705// licenseType may be updated. 2706type DedicatedHostUpdate struct { 2707 *DedicatedHostProperties `json:"properties,omitempty"` 2708 // Tags - Resource tags 2709 Tags map[string]*string `json:"tags"` 2710} 2711 2712// MarshalJSON is the custom marshaler for DedicatedHostUpdate. 2713func (dhu DedicatedHostUpdate) MarshalJSON() ([]byte, error) { 2714 objectMap := make(map[string]interface{}) 2715 if dhu.DedicatedHostProperties != nil { 2716 objectMap["properties"] = dhu.DedicatedHostProperties 2717 } 2718 if dhu.Tags != nil { 2719 objectMap["tags"] = dhu.Tags 2720 } 2721 return json.Marshal(objectMap) 2722} 2723 2724// UnmarshalJSON is the custom unmarshaler for DedicatedHostUpdate struct. 2725func (dhu *DedicatedHostUpdate) UnmarshalJSON(body []byte) error { 2726 var m map[string]*json.RawMessage 2727 err := json.Unmarshal(body, &m) 2728 if err != nil { 2729 return err 2730 } 2731 for k, v := range m { 2732 switch k { 2733 case "properties": 2734 if v != nil { 2735 var dedicatedHostProperties DedicatedHostProperties 2736 err = json.Unmarshal(*v, &dedicatedHostProperties) 2737 if err != nil { 2738 return err 2739 } 2740 dhu.DedicatedHostProperties = &dedicatedHostProperties 2741 } 2742 case "tags": 2743 if v != nil { 2744 var tags map[string]*string 2745 err = json.Unmarshal(*v, &tags) 2746 if err != nil { 2747 return err 2748 } 2749 dhu.Tags = tags 2750 } 2751 } 2752 } 2753 2754 return nil 2755} 2756 2757// DiagnosticsProfile specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2758// 2015-06-15. 2759type DiagnosticsProfile struct { 2760 // 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. 2761 BootDiagnostics *BootDiagnostics `json:"bootDiagnostics,omitempty"` 2762} 2763 2764// DiffDiskSettings describes the parameters of ephemeral disk settings that can be specified for operating 2765// system disk. <br><br> NOTE: The ephemeral disk settings can only be specified for managed disk. 2766type DiffDiskSettings struct { 2767 // Option - Specifies the ephemeral disk settings for operating system disk. Possible values include: 'DiffDiskOptionsLocal' 2768 Option DiffDiskOptions `json:"option,omitempty"` 2769 // 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/azure/virtual-machines/windows/sizes and Linux VM at https://docs.microsoft.com/azure/virtual-machines/linux/sizes to check which VM sizes exposes a cache disk. Possible values include: 'DiffDiskPlacementCacheDisk', 'DiffDiskPlacementResourceDisk' 2770 Placement DiffDiskPlacement `json:"placement,omitempty"` 2771} 2772 2773// Disallowed describes the disallowed disk types. 2774type Disallowed struct { 2775 // DiskTypes - A list of disk types. 2776 DiskTypes *[]string `json:"diskTypes,omitempty"` 2777} 2778 2779// DisallowedConfiguration specifies the disallowed configuration for a virtual machine image. 2780type DisallowedConfiguration struct { 2781 // VMDiskType - VM disk types which are disallowed. Possible values include: 'VMDiskTypesNone', 'VMDiskTypesUnmanaged' 2782 VMDiskType VMDiskTypes `json:"vmDiskType,omitempty"` 2783} 2784 2785// Disk disk resource. 2786type Disk struct { 2787 autorest.Response `json:"-"` 2788 // ManagedBy - READ-ONLY; A relative URI containing the ID of the VM that has the disk attached. 2789 ManagedBy *string `json:"managedBy,omitempty"` 2790 // ManagedByExtended - READ-ONLY; List of relative URIs containing the IDs of the VMs that have the disk attached. maxShares should be set to a value greater than one for disks to allow attaching them to multiple VMs. 2791 ManagedByExtended *[]string `json:"managedByExtended,omitempty"` 2792 Sku *DiskSku `json:"sku,omitempty"` 2793 // Zones - The Logical zone list for Disk. 2794 Zones *[]string `json:"zones,omitempty"` 2795 // ExtendedLocation - The extended location where the disk will be created. Extended location cannot be changed. 2796 ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` 2797 *DiskProperties `json:"properties,omitempty"` 2798 // ID - READ-ONLY; Resource Id 2799 ID *string `json:"id,omitempty"` 2800 // Name - READ-ONLY; Resource name 2801 Name *string `json:"name,omitempty"` 2802 // Type - READ-ONLY; Resource type 2803 Type *string `json:"type,omitempty"` 2804 // Location - Resource location 2805 Location *string `json:"location,omitempty"` 2806 // Tags - Resource tags 2807 Tags map[string]*string `json:"tags"` 2808} 2809 2810// MarshalJSON is the custom marshaler for Disk. 2811func (d Disk) MarshalJSON() ([]byte, error) { 2812 objectMap := make(map[string]interface{}) 2813 if d.Sku != nil { 2814 objectMap["sku"] = d.Sku 2815 } 2816 if d.Zones != nil { 2817 objectMap["zones"] = d.Zones 2818 } 2819 if d.ExtendedLocation != nil { 2820 objectMap["extendedLocation"] = d.ExtendedLocation 2821 } 2822 if d.DiskProperties != nil { 2823 objectMap["properties"] = d.DiskProperties 2824 } 2825 if d.Location != nil { 2826 objectMap["location"] = d.Location 2827 } 2828 if d.Tags != nil { 2829 objectMap["tags"] = d.Tags 2830 } 2831 return json.Marshal(objectMap) 2832} 2833 2834// UnmarshalJSON is the custom unmarshaler for Disk struct. 2835func (d *Disk) UnmarshalJSON(body []byte) error { 2836 var m map[string]*json.RawMessage 2837 err := json.Unmarshal(body, &m) 2838 if err != nil { 2839 return err 2840 } 2841 for k, v := range m { 2842 switch k { 2843 case "managedBy": 2844 if v != nil { 2845 var managedBy string 2846 err = json.Unmarshal(*v, &managedBy) 2847 if err != nil { 2848 return err 2849 } 2850 d.ManagedBy = &managedBy 2851 } 2852 case "managedByExtended": 2853 if v != nil { 2854 var managedByExtended []string 2855 err = json.Unmarshal(*v, &managedByExtended) 2856 if err != nil { 2857 return err 2858 } 2859 d.ManagedByExtended = &managedByExtended 2860 } 2861 case "sku": 2862 if v != nil { 2863 var sku DiskSku 2864 err = json.Unmarshal(*v, &sku) 2865 if err != nil { 2866 return err 2867 } 2868 d.Sku = &sku 2869 } 2870 case "zones": 2871 if v != nil { 2872 var zones []string 2873 err = json.Unmarshal(*v, &zones) 2874 if err != nil { 2875 return err 2876 } 2877 d.Zones = &zones 2878 } 2879 case "extendedLocation": 2880 if v != nil { 2881 var extendedLocation ExtendedLocation 2882 err = json.Unmarshal(*v, &extendedLocation) 2883 if err != nil { 2884 return err 2885 } 2886 d.ExtendedLocation = &extendedLocation 2887 } 2888 case "properties": 2889 if v != nil { 2890 var diskProperties DiskProperties 2891 err = json.Unmarshal(*v, &diskProperties) 2892 if err != nil { 2893 return err 2894 } 2895 d.DiskProperties = &diskProperties 2896 } 2897 case "id": 2898 if v != nil { 2899 var ID string 2900 err = json.Unmarshal(*v, &ID) 2901 if err != nil { 2902 return err 2903 } 2904 d.ID = &ID 2905 } 2906 case "name": 2907 if v != nil { 2908 var name string 2909 err = json.Unmarshal(*v, &name) 2910 if err != nil { 2911 return err 2912 } 2913 d.Name = &name 2914 } 2915 case "type": 2916 if v != nil { 2917 var typeVar string 2918 err = json.Unmarshal(*v, &typeVar) 2919 if err != nil { 2920 return err 2921 } 2922 d.Type = &typeVar 2923 } 2924 case "location": 2925 if v != nil { 2926 var location string 2927 err = json.Unmarshal(*v, &location) 2928 if err != nil { 2929 return err 2930 } 2931 d.Location = &location 2932 } 2933 case "tags": 2934 if v != nil { 2935 var tags map[string]*string 2936 err = json.Unmarshal(*v, &tags) 2937 if err != nil { 2938 return err 2939 } 2940 d.Tags = tags 2941 } 2942 } 2943 } 2944 2945 return nil 2946} 2947 2948// DiskAccess disk access resource. 2949type DiskAccess struct { 2950 autorest.Response `json:"-"` 2951 *DiskAccessProperties `json:"properties,omitempty"` 2952 // ID - READ-ONLY; Resource Id 2953 ID *string `json:"id,omitempty"` 2954 // Name - READ-ONLY; Resource name 2955 Name *string `json:"name,omitempty"` 2956 // Type - READ-ONLY; Resource type 2957 Type *string `json:"type,omitempty"` 2958 // Location - Resource location 2959 Location *string `json:"location,omitempty"` 2960 // Tags - Resource tags 2961 Tags map[string]*string `json:"tags"` 2962} 2963 2964// MarshalJSON is the custom marshaler for DiskAccess. 2965func (da DiskAccess) MarshalJSON() ([]byte, error) { 2966 objectMap := make(map[string]interface{}) 2967 if da.DiskAccessProperties != nil { 2968 objectMap["properties"] = da.DiskAccessProperties 2969 } 2970 if da.Location != nil { 2971 objectMap["location"] = da.Location 2972 } 2973 if da.Tags != nil { 2974 objectMap["tags"] = da.Tags 2975 } 2976 return json.Marshal(objectMap) 2977} 2978 2979// UnmarshalJSON is the custom unmarshaler for DiskAccess struct. 2980func (da *DiskAccess) UnmarshalJSON(body []byte) error { 2981 var m map[string]*json.RawMessage 2982 err := json.Unmarshal(body, &m) 2983 if err != nil { 2984 return err 2985 } 2986 for k, v := range m { 2987 switch k { 2988 case "properties": 2989 if v != nil { 2990 var diskAccessProperties DiskAccessProperties 2991 err = json.Unmarshal(*v, &diskAccessProperties) 2992 if err != nil { 2993 return err 2994 } 2995 da.DiskAccessProperties = &diskAccessProperties 2996 } 2997 case "id": 2998 if v != nil { 2999 var ID string 3000 err = json.Unmarshal(*v, &ID) 3001 if err != nil { 3002 return err 3003 } 3004 da.ID = &ID 3005 } 3006 case "name": 3007 if v != nil { 3008 var name string 3009 err = json.Unmarshal(*v, &name) 3010 if err != nil { 3011 return err 3012 } 3013 da.Name = &name 3014 } 3015 case "type": 3016 if v != nil { 3017 var typeVar string 3018 err = json.Unmarshal(*v, &typeVar) 3019 if err != nil { 3020 return err 3021 } 3022 da.Type = &typeVar 3023 } 3024 case "location": 3025 if v != nil { 3026 var location string 3027 err = json.Unmarshal(*v, &location) 3028 if err != nil { 3029 return err 3030 } 3031 da.Location = &location 3032 } 3033 case "tags": 3034 if v != nil { 3035 var tags map[string]*string 3036 err = json.Unmarshal(*v, &tags) 3037 if err != nil { 3038 return err 3039 } 3040 da.Tags = tags 3041 } 3042 } 3043 } 3044 3045 return nil 3046} 3047 3048// DiskAccessesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 3049// long-running operation. 3050type DiskAccessesCreateOrUpdateFuture struct { 3051 azure.FutureAPI 3052 // Result returns the result of the asynchronous operation. 3053 // If the operation has not completed it will return an error. 3054 Result func(DiskAccessesClient) (DiskAccess, error) 3055} 3056 3057// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3058func (future *DiskAccessesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 3059 var azFuture azure.Future 3060 if err := json.Unmarshal(body, &azFuture); err != nil { 3061 return err 3062 } 3063 future.FutureAPI = &azFuture 3064 future.Result = future.result 3065 return nil 3066} 3067 3068// result is the default implementation for DiskAccessesCreateOrUpdateFuture.Result. 3069func (future *DiskAccessesCreateOrUpdateFuture) result(client DiskAccessesClient) (da DiskAccess, err error) { 3070 var done bool 3071 done, err = future.DoneWithContext(context.Background(), client) 3072 if err != nil { 3073 err = autorest.NewErrorWithError(err, "compute.DiskAccessesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 3074 return 3075 } 3076 if !done { 3077 da.Response.Response = future.Response() 3078 err = azure.NewAsyncOpIncompleteError("compute.DiskAccessesCreateOrUpdateFuture") 3079 return 3080 } 3081 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3082 if da.Response.Response, err = future.GetResult(sender); err == nil && da.Response.Response.StatusCode != http.StatusNoContent { 3083 da, err = client.CreateOrUpdateResponder(da.Response.Response) 3084 if err != nil { 3085 err = autorest.NewErrorWithError(err, "compute.DiskAccessesCreateOrUpdateFuture", "Result", da.Response.Response, "Failure responding to request") 3086 } 3087 } 3088 return 3089} 3090 3091// DiskAccessesDeleteAPrivateEndpointConnectionFuture an abstraction for monitoring and retrieving the 3092// results of a long-running operation. 3093type DiskAccessesDeleteAPrivateEndpointConnectionFuture struct { 3094 azure.FutureAPI 3095 // Result returns the result of the asynchronous operation. 3096 // If the operation has not completed it will return an error. 3097 Result func(DiskAccessesClient) (autorest.Response, error) 3098} 3099 3100// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3101func (future *DiskAccessesDeleteAPrivateEndpointConnectionFuture) UnmarshalJSON(body []byte) error { 3102 var azFuture azure.Future 3103 if err := json.Unmarshal(body, &azFuture); err != nil { 3104 return err 3105 } 3106 future.FutureAPI = &azFuture 3107 future.Result = future.result 3108 return nil 3109} 3110 3111// result is the default implementation for DiskAccessesDeleteAPrivateEndpointConnectionFuture.Result. 3112func (future *DiskAccessesDeleteAPrivateEndpointConnectionFuture) result(client DiskAccessesClient) (ar autorest.Response, err error) { 3113 var done bool 3114 done, err = future.DoneWithContext(context.Background(), client) 3115 if err != nil { 3116 err = autorest.NewErrorWithError(err, "compute.DiskAccessesDeleteAPrivateEndpointConnectionFuture", "Result", future.Response(), "Polling failure") 3117 return 3118 } 3119 if !done { 3120 ar.Response = future.Response() 3121 err = azure.NewAsyncOpIncompleteError("compute.DiskAccessesDeleteAPrivateEndpointConnectionFuture") 3122 return 3123 } 3124 ar.Response = future.Response() 3125 return 3126} 3127 3128// DiskAccessesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 3129// operation. 3130type DiskAccessesDeleteFuture struct { 3131 azure.FutureAPI 3132 // Result returns the result of the asynchronous operation. 3133 // If the operation has not completed it will return an error. 3134 Result func(DiskAccessesClient) (autorest.Response, error) 3135} 3136 3137// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3138func (future *DiskAccessesDeleteFuture) UnmarshalJSON(body []byte) error { 3139 var azFuture azure.Future 3140 if err := json.Unmarshal(body, &azFuture); err != nil { 3141 return err 3142 } 3143 future.FutureAPI = &azFuture 3144 future.Result = future.result 3145 return nil 3146} 3147 3148// result is the default implementation for DiskAccessesDeleteFuture.Result. 3149func (future *DiskAccessesDeleteFuture) result(client DiskAccessesClient) (ar autorest.Response, err error) { 3150 var done bool 3151 done, err = future.DoneWithContext(context.Background(), client) 3152 if err != nil { 3153 err = autorest.NewErrorWithError(err, "compute.DiskAccessesDeleteFuture", "Result", future.Response(), "Polling failure") 3154 return 3155 } 3156 if !done { 3157 ar.Response = future.Response() 3158 err = azure.NewAsyncOpIncompleteError("compute.DiskAccessesDeleteFuture") 3159 return 3160 } 3161 ar.Response = future.Response() 3162 return 3163} 3164 3165// DiskAccessesUpdateAPrivateEndpointConnectionFuture an abstraction for monitoring and retrieving the 3166// results of a long-running operation. 3167type DiskAccessesUpdateAPrivateEndpointConnectionFuture struct { 3168 azure.FutureAPI 3169 // Result returns the result of the asynchronous operation. 3170 // If the operation has not completed it will return an error. 3171 Result func(DiskAccessesClient) (PrivateEndpointConnection, error) 3172} 3173 3174// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3175func (future *DiskAccessesUpdateAPrivateEndpointConnectionFuture) UnmarshalJSON(body []byte) error { 3176 var azFuture azure.Future 3177 if err := json.Unmarshal(body, &azFuture); err != nil { 3178 return err 3179 } 3180 future.FutureAPI = &azFuture 3181 future.Result = future.result 3182 return nil 3183} 3184 3185// result is the default implementation for DiskAccessesUpdateAPrivateEndpointConnectionFuture.Result. 3186func (future *DiskAccessesUpdateAPrivateEndpointConnectionFuture) result(client DiskAccessesClient) (pec PrivateEndpointConnection, err error) { 3187 var done bool 3188 done, err = future.DoneWithContext(context.Background(), client) 3189 if err != nil { 3190 err = autorest.NewErrorWithError(err, "compute.DiskAccessesUpdateAPrivateEndpointConnectionFuture", "Result", future.Response(), "Polling failure") 3191 return 3192 } 3193 if !done { 3194 pec.Response.Response = future.Response() 3195 err = azure.NewAsyncOpIncompleteError("compute.DiskAccessesUpdateAPrivateEndpointConnectionFuture") 3196 return 3197 } 3198 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3199 if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent { 3200 pec, err = client.UpdateAPrivateEndpointConnectionResponder(pec.Response.Response) 3201 if err != nil { 3202 err = autorest.NewErrorWithError(err, "compute.DiskAccessesUpdateAPrivateEndpointConnectionFuture", "Result", pec.Response.Response, "Failure responding to request") 3203 } 3204 } 3205 return 3206} 3207 3208// DiskAccessesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 3209// operation. 3210type DiskAccessesUpdateFuture struct { 3211 azure.FutureAPI 3212 // Result returns the result of the asynchronous operation. 3213 // If the operation has not completed it will return an error. 3214 Result func(DiskAccessesClient) (DiskAccess, error) 3215} 3216 3217// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3218func (future *DiskAccessesUpdateFuture) UnmarshalJSON(body []byte) error { 3219 var azFuture azure.Future 3220 if err := json.Unmarshal(body, &azFuture); err != nil { 3221 return err 3222 } 3223 future.FutureAPI = &azFuture 3224 future.Result = future.result 3225 return nil 3226} 3227 3228// result is the default implementation for DiskAccessesUpdateFuture.Result. 3229func (future *DiskAccessesUpdateFuture) result(client DiskAccessesClient) (da DiskAccess, err error) { 3230 var done bool 3231 done, err = future.DoneWithContext(context.Background(), client) 3232 if err != nil { 3233 err = autorest.NewErrorWithError(err, "compute.DiskAccessesUpdateFuture", "Result", future.Response(), "Polling failure") 3234 return 3235 } 3236 if !done { 3237 da.Response.Response = future.Response() 3238 err = azure.NewAsyncOpIncompleteError("compute.DiskAccessesUpdateFuture") 3239 return 3240 } 3241 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3242 if da.Response.Response, err = future.GetResult(sender); err == nil && da.Response.Response.StatusCode != http.StatusNoContent { 3243 da, err = client.UpdateResponder(da.Response.Response) 3244 if err != nil { 3245 err = autorest.NewErrorWithError(err, "compute.DiskAccessesUpdateFuture", "Result", da.Response.Response, "Failure responding to request") 3246 } 3247 } 3248 return 3249} 3250 3251// DiskAccessList the List disk access operation response. 3252type DiskAccessList struct { 3253 autorest.Response `json:"-"` 3254 // Value - A list of disk access resources. 3255 Value *[]DiskAccess `json:"value,omitempty"` 3256 // NextLink - The uri to fetch the next page of disk access resources. Call ListNext() with this to fetch the next page of disk access resources. 3257 NextLink *string `json:"nextLink,omitempty"` 3258} 3259 3260// DiskAccessListIterator provides access to a complete listing of DiskAccess values. 3261type DiskAccessListIterator struct { 3262 i int 3263 page DiskAccessListPage 3264} 3265 3266// NextWithContext advances to the next value. If there was an error making 3267// the request the iterator does not advance and the error is returned. 3268func (iter *DiskAccessListIterator) NextWithContext(ctx context.Context) (err error) { 3269 if tracing.IsEnabled() { 3270 ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessListIterator.NextWithContext") 3271 defer func() { 3272 sc := -1 3273 if iter.Response().Response.Response != nil { 3274 sc = iter.Response().Response.Response.StatusCode 3275 } 3276 tracing.EndSpan(ctx, sc, err) 3277 }() 3278 } 3279 iter.i++ 3280 if iter.i < len(iter.page.Values()) { 3281 return nil 3282 } 3283 err = iter.page.NextWithContext(ctx) 3284 if err != nil { 3285 iter.i-- 3286 return err 3287 } 3288 iter.i = 0 3289 return nil 3290} 3291 3292// Next advances to the next value. If there was an error making 3293// the request the iterator does not advance and the error is returned. 3294// Deprecated: Use NextWithContext() instead. 3295func (iter *DiskAccessListIterator) Next() error { 3296 return iter.NextWithContext(context.Background()) 3297} 3298 3299// NotDone returns true if the enumeration should be started or is not yet complete. 3300func (iter DiskAccessListIterator) NotDone() bool { 3301 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3302} 3303 3304// Response returns the raw server response from the last page request. 3305func (iter DiskAccessListIterator) Response() DiskAccessList { 3306 return iter.page.Response() 3307} 3308 3309// Value returns the current value or a zero-initialized value if the 3310// iterator has advanced beyond the end of the collection. 3311func (iter DiskAccessListIterator) Value() DiskAccess { 3312 if !iter.page.NotDone() { 3313 return DiskAccess{} 3314 } 3315 return iter.page.Values()[iter.i] 3316} 3317 3318// Creates a new instance of the DiskAccessListIterator type. 3319func NewDiskAccessListIterator(page DiskAccessListPage) DiskAccessListIterator { 3320 return DiskAccessListIterator{page: page} 3321} 3322 3323// IsEmpty returns true if the ListResult contains no values. 3324func (dal DiskAccessList) IsEmpty() bool { 3325 return dal.Value == nil || len(*dal.Value) == 0 3326} 3327 3328// hasNextLink returns true if the NextLink is not empty. 3329func (dal DiskAccessList) hasNextLink() bool { 3330 return dal.NextLink != nil && len(*dal.NextLink) != 0 3331} 3332 3333// diskAccessListPreparer prepares a request to retrieve the next set of results. 3334// It returns nil if no more results exist. 3335func (dal DiskAccessList) diskAccessListPreparer(ctx context.Context) (*http.Request, error) { 3336 if !dal.hasNextLink() { 3337 return nil, nil 3338 } 3339 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3340 autorest.AsJSON(), 3341 autorest.AsGet(), 3342 autorest.WithBaseURL(to.String(dal.NextLink))) 3343} 3344 3345// DiskAccessListPage contains a page of DiskAccess values. 3346type DiskAccessListPage struct { 3347 fn func(context.Context, DiskAccessList) (DiskAccessList, error) 3348 dal DiskAccessList 3349} 3350 3351// NextWithContext advances to the next page of values. If there was an error making 3352// the request the page does not advance and the error is returned. 3353func (page *DiskAccessListPage) NextWithContext(ctx context.Context) (err error) { 3354 if tracing.IsEnabled() { 3355 ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessListPage.NextWithContext") 3356 defer func() { 3357 sc := -1 3358 if page.Response().Response.Response != nil { 3359 sc = page.Response().Response.Response.StatusCode 3360 } 3361 tracing.EndSpan(ctx, sc, err) 3362 }() 3363 } 3364 for { 3365 next, err := page.fn(ctx, page.dal) 3366 if err != nil { 3367 return err 3368 } 3369 page.dal = next 3370 if !next.hasNextLink() || !next.IsEmpty() { 3371 break 3372 } 3373 } 3374 return nil 3375} 3376 3377// Next advances to the next page of values. If there was an error making 3378// the request the page does not advance and the error is returned. 3379// Deprecated: Use NextWithContext() instead. 3380func (page *DiskAccessListPage) Next() error { 3381 return page.NextWithContext(context.Background()) 3382} 3383 3384// NotDone returns true if the page enumeration should be started or is not yet complete. 3385func (page DiskAccessListPage) NotDone() bool { 3386 return !page.dal.IsEmpty() 3387} 3388 3389// Response returns the raw server response from the last page request. 3390func (page DiskAccessListPage) Response() DiskAccessList { 3391 return page.dal 3392} 3393 3394// Values returns the slice of values for the current page or nil if there are no values. 3395func (page DiskAccessListPage) Values() []DiskAccess { 3396 if page.dal.IsEmpty() { 3397 return nil 3398 } 3399 return *page.dal.Value 3400} 3401 3402// Creates a new instance of the DiskAccessListPage type. 3403func NewDiskAccessListPage(cur DiskAccessList, getNextPage func(context.Context, DiskAccessList) (DiskAccessList, error)) DiskAccessListPage { 3404 return DiskAccessListPage{ 3405 fn: getNextPage, 3406 dal: cur, 3407 } 3408} 3409 3410// DiskAccessProperties ... 3411type DiskAccessProperties struct { 3412 // PrivateEndpointConnections - READ-ONLY; A readonly collection of private endpoint connections created on the disk. Currently only one endpoint connection is supported. 3413 PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` 3414 // ProvisioningState - READ-ONLY; The disk access resource provisioning state. 3415 ProvisioningState *string `json:"provisioningState,omitempty"` 3416 // TimeCreated - READ-ONLY; The time when the disk access was created. 3417 TimeCreated *date.Time `json:"timeCreated,omitempty"` 3418} 3419 3420// MarshalJSON is the custom marshaler for DiskAccessProperties. 3421func (dap DiskAccessProperties) MarshalJSON() ([]byte, error) { 3422 objectMap := make(map[string]interface{}) 3423 return json.Marshal(objectMap) 3424} 3425 3426// DiskAccessUpdate used for updating a disk access resource. 3427type DiskAccessUpdate struct { 3428 // Tags - Resource tags 3429 Tags map[string]*string `json:"tags"` 3430} 3431 3432// MarshalJSON is the custom marshaler for DiskAccessUpdate. 3433func (dau DiskAccessUpdate) MarshalJSON() ([]byte, error) { 3434 objectMap := make(map[string]interface{}) 3435 if dau.Tags != nil { 3436 objectMap["tags"] = dau.Tags 3437 } 3438 return json.Marshal(objectMap) 3439} 3440 3441// DiskEncryptionSet disk encryption set resource. 3442type DiskEncryptionSet struct { 3443 autorest.Response `json:"-"` 3444 Identity *EncryptionSetIdentity `json:"identity,omitempty"` 3445 *EncryptionSetProperties `json:"properties,omitempty"` 3446 // ID - READ-ONLY; Resource Id 3447 ID *string `json:"id,omitempty"` 3448 // Name - READ-ONLY; Resource name 3449 Name *string `json:"name,omitempty"` 3450 // Type - READ-ONLY; Resource type 3451 Type *string `json:"type,omitempty"` 3452 // Location - Resource location 3453 Location *string `json:"location,omitempty"` 3454 // Tags - Resource tags 3455 Tags map[string]*string `json:"tags"` 3456} 3457 3458// MarshalJSON is the custom marshaler for DiskEncryptionSet. 3459func (desVar DiskEncryptionSet) MarshalJSON() ([]byte, error) { 3460 objectMap := make(map[string]interface{}) 3461 if desVar.Identity != nil { 3462 objectMap["identity"] = desVar.Identity 3463 } 3464 if desVar.EncryptionSetProperties != nil { 3465 objectMap["properties"] = desVar.EncryptionSetProperties 3466 } 3467 if desVar.Location != nil { 3468 objectMap["location"] = desVar.Location 3469 } 3470 if desVar.Tags != nil { 3471 objectMap["tags"] = desVar.Tags 3472 } 3473 return json.Marshal(objectMap) 3474} 3475 3476// UnmarshalJSON is the custom unmarshaler for DiskEncryptionSet struct. 3477func (desVar *DiskEncryptionSet) UnmarshalJSON(body []byte) error { 3478 var m map[string]*json.RawMessage 3479 err := json.Unmarshal(body, &m) 3480 if err != nil { 3481 return err 3482 } 3483 for k, v := range m { 3484 switch k { 3485 case "identity": 3486 if v != nil { 3487 var identity EncryptionSetIdentity 3488 err = json.Unmarshal(*v, &identity) 3489 if err != nil { 3490 return err 3491 } 3492 desVar.Identity = &identity 3493 } 3494 case "properties": 3495 if v != nil { 3496 var encryptionSetProperties EncryptionSetProperties 3497 err = json.Unmarshal(*v, &encryptionSetProperties) 3498 if err != nil { 3499 return err 3500 } 3501 desVar.EncryptionSetProperties = &encryptionSetProperties 3502 } 3503 case "id": 3504 if v != nil { 3505 var ID string 3506 err = json.Unmarshal(*v, &ID) 3507 if err != nil { 3508 return err 3509 } 3510 desVar.ID = &ID 3511 } 3512 case "name": 3513 if v != nil { 3514 var name string 3515 err = json.Unmarshal(*v, &name) 3516 if err != nil { 3517 return err 3518 } 3519 desVar.Name = &name 3520 } 3521 case "type": 3522 if v != nil { 3523 var typeVar string 3524 err = json.Unmarshal(*v, &typeVar) 3525 if err != nil { 3526 return err 3527 } 3528 desVar.Type = &typeVar 3529 } 3530 case "location": 3531 if v != nil { 3532 var location string 3533 err = json.Unmarshal(*v, &location) 3534 if err != nil { 3535 return err 3536 } 3537 desVar.Location = &location 3538 } 3539 case "tags": 3540 if v != nil { 3541 var tags map[string]*string 3542 err = json.Unmarshal(*v, &tags) 3543 if err != nil { 3544 return err 3545 } 3546 desVar.Tags = tags 3547 } 3548 } 3549 } 3550 3551 return nil 3552} 3553 3554// DiskEncryptionSetList the List disk encryption set operation response. 3555type DiskEncryptionSetList struct { 3556 autorest.Response `json:"-"` 3557 // Value - A list of disk encryption sets. 3558 Value *[]DiskEncryptionSet `json:"value,omitempty"` 3559 // 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. 3560 NextLink *string `json:"nextLink,omitempty"` 3561} 3562 3563// DiskEncryptionSetListIterator provides access to a complete listing of DiskEncryptionSet values. 3564type DiskEncryptionSetListIterator struct { 3565 i int 3566 page DiskEncryptionSetListPage 3567} 3568 3569// NextWithContext advances to the next value. If there was an error making 3570// the request the iterator does not advance and the error is returned. 3571func (iter *DiskEncryptionSetListIterator) NextWithContext(ctx context.Context) (err error) { 3572 if tracing.IsEnabled() { 3573 ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetListIterator.NextWithContext") 3574 defer func() { 3575 sc := -1 3576 if iter.Response().Response.Response != nil { 3577 sc = iter.Response().Response.Response.StatusCode 3578 } 3579 tracing.EndSpan(ctx, sc, err) 3580 }() 3581 } 3582 iter.i++ 3583 if iter.i < len(iter.page.Values()) { 3584 return nil 3585 } 3586 err = iter.page.NextWithContext(ctx) 3587 if err != nil { 3588 iter.i-- 3589 return err 3590 } 3591 iter.i = 0 3592 return nil 3593} 3594 3595// Next advances to the next value. If there was an error making 3596// the request the iterator does not advance and the error is returned. 3597// Deprecated: Use NextWithContext() instead. 3598func (iter *DiskEncryptionSetListIterator) Next() error { 3599 return iter.NextWithContext(context.Background()) 3600} 3601 3602// NotDone returns true if the enumeration should be started or is not yet complete. 3603func (iter DiskEncryptionSetListIterator) NotDone() bool { 3604 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3605} 3606 3607// Response returns the raw server response from the last page request. 3608func (iter DiskEncryptionSetListIterator) Response() DiskEncryptionSetList { 3609 return iter.page.Response() 3610} 3611 3612// Value returns the current value or a zero-initialized value if the 3613// iterator has advanced beyond the end of the collection. 3614func (iter DiskEncryptionSetListIterator) Value() DiskEncryptionSet { 3615 if !iter.page.NotDone() { 3616 return DiskEncryptionSet{} 3617 } 3618 return iter.page.Values()[iter.i] 3619} 3620 3621// Creates a new instance of the DiskEncryptionSetListIterator type. 3622func NewDiskEncryptionSetListIterator(page DiskEncryptionSetListPage) DiskEncryptionSetListIterator { 3623 return DiskEncryptionSetListIterator{page: page} 3624} 3625 3626// IsEmpty returns true if the ListResult contains no values. 3627func (desl DiskEncryptionSetList) IsEmpty() bool { 3628 return desl.Value == nil || len(*desl.Value) == 0 3629} 3630 3631// hasNextLink returns true if the NextLink is not empty. 3632func (desl DiskEncryptionSetList) hasNextLink() bool { 3633 return desl.NextLink != nil && len(*desl.NextLink) != 0 3634} 3635 3636// diskEncryptionSetListPreparer prepares a request to retrieve the next set of results. 3637// It returns nil if no more results exist. 3638func (desl DiskEncryptionSetList) diskEncryptionSetListPreparer(ctx context.Context) (*http.Request, error) { 3639 if !desl.hasNextLink() { 3640 return nil, nil 3641 } 3642 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3643 autorest.AsJSON(), 3644 autorest.AsGet(), 3645 autorest.WithBaseURL(to.String(desl.NextLink))) 3646} 3647 3648// DiskEncryptionSetListPage contains a page of DiskEncryptionSet values. 3649type DiskEncryptionSetListPage struct { 3650 fn func(context.Context, DiskEncryptionSetList) (DiskEncryptionSetList, error) 3651 desl DiskEncryptionSetList 3652} 3653 3654// NextWithContext advances to the next page of values. If there was an error making 3655// the request the page does not advance and the error is returned. 3656func (page *DiskEncryptionSetListPage) NextWithContext(ctx context.Context) (err error) { 3657 if tracing.IsEnabled() { 3658 ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetListPage.NextWithContext") 3659 defer func() { 3660 sc := -1 3661 if page.Response().Response.Response != nil { 3662 sc = page.Response().Response.Response.StatusCode 3663 } 3664 tracing.EndSpan(ctx, sc, err) 3665 }() 3666 } 3667 for { 3668 next, err := page.fn(ctx, page.desl) 3669 if err != nil { 3670 return err 3671 } 3672 page.desl = next 3673 if !next.hasNextLink() || !next.IsEmpty() { 3674 break 3675 } 3676 } 3677 return nil 3678} 3679 3680// Next advances to the next page of values. If there was an error making 3681// the request the page does not advance and the error is returned. 3682// Deprecated: Use NextWithContext() instead. 3683func (page *DiskEncryptionSetListPage) Next() error { 3684 return page.NextWithContext(context.Background()) 3685} 3686 3687// NotDone returns true if the page enumeration should be started or is not yet complete. 3688func (page DiskEncryptionSetListPage) NotDone() bool { 3689 return !page.desl.IsEmpty() 3690} 3691 3692// Response returns the raw server response from the last page request. 3693func (page DiskEncryptionSetListPage) Response() DiskEncryptionSetList { 3694 return page.desl 3695} 3696 3697// Values returns the slice of values for the current page or nil if there are no values. 3698func (page DiskEncryptionSetListPage) Values() []DiskEncryptionSet { 3699 if page.desl.IsEmpty() { 3700 return nil 3701 } 3702 return *page.desl.Value 3703} 3704 3705// Creates a new instance of the DiskEncryptionSetListPage type. 3706func NewDiskEncryptionSetListPage(cur DiskEncryptionSetList, getNextPage func(context.Context, DiskEncryptionSetList) (DiskEncryptionSetList, error)) DiskEncryptionSetListPage { 3707 return DiskEncryptionSetListPage{ 3708 fn: getNextPage, 3709 desl: cur, 3710 } 3711} 3712 3713// DiskEncryptionSetParameters describes the parameter of customer managed disk encryption set resource id 3714// that can be specified for disk. <br><br> NOTE: The disk encryption set resource id can only be specified 3715// for managed disk. Please refer https://aka.ms/mdssewithcmkoverview for more details. 3716type DiskEncryptionSetParameters struct { 3717 // ID - Resource Id 3718 ID *string `json:"id,omitempty"` 3719} 3720 3721// DiskEncryptionSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 3722// long-running operation. 3723type DiskEncryptionSetsCreateOrUpdateFuture struct { 3724 azure.FutureAPI 3725 // Result returns the result of the asynchronous operation. 3726 // If the operation has not completed it will return an error. 3727 Result func(DiskEncryptionSetsClient) (DiskEncryptionSet, error) 3728} 3729 3730// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3731func (future *DiskEncryptionSetsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 3732 var azFuture azure.Future 3733 if err := json.Unmarshal(body, &azFuture); err != nil { 3734 return err 3735 } 3736 future.FutureAPI = &azFuture 3737 future.Result = future.result 3738 return nil 3739} 3740 3741// result is the default implementation for DiskEncryptionSetsCreateOrUpdateFuture.Result. 3742func (future *DiskEncryptionSetsCreateOrUpdateFuture) result(client DiskEncryptionSetsClient) (desVar DiskEncryptionSet, err error) { 3743 var done bool 3744 done, err = future.DoneWithContext(context.Background(), client) 3745 if err != nil { 3746 err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 3747 return 3748 } 3749 if !done { 3750 desVar.Response.Response = future.Response() 3751 err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsCreateOrUpdateFuture") 3752 return 3753 } 3754 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3755 if desVar.Response.Response, err = future.GetResult(sender); err == nil && desVar.Response.Response.StatusCode != http.StatusNoContent { 3756 desVar, err = client.CreateOrUpdateResponder(desVar.Response.Response) 3757 if err != nil { 3758 err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsCreateOrUpdateFuture", "Result", desVar.Response.Response, "Failure responding to request") 3759 } 3760 } 3761 return 3762} 3763 3764// DiskEncryptionSetsDeleteFuture an abstraction for monitoring and retrieving the results of a 3765// long-running operation. 3766type DiskEncryptionSetsDeleteFuture struct { 3767 azure.FutureAPI 3768 // Result returns the result of the asynchronous operation. 3769 // If the operation has not completed it will return an error. 3770 Result func(DiskEncryptionSetsClient) (autorest.Response, error) 3771} 3772 3773// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3774func (future *DiskEncryptionSetsDeleteFuture) UnmarshalJSON(body []byte) error { 3775 var azFuture azure.Future 3776 if err := json.Unmarshal(body, &azFuture); err != nil { 3777 return err 3778 } 3779 future.FutureAPI = &azFuture 3780 future.Result = future.result 3781 return nil 3782} 3783 3784// result is the default implementation for DiskEncryptionSetsDeleteFuture.Result. 3785func (future *DiskEncryptionSetsDeleteFuture) result(client DiskEncryptionSetsClient) (ar autorest.Response, err error) { 3786 var done bool 3787 done, err = future.DoneWithContext(context.Background(), client) 3788 if err != nil { 3789 err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsDeleteFuture", "Result", future.Response(), "Polling failure") 3790 return 3791 } 3792 if !done { 3793 ar.Response = future.Response() 3794 err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsDeleteFuture") 3795 return 3796 } 3797 ar.Response = future.Response() 3798 return 3799} 3800 3801// DiskEncryptionSetsUpdateFuture an abstraction for monitoring and retrieving the results of a 3802// long-running operation. 3803type DiskEncryptionSetsUpdateFuture struct { 3804 azure.FutureAPI 3805 // Result returns the result of the asynchronous operation. 3806 // If the operation has not completed it will return an error. 3807 Result func(DiskEncryptionSetsClient) (DiskEncryptionSet, error) 3808} 3809 3810// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3811func (future *DiskEncryptionSetsUpdateFuture) UnmarshalJSON(body []byte) error { 3812 var azFuture azure.Future 3813 if err := json.Unmarshal(body, &azFuture); err != nil { 3814 return err 3815 } 3816 future.FutureAPI = &azFuture 3817 future.Result = future.result 3818 return nil 3819} 3820 3821// result is the default implementation for DiskEncryptionSetsUpdateFuture.Result. 3822func (future *DiskEncryptionSetsUpdateFuture) result(client DiskEncryptionSetsClient) (desVar DiskEncryptionSet, err error) { 3823 var done bool 3824 done, err = future.DoneWithContext(context.Background(), client) 3825 if err != nil { 3826 err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsUpdateFuture", "Result", future.Response(), "Polling failure") 3827 return 3828 } 3829 if !done { 3830 desVar.Response.Response = future.Response() 3831 err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsUpdateFuture") 3832 return 3833 } 3834 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3835 if desVar.Response.Response, err = future.GetResult(sender); err == nil && desVar.Response.Response.StatusCode != http.StatusNoContent { 3836 desVar, err = client.UpdateResponder(desVar.Response.Response) 3837 if err != nil { 3838 err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsUpdateFuture", "Result", desVar.Response.Response, "Failure responding to request") 3839 } 3840 } 3841 return 3842} 3843 3844// DiskEncryptionSettings describes a Encryption Settings for a Disk 3845type DiskEncryptionSettings struct { 3846 // DiskEncryptionKey - Specifies the location of the disk encryption key, which is a Key Vault Secret. 3847 DiskEncryptionKey *KeyVaultSecretReference `json:"diskEncryptionKey,omitempty"` 3848 // KeyEncryptionKey - Specifies the location of the key encryption key in Key Vault. 3849 KeyEncryptionKey *KeyVaultKeyReference `json:"keyEncryptionKey,omitempty"` 3850 // Enabled - Specifies whether disk encryption should be enabled on the virtual machine. 3851 Enabled *bool `json:"enabled,omitempty"` 3852} 3853 3854// DiskEncryptionSetUpdate disk encryption set update resource. 3855type DiskEncryptionSetUpdate struct { 3856 *DiskEncryptionSetUpdateProperties `json:"properties,omitempty"` 3857 // Tags - Resource tags 3858 Tags map[string]*string `json:"tags"` 3859 Identity *EncryptionSetIdentity `json:"identity,omitempty"` 3860} 3861 3862// MarshalJSON is the custom marshaler for DiskEncryptionSetUpdate. 3863func (desu DiskEncryptionSetUpdate) MarshalJSON() ([]byte, error) { 3864 objectMap := make(map[string]interface{}) 3865 if desu.DiskEncryptionSetUpdateProperties != nil { 3866 objectMap["properties"] = desu.DiskEncryptionSetUpdateProperties 3867 } 3868 if desu.Tags != nil { 3869 objectMap["tags"] = desu.Tags 3870 } 3871 if desu.Identity != nil { 3872 objectMap["identity"] = desu.Identity 3873 } 3874 return json.Marshal(objectMap) 3875} 3876 3877// UnmarshalJSON is the custom unmarshaler for DiskEncryptionSetUpdate struct. 3878func (desu *DiskEncryptionSetUpdate) UnmarshalJSON(body []byte) error { 3879 var m map[string]*json.RawMessage 3880 err := json.Unmarshal(body, &m) 3881 if err != nil { 3882 return err 3883 } 3884 for k, v := range m { 3885 switch k { 3886 case "properties": 3887 if v != nil { 3888 var diskEncryptionSetUpdateProperties DiskEncryptionSetUpdateProperties 3889 err = json.Unmarshal(*v, &diskEncryptionSetUpdateProperties) 3890 if err != nil { 3891 return err 3892 } 3893 desu.DiskEncryptionSetUpdateProperties = &diskEncryptionSetUpdateProperties 3894 } 3895 case "tags": 3896 if v != nil { 3897 var tags map[string]*string 3898 err = json.Unmarshal(*v, &tags) 3899 if err != nil { 3900 return err 3901 } 3902 desu.Tags = tags 3903 } 3904 case "identity": 3905 if v != nil { 3906 var identity EncryptionSetIdentity 3907 err = json.Unmarshal(*v, &identity) 3908 if err != nil { 3909 return err 3910 } 3911 desu.Identity = &identity 3912 } 3913 } 3914 } 3915 3916 return nil 3917} 3918 3919// DiskEncryptionSetUpdateProperties disk encryption set resource update properties. 3920type DiskEncryptionSetUpdateProperties struct { 3921 // EncryptionType - Possible values include: 'DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey', 'DiskEncryptionSetTypeEncryptionAtRestWithPlatformAndCustomerKeys' 3922 EncryptionType DiskEncryptionSetType `json:"encryptionType,omitempty"` 3923 ActiveKey *KeyForDiskEncryptionSet `json:"activeKey,omitempty"` 3924 // RotationToLatestKeyVersionEnabled - Set this flag to true to enable auto-updating of this disk encryption set to the latest key version. 3925 RotationToLatestKeyVersionEnabled *bool `json:"rotationToLatestKeyVersionEnabled,omitempty"` 3926} 3927 3928// DiskImageEncryption this is the disk image encryption base class. 3929type DiskImageEncryption struct { 3930 // DiskEncryptionSetID - A relative URI containing the resource ID of the disk encryption set. 3931 DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` 3932} 3933 3934// DiskInstanceView the instance view of the disk. 3935type DiskInstanceView struct { 3936 // Name - The disk name. 3937 Name *string `json:"name,omitempty"` 3938 // EncryptionSettings - Specifies the encryption settings for the OS Disk. <br><br> Minimum api-version: 2015-06-15 3939 EncryptionSettings *[]DiskEncryptionSettings `json:"encryptionSettings,omitempty"` 3940 // Statuses - The resource status information. 3941 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 3942} 3943 3944// DiskList the List Disks operation response. 3945type DiskList struct { 3946 autorest.Response `json:"-"` 3947 // Value - A list of disks. 3948 Value *[]Disk `json:"value,omitempty"` 3949 // NextLink - The uri to fetch the next page of disks. Call ListNext() with this to fetch the next page of disks. 3950 NextLink *string `json:"nextLink,omitempty"` 3951} 3952 3953// DiskListIterator provides access to a complete listing of Disk values. 3954type DiskListIterator struct { 3955 i int 3956 page DiskListPage 3957} 3958 3959// NextWithContext advances to the next value. If there was an error making 3960// the request the iterator does not advance and the error is returned. 3961func (iter *DiskListIterator) NextWithContext(ctx context.Context) (err error) { 3962 if tracing.IsEnabled() { 3963 ctx = tracing.StartSpan(ctx, fqdn+"/DiskListIterator.NextWithContext") 3964 defer func() { 3965 sc := -1 3966 if iter.Response().Response.Response != nil { 3967 sc = iter.Response().Response.Response.StatusCode 3968 } 3969 tracing.EndSpan(ctx, sc, err) 3970 }() 3971 } 3972 iter.i++ 3973 if iter.i < len(iter.page.Values()) { 3974 return nil 3975 } 3976 err = iter.page.NextWithContext(ctx) 3977 if err != nil { 3978 iter.i-- 3979 return err 3980 } 3981 iter.i = 0 3982 return nil 3983} 3984 3985// Next advances to the next value. If there was an error making 3986// the request the iterator does not advance and the error is returned. 3987// Deprecated: Use NextWithContext() instead. 3988func (iter *DiskListIterator) Next() error { 3989 return iter.NextWithContext(context.Background()) 3990} 3991 3992// NotDone returns true if the enumeration should be started or is not yet complete. 3993func (iter DiskListIterator) NotDone() bool { 3994 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3995} 3996 3997// Response returns the raw server response from the last page request. 3998func (iter DiskListIterator) Response() DiskList { 3999 return iter.page.Response() 4000} 4001 4002// Value returns the current value or a zero-initialized value if the 4003// iterator has advanced beyond the end of the collection. 4004func (iter DiskListIterator) Value() Disk { 4005 if !iter.page.NotDone() { 4006 return Disk{} 4007 } 4008 return iter.page.Values()[iter.i] 4009} 4010 4011// Creates a new instance of the DiskListIterator type. 4012func NewDiskListIterator(page DiskListPage) DiskListIterator { 4013 return DiskListIterator{page: page} 4014} 4015 4016// IsEmpty returns true if the ListResult contains no values. 4017func (dl DiskList) IsEmpty() bool { 4018 return dl.Value == nil || len(*dl.Value) == 0 4019} 4020 4021// hasNextLink returns true if the NextLink is not empty. 4022func (dl DiskList) hasNextLink() bool { 4023 return dl.NextLink != nil && len(*dl.NextLink) != 0 4024} 4025 4026// diskListPreparer prepares a request to retrieve the next set of results. 4027// It returns nil if no more results exist. 4028func (dl DiskList) diskListPreparer(ctx context.Context) (*http.Request, error) { 4029 if !dl.hasNextLink() { 4030 return nil, nil 4031 } 4032 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4033 autorest.AsJSON(), 4034 autorest.AsGet(), 4035 autorest.WithBaseURL(to.String(dl.NextLink))) 4036} 4037 4038// DiskListPage contains a page of Disk values. 4039type DiskListPage struct { 4040 fn func(context.Context, DiskList) (DiskList, error) 4041 dl DiskList 4042} 4043 4044// NextWithContext advances to the next page of values. If there was an error making 4045// the request the page does not advance and the error is returned. 4046func (page *DiskListPage) NextWithContext(ctx context.Context) (err error) { 4047 if tracing.IsEnabled() { 4048 ctx = tracing.StartSpan(ctx, fqdn+"/DiskListPage.NextWithContext") 4049 defer func() { 4050 sc := -1 4051 if page.Response().Response.Response != nil { 4052 sc = page.Response().Response.Response.StatusCode 4053 } 4054 tracing.EndSpan(ctx, sc, err) 4055 }() 4056 } 4057 for { 4058 next, err := page.fn(ctx, page.dl) 4059 if err != nil { 4060 return err 4061 } 4062 page.dl = next 4063 if !next.hasNextLink() || !next.IsEmpty() { 4064 break 4065 } 4066 } 4067 return nil 4068} 4069 4070// Next advances to the next page of values. If there was an error making 4071// the request the page does not advance and the error is returned. 4072// Deprecated: Use NextWithContext() instead. 4073func (page *DiskListPage) Next() error { 4074 return page.NextWithContext(context.Background()) 4075} 4076 4077// NotDone returns true if the page enumeration should be started or is not yet complete. 4078func (page DiskListPage) NotDone() bool { 4079 return !page.dl.IsEmpty() 4080} 4081 4082// Response returns the raw server response from the last page request. 4083func (page DiskListPage) Response() DiskList { 4084 return page.dl 4085} 4086 4087// Values returns the slice of values for the current page or nil if there are no values. 4088func (page DiskListPage) Values() []Disk { 4089 if page.dl.IsEmpty() { 4090 return nil 4091 } 4092 return *page.dl.Value 4093} 4094 4095// Creates a new instance of the DiskListPage type. 4096func NewDiskListPage(cur DiskList, getNextPage func(context.Context, DiskList) (DiskList, error)) DiskListPage { 4097 return DiskListPage{ 4098 fn: getNextPage, 4099 dl: cur, 4100 } 4101} 4102 4103// DiskProperties disk resource properties. 4104type DiskProperties struct { 4105 // TimeCreated - READ-ONLY; The time when the disk was created. 4106 TimeCreated *date.Time `json:"timeCreated,omitempty"` 4107 // OsType - The Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' 4108 OsType OperatingSystemTypes `json:"osType,omitempty"` 4109 // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'HyperVGenerationV1', 'HyperVGenerationV2' 4110 HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` 4111 // PurchasePlan - Purchase plan information for the the image from which the OS disk was created. E.g. - {name: 2019-Datacenter, publisher: MicrosoftWindowsServer, product: WindowsServer} 4112 PurchasePlan *PurchasePlan `json:"purchasePlan,omitempty"` 4113 // CreationData - Disk source information. CreationData information cannot be changed after the disk has been created. 4114 CreationData *CreationData `json:"creationData,omitempty"` 4115 // 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. 4116 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 4117 // DiskSizeBytes - READ-ONLY; The size of the disk in bytes. This field is read only. 4118 DiskSizeBytes *int64 `json:"diskSizeBytes,omitempty"` 4119 // UniqueID - READ-ONLY; Unique Guid identifying the resource. 4120 UniqueID *string `json:"uniqueId,omitempty"` 4121 // EncryptionSettingsCollection - Encryption settings collection used for Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. 4122 EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` 4123 // ProvisioningState - READ-ONLY; The disk provisioning state. 4124 ProvisioningState *string `json:"provisioningState,omitempty"` 4125 // DiskIOPSReadWrite - The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. 4126 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 4127 // 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. 4128 DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` 4129 // DiskIOPSReadOnly - The total number of IOPS that will be allowed across all VMs mounting the shared disk as ReadOnly. One operation can transfer between 4k and 256k bytes. 4130 DiskIOPSReadOnly *int64 `json:"diskIOPSReadOnly,omitempty"` 4131 // DiskMBpsReadOnly - The total throughput (MBps) that will be allowed across all VMs mounting the shared disk as ReadOnly. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. 4132 DiskMBpsReadOnly *int64 `json:"diskMBpsReadOnly,omitempty"` 4133 // DiskState - The state of the disk. Possible values include: 'DiskStateUnattached', 'DiskStateAttached', 'DiskStateReserved', 'DiskStateActiveSAS', 'DiskStateReadyToUpload', 'DiskStateActiveUpload' 4134 DiskState DiskState `json:"diskState,omitempty"` 4135 // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 4136 Encryption *Encryption `json:"encryption,omitempty"` 4137 // MaxShares - The maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a disk that can be mounted on multiple VMs at the same time. 4138 MaxShares *int32 `json:"maxShares,omitempty"` 4139 // ShareInfo - READ-ONLY; Details of the list of all VMs that have the disk attached. maxShares should be set to a value greater than one for disks to allow attaching them to multiple VMs. 4140 ShareInfo *[]ShareInfoElement `json:"shareInfo,omitempty"` 4141 // NetworkAccessPolicy - Possible values include: 'NetworkAccessPolicyAllowAll', 'NetworkAccessPolicyAllowPrivate', 'NetworkAccessPolicyDenyAll' 4142 NetworkAccessPolicy NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` 4143 // DiskAccessID - ARM id of the DiskAccess resource for using private endpoints on disks. 4144 DiskAccessID *string `json:"diskAccessId,omitempty"` 4145 // Tier - Performance tier of the disk (e.g, P4, S10) as described here: https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not apply to Ultra disks. 4146 Tier *string `json:"tier,omitempty"` 4147 // BurstingEnabled - Set to true to enable bursting beyond the provisioned performance target of the disk. Bursting is disabled by default. Does not apply to Ultra disks. 4148 BurstingEnabled *bool `json:"burstingEnabled,omitempty"` 4149 // PropertyUpdatesInProgress - READ-ONLY; Properties of the disk for which update is pending. 4150 PropertyUpdatesInProgress *PropertyUpdatesInProgress `json:"propertyUpdatesInProgress,omitempty"` 4151 // SupportsHibernation - Indicates the OS on a disk supports hibernation. 4152 SupportsHibernation *bool `json:"supportsHibernation,omitempty"` 4153 // SecurityProfile - Contains the security related information for the resource. 4154 SecurityProfile *DiskSecurityProfile `json:"securityProfile,omitempty"` 4155} 4156 4157// MarshalJSON is the custom marshaler for DiskProperties. 4158func (dp DiskProperties) MarshalJSON() ([]byte, error) { 4159 objectMap := make(map[string]interface{}) 4160 if dp.OsType != "" { 4161 objectMap["osType"] = dp.OsType 4162 } 4163 if dp.HyperVGeneration != "" { 4164 objectMap["hyperVGeneration"] = dp.HyperVGeneration 4165 } 4166 if dp.PurchasePlan != nil { 4167 objectMap["purchasePlan"] = dp.PurchasePlan 4168 } 4169 if dp.CreationData != nil { 4170 objectMap["creationData"] = dp.CreationData 4171 } 4172 if dp.DiskSizeGB != nil { 4173 objectMap["diskSizeGB"] = dp.DiskSizeGB 4174 } 4175 if dp.EncryptionSettingsCollection != nil { 4176 objectMap["encryptionSettingsCollection"] = dp.EncryptionSettingsCollection 4177 } 4178 if dp.DiskIOPSReadWrite != nil { 4179 objectMap["diskIOPSReadWrite"] = dp.DiskIOPSReadWrite 4180 } 4181 if dp.DiskMBpsReadWrite != nil { 4182 objectMap["diskMBpsReadWrite"] = dp.DiskMBpsReadWrite 4183 } 4184 if dp.DiskIOPSReadOnly != nil { 4185 objectMap["diskIOPSReadOnly"] = dp.DiskIOPSReadOnly 4186 } 4187 if dp.DiskMBpsReadOnly != nil { 4188 objectMap["diskMBpsReadOnly"] = dp.DiskMBpsReadOnly 4189 } 4190 if dp.DiskState != "" { 4191 objectMap["diskState"] = dp.DiskState 4192 } 4193 if dp.Encryption != nil { 4194 objectMap["encryption"] = dp.Encryption 4195 } 4196 if dp.MaxShares != nil { 4197 objectMap["maxShares"] = dp.MaxShares 4198 } 4199 if dp.NetworkAccessPolicy != "" { 4200 objectMap["networkAccessPolicy"] = dp.NetworkAccessPolicy 4201 } 4202 if dp.DiskAccessID != nil { 4203 objectMap["diskAccessId"] = dp.DiskAccessID 4204 } 4205 if dp.Tier != nil { 4206 objectMap["tier"] = dp.Tier 4207 } 4208 if dp.BurstingEnabled != nil { 4209 objectMap["burstingEnabled"] = dp.BurstingEnabled 4210 } 4211 if dp.SupportsHibernation != nil { 4212 objectMap["supportsHibernation"] = dp.SupportsHibernation 4213 } 4214 if dp.SecurityProfile != nil { 4215 objectMap["securityProfile"] = dp.SecurityProfile 4216 } 4217 return json.Marshal(objectMap) 4218} 4219 4220// DiskRestorePoint properties of disk restore point 4221type DiskRestorePoint struct { 4222 autorest.Response `json:"-"` 4223 *DiskRestorePointProperties `json:"properties,omitempty"` 4224 // ID - READ-ONLY; Resource Id 4225 ID *string `json:"id,omitempty"` 4226 // Name - READ-ONLY; Resource name 4227 Name *string `json:"name,omitempty"` 4228 // Type - READ-ONLY; Resource type 4229 Type *string `json:"type,omitempty"` 4230} 4231 4232// MarshalJSON is the custom marshaler for DiskRestorePoint. 4233func (drp DiskRestorePoint) MarshalJSON() ([]byte, error) { 4234 objectMap := make(map[string]interface{}) 4235 if drp.DiskRestorePointProperties != nil { 4236 objectMap["properties"] = drp.DiskRestorePointProperties 4237 } 4238 return json.Marshal(objectMap) 4239} 4240 4241// UnmarshalJSON is the custom unmarshaler for DiskRestorePoint struct. 4242func (drp *DiskRestorePoint) UnmarshalJSON(body []byte) error { 4243 var m map[string]*json.RawMessage 4244 err := json.Unmarshal(body, &m) 4245 if err != nil { 4246 return err 4247 } 4248 for k, v := range m { 4249 switch k { 4250 case "properties": 4251 if v != nil { 4252 var diskRestorePointProperties DiskRestorePointProperties 4253 err = json.Unmarshal(*v, &diskRestorePointProperties) 4254 if err != nil { 4255 return err 4256 } 4257 drp.DiskRestorePointProperties = &diskRestorePointProperties 4258 } 4259 case "id": 4260 if v != nil { 4261 var ID string 4262 err = json.Unmarshal(*v, &ID) 4263 if err != nil { 4264 return err 4265 } 4266 drp.ID = &ID 4267 } 4268 case "name": 4269 if v != nil { 4270 var name string 4271 err = json.Unmarshal(*v, &name) 4272 if err != nil { 4273 return err 4274 } 4275 drp.Name = &name 4276 } 4277 case "type": 4278 if v != nil { 4279 var typeVar string 4280 err = json.Unmarshal(*v, &typeVar) 4281 if err != nil { 4282 return err 4283 } 4284 drp.Type = &typeVar 4285 } 4286 } 4287 } 4288 4289 return nil 4290} 4291 4292// DiskRestorePointList the List Disk Restore Points operation response. 4293type DiskRestorePointList struct { 4294 autorest.Response `json:"-"` 4295 // Value - A list of disk restore points. 4296 Value *[]DiskRestorePoint `json:"value,omitempty"` 4297 // NextLink - The uri to fetch the next page of disk restore points. Call ListNext() with this to fetch the next page of disk restore points. 4298 NextLink *string `json:"nextLink,omitempty"` 4299} 4300 4301// DiskRestorePointListIterator provides access to a complete listing of DiskRestorePoint values. 4302type DiskRestorePointListIterator struct { 4303 i int 4304 page DiskRestorePointListPage 4305} 4306 4307// NextWithContext advances to the next value. If there was an error making 4308// the request the iterator does not advance and the error is returned. 4309func (iter *DiskRestorePointListIterator) NextWithContext(ctx context.Context) (err error) { 4310 if tracing.IsEnabled() { 4311 ctx = tracing.StartSpan(ctx, fqdn+"/DiskRestorePointListIterator.NextWithContext") 4312 defer func() { 4313 sc := -1 4314 if iter.Response().Response.Response != nil { 4315 sc = iter.Response().Response.Response.StatusCode 4316 } 4317 tracing.EndSpan(ctx, sc, err) 4318 }() 4319 } 4320 iter.i++ 4321 if iter.i < len(iter.page.Values()) { 4322 return nil 4323 } 4324 err = iter.page.NextWithContext(ctx) 4325 if err != nil { 4326 iter.i-- 4327 return err 4328 } 4329 iter.i = 0 4330 return nil 4331} 4332 4333// Next advances to the next value. If there was an error making 4334// the request the iterator does not advance and the error is returned. 4335// Deprecated: Use NextWithContext() instead. 4336func (iter *DiskRestorePointListIterator) Next() error { 4337 return iter.NextWithContext(context.Background()) 4338} 4339 4340// NotDone returns true if the enumeration should be started or is not yet complete. 4341func (iter DiskRestorePointListIterator) NotDone() bool { 4342 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4343} 4344 4345// Response returns the raw server response from the last page request. 4346func (iter DiskRestorePointListIterator) Response() DiskRestorePointList { 4347 return iter.page.Response() 4348} 4349 4350// Value returns the current value or a zero-initialized value if the 4351// iterator has advanced beyond the end of the collection. 4352func (iter DiskRestorePointListIterator) Value() DiskRestorePoint { 4353 if !iter.page.NotDone() { 4354 return DiskRestorePoint{} 4355 } 4356 return iter.page.Values()[iter.i] 4357} 4358 4359// Creates a new instance of the DiskRestorePointListIterator type. 4360func NewDiskRestorePointListIterator(page DiskRestorePointListPage) DiskRestorePointListIterator { 4361 return DiskRestorePointListIterator{page: page} 4362} 4363 4364// IsEmpty returns true if the ListResult contains no values. 4365func (drpl DiskRestorePointList) IsEmpty() bool { 4366 return drpl.Value == nil || len(*drpl.Value) == 0 4367} 4368 4369// hasNextLink returns true if the NextLink is not empty. 4370func (drpl DiskRestorePointList) hasNextLink() bool { 4371 return drpl.NextLink != nil && len(*drpl.NextLink) != 0 4372} 4373 4374// diskRestorePointListPreparer prepares a request to retrieve the next set of results. 4375// It returns nil if no more results exist. 4376func (drpl DiskRestorePointList) diskRestorePointListPreparer(ctx context.Context) (*http.Request, error) { 4377 if !drpl.hasNextLink() { 4378 return nil, nil 4379 } 4380 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4381 autorest.AsJSON(), 4382 autorest.AsGet(), 4383 autorest.WithBaseURL(to.String(drpl.NextLink))) 4384} 4385 4386// DiskRestorePointListPage contains a page of DiskRestorePoint values. 4387type DiskRestorePointListPage struct { 4388 fn func(context.Context, DiskRestorePointList) (DiskRestorePointList, error) 4389 drpl DiskRestorePointList 4390} 4391 4392// NextWithContext advances to the next page of values. If there was an error making 4393// the request the page does not advance and the error is returned. 4394func (page *DiskRestorePointListPage) NextWithContext(ctx context.Context) (err error) { 4395 if tracing.IsEnabled() { 4396 ctx = tracing.StartSpan(ctx, fqdn+"/DiskRestorePointListPage.NextWithContext") 4397 defer func() { 4398 sc := -1 4399 if page.Response().Response.Response != nil { 4400 sc = page.Response().Response.Response.StatusCode 4401 } 4402 tracing.EndSpan(ctx, sc, err) 4403 }() 4404 } 4405 for { 4406 next, err := page.fn(ctx, page.drpl) 4407 if err != nil { 4408 return err 4409 } 4410 page.drpl = next 4411 if !next.hasNextLink() || !next.IsEmpty() { 4412 break 4413 } 4414 } 4415 return nil 4416} 4417 4418// Next advances to the next page of values. If there was an error making 4419// the request the page does not advance and the error is returned. 4420// Deprecated: Use NextWithContext() instead. 4421func (page *DiskRestorePointListPage) Next() error { 4422 return page.NextWithContext(context.Background()) 4423} 4424 4425// NotDone returns true if the page enumeration should be started or is not yet complete. 4426func (page DiskRestorePointListPage) NotDone() bool { 4427 return !page.drpl.IsEmpty() 4428} 4429 4430// Response returns the raw server response from the last page request. 4431func (page DiskRestorePointListPage) Response() DiskRestorePointList { 4432 return page.drpl 4433} 4434 4435// Values returns the slice of values for the current page or nil if there are no values. 4436func (page DiskRestorePointListPage) Values() []DiskRestorePoint { 4437 if page.drpl.IsEmpty() { 4438 return nil 4439 } 4440 return *page.drpl.Value 4441} 4442 4443// Creates a new instance of the DiskRestorePointListPage type. 4444func NewDiskRestorePointListPage(cur DiskRestorePointList, getNextPage func(context.Context, DiskRestorePointList) (DiskRestorePointList, error)) DiskRestorePointListPage { 4445 return DiskRestorePointListPage{ 4446 fn: getNextPage, 4447 drpl: cur, 4448 } 4449} 4450 4451// DiskRestorePointProperties properties of an incremental disk restore point 4452type DiskRestorePointProperties struct { 4453 // TimeCreated - READ-ONLY; The timestamp of restorePoint creation 4454 TimeCreated *date.Time `json:"timeCreated,omitempty"` 4455 // SourceResourceID - READ-ONLY; arm id of source disk 4456 SourceResourceID *string `json:"sourceResourceId,omitempty"` 4457 // OsType - READ-ONLY; The Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' 4458 OsType OperatingSystemTypes `json:"osType,omitempty"` 4459 // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'HyperVGenerationV1', 'HyperVGenerationV2' 4460 HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` 4461 // PurchasePlan - Purchase plan information for the the image from which the OS disk was created. 4462 PurchasePlan *PurchasePlan `json:"purchasePlan,omitempty"` 4463 // FamilyID - READ-ONLY; id of the backing snapshot's MIS family 4464 FamilyID *string `json:"familyId,omitempty"` 4465 // SourceUniqueID - READ-ONLY; unique incarnation id of the source disk 4466 SourceUniqueID *string `json:"sourceUniqueId,omitempty"` 4467 // Encryption - READ-ONLY; Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 4468 Encryption *Encryption `json:"encryption,omitempty"` 4469 // SupportsHibernation - Indicates the OS on a disk supports hibernation. 4470 SupportsHibernation *bool `json:"supportsHibernation,omitempty"` 4471} 4472 4473// MarshalJSON is the custom marshaler for DiskRestorePointProperties. 4474func (drpp DiskRestorePointProperties) MarshalJSON() ([]byte, error) { 4475 objectMap := make(map[string]interface{}) 4476 if drpp.HyperVGeneration != "" { 4477 objectMap["hyperVGeneration"] = drpp.HyperVGeneration 4478 } 4479 if drpp.PurchasePlan != nil { 4480 objectMap["purchasePlan"] = drpp.PurchasePlan 4481 } 4482 if drpp.SupportsHibernation != nil { 4483 objectMap["supportsHibernation"] = drpp.SupportsHibernation 4484 } 4485 return json.Marshal(objectMap) 4486} 4487 4488// DisksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 4489// operation. 4490type DisksCreateOrUpdateFuture struct { 4491 azure.FutureAPI 4492 // Result returns the result of the asynchronous operation. 4493 // If the operation has not completed it will return an error. 4494 Result func(DisksClient) (Disk, error) 4495} 4496 4497// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4498func (future *DisksCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 4499 var azFuture azure.Future 4500 if err := json.Unmarshal(body, &azFuture); err != nil { 4501 return err 4502 } 4503 future.FutureAPI = &azFuture 4504 future.Result = future.result 4505 return nil 4506} 4507 4508// result is the default implementation for DisksCreateOrUpdateFuture.Result. 4509func (future *DisksCreateOrUpdateFuture) result(client DisksClient) (d Disk, err error) { 4510 var done bool 4511 done, err = future.DoneWithContext(context.Background(), client) 4512 if err != nil { 4513 err = autorest.NewErrorWithError(err, "compute.DisksCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 4514 return 4515 } 4516 if !done { 4517 d.Response.Response = future.Response() 4518 err = azure.NewAsyncOpIncompleteError("compute.DisksCreateOrUpdateFuture") 4519 return 4520 } 4521 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4522 if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent { 4523 d, err = client.CreateOrUpdateResponder(d.Response.Response) 4524 if err != nil { 4525 err = autorest.NewErrorWithError(err, "compute.DisksCreateOrUpdateFuture", "Result", d.Response.Response, "Failure responding to request") 4526 } 4527 } 4528 return 4529} 4530 4531// DisksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 4532type DisksDeleteFuture struct { 4533 azure.FutureAPI 4534 // Result returns the result of the asynchronous operation. 4535 // If the operation has not completed it will return an error. 4536 Result func(DisksClient) (autorest.Response, error) 4537} 4538 4539// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4540func (future *DisksDeleteFuture) UnmarshalJSON(body []byte) error { 4541 var azFuture azure.Future 4542 if err := json.Unmarshal(body, &azFuture); err != nil { 4543 return err 4544 } 4545 future.FutureAPI = &azFuture 4546 future.Result = future.result 4547 return nil 4548} 4549 4550// result is the default implementation for DisksDeleteFuture.Result. 4551func (future *DisksDeleteFuture) result(client DisksClient) (ar autorest.Response, err error) { 4552 var done bool 4553 done, err = future.DoneWithContext(context.Background(), client) 4554 if err != nil { 4555 err = autorest.NewErrorWithError(err, "compute.DisksDeleteFuture", "Result", future.Response(), "Polling failure") 4556 return 4557 } 4558 if !done { 4559 ar.Response = future.Response() 4560 err = azure.NewAsyncOpIncompleteError("compute.DisksDeleteFuture") 4561 return 4562 } 4563 ar.Response = future.Response() 4564 return 4565} 4566 4567// DiskSecurityProfile contains the security related information for the resource. 4568type DiskSecurityProfile struct { 4569 // SecurityType - Possible values include: 'DiskSecurityTypesTrustedLaunch' 4570 SecurityType DiskSecurityTypes `json:"securityType,omitempty"` 4571} 4572 4573// DisksGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running 4574// operation. 4575type DisksGrantAccessFuture struct { 4576 azure.FutureAPI 4577 // Result returns the result of the asynchronous operation. 4578 // If the operation has not completed it will return an error. 4579 Result func(DisksClient) (AccessURI, error) 4580} 4581 4582// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4583func (future *DisksGrantAccessFuture) UnmarshalJSON(body []byte) error { 4584 var azFuture azure.Future 4585 if err := json.Unmarshal(body, &azFuture); err != nil { 4586 return err 4587 } 4588 future.FutureAPI = &azFuture 4589 future.Result = future.result 4590 return nil 4591} 4592 4593// result is the default implementation for DisksGrantAccessFuture.Result. 4594func (future *DisksGrantAccessFuture) result(client DisksClient) (au AccessURI, err error) { 4595 var done bool 4596 done, err = future.DoneWithContext(context.Background(), client) 4597 if err != nil { 4598 err = autorest.NewErrorWithError(err, "compute.DisksGrantAccessFuture", "Result", future.Response(), "Polling failure") 4599 return 4600 } 4601 if !done { 4602 au.Response.Response = future.Response() 4603 err = azure.NewAsyncOpIncompleteError("compute.DisksGrantAccessFuture") 4604 return 4605 } 4606 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4607 if au.Response.Response, err = future.GetResult(sender); err == nil && au.Response.Response.StatusCode != http.StatusNoContent { 4608 au, err = client.GrantAccessResponder(au.Response.Response) 4609 if err != nil { 4610 err = autorest.NewErrorWithError(err, "compute.DisksGrantAccessFuture", "Result", au.Response.Response, "Failure responding to request") 4611 } 4612 } 4613 return 4614} 4615 4616// DiskSku the disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, 4617// Premium_ZRS, or StandardSSD_ZRS. 4618type DiskSku struct { 4619 // Name - The sku name. Possible values include: 'DiskStorageAccountTypesStandardLRS', 'DiskStorageAccountTypesPremiumLRS', 'DiskStorageAccountTypesStandardSSDLRS', 'DiskStorageAccountTypesUltraSSDLRS', 'DiskStorageAccountTypesPremiumZRS', 'DiskStorageAccountTypesStandardSSDZRS' 4620 Name DiskStorageAccountTypes `json:"name,omitempty"` 4621 // Tier - READ-ONLY; The sku tier. 4622 Tier *string `json:"tier,omitempty"` 4623} 4624 4625// MarshalJSON is the custom marshaler for DiskSku. 4626func (ds DiskSku) MarshalJSON() ([]byte, error) { 4627 objectMap := make(map[string]interface{}) 4628 if ds.Name != "" { 4629 objectMap["name"] = ds.Name 4630 } 4631 return json.Marshal(objectMap) 4632} 4633 4634// DisksRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running 4635// operation. 4636type DisksRevokeAccessFuture struct { 4637 azure.FutureAPI 4638 // Result returns the result of the asynchronous operation. 4639 // If the operation has not completed it will return an error. 4640 Result func(DisksClient) (autorest.Response, error) 4641} 4642 4643// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4644func (future *DisksRevokeAccessFuture) UnmarshalJSON(body []byte) error { 4645 var azFuture azure.Future 4646 if err := json.Unmarshal(body, &azFuture); err != nil { 4647 return err 4648 } 4649 future.FutureAPI = &azFuture 4650 future.Result = future.result 4651 return nil 4652} 4653 4654// result is the default implementation for DisksRevokeAccessFuture.Result. 4655func (future *DisksRevokeAccessFuture) result(client DisksClient) (ar autorest.Response, err error) { 4656 var done bool 4657 done, err = future.DoneWithContext(context.Background(), client) 4658 if err != nil { 4659 err = autorest.NewErrorWithError(err, "compute.DisksRevokeAccessFuture", "Result", future.Response(), "Polling failure") 4660 return 4661 } 4662 if !done { 4663 ar.Response = future.Response() 4664 err = azure.NewAsyncOpIncompleteError("compute.DisksRevokeAccessFuture") 4665 return 4666 } 4667 ar.Response = future.Response() 4668 return 4669} 4670 4671// DisksUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. 4672type DisksUpdateFuture struct { 4673 azure.FutureAPI 4674 // Result returns the result of the asynchronous operation. 4675 // If the operation has not completed it will return an error. 4676 Result func(DisksClient) (Disk, error) 4677} 4678 4679// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4680func (future *DisksUpdateFuture) UnmarshalJSON(body []byte) error { 4681 var azFuture azure.Future 4682 if err := json.Unmarshal(body, &azFuture); err != nil { 4683 return err 4684 } 4685 future.FutureAPI = &azFuture 4686 future.Result = future.result 4687 return nil 4688} 4689 4690// result is the default implementation for DisksUpdateFuture.Result. 4691func (future *DisksUpdateFuture) result(client DisksClient) (d Disk, err error) { 4692 var done bool 4693 done, err = future.DoneWithContext(context.Background(), client) 4694 if err != nil { 4695 err = autorest.NewErrorWithError(err, "compute.DisksUpdateFuture", "Result", future.Response(), "Polling failure") 4696 return 4697 } 4698 if !done { 4699 d.Response.Response = future.Response() 4700 err = azure.NewAsyncOpIncompleteError("compute.DisksUpdateFuture") 4701 return 4702 } 4703 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4704 if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent { 4705 d, err = client.UpdateResponder(d.Response.Response) 4706 if err != nil { 4707 err = autorest.NewErrorWithError(err, "compute.DisksUpdateFuture", "Result", d.Response.Response, "Failure responding to request") 4708 } 4709 } 4710 return 4711} 4712 4713// DiskUpdate disk update resource. 4714type DiskUpdate struct { 4715 *DiskUpdateProperties `json:"properties,omitempty"` 4716 // Tags - Resource tags 4717 Tags map[string]*string `json:"tags"` 4718 Sku *DiskSku `json:"sku,omitempty"` 4719} 4720 4721// MarshalJSON is the custom marshaler for DiskUpdate. 4722func (du DiskUpdate) MarshalJSON() ([]byte, error) { 4723 objectMap := make(map[string]interface{}) 4724 if du.DiskUpdateProperties != nil { 4725 objectMap["properties"] = du.DiskUpdateProperties 4726 } 4727 if du.Tags != nil { 4728 objectMap["tags"] = du.Tags 4729 } 4730 if du.Sku != nil { 4731 objectMap["sku"] = du.Sku 4732 } 4733 return json.Marshal(objectMap) 4734} 4735 4736// UnmarshalJSON is the custom unmarshaler for DiskUpdate struct. 4737func (du *DiskUpdate) UnmarshalJSON(body []byte) error { 4738 var m map[string]*json.RawMessage 4739 err := json.Unmarshal(body, &m) 4740 if err != nil { 4741 return err 4742 } 4743 for k, v := range m { 4744 switch k { 4745 case "properties": 4746 if v != nil { 4747 var diskUpdateProperties DiskUpdateProperties 4748 err = json.Unmarshal(*v, &diskUpdateProperties) 4749 if err != nil { 4750 return err 4751 } 4752 du.DiskUpdateProperties = &diskUpdateProperties 4753 } 4754 case "tags": 4755 if v != nil { 4756 var tags map[string]*string 4757 err = json.Unmarshal(*v, &tags) 4758 if err != nil { 4759 return err 4760 } 4761 du.Tags = tags 4762 } 4763 case "sku": 4764 if v != nil { 4765 var sku DiskSku 4766 err = json.Unmarshal(*v, &sku) 4767 if err != nil { 4768 return err 4769 } 4770 du.Sku = &sku 4771 } 4772 } 4773 } 4774 4775 return nil 4776} 4777 4778// DiskUpdateProperties disk resource update properties. 4779type DiskUpdateProperties struct { 4780 // OsType - the Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' 4781 OsType OperatingSystemTypes `json:"osType,omitempty"` 4782 // 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. 4783 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 4784 // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. 4785 EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` 4786 // DiskIOPSReadWrite - The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. 4787 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 4788 // 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. 4789 DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` 4790 // DiskIOPSReadOnly - The total number of IOPS that will be allowed across all VMs mounting the shared disk as ReadOnly. One operation can transfer between 4k and 256k bytes. 4791 DiskIOPSReadOnly *int64 `json:"diskIOPSReadOnly,omitempty"` 4792 // DiskMBpsReadOnly - The total throughput (MBps) that will be allowed across all VMs mounting the shared disk as ReadOnly. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. 4793 DiskMBpsReadOnly *int64 `json:"diskMBpsReadOnly,omitempty"` 4794 // MaxShares - The maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a disk that can be mounted on multiple VMs at the same time. 4795 MaxShares *int32 `json:"maxShares,omitempty"` 4796 // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 4797 Encryption *Encryption `json:"encryption,omitempty"` 4798 // NetworkAccessPolicy - Possible values include: 'NetworkAccessPolicyAllowAll', 'NetworkAccessPolicyAllowPrivate', 'NetworkAccessPolicyDenyAll' 4799 NetworkAccessPolicy NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` 4800 // DiskAccessID - ARM id of the DiskAccess resource for using private endpoints on disks. 4801 DiskAccessID *string `json:"diskAccessId,omitempty"` 4802 // Tier - Performance tier of the disk (e.g, P4, S10) as described here: https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not apply to Ultra disks. 4803 Tier *string `json:"tier,omitempty"` 4804 // BurstingEnabled - Set to true to enable bursting beyond the provisioned performance target of the disk. Bursting is disabled by default. Does not apply to Ultra disks. 4805 BurstingEnabled *bool `json:"burstingEnabled,omitempty"` 4806 // PurchasePlan - Purchase plan information to be added on the OS disk 4807 PurchasePlan *PurchasePlan `json:"purchasePlan,omitempty"` 4808 // PropertyUpdatesInProgress - READ-ONLY; Properties of the disk for which update is pending. 4809 PropertyUpdatesInProgress *PropertyUpdatesInProgress `json:"propertyUpdatesInProgress,omitempty"` 4810 // SupportsHibernation - Indicates the OS on a disk supports hibernation. 4811 SupportsHibernation *bool `json:"supportsHibernation,omitempty"` 4812} 4813 4814// MarshalJSON is the custom marshaler for DiskUpdateProperties. 4815func (dup DiskUpdateProperties) MarshalJSON() ([]byte, error) { 4816 objectMap := make(map[string]interface{}) 4817 if dup.OsType != "" { 4818 objectMap["osType"] = dup.OsType 4819 } 4820 if dup.DiskSizeGB != nil { 4821 objectMap["diskSizeGB"] = dup.DiskSizeGB 4822 } 4823 if dup.EncryptionSettingsCollection != nil { 4824 objectMap["encryptionSettingsCollection"] = dup.EncryptionSettingsCollection 4825 } 4826 if dup.DiskIOPSReadWrite != nil { 4827 objectMap["diskIOPSReadWrite"] = dup.DiskIOPSReadWrite 4828 } 4829 if dup.DiskMBpsReadWrite != nil { 4830 objectMap["diskMBpsReadWrite"] = dup.DiskMBpsReadWrite 4831 } 4832 if dup.DiskIOPSReadOnly != nil { 4833 objectMap["diskIOPSReadOnly"] = dup.DiskIOPSReadOnly 4834 } 4835 if dup.DiskMBpsReadOnly != nil { 4836 objectMap["diskMBpsReadOnly"] = dup.DiskMBpsReadOnly 4837 } 4838 if dup.MaxShares != nil { 4839 objectMap["maxShares"] = dup.MaxShares 4840 } 4841 if dup.Encryption != nil { 4842 objectMap["encryption"] = dup.Encryption 4843 } 4844 if dup.NetworkAccessPolicy != "" { 4845 objectMap["networkAccessPolicy"] = dup.NetworkAccessPolicy 4846 } 4847 if dup.DiskAccessID != nil { 4848 objectMap["diskAccessId"] = dup.DiskAccessID 4849 } 4850 if dup.Tier != nil { 4851 objectMap["tier"] = dup.Tier 4852 } 4853 if dup.BurstingEnabled != nil { 4854 objectMap["burstingEnabled"] = dup.BurstingEnabled 4855 } 4856 if dup.PurchasePlan != nil { 4857 objectMap["purchasePlan"] = dup.PurchasePlan 4858 } 4859 if dup.SupportsHibernation != nil { 4860 objectMap["supportsHibernation"] = dup.SupportsHibernation 4861 } 4862 return json.Marshal(objectMap) 4863} 4864 4865// Encryption encryption at rest settings for disk or snapshot 4866type Encryption struct { 4867 // DiskEncryptionSetID - ResourceId of the disk encryption set to use for enabling encryption at rest. 4868 DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` 4869 // Type - Possible values include: 'EncryptionTypeEncryptionAtRestWithPlatformKey', 'EncryptionTypeEncryptionAtRestWithCustomerKey', 'EncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys' 4870 Type EncryptionType `json:"type,omitempty"` 4871} 4872 4873// EncryptionImages optional. Allows users to provide customer managed keys for encrypting the OS and data 4874// disks in the gallery artifact. 4875type EncryptionImages struct { 4876 OsDiskImage *OSDiskImageEncryption `json:"osDiskImage,omitempty"` 4877 // DataDiskImages - A list of encryption specifications for data disk images. 4878 DataDiskImages *[]DataDiskImageEncryption `json:"dataDiskImages,omitempty"` 4879} 4880 4881// EncryptionSetIdentity the managed identity for the disk encryption set. It should be given permission on 4882// the key vault before it can be used to encrypt disks. 4883type EncryptionSetIdentity struct { 4884 // Type - The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is supported for new creations. Disk Encryption Sets can be updated with Identity type None during migration of subscription to a new Azure Active Directory tenant; it will cause the encrypted resources to lose access to the keys. Possible values include: 'DiskEncryptionSetIdentityTypeSystemAssigned', 'DiskEncryptionSetIdentityTypeNone' 4885 Type DiskEncryptionSetIdentityType `json:"type,omitempty"` 4886 // 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 4887 PrincipalID *string `json:"principalId,omitempty"` 4888 // 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 4889 TenantID *string `json:"tenantId,omitempty"` 4890} 4891 4892// MarshalJSON is the custom marshaler for EncryptionSetIdentity. 4893func (esi EncryptionSetIdentity) MarshalJSON() ([]byte, error) { 4894 objectMap := make(map[string]interface{}) 4895 if esi.Type != "" { 4896 objectMap["type"] = esi.Type 4897 } 4898 return json.Marshal(objectMap) 4899} 4900 4901// EncryptionSetProperties ... 4902type EncryptionSetProperties struct { 4903 // EncryptionType - Possible values include: 'DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey', 'DiskEncryptionSetTypeEncryptionAtRestWithPlatformAndCustomerKeys' 4904 EncryptionType DiskEncryptionSetType `json:"encryptionType,omitempty"` 4905 // ActiveKey - The key vault key which is currently used by this disk encryption set. 4906 ActiveKey *KeyForDiskEncryptionSet `json:"activeKey,omitempty"` 4907 // 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. 4908 PreviousKeys *[]KeyForDiskEncryptionSet `json:"previousKeys,omitempty"` 4909 // ProvisioningState - READ-ONLY; The disk encryption set provisioning state. 4910 ProvisioningState *string `json:"provisioningState,omitempty"` 4911 // RotationToLatestKeyVersionEnabled - Set this flag to true to enable auto-updating of this disk encryption set to the latest key version. 4912 RotationToLatestKeyVersionEnabled *bool `json:"rotationToLatestKeyVersionEnabled,omitempty"` 4913 // LastKeyRotationTimestamp - READ-ONLY; The time when the active key of this disk encryption set was updated. 4914 LastKeyRotationTimestamp *date.Time `json:"lastKeyRotationTimestamp,omitempty"` 4915} 4916 4917// MarshalJSON is the custom marshaler for EncryptionSetProperties. 4918func (esp EncryptionSetProperties) MarshalJSON() ([]byte, error) { 4919 objectMap := make(map[string]interface{}) 4920 if esp.EncryptionType != "" { 4921 objectMap["encryptionType"] = esp.EncryptionType 4922 } 4923 if esp.ActiveKey != nil { 4924 objectMap["activeKey"] = esp.ActiveKey 4925 } 4926 if esp.RotationToLatestKeyVersionEnabled != nil { 4927 objectMap["rotationToLatestKeyVersionEnabled"] = esp.RotationToLatestKeyVersionEnabled 4928 } 4929 return json.Marshal(objectMap) 4930} 4931 4932// EncryptionSettingsCollection encryption settings for disk or snapshot 4933type EncryptionSettingsCollection struct { 4934 // 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. 4935 Enabled *bool `json:"enabled,omitempty"` 4936 // EncryptionSettings - A collection of encryption settings, one for each disk volume. 4937 EncryptionSettings *[]EncryptionSettingsElement `json:"encryptionSettings,omitempty"` 4938 // 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. 4939 EncryptionSettingsVersion *string `json:"encryptionSettingsVersion,omitempty"` 4940} 4941 4942// EncryptionSettingsElement encryption settings for one disk volume. 4943type EncryptionSettingsElement struct { 4944 // DiskEncryptionKey - Key Vault Secret Url and vault id of the disk encryption key 4945 DiskEncryptionKey *KeyVaultAndSecretReference `json:"diskEncryptionKey,omitempty"` 4946 // 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. 4947 KeyEncryptionKey *KeyVaultAndKeyReference `json:"keyEncryptionKey,omitempty"` 4948} 4949 4950// ExtendedLocation the complex type of the extended location. 4951type ExtendedLocation struct { 4952 // Name - The name of the extended location. 4953 Name *string `json:"name,omitempty"` 4954 // Type - The type of the extended location. Possible values include: 'ExtendedLocationTypesEdgeZone' 4955 Type ExtendedLocationTypes `json:"type,omitempty"` 4956} 4957 4958// Extension describes a cloud service Extension. 4959type Extension struct { 4960 // Name - The name of the extension. 4961 Name *string `json:"name,omitempty"` 4962 Properties *CloudServiceExtensionProperties `json:"properties,omitempty"` 4963} 4964 4965// GalleriesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 4966// operation. 4967type GalleriesCreateOrUpdateFuture struct { 4968 azure.FutureAPI 4969 // Result returns the result of the asynchronous operation. 4970 // If the operation has not completed it will return an error. 4971 Result func(GalleriesClient) (Gallery, error) 4972} 4973 4974// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4975func (future *GalleriesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 4976 var azFuture azure.Future 4977 if err := json.Unmarshal(body, &azFuture); err != nil { 4978 return err 4979 } 4980 future.FutureAPI = &azFuture 4981 future.Result = future.result 4982 return nil 4983} 4984 4985// result is the default implementation for GalleriesCreateOrUpdateFuture.Result. 4986func (future *GalleriesCreateOrUpdateFuture) result(client GalleriesClient) (g Gallery, err error) { 4987 var done bool 4988 done, err = future.DoneWithContext(context.Background(), client) 4989 if err != nil { 4990 err = autorest.NewErrorWithError(err, "compute.GalleriesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 4991 return 4992 } 4993 if !done { 4994 g.Response.Response = future.Response() 4995 err = azure.NewAsyncOpIncompleteError("compute.GalleriesCreateOrUpdateFuture") 4996 return 4997 } 4998 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4999 if g.Response.Response, err = future.GetResult(sender); err == nil && g.Response.Response.StatusCode != http.StatusNoContent { 5000 g, err = client.CreateOrUpdateResponder(g.Response.Response) 5001 if err != nil { 5002 err = autorest.NewErrorWithError(err, "compute.GalleriesCreateOrUpdateFuture", "Result", g.Response.Response, "Failure responding to request") 5003 } 5004 } 5005 return 5006} 5007 5008// GalleriesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 5009// operation. 5010type GalleriesDeleteFuture struct { 5011 azure.FutureAPI 5012 // Result returns the result of the asynchronous operation. 5013 // If the operation has not completed it will return an error. 5014 Result func(GalleriesClient) (autorest.Response, error) 5015} 5016 5017// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5018func (future *GalleriesDeleteFuture) UnmarshalJSON(body []byte) error { 5019 var azFuture azure.Future 5020 if err := json.Unmarshal(body, &azFuture); err != nil { 5021 return err 5022 } 5023 future.FutureAPI = &azFuture 5024 future.Result = future.result 5025 return nil 5026} 5027 5028// result is the default implementation for GalleriesDeleteFuture.Result. 5029func (future *GalleriesDeleteFuture) result(client GalleriesClient) (ar autorest.Response, err error) { 5030 var done bool 5031 done, err = future.DoneWithContext(context.Background(), client) 5032 if err != nil { 5033 err = autorest.NewErrorWithError(err, "compute.GalleriesDeleteFuture", "Result", future.Response(), "Polling failure") 5034 return 5035 } 5036 if !done { 5037 ar.Response = future.Response() 5038 err = azure.NewAsyncOpIncompleteError("compute.GalleriesDeleteFuture") 5039 return 5040 } 5041 ar.Response = future.Response() 5042 return 5043} 5044 5045// GalleriesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 5046// operation. 5047type GalleriesUpdateFuture struct { 5048 azure.FutureAPI 5049 // Result returns the result of the asynchronous operation. 5050 // If the operation has not completed it will return an error. 5051 Result func(GalleriesClient) (Gallery, error) 5052} 5053 5054// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5055func (future *GalleriesUpdateFuture) UnmarshalJSON(body []byte) error { 5056 var azFuture azure.Future 5057 if err := json.Unmarshal(body, &azFuture); err != nil { 5058 return err 5059 } 5060 future.FutureAPI = &azFuture 5061 future.Result = future.result 5062 return nil 5063} 5064 5065// result is the default implementation for GalleriesUpdateFuture.Result. 5066func (future *GalleriesUpdateFuture) result(client GalleriesClient) (g Gallery, err error) { 5067 var done bool 5068 done, err = future.DoneWithContext(context.Background(), client) 5069 if err != nil { 5070 err = autorest.NewErrorWithError(err, "compute.GalleriesUpdateFuture", "Result", future.Response(), "Polling failure") 5071 return 5072 } 5073 if !done { 5074 g.Response.Response = future.Response() 5075 err = azure.NewAsyncOpIncompleteError("compute.GalleriesUpdateFuture") 5076 return 5077 } 5078 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5079 if g.Response.Response, err = future.GetResult(sender); err == nil && g.Response.Response.StatusCode != http.StatusNoContent { 5080 g, err = client.UpdateResponder(g.Response.Response) 5081 if err != nil { 5082 err = autorest.NewErrorWithError(err, "compute.GalleriesUpdateFuture", "Result", g.Response.Response, "Failure responding to request") 5083 } 5084 } 5085 return 5086} 5087 5088// Gallery specifies information about the Shared Image Gallery that you want to create or update. 5089type Gallery struct { 5090 autorest.Response `json:"-"` 5091 *GalleryProperties `json:"properties,omitempty"` 5092 // ID - READ-ONLY; Resource Id 5093 ID *string `json:"id,omitempty"` 5094 // Name - READ-ONLY; Resource name 5095 Name *string `json:"name,omitempty"` 5096 // Type - READ-ONLY; Resource type 5097 Type *string `json:"type,omitempty"` 5098 // Location - Resource location 5099 Location *string `json:"location,omitempty"` 5100 // Tags - Resource tags 5101 Tags map[string]*string `json:"tags"` 5102} 5103 5104// MarshalJSON is the custom marshaler for Gallery. 5105func (g Gallery) MarshalJSON() ([]byte, error) { 5106 objectMap := make(map[string]interface{}) 5107 if g.GalleryProperties != nil { 5108 objectMap["properties"] = g.GalleryProperties 5109 } 5110 if g.Location != nil { 5111 objectMap["location"] = g.Location 5112 } 5113 if g.Tags != nil { 5114 objectMap["tags"] = g.Tags 5115 } 5116 return json.Marshal(objectMap) 5117} 5118 5119// UnmarshalJSON is the custom unmarshaler for Gallery struct. 5120func (g *Gallery) UnmarshalJSON(body []byte) error { 5121 var m map[string]*json.RawMessage 5122 err := json.Unmarshal(body, &m) 5123 if err != nil { 5124 return err 5125 } 5126 for k, v := range m { 5127 switch k { 5128 case "properties": 5129 if v != nil { 5130 var galleryProperties GalleryProperties 5131 err = json.Unmarshal(*v, &galleryProperties) 5132 if err != nil { 5133 return err 5134 } 5135 g.GalleryProperties = &galleryProperties 5136 } 5137 case "id": 5138 if v != nil { 5139 var ID string 5140 err = json.Unmarshal(*v, &ID) 5141 if err != nil { 5142 return err 5143 } 5144 g.ID = &ID 5145 } 5146 case "name": 5147 if v != nil { 5148 var name string 5149 err = json.Unmarshal(*v, &name) 5150 if err != nil { 5151 return err 5152 } 5153 g.Name = &name 5154 } 5155 case "type": 5156 if v != nil { 5157 var typeVar string 5158 err = json.Unmarshal(*v, &typeVar) 5159 if err != nil { 5160 return err 5161 } 5162 g.Type = &typeVar 5163 } 5164 case "location": 5165 if v != nil { 5166 var location string 5167 err = json.Unmarshal(*v, &location) 5168 if err != nil { 5169 return err 5170 } 5171 g.Location = &location 5172 } 5173 case "tags": 5174 if v != nil { 5175 var tags map[string]*string 5176 err = json.Unmarshal(*v, &tags) 5177 if err != nil { 5178 return err 5179 } 5180 g.Tags = tags 5181 } 5182 } 5183 } 5184 5185 return nil 5186} 5187 5188// GalleryApplication specifies information about the gallery Application Definition that you want to 5189// create or update. 5190type GalleryApplication struct { 5191 autorest.Response `json:"-"` 5192 *GalleryApplicationProperties `json:"properties,omitempty"` 5193 // ID - READ-ONLY; Resource Id 5194 ID *string `json:"id,omitempty"` 5195 // Name - READ-ONLY; Resource name 5196 Name *string `json:"name,omitempty"` 5197 // Type - READ-ONLY; Resource type 5198 Type *string `json:"type,omitempty"` 5199 // Location - Resource location 5200 Location *string `json:"location,omitempty"` 5201 // Tags - Resource tags 5202 Tags map[string]*string `json:"tags"` 5203} 5204 5205// MarshalJSON is the custom marshaler for GalleryApplication. 5206func (ga GalleryApplication) MarshalJSON() ([]byte, error) { 5207 objectMap := make(map[string]interface{}) 5208 if ga.GalleryApplicationProperties != nil { 5209 objectMap["properties"] = ga.GalleryApplicationProperties 5210 } 5211 if ga.Location != nil { 5212 objectMap["location"] = ga.Location 5213 } 5214 if ga.Tags != nil { 5215 objectMap["tags"] = ga.Tags 5216 } 5217 return json.Marshal(objectMap) 5218} 5219 5220// UnmarshalJSON is the custom unmarshaler for GalleryApplication struct. 5221func (ga *GalleryApplication) UnmarshalJSON(body []byte) error { 5222 var m map[string]*json.RawMessage 5223 err := json.Unmarshal(body, &m) 5224 if err != nil { 5225 return err 5226 } 5227 for k, v := range m { 5228 switch k { 5229 case "properties": 5230 if v != nil { 5231 var galleryApplicationProperties GalleryApplicationProperties 5232 err = json.Unmarshal(*v, &galleryApplicationProperties) 5233 if err != nil { 5234 return err 5235 } 5236 ga.GalleryApplicationProperties = &galleryApplicationProperties 5237 } 5238 case "id": 5239 if v != nil { 5240 var ID string 5241 err = json.Unmarshal(*v, &ID) 5242 if err != nil { 5243 return err 5244 } 5245 ga.ID = &ID 5246 } 5247 case "name": 5248 if v != nil { 5249 var name string 5250 err = json.Unmarshal(*v, &name) 5251 if err != nil { 5252 return err 5253 } 5254 ga.Name = &name 5255 } 5256 case "type": 5257 if v != nil { 5258 var typeVar string 5259 err = json.Unmarshal(*v, &typeVar) 5260 if err != nil { 5261 return err 5262 } 5263 ga.Type = &typeVar 5264 } 5265 case "location": 5266 if v != nil { 5267 var location string 5268 err = json.Unmarshal(*v, &location) 5269 if err != nil { 5270 return err 5271 } 5272 ga.Location = &location 5273 } 5274 case "tags": 5275 if v != nil { 5276 var tags map[string]*string 5277 err = json.Unmarshal(*v, &tags) 5278 if err != nil { 5279 return err 5280 } 5281 ga.Tags = tags 5282 } 5283 } 5284 } 5285 5286 return nil 5287} 5288 5289// GalleryApplicationList the List Gallery Applications operation response. 5290type GalleryApplicationList struct { 5291 autorest.Response `json:"-"` 5292 // Value - A list of Gallery Applications. 5293 Value *[]GalleryApplication `json:"value,omitempty"` 5294 // NextLink - The uri to fetch the next page of Application Definitions in the Application Gallery. Call ListNext() with this to fetch the next page of gallery Application Definitions. 5295 NextLink *string `json:"nextLink,omitempty"` 5296} 5297 5298// GalleryApplicationListIterator provides access to a complete listing of GalleryApplication values. 5299type GalleryApplicationListIterator struct { 5300 i int 5301 page GalleryApplicationListPage 5302} 5303 5304// NextWithContext advances to the next value. If there was an error making 5305// the request the iterator does not advance and the error is returned. 5306func (iter *GalleryApplicationListIterator) NextWithContext(ctx context.Context) (err error) { 5307 if tracing.IsEnabled() { 5308 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationListIterator.NextWithContext") 5309 defer func() { 5310 sc := -1 5311 if iter.Response().Response.Response != nil { 5312 sc = iter.Response().Response.Response.StatusCode 5313 } 5314 tracing.EndSpan(ctx, sc, err) 5315 }() 5316 } 5317 iter.i++ 5318 if iter.i < len(iter.page.Values()) { 5319 return nil 5320 } 5321 err = iter.page.NextWithContext(ctx) 5322 if err != nil { 5323 iter.i-- 5324 return err 5325 } 5326 iter.i = 0 5327 return nil 5328} 5329 5330// Next advances to the next value. If there was an error making 5331// the request the iterator does not advance and the error is returned. 5332// Deprecated: Use NextWithContext() instead. 5333func (iter *GalleryApplicationListIterator) Next() error { 5334 return iter.NextWithContext(context.Background()) 5335} 5336 5337// NotDone returns true if the enumeration should be started or is not yet complete. 5338func (iter GalleryApplicationListIterator) NotDone() bool { 5339 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5340} 5341 5342// Response returns the raw server response from the last page request. 5343func (iter GalleryApplicationListIterator) Response() GalleryApplicationList { 5344 return iter.page.Response() 5345} 5346 5347// Value returns the current value or a zero-initialized value if the 5348// iterator has advanced beyond the end of the collection. 5349func (iter GalleryApplicationListIterator) Value() GalleryApplication { 5350 if !iter.page.NotDone() { 5351 return GalleryApplication{} 5352 } 5353 return iter.page.Values()[iter.i] 5354} 5355 5356// Creates a new instance of the GalleryApplicationListIterator type. 5357func NewGalleryApplicationListIterator(page GalleryApplicationListPage) GalleryApplicationListIterator { 5358 return GalleryApplicationListIterator{page: page} 5359} 5360 5361// IsEmpty returns true if the ListResult contains no values. 5362func (gal GalleryApplicationList) IsEmpty() bool { 5363 return gal.Value == nil || len(*gal.Value) == 0 5364} 5365 5366// hasNextLink returns true if the NextLink is not empty. 5367func (gal GalleryApplicationList) hasNextLink() bool { 5368 return gal.NextLink != nil && len(*gal.NextLink) != 0 5369} 5370 5371// galleryApplicationListPreparer prepares a request to retrieve the next set of results. 5372// It returns nil if no more results exist. 5373func (gal GalleryApplicationList) galleryApplicationListPreparer(ctx context.Context) (*http.Request, error) { 5374 if !gal.hasNextLink() { 5375 return nil, nil 5376 } 5377 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5378 autorest.AsJSON(), 5379 autorest.AsGet(), 5380 autorest.WithBaseURL(to.String(gal.NextLink))) 5381} 5382 5383// GalleryApplicationListPage contains a page of GalleryApplication values. 5384type GalleryApplicationListPage struct { 5385 fn func(context.Context, GalleryApplicationList) (GalleryApplicationList, error) 5386 gal GalleryApplicationList 5387} 5388 5389// NextWithContext advances to the next page of values. If there was an error making 5390// the request the page does not advance and the error is returned. 5391func (page *GalleryApplicationListPage) NextWithContext(ctx context.Context) (err error) { 5392 if tracing.IsEnabled() { 5393 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationListPage.NextWithContext") 5394 defer func() { 5395 sc := -1 5396 if page.Response().Response.Response != nil { 5397 sc = page.Response().Response.Response.StatusCode 5398 } 5399 tracing.EndSpan(ctx, sc, err) 5400 }() 5401 } 5402 for { 5403 next, err := page.fn(ctx, page.gal) 5404 if err != nil { 5405 return err 5406 } 5407 page.gal = next 5408 if !next.hasNextLink() || !next.IsEmpty() { 5409 break 5410 } 5411 } 5412 return nil 5413} 5414 5415// Next advances to the next page of values. If there was an error making 5416// the request the page does not advance and the error is returned. 5417// Deprecated: Use NextWithContext() instead. 5418func (page *GalleryApplicationListPage) Next() error { 5419 return page.NextWithContext(context.Background()) 5420} 5421 5422// NotDone returns true if the page enumeration should be started or is not yet complete. 5423func (page GalleryApplicationListPage) NotDone() bool { 5424 return !page.gal.IsEmpty() 5425} 5426 5427// Response returns the raw server response from the last page request. 5428func (page GalleryApplicationListPage) Response() GalleryApplicationList { 5429 return page.gal 5430} 5431 5432// Values returns the slice of values for the current page or nil if there are no values. 5433func (page GalleryApplicationListPage) Values() []GalleryApplication { 5434 if page.gal.IsEmpty() { 5435 return nil 5436 } 5437 return *page.gal.Value 5438} 5439 5440// Creates a new instance of the GalleryApplicationListPage type. 5441func NewGalleryApplicationListPage(cur GalleryApplicationList, getNextPage func(context.Context, GalleryApplicationList) (GalleryApplicationList, error)) GalleryApplicationListPage { 5442 return GalleryApplicationListPage{ 5443 fn: getNextPage, 5444 gal: cur, 5445 } 5446} 5447 5448// GalleryApplicationProperties describes the properties of a gallery Application Definition. 5449type GalleryApplicationProperties struct { 5450 // Description - The description of this gallery Application Definition resource. This property is updatable. 5451 Description *string `json:"description,omitempty"` 5452 // Eula - The Eula agreement for the gallery Application Definition. 5453 Eula *string `json:"eula,omitempty"` 5454 // PrivacyStatementURI - The privacy statement uri. 5455 PrivacyStatementURI *string `json:"privacyStatementUri,omitempty"` 5456 // ReleaseNoteURI - The release note uri. 5457 ReleaseNoteURI *string `json:"releaseNoteUri,omitempty"` 5458 // EndOfLifeDate - The end of life date of the gallery Application Definition. This property can be used for decommissioning purposes. This property is updatable. 5459 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 5460 // SupportedOSType - This property allows you to specify the supported type of the OS that application is built for. <br><br> Possible values are: <br><br> **Windows** <br><br> **Linux**. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' 5461 SupportedOSType OperatingSystemTypes `json:"supportedOSType,omitempty"` 5462} 5463 5464// GalleryApplicationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 5465// long-running operation. 5466type GalleryApplicationsCreateOrUpdateFuture struct { 5467 azure.FutureAPI 5468 // Result returns the result of the asynchronous operation. 5469 // If the operation has not completed it will return an error. 5470 Result func(GalleryApplicationsClient) (GalleryApplication, error) 5471} 5472 5473// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5474func (future *GalleryApplicationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 5475 var azFuture azure.Future 5476 if err := json.Unmarshal(body, &azFuture); err != nil { 5477 return err 5478 } 5479 future.FutureAPI = &azFuture 5480 future.Result = future.result 5481 return nil 5482} 5483 5484// result is the default implementation for GalleryApplicationsCreateOrUpdateFuture.Result. 5485func (future *GalleryApplicationsCreateOrUpdateFuture) result(client GalleryApplicationsClient) (ga GalleryApplication, err error) { 5486 var done bool 5487 done, err = future.DoneWithContext(context.Background(), client) 5488 if err != nil { 5489 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 5490 return 5491 } 5492 if !done { 5493 ga.Response.Response = future.Response() 5494 err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationsCreateOrUpdateFuture") 5495 return 5496 } 5497 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5498 if ga.Response.Response, err = future.GetResult(sender); err == nil && ga.Response.Response.StatusCode != http.StatusNoContent { 5499 ga, err = client.CreateOrUpdateResponder(ga.Response.Response) 5500 if err != nil { 5501 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsCreateOrUpdateFuture", "Result", ga.Response.Response, "Failure responding to request") 5502 } 5503 } 5504 return 5505} 5506 5507// GalleryApplicationsDeleteFuture an abstraction for monitoring and retrieving the results of a 5508// long-running operation. 5509type GalleryApplicationsDeleteFuture struct { 5510 azure.FutureAPI 5511 // Result returns the result of the asynchronous operation. 5512 // If the operation has not completed it will return an error. 5513 Result func(GalleryApplicationsClient) (autorest.Response, error) 5514} 5515 5516// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5517func (future *GalleryApplicationsDeleteFuture) UnmarshalJSON(body []byte) error { 5518 var azFuture azure.Future 5519 if err := json.Unmarshal(body, &azFuture); err != nil { 5520 return err 5521 } 5522 future.FutureAPI = &azFuture 5523 future.Result = future.result 5524 return nil 5525} 5526 5527// result is the default implementation for GalleryApplicationsDeleteFuture.Result. 5528func (future *GalleryApplicationsDeleteFuture) result(client GalleryApplicationsClient) (ar autorest.Response, err error) { 5529 var done bool 5530 done, err = future.DoneWithContext(context.Background(), client) 5531 if err != nil { 5532 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsDeleteFuture", "Result", future.Response(), "Polling failure") 5533 return 5534 } 5535 if !done { 5536 ar.Response = future.Response() 5537 err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationsDeleteFuture") 5538 return 5539 } 5540 ar.Response = future.Response() 5541 return 5542} 5543 5544// GalleryApplicationsUpdateFuture an abstraction for monitoring and retrieving the results of a 5545// long-running operation. 5546type GalleryApplicationsUpdateFuture struct { 5547 azure.FutureAPI 5548 // Result returns the result of the asynchronous operation. 5549 // If the operation has not completed it will return an error. 5550 Result func(GalleryApplicationsClient) (GalleryApplication, error) 5551} 5552 5553// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5554func (future *GalleryApplicationsUpdateFuture) UnmarshalJSON(body []byte) error { 5555 var azFuture azure.Future 5556 if err := json.Unmarshal(body, &azFuture); err != nil { 5557 return err 5558 } 5559 future.FutureAPI = &azFuture 5560 future.Result = future.result 5561 return nil 5562} 5563 5564// result is the default implementation for GalleryApplicationsUpdateFuture.Result. 5565func (future *GalleryApplicationsUpdateFuture) result(client GalleryApplicationsClient) (ga GalleryApplication, err error) { 5566 var done bool 5567 done, err = future.DoneWithContext(context.Background(), client) 5568 if err != nil { 5569 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsUpdateFuture", "Result", future.Response(), "Polling failure") 5570 return 5571 } 5572 if !done { 5573 ga.Response.Response = future.Response() 5574 err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationsUpdateFuture") 5575 return 5576 } 5577 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5578 if ga.Response.Response, err = future.GetResult(sender); err == nil && ga.Response.Response.StatusCode != http.StatusNoContent { 5579 ga, err = client.UpdateResponder(ga.Response.Response) 5580 if err != nil { 5581 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsUpdateFuture", "Result", ga.Response.Response, "Failure responding to request") 5582 } 5583 } 5584 return 5585} 5586 5587// GalleryApplicationUpdate specifies information about the gallery Application Definition that you want to 5588// update. 5589type GalleryApplicationUpdate struct { 5590 *GalleryApplicationProperties `json:"properties,omitempty"` 5591 // ID - READ-ONLY; Resource Id 5592 ID *string `json:"id,omitempty"` 5593 // Name - READ-ONLY; Resource name 5594 Name *string `json:"name,omitempty"` 5595 // Type - READ-ONLY; Resource type 5596 Type *string `json:"type,omitempty"` 5597 // Tags - Resource tags 5598 Tags map[string]*string `json:"tags"` 5599} 5600 5601// MarshalJSON is the custom marshaler for GalleryApplicationUpdate. 5602func (gau GalleryApplicationUpdate) MarshalJSON() ([]byte, error) { 5603 objectMap := make(map[string]interface{}) 5604 if gau.GalleryApplicationProperties != nil { 5605 objectMap["properties"] = gau.GalleryApplicationProperties 5606 } 5607 if gau.Tags != nil { 5608 objectMap["tags"] = gau.Tags 5609 } 5610 return json.Marshal(objectMap) 5611} 5612 5613// UnmarshalJSON is the custom unmarshaler for GalleryApplicationUpdate struct. 5614func (gau *GalleryApplicationUpdate) UnmarshalJSON(body []byte) error { 5615 var m map[string]*json.RawMessage 5616 err := json.Unmarshal(body, &m) 5617 if err != nil { 5618 return err 5619 } 5620 for k, v := range m { 5621 switch k { 5622 case "properties": 5623 if v != nil { 5624 var galleryApplicationProperties GalleryApplicationProperties 5625 err = json.Unmarshal(*v, &galleryApplicationProperties) 5626 if err != nil { 5627 return err 5628 } 5629 gau.GalleryApplicationProperties = &galleryApplicationProperties 5630 } 5631 case "id": 5632 if v != nil { 5633 var ID string 5634 err = json.Unmarshal(*v, &ID) 5635 if err != nil { 5636 return err 5637 } 5638 gau.ID = &ID 5639 } 5640 case "name": 5641 if v != nil { 5642 var name string 5643 err = json.Unmarshal(*v, &name) 5644 if err != nil { 5645 return err 5646 } 5647 gau.Name = &name 5648 } 5649 case "type": 5650 if v != nil { 5651 var typeVar string 5652 err = json.Unmarshal(*v, &typeVar) 5653 if err != nil { 5654 return err 5655 } 5656 gau.Type = &typeVar 5657 } 5658 case "tags": 5659 if v != nil { 5660 var tags map[string]*string 5661 err = json.Unmarshal(*v, &tags) 5662 if err != nil { 5663 return err 5664 } 5665 gau.Tags = tags 5666 } 5667 } 5668 } 5669 5670 return nil 5671} 5672 5673// GalleryApplicationVersion specifies information about the gallery Application Version that you want to 5674// create or update. 5675type GalleryApplicationVersion struct { 5676 autorest.Response `json:"-"` 5677 *GalleryApplicationVersionProperties `json:"properties,omitempty"` 5678 // ID - READ-ONLY; Resource Id 5679 ID *string `json:"id,omitempty"` 5680 // Name - READ-ONLY; Resource name 5681 Name *string `json:"name,omitempty"` 5682 // Type - READ-ONLY; Resource type 5683 Type *string `json:"type,omitempty"` 5684 // Location - Resource location 5685 Location *string `json:"location,omitempty"` 5686 // Tags - Resource tags 5687 Tags map[string]*string `json:"tags"` 5688} 5689 5690// MarshalJSON is the custom marshaler for GalleryApplicationVersion. 5691func (gav GalleryApplicationVersion) MarshalJSON() ([]byte, error) { 5692 objectMap := make(map[string]interface{}) 5693 if gav.GalleryApplicationVersionProperties != nil { 5694 objectMap["properties"] = gav.GalleryApplicationVersionProperties 5695 } 5696 if gav.Location != nil { 5697 objectMap["location"] = gav.Location 5698 } 5699 if gav.Tags != nil { 5700 objectMap["tags"] = gav.Tags 5701 } 5702 return json.Marshal(objectMap) 5703} 5704 5705// UnmarshalJSON is the custom unmarshaler for GalleryApplicationVersion struct. 5706func (gav *GalleryApplicationVersion) UnmarshalJSON(body []byte) error { 5707 var m map[string]*json.RawMessage 5708 err := json.Unmarshal(body, &m) 5709 if err != nil { 5710 return err 5711 } 5712 for k, v := range m { 5713 switch k { 5714 case "properties": 5715 if v != nil { 5716 var galleryApplicationVersionProperties GalleryApplicationVersionProperties 5717 err = json.Unmarshal(*v, &galleryApplicationVersionProperties) 5718 if err != nil { 5719 return err 5720 } 5721 gav.GalleryApplicationVersionProperties = &galleryApplicationVersionProperties 5722 } 5723 case "id": 5724 if v != nil { 5725 var ID string 5726 err = json.Unmarshal(*v, &ID) 5727 if err != nil { 5728 return err 5729 } 5730 gav.ID = &ID 5731 } 5732 case "name": 5733 if v != nil { 5734 var name string 5735 err = json.Unmarshal(*v, &name) 5736 if err != nil { 5737 return err 5738 } 5739 gav.Name = &name 5740 } 5741 case "type": 5742 if v != nil { 5743 var typeVar string 5744 err = json.Unmarshal(*v, &typeVar) 5745 if err != nil { 5746 return err 5747 } 5748 gav.Type = &typeVar 5749 } 5750 case "location": 5751 if v != nil { 5752 var location string 5753 err = json.Unmarshal(*v, &location) 5754 if err != nil { 5755 return err 5756 } 5757 gav.Location = &location 5758 } 5759 case "tags": 5760 if v != nil { 5761 var tags map[string]*string 5762 err = json.Unmarshal(*v, &tags) 5763 if err != nil { 5764 return err 5765 } 5766 gav.Tags = tags 5767 } 5768 } 5769 } 5770 5771 return nil 5772} 5773 5774// GalleryApplicationVersionList the List Gallery Application version operation response. 5775type GalleryApplicationVersionList struct { 5776 autorest.Response `json:"-"` 5777 // Value - A list of gallery Application Versions. 5778 Value *[]GalleryApplicationVersion `json:"value,omitempty"` 5779 // NextLink - The uri to fetch the next page of gallery Application Versions. Call ListNext() with this to fetch the next page of gallery Application Versions. 5780 NextLink *string `json:"nextLink,omitempty"` 5781} 5782 5783// GalleryApplicationVersionListIterator provides access to a complete listing of GalleryApplicationVersion 5784// values. 5785type GalleryApplicationVersionListIterator struct { 5786 i int 5787 page GalleryApplicationVersionListPage 5788} 5789 5790// NextWithContext advances to the next value. If there was an error making 5791// the request the iterator does not advance and the error is returned. 5792func (iter *GalleryApplicationVersionListIterator) NextWithContext(ctx context.Context) (err error) { 5793 if tracing.IsEnabled() { 5794 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionListIterator.NextWithContext") 5795 defer func() { 5796 sc := -1 5797 if iter.Response().Response.Response != nil { 5798 sc = iter.Response().Response.Response.StatusCode 5799 } 5800 tracing.EndSpan(ctx, sc, err) 5801 }() 5802 } 5803 iter.i++ 5804 if iter.i < len(iter.page.Values()) { 5805 return nil 5806 } 5807 err = iter.page.NextWithContext(ctx) 5808 if err != nil { 5809 iter.i-- 5810 return err 5811 } 5812 iter.i = 0 5813 return nil 5814} 5815 5816// Next advances to the next value. If there was an error making 5817// the request the iterator does not advance and the error is returned. 5818// Deprecated: Use NextWithContext() instead. 5819func (iter *GalleryApplicationVersionListIterator) Next() error { 5820 return iter.NextWithContext(context.Background()) 5821} 5822 5823// NotDone returns true if the enumeration should be started or is not yet complete. 5824func (iter GalleryApplicationVersionListIterator) NotDone() bool { 5825 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5826} 5827 5828// Response returns the raw server response from the last page request. 5829func (iter GalleryApplicationVersionListIterator) Response() GalleryApplicationVersionList { 5830 return iter.page.Response() 5831} 5832 5833// Value returns the current value or a zero-initialized value if the 5834// iterator has advanced beyond the end of the collection. 5835func (iter GalleryApplicationVersionListIterator) Value() GalleryApplicationVersion { 5836 if !iter.page.NotDone() { 5837 return GalleryApplicationVersion{} 5838 } 5839 return iter.page.Values()[iter.i] 5840} 5841 5842// Creates a new instance of the GalleryApplicationVersionListIterator type. 5843func NewGalleryApplicationVersionListIterator(page GalleryApplicationVersionListPage) GalleryApplicationVersionListIterator { 5844 return GalleryApplicationVersionListIterator{page: page} 5845} 5846 5847// IsEmpty returns true if the ListResult contains no values. 5848func (gavl GalleryApplicationVersionList) IsEmpty() bool { 5849 return gavl.Value == nil || len(*gavl.Value) == 0 5850} 5851 5852// hasNextLink returns true if the NextLink is not empty. 5853func (gavl GalleryApplicationVersionList) hasNextLink() bool { 5854 return gavl.NextLink != nil && len(*gavl.NextLink) != 0 5855} 5856 5857// galleryApplicationVersionListPreparer prepares a request to retrieve the next set of results. 5858// It returns nil if no more results exist. 5859func (gavl GalleryApplicationVersionList) galleryApplicationVersionListPreparer(ctx context.Context) (*http.Request, error) { 5860 if !gavl.hasNextLink() { 5861 return nil, nil 5862 } 5863 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5864 autorest.AsJSON(), 5865 autorest.AsGet(), 5866 autorest.WithBaseURL(to.String(gavl.NextLink))) 5867} 5868 5869// GalleryApplicationVersionListPage contains a page of GalleryApplicationVersion values. 5870type GalleryApplicationVersionListPage struct { 5871 fn func(context.Context, GalleryApplicationVersionList) (GalleryApplicationVersionList, error) 5872 gavl GalleryApplicationVersionList 5873} 5874 5875// NextWithContext advances to the next page of values. If there was an error making 5876// the request the page does not advance and the error is returned. 5877func (page *GalleryApplicationVersionListPage) NextWithContext(ctx context.Context) (err error) { 5878 if tracing.IsEnabled() { 5879 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionListPage.NextWithContext") 5880 defer func() { 5881 sc := -1 5882 if page.Response().Response.Response != nil { 5883 sc = page.Response().Response.Response.StatusCode 5884 } 5885 tracing.EndSpan(ctx, sc, err) 5886 }() 5887 } 5888 for { 5889 next, err := page.fn(ctx, page.gavl) 5890 if err != nil { 5891 return err 5892 } 5893 page.gavl = next 5894 if !next.hasNextLink() || !next.IsEmpty() { 5895 break 5896 } 5897 } 5898 return nil 5899} 5900 5901// Next advances to the next page of values. If there was an error making 5902// the request the page does not advance and the error is returned. 5903// Deprecated: Use NextWithContext() instead. 5904func (page *GalleryApplicationVersionListPage) Next() error { 5905 return page.NextWithContext(context.Background()) 5906} 5907 5908// NotDone returns true if the page enumeration should be started or is not yet complete. 5909func (page GalleryApplicationVersionListPage) NotDone() bool { 5910 return !page.gavl.IsEmpty() 5911} 5912 5913// Response returns the raw server response from the last page request. 5914func (page GalleryApplicationVersionListPage) Response() GalleryApplicationVersionList { 5915 return page.gavl 5916} 5917 5918// Values returns the slice of values for the current page or nil if there are no values. 5919func (page GalleryApplicationVersionListPage) Values() []GalleryApplicationVersion { 5920 if page.gavl.IsEmpty() { 5921 return nil 5922 } 5923 return *page.gavl.Value 5924} 5925 5926// Creates a new instance of the GalleryApplicationVersionListPage type. 5927func NewGalleryApplicationVersionListPage(cur GalleryApplicationVersionList, getNextPage func(context.Context, GalleryApplicationVersionList) (GalleryApplicationVersionList, error)) GalleryApplicationVersionListPage { 5928 return GalleryApplicationVersionListPage{ 5929 fn: getNextPage, 5930 gavl: cur, 5931 } 5932} 5933 5934// GalleryApplicationVersionProperties describes the properties of a gallery image version. 5935type GalleryApplicationVersionProperties struct { 5936 PublishingProfile *GalleryApplicationVersionPublishingProfile `json:"publishingProfile,omitempty"` 5937 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningState1Creating', 'ProvisioningState1Updating', 'ProvisioningState1Failed', 'ProvisioningState1Succeeded', 'ProvisioningState1Deleting', 'ProvisioningState1Migrating' 5938 ProvisioningState ProvisioningState1 `json:"provisioningState,omitempty"` 5939 // ReplicationStatus - READ-ONLY 5940 ReplicationStatus *ReplicationStatus `json:"replicationStatus,omitempty"` 5941} 5942 5943// MarshalJSON is the custom marshaler for GalleryApplicationVersionProperties. 5944func (gavp GalleryApplicationVersionProperties) MarshalJSON() ([]byte, error) { 5945 objectMap := make(map[string]interface{}) 5946 if gavp.PublishingProfile != nil { 5947 objectMap["publishingProfile"] = gavp.PublishingProfile 5948 } 5949 return json.Marshal(objectMap) 5950} 5951 5952// GalleryApplicationVersionPublishingProfile the publishing profile of a gallery image version. 5953type GalleryApplicationVersionPublishingProfile struct { 5954 Source *UserArtifactSource `json:"source,omitempty"` 5955 ManageActions *UserArtifactManage `json:"manageActions,omitempty"` 5956 // EnableHealthCheck - Optional. Whether or not this application reports health. 5957 EnableHealthCheck *bool `json:"enableHealthCheck,omitempty"` 5958 // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. 5959 TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` 5960 // ReplicaCount - The number of replicas of the Image Version to be created per region. This property would take effect for a region when regionalReplicaCount is not specified. This property is updatable. 5961 ReplicaCount *int32 `json:"replicaCount,omitempty"` 5962 // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. 5963 ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` 5964 // PublishedDate - READ-ONLY; The timestamp for when the gallery image version is published. 5965 PublishedDate *date.Time `json:"publishedDate,omitempty"` 5966 // EndOfLifeDate - The end of life date of the gallery image version. This property can be used for decommissioning purposes. This property is updatable. 5967 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 5968 // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' 5969 StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` 5970} 5971 5972// MarshalJSON is the custom marshaler for GalleryApplicationVersionPublishingProfile. 5973func (gavpp GalleryApplicationVersionPublishingProfile) MarshalJSON() ([]byte, error) { 5974 objectMap := make(map[string]interface{}) 5975 if gavpp.Source != nil { 5976 objectMap["source"] = gavpp.Source 5977 } 5978 if gavpp.ManageActions != nil { 5979 objectMap["manageActions"] = gavpp.ManageActions 5980 } 5981 if gavpp.EnableHealthCheck != nil { 5982 objectMap["enableHealthCheck"] = gavpp.EnableHealthCheck 5983 } 5984 if gavpp.TargetRegions != nil { 5985 objectMap["targetRegions"] = gavpp.TargetRegions 5986 } 5987 if gavpp.ReplicaCount != nil { 5988 objectMap["replicaCount"] = gavpp.ReplicaCount 5989 } 5990 if gavpp.ExcludeFromLatest != nil { 5991 objectMap["excludeFromLatest"] = gavpp.ExcludeFromLatest 5992 } 5993 if gavpp.EndOfLifeDate != nil { 5994 objectMap["endOfLifeDate"] = gavpp.EndOfLifeDate 5995 } 5996 if gavpp.StorageAccountType != "" { 5997 objectMap["storageAccountType"] = gavpp.StorageAccountType 5998 } 5999 return json.Marshal(objectMap) 6000} 6001 6002// GalleryApplicationVersionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results 6003// of a long-running operation. 6004type GalleryApplicationVersionsCreateOrUpdateFuture struct { 6005 azure.FutureAPI 6006 // Result returns the result of the asynchronous operation. 6007 // If the operation has not completed it will return an error. 6008 Result func(GalleryApplicationVersionsClient) (GalleryApplicationVersion, error) 6009} 6010 6011// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6012func (future *GalleryApplicationVersionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 6013 var azFuture azure.Future 6014 if err := json.Unmarshal(body, &azFuture); err != nil { 6015 return err 6016 } 6017 future.FutureAPI = &azFuture 6018 future.Result = future.result 6019 return nil 6020} 6021 6022// result is the default implementation for GalleryApplicationVersionsCreateOrUpdateFuture.Result. 6023func (future *GalleryApplicationVersionsCreateOrUpdateFuture) result(client GalleryApplicationVersionsClient) (gav GalleryApplicationVersion, err error) { 6024 var done bool 6025 done, err = future.DoneWithContext(context.Background(), client) 6026 if err != nil { 6027 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 6028 return 6029 } 6030 if !done { 6031 gav.Response.Response = future.Response() 6032 err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationVersionsCreateOrUpdateFuture") 6033 return 6034 } 6035 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6036 if gav.Response.Response, err = future.GetResult(sender); err == nil && gav.Response.Response.StatusCode != http.StatusNoContent { 6037 gav, err = client.CreateOrUpdateResponder(gav.Response.Response) 6038 if err != nil { 6039 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsCreateOrUpdateFuture", "Result", gav.Response.Response, "Failure responding to request") 6040 } 6041 } 6042 return 6043} 6044 6045// GalleryApplicationVersionsDeleteFuture an abstraction for monitoring and retrieving the results of a 6046// long-running operation. 6047type GalleryApplicationVersionsDeleteFuture struct { 6048 azure.FutureAPI 6049 // Result returns the result of the asynchronous operation. 6050 // If the operation has not completed it will return an error. 6051 Result func(GalleryApplicationVersionsClient) (autorest.Response, error) 6052} 6053 6054// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6055func (future *GalleryApplicationVersionsDeleteFuture) UnmarshalJSON(body []byte) error { 6056 var azFuture azure.Future 6057 if err := json.Unmarshal(body, &azFuture); err != nil { 6058 return err 6059 } 6060 future.FutureAPI = &azFuture 6061 future.Result = future.result 6062 return nil 6063} 6064 6065// result is the default implementation for GalleryApplicationVersionsDeleteFuture.Result. 6066func (future *GalleryApplicationVersionsDeleteFuture) result(client GalleryApplicationVersionsClient) (ar autorest.Response, err error) { 6067 var done bool 6068 done, err = future.DoneWithContext(context.Background(), client) 6069 if err != nil { 6070 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsDeleteFuture", "Result", future.Response(), "Polling failure") 6071 return 6072 } 6073 if !done { 6074 ar.Response = future.Response() 6075 err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationVersionsDeleteFuture") 6076 return 6077 } 6078 ar.Response = future.Response() 6079 return 6080} 6081 6082// GalleryApplicationVersionsUpdateFuture an abstraction for monitoring and retrieving the results of a 6083// long-running operation. 6084type GalleryApplicationVersionsUpdateFuture struct { 6085 azure.FutureAPI 6086 // Result returns the result of the asynchronous operation. 6087 // If the operation has not completed it will return an error. 6088 Result func(GalleryApplicationVersionsClient) (GalleryApplicationVersion, error) 6089} 6090 6091// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6092func (future *GalleryApplicationVersionsUpdateFuture) UnmarshalJSON(body []byte) error { 6093 var azFuture azure.Future 6094 if err := json.Unmarshal(body, &azFuture); err != nil { 6095 return err 6096 } 6097 future.FutureAPI = &azFuture 6098 future.Result = future.result 6099 return nil 6100} 6101 6102// result is the default implementation for GalleryApplicationVersionsUpdateFuture.Result. 6103func (future *GalleryApplicationVersionsUpdateFuture) result(client GalleryApplicationVersionsClient) (gav GalleryApplicationVersion, err error) { 6104 var done bool 6105 done, err = future.DoneWithContext(context.Background(), client) 6106 if err != nil { 6107 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsUpdateFuture", "Result", future.Response(), "Polling failure") 6108 return 6109 } 6110 if !done { 6111 gav.Response.Response = future.Response() 6112 err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationVersionsUpdateFuture") 6113 return 6114 } 6115 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6116 if gav.Response.Response, err = future.GetResult(sender); err == nil && gav.Response.Response.StatusCode != http.StatusNoContent { 6117 gav, err = client.UpdateResponder(gav.Response.Response) 6118 if err != nil { 6119 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsUpdateFuture", "Result", gav.Response.Response, "Failure responding to request") 6120 } 6121 } 6122 return 6123} 6124 6125// GalleryApplicationVersionUpdate specifies information about the gallery Application Version that you 6126// want to update. 6127type GalleryApplicationVersionUpdate struct { 6128 *GalleryApplicationVersionProperties `json:"properties,omitempty"` 6129 // ID - READ-ONLY; Resource Id 6130 ID *string `json:"id,omitempty"` 6131 // Name - READ-ONLY; Resource name 6132 Name *string `json:"name,omitempty"` 6133 // Type - READ-ONLY; Resource type 6134 Type *string `json:"type,omitempty"` 6135 // Tags - Resource tags 6136 Tags map[string]*string `json:"tags"` 6137} 6138 6139// MarshalJSON is the custom marshaler for GalleryApplicationVersionUpdate. 6140func (gavu GalleryApplicationVersionUpdate) MarshalJSON() ([]byte, error) { 6141 objectMap := make(map[string]interface{}) 6142 if gavu.GalleryApplicationVersionProperties != nil { 6143 objectMap["properties"] = gavu.GalleryApplicationVersionProperties 6144 } 6145 if gavu.Tags != nil { 6146 objectMap["tags"] = gavu.Tags 6147 } 6148 return json.Marshal(objectMap) 6149} 6150 6151// UnmarshalJSON is the custom unmarshaler for GalleryApplicationVersionUpdate struct. 6152func (gavu *GalleryApplicationVersionUpdate) UnmarshalJSON(body []byte) error { 6153 var m map[string]*json.RawMessage 6154 err := json.Unmarshal(body, &m) 6155 if err != nil { 6156 return err 6157 } 6158 for k, v := range m { 6159 switch k { 6160 case "properties": 6161 if v != nil { 6162 var galleryApplicationVersionProperties GalleryApplicationVersionProperties 6163 err = json.Unmarshal(*v, &galleryApplicationVersionProperties) 6164 if err != nil { 6165 return err 6166 } 6167 gavu.GalleryApplicationVersionProperties = &galleryApplicationVersionProperties 6168 } 6169 case "id": 6170 if v != nil { 6171 var ID string 6172 err = json.Unmarshal(*v, &ID) 6173 if err != nil { 6174 return err 6175 } 6176 gavu.ID = &ID 6177 } 6178 case "name": 6179 if v != nil { 6180 var name string 6181 err = json.Unmarshal(*v, &name) 6182 if err != nil { 6183 return err 6184 } 6185 gavu.Name = &name 6186 } 6187 case "type": 6188 if v != nil { 6189 var typeVar string 6190 err = json.Unmarshal(*v, &typeVar) 6191 if err != nil { 6192 return err 6193 } 6194 gavu.Type = &typeVar 6195 } 6196 case "tags": 6197 if v != nil { 6198 var tags map[string]*string 6199 err = json.Unmarshal(*v, &tags) 6200 if err != nil { 6201 return err 6202 } 6203 gavu.Tags = tags 6204 } 6205 } 6206 } 6207 6208 return nil 6209} 6210 6211// GalleryArtifactPublishingProfileBase describes the basic gallery artifact publishing profile. 6212type GalleryArtifactPublishingProfileBase struct { 6213 // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. 6214 TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` 6215 // ReplicaCount - The number of replicas of the Image Version to be created per region. This property would take effect for a region when regionalReplicaCount is not specified. This property is updatable. 6216 ReplicaCount *int32 `json:"replicaCount,omitempty"` 6217 // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. 6218 ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` 6219 // PublishedDate - READ-ONLY; The timestamp for when the gallery image version is published. 6220 PublishedDate *date.Time `json:"publishedDate,omitempty"` 6221 // EndOfLifeDate - The end of life date of the gallery image version. This property can be used for decommissioning purposes. This property is updatable. 6222 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 6223 // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' 6224 StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` 6225} 6226 6227// MarshalJSON is the custom marshaler for GalleryArtifactPublishingProfileBase. 6228func (gappb GalleryArtifactPublishingProfileBase) MarshalJSON() ([]byte, error) { 6229 objectMap := make(map[string]interface{}) 6230 if gappb.TargetRegions != nil { 6231 objectMap["targetRegions"] = gappb.TargetRegions 6232 } 6233 if gappb.ReplicaCount != nil { 6234 objectMap["replicaCount"] = gappb.ReplicaCount 6235 } 6236 if gappb.ExcludeFromLatest != nil { 6237 objectMap["excludeFromLatest"] = gappb.ExcludeFromLatest 6238 } 6239 if gappb.EndOfLifeDate != nil { 6240 objectMap["endOfLifeDate"] = gappb.EndOfLifeDate 6241 } 6242 if gappb.StorageAccountType != "" { 6243 objectMap["storageAccountType"] = gappb.StorageAccountType 6244 } 6245 return json.Marshal(objectMap) 6246} 6247 6248// GalleryArtifactSource the source image from which the Image Version is going to be created. 6249type GalleryArtifactSource struct { 6250 ManagedImage *ManagedArtifact `json:"managedImage,omitempty"` 6251} 6252 6253// GalleryArtifactVersionSource the gallery artifact version source. 6254type GalleryArtifactVersionSource struct { 6255 // ID - The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, user image or storage account resource. 6256 ID *string `json:"id,omitempty"` 6257 // URI - The uri of the gallery artifact version source. Currently used to specify vhd/blob source. 6258 URI *string `json:"uri,omitempty"` 6259} 6260 6261// GalleryDataDiskImage this is the data disk image. 6262type GalleryDataDiskImage struct { 6263 // Lun - This property specifies the logical unit number of the data disk. This value is used to identify data disks within the Virtual Machine and therefore must be unique for each data disk attached to the Virtual Machine. 6264 Lun *int32 `json:"lun,omitempty"` 6265 // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. 6266 SizeInGB *int32 `json:"sizeInGB,omitempty"` 6267 // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' 6268 HostCaching HostCaching `json:"hostCaching,omitempty"` 6269 Source *GalleryArtifactVersionSource `json:"source,omitempty"` 6270} 6271 6272// MarshalJSON is the custom marshaler for GalleryDataDiskImage. 6273func (gddi GalleryDataDiskImage) MarshalJSON() ([]byte, error) { 6274 objectMap := make(map[string]interface{}) 6275 if gddi.Lun != nil { 6276 objectMap["lun"] = gddi.Lun 6277 } 6278 if gddi.HostCaching != "" { 6279 objectMap["hostCaching"] = gddi.HostCaching 6280 } 6281 if gddi.Source != nil { 6282 objectMap["source"] = gddi.Source 6283 } 6284 return json.Marshal(objectMap) 6285} 6286 6287// GalleryDiskImage this is the disk image base class. 6288type GalleryDiskImage struct { 6289 // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. 6290 SizeInGB *int32 `json:"sizeInGB,omitempty"` 6291 // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' 6292 HostCaching HostCaching `json:"hostCaching,omitempty"` 6293 Source *GalleryArtifactVersionSource `json:"source,omitempty"` 6294} 6295 6296// MarshalJSON is the custom marshaler for GalleryDiskImage. 6297func (gdi GalleryDiskImage) MarshalJSON() ([]byte, error) { 6298 objectMap := make(map[string]interface{}) 6299 if gdi.HostCaching != "" { 6300 objectMap["hostCaching"] = gdi.HostCaching 6301 } 6302 if gdi.Source != nil { 6303 objectMap["source"] = gdi.Source 6304 } 6305 return json.Marshal(objectMap) 6306} 6307 6308// GalleryIdentifier describes the gallery unique name. 6309type GalleryIdentifier struct { 6310 // UniqueName - READ-ONLY; The unique name of the Shared Image Gallery. This name is generated automatically by Azure. 6311 UniqueName *string `json:"uniqueName,omitempty"` 6312} 6313 6314// MarshalJSON is the custom marshaler for GalleryIdentifier. 6315func (gi GalleryIdentifier) MarshalJSON() ([]byte, error) { 6316 objectMap := make(map[string]interface{}) 6317 return json.Marshal(objectMap) 6318} 6319 6320// GalleryImage specifies information about the gallery image definition that you want to create or update. 6321type GalleryImage struct { 6322 autorest.Response `json:"-"` 6323 *GalleryImageProperties `json:"properties,omitempty"` 6324 // ID - READ-ONLY; Resource Id 6325 ID *string `json:"id,omitempty"` 6326 // Name - READ-ONLY; Resource name 6327 Name *string `json:"name,omitempty"` 6328 // Type - READ-ONLY; Resource type 6329 Type *string `json:"type,omitempty"` 6330 // Location - Resource location 6331 Location *string `json:"location,omitempty"` 6332 // Tags - Resource tags 6333 Tags map[string]*string `json:"tags"` 6334} 6335 6336// MarshalJSON is the custom marshaler for GalleryImage. 6337func (gi GalleryImage) MarshalJSON() ([]byte, error) { 6338 objectMap := make(map[string]interface{}) 6339 if gi.GalleryImageProperties != nil { 6340 objectMap["properties"] = gi.GalleryImageProperties 6341 } 6342 if gi.Location != nil { 6343 objectMap["location"] = gi.Location 6344 } 6345 if gi.Tags != nil { 6346 objectMap["tags"] = gi.Tags 6347 } 6348 return json.Marshal(objectMap) 6349} 6350 6351// UnmarshalJSON is the custom unmarshaler for GalleryImage struct. 6352func (gi *GalleryImage) UnmarshalJSON(body []byte) error { 6353 var m map[string]*json.RawMessage 6354 err := json.Unmarshal(body, &m) 6355 if err != nil { 6356 return err 6357 } 6358 for k, v := range m { 6359 switch k { 6360 case "properties": 6361 if v != nil { 6362 var galleryImageProperties GalleryImageProperties 6363 err = json.Unmarshal(*v, &galleryImageProperties) 6364 if err != nil { 6365 return err 6366 } 6367 gi.GalleryImageProperties = &galleryImageProperties 6368 } 6369 case "id": 6370 if v != nil { 6371 var ID string 6372 err = json.Unmarshal(*v, &ID) 6373 if err != nil { 6374 return err 6375 } 6376 gi.ID = &ID 6377 } 6378 case "name": 6379 if v != nil { 6380 var name string 6381 err = json.Unmarshal(*v, &name) 6382 if err != nil { 6383 return err 6384 } 6385 gi.Name = &name 6386 } 6387 case "type": 6388 if v != nil { 6389 var typeVar string 6390 err = json.Unmarshal(*v, &typeVar) 6391 if err != nil { 6392 return err 6393 } 6394 gi.Type = &typeVar 6395 } 6396 case "location": 6397 if v != nil { 6398 var location string 6399 err = json.Unmarshal(*v, &location) 6400 if err != nil { 6401 return err 6402 } 6403 gi.Location = &location 6404 } 6405 case "tags": 6406 if v != nil { 6407 var tags map[string]*string 6408 err = json.Unmarshal(*v, &tags) 6409 if err != nil { 6410 return err 6411 } 6412 gi.Tags = tags 6413 } 6414 } 6415 } 6416 6417 return nil 6418} 6419 6420// GalleryImageFeature a feature for gallery image. 6421type GalleryImageFeature struct { 6422 // Name - The name of the gallery image feature. 6423 Name *string `json:"name,omitempty"` 6424 // Value - The value of the gallery image feature. 6425 Value *string `json:"value,omitempty"` 6426} 6427 6428// GalleryImageIdentifier this is the gallery image definition identifier. 6429type GalleryImageIdentifier struct { 6430 // Publisher - The name of the gallery image definition publisher. 6431 Publisher *string `json:"publisher,omitempty"` 6432 // Offer - The name of the gallery image definition offer. 6433 Offer *string `json:"offer,omitempty"` 6434 // Sku - The name of the gallery image definition SKU. 6435 Sku *string `json:"sku,omitempty"` 6436} 6437 6438// GalleryImageList the List Gallery Images operation response. 6439type GalleryImageList struct { 6440 autorest.Response `json:"-"` 6441 // Value - A list of Shared Image Gallery images. 6442 Value *[]GalleryImage `json:"value,omitempty"` 6443 // NextLink - The uri to fetch the next page of Image Definitions in the Shared Image Gallery. Call ListNext() with this to fetch the next page of gallery image definitions. 6444 NextLink *string `json:"nextLink,omitempty"` 6445} 6446 6447// GalleryImageListIterator provides access to a complete listing of GalleryImage values. 6448type GalleryImageListIterator struct { 6449 i int 6450 page GalleryImageListPage 6451} 6452 6453// NextWithContext advances to the next value. If there was an error making 6454// the request the iterator does not advance and the error is returned. 6455func (iter *GalleryImageListIterator) NextWithContext(ctx context.Context) (err error) { 6456 if tracing.IsEnabled() { 6457 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageListIterator.NextWithContext") 6458 defer func() { 6459 sc := -1 6460 if iter.Response().Response.Response != nil { 6461 sc = iter.Response().Response.Response.StatusCode 6462 } 6463 tracing.EndSpan(ctx, sc, err) 6464 }() 6465 } 6466 iter.i++ 6467 if iter.i < len(iter.page.Values()) { 6468 return nil 6469 } 6470 err = iter.page.NextWithContext(ctx) 6471 if err != nil { 6472 iter.i-- 6473 return err 6474 } 6475 iter.i = 0 6476 return nil 6477} 6478 6479// Next advances to the next value. If there was an error making 6480// the request the iterator does not advance and the error is returned. 6481// Deprecated: Use NextWithContext() instead. 6482func (iter *GalleryImageListIterator) Next() error { 6483 return iter.NextWithContext(context.Background()) 6484} 6485 6486// NotDone returns true if the enumeration should be started or is not yet complete. 6487func (iter GalleryImageListIterator) NotDone() bool { 6488 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6489} 6490 6491// Response returns the raw server response from the last page request. 6492func (iter GalleryImageListIterator) Response() GalleryImageList { 6493 return iter.page.Response() 6494} 6495 6496// Value returns the current value or a zero-initialized value if the 6497// iterator has advanced beyond the end of the collection. 6498func (iter GalleryImageListIterator) Value() GalleryImage { 6499 if !iter.page.NotDone() { 6500 return GalleryImage{} 6501 } 6502 return iter.page.Values()[iter.i] 6503} 6504 6505// Creates a new instance of the GalleryImageListIterator type. 6506func NewGalleryImageListIterator(page GalleryImageListPage) GalleryImageListIterator { 6507 return GalleryImageListIterator{page: page} 6508} 6509 6510// IsEmpty returns true if the ListResult contains no values. 6511func (gil GalleryImageList) IsEmpty() bool { 6512 return gil.Value == nil || len(*gil.Value) == 0 6513} 6514 6515// hasNextLink returns true if the NextLink is not empty. 6516func (gil GalleryImageList) hasNextLink() bool { 6517 return gil.NextLink != nil && len(*gil.NextLink) != 0 6518} 6519 6520// galleryImageListPreparer prepares a request to retrieve the next set of results. 6521// It returns nil if no more results exist. 6522func (gil GalleryImageList) galleryImageListPreparer(ctx context.Context) (*http.Request, error) { 6523 if !gil.hasNextLink() { 6524 return nil, nil 6525 } 6526 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6527 autorest.AsJSON(), 6528 autorest.AsGet(), 6529 autorest.WithBaseURL(to.String(gil.NextLink))) 6530} 6531 6532// GalleryImageListPage contains a page of GalleryImage values. 6533type GalleryImageListPage struct { 6534 fn func(context.Context, GalleryImageList) (GalleryImageList, error) 6535 gil GalleryImageList 6536} 6537 6538// NextWithContext advances to the next page of values. If there was an error making 6539// the request the page does not advance and the error is returned. 6540func (page *GalleryImageListPage) NextWithContext(ctx context.Context) (err error) { 6541 if tracing.IsEnabled() { 6542 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageListPage.NextWithContext") 6543 defer func() { 6544 sc := -1 6545 if page.Response().Response.Response != nil { 6546 sc = page.Response().Response.Response.StatusCode 6547 } 6548 tracing.EndSpan(ctx, sc, err) 6549 }() 6550 } 6551 for { 6552 next, err := page.fn(ctx, page.gil) 6553 if err != nil { 6554 return err 6555 } 6556 page.gil = next 6557 if !next.hasNextLink() || !next.IsEmpty() { 6558 break 6559 } 6560 } 6561 return nil 6562} 6563 6564// Next advances to the next page of values. If there was an error making 6565// the request the page does not advance and the error is returned. 6566// Deprecated: Use NextWithContext() instead. 6567func (page *GalleryImageListPage) Next() error { 6568 return page.NextWithContext(context.Background()) 6569} 6570 6571// NotDone returns true if the page enumeration should be started or is not yet complete. 6572func (page GalleryImageListPage) NotDone() bool { 6573 return !page.gil.IsEmpty() 6574} 6575 6576// Response returns the raw server response from the last page request. 6577func (page GalleryImageListPage) Response() GalleryImageList { 6578 return page.gil 6579} 6580 6581// Values returns the slice of values for the current page or nil if there are no values. 6582func (page GalleryImageListPage) Values() []GalleryImage { 6583 if page.gil.IsEmpty() { 6584 return nil 6585 } 6586 return *page.gil.Value 6587} 6588 6589// Creates a new instance of the GalleryImageListPage type. 6590func NewGalleryImageListPage(cur GalleryImageList, getNextPage func(context.Context, GalleryImageList) (GalleryImageList, error)) GalleryImageListPage { 6591 return GalleryImageListPage{ 6592 fn: getNextPage, 6593 gil: cur, 6594 } 6595} 6596 6597// GalleryImageProperties describes the properties of a gallery image definition. 6598type GalleryImageProperties struct { 6599 // Description - The description of this gallery image definition resource. This property is updatable. 6600 Description *string `json:"description,omitempty"` 6601 // Eula - The Eula agreement for the gallery image definition. 6602 Eula *string `json:"eula,omitempty"` 6603 // PrivacyStatementURI - The privacy statement uri. 6604 PrivacyStatementURI *string `json:"privacyStatementUri,omitempty"` 6605 // ReleaseNoteURI - The release note uri. 6606 ReleaseNoteURI *string `json:"releaseNoteUri,omitempty"` 6607 // OsType - This property allows you to specify the type of the OS that is included in the disk when creating a VM from a managed image. <br><br> Possible values are: <br><br> **Windows** <br><br> **Linux**. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' 6608 OsType OperatingSystemTypes `json:"osType,omitempty"` 6609 // OsState - This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'. Possible values include: 'OperatingSystemStateTypesGeneralized', 'OperatingSystemStateTypesSpecialized' 6610 OsState OperatingSystemStateTypes `json:"osState,omitempty"` 6611 // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'HyperVGenerationV1', 'HyperVGenerationV2' 6612 HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` 6613 // EndOfLifeDate - The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property is updatable. 6614 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 6615 Identifier *GalleryImageIdentifier `json:"identifier,omitempty"` 6616 Recommended *RecommendedMachineConfiguration `json:"recommended,omitempty"` 6617 Disallowed *Disallowed `json:"disallowed,omitempty"` 6618 PurchasePlan *ImagePurchasePlan `json:"purchasePlan,omitempty"` 6619 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningState2Creating', 'ProvisioningState2Updating', 'ProvisioningState2Failed', 'ProvisioningState2Succeeded', 'ProvisioningState2Deleting', 'ProvisioningState2Migrating' 6620 ProvisioningState ProvisioningState2 `json:"provisioningState,omitempty"` 6621 // Features - A list of gallery image features. 6622 Features *[]GalleryImageFeature `json:"features,omitempty"` 6623} 6624 6625// MarshalJSON is the custom marshaler for GalleryImageProperties. 6626func (gip GalleryImageProperties) MarshalJSON() ([]byte, error) { 6627 objectMap := make(map[string]interface{}) 6628 if gip.Description != nil { 6629 objectMap["description"] = gip.Description 6630 } 6631 if gip.Eula != nil { 6632 objectMap["eula"] = gip.Eula 6633 } 6634 if gip.PrivacyStatementURI != nil { 6635 objectMap["privacyStatementUri"] = gip.PrivacyStatementURI 6636 } 6637 if gip.ReleaseNoteURI != nil { 6638 objectMap["releaseNoteUri"] = gip.ReleaseNoteURI 6639 } 6640 if gip.OsType != "" { 6641 objectMap["osType"] = gip.OsType 6642 } 6643 if gip.OsState != "" { 6644 objectMap["osState"] = gip.OsState 6645 } 6646 if gip.HyperVGeneration != "" { 6647 objectMap["hyperVGeneration"] = gip.HyperVGeneration 6648 } 6649 if gip.EndOfLifeDate != nil { 6650 objectMap["endOfLifeDate"] = gip.EndOfLifeDate 6651 } 6652 if gip.Identifier != nil { 6653 objectMap["identifier"] = gip.Identifier 6654 } 6655 if gip.Recommended != nil { 6656 objectMap["recommended"] = gip.Recommended 6657 } 6658 if gip.Disallowed != nil { 6659 objectMap["disallowed"] = gip.Disallowed 6660 } 6661 if gip.PurchasePlan != nil { 6662 objectMap["purchasePlan"] = gip.PurchasePlan 6663 } 6664 if gip.Features != nil { 6665 objectMap["features"] = gip.Features 6666 } 6667 return json.Marshal(objectMap) 6668} 6669 6670// GalleryImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 6671// long-running operation. 6672type GalleryImagesCreateOrUpdateFuture struct { 6673 azure.FutureAPI 6674 // Result returns the result of the asynchronous operation. 6675 // If the operation has not completed it will return an error. 6676 Result func(GalleryImagesClient) (GalleryImage, error) 6677} 6678 6679// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6680func (future *GalleryImagesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 6681 var azFuture azure.Future 6682 if err := json.Unmarshal(body, &azFuture); err != nil { 6683 return err 6684 } 6685 future.FutureAPI = &azFuture 6686 future.Result = future.result 6687 return nil 6688} 6689 6690// result is the default implementation for GalleryImagesCreateOrUpdateFuture.Result. 6691func (future *GalleryImagesCreateOrUpdateFuture) result(client GalleryImagesClient) (gi GalleryImage, err error) { 6692 var done bool 6693 done, err = future.DoneWithContext(context.Background(), client) 6694 if err != nil { 6695 err = autorest.NewErrorWithError(err, "compute.GalleryImagesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 6696 return 6697 } 6698 if !done { 6699 gi.Response.Response = future.Response() 6700 err = azure.NewAsyncOpIncompleteError("compute.GalleryImagesCreateOrUpdateFuture") 6701 return 6702 } 6703 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6704 if gi.Response.Response, err = future.GetResult(sender); err == nil && gi.Response.Response.StatusCode != http.StatusNoContent { 6705 gi, err = client.CreateOrUpdateResponder(gi.Response.Response) 6706 if err != nil { 6707 err = autorest.NewErrorWithError(err, "compute.GalleryImagesCreateOrUpdateFuture", "Result", gi.Response.Response, "Failure responding to request") 6708 } 6709 } 6710 return 6711} 6712 6713// GalleryImagesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 6714// operation. 6715type GalleryImagesDeleteFuture struct { 6716 azure.FutureAPI 6717 // Result returns the result of the asynchronous operation. 6718 // If the operation has not completed it will return an error. 6719 Result func(GalleryImagesClient) (autorest.Response, error) 6720} 6721 6722// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6723func (future *GalleryImagesDeleteFuture) UnmarshalJSON(body []byte) error { 6724 var azFuture azure.Future 6725 if err := json.Unmarshal(body, &azFuture); err != nil { 6726 return err 6727 } 6728 future.FutureAPI = &azFuture 6729 future.Result = future.result 6730 return nil 6731} 6732 6733// result is the default implementation for GalleryImagesDeleteFuture.Result. 6734func (future *GalleryImagesDeleteFuture) result(client GalleryImagesClient) (ar autorest.Response, err error) { 6735 var done bool 6736 done, err = future.DoneWithContext(context.Background(), client) 6737 if err != nil { 6738 err = autorest.NewErrorWithError(err, "compute.GalleryImagesDeleteFuture", "Result", future.Response(), "Polling failure") 6739 return 6740 } 6741 if !done { 6742 ar.Response = future.Response() 6743 err = azure.NewAsyncOpIncompleteError("compute.GalleryImagesDeleteFuture") 6744 return 6745 } 6746 ar.Response = future.Response() 6747 return 6748} 6749 6750// GalleryImagesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 6751// operation. 6752type GalleryImagesUpdateFuture struct { 6753 azure.FutureAPI 6754 // Result returns the result of the asynchronous operation. 6755 // If the operation has not completed it will return an error. 6756 Result func(GalleryImagesClient) (GalleryImage, error) 6757} 6758 6759// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6760func (future *GalleryImagesUpdateFuture) UnmarshalJSON(body []byte) error { 6761 var azFuture azure.Future 6762 if err := json.Unmarshal(body, &azFuture); err != nil { 6763 return err 6764 } 6765 future.FutureAPI = &azFuture 6766 future.Result = future.result 6767 return nil 6768} 6769 6770// result is the default implementation for GalleryImagesUpdateFuture.Result. 6771func (future *GalleryImagesUpdateFuture) result(client GalleryImagesClient) (gi GalleryImage, err error) { 6772 var done bool 6773 done, err = future.DoneWithContext(context.Background(), client) 6774 if err != nil { 6775 err = autorest.NewErrorWithError(err, "compute.GalleryImagesUpdateFuture", "Result", future.Response(), "Polling failure") 6776 return 6777 } 6778 if !done { 6779 gi.Response.Response = future.Response() 6780 err = azure.NewAsyncOpIncompleteError("compute.GalleryImagesUpdateFuture") 6781 return 6782 } 6783 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6784 if gi.Response.Response, err = future.GetResult(sender); err == nil && gi.Response.Response.StatusCode != http.StatusNoContent { 6785 gi, err = client.UpdateResponder(gi.Response.Response) 6786 if err != nil { 6787 err = autorest.NewErrorWithError(err, "compute.GalleryImagesUpdateFuture", "Result", gi.Response.Response, "Failure responding to request") 6788 } 6789 } 6790 return 6791} 6792 6793// GalleryImageUpdate specifies information about the gallery image definition that you want to update. 6794type GalleryImageUpdate struct { 6795 *GalleryImageProperties `json:"properties,omitempty"` 6796 // ID - READ-ONLY; Resource Id 6797 ID *string `json:"id,omitempty"` 6798 // Name - READ-ONLY; Resource name 6799 Name *string `json:"name,omitempty"` 6800 // Type - READ-ONLY; Resource type 6801 Type *string `json:"type,omitempty"` 6802 // Tags - Resource tags 6803 Tags map[string]*string `json:"tags"` 6804} 6805 6806// MarshalJSON is the custom marshaler for GalleryImageUpdate. 6807func (giu GalleryImageUpdate) MarshalJSON() ([]byte, error) { 6808 objectMap := make(map[string]interface{}) 6809 if giu.GalleryImageProperties != nil { 6810 objectMap["properties"] = giu.GalleryImageProperties 6811 } 6812 if giu.Tags != nil { 6813 objectMap["tags"] = giu.Tags 6814 } 6815 return json.Marshal(objectMap) 6816} 6817 6818// UnmarshalJSON is the custom unmarshaler for GalleryImageUpdate struct. 6819func (giu *GalleryImageUpdate) UnmarshalJSON(body []byte) error { 6820 var m map[string]*json.RawMessage 6821 err := json.Unmarshal(body, &m) 6822 if err != nil { 6823 return err 6824 } 6825 for k, v := range m { 6826 switch k { 6827 case "properties": 6828 if v != nil { 6829 var galleryImageProperties GalleryImageProperties 6830 err = json.Unmarshal(*v, &galleryImageProperties) 6831 if err != nil { 6832 return err 6833 } 6834 giu.GalleryImageProperties = &galleryImageProperties 6835 } 6836 case "id": 6837 if v != nil { 6838 var ID string 6839 err = json.Unmarshal(*v, &ID) 6840 if err != nil { 6841 return err 6842 } 6843 giu.ID = &ID 6844 } 6845 case "name": 6846 if v != nil { 6847 var name string 6848 err = json.Unmarshal(*v, &name) 6849 if err != nil { 6850 return err 6851 } 6852 giu.Name = &name 6853 } 6854 case "type": 6855 if v != nil { 6856 var typeVar string 6857 err = json.Unmarshal(*v, &typeVar) 6858 if err != nil { 6859 return err 6860 } 6861 giu.Type = &typeVar 6862 } 6863 case "tags": 6864 if v != nil { 6865 var tags map[string]*string 6866 err = json.Unmarshal(*v, &tags) 6867 if err != nil { 6868 return err 6869 } 6870 giu.Tags = tags 6871 } 6872 } 6873 } 6874 6875 return nil 6876} 6877 6878// GalleryImageVersion specifies information about the gallery image version that you want to create or 6879// update. 6880type GalleryImageVersion struct { 6881 autorest.Response `json:"-"` 6882 *GalleryImageVersionProperties `json:"properties,omitempty"` 6883 // ID - READ-ONLY; Resource Id 6884 ID *string `json:"id,omitempty"` 6885 // Name - READ-ONLY; Resource name 6886 Name *string `json:"name,omitempty"` 6887 // Type - READ-ONLY; Resource type 6888 Type *string `json:"type,omitempty"` 6889 // Location - Resource location 6890 Location *string `json:"location,omitempty"` 6891 // Tags - Resource tags 6892 Tags map[string]*string `json:"tags"` 6893} 6894 6895// MarshalJSON is the custom marshaler for GalleryImageVersion. 6896func (giv GalleryImageVersion) MarshalJSON() ([]byte, error) { 6897 objectMap := make(map[string]interface{}) 6898 if giv.GalleryImageVersionProperties != nil { 6899 objectMap["properties"] = giv.GalleryImageVersionProperties 6900 } 6901 if giv.Location != nil { 6902 objectMap["location"] = giv.Location 6903 } 6904 if giv.Tags != nil { 6905 objectMap["tags"] = giv.Tags 6906 } 6907 return json.Marshal(objectMap) 6908} 6909 6910// UnmarshalJSON is the custom unmarshaler for GalleryImageVersion struct. 6911func (giv *GalleryImageVersion) UnmarshalJSON(body []byte) error { 6912 var m map[string]*json.RawMessage 6913 err := json.Unmarshal(body, &m) 6914 if err != nil { 6915 return err 6916 } 6917 for k, v := range m { 6918 switch k { 6919 case "properties": 6920 if v != nil { 6921 var galleryImageVersionProperties GalleryImageVersionProperties 6922 err = json.Unmarshal(*v, &galleryImageVersionProperties) 6923 if err != nil { 6924 return err 6925 } 6926 giv.GalleryImageVersionProperties = &galleryImageVersionProperties 6927 } 6928 case "id": 6929 if v != nil { 6930 var ID string 6931 err = json.Unmarshal(*v, &ID) 6932 if err != nil { 6933 return err 6934 } 6935 giv.ID = &ID 6936 } 6937 case "name": 6938 if v != nil { 6939 var name string 6940 err = json.Unmarshal(*v, &name) 6941 if err != nil { 6942 return err 6943 } 6944 giv.Name = &name 6945 } 6946 case "type": 6947 if v != nil { 6948 var typeVar string 6949 err = json.Unmarshal(*v, &typeVar) 6950 if err != nil { 6951 return err 6952 } 6953 giv.Type = &typeVar 6954 } 6955 case "location": 6956 if v != nil { 6957 var location string 6958 err = json.Unmarshal(*v, &location) 6959 if err != nil { 6960 return err 6961 } 6962 giv.Location = &location 6963 } 6964 case "tags": 6965 if v != nil { 6966 var tags map[string]*string 6967 err = json.Unmarshal(*v, &tags) 6968 if err != nil { 6969 return err 6970 } 6971 giv.Tags = tags 6972 } 6973 } 6974 } 6975 6976 return nil 6977} 6978 6979// GalleryImageVersionList the List Gallery Image version operation response. 6980type GalleryImageVersionList struct { 6981 autorest.Response `json:"-"` 6982 // Value - A list of gallery image versions. 6983 Value *[]GalleryImageVersion `json:"value,omitempty"` 6984 // NextLink - The uri to fetch the next page of gallery image versions. Call ListNext() with this to fetch the next page of gallery image versions. 6985 NextLink *string `json:"nextLink,omitempty"` 6986} 6987 6988// GalleryImageVersionListIterator provides access to a complete listing of GalleryImageVersion values. 6989type GalleryImageVersionListIterator struct { 6990 i int 6991 page GalleryImageVersionListPage 6992} 6993 6994// NextWithContext advances to the next value. If there was an error making 6995// the request the iterator does not advance and the error is returned. 6996func (iter *GalleryImageVersionListIterator) NextWithContext(ctx context.Context) (err error) { 6997 if tracing.IsEnabled() { 6998 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionListIterator.NextWithContext") 6999 defer func() { 7000 sc := -1 7001 if iter.Response().Response.Response != nil { 7002 sc = iter.Response().Response.Response.StatusCode 7003 } 7004 tracing.EndSpan(ctx, sc, err) 7005 }() 7006 } 7007 iter.i++ 7008 if iter.i < len(iter.page.Values()) { 7009 return nil 7010 } 7011 err = iter.page.NextWithContext(ctx) 7012 if err != nil { 7013 iter.i-- 7014 return err 7015 } 7016 iter.i = 0 7017 return nil 7018} 7019 7020// Next advances to the next value. If there was an error making 7021// the request the iterator does not advance and the error is returned. 7022// Deprecated: Use NextWithContext() instead. 7023func (iter *GalleryImageVersionListIterator) Next() error { 7024 return iter.NextWithContext(context.Background()) 7025} 7026 7027// NotDone returns true if the enumeration should be started or is not yet complete. 7028func (iter GalleryImageVersionListIterator) NotDone() bool { 7029 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7030} 7031 7032// Response returns the raw server response from the last page request. 7033func (iter GalleryImageVersionListIterator) Response() GalleryImageVersionList { 7034 return iter.page.Response() 7035} 7036 7037// Value returns the current value or a zero-initialized value if the 7038// iterator has advanced beyond the end of the collection. 7039func (iter GalleryImageVersionListIterator) Value() GalleryImageVersion { 7040 if !iter.page.NotDone() { 7041 return GalleryImageVersion{} 7042 } 7043 return iter.page.Values()[iter.i] 7044} 7045 7046// Creates a new instance of the GalleryImageVersionListIterator type. 7047func NewGalleryImageVersionListIterator(page GalleryImageVersionListPage) GalleryImageVersionListIterator { 7048 return GalleryImageVersionListIterator{page: page} 7049} 7050 7051// IsEmpty returns true if the ListResult contains no values. 7052func (givl GalleryImageVersionList) IsEmpty() bool { 7053 return givl.Value == nil || len(*givl.Value) == 0 7054} 7055 7056// hasNextLink returns true if the NextLink is not empty. 7057func (givl GalleryImageVersionList) hasNextLink() bool { 7058 return givl.NextLink != nil && len(*givl.NextLink) != 0 7059} 7060 7061// galleryImageVersionListPreparer prepares a request to retrieve the next set of results. 7062// It returns nil if no more results exist. 7063func (givl GalleryImageVersionList) galleryImageVersionListPreparer(ctx context.Context) (*http.Request, error) { 7064 if !givl.hasNextLink() { 7065 return nil, nil 7066 } 7067 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7068 autorest.AsJSON(), 7069 autorest.AsGet(), 7070 autorest.WithBaseURL(to.String(givl.NextLink))) 7071} 7072 7073// GalleryImageVersionListPage contains a page of GalleryImageVersion values. 7074type GalleryImageVersionListPage struct { 7075 fn func(context.Context, GalleryImageVersionList) (GalleryImageVersionList, error) 7076 givl GalleryImageVersionList 7077} 7078 7079// NextWithContext advances to the next page of values. If there was an error making 7080// the request the page does not advance and the error is returned. 7081func (page *GalleryImageVersionListPage) NextWithContext(ctx context.Context) (err error) { 7082 if tracing.IsEnabled() { 7083 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionListPage.NextWithContext") 7084 defer func() { 7085 sc := -1 7086 if page.Response().Response.Response != nil { 7087 sc = page.Response().Response.Response.StatusCode 7088 } 7089 tracing.EndSpan(ctx, sc, err) 7090 }() 7091 } 7092 for { 7093 next, err := page.fn(ctx, page.givl) 7094 if err != nil { 7095 return err 7096 } 7097 page.givl = next 7098 if !next.hasNextLink() || !next.IsEmpty() { 7099 break 7100 } 7101 } 7102 return nil 7103} 7104 7105// Next advances to the next page of values. If there was an error making 7106// the request the page does not advance and the error is returned. 7107// Deprecated: Use NextWithContext() instead. 7108func (page *GalleryImageVersionListPage) Next() error { 7109 return page.NextWithContext(context.Background()) 7110} 7111 7112// NotDone returns true if the page enumeration should be started or is not yet complete. 7113func (page GalleryImageVersionListPage) NotDone() bool { 7114 return !page.givl.IsEmpty() 7115} 7116 7117// Response returns the raw server response from the last page request. 7118func (page GalleryImageVersionListPage) Response() GalleryImageVersionList { 7119 return page.givl 7120} 7121 7122// Values returns the slice of values for the current page or nil if there are no values. 7123func (page GalleryImageVersionListPage) Values() []GalleryImageVersion { 7124 if page.givl.IsEmpty() { 7125 return nil 7126 } 7127 return *page.givl.Value 7128} 7129 7130// Creates a new instance of the GalleryImageVersionListPage type. 7131func NewGalleryImageVersionListPage(cur GalleryImageVersionList, getNextPage func(context.Context, GalleryImageVersionList) (GalleryImageVersionList, error)) GalleryImageVersionListPage { 7132 return GalleryImageVersionListPage{ 7133 fn: getNextPage, 7134 givl: cur, 7135 } 7136} 7137 7138// GalleryImageVersionProperties describes the properties of a gallery image version. 7139type GalleryImageVersionProperties struct { 7140 PublishingProfile *GalleryImageVersionPublishingProfile `json:"publishingProfile,omitempty"` 7141 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningState3Creating', 'ProvisioningState3Updating', 'ProvisioningState3Failed', 'ProvisioningState3Succeeded', 'ProvisioningState3Deleting', 'ProvisioningState3Migrating' 7142 ProvisioningState ProvisioningState3 `json:"provisioningState,omitempty"` 7143 StorageProfile *GalleryImageVersionStorageProfile `json:"storageProfile,omitempty"` 7144 // ReplicationStatus - READ-ONLY 7145 ReplicationStatus *ReplicationStatus `json:"replicationStatus,omitempty"` 7146} 7147 7148// MarshalJSON is the custom marshaler for GalleryImageVersionProperties. 7149func (givp GalleryImageVersionProperties) MarshalJSON() ([]byte, error) { 7150 objectMap := make(map[string]interface{}) 7151 if givp.PublishingProfile != nil { 7152 objectMap["publishingProfile"] = givp.PublishingProfile 7153 } 7154 if givp.StorageProfile != nil { 7155 objectMap["storageProfile"] = givp.StorageProfile 7156 } 7157 return json.Marshal(objectMap) 7158} 7159 7160// GalleryImageVersionPublishingProfile the publishing profile of a gallery image Version. 7161type GalleryImageVersionPublishingProfile struct { 7162 // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. 7163 TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` 7164 // ReplicaCount - The number of replicas of the Image Version to be created per region. This property would take effect for a region when regionalReplicaCount is not specified. This property is updatable. 7165 ReplicaCount *int32 `json:"replicaCount,omitempty"` 7166 // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. 7167 ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` 7168 // PublishedDate - READ-ONLY; The timestamp for when the gallery image version is published. 7169 PublishedDate *date.Time `json:"publishedDate,omitempty"` 7170 // EndOfLifeDate - The end of life date of the gallery image version. This property can be used for decommissioning purposes. This property is updatable. 7171 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 7172 // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' 7173 StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` 7174} 7175 7176// MarshalJSON is the custom marshaler for GalleryImageVersionPublishingProfile. 7177func (givpp GalleryImageVersionPublishingProfile) MarshalJSON() ([]byte, error) { 7178 objectMap := make(map[string]interface{}) 7179 if givpp.TargetRegions != nil { 7180 objectMap["targetRegions"] = givpp.TargetRegions 7181 } 7182 if givpp.ReplicaCount != nil { 7183 objectMap["replicaCount"] = givpp.ReplicaCount 7184 } 7185 if givpp.ExcludeFromLatest != nil { 7186 objectMap["excludeFromLatest"] = givpp.ExcludeFromLatest 7187 } 7188 if givpp.EndOfLifeDate != nil { 7189 objectMap["endOfLifeDate"] = givpp.EndOfLifeDate 7190 } 7191 if givpp.StorageAccountType != "" { 7192 objectMap["storageAccountType"] = givpp.StorageAccountType 7193 } 7194 return json.Marshal(objectMap) 7195} 7196 7197// GalleryImageVersionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 7198// long-running operation. 7199type GalleryImageVersionsCreateOrUpdateFuture struct { 7200 azure.FutureAPI 7201 // Result returns the result of the asynchronous operation. 7202 // If the operation has not completed it will return an error. 7203 Result func(GalleryImageVersionsClient) (GalleryImageVersion, error) 7204} 7205 7206// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7207func (future *GalleryImageVersionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 7208 var azFuture azure.Future 7209 if err := json.Unmarshal(body, &azFuture); err != nil { 7210 return err 7211 } 7212 future.FutureAPI = &azFuture 7213 future.Result = future.result 7214 return nil 7215} 7216 7217// result is the default implementation for GalleryImageVersionsCreateOrUpdateFuture.Result. 7218func (future *GalleryImageVersionsCreateOrUpdateFuture) result(client GalleryImageVersionsClient) (giv GalleryImageVersion, err error) { 7219 var done bool 7220 done, err = future.DoneWithContext(context.Background(), client) 7221 if err != nil { 7222 err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 7223 return 7224 } 7225 if !done { 7226 giv.Response.Response = future.Response() 7227 err = azure.NewAsyncOpIncompleteError("compute.GalleryImageVersionsCreateOrUpdateFuture") 7228 return 7229 } 7230 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7231 if giv.Response.Response, err = future.GetResult(sender); err == nil && giv.Response.Response.StatusCode != http.StatusNoContent { 7232 giv, err = client.CreateOrUpdateResponder(giv.Response.Response) 7233 if err != nil { 7234 err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsCreateOrUpdateFuture", "Result", giv.Response.Response, "Failure responding to request") 7235 } 7236 } 7237 return 7238} 7239 7240// GalleryImageVersionsDeleteFuture an abstraction for monitoring and retrieving the results of a 7241// long-running operation. 7242type GalleryImageVersionsDeleteFuture struct { 7243 azure.FutureAPI 7244 // Result returns the result of the asynchronous operation. 7245 // If the operation has not completed it will return an error. 7246 Result func(GalleryImageVersionsClient) (autorest.Response, error) 7247} 7248 7249// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7250func (future *GalleryImageVersionsDeleteFuture) UnmarshalJSON(body []byte) error { 7251 var azFuture azure.Future 7252 if err := json.Unmarshal(body, &azFuture); err != nil { 7253 return err 7254 } 7255 future.FutureAPI = &azFuture 7256 future.Result = future.result 7257 return nil 7258} 7259 7260// result is the default implementation for GalleryImageVersionsDeleteFuture.Result. 7261func (future *GalleryImageVersionsDeleteFuture) result(client GalleryImageVersionsClient) (ar autorest.Response, err error) { 7262 var done bool 7263 done, err = future.DoneWithContext(context.Background(), client) 7264 if err != nil { 7265 err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsDeleteFuture", "Result", future.Response(), "Polling failure") 7266 return 7267 } 7268 if !done { 7269 ar.Response = future.Response() 7270 err = azure.NewAsyncOpIncompleteError("compute.GalleryImageVersionsDeleteFuture") 7271 return 7272 } 7273 ar.Response = future.Response() 7274 return 7275} 7276 7277// GalleryImageVersionStorageProfile this is the storage profile of a Gallery Image Version. 7278type GalleryImageVersionStorageProfile struct { 7279 Source *GalleryArtifactVersionSource `json:"source,omitempty"` 7280 OsDiskImage *GalleryOSDiskImage `json:"osDiskImage,omitempty"` 7281 // DataDiskImages - A list of data disk images. 7282 DataDiskImages *[]GalleryDataDiskImage `json:"dataDiskImages,omitempty"` 7283} 7284 7285// GalleryImageVersionsUpdateFuture an abstraction for monitoring and retrieving the results of a 7286// long-running operation. 7287type GalleryImageVersionsUpdateFuture struct { 7288 azure.FutureAPI 7289 // Result returns the result of the asynchronous operation. 7290 // If the operation has not completed it will return an error. 7291 Result func(GalleryImageVersionsClient) (GalleryImageVersion, error) 7292} 7293 7294// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7295func (future *GalleryImageVersionsUpdateFuture) UnmarshalJSON(body []byte) error { 7296 var azFuture azure.Future 7297 if err := json.Unmarshal(body, &azFuture); err != nil { 7298 return err 7299 } 7300 future.FutureAPI = &azFuture 7301 future.Result = future.result 7302 return nil 7303} 7304 7305// result is the default implementation for GalleryImageVersionsUpdateFuture.Result. 7306func (future *GalleryImageVersionsUpdateFuture) result(client GalleryImageVersionsClient) (giv GalleryImageVersion, err error) { 7307 var done bool 7308 done, err = future.DoneWithContext(context.Background(), client) 7309 if err != nil { 7310 err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsUpdateFuture", "Result", future.Response(), "Polling failure") 7311 return 7312 } 7313 if !done { 7314 giv.Response.Response = future.Response() 7315 err = azure.NewAsyncOpIncompleteError("compute.GalleryImageVersionsUpdateFuture") 7316 return 7317 } 7318 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7319 if giv.Response.Response, err = future.GetResult(sender); err == nil && giv.Response.Response.StatusCode != http.StatusNoContent { 7320 giv, err = client.UpdateResponder(giv.Response.Response) 7321 if err != nil { 7322 err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsUpdateFuture", "Result", giv.Response.Response, "Failure responding to request") 7323 } 7324 } 7325 return 7326} 7327 7328// GalleryImageVersionUpdate specifies information about the gallery image version that you want to update. 7329type GalleryImageVersionUpdate struct { 7330 *GalleryImageVersionProperties `json:"properties,omitempty"` 7331 // ID - READ-ONLY; Resource Id 7332 ID *string `json:"id,omitempty"` 7333 // Name - READ-ONLY; Resource name 7334 Name *string `json:"name,omitempty"` 7335 // Type - READ-ONLY; Resource type 7336 Type *string `json:"type,omitempty"` 7337 // Tags - Resource tags 7338 Tags map[string]*string `json:"tags"` 7339} 7340 7341// MarshalJSON is the custom marshaler for GalleryImageVersionUpdate. 7342func (givu GalleryImageVersionUpdate) MarshalJSON() ([]byte, error) { 7343 objectMap := make(map[string]interface{}) 7344 if givu.GalleryImageVersionProperties != nil { 7345 objectMap["properties"] = givu.GalleryImageVersionProperties 7346 } 7347 if givu.Tags != nil { 7348 objectMap["tags"] = givu.Tags 7349 } 7350 return json.Marshal(objectMap) 7351} 7352 7353// UnmarshalJSON is the custom unmarshaler for GalleryImageVersionUpdate struct. 7354func (givu *GalleryImageVersionUpdate) UnmarshalJSON(body []byte) error { 7355 var m map[string]*json.RawMessage 7356 err := json.Unmarshal(body, &m) 7357 if err != nil { 7358 return err 7359 } 7360 for k, v := range m { 7361 switch k { 7362 case "properties": 7363 if v != nil { 7364 var galleryImageVersionProperties GalleryImageVersionProperties 7365 err = json.Unmarshal(*v, &galleryImageVersionProperties) 7366 if err != nil { 7367 return err 7368 } 7369 givu.GalleryImageVersionProperties = &galleryImageVersionProperties 7370 } 7371 case "id": 7372 if v != nil { 7373 var ID string 7374 err = json.Unmarshal(*v, &ID) 7375 if err != nil { 7376 return err 7377 } 7378 givu.ID = &ID 7379 } 7380 case "name": 7381 if v != nil { 7382 var name string 7383 err = json.Unmarshal(*v, &name) 7384 if err != nil { 7385 return err 7386 } 7387 givu.Name = &name 7388 } 7389 case "type": 7390 if v != nil { 7391 var typeVar string 7392 err = json.Unmarshal(*v, &typeVar) 7393 if err != nil { 7394 return err 7395 } 7396 givu.Type = &typeVar 7397 } 7398 case "tags": 7399 if v != nil { 7400 var tags map[string]*string 7401 err = json.Unmarshal(*v, &tags) 7402 if err != nil { 7403 return err 7404 } 7405 givu.Tags = tags 7406 } 7407 } 7408 } 7409 7410 return nil 7411} 7412 7413// GalleryList the List Galleries operation response. 7414type GalleryList struct { 7415 autorest.Response `json:"-"` 7416 // Value - A list of galleries. 7417 Value *[]Gallery `json:"value,omitempty"` 7418 // NextLink - The uri to fetch the next page of galleries. Call ListNext() with this to fetch the next page of galleries. 7419 NextLink *string `json:"nextLink,omitempty"` 7420} 7421 7422// GalleryListIterator provides access to a complete listing of Gallery values. 7423type GalleryListIterator struct { 7424 i int 7425 page GalleryListPage 7426} 7427 7428// NextWithContext advances to the next value. If there was an error making 7429// the request the iterator does not advance and the error is returned. 7430func (iter *GalleryListIterator) NextWithContext(ctx context.Context) (err error) { 7431 if tracing.IsEnabled() { 7432 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryListIterator.NextWithContext") 7433 defer func() { 7434 sc := -1 7435 if iter.Response().Response.Response != nil { 7436 sc = iter.Response().Response.Response.StatusCode 7437 } 7438 tracing.EndSpan(ctx, sc, err) 7439 }() 7440 } 7441 iter.i++ 7442 if iter.i < len(iter.page.Values()) { 7443 return nil 7444 } 7445 err = iter.page.NextWithContext(ctx) 7446 if err != nil { 7447 iter.i-- 7448 return err 7449 } 7450 iter.i = 0 7451 return nil 7452} 7453 7454// Next advances to the next value. If there was an error making 7455// the request the iterator does not advance and the error is returned. 7456// Deprecated: Use NextWithContext() instead. 7457func (iter *GalleryListIterator) Next() error { 7458 return iter.NextWithContext(context.Background()) 7459} 7460 7461// NotDone returns true if the enumeration should be started or is not yet complete. 7462func (iter GalleryListIterator) NotDone() bool { 7463 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7464} 7465 7466// Response returns the raw server response from the last page request. 7467func (iter GalleryListIterator) Response() GalleryList { 7468 return iter.page.Response() 7469} 7470 7471// Value returns the current value or a zero-initialized value if the 7472// iterator has advanced beyond the end of the collection. 7473func (iter GalleryListIterator) Value() Gallery { 7474 if !iter.page.NotDone() { 7475 return Gallery{} 7476 } 7477 return iter.page.Values()[iter.i] 7478} 7479 7480// Creates a new instance of the GalleryListIterator type. 7481func NewGalleryListIterator(page GalleryListPage) GalleryListIterator { 7482 return GalleryListIterator{page: page} 7483} 7484 7485// IsEmpty returns true if the ListResult contains no values. 7486func (gl GalleryList) IsEmpty() bool { 7487 return gl.Value == nil || len(*gl.Value) == 0 7488} 7489 7490// hasNextLink returns true if the NextLink is not empty. 7491func (gl GalleryList) hasNextLink() bool { 7492 return gl.NextLink != nil && len(*gl.NextLink) != 0 7493} 7494 7495// galleryListPreparer prepares a request to retrieve the next set of results. 7496// It returns nil if no more results exist. 7497func (gl GalleryList) galleryListPreparer(ctx context.Context) (*http.Request, error) { 7498 if !gl.hasNextLink() { 7499 return nil, nil 7500 } 7501 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7502 autorest.AsJSON(), 7503 autorest.AsGet(), 7504 autorest.WithBaseURL(to.String(gl.NextLink))) 7505} 7506 7507// GalleryListPage contains a page of Gallery values. 7508type GalleryListPage struct { 7509 fn func(context.Context, GalleryList) (GalleryList, error) 7510 gl GalleryList 7511} 7512 7513// NextWithContext advances to the next page of values. If there was an error making 7514// the request the page does not advance and the error is returned. 7515func (page *GalleryListPage) NextWithContext(ctx context.Context) (err error) { 7516 if tracing.IsEnabled() { 7517 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryListPage.NextWithContext") 7518 defer func() { 7519 sc := -1 7520 if page.Response().Response.Response != nil { 7521 sc = page.Response().Response.Response.StatusCode 7522 } 7523 tracing.EndSpan(ctx, sc, err) 7524 }() 7525 } 7526 for { 7527 next, err := page.fn(ctx, page.gl) 7528 if err != nil { 7529 return err 7530 } 7531 page.gl = next 7532 if !next.hasNextLink() || !next.IsEmpty() { 7533 break 7534 } 7535 } 7536 return nil 7537} 7538 7539// Next advances to the next page of values. If there was an error making 7540// the request the page does not advance and the error is returned. 7541// Deprecated: Use NextWithContext() instead. 7542func (page *GalleryListPage) Next() error { 7543 return page.NextWithContext(context.Background()) 7544} 7545 7546// NotDone returns true if the page enumeration should be started or is not yet complete. 7547func (page GalleryListPage) NotDone() bool { 7548 return !page.gl.IsEmpty() 7549} 7550 7551// Response returns the raw server response from the last page request. 7552func (page GalleryListPage) Response() GalleryList { 7553 return page.gl 7554} 7555 7556// Values returns the slice of values for the current page or nil if there are no values. 7557func (page GalleryListPage) Values() []Gallery { 7558 if page.gl.IsEmpty() { 7559 return nil 7560 } 7561 return *page.gl.Value 7562} 7563 7564// Creates a new instance of the GalleryListPage type. 7565func NewGalleryListPage(cur GalleryList, getNextPage func(context.Context, GalleryList) (GalleryList, error)) GalleryListPage { 7566 return GalleryListPage{ 7567 fn: getNextPage, 7568 gl: cur, 7569 } 7570} 7571 7572// GalleryOSDiskImage this is the OS disk image. 7573type GalleryOSDiskImage struct { 7574 // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. 7575 SizeInGB *int32 `json:"sizeInGB,omitempty"` 7576 // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' 7577 HostCaching HostCaching `json:"hostCaching,omitempty"` 7578 Source *GalleryArtifactVersionSource `json:"source,omitempty"` 7579} 7580 7581// MarshalJSON is the custom marshaler for GalleryOSDiskImage. 7582func (godi GalleryOSDiskImage) MarshalJSON() ([]byte, error) { 7583 objectMap := make(map[string]interface{}) 7584 if godi.HostCaching != "" { 7585 objectMap["hostCaching"] = godi.HostCaching 7586 } 7587 if godi.Source != nil { 7588 objectMap["source"] = godi.Source 7589 } 7590 return json.Marshal(objectMap) 7591} 7592 7593// GalleryProperties describes the properties of a Shared Image Gallery. 7594type GalleryProperties struct { 7595 // Description - The description of this Shared Image Gallery resource. This property is updatable. 7596 Description *string `json:"description,omitempty"` 7597 Identifier *GalleryIdentifier `json:"identifier,omitempty"` 7598 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningStateCreating', 'ProvisioningStateUpdating', 'ProvisioningStateFailed', 'ProvisioningStateSucceeded', 'ProvisioningStateDeleting', 'ProvisioningStateMigrating' 7599 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 7600 SharingProfile *SharingProfile `json:"sharingProfile,omitempty"` 7601} 7602 7603// MarshalJSON is the custom marshaler for GalleryProperties. 7604func (gp GalleryProperties) MarshalJSON() ([]byte, error) { 7605 objectMap := make(map[string]interface{}) 7606 if gp.Description != nil { 7607 objectMap["description"] = gp.Description 7608 } 7609 if gp.Identifier != nil { 7610 objectMap["identifier"] = gp.Identifier 7611 } 7612 if gp.SharingProfile != nil { 7613 objectMap["sharingProfile"] = gp.SharingProfile 7614 } 7615 return json.Marshal(objectMap) 7616} 7617 7618// GallerySharingProfileUpdateFuture an abstraction for monitoring and retrieving the results of a 7619// long-running operation. 7620type GallerySharingProfileUpdateFuture struct { 7621 azure.FutureAPI 7622 // Result returns the result of the asynchronous operation. 7623 // If the operation has not completed it will return an error. 7624 Result func(GallerySharingProfileClient) (SharingUpdate, error) 7625} 7626 7627// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7628func (future *GallerySharingProfileUpdateFuture) UnmarshalJSON(body []byte) error { 7629 var azFuture azure.Future 7630 if err := json.Unmarshal(body, &azFuture); err != nil { 7631 return err 7632 } 7633 future.FutureAPI = &azFuture 7634 future.Result = future.result 7635 return nil 7636} 7637 7638// result is the default implementation for GallerySharingProfileUpdateFuture.Result. 7639func (future *GallerySharingProfileUpdateFuture) result(client GallerySharingProfileClient) (su SharingUpdate, err error) { 7640 var done bool 7641 done, err = future.DoneWithContext(context.Background(), client) 7642 if err != nil { 7643 err = autorest.NewErrorWithError(err, "compute.GallerySharingProfileUpdateFuture", "Result", future.Response(), "Polling failure") 7644 return 7645 } 7646 if !done { 7647 su.Response.Response = future.Response() 7648 err = azure.NewAsyncOpIncompleteError("compute.GallerySharingProfileUpdateFuture") 7649 return 7650 } 7651 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7652 if su.Response.Response, err = future.GetResult(sender); err == nil && su.Response.Response.StatusCode != http.StatusNoContent { 7653 su, err = client.UpdateResponder(su.Response.Response) 7654 if err != nil { 7655 err = autorest.NewErrorWithError(err, "compute.GallerySharingProfileUpdateFuture", "Result", su.Response.Response, "Failure responding to request") 7656 } 7657 } 7658 return 7659} 7660 7661// GalleryUpdate specifies information about the Shared Image Gallery that you want to update. 7662type GalleryUpdate struct { 7663 *GalleryProperties `json:"properties,omitempty"` 7664 // ID - READ-ONLY; Resource Id 7665 ID *string `json:"id,omitempty"` 7666 // Name - READ-ONLY; Resource name 7667 Name *string `json:"name,omitempty"` 7668 // Type - READ-ONLY; Resource type 7669 Type *string `json:"type,omitempty"` 7670 // Tags - Resource tags 7671 Tags map[string]*string `json:"tags"` 7672} 7673 7674// MarshalJSON is the custom marshaler for GalleryUpdate. 7675func (gu GalleryUpdate) MarshalJSON() ([]byte, error) { 7676 objectMap := make(map[string]interface{}) 7677 if gu.GalleryProperties != nil { 7678 objectMap["properties"] = gu.GalleryProperties 7679 } 7680 if gu.Tags != nil { 7681 objectMap["tags"] = gu.Tags 7682 } 7683 return json.Marshal(objectMap) 7684} 7685 7686// UnmarshalJSON is the custom unmarshaler for GalleryUpdate struct. 7687func (gu *GalleryUpdate) UnmarshalJSON(body []byte) error { 7688 var m map[string]*json.RawMessage 7689 err := json.Unmarshal(body, &m) 7690 if err != nil { 7691 return err 7692 } 7693 for k, v := range m { 7694 switch k { 7695 case "properties": 7696 if v != nil { 7697 var galleryProperties GalleryProperties 7698 err = json.Unmarshal(*v, &galleryProperties) 7699 if err != nil { 7700 return err 7701 } 7702 gu.GalleryProperties = &galleryProperties 7703 } 7704 case "id": 7705 if v != nil { 7706 var ID string 7707 err = json.Unmarshal(*v, &ID) 7708 if err != nil { 7709 return err 7710 } 7711 gu.ID = &ID 7712 } 7713 case "name": 7714 if v != nil { 7715 var name string 7716 err = json.Unmarshal(*v, &name) 7717 if err != nil { 7718 return err 7719 } 7720 gu.Name = &name 7721 } 7722 case "type": 7723 if v != nil { 7724 var typeVar string 7725 err = json.Unmarshal(*v, &typeVar) 7726 if err != nil { 7727 return err 7728 } 7729 gu.Type = &typeVar 7730 } 7731 case "tags": 7732 if v != nil { 7733 var tags map[string]*string 7734 err = json.Unmarshal(*v, &tags) 7735 if err != nil { 7736 return err 7737 } 7738 gu.Tags = tags 7739 } 7740 } 7741 } 7742 7743 return nil 7744} 7745 7746// GrantAccessData data used for requesting a SAS. 7747type GrantAccessData struct { 7748 // Access - Possible values include: 'AccessLevelNone', 'AccessLevelRead', 'AccessLevelWrite' 7749 Access AccessLevel `json:"access,omitempty"` 7750 // DurationInSeconds - Time duration in seconds until the SAS access expires. 7751 DurationInSeconds *int32 `json:"durationInSeconds,omitempty"` 7752} 7753 7754// HardwareProfile specifies the hardware settings for the virtual machine. 7755type HardwareProfile struct { 7756 // VMSize - Specifies the size of the virtual machine. <br><br> The enum data type is currently deprecated and will be removed by December 23rd 2023. <br><br> Recommended way to get the list of available sizes is using these APIs: <br><br> [List all available virtual machine sizes in an availability set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) <br><br> [List all available virtual machine sizes in a region]( https://docs.microsoft.com/rest/api/compute/resourceskus/list) <br><br> [List all available virtual machine sizes for resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). For more information about virtual machine sizes, see [Sizes for virtual machines](https://docs.microsoft.com/azure/virtual-machines/sizes). <br><br> The available VM sizes depend on region and availability set. Possible values include: 'VirtualMachineSizeTypesBasicA0', 'VirtualMachineSizeTypesBasicA1', 'VirtualMachineSizeTypesBasicA2', 'VirtualMachineSizeTypesBasicA3', 'VirtualMachineSizeTypesBasicA4', 'VirtualMachineSizeTypesStandardA0', 'VirtualMachineSizeTypesStandardA1', 'VirtualMachineSizeTypesStandardA2', 'VirtualMachineSizeTypesStandardA3', 'VirtualMachineSizeTypesStandardA4', 'VirtualMachineSizeTypesStandardA5', 'VirtualMachineSizeTypesStandardA6', 'VirtualMachineSizeTypesStandardA7', 'VirtualMachineSizeTypesStandardA8', 'VirtualMachineSizeTypesStandardA9', 'VirtualMachineSizeTypesStandardA10', 'VirtualMachineSizeTypesStandardA11', 'VirtualMachineSizeTypesStandardA1V2', 'VirtualMachineSizeTypesStandardA2V2', 'VirtualMachineSizeTypesStandardA4V2', 'VirtualMachineSizeTypesStandardA8V2', 'VirtualMachineSizeTypesStandardA2mV2', 'VirtualMachineSizeTypesStandardA4mV2', 'VirtualMachineSizeTypesStandardA8mV2', 'VirtualMachineSizeTypesStandardB1s', 'VirtualMachineSizeTypesStandardB1ms', 'VirtualMachineSizeTypesStandardB2s', 'VirtualMachineSizeTypesStandardB2ms', 'VirtualMachineSizeTypesStandardB4ms', 'VirtualMachineSizeTypesStandardB8ms', 'VirtualMachineSizeTypesStandardD1', 'VirtualMachineSizeTypesStandardD2', 'VirtualMachineSizeTypesStandardD3', 'VirtualMachineSizeTypesStandardD4', 'VirtualMachineSizeTypesStandardD11', 'VirtualMachineSizeTypesStandardD12', 'VirtualMachineSizeTypesStandardD13', 'VirtualMachineSizeTypesStandardD14', 'VirtualMachineSizeTypesStandardD1V2', 'VirtualMachineSizeTypesStandardD2V2', 'VirtualMachineSizeTypesStandardD3V2', 'VirtualMachineSizeTypesStandardD4V2', 'VirtualMachineSizeTypesStandardD5V2', 'VirtualMachineSizeTypesStandardD2V3', 'VirtualMachineSizeTypesStandardD4V3', 'VirtualMachineSizeTypesStandardD8V3', 'VirtualMachineSizeTypesStandardD16V3', 'VirtualMachineSizeTypesStandardD32V3', 'VirtualMachineSizeTypesStandardD64V3', 'VirtualMachineSizeTypesStandardD2sV3', 'VirtualMachineSizeTypesStandardD4sV3', 'VirtualMachineSizeTypesStandardD8sV3', 'VirtualMachineSizeTypesStandardD16sV3', 'VirtualMachineSizeTypesStandardD32sV3', 'VirtualMachineSizeTypesStandardD64sV3', 'VirtualMachineSizeTypesStandardD11V2', 'VirtualMachineSizeTypesStandardD12V2', 'VirtualMachineSizeTypesStandardD13V2', 'VirtualMachineSizeTypesStandardD14V2', 'VirtualMachineSizeTypesStandardD15V2', 'VirtualMachineSizeTypesStandardDS1', 'VirtualMachineSizeTypesStandardDS2', 'VirtualMachineSizeTypesStandardDS3', 'VirtualMachineSizeTypesStandardDS4', 'VirtualMachineSizeTypesStandardDS11', 'VirtualMachineSizeTypesStandardDS12', 'VirtualMachineSizeTypesStandardDS13', 'VirtualMachineSizeTypesStandardDS14', 'VirtualMachineSizeTypesStandardDS1V2', 'VirtualMachineSizeTypesStandardDS2V2', 'VirtualMachineSizeTypesStandardDS3V2', 'VirtualMachineSizeTypesStandardDS4V2', 'VirtualMachineSizeTypesStandardDS5V2', 'VirtualMachineSizeTypesStandardDS11V2', 'VirtualMachineSizeTypesStandardDS12V2', 'VirtualMachineSizeTypesStandardDS13V2', 'VirtualMachineSizeTypesStandardDS14V2', 'VirtualMachineSizeTypesStandardDS15V2', 'VirtualMachineSizeTypesStandardDS134V2', 'VirtualMachineSizeTypesStandardDS132V2', 'VirtualMachineSizeTypesStandardDS148V2', 'VirtualMachineSizeTypesStandardDS144V2', 'VirtualMachineSizeTypesStandardE2V3', 'VirtualMachineSizeTypesStandardE4V3', 'VirtualMachineSizeTypesStandardE8V3', 'VirtualMachineSizeTypesStandardE16V3', 'VirtualMachineSizeTypesStandardE32V3', 'VirtualMachineSizeTypesStandardE64V3', 'VirtualMachineSizeTypesStandardE2sV3', 'VirtualMachineSizeTypesStandardE4sV3', 'VirtualMachineSizeTypesStandardE8sV3', 'VirtualMachineSizeTypesStandardE16sV3', 'VirtualMachineSizeTypesStandardE32sV3', 'VirtualMachineSizeTypesStandardE64sV3', 'VirtualMachineSizeTypesStandardE3216V3', 'VirtualMachineSizeTypesStandardE328sV3', 'VirtualMachineSizeTypesStandardE6432sV3', 'VirtualMachineSizeTypesStandardE6416sV3', 'VirtualMachineSizeTypesStandardF1', 'VirtualMachineSizeTypesStandardF2', 'VirtualMachineSizeTypesStandardF4', 'VirtualMachineSizeTypesStandardF8', 'VirtualMachineSizeTypesStandardF16', 'VirtualMachineSizeTypesStandardF1s', 'VirtualMachineSizeTypesStandardF2s', 'VirtualMachineSizeTypesStandardF4s', 'VirtualMachineSizeTypesStandardF8s', 'VirtualMachineSizeTypesStandardF16s', 'VirtualMachineSizeTypesStandardF2sV2', 'VirtualMachineSizeTypesStandardF4sV2', 'VirtualMachineSizeTypesStandardF8sV2', 'VirtualMachineSizeTypesStandardF16sV2', 'VirtualMachineSizeTypesStandardF32sV2', 'VirtualMachineSizeTypesStandardF64sV2', 'VirtualMachineSizeTypesStandardF72sV2', 'VirtualMachineSizeTypesStandardG1', 'VirtualMachineSizeTypesStandardG2', 'VirtualMachineSizeTypesStandardG3', 'VirtualMachineSizeTypesStandardG4', 'VirtualMachineSizeTypesStandardG5', 'VirtualMachineSizeTypesStandardGS1', 'VirtualMachineSizeTypesStandardGS2', 'VirtualMachineSizeTypesStandardGS3', 'VirtualMachineSizeTypesStandardGS4', 'VirtualMachineSizeTypesStandardGS5', 'VirtualMachineSizeTypesStandardGS48', 'VirtualMachineSizeTypesStandardGS44', 'VirtualMachineSizeTypesStandardGS516', 'VirtualMachineSizeTypesStandardGS58', 'VirtualMachineSizeTypesStandardH8', 'VirtualMachineSizeTypesStandardH16', 'VirtualMachineSizeTypesStandardH8m', 'VirtualMachineSizeTypesStandardH16m', 'VirtualMachineSizeTypesStandardH16r', 'VirtualMachineSizeTypesStandardH16mr', 'VirtualMachineSizeTypesStandardL4s', 'VirtualMachineSizeTypesStandardL8s', 'VirtualMachineSizeTypesStandardL16s', 'VirtualMachineSizeTypesStandardL32s', 'VirtualMachineSizeTypesStandardM64s', 'VirtualMachineSizeTypesStandardM64ms', 'VirtualMachineSizeTypesStandardM128s', 'VirtualMachineSizeTypesStandardM128ms', 'VirtualMachineSizeTypesStandardM6432ms', 'VirtualMachineSizeTypesStandardM6416ms', 'VirtualMachineSizeTypesStandardM12864ms', 'VirtualMachineSizeTypesStandardM12832ms', 'VirtualMachineSizeTypesStandardNC6', 'VirtualMachineSizeTypesStandardNC12', 'VirtualMachineSizeTypesStandardNC24', 'VirtualMachineSizeTypesStandardNC24r', 'VirtualMachineSizeTypesStandardNC6sV2', 'VirtualMachineSizeTypesStandardNC12sV2', 'VirtualMachineSizeTypesStandardNC24sV2', 'VirtualMachineSizeTypesStandardNC24rsV2', 'VirtualMachineSizeTypesStandardNC6sV3', 'VirtualMachineSizeTypesStandardNC12sV3', 'VirtualMachineSizeTypesStandardNC24sV3', 'VirtualMachineSizeTypesStandardNC24rsV3', 'VirtualMachineSizeTypesStandardND6s', 'VirtualMachineSizeTypesStandardND12s', 'VirtualMachineSizeTypesStandardND24s', 'VirtualMachineSizeTypesStandardND24rs', 'VirtualMachineSizeTypesStandardNV6', 'VirtualMachineSizeTypesStandardNV12', 'VirtualMachineSizeTypesStandardNV24' 7757 VMSize VirtualMachineSizeTypes `json:"vmSize,omitempty"` 7758} 7759 7760// Image the source user image virtual hard disk. The virtual hard disk will be copied before being 7761// attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not 7762// exist. 7763type Image struct { 7764 autorest.Response `json:"-"` 7765 *ImageProperties `json:"properties,omitempty"` 7766 // ExtendedLocation - The extended location of the Image. 7767 ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` 7768 // ID - READ-ONLY; Resource Id 7769 ID *string `json:"id,omitempty"` 7770 // Name - READ-ONLY; Resource name 7771 Name *string `json:"name,omitempty"` 7772 // Type - READ-ONLY; Resource type 7773 Type *string `json:"type,omitempty"` 7774 // Location - Resource location 7775 Location *string `json:"location,omitempty"` 7776 // Tags - Resource tags 7777 Tags map[string]*string `json:"tags"` 7778} 7779 7780// MarshalJSON is the custom marshaler for Image. 7781func (i Image) MarshalJSON() ([]byte, error) { 7782 objectMap := make(map[string]interface{}) 7783 if i.ImageProperties != nil { 7784 objectMap["properties"] = i.ImageProperties 7785 } 7786 if i.ExtendedLocation != nil { 7787 objectMap["extendedLocation"] = i.ExtendedLocation 7788 } 7789 if i.Location != nil { 7790 objectMap["location"] = i.Location 7791 } 7792 if i.Tags != nil { 7793 objectMap["tags"] = i.Tags 7794 } 7795 return json.Marshal(objectMap) 7796} 7797 7798// UnmarshalJSON is the custom unmarshaler for Image struct. 7799func (i *Image) UnmarshalJSON(body []byte) error { 7800 var m map[string]*json.RawMessage 7801 err := json.Unmarshal(body, &m) 7802 if err != nil { 7803 return err 7804 } 7805 for k, v := range m { 7806 switch k { 7807 case "properties": 7808 if v != nil { 7809 var imageProperties ImageProperties 7810 err = json.Unmarshal(*v, &imageProperties) 7811 if err != nil { 7812 return err 7813 } 7814 i.ImageProperties = &imageProperties 7815 } 7816 case "extendedLocation": 7817 if v != nil { 7818 var extendedLocation ExtendedLocation 7819 err = json.Unmarshal(*v, &extendedLocation) 7820 if err != nil { 7821 return err 7822 } 7823 i.ExtendedLocation = &extendedLocation 7824 } 7825 case "id": 7826 if v != nil { 7827 var ID string 7828 err = json.Unmarshal(*v, &ID) 7829 if err != nil { 7830 return err 7831 } 7832 i.ID = &ID 7833 } 7834 case "name": 7835 if v != nil { 7836 var name string 7837 err = json.Unmarshal(*v, &name) 7838 if err != nil { 7839 return err 7840 } 7841 i.Name = &name 7842 } 7843 case "type": 7844 if v != nil { 7845 var typeVar string 7846 err = json.Unmarshal(*v, &typeVar) 7847 if err != nil { 7848 return err 7849 } 7850 i.Type = &typeVar 7851 } 7852 case "location": 7853 if v != nil { 7854 var location string 7855 err = json.Unmarshal(*v, &location) 7856 if err != nil { 7857 return err 7858 } 7859 i.Location = &location 7860 } 7861 case "tags": 7862 if v != nil { 7863 var tags map[string]*string 7864 err = json.Unmarshal(*v, &tags) 7865 if err != nil { 7866 return err 7867 } 7868 i.Tags = tags 7869 } 7870 } 7871 } 7872 7873 return nil 7874} 7875 7876// ImageDataDisk describes a data disk. 7877type ImageDataDisk struct { 7878 // 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. 7879 Lun *int32 `json:"lun,omitempty"` 7880 // Snapshot - The snapshot. 7881 Snapshot *SubResource `json:"snapshot,omitempty"` 7882 // ManagedDisk - The managedDisk. 7883 ManagedDisk *SubResource `json:"managedDisk,omitempty"` 7884 // BlobURI - The Virtual Hard Disk. 7885 BlobURI *string `json:"blobUri,omitempty"` 7886 // 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' 7887 Caching CachingTypes `json:"caching,omitempty"` 7888 // 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 7889 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 7890 // 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', 'StorageAccountTypesPremiumZRS', 'StorageAccountTypesStandardSSDZRS' 7891 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 7892 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. 7893 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 7894} 7895 7896// ImageDisk describes a image disk. 7897type ImageDisk struct { 7898 // Snapshot - The snapshot. 7899 Snapshot *SubResource `json:"snapshot,omitempty"` 7900 // ManagedDisk - The managedDisk. 7901 ManagedDisk *SubResource `json:"managedDisk,omitempty"` 7902 // BlobURI - The Virtual Hard Disk. 7903 BlobURI *string `json:"blobUri,omitempty"` 7904 // 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' 7905 Caching CachingTypes `json:"caching,omitempty"` 7906 // 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 7907 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 7908 // 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', 'StorageAccountTypesPremiumZRS', 'StorageAccountTypesStandardSSDZRS' 7909 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 7910 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. 7911 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 7912} 7913 7914// ImageDiskReference the source image used for creating the disk. 7915type ImageDiskReference struct { 7916 // ID - A relative uri containing either a Platform Image Repository or user image reference. 7917 ID *string `json:"id,omitempty"` 7918 // 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. 7919 Lun *int32 `json:"lun,omitempty"` 7920} 7921 7922// ImageListResult the List Image operation response. 7923type ImageListResult struct { 7924 autorest.Response `json:"-"` 7925 // Value - The list of Images. 7926 Value *[]Image `json:"value,omitempty"` 7927 // NextLink - The uri to fetch the next page of Images. Call ListNext() with this to fetch the next page of Images. 7928 NextLink *string `json:"nextLink,omitempty"` 7929} 7930 7931// ImageListResultIterator provides access to a complete listing of Image values. 7932type ImageListResultIterator struct { 7933 i int 7934 page ImageListResultPage 7935} 7936 7937// NextWithContext advances to the next value. If there was an error making 7938// the request the iterator does not advance and the error is returned. 7939func (iter *ImageListResultIterator) NextWithContext(ctx context.Context) (err error) { 7940 if tracing.IsEnabled() { 7941 ctx = tracing.StartSpan(ctx, fqdn+"/ImageListResultIterator.NextWithContext") 7942 defer func() { 7943 sc := -1 7944 if iter.Response().Response.Response != nil { 7945 sc = iter.Response().Response.Response.StatusCode 7946 } 7947 tracing.EndSpan(ctx, sc, err) 7948 }() 7949 } 7950 iter.i++ 7951 if iter.i < len(iter.page.Values()) { 7952 return nil 7953 } 7954 err = iter.page.NextWithContext(ctx) 7955 if err != nil { 7956 iter.i-- 7957 return err 7958 } 7959 iter.i = 0 7960 return nil 7961} 7962 7963// Next advances to the next value. If there was an error making 7964// the request the iterator does not advance and the error is returned. 7965// Deprecated: Use NextWithContext() instead. 7966func (iter *ImageListResultIterator) Next() error { 7967 return iter.NextWithContext(context.Background()) 7968} 7969 7970// NotDone returns true if the enumeration should be started or is not yet complete. 7971func (iter ImageListResultIterator) NotDone() bool { 7972 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7973} 7974 7975// Response returns the raw server response from the last page request. 7976func (iter ImageListResultIterator) Response() ImageListResult { 7977 return iter.page.Response() 7978} 7979 7980// Value returns the current value or a zero-initialized value if the 7981// iterator has advanced beyond the end of the collection. 7982func (iter ImageListResultIterator) Value() Image { 7983 if !iter.page.NotDone() { 7984 return Image{} 7985 } 7986 return iter.page.Values()[iter.i] 7987} 7988 7989// Creates a new instance of the ImageListResultIterator type. 7990func NewImageListResultIterator(page ImageListResultPage) ImageListResultIterator { 7991 return ImageListResultIterator{page: page} 7992} 7993 7994// IsEmpty returns true if the ListResult contains no values. 7995func (ilr ImageListResult) IsEmpty() bool { 7996 return ilr.Value == nil || len(*ilr.Value) == 0 7997} 7998 7999// hasNextLink returns true if the NextLink is not empty. 8000func (ilr ImageListResult) hasNextLink() bool { 8001 return ilr.NextLink != nil && len(*ilr.NextLink) != 0 8002} 8003 8004// imageListResultPreparer prepares a request to retrieve the next set of results. 8005// It returns nil if no more results exist. 8006func (ilr ImageListResult) imageListResultPreparer(ctx context.Context) (*http.Request, error) { 8007 if !ilr.hasNextLink() { 8008 return nil, nil 8009 } 8010 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8011 autorest.AsJSON(), 8012 autorest.AsGet(), 8013 autorest.WithBaseURL(to.String(ilr.NextLink))) 8014} 8015 8016// ImageListResultPage contains a page of Image values. 8017type ImageListResultPage struct { 8018 fn func(context.Context, ImageListResult) (ImageListResult, error) 8019 ilr ImageListResult 8020} 8021 8022// NextWithContext advances to the next page of values. If there was an error making 8023// the request the page does not advance and the error is returned. 8024func (page *ImageListResultPage) NextWithContext(ctx context.Context) (err error) { 8025 if tracing.IsEnabled() { 8026 ctx = tracing.StartSpan(ctx, fqdn+"/ImageListResultPage.NextWithContext") 8027 defer func() { 8028 sc := -1 8029 if page.Response().Response.Response != nil { 8030 sc = page.Response().Response.Response.StatusCode 8031 } 8032 tracing.EndSpan(ctx, sc, err) 8033 }() 8034 } 8035 for { 8036 next, err := page.fn(ctx, page.ilr) 8037 if err != nil { 8038 return err 8039 } 8040 page.ilr = next 8041 if !next.hasNextLink() || !next.IsEmpty() { 8042 break 8043 } 8044 } 8045 return nil 8046} 8047 8048// Next advances to the next page of values. If there was an error making 8049// the request the page does not advance and the error is returned. 8050// Deprecated: Use NextWithContext() instead. 8051func (page *ImageListResultPage) Next() error { 8052 return page.NextWithContext(context.Background()) 8053} 8054 8055// NotDone returns true if the page enumeration should be started or is not yet complete. 8056func (page ImageListResultPage) NotDone() bool { 8057 return !page.ilr.IsEmpty() 8058} 8059 8060// Response returns the raw server response from the last page request. 8061func (page ImageListResultPage) Response() ImageListResult { 8062 return page.ilr 8063} 8064 8065// Values returns the slice of values for the current page or nil if there are no values. 8066func (page ImageListResultPage) Values() []Image { 8067 if page.ilr.IsEmpty() { 8068 return nil 8069 } 8070 return *page.ilr.Value 8071} 8072 8073// Creates a new instance of the ImageListResultPage type. 8074func NewImageListResultPage(cur ImageListResult, getNextPage func(context.Context, ImageListResult) (ImageListResult, error)) ImageListResultPage { 8075 return ImageListResultPage{ 8076 fn: getNextPage, 8077 ilr: cur, 8078 } 8079} 8080 8081// ImageOSDisk describes an Operating System disk. 8082type ImageOSDisk struct { 8083 // 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: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' 8084 OsType OperatingSystemTypes `json:"osType,omitempty"` 8085 // OsState - The OS State. Possible values include: 'OperatingSystemStateTypesGeneralized', 'OperatingSystemStateTypesSpecialized' 8086 OsState OperatingSystemStateTypes `json:"osState,omitempty"` 8087 // Snapshot - The snapshot. 8088 Snapshot *SubResource `json:"snapshot,omitempty"` 8089 // ManagedDisk - The managedDisk. 8090 ManagedDisk *SubResource `json:"managedDisk,omitempty"` 8091 // BlobURI - The Virtual Hard Disk. 8092 BlobURI *string `json:"blobUri,omitempty"` 8093 // 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' 8094 Caching CachingTypes `json:"caching,omitempty"` 8095 // 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 8096 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 8097 // 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', 'StorageAccountTypesPremiumZRS', 'StorageAccountTypesStandardSSDZRS' 8098 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 8099 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. 8100 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 8101} 8102 8103// ImageProperties describes the properties of an Image. 8104type ImageProperties struct { 8105 // SourceVirtualMachine - The source virtual machine from which Image is created. 8106 SourceVirtualMachine *SubResource `json:"sourceVirtualMachine,omitempty"` 8107 // StorageProfile - Specifies the storage settings for the virtual machine disks. 8108 StorageProfile *ImageStorageProfile `json:"storageProfile,omitempty"` 8109 // ProvisioningState - READ-ONLY; The provisioning state. 8110 ProvisioningState *string `json:"provisioningState,omitempty"` 8111 // HyperVGeneration - Specifies the HyperVGenerationType of the VirtualMachine created from the image. From API Version 2019-03-01 if the image source is a blob, then we need the user to specify the value, if the source is managed resource like disk or snapshot, we may require the user to specify the property if we cannot deduce it from the source managed resource. Possible values include: 'HyperVGenerationTypesV1', 'HyperVGenerationTypesV2' 8112 HyperVGeneration HyperVGenerationTypes `json:"hyperVGeneration,omitempty"` 8113} 8114 8115// MarshalJSON is the custom marshaler for ImageProperties. 8116func (IP ImageProperties) MarshalJSON() ([]byte, error) { 8117 objectMap := make(map[string]interface{}) 8118 if IP.SourceVirtualMachine != nil { 8119 objectMap["sourceVirtualMachine"] = IP.SourceVirtualMachine 8120 } 8121 if IP.StorageProfile != nil { 8122 objectMap["storageProfile"] = IP.StorageProfile 8123 } 8124 if IP.HyperVGeneration != "" { 8125 objectMap["hyperVGeneration"] = IP.HyperVGeneration 8126 } 8127 return json.Marshal(objectMap) 8128} 8129 8130// ImagePurchasePlan describes the gallery image definition purchase plan. This is used by marketplace 8131// images. 8132type ImagePurchasePlan struct { 8133 // Name - The plan ID. 8134 Name *string `json:"name,omitempty"` 8135 // Publisher - The publisher ID. 8136 Publisher *string `json:"publisher,omitempty"` 8137 // Product - The product ID. 8138 Product *string `json:"product,omitempty"` 8139} 8140 8141// ImageReference specifies information about the image to use. You can specify information about platform 8142// images, marketplace images, or virtual machine images. This element is required when you want to use a 8143// platform image, marketplace image, or virtual machine image, but is not used in other creation 8144// operations. NOTE: Image reference publisher and offer can only be set when you create the scale set. 8145type ImageReference struct { 8146 // Publisher - The image publisher. 8147 Publisher *string `json:"publisher,omitempty"` 8148 // Offer - Specifies the offer of the platform image or marketplace image used to create the virtual machine. 8149 Offer *string `json:"offer,omitempty"` 8150 // Sku - The image SKU. 8151 Sku *string `json:"sku,omitempty"` 8152 // 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. 8153 Version *string `json:"version,omitempty"` 8154 // 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'. 8155 ExactVersion *string `json:"exactVersion,omitempty"` 8156 // ID - Resource Id 8157 ID *string `json:"id,omitempty"` 8158} 8159 8160// MarshalJSON is the custom marshaler for ImageReference. 8161func (ir ImageReference) MarshalJSON() ([]byte, error) { 8162 objectMap := make(map[string]interface{}) 8163 if ir.Publisher != nil { 8164 objectMap["publisher"] = ir.Publisher 8165 } 8166 if ir.Offer != nil { 8167 objectMap["offer"] = ir.Offer 8168 } 8169 if ir.Sku != nil { 8170 objectMap["sku"] = ir.Sku 8171 } 8172 if ir.Version != nil { 8173 objectMap["version"] = ir.Version 8174 } 8175 if ir.ID != nil { 8176 objectMap["id"] = ir.ID 8177 } 8178 return json.Marshal(objectMap) 8179} 8180 8181// ImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 8182// operation. 8183type ImagesCreateOrUpdateFuture struct { 8184 azure.FutureAPI 8185 // Result returns the result of the asynchronous operation. 8186 // If the operation has not completed it will return an error. 8187 Result func(ImagesClient) (Image, error) 8188} 8189 8190// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8191func (future *ImagesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 8192 var azFuture azure.Future 8193 if err := json.Unmarshal(body, &azFuture); err != nil { 8194 return err 8195 } 8196 future.FutureAPI = &azFuture 8197 future.Result = future.result 8198 return nil 8199} 8200 8201// result is the default implementation for ImagesCreateOrUpdateFuture.Result. 8202func (future *ImagesCreateOrUpdateFuture) result(client ImagesClient) (i Image, err error) { 8203 var done bool 8204 done, err = future.DoneWithContext(context.Background(), client) 8205 if err != nil { 8206 err = autorest.NewErrorWithError(err, "compute.ImagesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 8207 return 8208 } 8209 if !done { 8210 i.Response.Response = future.Response() 8211 err = azure.NewAsyncOpIncompleteError("compute.ImagesCreateOrUpdateFuture") 8212 return 8213 } 8214 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8215 if i.Response.Response, err = future.GetResult(sender); err == nil && i.Response.Response.StatusCode != http.StatusNoContent { 8216 i, err = client.CreateOrUpdateResponder(i.Response.Response) 8217 if err != nil { 8218 err = autorest.NewErrorWithError(err, "compute.ImagesCreateOrUpdateFuture", "Result", i.Response.Response, "Failure responding to request") 8219 } 8220 } 8221 return 8222} 8223 8224// ImagesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 8225type ImagesDeleteFuture struct { 8226 azure.FutureAPI 8227 // Result returns the result of the asynchronous operation. 8228 // If the operation has not completed it will return an error. 8229 Result func(ImagesClient) (autorest.Response, error) 8230} 8231 8232// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8233func (future *ImagesDeleteFuture) UnmarshalJSON(body []byte) error { 8234 var azFuture azure.Future 8235 if err := json.Unmarshal(body, &azFuture); err != nil { 8236 return err 8237 } 8238 future.FutureAPI = &azFuture 8239 future.Result = future.result 8240 return nil 8241} 8242 8243// result is the default implementation for ImagesDeleteFuture.Result. 8244func (future *ImagesDeleteFuture) result(client ImagesClient) (ar autorest.Response, err error) { 8245 var done bool 8246 done, err = future.DoneWithContext(context.Background(), client) 8247 if err != nil { 8248 err = autorest.NewErrorWithError(err, "compute.ImagesDeleteFuture", "Result", future.Response(), "Polling failure") 8249 return 8250 } 8251 if !done { 8252 ar.Response = future.Response() 8253 err = azure.NewAsyncOpIncompleteError("compute.ImagesDeleteFuture") 8254 return 8255 } 8256 ar.Response = future.Response() 8257 return 8258} 8259 8260// ImageStorageProfile describes a storage profile. 8261type ImageStorageProfile struct { 8262 // 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/managed-disks-overview). 8263 OsDisk *ImageOSDisk `json:"osDisk,omitempty"` 8264 // 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/managed-disks-overview). 8265 DataDisks *[]ImageDataDisk `json:"dataDisks,omitempty"` 8266 // 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). 8267 ZoneResilient *bool `json:"zoneResilient,omitempty"` 8268} 8269 8270// ImagesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. 8271type ImagesUpdateFuture struct { 8272 azure.FutureAPI 8273 // Result returns the result of the asynchronous operation. 8274 // If the operation has not completed it will return an error. 8275 Result func(ImagesClient) (Image, error) 8276} 8277 8278// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8279func (future *ImagesUpdateFuture) UnmarshalJSON(body []byte) error { 8280 var azFuture azure.Future 8281 if err := json.Unmarshal(body, &azFuture); err != nil { 8282 return err 8283 } 8284 future.FutureAPI = &azFuture 8285 future.Result = future.result 8286 return nil 8287} 8288 8289// result is the default implementation for ImagesUpdateFuture.Result. 8290func (future *ImagesUpdateFuture) result(client ImagesClient) (i Image, err error) { 8291 var done bool 8292 done, err = future.DoneWithContext(context.Background(), client) 8293 if err != nil { 8294 err = autorest.NewErrorWithError(err, "compute.ImagesUpdateFuture", "Result", future.Response(), "Polling failure") 8295 return 8296 } 8297 if !done { 8298 i.Response.Response = future.Response() 8299 err = azure.NewAsyncOpIncompleteError("compute.ImagesUpdateFuture") 8300 return 8301 } 8302 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8303 if i.Response.Response, err = future.GetResult(sender); err == nil && i.Response.Response.StatusCode != http.StatusNoContent { 8304 i, err = client.UpdateResponder(i.Response.Response) 8305 if err != nil { 8306 err = autorest.NewErrorWithError(err, "compute.ImagesUpdateFuture", "Result", i.Response.Response, "Failure responding to request") 8307 } 8308 } 8309 return 8310} 8311 8312// ImageUpdate the source user image virtual hard disk. Only tags may be updated. 8313type ImageUpdate struct { 8314 *ImageProperties `json:"properties,omitempty"` 8315 // Tags - Resource tags 8316 Tags map[string]*string `json:"tags"` 8317} 8318 8319// MarshalJSON is the custom marshaler for ImageUpdate. 8320func (iu ImageUpdate) MarshalJSON() ([]byte, error) { 8321 objectMap := make(map[string]interface{}) 8322 if iu.ImageProperties != nil { 8323 objectMap["properties"] = iu.ImageProperties 8324 } 8325 if iu.Tags != nil { 8326 objectMap["tags"] = iu.Tags 8327 } 8328 return json.Marshal(objectMap) 8329} 8330 8331// UnmarshalJSON is the custom unmarshaler for ImageUpdate struct. 8332func (iu *ImageUpdate) UnmarshalJSON(body []byte) error { 8333 var m map[string]*json.RawMessage 8334 err := json.Unmarshal(body, &m) 8335 if err != nil { 8336 return err 8337 } 8338 for k, v := range m { 8339 switch k { 8340 case "properties": 8341 if v != nil { 8342 var imageProperties ImageProperties 8343 err = json.Unmarshal(*v, &imageProperties) 8344 if err != nil { 8345 return err 8346 } 8347 iu.ImageProperties = &imageProperties 8348 } 8349 case "tags": 8350 if v != nil { 8351 var tags map[string]*string 8352 err = json.Unmarshal(*v, &tags) 8353 if err != nil { 8354 return err 8355 } 8356 iu.Tags = tags 8357 } 8358 } 8359 } 8360 8361 return nil 8362} 8363 8364// InnerError inner error details. 8365type InnerError struct { 8366 // Exceptiontype - The exception type. 8367 Exceptiontype *string `json:"exceptiontype,omitempty"` 8368 // Errordetail - The internal error message or exception dump. 8369 Errordetail *string `json:"errordetail,omitempty"` 8370} 8371 8372// InstanceSku ... 8373type InstanceSku struct { 8374 // Name - READ-ONLY; The sku name. 8375 Name *string `json:"name,omitempty"` 8376 // Tier - READ-ONLY; The tier of the cloud service role instance. 8377 Tier *string `json:"tier,omitempty"` 8378} 8379 8380// MarshalJSON is the custom marshaler for InstanceSku. 8381func (is InstanceSku) MarshalJSON() ([]byte, error) { 8382 objectMap := make(map[string]interface{}) 8383 return json.Marshal(objectMap) 8384} 8385 8386// InstanceViewStatus instance view status. 8387type InstanceViewStatus struct { 8388 // Code - The status code. 8389 Code *string `json:"code,omitempty"` 8390 // Level - The level code. Possible values include: 'StatusLevelTypesInfo', 'StatusLevelTypesWarning', 'StatusLevelTypesError' 8391 Level StatusLevelTypes `json:"level,omitempty"` 8392 // DisplayStatus - The short localizable label for the status. 8393 DisplayStatus *string `json:"displayStatus,omitempty"` 8394 // Message - The detailed status message, including for alerts and error messages. 8395 Message *string `json:"message,omitempty"` 8396 // Time - The time of the status. 8397 Time *date.Time `json:"time,omitempty"` 8398} 8399 8400// InstanceViewStatusesSummary instance view statuses. 8401type InstanceViewStatusesSummary struct { 8402 // StatusesSummary - READ-ONLY 8403 StatusesSummary *[]StatusCodeCount `json:"statusesSummary,omitempty"` 8404} 8405 8406// MarshalJSON is the custom marshaler for InstanceViewStatusesSummary. 8407func (ivss InstanceViewStatusesSummary) MarshalJSON() ([]byte, error) { 8408 objectMap := make(map[string]interface{}) 8409 return json.Marshal(objectMap) 8410} 8411 8412// KeyForDiskEncryptionSet key Vault Key Url to be used for server side encryption of Managed Disks and 8413// Snapshots 8414type KeyForDiskEncryptionSet struct { 8415 // SourceVault - Resource id of the KeyVault containing the key or secret. This property is optional and cannot be used if the KeyVault subscription is not the same as the Disk Encryption Set subscription. 8416 SourceVault *SourceVault `json:"sourceVault,omitempty"` 8417 // KeyURL - Fully versioned Key Url pointing to a key in KeyVault. Version segment of the Url is required regardless of rotationToLatestKeyVersionEnabled value. 8418 KeyURL *string `json:"keyUrl,omitempty"` 8419} 8420 8421// KeyVaultAndKeyReference key Vault Key Url and vault id of KeK, KeK is optional and when provided is used 8422// to unwrap the encryptionKey 8423type KeyVaultAndKeyReference struct { 8424 // SourceVault - Resource id of the KeyVault containing the key or secret 8425 SourceVault *SourceVault `json:"sourceVault,omitempty"` 8426 // KeyURL - Url pointing to a key or secret in KeyVault 8427 KeyURL *string `json:"keyUrl,omitempty"` 8428} 8429 8430// KeyVaultAndSecretReference key Vault Secret Url and vault id of the encryption key 8431type KeyVaultAndSecretReference struct { 8432 // SourceVault - Resource id of the KeyVault containing the key or secret 8433 SourceVault *SourceVault `json:"sourceVault,omitempty"` 8434 // SecretURL - Url pointing to a key or secret in KeyVault 8435 SecretURL *string `json:"secretUrl,omitempty"` 8436} 8437 8438// KeyVaultKeyReference describes a reference to Key Vault Key 8439type KeyVaultKeyReference struct { 8440 // KeyURL - The URL referencing a key encryption key in Key Vault. 8441 KeyURL *string `json:"keyUrl,omitempty"` 8442 // SourceVault - The relative URL of the Key Vault containing the key. 8443 SourceVault *SubResource `json:"sourceVault,omitempty"` 8444} 8445 8446// KeyVaultSecretReference describes a reference to Key Vault Secret 8447type KeyVaultSecretReference struct { 8448 // SecretURL - The URL referencing a secret in a Key Vault. 8449 SecretURL *string `json:"secretUrl,omitempty"` 8450 // SourceVault - The relative URL of the Key Vault containing the secret. 8451 SourceVault *SubResource `json:"sourceVault,omitempty"` 8452} 8453 8454// LastPatchInstallationSummary describes the properties of the last installed patch summary. 8455type LastPatchInstallationSummary struct { 8456 // 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 "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings.". Possible values include: 'PatchOperationStatusUnknown', 'PatchOperationStatusInProgress', 'PatchOperationStatusFailed', 'PatchOperationStatusSucceeded', 'PatchOperationStatusCompletedWithWarnings' 8457 Status PatchOperationStatus `json:"status,omitempty"` 8458 // InstallationActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. 8459 InstallationActivityID *string `json:"installationActivityId,omitempty"` 8460 // MaintenanceWindowExceeded - READ-ONLY; Describes whether the operation ran out of time before it completed all its intended actions 8461 MaintenanceWindowExceeded *bool `json:"maintenanceWindowExceeded,omitempty"` 8462 // 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. 8463 NotSelectedPatchCount *int32 `json:"notSelectedPatchCount,omitempty"` 8464 // ExcludedPatchCount - READ-ONLY; The number of all available patches but excluded explicitly by a customer-specified exclusion list match. 8465 ExcludedPatchCount *int32 `json:"excludedPatchCount,omitempty"` 8466 // PendingPatchCount - READ-ONLY; The number of all available patches expected to be installed over the course of the patch installation operation. 8467 PendingPatchCount *int32 `json:"pendingPatchCount,omitempty"` 8468 // InstalledPatchCount - READ-ONLY; The count of patches that successfully installed. 8469 InstalledPatchCount *int32 `json:"installedPatchCount,omitempty"` 8470 // FailedPatchCount - READ-ONLY; The count of patches that failed installation. 8471 FailedPatchCount *int32 `json:"failedPatchCount,omitempty"` 8472 // StartTime - READ-ONLY; The UTC timestamp when the operation began. 8473 StartTime *date.Time `json:"startTime,omitempty"` 8474 // LastModifiedTime - READ-ONLY; The UTC timestamp when the operation began. 8475 LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` 8476 // Error - READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. 8477 Error *APIError `json:"error,omitempty"` 8478} 8479 8480// MarshalJSON is the custom marshaler for LastPatchInstallationSummary. 8481func (lpis LastPatchInstallationSummary) MarshalJSON() ([]byte, error) { 8482 objectMap := make(map[string]interface{}) 8483 return json.Marshal(objectMap) 8484} 8485 8486// LinuxConfiguration specifies the Linux operating system settings on the virtual machine. <br><br>For a 8487// list of supported Linux distributions, see [Linux on Azure-Endorsed 8488// Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). 8489type LinuxConfiguration struct { 8490 // DisablePasswordAuthentication - Specifies whether password authentication should be disabled. 8491 DisablePasswordAuthentication *bool `json:"disablePasswordAuthentication,omitempty"` 8492 // SSH - Specifies the ssh key configuration for a Linux OS. 8493 SSH *SSHConfiguration `json:"ssh,omitempty"` 8494 // 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. 8495 ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` 8496 // PatchSettings - [Preview Feature] Specifies settings related to VM Guest Patching on Linux. 8497 PatchSettings *LinuxPatchSettings `json:"patchSettings,omitempty"` 8498} 8499 8500// LinuxParameters input for InstallPatches on a Linux VM, as directly received by the API 8501type LinuxParameters struct { 8502 // ClassificationsToInclude - The update classifications to select when installing patches for Linux. 8503 ClassificationsToInclude *[]VMGuestPatchClassificationLinux `json:"classificationsToInclude,omitempty"` 8504 // PackageNameMasksToInclude - packages to include in the patch operation. Format: packageName_packageVersion 8505 PackageNameMasksToInclude *[]string `json:"packageNameMasksToInclude,omitempty"` 8506 // PackageNameMasksToExclude - packages to exclude in the patch operation. Format: packageName_packageVersion 8507 PackageNameMasksToExclude *[]string `json:"packageNameMasksToExclude,omitempty"` 8508 // MaintenanceRunID - This is used as a maintenance run identifier for Auto VM Guest Patching in Linux. 8509 MaintenanceRunID *string `json:"maintenanceRunId,omitempty"` 8510} 8511 8512// LinuxPatchSettings specifies settings related to VM Guest Patching on Linux. 8513type LinuxPatchSettings struct { 8514 // PatchMode - Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines associated to virtual machine scale set with OrchestrationMode as Flexible.<br /><br /> Possible values are:<br /><br /> **ImageDefault** - The virtual machine's default patching configuration is used. <br /><br /> **AutomaticByPlatform** - The virtual machine will be automatically updated by the platform. The property provisionVMAgent must be true. Possible values include: 'LinuxVMGuestPatchModeImageDefault', 'LinuxVMGuestPatchModeAutomaticByPlatform' 8515 PatchMode LinuxVMGuestPatchMode `json:"patchMode,omitempty"` 8516 // AssessmentMode - Specifies the mode of VM Guest Patch Assessment for the IaaS virtual machine.<br /><br /> Possible values are:<br /><br /> **ImageDefault** - You control the timing of patch assessments on a virtual machine. <br /><br /> **AutomaticByPlatform** - The platform will trigger periodic patch assessments. The property provisionVMAgent must be true. Possible values include: 'LinuxPatchAssessmentModeImageDefault', 'LinuxPatchAssessmentModeAutomaticByPlatform' 8517 AssessmentMode LinuxPatchAssessmentMode `json:"assessmentMode,omitempty"` 8518} 8519 8520// ListUsagesResult the List Usages operation response. 8521type ListUsagesResult struct { 8522 autorest.Response `json:"-"` 8523 // Value - The list of compute resource usages. 8524 Value *[]Usage `json:"value,omitempty"` 8525 // 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. 8526 NextLink *string `json:"nextLink,omitempty"` 8527} 8528 8529// ListUsagesResultIterator provides access to a complete listing of Usage values. 8530type ListUsagesResultIterator struct { 8531 i int 8532 page ListUsagesResultPage 8533} 8534 8535// NextWithContext advances to the next value. If there was an error making 8536// the request the iterator does not advance and the error is returned. 8537func (iter *ListUsagesResultIterator) NextWithContext(ctx context.Context) (err error) { 8538 if tracing.IsEnabled() { 8539 ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultIterator.NextWithContext") 8540 defer func() { 8541 sc := -1 8542 if iter.Response().Response.Response != nil { 8543 sc = iter.Response().Response.Response.StatusCode 8544 } 8545 tracing.EndSpan(ctx, sc, err) 8546 }() 8547 } 8548 iter.i++ 8549 if iter.i < len(iter.page.Values()) { 8550 return nil 8551 } 8552 err = iter.page.NextWithContext(ctx) 8553 if err != nil { 8554 iter.i-- 8555 return err 8556 } 8557 iter.i = 0 8558 return nil 8559} 8560 8561// Next advances to the next value. If there was an error making 8562// the request the iterator does not advance and the error is returned. 8563// Deprecated: Use NextWithContext() instead. 8564func (iter *ListUsagesResultIterator) Next() error { 8565 return iter.NextWithContext(context.Background()) 8566} 8567 8568// NotDone returns true if the enumeration should be started or is not yet complete. 8569func (iter ListUsagesResultIterator) NotDone() bool { 8570 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8571} 8572 8573// Response returns the raw server response from the last page request. 8574func (iter ListUsagesResultIterator) Response() ListUsagesResult { 8575 return iter.page.Response() 8576} 8577 8578// Value returns the current value or a zero-initialized value if the 8579// iterator has advanced beyond the end of the collection. 8580func (iter ListUsagesResultIterator) Value() Usage { 8581 if !iter.page.NotDone() { 8582 return Usage{} 8583 } 8584 return iter.page.Values()[iter.i] 8585} 8586 8587// Creates a new instance of the ListUsagesResultIterator type. 8588func NewListUsagesResultIterator(page ListUsagesResultPage) ListUsagesResultIterator { 8589 return ListUsagesResultIterator{page: page} 8590} 8591 8592// IsEmpty returns true if the ListResult contains no values. 8593func (lur ListUsagesResult) IsEmpty() bool { 8594 return lur.Value == nil || len(*lur.Value) == 0 8595} 8596 8597// hasNextLink returns true if the NextLink is not empty. 8598func (lur ListUsagesResult) hasNextLink() bool { 8599 return lur.NextLink != nil && len(*lur.NextLink) != 0 8600} 8601 8602// listUsagesResultPreparer prepares a request to retrieve the next set of results. 8603// It returns nil if no more results exist. 8604func (lur ListUsagesResult) listUsagesResultPreparer(ctx context.Context) (*http.Request, error) { 8605 if !lur.hasNextLink() { 8606 return nil, nil 8607 } 8608 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8609 autorest.AsJSON(), 8610 autorest.AsGet(), 8611 autorest.WithBaseURL(to.String(lur.NextLink))) 8612} 8613 8614// ListUsagesResultPage contains a page of Usage values. 8615type ListUsagesResultPage struct { 8616 fn func(context.Context, ListUsagesResult) (ListUsagesResult, error) 8617 lur ListUsagesResult 8618} 8619 8620// NextWithContext advances to the next page of values. If there was an error making 8621// the request the page does not advance and the error is returned. 8622func (page *ListUsagesResultPage) NextWithContext(ctx context.Context) (err error) { 8623 if tracing.IsEnabled() { 8624 ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultPage.NextWithContext") 8625 defer func() { 8626 sc := -1 8627 if page.Response().Response.Response != nil { 8628 sc = page.Response().Response.Response.StatusCode 8629 } 8630 tracing.EndSpan(ctx, sc, err) 8631 }() 8632 } 8633 for { 8634 next, err := page.fn(ctx, page.lur) 8635 if err != nil { 8636 return err 8637 } 8638 page.lur = next 8639 if !next.hasNextLink() || !next.IsEmpty() { 8640 break 8641 } 8642 } 8643 return nil 8644} 8645 8646// Next advances to the next page of values. If there was an error making 8647// the request the page does not advance and the error is returned. 8648// Deprecated: Use NextWithContext() instead. 8649func (page *ListUsagesResultPage) Next() error { 8650 return page.NextWithContext(context.Background()) 8651} 8652 8653// NotDone returns true if the page enumeration should be started or is not yet complete. 8654func (page ListUsagesResultPage) NotDone() bool { 8655 return !page.lur.IsEmpty() 8656} 8657 8658// Response returns the raw server response from the last page request. 8659func (page ListUsagesResultPage) Response() ListUsagesResult { 8660 return page.lur 8661} 8662 8663// Values returns the slice of values for the current page or nil if there are no values. 8664func (page ListUsagesResultPage) Values() []Usage { 8665 if page.lur.IsEmpty() { 8666 return nil 8667 } 8668 return *page.lur.Value 8669} 8670 8671// Creates a new instance of the ListUsagesResultPage type. 8672func NewListUsagesResultPage(cur ListUsagesResult, getNextPage func(context.Context, ListUsagesResult) (ListUsagesResult, error)) ListUsagesResultPage { 8673 return ListUsagesResultPage{ 8674 fn: getNextPage, 8675 lur: cur, 8676 } 8677} 8678 8679// ListVirtualMachineExtensionImage ... 8680type ListVirtualMachineExtensionImage struct { 8681 autorest.Response `json:"-"` 8682 Value *[]VirtualMachineExtensionImage `json:"value,omitempty"` 8683} 8684 8685// ListVirtualMachineImageResource ... 8686type ListVirtualMachineImageResource struct { 8687 autorest.Response `json:"-"` 8688 Value *[]VirtualMachineImageResource `json:"value,omitempty"` 8689} 8690 8691// LoadBalancerConfiguration describes the load balancer configuration. 8692type LoadBalancerConfiguration struct { 8693 // ID - Resource Id 8694 ID *string `json:"id,omitempty"` 8695 // Name - The name of the Load balancer 8696 Name *string `json:"name,omitempty"` 8697 // Properties - Properties of the load balancer configuration. 8698 Properties *LoadBalancerConfigurationProperties `json:"properties,omitempty"` 8699} 8700 8701// LoadBalancerConfigurationProperties ... 8702type LoadBalancerConfigurationProperties struct { 8703 // FrontendIPConfigurations - Specifies the frontend IP to be used for the load balancer. Only IPv4 frontend IP address is supported. Each load balancer configuration must have exactly one frontend IP configuration. 8704 FrontendIPConfigurations *[]LoadBalancerFrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` 8705} 8706 8707// LoadBalancerFrontendIPConfiguration ... 8708type LoadBalancerFrontendIPConfiguration struct { 8709 // Name - The name of the resource that is unique within the set of frontend IP configurations used by the load balancer. This name can be used to access the resource. 8710 Name *string `json:"name,omitempty"` 8711 // Properties - Properties of load balancer frontend ip configuration. 8712 Properties *LoadBalancerFrontendIPConfigurationProperties `json:"properties,omitempty"` 8713} 8714 8715// LoadBalancerFrontendIPConfigurationProperties describes a cloud service IP Configuration 8716type LoadBalancerFrontendIPConfigurationProperties struct { 8717 // PublicIPAddress - The reference to the public ip address resource. 8718 PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` 8719 // Subnet - The reference to the virtual network subnet resource. 8720 Subnet *SubResource `json:"subnet,omitempty"` 8721 // PrivateIPAddress - The virtual network private IP address of the IP configuration. 8722 PrivateIPAddress *string `json:"privateIPAddress,omitempty"` 8723} 8724 8725// LogAnalyticsExportRequestRateByIntervalFuture an abstraction for monitoring and retrieving the results 8726// of a long-running operation. 8727type LogAnalyticsExportRequestRateByIntervalFuture struct { 8728 azure.FutureAPI 8729 // Result returns the result of the asynchronous operation. 8730 // If the operation has not completed it will return an error. 8731 Result func(LogAnalyticsClient) (LogAnalyticsOperationResult, error) 8732} 8733 8734// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8735func (future *LogAnalyticsExportRequestRateByIntervalFuture) UnmarshalJSON(body []byte) error { 8736 var azFuture azure.Future 8737 if err := json.Unmarshal(body, &azFuture); err != nil { 8738 return err 8739 } 8740 future.FutureAPI = &azFuture 8741 future.Result = future.result 8742 return nil 8743} 8744 8745// result is the default implementation for LogAnalyticsExportRequestRateByIntervalFuture.Result. 8746func (future *LogAnalyticsExportRequestRateByIntervalFuture) result(client LogAnalyticsClient) (laor LogAnalyticsOperationResult, err error) { 8747 var done bool 8748 done, err = future.DoneWithContext(context.Background(), client) 8749 if err != nil { 8750 err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportRequestRateByIntervalFuture", "Result", future.Response(), "Polling failure") 8751 return 8752 } 8753 if !done { 8754 laor.Response.Response = future.Response() 8755 err = azure.NewAsyncOpIncompleteError("compute.LogAnalyticsExportRequestRateByIntervalFuture") 8756 return 8757 } 8758 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8759 if laor.Response.Response, err = future.GetResult(sender); err == nil && laor.Response.Response.StatusCode != http.StatusNoContent { 8760 laor, err = client.ExportRequestRateByIntervalResponder(laor.Response.Response) 8761 if err != nil { 8762 err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportRequestRateByIntervalFuture", "Result", laor.Response.Response, "Failure responding to request") 8763 } 8764 } 8765 return 8766} 8767 8768// LogAnalyticsExportThrottledRequestsFuture an abstraction for monitoring and retrieving the results of a 8769// long-running operation. 8770type LogAnalyticsExportThrottledRequestsFuture struct { 8771 azure.FutureAPI 8772 // Result returns the result of the asynchronous operation. 8773 // If the operation has not completed it will return an error. 8774 Result func(LogAnalyticsClient) (LogAnalyticsOperationResult, error) 8775} 8776 8777// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8778func (future *LogAnalyticsExportThrottledRequestsFuture) UnmarshalJSON(body []byte) error { 8779 var azFuture azure.Future 8780 if err := json.Unmarshal(body, &azFuture); err != nil { 8781 return err 8782 } 8783 future.FutureAPI = &azFuture 8784 future.Result = future.result 8785 return nil 8786} 8787 8788// result is the default implementation for LogAnalyticsExportThrottledRequestsFuture.Result. 8789func (future *LogAnalyticsExportThrottledRequestsFuture) result(client LogAnalyticsClient) (laor LogAnalyticsOperationResult, err error) { 8790 var done bool 8791 done, err = future.DoneWithContext(context.Background(), client) 8792 if err != nil { 8793 err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportThrottledRequestsFuture", "Result", future.Response(), "Polling failure") 8794 return 8795 } 8796 if !done { 8797 laor.Response.Response = future.Response() 8798 err = azure.NewAsyncOpIncompleteError("compute.LogAnalyticsExportThrottledRequestsFuture") 8799 return 8800 } 8801 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8802 if laor.Response.Response, err = future.GetResult(sender); err == nil && laor.Response.Response.StatusCode != http.StatusNoContent { 8803 laor, err = client.ExportThrottledRequestsResponder(laor.Response.Response) 8804 if err != nil { 8805 err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportThrottledRequestsFuture", "Result", laor.Response.Response, "Failure responding to request") 8806 } 8807 } 8808 return 8809} 8810 8811// LogAnalyticsInputBase api input base class for LogAnalytics Api. 8812type LogAnalyticsInputBase struct { 8813 // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. 8814 BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` 8815 // FromTime - From time of the query 8816 FromTime *date.Time `json:"fromTime,omitempty"` 8817 // ToTime - To time of the query 8818 ToTime *date.Time `json:"toTime,omitempty"` 8819 // GroupByThrottlePolicy - Group query result by Throttle Policy applied. 8820 GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` 8821 // GroupByOperationName - Group query result by Operation Name. 8822 GroupByOperationName *bool `json:"groupByOperationName,omitempty"` 8823 // GroupByResourceName - Group query result by Resource Name. 8824 GroupByResourceName *bool `json:"groupByResourceName,omitempty"` 8825 // GroupByClientApplicationID - Group query result by Client Application ID. 8826 GroupByClientApplicationID *bool `json:"groupByClientApplicationId,omitempty"` 8827 // GroupByUserAgent - Group query result by User Agent. 8828 GroupByUserAgent *bool `json:"groupByUserAgent,omitempty"` 8829} 8830 8831// LogAnalyticsOperationResult logAnalytics operation status response 8832type LogAnalyticsOperationResult struct { 8833 autorest.Response `json:"-"` 8834 // Properties - READ-ONLY; LogAnalyticsOutput 8835 Properties *LogAnalyticsOutput `json:"properties,omitempty"` 8836} 8837 8838// MarshalJSON is the custom marshaler for LogAnalyticsOperationResult. 8839func (laor LogAnalyticsOperationResult) MarshalJSON() ([]byte, error) { 8840 objectMap := make(map[string]interface{}) 8841 return json.Marshal(objectMap) 8842} 8843 8844// LogAnalyticsOutput logAnalytics output properties 8845type LogAnalyticsOutput struct { 8846 // Output - READ-ONLY; Output file Uri path to blob container. 8847 Output *string `json:"output,omitempty"` 8848} 8849 8850// MarshalJSON is the custom marshaler for LogAnalyticsOutput. 8851func (lao LogAnalyticsOutput) MarshalJSON() ([]byte, error) { 8852 objectMap := make(map[string]interface{}) 8853 return json.Marshal(objectMap) 8854} 8855 8856// MaintenanceRedeployStatus maintenance Operation Status. 8857type MaintenanceRedeployStatus struct { 8858 // IsCustomerInitiatedMaintenanceAllowed - True, if customer is allowed to perform Maintenance. 8859 IsCustomerInitiatedMaintenanceAllowed *bool `json:"isCustomerInitiatedMaintenanceAllowed,omitempty"` 8860 // PreMaintenanceWindowStartTime - Start Time for the Pre Maintenance Window. 8861 PreMaintenanceWindowStartTime *date.Time `json:"preMaintenanceWindowStartTime,omitempty"` 8862 // PreMaintenanceWindowEndTime - End Time for the Pre Maintenance Window. 8863 PreMaintenanceWindowEndTime *date.Time `json:"preMaintenanceWindowEndTime,omitempty"` 8864 // MaintenanceWindowStartTime - Start Time for the Maintenance Window. 8865 MaintenanceWindowStartTime *date.Time `json:"maintenanceWindowStartTime,omitempty"` 8866 // MaintenanceWindowEndTime - End Time for the Maintenance Window. 8867 MaintenanceWindowEndTime *date.Time `json:"maintenanceWindowEndTime,omitempty"` 8868 // LastOperationResultCode - The Last Maintenance Operation Result Code. Possible values include: 'MaintenanceOperationResultCodeTypesNone', 'MaintenanceOperationResultCodeTypesRetryLater', 'MaintenanceOperationResultCodeTypesMaintenanceAborted', 'MaintenanceOperationResultCodeTypesMaintenanceCompleted' 8869 LastOperationResultCode MaintenanceOperationResultCodeTypes `json:"lastOperationResultCode,omitempty"` 8870 // LastOperationMessage - Message returned for the last Maintenance Operation. 8871 LastOperationMessage *string `json:"lastOperationMessage,omitempty"` 8872} 8873 8874// ManagedArtifact the managed artifact. 8875type ManagedArtifact struct { 8876 // ID - The managed artifact id. 8877 ID *string `json:"id,omitempty"` 8878} 8879 8880// ManagedDiskParameters the parameters of a managed disk. 8881type ManagedDiskParameters struct { 8882 // 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', 'StorageAccountTypesPremiumZRS', 'StorageAccountTypesStandardSSDZRS' 8883 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 8884 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed disk. 8885 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 8886 // ID - Resource Id 8887 ID *string `json:"id,omitempty"` 8888} 8889 8890// NetworkInterfaceReference describes a network interface reference. 8891type NetworkInterfaceReference struct { 8892 *NetworkInterfaceReferenceProperties `json:"properties,omitempty"` 8893 // ID - Resource Id 8894 ID *string `json:"id,omitempty"` 8895} 8896 8897// MarshalJSON is the custom marshaler for NetworkInterfaceReference. 8898func (nir NetworkInterfaceReference) MarshalJSON() ([]byte, error) { 8899 objectMap := make(map[string]interface{}) 8900 if nir.NetworkInterfaceReferenceProperties != nil { 8901 objectMap["properties"] = nir.NetworkInterfaceReferenceProperties 8902 } 8903 if nir.ID != nil { 8904 objectMap["id"] = nir.ID 8905 } 8906 return json.Marshal(objectMap) 8907} 8908 8909// UnmarshalJSON is the custom unmarshaler for NetworkInterfaceReference struct. 8910func (nir *NetworkInterfaceReference) UnmarshalJSON(body []byte) error { 8911 var m map[string]*json.RawMessage 8912 err := json.Unmarshal(body, &m) 8913 if err != nil { 8914 return err 8915 } 8916 for k, v := range m { 8917 switch k { 8918 case "properties": 8919 if v != nil { 8920 var networkInterfaceReferenceProperties NetworkInterfaceReferenceProperties 8921 err = json.Unmarshal(*v, &networkInterfaceReferenceProperties) 8922 if err != nil { 8923 return err 8924 } 8925 nir.NetworkInterfaceReferenceProperties = &networkInterfaceReferenceProperties 8926 } 8927 case "id": 8928 if v != nil { 8929 var ID string 8930 err = json.Unmarshal(*v, &ID) 8931 if err != nil { 8932 return err 8933 } 8934 nir.ID = &ID 8935 } 8936 } 8937 } 8938 8939 return nil 8940} 8941 8942// NetworkInterfaceReferenceProperties describes a network interface reference properties. 8943type NetworkInterfaceReferenceProperties struct { 8944 // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. 8945 Primary *bool `json:"primary,omitempty"` 8946 // DeleteOption - Specify what happens to the network interface when the VM is deleted. Possible values include: 'DeleteOptionsDelete', 'DeleteOptionsDetach' 8947 DeleteOption DeleteOptions `json:"deleteOption,omitempty"` 8948} 8949 8950// NetworkProfile specifies the network interfaces or the networking configuration of the virtual machine. 8951type NetworkProfile struct { 8952 // NetworkInterfaces - Specifies the list of resource Ids for the network interfaces associated with the virtual machine. 8953 NetworkInterfaces *[]NetworkInterfaceReference `json:"networkInterfaces,omitempty"` 8954 // NetworkAPIVersion - specifies the Microsoft.Network API version used when creating networking resources in the Network Interface Configurations. Possible values include: 'NetworkAPIVersionTwoZeroTwoZeroHyphenMinusOneOneHyphenMinusZeroOne' 8955 NetworkAPIVersion NetworkAPIVersion `json:"networkApiVersion,omitempty"` 8956 // NetworkInterfaceConfigurations - Specifies the networking configurations that will be used to create the virtual machine networking resources. 8957 NetworkInterfaceConfigurations *[]VirtualMachineNetworkInterfaceConfiguration `json:"networkInterfaceConfigurations,omitempty"` 8958} 8959 8960// OperationListResult the List Compute Operation operation response. 8961type OperationListResult struct { 8962 autorest.Response `json:"-"` 8963 // Value - READ-ONLY; The list of compute operations 8964 Value *[]OperationValue `json:"value,omitempty"` 8965} 8966 8967// MarshalJSON is the custom marshaler for OperationListResult. 8968func (olr OperationListResult) MarshalJSON() ([]byte, error) { 8969 objectMap := make(map[string]interface{}) 8970 return json.Marshal(objectMap) 8971} 8972 8973// OperationValue describes the properties of a Compute Operation value. 8974type OperationValue struct { 8975 // Origin - READ-ONLY; The origin of the compute operation. 8976 Origin *string `json:"origin,omitempty"` 8977 // Name - READ-ONLY; The name of the compute operation. 8978 Name *string `json:"name,omitempty"` 8979 *OperationValueDisplay `json:"display,omitempty"` 8980} 8981 8982// MarshalJSON is the custom marshaler for OperationValue. 8983func (ov OperationValue) MarshalJSON() ([]byte, error) { 8984 objectMap := make(map[string]interface{}) 8985 if ov.OperationValueDisplay != nil { 8986 objectMap["display"] = ov.OperationValueDisplay 8987 } 8988 return json.Marshal(objectMap) 8989} 8990 8991// UnmarshalJSON is the custom unmarshaler for OperationValue struct. 8992func (ov *OperationValue) UnmarshalJSON(body []byte) error { 8993 var m map[string]*json.RawMessage 8994 err := json.Unmarshal(body, &m) 8995 if err != nil { 8996 return err 8997 } 8998 for k, v := range m { 8999 switch k { 9000 case "origin": 9001 if v != nil { 9002 var origin string 9003 err = json.Unmarshal(*v, &origin) 9004 if err != nil { 9005 return err 9006 } 9007 ov.Origin = &origin 9008 } 9009 case "name": 9010 if v != nil { 9011 var name string 9012 err = json.Unmarshal(*v, &name) 9013 if err != nil { 9014 return err 9015 } 9016 ov.Name = &name 9017 } 9018 case "display": 9019 if v != nil { 9020 var operationValueDisplay OperationValueDisplay 9021 err = json.Unmarshal(*v, &operationValueDisplay) 9022 if err != nil { 9023 return err 9024 } 9025 ov.OperationValueDisplay = &operationValueDisplay 9026 } 9027 } 9028 } 9029 9030 return nil 9031} 9032 9033// OperationValueDisplay describes the properties of a Compute Operation Value Display. 9034type OperationValueDisplay struct { 9035 // Operation - READ-ONLY; The display name of the compute operation. 9036 Operation *string `json:"operation,omitempty"` 9037 // Resource - READ-ONLY; The display name of the resource the operation applies to. 9038 Resource *string `json:"resource,omitempty"` 9039 // Description - READ-ONLY; The description of the operation. 9040 Description *string `json:"description,omitempty"` 9041 // Provider - READ-ONLY; The resource provider for the operation. 9042 Provider *string `json:"provider,omitempty"` 9043} 9044 9045// MarshalJSON is the custom marshaler for OperationValueDisplay. 9046func (ovd OperationValueDisplay) MarshalJSON() ([]byte, error) { 9047 objectMap := make(map[string]interface{}) 9048 return json.Marshal(objectMap) 9049} 9050 9051// OrchestrationServiceStateInput the input for OrchestrationServiceState 9052type OrchestrationServiceStateInput struct { 9053 // ServiceName - The name of the service. 9054 ServiceName *string `json:"serviceName,omitempty"` 9055 // Action - The action to be performed. Possible values include: 'OrchestrationServiceStateActionResume', 'OrchestrationServiceStateActionSuspend' 9056 Action OrchestrationServiceStateAction `json:"action,omitempty"` 9057} 9058 9059// OrchestrationServiceSummary summary for an orchestration service of a virtual machine scale set. 9060type OrchestrationServiceSummary struct { 9061 // ServiceName - READ-ONLY; The name of the service. Possible values include: 'OrchestrationServiceNamesAutomaticRepairs' 9062 ServiceName OrchestrationServiceNames `json:"serviceName,omitempty"` 9063 // ServiceState - READ-ONLY; The current state of the service. Possible values include: 'OrchestrationServiceStateNotRunning', 'OrchestrationServiceStateRunning', 'OrchestrationServiceStateSuspended' 9064 ServiceState OrchestrationServiceState `json:"serviceState,omitempty"` 9065} 9066 9067// MarshalJSON is the custom marshaler for OrchestrationServiceSummary. 9068func (oss OrchestrationServiceSummary) MarshalJSON() ([]byte, error) { 9069 objectMap := make(map[string]interface{}) 9070 return json.Marshal(objectMap) 9071} 9072 9073// OSDisk specifies information about the operating system disk used by the virtual machine. <br><br> For 9074// more information about disks, see [About disks and VHDs for Azure virtual 9075// machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). 9076type OSDisk struct { 9077 // 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: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' 9078 OsType OperatingSystemTypes `json:"osType,omitempty"` 9079 // EncryptionSettings - Specifies the encryption settings for the OS Disk. <br><br> Minimum api-version: 2015-06-15 9080 EncryptionSettings *DiskEncryptionSettings `json:"encryptionSettings,omitempty"` 9081 // Name - The disk name. 9082 Name *string `json:"name,omitempty"` 9083 // Vhd - The virtual hard disk. 9084 Vhd *VirtualHardDisk `json:"vhd,omitempty"` 9085 // 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. 9086 Image *VirtualHardDisk `json:"image,omitempty"` 9087 // 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' 9088 Caching CachingTypes `json:"caching,omitempty"` 9089 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 9090 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 9091 // DiffDiskSettings - Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine. 9092 DiffDiskSettings *DiffDiskSettings `json:"diffDiskSettings,omitempty"` 9093 // 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' 9094 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 9095 // 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 9096 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 9097 // ManagedDisk - The managed disk parameters. 9098 ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` 9099 // DeleteOption - Specifies whether OS Disk should be deleted or detached upon VM deletion. <br><br> Possible values: <br><br> **Delete** If this value is used, the OS disk is deleted when VM is deleted.<br><br> **Detach** If this value is used, the os disk is retained after VM is deleted. <br><br> The default value is set to **detach**. For an ephemeral OS Disk, the default value is set to **Delete**. User cannot change the delete option for ephemeral OS Disk. Possible values include: 'DiskDeleteOptionTypesDelete', 'DiskDeleteOptionTypesDetach' 9100 DeleteOption DiskDeleteOptionTypes `json:"deleteOption,omitempty"` 9101} 9102 9103// OSDiskImage contains the os disk image information. 9104type OSDiskImage struct { 9105 // OperatingSystem - The operating system of the osDiskImage. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' 9106 OperatingSystem OperatingSystemTypes `json:"operatingSystem,omitempty"` 9107} 9108 9109// OSDiskImageEncryption contains encryption settings for an OS disk image. 9110type OSDiskImageEncryption struct { 9111 // DiskEncryptionSetID - A relative URI containing the resource ID of the disk encryption set. 9112 DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` 9113} 9114 9115// OSFamily describes a cloud service OS family. 9116type OSFamily struct { 9117 autorest.Response `json:"-"` 9118 // ID - READ-ONLY; Resource Id. 9119 ID *string `json:"id,omitempty"` 9120 // Name - READ-ONLY; Resource name. 9121 Name *string `json:"name,omitempty"` 9122 // Type - READ-ONLY; Resource type. 9123 Type *string `json:"type,omitempty"` 9124 // Location - READ-ONLY; Resource location. 9125 Location *string `json:"location,omitempty"` 9126 Properties *OSFamilyProperties `json:"properties,omitempty"` 9127} 9128 9129// MarshalJSON is the custom marshaler for OSFamily. 9130func (of OSFamily) MarshalJSON() ([]byte, error) { 9131 objectMap := make(map[string]interface{}) 9132 if of.Properties != nil { 9133 objectMap["properties"] = of.Properties 9134 } 9135 return json.Marshal(objectMap) 9136} 9137 9138// OSFamilyListResult ... 9139type OSFamilyListResult struct { 9140 autorest.Response `json:"-"` 9141 Value *[]OSFamily `json:"value,omitempty"` 9142 NextLink *string `json:"nextLink,omitempty"` 9143} 9144 9145// OSFamilyListResultIterator provides access to a complete listing of OSFamily values. 9146type OSFamilyListResultIterator struct { 9147 i int 9148 page OSFamilyListResultPage 9149} 9150 9151// NextWithContext advances to the next value. If there was an error making 9152// the request the iterator does not advance and the error is returned. 9153func (iter *OSFamilyListResultIterator) NextWithContext(ctx context.Context) (err error) { 9154 if tracing.IsEnabled() { 9155 ctx = tracing.StartSpan(ctx, fqdn+"/OSFamilyListResultIterator.NextWithContext") 9156 defer func() { 9157 sc := -1 9158 if iter.Response().Response.Response != nil { 9159 sc = iter.Response().Response.Response.StatusCode 9160 } 9161 tracing.EndSpan(ctx, sc, err) 9162 }() 9163 } 9164 iter.i++ 9165 if iter.i < len(iter.page.Values()) { 9166 return nil 9167 } 9168 err = iter.page.NextWithContext(ctx) 9169 if err != nil { 9170 iter.i-- 9171 return err 9172 } 9173 iter.i = 0 9174 return nil 9175} 9176 9177// Next advances to the next value. If there was an error making 9178// the request the iterator does not advance and the error is returned. 9179// Deprecated: Use NextWithContext() instead. 9180func (iter *OSFamilyListResultIterator) Next() error { 9181 return iter.NextWithContext(context.Background()) 9182} 9183 9184// NotDone returns true if the enumeration should be started or is not yet complete. 9185func (iter OSFamilyListResultIterator) NotDone() bool { 9186 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9187} 9188 9189// Response returns the raw server response from the last page request. 9190func (iter OSFamilyListResultIterator) Response() OSFamilyListResult { 9191 return iter.page.Response() 9192} 9193 9194// Value returns the current value or a zero-initialized value if the 9195// iterator has advanced beyond the end of the collection. 9196func (iter OSFamilyListResultIterator) Value() OSFamily { 9197 if !iter.page.NotDone() { 9198 return OSFamily{} 9199 } 9200 return iter.page.Values()[iter.i] 9201} 9202 9203// Creates a new instance of the OSFamilyListResultIterator type. 9204func NewOSFamilyListResultIterator(page OSFamilyListResultPage) OSFamilyListResultIterator { 9205 return OSFamilyListResultIterator{page: page} 9206} 9207 9208// IsEmpty returns true if the ListResult contains no values. 9209func (oflr OSFamilyListResult) IsEmpty() bool { 9210 return oflr.Value == nil || len(*oflr.Value) == 0 9211} 9212 9213// hasNextLink returns true if the NextLink is not empty. 9214func (oflr OSFamilyListResult) hasNextLink() bool { 9215 return oflr.NextLink != nil && len(*oflr.NextLink) != 0 9216} 9217 9218// oSFamilyListResultPreparer prepares a request to retrieve the next set of results. 9219// It returns nil if no more results exist. 9220func (oflr OSFamilyListResult) oSFamilyListResultPreparer(ctx context.Context) (*http.Request, error) { 9221 if !oflr.hasNextLink() { 9222 return nil, nil 9223 } 9224 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9225 autorest.AsJSON(), 9226 autorest.AsGet(), 9227 autorest.WithBaseURL(to.String(oflr.NextLink))) 9228} 9229 9230// OSFamilyListResultPage contains a page of OSFamily values. 9231type OSFamilyListResultPage struct { 9232 fn func(context.Context, OSFamilyListResult) (OSFamilyListResult, error) 9233 oflr OSFamilyListResult 9234} 9235 9236// NextWithContext advances to the next page of values. If there was an error making 9237// the request the page does not advance and the error is returned. 9238func (page *OSFamilyListResultPage) NextWithContext(ctx context.Context) (err error) { 9239 if tracing.IsEnabled() { 9240 ctx = tracing.StartSpan(ctx, fqdn+"/OSFamilyListResultPage.NextWithContext") 9241 defer func() { 9242 sc := -1 9243 if page.Response().Response.Response != nil { 9244 sc = page.Response().Response.Response.StatusCode 9245 } 9246 tracing.EndSpan(ctx, sc, err) 9247 }() 9248 } 9249 for { 9250 next, err := page.fn(ctx, page.oflr) 9251 if err != nil { 9252 return err 9253 } 9254 page.oflr = next 9255 if !next.hasNextLink() || !next.IsEmpty() { 9256 break 9257 } 9258 } 9259 return nil 9260} 9261 9262// Next advances to the next page of values. If there was an error making 9263// the request the page does not advance and the error is returned. 9264// Deprecated: Use NextWithContext() instead. 9265func (page *OSFamilyListResultPage) Next() error { 9266 return page.NextWithContext(context.Background()) 9267} 9268 9269// NotDone returns true if the page enumeration should be started or is not yet complete. 9270func (page OSFamilyListResultPage) NotDone() bool { 9271 return !page.oflr.IsEmpty() 9272} 9273 9274// Response returns the raw server response from the last page request. 9275func (page OSFamilyListResultPage) Response() OSFamilyListResult { 9276 return page.oflr 9277} 9278 9279// Values returns the slice of values for the current page or nil if there are no values. 9280func (page OSFamilyListResultPage) Values() []OSFamily { 9281 if page.oflr.IsEmpty() { 9282 return nil 9283 } 9284 return *page.oflr.Value 9285} 9286 9287// Creates a new instance of the OSFamilyListResultPage type. 9288func NewOSFamilyListResultPage(cur OSFamilyListResult, getNextPage func(context.Context, OSFamilyListResult) (OSFamilyListResult, error)) OSFamilyListResultPage { 9289 return OSFamilyListResultPage{ 9290 fn: getNextPage, 9291 oflr: cur, 9292 } 9293} 9294 9295// OSFamilyProperties OS family properties. 9296type OSFamilyProperties struct { 9297 // Name - READ-ONLY; The OS family name. 9298 Name *string `json:"name,omitempty"` 9299 // Label - READ-ONLY; The OS family label. 9300 Label *string `json:"label,omitempty"` 9301 // Versions - READ-ONLY; List of OS versions belonging to this family. 9302 Versions *[]OSVersionPropertiesBase `json:"versions,omitempty"` 9303} 9304 9305// MarshalJSON is the custom marshaler for OSFamilyProperties. 9306func (ofp OSFamilyProperties) MarshalJSON() ([]byte, error) { 9307 objectMap := make(map[string]interface{}) 9308 return json.Marshal(objectMap) 9309} 9310 9311// OSProfile specifies the operating system settings for the virtual machine. Some of the settings cannot 9312// be changed once VM is provisioned. 9313type OSProfile struct { 9314 // 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/azure-resource-manager/management/resource-name-rules). 9315 ComputerName *string `json:"computerName,omitempty"` 9316 // 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. 9317 AdminUsername *string `json:"adminUsername,omitempty"` 9318 // 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/troubleshoot/azure/virtual-machines/reset-rdp) <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/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection) 9319 AdminPassword *string `json:"adminPassword,omitempty"` 9320 // 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/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/linux/using-cloud-init) 9321 CustomData *string `json:"customData,omitempty"` 9322 // WindowsConfiguration - Specifies Windows operating system settings on the virtual machine. 9323 WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` 9324 // 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/linux/endorsed-distros). 9325 LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` 9326 // Secrets - Specifies set of certificates that should be installed onto the virtual machine. 9327 Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` 9328 // 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. 9329 AllowExtensionOperations *bool `json:"allowExtensionOperations,omitempty"` 9330 // 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.** 9331 RequireGuestProvisionSignal *bool `json:"requireGuestProvisionSignal,omitempty"` 9332} 9333 9334// OSVersion describes a cloud service OS version. 9335type OSVersion struct { 9336 autorest.Response `json:"-"` 9337 // ID - READ-ONLY; Resource Id. 9338 ID *string `json:"id,omitempty"` 9339 // Name - READ-ONLY; Resource name. 9340 Name *string `json:"name,omitempty"` 9341 // Type - READ-ONLY; Resource type. 9342 Type *string `json:"type,omitempty"` 9343 // Location - READ-ONLY; Resource location. 9344 Location *string `json:"location,omitempty"` 9345 Properties *OSVersionProperties `json:"properties,omitempty"` 9346} 9347 9348// MarshalJSON is the custom marshaler for OSVersion. 9349func (ov OSVersion) MarshalJSON() ([]byte, error) { 9350 objectMap := make(map[string]interface{}) 9351 if ov.Properties != nil { 9352 objectMap["properties"] = ov.Properties 9353 } 9354 return json.Marshal(objectMap) 9355} 9356 9357// OSVersionListResult ... 9358type OSVersionListResult struct { 9359 autorest.Response `json:"-"` 9360 Value *[]OSVersion `json:"value,omitempty"` 9361 NextLink *string `json:"nextLink,omitempty"` 9362} 9363 9364// OSVersionListResultIterator provides access to a complete listing of OSVersion values. 9365type OSVersionListResultIterator struct { 9366 i int 9367 page OSVersionListResultPage 9368} 9369 9370// NextWithContext advances to the next value. If there was an error making 9371// the request the iterator does not advance and the error is returned. 9372func (iter *OSVersionListResultIterator) NextWithContext(ctx context.Context) (err error) { 9373 if tracing.IsEnabled() { 9374 ctx = tracing.StartSpan(ctx, fqdn+"/OSVersionListResultIterator.NextWithContext") 9375 defer func() { 9376 sc := -1 9377 if iter.Response().Response.Response != nil { 9378 sc = iter.Response().Response.Response.StatusCode 9379 } 9380 tracing.EndSpan(ctx, sc, err) 9381 }() 9382 } 9383 iter.i++ 9384 if iter.i < len(iter.page.Values()) { 9385 return nil 9386 } 9387 err = iter.page.NextWithContext(ctx) 9388 if err != nil { 9389 iter.i-- 9390 return err 9391 } 9392 iter.i = 0 9393 return nil 9394} 9395 9396// Next advances to the next value. If there was an error making 9397// the request the iterator does not advance and the error is returned. 9398// Deprecated: Use NextWithContext() instead. 9399func (iter *OSVersionListResultIterator) Next() error { 9400 return iter.NextWithContext(context.Background()) 9401} 9402 9403// NotDone returns true if the enumeration should be started or is not yet complete. 9404func (iter OSVersionListResultIterator) NotDone() bool { 9405 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9406} 9407 9408// Response returns the raw server response from the last page request. 9409func (iter OSVersionListResultIterator) Response() OSVersionListResult { 9410 return iter.page.Response() 9411} 9412 9413// Value returns the current value or a zero-initialized value if the 9414// iterator has advanced beyond the end of the collection. 9415func (iter OSVersionListResultIterator) Value() OSVersion { 9416 if !iter.page.NotDone() { 9417 return OSVersion{} 9418 } 9419 return iter.page.Values()[iter.i] 9420} 9421 9422// Creates a new instance of the OSVersionListResultIterator type. 9423func NewOSVersionListResultIterator(page OSVersionListResultPage) OSVersionListResultIterator { 9424 return OSVersionListResultIterator{page: page} 9425} 9426 9427// IsEmpty returns true if the ListResult contains no values. 9428func (ovlr OSVersionListResult) IsEmpty() bool { 9429 return ovlr.Value == nil || len(*ovlr.Value) == 0 9430} 9431 9432// hasNextLink returns true if the NextLink is not empty. 9433func (ovlr OSVersionListResult) hasNextLink() bool { 9434 return ovlr.NextLink != nil && len(*ovlr.NextLink) != 0 9435} 9436 9437// oSVersionListResultPreparer prepares a request to retrieve the next set of results. 9438// It returns nil if no more results exist. 9439func (ovlr OSVersionListResult) oSVersionListResultPreparer(ctx context.Context) (*http.Request, error) { 9440 if !ovlr.hasNextLink() { 9441 return nil, nil 9442 } 9443 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9444 autorest.AsJSON(), 9445 autorest.AsGet(), 9446 autorest.WithBaseURL(to.String(ovlr.NextLink))) 9447} 9448 9449// OSVersionListResultPage contains a page of OSVersion values. 9450type OSVersionListResultPage struct { 9451 fn func(context.Context, OSVersionListResult) (OSVersionListResult, error) 9452 ovlr OSVersionListResult 9453} 9454 9455// NextWithContext advances to the next page of values. If there was an error making 9456// the request the page does not advance and the error is returned. 9457func (page *OSVersionListResultPage) NextWithContext(ctx context.Context) (err error) { 9458 if tracing.IsEnabled() { 9459 ctx = tracing.StartSpan(ctx, fqdn+"/OSVersionListResultPage.NextWithContext") 9460 defer func() { 9461 sc := -1 9462 if page.Response().Response.Response != nil { 9463 sc = page.Response().Response.Response.StatusCode 9464 } 9465 tracing.EndSpan(ctx, sc, err) 9466 }() 9467 } 9468 for { 9469 next, err := page.fn(ctx, page.ovlr) 9470 if err != nil { 9471 return err 9472 } 9473 page.ovlr = next 9474 if !next.hasNextLink() || !next.IsEmpty() { 9475 break 9476 } 9477 } 9478 return nil 9479} 9480 9481// Next advances to the next page of values. If there was an error making 9482// the request the page does not advance and the error is returned. 9483// Deprecated: Use NextWithContext() instead. 9484func (page *OSVersionListResultPage) Next() error { 9485 return page.NextWithContext(context.Background()) 9486} 9487 9488// NotDone returns true if the page enumeration should be started or is not yet complete. 9489func (page OSVersionListResultPage) NotDone() bool { 9490 return !page.ovlr.IsEmpty() 9491} 9492 9493// Response returns the raw server response from the last page request. 9494func (page OSVersionListResultPage) Response() OSVersionListResult { 9495 return page.ovlr 9496} 9497 9498// Values returns the slice of values for the current page or nil if there are no values. 9499func (page OSVersionListResultPage) Values() []OSVersion { 9500 if page.ovlr.IsEmpty() { 9501 return nil 9502 } 9503 return *page.ovlr.Value 9504} 9505 9506// Creates a new instance of the OSVersionListResultPage type. 9507func NewOSVersionListResultPage(cur OSVersionListResult, getNextPage func(context.Context, OSVersionListResult) (OSVersionListResult, error)) OSVersionListResultPage { 9508 return OSVersionListResultPage{ 9509 fn: getNextPage, 9510 ovlr: cur, 9511 } 9512} 9513 9514// OSVersionProperties OS version properties. 9515type OSVersionProperties struct { 9516 // Family - READ-ONLY; The family of this OS version. 9517 Family *string `json:"family,omitempty"` 9518 // FamilyLabel - READ-ONLY; The family label of this OS version. 9519 FamilyLabel *string `json:"familyLabel,omitempty"` 9520 // Version - READ-ONLY; The OS version. 9521 Version *string `json:"version,omitempty"` 9522 // Label - READ-ONLY; The OS version label. 9523 Label *string `json:"label,omitempty"` 9524 // IsDefault - READ-ONLY; Specifies whether this is the default OS version for its family. 9525 IsDefault *bool `json:"isDefault,omitempty"` 9526 // IsActive - READ-ONLY; Specifies whether this OS version is active. 9527 IsActive *bool `json:"isActive,omitempty"` 9528} 9529 9530// MarshalJSON is the custom marshaler for OSVersionProperties. 9531func (ovp OSVersionProperties) MarshalJSON() ([]byte, error) { 9532 objectMap := make(map[string]interface{}) 9533 return json.Marshal(objectMap) 9534} 9535 9536// OSVersionPropertiesBase configuration view of an OS version. 9537type OSVersionPropertiesBase struct { 9538 // Version - READ-ONLY; The OS version. 9539 Version *string `json:"version,omitempty"` 9540 // Label - READ-ONLY; The OS version label. 9541 Label *string `json:"label,omitempty"` 9542 // IsDefault - READ-ONLY; Specifies whether this is the default OS version for its family. 9543 IsDefault *bool `json:"isDefault,omitempty"` 9544 // IsActive - READ-ONLY; Specifies whether this OS version is active. 9545 IsActive *bool `json:"isActive,omitempty"` 9546} 9547 9548// MarshalJSON is the custom marshaler for OSVersionPropertiesBase. 9549func (ovpb OSVersionPropertiesBase) MarshalJSON() ([]byte, error) { 9550 objectMap := make(map[string]interface{}) 9551 return json.Marshal(objectMap) 9552} 9553 9554// PatchInstallationDetail information about a specific patch that was encountered during an installation 9555// action. 9556type PatchInstallationDetail struct { 9557 // PatchID - READ-ONLY; A unique identifier for the patch. 9558 PatchID *string `json:"patchId,omitempty"` 9559 // Name - READ-ONLY; The friendly name of the patch. 9560 Name *string `json:"name,omitempty"` 9561 // Version - READ-ONLY; The version string of the package. It may conform to Semantic Versioning. Only applies to Linux. 9562 Version *string `json:"version,omitempty"` 9563 // KbID - READ-ONLY; The KBID of the patch. Only applies to Windows patches. 9564 KbID *string `json:"kbId,omitempty"` 9565 // Classifications - READ-ONLY; The classification(s) of the patch as provided by the patch publisher. 9566 Classifications *[]string `json:"classifications,omitempty"` 9567 // InstallationState - READ-ONLY; The state of the patch after the installation operation completed. Possible values include: 'PatchInstallationStateUnknown', 'PatchInstallationStateInstalled', 'PatchInstallationStateFailed', 'PatchInstallationStateExcluded', 'PatchInstallationStateNotSelected', 'PatchInstallationStatePending' 9568 InstallationState PatchInstallationState `json:"installationState,omitempty"` 9569} 9570 9571// MarshalJSON is the custom marshaler for PatchInstallationDetail. 9572func (pid PatchInstallationDetail) MarshalJSON() ([]byte, error) { 9573 objectMap := make(map[string]interface{}) 9574 return json.Marshal(objectMap) 9575} 9576 9577// PatchSettings specifies settings related to VM Guest Patching on Windows. 9578type PatchSettings struct { 9579 // PatchMode - Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines associated to virtual machine scale set with OrchestrationMode as Flexible.<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: 'WindowsVMGuestPatchModeManual', 'WindowsVMGuestPatchModeAutomaticByOS', 'WindowsVMGuestPatchModeAutomaticByPlatform' 9580 PatchMode WindowsVMGuestPatchMode `json:"patchMode,omitempty"` 9581 // EnableHotpatching - Enables customers to patch their Azure VMs without requiring a reboot. For enableHotpatching, the 'provisionVMAgent' must be set to true and 'patchMode' must be set to 'AutomaticByPlatform'. 9582 EnableHotpatching *bool `json:"enableHotpatching,omitempty"` 9583 // AssessmentMode - Specifies the mode of VM Guest patch assessment for the IaaS virtual machine.<br /><br /> Possible values are:<br /><br /> **ImageDefault** - You control the timing of patch assessments on a virtual machine.<br /><br /> **AutomaticByPlatform** - The platform will trigger periodic patch assessments. The property provisionVMAgent must be true. Possible values include: 'WindowsPatchAssessmentModeImageDefault', 'WindowsPatchAssessmentModeAutomaticByPlatform' 9584 AssessmentMode WindowsPatchAssessmentMode `json:"assessmentMode,omitempty"` 9585} 9586 9587// PirResource the Resource model definition. 9588type PirResource struct { 9589 // Name - READ-ONLY; Resource name 9590 Name *string `json:"name,omitempty"` 9591 // Location - READ-ONLY; Resource location 9592 Location *string `json:"location,omitempty"` 9593} 9594 9595// MarshalJSON is the custom marshaler for PirResource. 9596func (pr PirResource) MarshalJSON() ([]byte, error) { 9597 objectMap := make(map[string]interface{}) 9598 return json.Marshal(objectMap) 9599} 9600 9601// PirSharedGalleryResource base information about the shared gallery resource in pir. 9602type PirSharedGalleryResource struct { 9603 *SharedGalleryIdentifier `json:"identifier,omitempty"` 9604 // Name - READ-ONLY; Resource name 9605 Name *string `json:"name,omitempty"` 9606 // Location - READ-ONLY; Resource location 9607 Location *string `json:"location,omitempty"` 9608} 9609 9610// MarshalJSON is the custom marshaler for PirSharedGalleryResource. 9611func (psgr PirSharedGalleryResource) MarshalJSON() ([]byte, error) { 9612 objectMap := make(map[string]interface{}) 9613 if psgr.SharedGalleryIdentifier != nil { 9614 objectMap["identifier"] = psgr.SharedGalleryIdentifier 9615 } 9616 return json.Marshal(objectMap) 9617} 9618 9619// UnmarshalJSON is the custom unmarshaler for PirSharedGalleryResource struct. 9620func (psgr *PirSharedGalleryResource) UnmarshalJSON(body []byte) error { 9621 var m map[string]*json.RawMessage 9622 err := json.Unmarshal(body, &m) 9623 if err != nil { 9624 return err 9625 } 9626 for k, v := range m { 9627 switch k { 9628 case "identifier": 9629 if v != nil { 9630 var sharedGalleryIdentifier SharedGalleryIdentifier 9631 err = json.Unmarshal(*v, &sharedGalleryIdentifier) 9632 if err != nil { 9633 return err 9634 } 9635 psgr.SharedGalleryIdentifier = &sharedGalleryIdentifier 9636 } 9637 case "name": 9638 if v != nil { 9639 var name string 9640 err = json.Unmarshal(*v, &name) 9641 if err != nil { 9642 return err 9643 } 9644 psgr.Name = &name 9645 } 9646 case "location": 9647 if v != nil { 9648 var location string 9649 err = json.Unmarshal(*v, &location) 9650 if err != nil { 9651 return err 9652 } 9653 psgr.Location = &location 9654 } 9655 } 9656 } 9657 9658 return nil 9659} 9660 9661// Plan specifies information about the marketplace image used to create the virtual machine. This element 9662// is only used for marketplace images. Before you can use a marketplace image from an API, you must enable 9663// the image for programmatic use. In the Azure portal, find the marketplace image that you want to use 9664// and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and 9665// then click **Save**. 9666type Plan struct { 9667 // Name - The plan ID. 9668 Name *string `json:"name,omitempty"` 9669 // Publisher - The publisher ID. 9670 Publisher *string `json:"publisher,omitempty"` 9671 // Product - Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. 9672 Product *string `json:"product,omitempty"` 9673 // PromotionCode - The promotion code. 9674 PromotionCode *string `json:"promotionCode,omitempty"` 9675} 9676 9677// PrivateEndpoint the Private Endpoint resource. 9678type PrivateEndpoint struct { 9679 // ID - READ-ONLY; The ARM identifier for Private Endpoint 9680 ID *string `json:"id,omitempty"` 9681} 9682 9683// MarshalJSON is the custom marshaler for PrivateEndpoint. 9684func (peVar PrivateEndpoint) MarshalJSON() ([]byte, error) { 9685 objectMap := make(map[string]interface{}) 9686 return json.Marshal(objectMap) 9687} 9688 9689// PrivateEndpointConnection the Private Endpoint Connection resource. 9690type PrivateEndpointConnection struct { 9691 autorest.Response `json:"-"` 9692 // PrivateEndpointConnectionProperties - Resource properties. 9693 *PrivateEndpointConnectionProperties `json:"properties,omitempty"` 9694 // ID - READ-ONLY; private endpoint connection Id 9695 ID *string `json:"id,omitempty"` 9696 // Name - READ-ONLY; private endpoint connection name 9697 Name *string `json:"name,omitempty"` 9698 // Type - READ-ONLY; private endpoint connection type 9699 Type *string `json:"type,omitempty"` 9700} 9701 9702// MarshalJSON is the custom marshaler for PrivateEndpointConnection. 9703func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) { 9704 objectMap := make(map[string]interface{}) 9705 if pec.PrivateEndpointConnectionProperties != nil { 9706 objectMap["properties"] = pec.PrivateEndpointConnectionProperties 9707 } 9708 return json.Marshal(objectMap) 9709} 9710 9711// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct. 9712func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error { 9713 var m map[string]*json.RawMessage 9714 err := json.Unmarshal(body, &m) 9715 if err != nil { 9716 return err 9717 } 9718 for k, v := range m { 9719 switch k { 9720 case "properties": 9721 if v != nil { 9722 var privateEndpointConnectionProperties PrivateEndpointConnectionProperties 9723 err = json.Unmarshal(*v, &privateEndpointConnectionProperties) 9724 if err != nil { 9725 return err 9726 } 9727 pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties 9728 } 9729 case "id": 9730 if v != nil { 9731 var ID string 9732 err = json.Unmarshal(*v, &ID) 9733 if err != nil { 9734 return err 9735 } 9736 pec.ID = &ID 9737 } 9738 case "name": 9739 if v != nil { 9740 var name string 9741 err = json.Unmarshal(*v, &name) 9742 if err != nil { 9743 return err 9744 } 9745 pec.Name = &name 9746 } 9747 case "type": 9748 if v != nil { 9749 var typeVar string 9750 err = json.Unmarshal(*v, &typeVar) 9751 if err != nil { 9752 return err 9753 } 9754 pec.Type = &typeVar 9755 } 9756 } 9757 } 9758 9759 return nil 9760} 9761 9762// PrivateEndpointConnectionListResult a list of private link resources 9763type PrivateEndpointConnectionListResult struct { 9764 autorest.Response `json:"-"` 9765 // Value - Array of private endpoint connections 9766 Value *[]PrivateEndpointConnection `json:"value,omitempty"` 9767 // NextLink - The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the next page of snapshots. 9768 NextLink *string `json:"nextLink,omitempty"` 9769} 9770 9771// PrivateEndpointConnectionListResultIterator provides access to a complete listing of 9772// PrivateEndpointConnection values. 9773type PrivateEndpointConnectionListResultIterator struct { 9774 i int 9775 page PrivateEndpointConnectionListResultPage 9776} 9777 9778// NextWithContext advances to the next value. If there was an error making 9779// the request the iterator does not advance and the error is returned. 9780func (iter *PrivateEndpointConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) { 9781 if tracing.IsEnabled() { 9782 ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultIterator.NextWithContext") 9783 defer func() { 9784 sc := -1 9785 if iter.Response().Response.Response != nil { 9786 sc = iter.Response().Response.Response.StatusCode 9787 } 9788 tracing.EndSpan(ctx, sc, err) 9789 }() 9790 } 9791 iter.i++ 9792 if iter.i < len(iter.page.Values()) { 9793 return nil 9794 } 9795 err = iter.page.NextWithContext(ctx) 9796 if err != nil { 9797 iter.i-- 9798 return err 9799 } 9800 iter.i = 0 9801 return nil 9802} 9803 9804// Next advances to the next value. If there was an error making 9805// the request the iterator does not advance and the error is returned. 9806// Deprecated: Use NextWithContext() instead. 9807func (iter *PrivateEndpointConnectionListResultIterator) Next() error { 9808 return iter.NextWithContext(context.Background()) 9809} 9810 9811// NotDone returns true if the enumeration should be started or is not yet complete. 9812func (iter PrivateEndpointConnectionListResultIterator) NotDone() bool { 9813 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9814} 9815 9816// Response returns the raw server response from the last page request. 9817func (iter PrivateEndpointConnectionListResultIterator) Response() PrivateEndpointConnectionListResult { 9818 return iter.page.Response() 9819} 9820 9821// Value returns the current value or a zero-initialized value if the 9822// iterator has advanced beyond the end of the collection. 9823func (iter PrivateEndpointConnectionListResultIterator) Value() PrivateEndpointConnection { 9824 if !iter.page.NotDone() { 9825 return PrivateEndpointConnection{} 9826 } 9827 return iter.page.Values()[iter.i] 9828} 9829 9830// Creates a new instance of the PrivateEndpointConnectionListResultIterator type. 9831func NewPrivateEndpointConnectionListResultIterator(page PrivateEndpointConnectionListResultPage) PrivateEndpointConnectionListResultIterator { 9832 return PrivateEndpointConnectionListResultIterator{page: page} 9833} 9834 9835// IsEmpty returns true if the ListResult contains no values. 9836func (peclr PrivateEndpointConnectionListResult) IsEmpty() bool { 9837 return peclr.Value == nil || len(*peclr.Value) == 0 9838} 9839 9840// hasNextLink returns true if the NextLink is not empty. 9841func (peclr PrivateEndpointConnectionListResult) hasNextLink() bool { 9842 return peclr.NextLink != nil && len(*peclr.NextLink) != 0 9843} 9844 9845// privateEndpointConnectionListResultPreparer prepares a request to retrieve the next set of results. 9846// It returns nil if no more results exist. 9847func (peclr PrivateEndpointConnectionListResult) privateEndpointConnectionListResultPreparer(ctx context.Context) (*http.Request, error) { 9848 if !peclr.hasNextLink() { 9849 return nil, nil 9850 } 9851 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9852 autorest.AsJSON(), 9853 autorest.AsGet(), 9854 autorest.WithBaseURL(to.String(peclr.NextLink))) 9855} 9856 9857// PrivateEndpointConnectionListResultPage contains a page of PrivateEndpointConnection values. 9858type PrivateEndpointConnectionListResultPage struct { 9859 fn func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error) 9860 peclr PrivateEndpointConnectionListResult 9861} 9862 9863// NextWithContext advances to the next page of values. If there was an error making 9864// the request the page does not advance and the error is returned. 9865func (page *PrivateEndpointConnectionListResultPage) NextWithContext(ctx context.Context) (err error) { 9866 if tracing.IsEnabled() { 9867 ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultPage.NextWithContext") 9868 defer func() { 9869 sc := -1 9870 if page.Response().Response.Response != nil { 9871 sc = page.Response().Response.Response.StatusCode 9872 } 9873 tracing.EndSpan(ctx, sc, err) 9874 }() 9875 } 9876 for { 9877 next, err := page.fn(ctx, page.peclr) 9878 if err != nil { 9879 return err 9880 } 9881 page.peclr = next 9882 if !next.hasNextLink() || !next.IsEmpty() { 9883 break 9884 } 9885 } 9886 return nil 9887} 9888 9889// Next advances to the next page of values. If there was an error making 9890// the request the page does not advance and the error is returned. 9891// Deprecated: Use NextWithContext() instead. 9892func (page *PrivateEndpointConnectionListResultPage) Next() error { 9893 return page.NextWithContext(context.Background()) 9894} 9895 9896// NotDone returns true if the page enumeration should be started or is not yet complete. 9897func (page PrivateEndpointConnectionListResultPage) NotDone() bool { 9898 return !page.peclr.IsEmpty() 9899} 9900 9901// Response returns the raw server response from the last page request. 9902func (page PrivateEndpointConnectionListResultPage) Response() PrivateEndpointConnectionListResult { 9903 return page.peclr 9904} 9905 9906// Values returns the slice of values for the current page or nil if there are no values. 9907func (page PrivateEndpointConnectionListResultPage) Values() []PrivateEndpointConnection { 9908 if page.peclr.IsEmpty() { 9909 return nil 9910 } 9911 return *page.peclr.Value 9912} 9913 9914// Creates a new instance of the PrivateEndpointConnectionListResultPage type. 9915func NewPrivateEndpointConnectionListResultPage(cur PrivateEndpointConnectionListResult, getNextPage func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error)) PrivateEndpointConnectionListResultPage { 9916 return PrivateEndpointConnectionListResultPage{ 9917 fn: getNextPage, 9918 peclr: cur, 9919 } 9920} 9921 9922// PrivateEndpointConnectionProperties properties of the PrivateEndpointConnectProperties. 9923type PrivateEndpointConnectionProperties struct { 9924 // PrivateEndpoint - READ-ONLY; The resource of private end point. 9925 PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` 9926 // PrivateLinkServiceConnectionState - A collection of information about the state of the connection between DiskAccess and Virtual Network. 9927 PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` 9928 // ProvisioningState - The provisioning state of the private endpoint connection resource. Possible values include: 'PrivateEndpointConnectionProvisioningStateSucceeded', 'PrivateEndpointConnectionProvisioningStateCreating', 'PrivateEndpointConnectionProvisioningStateDeleting', 'PrivateEndpointConnectionProvisioningStateFailed' 9929 ProvisioningState PrivateEndpointConnectionProvisioningState `json:"provisioningState,omitempty"` 9930} 9931 9932// MarshalJSON is the custom marshaler for PrivateEndpointConnectionProperties. 9933func (pecp PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { 9934 objectMap := make(map[string]interface{}) 9935 if pecp.PrivateLinkServiceConnectionState != nil { 9936 objectMap["privateLinkServiceConnectionState"] = pecp.PrivateLinkServiceConnectionState 9937 } 9938 if pecp.ProvisioningState != "" { 9939 objectMap["provisioningState"] = pecp.ProvisioningState 9940 } 9941 return json.Marshal(objectMap) 9942} 9943 9944// PrivateLinkResource a private link resource 9945type PrivateLinkResource struct { 9946 // PrivateLinkResourceProperties - Resource properties. 9947 *PrivateLinkResourceProperties `json:"properties,omitempty"` 9948 // ID - READ-ONLY; private link resource Id 9949 ID *string `json:"id,omitempty"` 9950 // Name - READ-ONLY; private link resource name 9951 Name *string `json:"name,omitempty"` 9952 // Type - READ-ONLY; private link resource type 9953 Type *string `json:"type,omitempty"` 9954} 9955 9956// MarshalJSON is the custom marshaler for PrivateLinkResource. 9957func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) { 9958 objectMap := make(map[string]interface{}) 9959 if plr.PrivateLinkResourceProperties != nil { 9960 objectMap["properties"] = plr.PrivateLinkResourceProperties 9961 } 9962 return json.Marshal(objectMap) 9963} 9964 9965// UnmarshalJSON is the custom unmarshaler for PrivateLinkResource struct. 9966func (plr *PrivateLinkResource) UnmarshalJSON(body []byte) error { 9967 var m map[string]*json.RawMessage 9968 err := json.Unmarshal(body, &m) 9969 if err != nil { 9970 return err 9971 } 9972 for k, v := range m { 9973 switch k { 9974 case "properties": 9975 if v != nil { 9976 var privateLinkResourceProperties PrivateLinkResourceProperties 9977 err = json.Unmarshal(*v, &privateLinkResourceProperties) 9978 if err != nil { 9979 return err 9980 } 9981 plr.PrivateLinkResourceProperties = &privateLinkResourceProperties 9982 } 9983 case "id": 9984 if v != nil { 9985 var ID string 9986 err = json.Unmarshal(*v, &ID) 9987 if err != nil { 9988 return err 9989 } 9990 plr.ID = &ID 9991 } 9992 case "name": 9993 if v != nil { 9994 var name string 9995 err = json.Unmarshal(*v, &name) 9996 if err != nil { 9997 return err 9998 } 9999 plr.Name = &name 10000 } 10001 case "type": 10002 if v != nil { 10003 var typeVar string 10004 err = json.Unmarshal(*v, &typeVar) 10005 if err != nil { 10006 return err 10007 } 10008 plr.Type = &typeVar 10009 } 10010 } 10011 } 10012 10013 return nil 10014} 10015 10016// PrivateLinkResourceListResult a list of private link resources 10017type PrivateLinkResourceListResult struct { 10018 autorest.Response `json:"-"` 10019 // Value - Array of private link resources 10020 Value *[]PrivateLinkResource `json:"value,omitempty"` 10021} 10022 10023// PrivateLinkResourceProperties properties of a private link resource. 10024type PrivateLinkResourceProperties struct { 10025 // GroupID - READ-ONLY; The private link resource group id. 10026 GroupID *string `json:"groupId,omitempty"` 10027 // RequiredMembers - READ-ONLY; The private link resource required member names. 10028 RequiredMembers *[]string `json:"requiredMembers,omitempty"` 10029 // RequiredZoneNames - The private link resource DNS zone name. 10030 RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` 10031} 10032 10033// MarshalJSON is the custom marshaler for PrivateLinkResourceProperties. 10034func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { 10035 objectMap := make(map[string]interface{}) 10036 if plrp.RequiredZoneNames != nil { 10037 objectMap["requiredZoneNames"] = plrp.RequiredZoneNames 10038 } 10039 return json.Marshal(objectMap) 10040} 10041 10042// PrivateLinkServiceConnectionState a collection of information about the state of the connection between 10043// service consumer and provider. 10044type PrivateLinkServiceConnectionState struct { 10045 // Status - Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: 'PrivateEndpointServiceConnectionStatusPending', 'PrivateEndpointServiceConnectionStatusApproved', 'PrivateEndpointServiceConnectionStatusRejected' 10046 Status PrivateEndpointServiceConnectionStatus `json:"status,omitempty"` 10047 // Description - The reason for approval/rejection of the connection. 10048 Description *string `json:"description,omitempty"` 10049 // ActionsRequired - A message indicating if changes on the service provider require any updates on the consumer. 10050 ActionsRequired *string `json:"actionsRequired,omitempty"` 10051} 10052 10053// PropertyUpdatesInProgress properties of the disk for which update is pending. 10054type PropertyUpdatesInProgress struct { 10055 // TargetTier - The target performance tier of the disk if a tier change operation is in progress. 10056 TargetTier *string `json:"targetTier,omitempty"` 10057} 10058 10059// ProximityPlacementGroup specifies information about the proximity placement group. 10060type ProximityPlacementGroup struct { 10061 autorest.Response `json:"-"` 10062 // ProximityPlacementGroupProperties - Describes the properties of a Proximity Placement Group. 10063 *ProximityPlacementGroupProperties `json:"properties,omitempty"` 10064 // ID - READ-ONLY; Resource Id 10065 ID *string `json:"id,omitempty"` 10066 // Name - READ-ONLY; Resource name 10067 Name *string `json:"name,omitempty"` 10068 // Type - READ-ONLY; Resource type 10069 Type *string `json:"type,omitempty"` 10070 // Location - Resource location 10071 Location *string `json:"location,omitempty"` 10072 // Tags - Resource tags 10073 Tags map[string]*string `json:"tags"` 10074} 10075 10076// MarshalJSON is the custom marshaler for ProximityPlacementGroup. 10077func (ppg ProximityPlacementGroup) MarshalJSON() ([]byte, error) { 10078 objectMap := make(map[string]interface{}) 10079 if ppg.ProximityPlacementGroupProperties != nil { 10080 objectMap["properties"] = ppg.ProximityPlacementGroupProperties 10081 } 10082 if ppg.Location != nil { 10083 objectMap["location"] = ppg.Location 10084 } 10085 if ppg.Tags != nil { 10086 objectMap["tags"] = ppg.Tags 10087 } 10088 return json.Marshal(objectMap) 10089} 10090 10091// UnmarshalJSON is the custom unmarshaler for ProximityPlacementGroup struct. 10092func (ppg *ProximityPlacementGroup) UnmarshalJSON(body []byte) error { 10093 var m map[string]*json.RawMessage 10094 err := json.Unmarshal(body, &m) 10095 if err != nil { 10096 return err 10097 } 10098 for k, v := range m { 10099 switch k { 10100 case "properties": 10101 if v != nil { 10102 var proximityPlacementGroupProperties ProximityPlacementGroupProperties 10103 err = json.Unmarshal(*v, &proximityPlacementGroupProperties) 10104 if err != nil { 10105 return err 10106 } 10107 ppg.ProximityPlacementGroupProperties = &proximityPlacementGroupProperties 10108 } 10109 case "id": 10110 if v != nil { 10111 var ID string 10112 err = json.Unmarshal(*v, &ID) 10113 if err != nil { 10114 return err 10115 } 10116 ppg.ID = &ID 10117 } 10118 case "name": 10119 if v != nil { 10120 var name string 10121 err = json.Unmarshal(*v, &name) 10122 if err != nil { 10123 return err 10124 } 10125 ppg.Name = &name 10126 } 10127 case "type": 10128 if v != nil { 10129 var typeVar string 10130 err = json.Unmarshal(*v, &typeVar) 10131 if err != nil { 10132 return err 10133 } 10134 ppg.Type = &typeVar 10135 } 10136 case "location": 10137 if v != nil { 10138 var location string 10139 err = json.Unmarshal(*v, &location) 10140 if err != nil { 10141 return err 10142 } 10143 ppg.Location = &location 10144 } 10145 case "tags": 10146 if v != nil { 10147 var tags map[string]*string 10148 err = json.Unmarshal(*v, &tags) 10149 if err != nil { 10150 return err 10151 } 10152 ppg.Tags = tags 10153 } 10154 } 10155 } 10156 10157 return nil 10158} 10159 10160// ProximityPlacementGroupListResult the List Proximity Placement Group operation response. 10161type ProximityPlacementGroupListResult struct { 10162 autorest.Response `json:"-"` 10163 // Value - The list of proximity placement groups 10164 Value *[]ProximityPlacementGroup `json:"value,omitempty"` 10165 // NextLink - The URI to fetch the next page of proximity placement groups. 10166 NextLink *string `json:"nextLink,omitempty"` 10167} 10168 10169// ProximityPlacementGroupListResultIterator provides access to a complete listing of 10170// ProximityPlacementGroup values. 10171type ProximityPlacementGroupListResultIterator struct { 10172 i int 10173 page ProximityPlacementGroupListResultPage 10174} 10175 10176// NextWithContext advances to the next value. If there was an error making 10177// the request the iterator does not advance and the error is returned. 10178func (iter *ProximityPlacementGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { 10179 if tracing.IsEnabled() { 10180 ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupListResultIterator.NextWithContext") 10181 defer func() { 10182 sc := -1 10183 if iter.Response().Response.Response != nil { 10184 sc = iter.Response().Response.Response.StatusCode 10185 } 10186 tracing.EndSpan(ctx, sc, err) 10187 }() 10188 } 10189 iter.i++ 10190 if iter.i < len(iter.page.Values()) { 10191 return nil 10192 } 10193 err = iter.page.NextWithContext(ctx) 10194 if err != nil { 10195 iter.i-- 10196 return err 10197 } 10198 iter.i = 0 10199 return nil 10200} 10201 10202// Next advances to the next value. If there was an error making 10203// the request the iterator does not advance and the error is returned. 10204// Deprecated: Use NextWithContext() instead. 10205func (iter *ProximityPlacementGroupListResultIterator) Next() error { 10206 return iter.NextWithContext(context.Background()) 10207} 10208 10209// NotDone returns true if the enumeration should be started or is not yet complete. 10210func (iter ProximityPlacementGroupListResultIterator) NotDone() bool { 10211 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10212} 10213 10214// Response returns the raw server response from the last page request. 10215func (iter ProximityPlacementGroupListResultIterator) Response() ProximityPlacementGroupListResult { 10216 return iter.page.Response() 10217} 10218 10219// Value returns the current value or a zero-initialized value if the 10220// iterator has advanced beyond the end of the collection. 10221func (iter ProximityPlacementGroupListResultIterator) Value() ProximityPlacementGroup { 10222 if !iter.page.NotDone() { 10223 return ProximityPlacementGroup{} 10224 } 10225 return iter.page.Values()[iter.i] 10226} 10227 10228// Creates a new instance of the ProximityPlacementGroupListResultIterator type. 10229func NewProximityPlacementGroupListResultIterator(page ProximityPlacementGroupListResultPage) ProximityPlacementGroupListResultIterator { 10230 return ProximityPlacementGroupListResultIterator{page: page} 10231} 10232 10233// IsEmpty returns true if the ListResult contains no values. 10234func (ppglr ProximityPlacementGroupListResult) IsEmpty() bool { 10235 return ppglr.Value == nil || len(*ppglr.Value) == 0 10236} 10237 10238// hasNextLink returns true if the NextLink is not empty. 10239func (ppglr ProximityPlacementGroupListResult) hasNextLink() bool { 10240 return ppglr.NextLink != nil && len(*ppglr.NextLink) != 0 10241} 10242 10243// proximityPlacementGroupListResultPreparer prepares a request to retrieve the next set of results. 10244// It returns nil if no more results exist. 10245func (ppglr ProximityPlacementGroupListResult) proximityPlacementGroupListResultPreparer(ctx context.Context) (*http.Request, error) { 10246 if !ppglr.hasNextLink() { 10247 return nil, nil 10248 } 10249 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10250 autorest.AsJSON(), 10251 autorest.AsGet(), 10252 autorest.WithBaseURL(to.String(ppglr.NextLink))) 10253} 10254 10255// ProximityPlacementGroupListResultPage contains a page of ProximityPlacementGroup values. 10256type ProximityPlacementGroupListResultPage struct { 10257 fn func(context.Context, ProximityPlacementGroupListResult) (ProximityPlacementGroupListResult, error) 10258 ppglr ProximityPlacementGroupListResult 10259} 10260 10261// NextWithContext advances to the next page of values. If there was an error making 10262// the request the page does not advance and the error is returned. 10263func (page *ProximityPlacementGroupListResultPage) NextWithContext(ctx context.Context) (err error) { 10264 if tracing.IsEnabled() { 10265 ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupListResultPage.NextWithContext") 10266 defer func() { 10267 sc := -1 10268 if page.Response().Response.Response != nil { 10269 sc = page.Response().Response.Response.StatusCode 10270 } 10271 tracing.EndSpan(ctx, sc, err) 10272 }() 10273 } 10274 for { 10275 next, err := page.fn(ctx, page.ppglr) 10276 if err != nil { 10277 return err 10278 } 10279 page.ppglr = next 10280 if !next.hasNextLink() || !next.IsEmpty() { 10281 break 10282 } 10283 } 10284 return nil 10285} 10286 10287// Next advances to the next page of values. If there was an error making 10288// the request the page does not advance and the error is returned. 10289// Deprecated: Use NextWithContext() instead. 10290func (page *ProximityPlacementGroupListResultPage) Next() error { 10291 return page.NextWithContext(context.Background()) 10292} 10293 10294// NotDone returns true if the page enumeration should be started or is not yet complete. 10295func (page ProximityPlacementGroupListResultPage) NotDone() bool { 10296 return !page.ppglr.IsEmpty() 10297} 10298 10299// Response returns the raw server response from the last page request. 10300func (page ProximityPlacementGroupListResultPage) Response() ProximityPlacementGroupListResult { 10301 return page.ppglr 10302} 10303 10304// Values returns the slice of values for the current page or nil if there are no values. 10305func (page ProximityPlacementGroupListResultPage) Values() []ProximityPlacementGroup { 10306 if page.ppglr.IsEmpty() { 10307 return nil 10308 } 10309 return *page.ppglr.Value 10310} 10311 10312// Creates a new instance of the ProximityPlacementGroupListResultPage type. 10313func NewProximityPlacementGroupListResultPage(cur ProximityPlacementGroupListResult, getNextPage func(context.Context, ProximityPlacementGroupListResult) (ProximityPlacementGroupListResult, error)) ProximityPlacementGroupListResultPage { 10314 return ProximityPlacementGroupListResultPage{ 10315 fn: getNextPage, 10316 ppglr: cur, 10317 } 10318} 10319 10320// ProximityPlacementGroupProperties describes the properties of a Proximity Placement Group. 10321type ProximityPlacementGroupProperties struct { 10322 // 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: 'ProximityPlacementGroupTypeStandard', 'ProximityPlacementGroupTypeUltra' 10323 ProximityPlacementGroupType ProximityPlacementGroupType `json:"proximityPlacementGroupType,omitempty"` 10324 // VirtualMachines - READ-ONLY; A list of references to all virtual machines in the proximity placement group. 10325 VirtualMachines *[]SubResourceWithColocationStatus `json:"virtualMachines,omitempty"` 10326 // VirtualMachineScaleSets - READ-ONLY; A list of references to all virtual machine scale sets in the proximity placement group. 10327 VirtualMachineScaleSets *[]SubResourceWithColocationStatus `json:"virtualMachineScaleSets,omitempty"` 10328 // AvailabilitySets - READ-ONLY; A list of references to all availability sets in the proximity placement group. 10329 AvailabilitySets *[]SubResourceWithColocationStatus `json:"availabilitySets,omitempty"` 10330 // ColocationStatus - Describes colocation status of the Proximity Placement Group. 10331 ColocationStatus *InstanceViewStatus `json:"colocationStatus,omitempty"` 10332} 10333 10334// MarshalJSON is the custom marshaler for ProximityPlacementGroupProperties. 10335func (ppgp ProximityPlacementGroupProperties) MarshalJSON() ([]byte, error) { 10336 objectMap := make(map[string]interface{}) 10337 if ppgp.ProximityPlacementGroupType != "" { 10338 objectMap["proximityPlacementGroupType"] = ppgp.ProximityPlacementGroupType 10339 } 10340 if ppgp.ColocationStatus != nil { 10341 objectMap["colocationStatus"] = ppgp.ColocationStatus 10342 } 10343 return json.Marshal(objectMap) 10344} 10345 10346// ProximityPlacementGroupUpdate specifies information about the proximity placement group. 10347type ProximityPlacementGroupUpdate struct { 10348 // Tags - Resource tags 10349 Tags map[string]*string `json:"tags"` 10350} 10351 10352// MarshalJSON is the custom marshaler for ProximityPlacementGroupUpdate. 10353func (ppgu ProximityPlacementGroupUpdate) MarshalJSON() ([]byte, error) { 10354 objectMap := make(map[string]interface{}) 10355 if ppgu.Tags != nil { 10356 objectMap["tags"] = ppgu.Tags 10357 } 10358 return json.Marshal(objectMap) 10359} 10360 10361// ProxyOnlyResource the ProxyOnly Resource model definition. 10362type ProxyOnlyResource struct { 10363 // ID - READ-ONLY; Resource Id 10364 ID *string `json:"id,omitempty"` 10365 // Name - READ-ONLY; Resource name 10366 Name *string `json:"name,omitempty"` 10367 // Type - READ-ONLY; Resource type 10368 Type *string `json:"type,omitempty"` 10369} 10370 10371// MarshalJSON is the custom marshaler for ProxyOnlyResource. 10372func (por ProxyOnlyResource) MarshalJSON() ([]byte, error) { 10373 objectMap := make(map[string]interface{}) 10374 return json.Marshal(objectMap) 10375} 10376 10377// ProxyResource the resource model definition for an Azure Resource Manager proxy resource. It will not 10378// have tags and a location 10379type ProxyResource struct { 10380 // ID - READ-ONLY; Resource Id 10381 ID *string `json:"id,omitempty"` 10382 // Name - READ-ONLY; Resource name 10383 Name *string `json:"name,omitempty"` 10384 // Type - READ-ONLY; Resource type 10385 Type *string `json:"type,omitempty"` 10386} 10387 10388// MarshalJSON is the custom marshaler for ProxyResource. 10389func (pr ProxyResource) MarshalJSON() ([]byte, error) { 10390 objectMap := make(map[string]interface{}) 10391 return json.Marshal(objectMap) 10392} 10393 10394// PublicIPAddressSku describes the public IP Sku 10395type PublicIPAddressSku struct { 10396 // PublicIPAddressSkuName - Specify public IP sku name. Possible values include: 'PublicIPAddressSkuNameBasic', 'PublicIPAddressSkuNameStandard' 10397 PublicIPAddressSkuName PublicIPAddressSkuName `json:"publicIPAddressSkuName,omitempty"` 10398 // PublicIPAddressSkuTier - Specify public IP sku tier. Possible values include: 'PublicIPAddressSkuTierRegional', 'PublicIPAddressSkuTierGlobal' 10399 PublicIPAddressSkuTier PublicIPAddressSkuTier `json:"publicIPAddressSkuTier,omitempty"` 10400} 10401 10402// PurchasePlan used for establishing the purchase context of any 3rd Party artifact through MarketPlace. 10403type PurchasePlan struct { 10404 // Publisher - The publisher ID. 10405 Publisher *string `json:"publisher,omitempty"` 10406 // Name - The plan ID. 10407 Name *string `json:"name,omitempty"` 10408 // Product - Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. 10409 Product *string `json:"product,omitempty"` 10410 // PromotionCode - The Offer Promotion Code. 10411 PromotionCode *string `json:"promotionCode,omitempty"` 10412} 10413 10414// ReadCloser ... 10415type ReadCloser struct { 10416 autorest.Response `json:"-"` 10417 Value *io.ReadCloser `json:"value,omitempty"` 10418} 10419 10420// RecommendedMachineConfiguration the properties describe the recommended machine configuration for this 10421// Image Definition. These properties are updatable. 10422type RecommendedMachineConfiguration struct { 10423 VCPUs *ResourceRange `json:"vCPUs,omitempty"` 10424 Memory *ResourceRange `json:"memory,omitempty"` 10425} 10426 10427// RecoveryWalkResponse response after calling a manual recovery walk 10428type RecoveryWalkResponse struct { 10429 autorest.Response `json:"-"` 10430 // WalkPerformed - READ-ONLY; Whether the recovery walk was performed 10431 WalkPerformed *bool `json:"walkPerformed,omitempty"` 10432 // NextPlatformUpdateDomain - READ-ONLY; The next update domain that needs to be walked. Null means walk spanning all update domains has been completed 10433 NextPlatformUpdateDomain *int32 `json:"nextPlatformUpdateDomain,omitempty"` 10434} 10435 10436// MarshalJSON is the custom marshaler for RecoveryWalkResponse. 10437func (rwr RecoveryWalkResponse) MarshalJSON() ([]byte, error) { 10438 objectMap := make(map[string]interface{}) 10439 return json.Marshal(objectMap) 10440} 10441 10442// RegionalReplicationStatus this is the regional replication status. 10443type RegionalReplicationStatus struct { 10444 // Region - READ-ONLY; The region to which the gallery image version is being replicated to. 10445 Region *string `json:"region,omitempty"` 10446 // State - READ-ONLY; This is the regional replication state. Possible values include: 'ReplicationStateUnknown', 'ReplicationStateReplicating', 'ReplicationStateCompleted', 'ReplicationStateFailed' 10447 State ReplicationState `json:"state,omitempty"` 10448 // Details - READ-ONLY; The details of the replication status. 10449 Details *string `json:"details,omitempty"` 10450 // Progress - READ-ONLY; It indicates progress of the replication job. 10451 Progress *int32 `json:"progress,omitempty"` 10452} 10453 10454// MarshalJSON is the custom marshaler for RegionalReplicationStatus. 10455func (rrs RegionalReplicationStatus) MarshalJSON() ([]byte, error) { 10456 objectMap := make(map[string]interface{}) 10457 return json.Marshal(objectMap) 10458} 10459 10460// ReplicationStatus this is the replication status of the gallery image version. 10461type ReplicationStatus struct { 10462 // AggregatedState - READ-ONLY; This is the aggregated replication status based on all the regional replication status flags. Possible values include: 'AggregatedReplicationStateUnknown', 'AggregatedReplicationStateInProgress', 'AggregatedReplicationStateCompleted', 'AggregatedReplicationStateFailed' 10463 AggregatedState AggregatedReplicationState `json:"aggregatedState,omitempty"` 10464 // Summary - READ-ONLY; This is a summary of replication status for each region. 10465 Summary *[]RegionalReplicationStatus `json:"summary,omitempty"` 10466} 10467 10468// MarshalJSON is the custom marshaler for ReplicationStatus. 10469func (rs ReplicationStatus) MarshalJSON() ([]byte, error) { 10470 objectMap := make(map[string]interface{}) 10471 return json.Marshal(objectMap) 10472} 10473 10474// RequestRateByIntervalInput api request input for LogAnalytics getRequestRateByInterval Api. 10475type RequestRateByIntervalInput struct { 10476 // IntervalLength - Interval value in minutes used to create LogAnalytics call rate logs. Possible values include: 'IntervalInMinsThreeMins', 'IntervalInMinsFiveMins', 'IntervalInMinsThirtyMins', 'IntervalInMinsSixtyMins' 10477 IntervalLength IntervalInMins `json:"intervalLength,omitempty"` 10478 // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. 10479 BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` 10480 // FromTime - From time of the query 10481 FromTime *date.Time `json:"fromTime,omitempty"` 10482 // ToTime - To time of the query 10483 ToTime *date.Time `json:"toTime,omitempty"` 10484 // GroupByThrottlePolicy - Group query result by Throttle Policy applied. 10485 GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` 10486 // GroupByOperationName - Group query result by Operation Name. 10487 GroupByOperationName *bool `json:"groupByOperationName,omitempty"` 10488 // GroupByResourceName - Group query result by Resource Name. 10489 GroupByResourceName *bool `json:"groupByResourceName,omitempty"` 10490 // GroupByClientApplicationID - Group query result by Client Application ID. 10491 GroupByClientApplicationID *bool `json:"groupByClientApplicationId,omitempty"` 10492 // GroupByUserAgent - Group query result by User Agent. 10493 GroupByUserAgent *bool `json:"groupByUserAgent,omitempty"` 10494} 10495 10496// Resource the Resource model definition. 10497type Resource struct { 10498 // ID - READ-ONLY; Resource Id 10499 ID *string `json:"id,omitempty"` 10500 // Name - READ-ONLY; Resource name 10501 Name *string `json:"name,omitempty"` 10502 // Type - READ-ONLY; Resource type 10503 Type *string `json:"type,omitempty"` 10504 // Location - Resource location 10505 Location *string `json:"location,omitempty"` 10506 // Tags - Resource tags 10507 Tags map[string]*string `json:"tags"` 10508} 10509 10510// MarshalJSON is the custom marshaler for Resource. 10511func (r Resource) MarshalJSON() ([]byte, error) { 10512 objectMap := make(map[string]interface{}) 10513 if r.Location != nil { 10514 objectMap["location"] = r.Location 10515 } 10516 if r.Tags != nil { 10517 objectMap["tags"] = r.Tags 10518 } 10519 return json.Marshal(objectMap) 10520} 10521 10522// ResourceInstanceViewStatus instance view status. 10523type ResourceInstanceViewStatus struct { 10524 // Code - READ-ONLY; The status code. 10525 Code *string `json:"code,omitempty"` 10526 // DisplayStatus - READ-ONLY; The short localizable label for the status. 10527 DisplayStatus *string `json:"displayStatus,omitempty"` 10528 // Message - READ-ONLY; The detailed status message, including for alerts and error messages. 10529 Message *string `json:"message,omitempty"` 10530 // Time - READ-ONLY; The time of the status. 10531 Time *date.Time `json:"time,omitempty"` 10532 // Level - The level code. Possible values include: 'StatusLevelTypesInfo', 'StatusLevelTypesWarning', 'StatusLevelTypesError' 10533 Level StatusLevelTypes `json:"level,omitempty"` 10534} 10535 10536// MarshalJSON is the custom marshaler for ResourceInstanceViewStatus. 10537func (rivs ResourceInstanceViewStatus) MarshalJSON() ([]byte, error) { 10538 objectMap := make(map[string]interface{}) 10539 if rivs.Level != "" { 10540 objectMap["level"] = rivs.Level 10541 } 10542 return json.Marshal(objectMap) 10543} 10544 10545// ResourceRange describes the resource range. 10546type ResourceRange struct { 10547 // Min - The minimum number of the resource. 10548 Min *int32 `json:"min,omitempty"` 10549 // Max - The maximum number of the resource. 10550 Max *int32 `json:"max,omitempty"` 10551} 10552 10553// ResourceSku describes an available Compute SKU. 10554type ResourceSku struct { 10555 // ResourceType - READ-ONLY; The type of resource the SKU applies to. 10556 ResourceType *string `json:"resourceType,omitempty"` 10557 // Name - READ-ONLY; The name of SKU. 10558 Name *string `json:"name,omitempty"` 10559 // Tier - READ-ONLY; Specifies the tier of virtual machines in a scale set.<br /><br /> Possible Values:<br /><br /> **Standard**<br /><br /> **Basic** 10560 Tier *string `json:"tier,omitempty"` 10561 // Size - READ-ONLY; The Size of the SKU. 10562 Size *string `json:"size,omitempty"` 10563 // Family - READ-ONLY; The Family of this particular SKU. 10564 Family *string `json:"family,omitempty"` 10565 // Kind - READ-ONLY; The Kind of resources that are supported in this SKU. 10566 Kind *string `json:"kind,omitempty"` 10567 // Capacity - READ-ONLY; Specifies the number of virtual machines in the scale set. 10568 Capacity *ResourceSkuCapacity `json:"capacity,omitempty"` 10569 // Locations - READ-ONLY; The set of locations that the SKU is available. 10570 Locations *[]string `json:"locations,omitempty"` 10571 // LocationInfo - READ-ONLY; A list of locations and availability zones in those locations where the SKU is available. 10572 LocationInfo *[]ResourceSkuLocationInfo `json:"locationInfo,omitempty"` 10573 // APIVersions - READ-ONLY; The api versions that support this SKU. 10574 APIVersions *[]string `json:"apiVersions,omitempty"` 10575 // Costs - READ-ONLY; Metadata for retrieving price info. 10576 Costs *[]ResourceSkuCosts `json:"costs,omitempty"` 10577 // Capabilities - READ-ONLY; A name value pair to describe the capability. 10578 Capabilities *[]ResourceSkuCapabilities `json:"capabilities,omitempty"` 10579 // Restrictions - READ-ONLY; The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. 10580 Restrictions *[]ResourceSkuRestrictions `json:"restrictions,omitempty"` 10581} 10582 10583// MarshalJSON is the custom marshaler for ResourceSku. 10584func (rs ResourceSku) MarshalJSON() ([]byte, error) { 10585 objectMap := make(map[string]interface{}) 10586 return json.Marshal(objectMap) 10587} 10588 10589// ResourceSkuCapabilities describes The SKU capabilities object. 10590type ResourceSkuCapabilities struct { 10591 // Name - READ-ONLY; An invariant to describe the feature. 10592 Name *string `json:"name,omitempty"` 10593 // Value - READ-ONLY; An invariant if the feature is measured by quantity. 10594 Value *string `json:"value,omitempty"` 10595} 10596 10597// MarshalJSON is the custom marshaler for ResourceSkuCapabilities. 10598func (rsc ResourceSkuCapabilities) MarshalJSON() ([]byte, error) { 10599 objectMap := make(map[string]interface{}) 10600 return json.Marshal(objectMap) 10601} 10602 10603// ResourceSkuCapacity describes scaling information of a SKU. 10604type ResourceSkuCapacity struct { 10605 // Minimum - READ-ONLY; The minimum capacity. 10606 Minimum *int64 `json:"minimum,omitempty"` 10607 // Maximum - READ-ONLY; The maximum capacity that can be set. 10608 Maximum *int64 `json:"maximum,omitempty"` 10609 // Default - READ-ONLY; The default capacity. 10610 Default *int64 `json:"default,omitempty"` 10611 // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'ResourceSkuCapacityScaleTypeAutomatic', 'ResourceSkuCapacityScaleTypeManual', 'ResourceSkuCapacityScaleTypeNone' 10612 ScaleType ResourceSkuCapacityScaleType `json:"scaleType,omitempty"` 10613} 10614 10615// MarshalJSON is the custom marshaler for ResourceSkuCapacity. 10616func (rsc ResourceSkuCapacity) MarshalJSON() ([]byte, error) { 10617 objectMap := make(map[string]interface{}) 10618 return json.Marshal(objectMap) 10619} 10620 10621// ResourceSkuCosts describes metadata for retrieving price info. 10622type ResourceSkuCosts struct { 10623 // MeterID - READ-ONLY; Used for querying price from commerce. 10624 MeterID *string `json:"meterID,omitempty"` 10625 // Quantity - READ-ONLY; The multiplier is needed to extend the base metered cost. 10626 Quantity *int64 `json:"quantity,omitempty"` 10627 // ExtendedUnit - READ-ONLY; An invariant to show the extended unit. 10628 ExtendedUnit *string `json:"extendedUnit,omitempty"` 10629} 10630 10631// MarshalJSON is the custom marshaler for ResourceSkuCosts. 10632func (rsc ResourceSkuCosts) MarshalJSON() ([]byte, error) { 10633 objectMap := make(map[string]interface{}) 10634 return json.Marshal(objectMap) 10635} 10636 10637// ResourceSkuLocationInfo ... 10638type ResourceSkuLocationInfo struct { 10639 // Location - READ-ONLY; Location of the SKU 10640 Location *string `json:"location,omitempty"` 10641 // Zones - READ-ONLY; List of availability zones where the SKU is supported. 10642 Zones *[]string `json:"zones,omitempty"` 10643 // ZoneDetails - READ-ONLY; Details of capabilities available to a SKU in specific zones. 10644 ZoneDetails *[]ResourceSkuZoneDetails `json:"zoneDetails,omitempty"` 10645} 10646 10647// MarshalJSON is the custom marshaler for ResourceSkuLocationInfo. 10648func (rsli ResourceSkuLocationInfo) MarshalJSON() ([]byte, error) { 10649 objectMap := make(map[string]interface{}) 10650 return json.Marshal(objectMap) 10651} 10652 10653// ResourceSkuRestrictionInfo ... 10654type ResourceSkuRestrictionInfo struct { 10655 // Locations - READ-ONLY; Locations where the SKU is restricted 10656 Locations *[]string `json:"locations,omitempty"` 10657 // Zones - READ-ONLY; List of availability zones where the SKU is restricted. 10658 Zones *[]string `json:"zones,omitempty"` 10659} 10660 10661// MarshalJSON is the custom marshaler for ResourceSkuRestrictionInfo. 10662func (rsri ResourceSkuRestrictionInfo) MarshalJSON() ([]byte, error) { 10663 objectMap := make(map[string]interface{}) 10664 return json.Marshal(objectMap) 10665} 10666 10667// ResourceSkuRestrictions describes scaling information of a SKU. 10668type ResourceSkuRestrictions struct { 10669 // Type - READ-ONLY; The type of restrictions. Possible values include: 'ResourceSkuRestrictionsTypeLocation', 'ResourceSkuRestrictionsTypeZone' 10670 Type ResourceSkuRestrictionsType `json:"type,omitempty"` 10671 // Values - READ-ONLY; The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted. 10672 Values *[]string `json:"values,omitempty"` 10673 // RestrictionInfo - READ-ONLY; The information about the restriction where the SKU cannot be used. 10674 RestrictionInfo *ResourceSkuRestrictionInfo `json:"restrictionInfo,omitempty"` 10675 // ReasonCode - READ-ONLY; The reason for restriction. Possible values include: 'ResourceSkuRestrictionsReasonCodeQuotaID', 'ResourceSkuRestrictionsReasonCodeNotAvailableForSubscription' 10676 ReasonCode ResourceSkuRestrictionsReasonCode `json:"reasonCode,omitempty"` 10677} 10678 10679// MarshalJSON is the custom marshaler for ResourceSkuRestrictions. 10680func (rsr ResourceSkuRestrictions) MarshalJSON() ([]byte, error) { 10681 objectMap := make(map[string]interface{}) 10682 return json.Marshal(objectMap) 10683} 10684 10685// ResourceSkusResult the List Resource Skus operation response. 10686type ResourceSkusResult struct { 10687 autorest.Response `json:"-"` 10688 // Value - The list of skus available for the subscription. 10689 Value *[]ResourceSku `json:"value,omitempty"` 10690 // NextLink - The URI to fetch the next page of Resource Skus. Call ListNext() with this URI to fetch the next page of Resource Skus 10691 NextLink *string `json:"nextLink,omitempty"` 10692} 10693 10694// ResourceSkusResultIterator provides access to a complete listing of ResourceSku values. 10695type ResourceSkusResultIterator struct { 10696 i int 10697 page ResourceSkusResultPage 10698} 10699 10700// NextWithContext advances to the next value. If there was an error making 10701// the request the iterator does not advance and the error is returned. 10702func (iter *ResourceSkusResultIterator) NextWithContext(ctx context.Context) (err error) { 10703 if tracing.IsEnabled() { 10704 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusResultIterator.NextWithContext") 10705 defer func() { 10706 sc := -1 10707 if iter.Response().Response.Response != nil { 10708 sc = iter.Response().Response.Response.StatusCode 10709 } 10710 tracing.EndSpan(ctx, sc, err) 10711 }() 10712 } 10713 iter.i++ 10714 if iter.i < len(iter.page.Values()) { 10715 return nil 10716 } 10717 err = iter.page.NextWithContext(ctx) 10718 if err != nil { 10719 iter.i-- 10720 return err 10721 } 10722 iter.i = 0 10723 return nil 10724} 10725 10726// Next advances to the next value. If there was an error making 10727// the request the iterator does not advance and the error is returned. 10728// Deprecated: Use NextWithContext() instead. 10729func (iter *ResourceSkusResultIterator) Next() error { 10730 return iter.NextWithContext(context.Background()) 10731} 10732 10733// NotDone returns true if the enumeration should be started or is not yet complete. 10734func (iter ResourceSkusResultIterator) NotDone() bool { 10735 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10736} 10737 10738// Response returns the raw server response from the last page request. 10739func (iter ResourceSkusResultIterator) Response() ResourceSkusResult { 10740 return iter.page.Response() 10741} 10742 10743// Value returns the current value or a zero-initialized value if the 10744// iterator has advanced beyond the end of the collection. 10745func (iter ResourceSkusResultIterator) Value() ResourceSku { 10746 if !iter.page.NotDone() { 10747 return ResourceSku{} 10748 } 10749 return iter.page.Values()[iter.i] 10750} 10751 10752// Creates a new instance of the ResourceSkusResultIterator type. 10753func NewResourceSkusResultIterator(page ResourceSkusResultPage) ResourceSkusResultIterator { 10754 return ResourceSkusResultIterator{page: page} 10755} 10756 10757// IsEmpty returns true if the ListResult contains no values. 10758func (rsr ResourceSkusResult) IsEmpty() bool { 10759 return rsr.Value == nil || len(*rsr.Value) == 0 10760} 10761 10762// hasNextLink returns true if the NextLink is not empty. 10763func (rsr ResourceSkusResult) hasNextLink() bool { 10764 return rsr.NextLink != nil && len(*rsr.NextLink) != 0 10765} 10766 10767// resourceSkusResultPreparer prepares a request to retrieve the next set of results. 10768// It returns nil if no more results exist. 10769func (rsr ResourceSkusResult) resourceSkusResultPreparer(ctx context.Context) (*http.Request, error) { 10770 if !rsr.hasNextLink() { 10771 return nil, nil 10772 } 10773 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10774 autorest.AsJSON(), 10775 autorest.AsGet(), 10776 autorest.WithBaseURL(to.String(rsr.NextLink))) 10777} 10778 10779// ResourceSkusResultPage contains a page of ResourceSku values. 10780type ResourceSkusResultPage struct { 10781 fn func(context.Context, ResourceSkusResult) (ResourceSkusResult, error) 10782 rsr ResourceSkusResult 10783} 10784 10785// NextWithContext advances to the next page of values. If there was an error making 10786// the request the page does not advance and the error is returned. 10787func (page *ResourceSkusResultPage) NextWithContext(ctx context.Context) (err error) { 10788 if tracing.IsEnabled() { 10789 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusResultPage.NextWithContext") 10790 defer func() { 10791 sc := -1 10792 if page.Response().Response.Response != nil { 10793 sc = page.Response().Response.Response.StatusCode 10794 } 10795 tracing.EndSpan(ctx, sc, err) 10796 }() 10797 } 10798 for { 10799 next, err := page.fn(ctx, page.rsr) 10800 if err != nil { 10801 return err 10802 } 10803 page.rsr = next 10804 if !next.hasNextLink() || !next.IsEmpty() { 10805 break 10806 } 10807 } 10808 return nil 10809} 10810 10811// Next advances to the next page of values. If there was an error making 10812// the request the page does not advance and the error is returned. 10813// Deprecated: Use NextWithContext() instead. 10814func (page *ResourceSkusResultPage) Next() error { 10815 return page.NextWithContext(context.Background()) 10816} 10817 10818// NotDone returns true if the page enumeration should be started or is not yet complete. 10819func (page ResourceSkusResultPage) NotDone() bool { 10820 return !page.rsr.IsEmpty() 10821} 10822 10823// Response returns the raw server response from the last page request. 10824func (page ResourceSkusResultPage) Response() ResourceSkusResult { 10825 return page.rsr 10826} 10827 10828// Values returns the slice of values for the current page or nil if there are no values. 10829func (page ResourceSkusResultPage) Values() []ResourceSku { 10830 if page.rsr.IsEmpty() { 10831 return nil 10832 } 10833 return *page.rsr.Value 10834} 10835 10836// Creates a new instance of the ResourceSkusResultPage type. 10837func NewResourceSkusResultPage(cur ResourceSkusResult, getNextPage func(context.Context, ResourceSkusResult) (ResourceSkusResult, error)) ResourceSkusResultPage { 10838 return ResourceSkusResultPage{ 10839 fn: getNextPage, 10840 rsr: cur, 10841 } 10842} 10843 10844// ResourceSkuZoneDetails describes The zonal capabilities of a SKU. 10845type ResourceSkuZoneDetails struct { 10846 // Name - READ-ONLY; The set of zones that the SKU is available in with the specified capabilities. 10847 Name *[]string `json:"name,omitempty"` 10848 // Capabilities - READ-ONLY; A list of capabilities that are available for the SKU in the specified list of zones. 10849 Capabilities *[]ResourceSkuCapabilities `json:"capabilities,omitempty"` 10850} 10851 10852// MarshalJSON is the custom marshaler for ResourceSkuZoneDetails. 10853func (rszd ResourceSkuZoneDetails) MarshalJSON() ([]byte, error) { 10854 objectMap := make(map[string]interface{}) 10855 return json.Marshal(objectMap) 10856} 10857 10858// ResourceURIList the List resources which are encrypted with the disk encryption set. 10859type ResourceURIList struct { 10860 autorest.Response `json:"-"` 10861 // Value - A list of IDs or Owner IDs of resources which are encrypted with the disk encryption set. 10862 Value *[]string `json:"value,omitempty"` 10863 // NextLink - The uri to fetch the next page of encrypted resources. Call ListNext() with this to fetch the next page of encrypted resources. 10864 NextLink *string `json:"nextLink,omitempty"` 10865} 10866 10867// ResourceURIListIterator provides access to a complete listing of string values. 10868type ResourceURIListIterator struct { 10869 i int 10870 page ResourceURIListPage 10871} 10872 10873// NextWithContext advances to the next value. If there was an error making 10874// the request the iterator does not advance and the error is returned. 10875func (iter *ResourceURIListIterator) NextWithContext(ctx context.Context) (err error) { 10876 if tracing.IsEnabled() { 10877 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceURIListIterator.NextWithContext") 10878 defer func() { 10879 sc := -1 10880 if iter.Response().Response.Response != nil { 10881 sc = iter.Response().Response.Response.StatusCode 10882 } 10883 tracing.EndSpan(ctx, sc, err) 10884 }() 10885 } 10886 iter.i++ 10887 if iter.i < len(iter.page.Values()) { 10888 return nil 10889 } 10890 err = iter.page.NextWithContext(ctx) 10891 if err != nil { 10892 iter.i-- 10893 return err 10894 } 10895 iter.i = 0 10896 return nil 10897} 10898 10899// Next advances to the next value. If there was an error making 10900// the request the iterator does not advance and the error is returned. 10901// Deprecated: Use NextWithContext() instead. 10902func (iter *ResourceURIListIterator) Next() error { 10903 return iter.NextWithContext(context.Background()) 10904} 10905 10906// NotDone returns true if the enumeration should be started or is not yet complete. 10907func (iter ResourceURIListIterator) NotDone() bool { 10908 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10909} 10910 10911// Response returns the raw server response from the last page request. 10912func (iter ResourceURIListIterator) Response() ResourceURIList { 10913 return iter.page.Response() 10914} 10915 10916// Value returns the current value or a zero-initialized value if the 10917// iterator has advanced beyond the end of the collection. 10918func (iter ResourceURIListIterator) Value() string { 10919 if !iter.page.NotDone() { 10920 return "" 10921 } 10922 return iter.page.Values()[iter.i] 10923} 10924 10925// Creates a new instance of the ResourceURIListIterator type. 10926func NewResourceURIListIterator(page ResourceURIListPage) ResourceURIListIterator { 10927 return ResourceURIListIterator{page: page} 10928} 10929 10930// IsEmpty returns true if the ListResult contains no values. 10931func (rul ResourceURIList) IsEmpty() bool { 10932 return rul.Value == nil || len(*rul.Value) == 0 10933} 10934 10935// hasNextLink returns true if the NextLink is not empty. 10936func (rul ResourceURIList) hasNextLink() bool { 10937 return rul.NextLink != nil && len(*rul.NextLink) != 0 10938} 10939 10940// resourceURIListPreparer prepares a request to retrieve the next set of results. 10941// It returns nil if no more results exist. 10942func (rul ResourceURIList) resourceURIListPreparer(ctx context.Context) (*http.Request, error) { 10943 if !rul.hasNextLink() { 10944 return nil, nil 10945 } 10946 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10947 autorest.AsJSON(), 10948 autorest.AsGet(), 10949 autorest.WithBaseURL(to.String(rul.NextLink))) 10950} 10951 10952// ResourceURIListPage contains a page of string values. 10953type ResourceURIListPage struct { 10954 fn func(context.Context, ResourceURIList) (ResourceURIList, error) 10955 rul ResourceURIList 10956} 10957 10958// NextWithContext advances to the next page of values. If there was an error making 10959// the request the page does not advance and the error is returned. 10960func (page *ResourceURIListPage) NextWithContext(ctx context.Context) (err error) { 10961 if tracing.IsEnabled() { 10962 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceURIListPage.NextWithContext") 10963 defer func() { 10964 sc := -1 10965 if page.Response().Response.Response != nil { 10966 sc = page.Response().Response.Response.StatusCode 10967 } 10968 tracing.EndSpan(ctx, sc, err) 10969 }() 10970 } 10971 for { 10972 next, err := page.fn(ctx, page.rul) 10973 if err != nil { 10974 return err 10975 } 10976 page.rul = next 10977 if !next.hasNextLink() || !next.IsEmpty() { 10978 break 10979 } 10980 } 10981 return nil 10982} 10983 10984// Next advances to the next page of values. If there was an error making 10985// the request the page does not advance and the error is returned. 10986// Deprecated: Use NextWithContext() instead. 10987func (page *ResourceURIListPage) Next() error { 10988 return page.NextWithContext(context.Background()) 10989} 10990 10991// NotDone returns true if the page enumeration should be started or is not yet complete. 10992func (page ResourceURIListPage) NotDone() bool { 10993 return !page.rul.IsEmpty() 10994} 10995 10996// Response returns the raw server response from the last page request. 10997func (page ResourceURIListPage) Response() ResourceURIList { 10998 return page.rul 10999} 11000 11001// Values returns the slice of values for the current page or nil if there are no values. 11002func (page ResourceURIListPage) Values() []string { 11003 if page.rul.IsEmpty() { 11004 return nil 11005 } 11006 return *page.rul.Value 11007} 11008 11009// Creates a new instance of the ResourceURIListPage type. 11010func NewResourceURIListPage(cur ResourceURIList, getNextPage func(context.Context, ResourceURIList) (ResourceURIList, error)) ResourceURIListPage { 11011 return ResourceURIListPage{ 11012 fn: getNextPage, 11013 rul: cur, 11014 } 11015} 11016 11017// RestorePoint restore Point details. 11018type RestorePoint struct { 11019 autorest.Response `json:"-"` 11020 // SourceMetadata - READ-ONLY; Gets the details of the VM captured at the time of the restore point creation. 11021 SourceMetadata *RestorePointSourceMetadata `json:"sourceMetadata,omitempty"` 11022 // ProvisioningState - READ-ONLY; Gets the provisioning state of the restore point. 11023 ProvisioningState *string `json:"provisioningState,omitempty"` 11024 // ConsistencyMode - READ-ONLY; Gets the consistency mode for the restore point. Please refer to https://aka.ms/RestorePoints for more details. Possible values include: 'ConsistencyModeTypesCrashConsistent', 'ConsistencyModeTypesFileSystemConsistent', 'ConsistencyModeTypesApplicationConsistent' 11025 ConsistencyMode ConsistencyModeTypes `json:"consistencyMode,omitempty"` 11026 // ProvisioningDetails - READ-ONLY; Gets the provisioning details set by the server during Create restore point operation. 11027 ProvisioningDetails *RestorePointProvisioningDetails `json:"provisioningDetails,omitempty"` 11028 // ExcludeDisks - List of disk resource ids that the customer wishes to exclude from the restore point. If no disks are specified, all disks will be included. 11029 ExcludeDisks *[]APIEntityReference `json:"excludeDisks,omitempty"` 11030 // ID - READ-ONLY; Resource Id 11031 ID *string `json:"id,omitempty"` 11032 // Name - READ-ONLY; Resource name 11033 Name *string `json:"name,omitempty"` 11034 // Type - READ-ONLY; Resource type 11035 Type *string `json:"type,omitempty"` 11036} 11037 11038// MarshalJSON is the custom marshaler for RestorePoint. 11039func (rp RestorePoint) MarshalJSON() ([]byte, error) { 11040 objectMap := make(map[string]interface{}) 11041 if rp.ExcludeDisks != nil { 11042 objectMap["excludeDisks"] = rp.ExcludeDisks 11043 } 11044 return json.Marshal(objectMap) 11045} 11046 11047// RestorePointCollection create or update Restore Point collection parameters. 11048type RestorePointCollection struct { 11049 autorest.Response `json:"-"` 11050 *RestorePointCollectionProperties `json:"properties,omitempty"` 11051 // ID - READ-ONLY; Resource Id 11052 ID *string `json:"id,omitempty"` 11053 // Name - READ-ONLY; Resource name 11054 Name *string `json:"name,omitempty"` 11055 // Type - READ-ONLY; Resource type 11056 Type *string `json:"type,omitempty"` 11057 // Location - Resource location 11058 Location *string `json:"location,omitempty"` 11059 // Tags - Resource tags 11060 Tags map[string]*string `json:"tags"` 11061} 11062 11063// MarshalJSON is the custom marshaler for RestorePointCollection. 11064func (RPCVar RestorePointCollection) MarshalJSON() ([]byte, error) { 11065 objectMap := make(map[string]interface{}) 11066 if RPCVar.RestorePointCollectionProperties != nil { 11067 objectMap["properties"] = RPCVar.RestorePointCollectionProperties 11068 } 11069 if RPCVar.Location != nil { 11070 objectMap["location"] = RPCVar.Location 11071 } 11072 if RPCVar.Tags != nil { 11073 objectMap["tags"] = RPCVar.Tags 11074 } 11075 return json.Marshal(objectMap) 11076} 11077 11078// UnmarshalJSON is the custom unmarshaler for RestorePointCollection struct. 11079func (RPCVar *RestorePointCollection) UnmarshalJSON(body []byte) error { 11080 var m map[string]*json.RawMessage 11081 err := json.Unmarshal(body, &m) 11082 if err != nil { 11083 return err 11084 } 11085 for k, v := range m { 11086 switch k { 11087 case "properties": 11088 if v != nil { 11089 var restorePointCollectionProperties RestorePointCollectionProperties 11090 err = json.Unmarshal(*v, &restorePointCollectionProperties) 11091 if err != nil { 11092 return err 11093 } 11094 RPCVar.RestorePointCollectionProperties = &restorePointCollectionProperties 11095 } 11096 case "id": 11097 if v != nil { 11098 var ID string 11099 err = json.Unmarshal(*v, &ID) 11100 if err != nil { 11101 return err 11102 } 11103 RPCVar.ID = &ID 11104 } 11105 case "name": 11106 if v != nil { 11107 var name string 11108 err = json.Unmarshal(*v, &name) 11109 if err != nil { 11110 return err 11111 } 11112 RPCVar.Name = &name 11113 } 11114 case "type": 11115 if v != nil { 11116 var typeVar string 11117 err = json.Unmarshal(*v, &typeVar) 11118 if err != nil { 11119 return err 11120 } 11121 RPCVar.Type = &typeVar 11122 } 11123 case "location": 11124 if v != nil { 11125 var location string 11126 err = json.Unmarshal(*v, &location) 11127 if err != nil { 11128 return err 11129 } 11130 RPCVar.Location = &location 11131 } 11132 case "tags": 11133 if v != nil { 11134 var tags map[string]*string 11135 err = json.Unmarshal(*v, &tags) 11136 if err != nil { 11137 return err 11138 } 11139 RPCVar.Tags = tags 11140 } 11141 } 11142 } 11143 11144 return nil 11145} 11146 11147// RestorePointCollectionListResult the List restore point collection operation response. 11148type RestorePointCollectionListResult struct { 11149 autorest.Response `json:"-"` 11150 // Value - Gets the list of restore point collections. 11151 Value *[]RestorePointCollection `json:"value,omitempty"` 11152 // NextLink - The uri to fetch the next page of RestorePointCollections. Call ListNext() with this to fetch the next page of RestorePointCollections 11153 NextLink *string `json:"nextLink,omitempty"` 11154} 11155 11156// RestorePointCollectionListResultIterator provides access to a complete listing of RestorePointCollection 11157// values. 11158type RestorePointCollectionListResultIterator struct { 11159 i int 11160 page RestorePointCollectionListResultPage 11161} 11162 11163// NextWithContext advances to the next value. If there was an error making 11164// the request the iterator does not advance and the error is returned. 11165func (iter *RestorePointCollectionListResultIterator) NextWithContext(ctx context.Context) (err error) { 11166 if tracing.IsEnabled() { 11167 ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointCollectionListResultIterator.NextWithContext") 11168 defer func() { 11169 sc := -1 11170 if iter.Response().Response.Response != nil { 11171 sc = iter.Response().Response.Response.StatusCode 11172 } 11173 tracing.EndSpan(ctx, sc, err) 11174 }() 11175 } 11176 iter.i++ 11177 if iter.i < len(iter.page.Values()) { 11178 return nil 11179 } 11180 err = iter.page.NextWithContext(ctx) 11181 if err != nil { 11182 iter.i-- 11183 return err 11184 } 11185 iter.i = 0 11186 return nil 11187} 11188 11189// Next advances to the next value. If there was an error making 11190// the request the iterator does not advance and the error is returned. 11191// Deprecated: Use NextWithContext() instead. 11192func (iter *RestorePointCollectionListResultIterator) Next() error { 11193 return iter.NextWithContext(context.Background()) 11194} 11195 11196// NotDone returns true if the enumeration should be started or is not yet complete. 11197func (iter RestorePointCollectionListResultIterator) NotDone() bool { 11198 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11199} 11200 11201// Response returns the raw server response from the last page request. 11202func (iter RestorePointCollectionListResultIterator) Response() RestorePointCollectionListResult { 11203 return iter.page.Response() 11204} 11205 11206// Value returns the current value or a zero-initialized value if the 11207// iterator has advanced beyond the end of the collection. 11208func (iter RestorePointCollectionListResultIterator) Value() RestorePointCollection { 11209 if !iter.page.NotDone() { 11210 return RestorePointCollection{} 11211 } 11212 return iter.page.Values()[iter.i] 11213} 11214 11215// Creates a new instance of the RestorePointCollectionListResultIterator type. 11216func NewRestorePointCollectionListResultIterator(page RestorePointCollectionListResultPage) RestorePointCollectionListResultIterator { 11217 return RestorePointCollectionListResultIterator{page: page} 11218} 11219 11220// IsEmpty returns true if the ListResult contains no values. 11221func (rpclr RestorePointCollectionListResult) IsEmpty() bool { 11222 return rpclr.Value == nil || len(*rpclr.Value) == 0 11223} 11224 11225// hasNextLink returns true if the NextLink is not empty. 11226func (rpclr RestorePointCollectionListResult) hasNextLink() bool { 11227 return rpclr.NextLink != nil && len(*rpclr.NextLink) != 0 11228} 11229 11230// restorePointCollectionListResultPreparer prepares a request to retrieve the next set of results. 11231// It returns nil if no more results exist. 11232func (rpclr RestorePointCollectionListResult) restorePointCollectionListResultPreparer(ctx context.Context) (*http.Request, error) { 11233 if !rpclr.hasNextLink() { 11234 return nil, nil 11235 } 11236 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11237 autorest.AsJSON(), 11238 autorest.AsGet(), 11239 autorest.WithBaseURL(to.String(rpclr.NextLink))) 11240} 11241 11242// RestorePointCollectionListResultPage contains a page of RestorePointCollection values. 11243type RestorePointCollectionListResultPage struct { 11244 fn func(context.Context, RestorePointCollectionListResult) (RestorePointCollectionListResult, error) 11245 rpclr RestorePointCollectionListResult 11246} 11247 11248// NextWithContext advances to the next page of values. If there was an error making 11249// the request the page does not advance and the error is returned. 11250func (page *RestorePointCollectionListResultPage) NextWithContext(ctx context.Context) (err error) { 11251 if tracing.IsEnabled() { 11252 ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointCollectionListResultPage.NextWithContext") 11253 defer func() { 11254 sc := -1 11255 if page.Response().Response.Response != nil { 11256 sc = page.Response().Response.Response.StatusCode 11257 } 11258 tracing.EndSpan(ctx, sc, err) 11259 }() 11260 } 11261 for { 11262 next, err := page.fn(ctx, page.rpclr) 11263 if err != nil { 11264 return err 11265 } 11266 page.rpclr = next 11267 if !next.hasNextLink() || !next.IsEmpty() { 11268 break 11269 } 11270 } 11271 return nil 11272} 11273 11274// Next advances to the next page of values. If there was an error making 11275// the request the page does not advance and the error is returned. 11276// Deprecated: Use NextWithContext() instead. 11277func (page *RestorePointCollectionListResultPage) Next() error { 11278 return page.NextWithContext(context.Background()) 11279} 11280 11281// NotDone returns true if the page enumeration should be started or is not yet complete. 11282func (page RestorePointCollectionListResultPage) NotDone() bool { 11283 return !page.rpclr.IsEmpty() 11284} 11285 11286// Response returns the raw server response from the last page request. 11287func (page RestorePointCollectionListResultPage) Response() RestorePointCollectionListResult { 11288 return page.rpclr 11289} 11290 11291// Values returns the slice of values for the current page or nil if there are no values. 11292func (page RestorePointCollectionListResultPage) Values() []RestorePointCollection { 11293 if page.rpclr.IsEmpty() { 11294 return nil 11295 } 11296 return *page.rpclr.Value 11297} 11298 11299// Creates a new instance of the RestorePointCollectionListResultPage type. 11300func NewRestorePointCollectionListResultPage(cur RestorePointCollectionListResult, getNextPage func(context.Context, RestorePointCollectionListResult) (RestorePointCollectionListResult, error)) RestorePointCollectionListResultPage { 11301 return RestorePointCollectionListResultPage{ 11302 fn: getNextPage, 11303 rpclr: cur, 11304 } 11305} 11306 11307// RestorePointCollectionProperties the restore point collection properties. 11308type RestorePointCollectionProperties struct { 11309 Source *RestorePointCollectionSourceProperties `json:"source,omitempty"` 11310 // ProvisioningState - READ-ONLY; The provisioning state of the restore point collection. 11311 ProvisioningState *string `json:"provisioningState,omitempty"` 11312 // RestorePointCollectionID - READ-ONLY; The unique id of the restore point collection. 11313 RestorePointCollectionID *string `json:"restorePointCollectionId,omitempty"` 11314 // RestorePoints - READ-ONLY; A list containing all restore points created under this restore point collection. 11315 RestorePoints *[]RestorePoint `json:"restorePoints,omitempty"` 11316} 11317 11318// MarshalJSON is the custom marshaler for RestorePointCollectionProperties. 11319func (rpcp RestorePointCollectionProperties) MarshalJSON() ([]byte, error) { 11320 objectMap := make(map[string]interface{}) 11321 if rpcp.Source != nil { 11322 objectMap["source"] = rpcp.Source 11323 } 11324 return json.Marshal(objectMap) 11325} 11326 11327// RestorePointCollectionsDeleteFuture an abstraction for monitoring and retrieving the results of a 11328// long-running operation. 11329type RestorePointCollectionsDeleteFuture struct { 11330 azure.FutureAPI 11331 // Result returns the result of the asynchronous operation. 11332 // If the operation has not completed it will return an error. 11333 Result func(RestorePointCollectionsClient) (autorest.Response, error) 11334} 11335 11336// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11337func (future *RestorePointCollectionsDeleteFuture) UnmarshalJSON(body []byte) error { 11338 var azFuture azure.Future 11339 if err := json.Unmarshal(body, &azFuture); err != nil { 11340 return err 11341 } 11342 future.FutureAPI = &azFuture 11343 future.Result = future.result 11344 return nil 11345} 11346 11347// result is the default implementation for RestorePointCollectionsDeleteFuture.Result. 11348func (future *RestorePointCollectionsDeleteFuture) result(client RestorePointCollectionsClient) (ar autorest.Response, err error) { 11349 var done bool 11350 done, err = future.DoneWithContext(context.Background(), client) 11351 if err != nil { 11352 err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsDeleteFuture", "Result", future.Response(), "Polling failure") 11353 return 11354 } 11355 if !done { 11356 ar.Response = future.Response() 11357 err = azure.NewAsyncOpIncompleteError("compute.RestorePointCollectionsDeleteFuture") 11358 return 11359 } 11360 ar.Response = future.Response() 11361 return 11362} 11363 11364// RestorePointCollectionSourceProperties the properties of the source resource that this restore point 11365// collection is created from. 11366type RestorePointCollectionSourceProperties struct { 11367 // Location - READ-ONLY; Location of the source resource used to create this restore point collection. 11368 Location *string `json:"location,omitempty"` 11369 // ID - Resource Id of the source resource used to create this restore point collection 11370 ID *string `json:"id,omitempty"` 11371} 11372 11373// MarshalJSON is the custom marshaler for RestorePointCollectionSourceProperties. 11374func (rpcsp RestorePointCollectionSourceProperties) MarshalJSON() ([]byte, error) { 11375 objectMap := make(map[string]interface{}) 11376 if rpcsp.ID != nil { 11377 objectMap["id"] = rpcsp.ID 11378 } 11379 return json.Marshal(objectMap) 11380} 11381 11382// RestorePointCollectionUpdate update Restore Point collection parameters. 11383type RestorePointCollectionUpdate struct { 11384 *RestorePointCollectionProperties `json:"properties,omitempty"` 11385 // Tags - Resource tags 11386 Tags map[string]*string `json:"tags"` 11387} 11388 11389// MarshalJSON is the custom marshaler for RestorePointCollectionUpdate. 11390func (rpcu RestorePointCollectionUpdate) MarshalJSON() ([]byte, error) { 11391 objectMap := make(map[string]interface{}) 11392 if rpcu.RestorePointCollectionProperties != nil { 11393 objectMap["properties"] = rpcu.RestorePointCollectionProperties 11394 } 11395 if rpcu.Tags != nil { 11396 objectMap["tags"] = rpcu.Tags 11397 } 11398 return json.Marshal(objectMap) 11399} 11400 11401// UnmarshalJSON is the custom unmarshaler for RestorePointCollectionUpdate struct. 11402func (rpcu *RestorePointCollectionUpdate) UnmarshalJSON(body []byte) error { 11403 var m map[string]*json.RawMessage 11404 err := json.Unmarshal(body, &m) 11405 if err != nil { 11406 return err 11407 } 11408 for k, v := range m { 11409 switch k { 11410 case "properties": 11411 if v != nil { 11412 var restorePointCollectionProperties RestorePointCollectionProperties 11413 err = json.Unmarshal(*v, &restorePointCollectionProperties) 11414 if err != nil { 11415 return err 11416 } 11417 rpcu.RestorePointCollectionProperties = &restorePointCollectionProperties 11418 } 11419 case "tags": 11420 if v != nil { 11421 var tags map[string]*string 11422 err = json.Unmarshal(*v, &tags) 11423 if err != nil { 11424 return err 11425 } 11426 rpcu.Tags = tags 11427 } 11428 } 11429 } 11430 11431 return nil 11432} 11433 11434// RestorePointProvisioningDetails restore Point Provisioning details. 11435type RestorePointProvisioningDetails struct { 11436 // CreationTime - Gets the creation time of the restore point. 11437 CreationTime *date.Time `json:"creationTime,omitempty"` 11438 // TotalUsedSizeInBytes - Gets the total size of the data in all the disks which are part of the restore point. 11439 TotalUsedSizeInBytes *int64 `json:"totalUsedSizeInBytes,omitempty"` 11440 // StatusCode - Gets the status of the Create restore point operation. 11441 StatusCode *int32 `json:"statusCode,omitempty"` 11442 // StatusMessage - Gets the status message of the Create restore point operation. 11443 StatusMessage *string `json:"statusMessage,omitempty"` 11444} 11445 11446// RestorePointsCreateFuture an abstraction for monitoring and retrieving the results of a long-running 11447// operation. 11448type RestorePointsCreateFuture struct { 11449 azure.FutureAPI 11450 // Result returns the result of the asynchronous operation. 11451 // If the operation has not completed it will return an error. 11452 Result func(RestorePointsClient) (RestorePoint, error) 11453} 11454 11455// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11456func (future *RestorePointsCreateFuture) UnmarshalJSON(body []byte) error { 11457 var azFuture azure.Future 11458 if err := json.Unmarshal(body, &azFuture); err != nil { 11459 return err 11460 } 11461 future.FutureAPI = &azFuture 11462 future.Result = future.result 11463 return nil 11464} 11465 11466// result is the default implementation for RestorePointsCreateFuture.Result. 11467func (future *RestorePointsCreateFuture) result(client RestorePointsClient) (rp RestorePoint, err error) { 11468 var done bool 11469 done, err = future.DoneWithContext(context.Background(), client) 11470 if err != nil { 11471 err = autorest.NewErrorWithError(err, "compute.RestorePointsCreateFuture", "Result", future.Response(), "Polling failure") 11472 return 11473 } 11474 if !done { 11475 rp.Response.Response = future.Response() 11476 err = azure.NewAsyncOpIncompleteError("compute.RestorePointsCreateFuture") 11477 return 11478 } 11479 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11480 if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { 11481 rp, err = client.CreateResponder(rp.Response.Response) 11482 if err != nil { 11483 err = autorest.NewErrorWithError(err, "compute.RestorePointsCreateFuture", "Result", rp.Response.Response, "Failure responding to request") 11484 } 11485 } 11486 return 11487} 11488 11489// RestorePointsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 11490// operation. 11491type RestorePointsDeleteFuture struct { 11492 azure.FutureAPI 11493 // Result returns the result of the asynchronous operation. 11494 // If the operation has not completed it will return an error. 11495 Result func(RestorePointsClient) (autorest.Response, error) 11496} 11497 11498// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11499func (future *RestorePointsDeleteFuture) UnmarshalJSON(body []byte) error { 11500 var azFuture azure.Future 11501 if err := json.Unmarshal(body, &azFuture); err != nil { 11502 return err 11503 } 11504 future.FutureAPI = &azFuture 11505 future.Result = future.result 11506 return nil 11507} 11508 11509// result is the default implementation for RestorePointsDeleteFuture.Result. 11510func (future *RestorePointsDeleteFuture) result(client RestorePointsClient) (ar autorest.Response, err error) { 11511 var done bool 11512 done, err = future.DoneWithContext(context.Background(), client) 11513 if err != nil { 11514 err = autorest.NewErrorWithError(err, "compute.RestorePointsDeleteFuture", "Result", future.Response(), "Polling failure") 11515 return 11516 } 11517 if !done { 11518 ar.Response = future.Response() 11519 err = azure.NewAsyncOpIncompleteError("compute.RestorePointsDeleteFuture") 11520 return 11521 } 11522 ar.Response = future.Response() 11523 return 11524} 11525 11526// RestorePointSourceMetadata describes the properties of the Virtual Machine for which the restore point 11527// was created. The properties provided are a subset and the snapshot of the overall Virtual Machine 11528// properties captured at the time of the restore point creation. 11529type RestorePointSourceMetadata struct { 11530 // HardwareProfile - Gets the hardware profile. 11531 HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` 11532 // StorageProfile - Gets the storage profile. 11533 StorageProfile *RestorePointSourceVMStorageProfile `json:"storageProfile,omitempty"` 11534 // OsProfile - Gets the OS profile. 11535 OsProfile *OSProfile `json:"osProfile,omitempty"` 11536 // DiagnosticsProfile - Gets the diagnostics profile. 11537 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 11538 // LicenseType - Gets the license type, which is for bring your own license scenario. 11539 LicenseType *string `json:"licenseType,omitempty"` 11540 // VMID - Gets the virtual machine unique id. 11541 VMID *string `json:"vmId,omitempty"` 11542 // SecurityProfile - Gets the security profile. 11543 SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` 11544} 11545 11546// RestorePointSourceVMDataDisk describes a data disk. 11547type RestorePointSourceVMDataDisk struct { 11548 // Lun - Gets the logical unit number. 11549 Lun *int32 `json:"lun,omitempty"` 11550 // Name - Gets the disk name. 11551 Name *string `json:"name,omitempty"` 11552 // Caching - Gets the caching type. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' 11553 Caching CachingTypes `json:"caching,omitempty"` 11554 // DiskSizeGB - Gets the initial disk size in GB for blank data disks, and the new desired size for existing OS and Data disks. 11555 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 11556 // ManagedDisk - Gets the managed disk details 11557 ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` 11558 // DiskRestorePoint - Gets the disk restore point Id. 11559 DiskRestorePoint *APIEntityReference `json:"diskRestorePoint,omitempty"` 11560} 11561 11562// RestorePointSourceVMOSDisk describes an Operating System disk. 11563type RestorePointSourceVMOSDisk struct { 11564 // OsType - Gets the Operating System type. Possible values include: 'OperatingSystemTypeWindows', 'OperatingSystemTypeLinux' 11565 OsType OperatingSystemType `json:"osType,omitempty"` 11566 // EncryptionSettings - Gets the disk encryption settings. 11567 EncryptionSettings *DiskEncryptionSettings `json:"encryptionSettings,omitempty"` 11568 // Name - Gets the disk name. 11569 Name *string `json:"name,omitempty"` 11570 // Caching - Gets the caching type. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' 11571 Caching CachingTypes `json:"caching,omitempty"` 11572 // DiskSizeGB - Gets the disk size in GB. 11573 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 11574 // ManagedDisk - Gets the managed disk details 11575 ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` 11576 // DiskRestorePoint - Gets the disk restore point Id. 11577 DiskRestorePoint *APIEntityReference `json:"diskRestorePoint,omitempty"` 11578} 11579 11580// RestorePointSourceVMStorageProfile describes the storage profile. 11581type RestorePointSourceVMStorageProfile struct { 11582 // OsDisk - Gets the OS disk of the VM captured at the time of the restore point creation. 11583 OsDisk *RestorePointSourceVMOSDisk `json:"osDisk,omitempty"` 11584 // DataDisks - Gets the data disks of the VM captured at the time of the restore point creation. 11585 DataDisks *[]RestorePointSourceVMDataDisk `json:"dataDisks,omitempty"` 11586} 11587 11588// RetrieveBootDiagnosticsDataResult the SAS URIs of the console screenshot and serial log blobs. 11589type RetrieveBootDiagnosticsDataResult struct { 11590 autorest.Response `json:"-"` 11591 // ConsoleScreenshotBlobURI - READ-ONLY; The console screenshot blob URI 11592 ConsoleScreenshotBlobURI *string `json:"consoleScreenshotBlobUri,omitempty"` 11593 // SerialConsoleLogBlobURI - READ-ONLY; The serial console log blob URI. 11594 SerialConsoleLogBlobURI *string `json:"serialConsoleLogBlobUri,omitempty"` 11595} 11596 11597// MarshalJSON is the custom marshaler for RetrieveBootDiagnosticsDataResult. 11598func (rbddr RetrieveBootDiagnosticsDataResult) MarshalJSON() ([]byte, error) { 11599 objectMap := make(map[string]interface{}) 11600 return json.Marshal(objectMap) 11601} 11602 11603// RoleInstance ... 11604type RoleInstance struct { 11605 autorest.Response `json:"-"` 11606 // ID - READ-ONLY; Resource Id 11607 ID *string `json:"id,omitempty"` 11608 // Name - READ-ONLY; Resource Name. 11609 Name *string `json:"name,omitempty"` 11610 // Type - READ-ONLY; Resource Type. 11611 Type *string `json:"type,omitempty"` 11612 // Location - READ-ONLY; Resource Location. 11613 Location *string `json:"location,omitempty"` 11614 // Tags - READ-ONLY; Resource tags. 11615 Tags map[string]*string `json:"tags"` 11616 Sku *InstanceSku `json:"sku,omitempty"` 11617 Properties *RoleInstanceProperties `json:"properties,omitempty"` 11618} 11619 11620// MarshalJSON is the custom marshaler for RoleInstance. 11621func (ri RoleInstance) MarshalJSON() ([]byte, error) { 11622 objectMap := make(map[string]interface{}) 11623 if ri.Sku != nil { 11624 objectMap["sku"] = ri.Sku 11625 } 11626 if ri.Properties != nil { 11627 objectMap["properties"] = ri.Properties 11628 } 11629 return json.Marshal(objectMap) 11630} 11631 11632// RoleInstanceInstanceView the instance view of the role instance. 11633type RoleInstanceInstanceView struct { 11634 autorest.Response `json:"-"` 11635 // PlatformUpdateDomain - READ-ONLY; The Update Domain. 11636 PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` 11637 // PlatformFaultDomain - READ-ONLY; The Fault Domain. 11638 PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` 11639 // PrivateID - READ-ONLY; Specifies a unique identifier generated internally for the cloud service associated with this role instance. <br /><br /> NOTE: If you are using Azure Diagnostics extension, this property can be used as 'DeploymentId' for querying details. 11640 PrivateID *string `json:"privateId,omitempty"` 11641 // Statuses - READ-ONLY 11642 Statuses *[]ResourceInstanceViewStatus `json:"statuses,omitempty"` 11643} 11644 11645// MarshalJSON is the custom marshaler for RoleInstanceInstanceView. 11646func (riiv RoleInstanceInstanceView) MarshalJSON() ([]byte, error) { 11647 objectMap := make(map[string]interface{}) 11648 return json.Marshal(objectMap) 11649} 11650 11651// RoleInstanceListResult ... 11652type RoleInstanceListResult struct { 11653 autorest.Response `json:"-"` 11654 Value *[]RoleInstance `json:"value,omitempty"` 11655 NextLink *string `json:"nextLink,omitempty"` 11656} 11657 11658// RoleInstanceListResultIterator provides access to a complete listing of RoleInstance values. 11659type RoleInstanceListResultIterator struct { 11660 i int 11661 page RoleInstanceListResultPage 11662} 11663 11664// NextWithContext advances to the next value. If there was an error making 11665// the request the iterator does not advance and the error is returned. 11666func (iter *RoleInstanceListResultIterator) NextWithContext(ctx context.Context) (err error) { 11667 if tracing.IsEnabled() { 11668 ctx = tracing.StartSpan(ctx, fqdn+"/RoleInstanceListResultIterator.NextWithContext") 11669 defer func() { 11670 sc := -1 11671 if iter.Response().Response.Response != nil { 11672 sc = iter.Response().Response.Response.StatusCode 11673 } 11674 tracing.EndSpan(ctx, sc, err) 11675 }() 11676 } 11677 iter.i++ 11678 if iter.i < len(iter.page.Values()) { 11679 return nil 11680 } 11681 err = iter.page.NextWithContext(ctx) 11682 if err != nil { 11683 iter.i-- 11684 return err 11685 } 11686 iter.i = 0 11687 return nil 11688} 11689 11690// Next advances to the next value. If there was an error making 11691// the request the iterator does not advance and the error is returned. 11692// Deprecated: Use NextWithContext() instead. 11693func (iter *RoleInstanceListResultIterator) Next() error { 11694 return iter.NextWithContext(context.Background()) 11695} 11696 11697// NotDone returns true if the enumeration should be started or is not yet complete. 11698func (iter RoleInstanceListResultIterator) NotDone() bool { 11699 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11700} 11701 11702// Response returns the raw server response from the last page request. 11703func (iter RoleInstanceListResultIterator) Response() RoleInstanceListResult { 11704 return iter.page.Response() 11705} 11706 11707// Value returns the current value or a zero-initialized value if the 11708// iterator has advanced beyond the end of the collection. 11709func (iter RoleInstanceListResultIterator) Value() RoleInstance { 11710 if !iter.page.NotDone() { 11711 return RoleInstance{} 11712 } 11713 return iter.page.Values()[iter.i] 11714} 11715 11716// Creates a new instance of the RoleInstanceListResultIterator type. 11717func NewRoleInstanceListResultIterator(page RoleInstanceListResultPage) RoleInstanceListResultIterator { 11718 return RoleInstanceListResultIterator{page: page} 11719} 11720 11721// IsEmpty returns true if the ListResult contains no values. 11722func (rilr RoleInstanceListResult) IsEmpty() bool { 11723 return rilr.Value == nil || len(*rilr.Value) == 0 11724} 11725 11726// hasNextLink returns true if the NextLink is not empty. 11727func (rilr RoleInstanceListResult) hasNextLink() bool { 11728 return rilr.NextLink != nil && len(*rilr.NextLink) != 0 11729} 11730 11731// roleInstanceListResultPreparer prepares a request to retrieve the next set of results. 11732// It returns nil if no more results exist. 11733func (rilr RoleInstanceListResult) roleInstanceListResultPreparer(ctx context.Context) (*http.Request, error) { 11734 if !rilr.hasNextLink() { 11735 return nil, nil 11736 } 11737 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11738 autorest.AsJSON(), 11739 autorest.AsGet(), 11740 autorest.WithBaseURL(to.String(rilr.NextLink))) 11741} 11742 11743// RoleInstanceListResultPage contains a page of RoleInstance values. 11744type RoleInstanceListResultPage struct { 11745 fn func(context.Context, RoleInstanceListResult) (RoleInstanceListResult, error) 11746 rilr RoleInstanceListResult 11747} 11748 11749// NextWithContext advances to the next page of values. If there was an error making 11750// the request the page does not advance and the error is returned. 11751func (page *RoleInstanceListResultPage) NextWithContext(ctx context.Context) (err error) { 11752 if tracing.IsEnabled() { 11753 ctx = tracing.StartSpan(ctx, fqdn+"/RoleInstanceListResultPage.NextWithContext") 11754 defer func() { 11755 sc := -1 11756 if page.Response().Response.Response != nil { 11757 sc = page.Response().Response.Response.StatusCode 11758 } 11759 tracing.EndSpan(ctx, sc, err) 11760 }() 11761 } 11762 for { 11763 next, err := page.fn(ctx, page.rilr) 11764 if err != nil { 11765 return err 11766 } 11767 page.rilr = next 11768 if !next.hasNextLink() || !next.IsEmpty() { 11769 break 11770 } 11771 } 11772 return nil 11773} 11774 11775// Next advances to the next page of values. If there was an error making 11776// the request the page does not advance and the error is returned. 11777// Deprecated: Use NextWithContext() instead. 11778func (page *RoleInstanceListResultPage) Next() error { 11779 return page.NextWithContext(context.Background()) 11780} 11781 11782// NotDone returns true if the page enumeration should be started or is not yet complete. 11783func (page RoleInstanceListResultPage) NotDone() bool { 11784 return !page.rilr.IsEmpty() 11785} 11786 11787// Response returns the raw server response from the last page request. 11788func (page RoleInstanceListResultPage) Response() RoleInstanceListResult { 11789 return page.rilr 11790} 11791 11792// Values returns the slice of values for the current page or nil if there are no values. 11793func (page RoleInstanceListResultPage) Values() []RoleInstance { 11794 if page.rilr.IsEmpty() { 11795 return nil 11796 } 11797 return *page.rilr.Value 11798} 11799 11800// Creates a new instance of the RoleInstanceListResultPage type. 11801func NewRoleInstanceListResultPage(cur RoleInstanceListResult, getNextPage func(context.Context, RoleInstanceListResult) (RoleInstanceListResult, error)) RoleInstanceListResultPage { 11802 return RoleInstanceListResultPage{ 11803 fn: getNextPage, 11804 rilr: cur, 11805 } 11806} 11807 11808// RoleInstanceNetworkProfile describes the network profile for the role instance. 11809type RoleInstanceNetworkProfile struct { 11810 // NetworkInterfaces - READ-ONLY; Specifies the list of resource Ids for the network interfaces associated with the role instance. 11811 NetworkInterfaces *[]SubResource `json:"networkInterfaces,omitempty"` 11812} 11813 11814// MarshalJSON is the custom marshaler for RoleInstanceNetworkProfile. 11815func (rinp RoleInstanceNetworkProfile) MarshalJSON() ([]byte, error) { 11816 objectMap := make(map[string]interface{}) 11817 return json.Marshal(objectMap) 11818} 11819 11820// RoleInstanceProperties ... 11821type RoleInstanceProperties struct { 11822 NetworkProfile *RoleInstanceNetworkProfile `json:"networkProfile,omitempty"` 11823 InstanceView *RoleInstanceInstanceView `json:"instanceView,omitempty"` 11824} 11825 11826// RoleInstances specifies a list of role instances from the cloud service. 11827type RoleInstances struct { 11828 // RoleInstances - List of cloud service role instance names. Value of '*' will signify all role instances of the cloud service. 11829 RoleInstances *[]string `json:"roleInstances,omitempty"` 11830} 11831 11832// RollbackStatusInfo information about rollback on failed VM instances after a OS Upgrade operation. 11833type RollbackStatusInfo struct { 11834 // SuccessfullyRolledbackInstanceCount - READ-ONLY; The number of instances which have been successfully rolled back. 11835 SuccessfullyRolledbackInstanceCount *int32 `json:"successfullyRolledbackInstanceCount,omitempty"` 11836 // FailedRolledbackInstanceCount - READ-ONLY; The number of instances which failed to rollback. 11837 FailedRolledbackInstanceCount *int32 `json:"failedRolledbackInstanceCount,omitempty"` 11838 // RollbackError - READ-ONLY; Error details if OS rollback failed. 11839 RollbackError *APIError `json:"rollbackError,omitempty"` 11840} 11841 11842// MarshalJSON is the custom marshaler for RollbackStatusInfo. 11843func (rsi RollbackStatusInfo) MarshalJSON() ([]byte, error) { 11844 objectMap := make(map[string]interface{}) 11845 return json.Marshal(objectMap) 11846} 11847 11848// RollingUpgradePolicy the configuration parameters used while performing a rolling upgrade. 11849type RollingUpgradePolicy struct { 11850 // 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%. 11851 MaxBatchInstancePercent *int32 `json:"maxBatchInstancePercent,omitempty"` 11852 // 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%. 11853 MaxUnhealthyInstancePercent *int32 `json:"maxUnhealthyInstancePercent,omitempty"` 11854 // 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%. 11855 MaxUnhealthyUpgradedInstancePercent *int32 `json:"maxUnhealthyUpgradedInstancePercent,omitempty"` 11856 // 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). 11857 PauseTimeBetweenBatches *string `json:"pauseTimeBetweenBatches,omitempty"` 11858 // EnableCrossZoneUpgrade - Allow VMSS to ignore AZ boundaries when constructing upgrade batches. Take into consideration the Update Domain and maxBatchInstancePercent to determine the batch size. 11859 EnableCrossZoneUpgrade *bool `json:"enableCrossZoneUpgrade,omitempty"` 11860 // PrioritizeUnhealthyInstances - Upgrade all unhealthy instances in a scale set before any healthy instances. 11861 PrioritizeUnhealthyInstances *bool `json:"prioritizeUnhealthyInstances,omitempty"` 11862} 11863 11864// RollingUpgradeProgressInfo information about the number of virtual machine instances in each upgrade 11865// state. 11866type RollingUpgradeProgressInfo struct { 11867 // SuccessfulInstanceCount - READ-ONLY; The number of instances that have been successfully upgraded. 11868 SuccessfulInstanceCount *int32 `json:"successfulInstanceCount,omitempty"` 11869 // FailedInstanceCount - READ-ONLY; The number of instances that have failed to be upgraded successfully. 11870 FailedInstanceCount *int32 `json:"failedInstanceCount,omitempty"` 11871 // InProgressInstanceCount - READ-ONLY; The number of instances that are currently being upgraded. 11872 InProgressInstanceCount *int32 `json:"inProgressInstanceCount,omitempty"` 11873 // PendingInstanceCount - READ-ONLY; The number of instances that have not yet begun to be upgraded. 11874 PendingInstanceCount *int32 `json:"pendingInstanceCount,omitempty"` 11875} 11876 11877// MarshalJSON is the custom marshaler for RollingUpgradeProgressInfo. 11878func (rupi RollingUpgradeProgressInfo) MarshalJSON() ([]byte, error) { 11879 objectMap := make(map[string]interface{}) 11880 return json.Marshal(objectMap) 11881} 11882 11883// RollingUpgradeRunningStatus information about the current running state of the overall upgrade. 11884type RollingUpgradeRunningStatus struct { 11885 // Code - READ-ONLY; Code indicating the current status of the upgrade. Possible values include: 'RollingUpgradeStatusCodeRollingForward', 'RollingUpgradeStatusCodeCancelled', 'RollingUpgradeStatusCodeCompleted', 'RollingUpgradeStatusCodeFaulted' 11886 Code RollingUpgradeStatusCode `json:"code,omitempty"` 11887 // StartTime - READ-ONLY; Start time of the upgrade. 11888 StartTime *date.Time `json:"startTime,omitempty"` 11889 // LastAction - READ-ONLY; The last action performed on the rolling upgrade. Possible values include: 'RollingUpgradeActionTypeStart', 'RollingUpgradeActionTypeCancel' 11890 LastAction RollingUpgradeActionType `json:"lastAction,omitempty"` 11891 // LastActionTime - READ-ONLY; Last action time of the upgrade. 11892 LastActionTime *date.Time `json:"lastActionTime,omitempty"` 11893} 11894 11895// MarshalJSON is the custom marshaler for RollingUpgradeRunningStatus. 11896func (rurs RollingUpgradeRunningStatus) MarshalJSON() ([]byte, error) { 11897 objectMap := make(map[string]interface{}) 11898 return json.Marshal(objectMap) 11899} 11900 11901// RollingUpgradeStatusInfo the status of the latest virtual machine scale set rolling upgrade. 11902type RollingUpgradeStatusInfo struct { 11903 autorest.Response `json:"-"` 11904 *RollingUpgradeStatusInfoProperties `json:"properties,omitempty"` 11905 // ID - READ-ONLY; Resource Id 11906 ID *string `json:"id,omitempty"` 11907 // Name - READ-ONLY; Resource name 11908 Name *string `json:"name,omitempty"` 11909 // Type - READ-ONLY; Resource type 11910 Type *string `json:"type,omitempty"` 11911 // Location - Resource location 11912 Location *string `json:"location,omitempty"` 11913 // Tags - Resource tags 11914 Tags map[string]*string `json:"tags"` 11915} 11916 11917// MarshalJSON is the custom marshaler for RollingUpgradeStatusInfo. 11918func (rusi RollingUpgradeStatusInfo) MarshalJSON() ([]byte, error) { 11919 objectMap := make(map[string]interface{}) 11920 if rusi.RollingUpgradeStatusInfoProperties != nil { 11921 objectMap["properties"] = rusi.RollingUpgradeStatusInfoProperties 11922 } 11923 if rusi.Location != nil { 11924 objectMap["location"] = rusi.Location 11925 } 11926 if rusi.Tags != nil { 11927 objectMap["tags"] = rusi.Tags 11928 } 11929 return json.Marshal(objectMap) 11930} 11931 11932// UnmarshalJSON is the custom unmarshaler for RollingUpgradeStatusInfo struct. 11933func (rusi *RollingUpgradeStatusInfo) UnmarshalJSON(body []byte) error { 11934 var m map[string]*json.RawMessage 11935 err := json.Unmarshal(body, &m) 11936 if err != nil { 11937 return err 11938 } 11939 for k, v := range m { 11940 switch k { 11941 case "properties": 11942 if v != nil { 11943 var rollingUpgradeStatusInfoProperties RollingUpgradeStatusInfoProperties 11944 err = json.Unmarshal(*v, &rollingUpgradeStatusInfoProperties) 11945 if err != nil { 11946 return err 11947 } 11948 rusi.RollingUpgradeStatusInfoProperties = &rollingUpgradeStatusInfoProperties 11949 } 11950 case "id": 11951 if v != nil { 11952 var ID string 11953 err = json.Unmarshal(*v, &ID) 11954 if err != nil { 11955 return err 11956 } 11957 rusi.ID = &ID 11958 } 11959 case "name": 11960 if v != nil { 11961 var name string 11962 err = json.Unmarshal(*v, &name) 11963 if err != nil { 11964 return err 11965 } 11966 rusi.Name = &name 11967 } 11968 case "type": 11969 if v != nil { 11970 var typeVar string 11971 err = json.Unmarshal(*v, &typeVar) 11972 if err != nil { 11973 return err 11974 } 11975 rusi.Type = &typeVar 11976 } 11977 case "location": 11978 if v != nil { 11979 var location string 11980 err = json.Unmarshal(*v, &location) 11981 if err != nil { 11982 return err 11983 } 11984 rusi.Location = &location 11985 } 11986 case "tags": 11987 if v != nil { 11988 var tags map[string]*string 11989 err = json.Unmarshal(*v, &tags) 11990 if err != nil { 11991 return err 11992 } 11993 rusi.Tags = tags 11994 } 11995 } 11996 } 11997 11998 return nil 11999} 12000 12001// RollingUpgradeStatusInfoProperties the status of the latest virtual machine scale set rolling upgrade. 12002type RollingUpgradeStatusInfoProperties struct { 12003 // Policy - READ-ONLY; The rolling upgrade policies applied for this upgrade. 12004 Policy *RollingUpgradePolicy `json:"policy,omitempty"` 12005 // RunningStatus - READ-ONLY; Information about the current running state of the overall upgrade. 12006 RunningStatus *RollingUpgradeRunningStatus `json:"runningStatus,omitempty"` 12007 // Progress - READ-ONLY; Information about the number of virtual machine instances in each upgrade state. 12008 Progress *RollingUpgradeProgressInfo `json:"progress,omitempty"` 12009 // Error - READ-ONLY; Error details for this upgrade, if there are any. 12010 Error *APIError `json:"error,omitempty"` 12011} 12012 12013// MarshalJSON is the custom marshaler for RollingUpgradeStatusInfoProperties. 12014func (rusip RollingUpgradeStatusInfoProperties) MarshalJSON() ([]byte, error) { 12015 objectMap := make(map[string]interface{}) 12016 return json.Marshal(objectMap) 12017} 12018 12019// RunCommandDocument describes the properties of a Run Command. 12020type RunCommandDocument struct { 12021 autorest.Response `json:"-"` 12022 // Script - The script to be executed. 12023 Script *[]string `json:"script,omitempty"` 12024 // Parameters - The parameters used by the script. 12025 Parameters *[]RunCommandParameterDefinition `json:"parameters,omitempty"` 12026 // Schema - The VM run command schema. 12027 Schema *string `json:"$schema,omitempty"` 12028 // ID - The VM run command id. 12029 ID *string `json:"id,omitempty"` 12030 // OsType - The Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' 12031 OsType OperatingSystemTypes `json:"osType,omitempty"` 12032 // Label - The VM run command label. 12033 Label *string `json:"label,omitempty"` 12034 // Description - The VM run command description. 12035 Description *string `json:"description,omitempty"` 12036} 12037 12038// RunCommandDocumentBase describes the properties of a Run Command metadata. 12039type RunCommandDocumentBase struct { 12040 // Schema - The VM run command schema. 12041 Schema *string `json:"$schema,omitempty"` 12042 // ID - The VM run command id. 12043 ID *string `json:"id,omitempty"` 12044 // OsType - The Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' 12045 OsType OperatingSystemTypes `json:"osType,omitempty"` 12046 // Label - The VM run command label. 12047 Label *string `json:"label,omitempty"` 12048 // Description - The VM run command description. 12049 Description *string `json:"description,omitempty"` 12050} 12051 12052// RunCommandInput capture Virtual Machine parameters. 12053type RunCommandInput struct { 12054 // CommandID - The run command id. 12055 CommandID *string `json:"commandId,omitempty"` 12056 // Script - Optional. The script to be executed. When this value is given, the given script will override the default script of the command. 12057 Script *[]string `json:"script,omitempty"` 12058 // Parameters - The run command parameters. 12059 Parameters *[]RunCommandInputParameter `json:"parameters,omitempty"` 12060} 12061 12062// RunCommandInputParameter describes the properties of a run command parameter. 12063type RunCommandInputParameter struct { 12064 // Name - The run command parameter name. 12065 Name *string `json:"name,omitempty"` 12066 // Value - The run command parameter value. 12067 Value *string `json:"value,omitempty"` 12068} 12069 12070// RunCommandListResult the List Virtual Machine operation response. 12071type RunCommandListResult struct { 12072 autorest.Response `json:"-"` 12073 // Value - The list of virtual machine run commands. 12074 Value *[]RunCommandDocumentBase `json:"value,omitempty"` 12075 // NextLink - The uri to fetch the next page of run commands. Call ListNext() with this to fetch the next page of run commands. 12076 NextLink *string `json:"nextLink,omitempty"` 12077} 12078 12079// RunCommandListResultIterator provides access to a complete listing of RunCommandDocumentBase values. 12080type RunCommandListResultIterator struct { 12081 i int 12082 page RunCommandListResultPage 12083} 12084 12085// NextWithContext advances to the next value. If there was an error making 12086// the request the iterator does not advance and the error is returned. 12087func (iter *RunCommandListResultIterator) NextWithContext(ctx context.Context) (err error) { 12088 if tracing.IsEnabled() { 12089 ctx = tracing.StartSpan(ctx, fqdn+"/RunCommandListResultIterator.NextWithContext") 12090 defer func() { 12091 sc := -1 12092 if iter.Response().Response.Response != nil { 12093 sc = iter.Response().Response.Response.StatusCode 12094 } 12095 tracing.EndSpan(ctx, sc, err) 12096 }() 12097 } 12098 iter.i++ 12099 if iter.i < len(iter.page.Values()) { 12100 return nil 12101 } 12102 err = iter.page.NextWithContext(ctx) 12103 if err != nil { 12104 iter.i-- 12105 return err 12106 } 12107 iter.i = 0 12108 return nil 12109} 12110 12111// Next advances to the next value. If there was an error making 12112// the request the iterator does not advance and the error is returned. 12113// Deprecated: Use NextWithContext() instead. 12114func (iter *RunCommandListResultIterator) Next() error { 12115 return iter.NextWithContext(context.Background()) 12116} 12117 12118// NotDone returns true if the enumeration should be started or is not yet complete. 12119func (iter RunCommandListResultIterator) NotDone() bool { 12120 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 12121} 12122 12123// Response returns the raw server response from the last page request. 12124func (iter RunCommandListResultIterator) Response() RunCommandListResult { 12125 return iter.page.Response() 12126} 12127 12128// Value returns the current value or a zero-initialized value if the 12129// iterator has advanced beyond the end of the collection. 12130func (iter RunCommandListResultIterator) Value() RunCommandDocumentBase { 12131 if !iter.page.NotDone() { 12132 return RunCommandDocumentBase{} 12133 } 12134 return iter.page.Values()[iter.i] 12135} 12136 12137// Creates a new instance of the RunCommandListResultIterator type. 12138func NewRunCommandListResultIterator(page RunCommandListResultPage) RunCommandListResultIterator { 12139 return RunCommandListResultIterator{page: page} 12140} 12141 12142// IsEmpty returns true if the ListResult contains no values. 12143func (rclr RunCommandListResult) IsEmpty() bool { 12144 return rclr.Value == nil || len(*rclr.Value) == 0 12145} 12146 12147// hasNextLink returns true if the NextLink is not empty. 12148func (rclr RunCommandListResult) hasNextLink() bool { 12149 return rclr.NextLink != nil && len(*rclr.NextLink) != 0 12150} 12151 12152// runCommandListResultPreparer prepares a request to retrieve the next set of results. 12153// It returns nil if no more results exist. 12154func (rclr RunCommandListResult) runCommandListResultPreparer(ctx context.Context) (*http.Request, error) { 12155 if !rclr.hasNextLink() { 12156 return nil, nil 12157 } 12158 return autorest.Prepare((&http.Request{}).WithContext(ctx), 12159 autorest.AsJSON(), 12160 autorest.AsGet(), 12161 autorest.WithBaseURL(to.String(rclr.NextLink))) 12162} 12163 12164// RunCommandListResultPage contains a page of RunCommandDocumentBase values. 12165type RunCommandListResultPage struct { 12166 fn func(context.Context, RunCommandListResult) (RunCommandListResult, error) 12167 rclr RunCommandListResult 12168} 12169 12170// NextWithContext advances to the next page of values. If there was an error making 12171// the request the page does not advance and the error is returned. 12172func (page *RunCommandListResultPage) NextWithContext(ctx context.Context) (err error) { 12173 if tracing.IsEnabled() { 12174 ctx = tracing.StartSpan(ctx, fqdn+"/RunCommandListResultPage.NextWithContext") 12175 defer func() { 12176 sc := -1 12177 if page.Response().Response.Response != nil { 12178 sc = page.Response().Response.Response.StatusCode 12179 } 12180 tracing.EndSpan(ctx, sc, err) 12181 }() 12182 } 12183 for { 12184 next, err := page.fn(ctx, page.rclr) 12185 if err != nil { 12186 return err 12187 } 12188 page.rclr = next 12189 if !next.hasNextLink() || !next.IsEmpty() { 12190 break 12191 } 12192 } 12193 return nil 12194} 12195 12196// Next advances to the next page of values. If there was an error making 12197// the request the page does not advance and the error is returned. 12198// Deprecated: Use NextWithContext() instead. 12199func (page *RunCommandListResultPage) Next() error { 12200 return page.NextWithContext(context.Background()) 12201} 12202 12203// NotDone returns true if the page enumeration should be started or is not yet complete. 12204func (page RunCommandListResultPage) NotDone() bool { 12205 return !page.rclr.IsEmpty() 12206} 12207 12208// Response returns the raw server response from the last page request. 12209func (page RunCommandListResultPage) Response() RunCommandListResult { 12210 return page.rclr 12211} 12212 12213// Values returns the slice of values for the current page or nil if there are no values. 12214func (page RunCommandListResultPage) Values() []RunCommandDocumentBase { 12215 if page.rclr.IsEmpty() { 12216 return nil 12217 } 12218 return *page.rclr.Value 12219} 12220 12221// Creates a new instance of the RunCommandListResultPage type. 12222func NewRunCommandListResultPage(cur RunCommandListResult, getNextPage func(context.Context, RunCommandListResult) (RunCommandListResult, error)) RunCommandListResultPage { 12223 return RunCommandListResultPage{ 12224 fn: getNextPage, 12225 rclr: cur, 12226 } 12227} 12228 12229// RunCommandParameterDefinition describes the properties of a run command parameter. 12230type RunCommandParameterDefinition struct { 12231 // Name - The run command parameter name. 12232 Name *string `json:"name,omitempty"` 12233 // Type - The run command parameter type. 12234 Type *string `json:"type,omitempty"` 12235 // DefaultValue - The run command parameter default value. 12236 DefaultValue *string `json:"defaultValue,omitempty"` 12237 // Required - The run command parameter required. 12238 Required *bool `json:"required,omitempty"` 12239} 12240 12241// RunCommandResult ... 12242type RunCommandResult struct { 12243 autorest.Response `json:"-"` 12244 // Value - Run command operation response. 12245 Value *[]InstanceViewStatus `json:"value,omitempty"` 12246} 12247 12248// ScaleInPolicy describes a scale-in policy for a virtual machine scale set. 12249type ScaleInPolicy struct { 12250 // 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> 12251 Rules *[]VirtualMachineScaleSetScaleInRules `json:"rules,omitempty"` 12252} 12253 12254// ScheduledEventsProfile ... 12255type ScheduledEventsProfile struct { 12256 // TerminateNotificationProfile - Specifies Terminate Scheduled Event related configurations. 12257 TerminateNotificationProfile *TerminateNotificationProfile `json:"terminateNotificationProfile,omitempty"` 12258} 12259 12260// SecurityProfile specifies the Security profile settings for the virtual machine or virtual machine scale 12261// set. 12262type SecurityProfile struct { 12263 // UefiSettings - Specifies the security settings like secure boot and vTPM used while creating the virtual machine. <br><br>Minimum api-version: 2020-12-01 12264 UefiSettings *UefiSettings `json:"uefiSettings,omitempty"` 12265 // 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. 12266 EncryptionAtHost *bool `json:"encryptionAtHost,omitempty"` 12267 // SecurityType - Specifies the SecurityType of the virtual machine. It is set as TrustedLaunch to enable UefiSettings. <br><br> Default: UefiSettings will not be enabled unless this property is set as TrustedLaunch. Possible values include: 'SecurityTypesTrustedLaunch' 12268 SecurityType SecurityTypes `json:"securityType,omitempty"` 12269} 12270 12271// SharedGallery specifies information about the Shared Gallery that you want to create or update. 12272type SharedGallery struct { 12273 autorest.Response `json:"-"` 12274 *SharedGalleryIdentifier `json:"identifier,omitempty"` 12275 // Name - READ-ONLY; Resource name 12276 Name *string `json:"name,omitempty"` 12277 // Location - READ-ONLY; Resource location 12278 Location *string `json:"location,omitempty"` 12279} 12280 12281// MarshalJSON is the custom marshaler for SharedGallery. 12282func (sg SharedGallery) MarshalJSON() ([]byte, error) { 12283 objectMap := make(map[string]interface{}) 12284 if sg.SharedGalleryIdentifier != nil { 12285 objectMap["identifier"] = sg.SharedGalleryIdentifier 12286 } 12287 return json.Marshal(objectMap) 12288} 12289 12290// UnmarshalJSON is the custom unmarshaler for SharedGallery struct. 12291func (sg *SharedGallery) UnmarshalJSON(body []byte) error { 12292 var m map[string]*json.RawMessage 12293 err := json.Unmarshal(body, &m) 12294 if err != nil { 12295 return err 12296 } 12297 for k, v := range m { 12298 switch k { 12299 case "identifier": 12300 if v != nil { 12301 var sharedGalleryIdentifier SharedGalleryIdentifier 12302 err = json.Unmarshal(*v, &sharedGalleryIdentifier) 12303 if err != nil { 12304 return err 12305 } 12306 sg.SharedGalleryIdentifier = &sharedGalleryIdentifier 12307 } 12308 case "name": 12309 if v != nil { 12310 var name string 12311 err = json.Unmarshal(*v, &name) 12312 if err != nil { 12313 return err 12314 } 12315 sg.Name = &name 12316 } 12317 case "location": 12318 if v != nil { 12319 var location string 12320 err = json.Unmarshal(*v, &location) 12321 if err != nil { 12322 return err 12323 } 12324 sg.Location = &location 12325 } 12326 } 12327 } 12328 12329 return nil 12330} 12331 12332// SharedGalleryIdentifier the identifier information of shared gallery. 12333type SharedGalleryIdentifier struct { 12334 // UniqueID - The unique id of this shared gallery. 12335 UniqueID *string `json:"uniqueId,omitempty"` 12336} 12337 12338// SharedGalleryImage specifies information about the gallery image definition that you want to create or 12339// update. 12340type SharedGalleryImage struct { 12341 autorest.Response `json:"-"` 12342 *SharedGalleryImageProperties `json:"properties,omitempty"` 12343 *SharedGalleryIdentifier `json:"identifier,omitempty"` 12344 // Name - READ-ONLY; Resource name 12345 Name *string `json:"name,omitempty"` 12346 // Location - READ-ONLY; Resource location 12347 Location *string `json:"location,omitempty"` 12348} 12349 12350// MarshalJSON is the custom marshaler for SharedGalleryImage. 12351func (sgi SharedGalleryImage) MarshalJSON() ([]byte, error) { 12352 objectMap := make(map[string]interface{}) 12353 if sgi.SharedGalleryImageProperties != nil { 12354 objectMap["properties"] = sgi.SharedGalleryImageProperties 12355 } 12356 if sgi.SharedGalleryIdentifier != nil { 12357 objectMap["identifier"] = sgi.SharedGalleryIdentifier 12358 } 12359 return json.Marshal(objectMap) 12360} 12361 12362// UnmarshalJSON is the custom unmarshaler for SharedGalleryImage struct. 12363func (sgi *SharedGalleryImage) UnmarshalJSON(body []byte) error { 12364 var m map[string]*json.RawMessage 12365 err := json.Unmarshal(body, &m) 12366 if err != nil { 12367 return err 12368 } 12369 for k, v := range m { 12370 switch k { 12371 case "properties": 12372 if v != nil { 12373 var sharedGalleryImageProperties SharedGalleryImageProperties 12374 err = json.Unmarshal(*v, &sharedGalleryImageProperties) 12375 if err != nil { 12376 return err 12377 } 12378 sgi.SharedGalleryImageProperties = &sharedGalleryImageProperties 12379 } 12380 case "identifier": 12381 if v != nil { 12382 var sharedGalleryIdentifier SharedGalleryIdentifier 12383 err = json.Unmarshal(*v, &sharedGalleryIdentifier) 12384 if err != nil { 12385 return err 12386 } 12387 sgi.SharedGalleryIdentifier = &sharedGalleryIdentifier 12388 } 12389 case "name": 12390 if v != nil { 12391 var name string 12392 err = json.Unmarshal(*v, &name) 12393 if err != nil { 12394 return err 12395 } 12396 sgi.Name = &name 12397 } 12398 case "location": 12399 if v != nil { 12400 var location string 12401 err = json.Unmarshal(*v, &location) 12402 if err != nil { 12403 return err 12404 } 12405 sgi.Location = &location 12406 } 12407 } 12408 } 12409 12410 return nil 12411} 12412 12413// SharedGalleryImageList the List Shared Gallery Images operation response. 12414type SharedGalleryImageList struct { 12415 autorest.Response `json:"-"` 12416 // Value - A list of shared gallery images. 12417 Value *[]SharedGalleryImage `json:"value,omitempty"` 12418 // NextLink - The uri to fetch the next page of shared gallery images. Call ListNext() with this to fetch the next page of shared gallery images. 12419 NextLink *string `json:"nextLink,omitempty"` 12420} 12421 12422// SharedGalleryImageListIterator provides access to a complete listing of SharedGalleryImage values. 12423type SharedGalleryImageListIterator struct { 12424 i int 12425 page SharedGalleryImageListPage 12426} 12427 12428// NextWithContext advances to the next value. If there was an error making 12429// the request the iterator does not advance and the error is returned. 12430func (iter *SharedGalleryImageListIterator) NextWithContext(ctx context.Context) (err error) { 12431 if tracing.IsEnabled() { 12432 ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImageListIterator.NextWithContext") 12433 defer func() { 12434 sc := -1 12435 if iter.Response().Response.Response != nil { 12436 sc = iter.Response().Response.Response.StatusCode 12437 } 12438 tracing.EndSpan(ctx, sc, err) 12439 }() 12440 } 12441 iter.i++ 12442 if iter.i < len(iter.page.Values()) { 12443 return nil 12444 } 12445 err = iter.page.NextWithContext(ctx) 12446 if err != nil { 12447 iter.i-- 12448 return err 12449 } 12450 iter.i = 0 12451 return nil 12452} 12453 12454// Next advances to the next value. If there was an error making 12455// the request the iterator does not advance and the error is returned. 12456// Deprecated: Use NextWithContext() instead. 12457func (iter *SharedGalleryImageListIterator) Next() error { 12458 return iter.NextWithContext(context.Background()) 12459} 12460 12461// NotDone returns true if the enumeration should be started or is not yet complete. 12462func (iter SharedGalleryImageListIterator) NotDone() bool { 12463 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 12464} 12465 12466// Response returns the raw server response from the last page request. 12467func (iter SharedGalleryImageListIterator) Response() SharedGalleryImageList { 12468 return iter.page.Response() 12469} 12470 12471// Value returns the current value or a zero-initialized value if the 12472// iterator has advanced beyond the end of the collection. 12473func (iter SharedGalleryImageListIterator) Value() SharedGalleryImage { 12474 if !iter.page.NotDone() { 12475 return SharedGalleryImage{} 12476 } 12477 return iter.page.Values()[iter.i] 12478} 12479 12480// Creates a new instance of the SharedGalleryImageListIterator type. 12481func NewSharedGalleryImageListIterator(page SharedGalleryImageListPage) SharedGalleryImageListIterator { 12482 return SharedGalleryImageListIterator{page: page} 12483} 12484 12485// IsEmpty returns true if the ListResult contains no values. 12486func (sgil SharedGalleryImageList) IsEmpty() bool { 12487 return sgil.Value == nil || len(*sgil.Value) == 0 12488} 12489 12490// hasNextLink returns true if the NextLink is not empty. 12491func (sgil SharedGalleryImageList) hasNextLink() bool { 12492 return sgil.NextLink != nil && len(*sgil.NextLink) != 0 12493} 12494 12495// sharedGalleryImageListPreparer prepares a request to retrieve the next set of results. 12496// It returns nil if no more results exist. 12497func (sgil SharedGalleryImageList) sharedGalleryImageListPreparer(ctx context.Context) (*http.Request, error) { 12498 if !sgil.hasNextLink() { 12499 return nil, nil 12500 } 12501 return autorest.Prepare((&http.Request{}).WithContext(ctx), 12502 autorest.AsJSON(), 12503 autorest.AsGet(), 12504 autorest.WithBaseURL(to.String(sgil.NextLink))) 12505} 12506 12507// SharedGalleryImageListPage contains a page of SharedGalleryImage values. 12508type SharedGalleryImageListPage struct { 12509 fn func(context.Context, SharedGalleryImageList) (SharedGalleryImageList, error) 12510 sgil SharedGalleryImageList 12511} 12512 12513// NextWithContext advances to the next page of values. If there was an error making 12514// the request the page does not advance and the error is returned. 12515func (page *SharedGalleryImageListPage) NextWithContext(ctx context.Context) (err error) { 12516 if tracing.IsEnabled() { 12517 ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImageListPage.NextWithContext") 12518 defer func() { 12519 sc := -1 12520 if page.Response().Response.Response != nil { 12521 sc = page.Response().Response.Response.StatusCode 12522 } 12523 tracing.EndSpan(ctx, sc, err) 12524 }() 12525 } 12526 for { 12527 next, err := page.fn(ctx, page.sgil) 12528 if err != nil { 12529 return err 12530 } 12531 page.sgil = next 12532 if !next.hasNextLink() || !next.IsEmpty() { 12533 break 12534 } 12535 } 12536 return nil 12537} 12538 12539// Next advances to the next page of values. If there was an error making 12540// the request the page does not advance and the error is returned. 12541// Deprecated: Use NextWithContext() instead. 12542func (page *SharedGalleryImageListPage) Next() error { 12543 return page.NextWithContext(context.Background()) 12544} 12545 12546// NotDone returns true if the page enumeration should be started or is not yet complete. 12547func (page SharedGalleryImageListPage) NotDone() bool { 12548 return !page.sgil.IsEmpty() 12549} 12550 12551// Response returns the raw server response from the last page request. 12552func (page SharedGalleryImageListPage) Response() SharedGalleryImageList { 12553 return page.sgil 12554} 12555 12556// Values returns the slice of values for the current page or nil if there are no values. 12557func (page SharedGalleryImageListPage) Values() []SharedGalleryImage { 12558 if page.sgil.IsEmpty() { 12559 return nil 12560 } 12561 return *page.sgil.Value 12562} 12563 12564// Creates a new instance of the SharedGalleryImageListPage type. 12565func NewSharedGalleryImageListPage(cur SharedGalleryImageList, getNextPage func(context.Context, SharedGalleryImageList) (SharedGalleryImageList, error)) SharedGalleryImageListPage { 12566 return SharedGalleryImageListPage{ 12567 fn: getNextPage, 12568 sgil: cur, 12569 } 12570} 12571 12572// SharedGalleryImageProperties describes the properties of a gallery image definition. 12573type SharedGalleryImageProperties struct { 12574 // OsType - This property allows you to specify the type of the OS that is included in the disk when creating a VM from a managed image. <br><br> Possible values are: <br><br> **Windows** <br><br> **Linux**. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' 12575 OsType OperatingSystemTypes `json:"osType,omitempty"` 12576 // OsState - This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'. Possible values include: 'OperatingSystemStateTypesGeneralized', 'OperatingSystemStateTypesSpecialized' 12577 OsState OperatingSystemStateTypes `json:"osState,omitempty"` 12578 // EndOfLifeDate - The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property is updatable. 12579 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 12580 Identifier *GalleryImageIdentifier `json:"identifier,omitempty"` 12581 Recommended *RecommendedMachineConfiguration `json:"recommended,omitempty"` 12582 Disallowed *Disallowed `json:"disallowed,omitempty"` 12583 // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'HyperVGenerationV1', 'HyperVGenerationV2' 12584 HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` 12585 // Features - A list of gallery image features. 12586 Features *[]GalleryImageFeature `json:"features,omitempty"` 12587 PurchasePlan *ImagePurchasePlan `json:"purchasePlan,omitempty"` 12588} 12589 12590// SharedGalleryImageVersion specifies information about the gallery image version that you want to create 12591// or update. 12592type SharedGalleryImageVersion struct { 12593 autorest.Response `json:"-"` 12594 *SharedGalleryImageVersionProperties `json:"properties,omitempty"` 12595 *SharedGalleryIdentifier `json:"identifier,omitempty"` 12596 // Name - READ-ONLY; Resource name 12597 Name *string `json:"name,omitempty"` 12598 // Location - READ-ONLY; Resource location 12599 Location *string `json:"location,omitempty"` 12600} 12601 12602// MarshalJSON is the custom marshaler for SharedGalleryImageVersion. 12603func (sgiv SharedGalleryImageVersion) MarshalJSON() ([]byte, error) { 12604 objectMap := make(map[string]interface{}) 12605 if sgiv.SharedGalleryImageVersionProperties != nil { 12606 objectMap["properties"] = sgiv.SharedGalleryImageVersionProperties 12607 } 12608 if sgiv.SharedGalleryIdentifier != nil { 12609 objectMap["identifier"] = sgiv.SharedGalleryIdentifier 12610 } 12611 return json.Marshal(objectMap) 12612} 12613 12614// UnmarshalJSON is the custom unmarshaler for SharedGalleryImageVersion struct. 12615func (sgiv *SharedGalleryImageVersion) UnmarshalJSON(body []byte) error { 12616 var m map[string]*json.RawMessage 12617 err := json.Unmarshal(body, &m) 12618 if err != nil { 12619 return err 12620 } 12621 for k, v := range m { 12622 switch k { 12623 case "properties": 12624 if v != nil { 12625 var sharedGalleryImageVersionProperties SharedGalleryImageVersionProperties 12626 err = json.Unmarshal(*v, &sharedGalleryImageVersionProperties) 12627 if err != nil { 12628 return err 12629 } 12630 sgiv.SharedGalleryImageVersionProperties = &sharedGalleryImageVersionProperties 12631 } 12632 case "identifier": 12633 if v != nil { 12634 var sharedGalleryIdentifier SharedGalleryIdentifier 12635 err = json.Unmarshal(*v, &sharedGalleryIdentifier) 12636 if err != nil { 12637 return err 12638 } 12639 sgiv.SharedGalleryIdentifier = &sharedGalleryIdentifier 12640 } 12641 case "name": 12642 if v != nil { 12643 var name string 12644 err = json.Unmarshal(*v, &name) 12645 if err != nil { 12646 return err 12647 } 12648 sgiv.Name = &name 12649 } 12650 case "location": 12651 if v != nil { 12652 var location string 12653 err = json.Unmarshal(*v, &location) 12654 if err != nil { 12655 return err 12656 } 12657 sgiv.Location = &location 12658 } 12659 } 12660 } 12661 12662 return nil 12663} 12664 12665// SharedGalleryImageVersionList the List Shared Gallery Image versions operation response. 12666type SharedGalleryImageVersionList struct { 12667 autorest.Response `json:"-"` 12668 // Value - A list of shared gallery images versions. 12669 Value *[]SharedGalleryImageVersion `json:"value,omitempty"` 12670 // NextLink - The uri to fetch the next page of shared gallery image versions. Call ListNext() with this to fetch the next page of shared gallery image versions. 12671 NextLink *string `json:"nextLink,omitempty"` 12672} 12673 12674// SharedGalleryImageVersionListIterator provides access to a complete listing of SharedGalleryImageVersion 12675// values. 12676type SharedGalleryImageVersionListIterator struct { 12677 i int 12678 page SharedGalleryImageVersionListPage 12679} 12680 12681// NextWithContext advances to the next value. If there was an error making 12682// the request the iterator does not advance and the error is returned. 12683func (iter *SharedGalleryImageVersionListIterator) NextWithContext(ctx context.Context) (err error) { 12684 if tracing.IsEnabled() { 12685 ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImageVersionListIterator.NextWithContext") 12686 defer func() { 12687 sc := -1 12688 if iter.Response().Response.Response != nil { 12689 sc = iter.Response().Response.Response.StatusCode 12690 } 12691 tracing.EndSpan(ctx, sc, err) 12692 }() 12693 } 12694 iter.i++ 12695 if iter.i < len(iter.page.Values()) { 12696 return nil 12697 } 12698 err = iter.page.NextWithContext(ctx) 12699 if err != nil { 12700 iter.i-- 12701 return err 12702 } 12703 iter.i = 0 12704 return nil 12705} 12706 12707// Next advances to the next value. If there was an error making 12708// the request the iterator does not advance and the error is returned. 12709// Deprecated: Use NextWithContext() instead. 12710func (iter *SharedGalleryImageVersionListIterator) Next() error { 12711 return iter.NextWithContext(context.Background()) 12712} 12713 12714// NotDone returns true if the enumeration should be started or is not yet complete. 12715func (iter SharedGalleryImageVersionListIterator) NotDone() bool { 12716 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 12717} 12718 12719// Response returns the raw server response from the last page request. 12720func (iter SharedGalleryImageVersionListIterator) Response() SharedGalleryImageVersionList { 12721 return iter.page.Response() 12722} 12723 12724// Value returns the current value or a zero-initialized value if the 12725// iterator has advanced beyond the end of the collection. 12726func (iter SharedGalleryImageVersionListIterator) Value() SharedGalleryImageVersion { 12727 if !iter.page.NotDone() { 12728 return SharedGalleryImageVersion{} 12729 } 12730 return iter.page.Values()[iter.i] 12731} 12732 12733// Creates a new instance of the SharedGalleryImageVersionListIterator type. 12734func NewSharedGalleryImageVersionListIterator(page SharedGalleryImageVersionListPage) SharedGalleryImageVersionListIterator { 12735 return SharedGalleryImageVersionListIterator{page: page} 12736} 12737 12738// IsEmpty returns true if the ListResult contains no values. 12739func (sgivl SharedGalleryImageVersionList) IsEmpty() bool { 12740 return sgivl.Value == nil || len(*sgivl.Value) == 0 12741} 12742 12743// hasNextLink returns true if the NextLink is not empty. 12744func (sgivl SharedGalleryImageVersionList) hasNextLink() bool { 12745 return sgivl.NextLink != nil && len(*sgivl.NextLink) != 0 12746} 12747 12748// sharedGalleryImageVersionListPreparer prepares a request to retrieve the next set of results. 12749// It returns nil if no more results exist. 12750func (sgivl SharedGalleryImageVersionList) sharedGalleryImageVersionListPreparer(ctx context.Context) (*http.Request, error) { 12751 if !sgivl.hasNextLink() { 12752 return nil, nil 12753 } 12754 return autorest.Prepare((&http.Request{}).WithContext(ctx), 12755 autorest.AsJSON(), 12756 autorest.AsGet(), 12757 autorest.WithBaseURL(to.String(sgivl.NextLink))) 12758} 12759 12760// SharedGalleryImageVersionListPage contains a page of SharedGalleryImageVersion values. 12761type SharedGalleryImageVersionListPage struct { 12762 fn func(context.Context, SharedGalleryImageVersionList) (SharedGalleryImageVersionList, error) 12763 sgivl SharedGalleryImageVersionList 12764} 12765 12766// NextWithContext advances to the next page of values. If there was an error making 12767// the request the page does not advance and the error is returned. 12768func (page *SharedGalleryImageVersionListPage) NextWithContext(ctx context.Context) (err error) { 12769 if tracing.IsEnabled() { 12770 ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImageVersionListPage.NextWithContext") 12771 defer func() { 12772 sc := -1 12773 if page.Response().Response.Response != nil { 12774 sc = page.Response().Response.Response.StatusCode 12775 } 12776 tracing.EndSpan(ctx, sc, err) 12777 }() 12778 } 12779 for { 12780 next, err := page.fn(ctx, page.sgivl) 12781 if err != nil { 12782 return err 12783 } 12784 page.sgivl = next 12785 if !next.hasNextLink() || !next.IsEmpty() { 12786 break 12787 } 12788 } 12789 return nil 12790} 12791 12792// Next advances to the next page of values. If there was an error making 12793// the request the page does not advance and the error is returned. 12794// Deprecated: Use NextWithContext() instead. 12795func (page *SharedGalleryImageVersionListPage) Next() error { 12796 return page.NextWithContext(context.Background()) 12797} 12798 12799// NotDone returns true if the page enumeration should be started or is not yet complete. 12800func (page SharedGalleryImageVersionListPage) NotDone() bool { 12801 return !page.sgivl.IsEmpty() 12802} 12803 12804// Response returns the raw server response from the last page request. 12805func (page SharedGalleryImageVersionListPage) Response() SharedGalleryImageVersionList { 12806 return page.sgivl 12807} 12808 12809// Values returns the slice of values for the current page or nil if there are no values. 12810func (page SharedGalleryImageVersionListPage) Values() []SharedGalleryImageVersion { 12811 if page.sgivl.IsEmpty() { 12812 return nil 12813 } 12814 return *page.sgivl.Value 12815} 12816 12817// Creates a new instance of the SharedGalleryImageVersionListPage type. 12818func NewSharedGalleryImageVersionListPage(cur SharedGalleryImageVersionList, getNextPage func(context.Context, SharedGalleryImageVersionList) (SharedGalleryImageVersionList, error)) SharedGalleryImageVersionListPage { 12819 return SharedGalleryImageVersionListPage{ 12820 fn: getNextPage, 12821 sgivl: cur, 12822 } 12823} 12824 12825// SharedGalleryImageVersionProperties describes the properties of a gallery image version. 12826type SharedGalleryImageVersionProperties struct { 12827 // PublishedDate - The published date of the gallery image version Definition. This property can be used for decommissioning purposes. This property is updatable. 12828 PublishedDate *date.Time `json:"publishedDate,omitempty"` 12829 // EndOfLifeDate - The end of life date of the gallery image version Definition. This property can be used for decommissioning purposes. This property is updatable. 12830 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 12831} 12832 12833// SharedGalleryList the List Shared Galleries operation response. 12834type SharedGalleryList struct { 12835 autorest.Response `json:"-"` 12836 // Value - A list of shared galleries. 12837 Value *[]SharedGallery `json:"value,omitempty"` 12838 // NextLink - The uri to fetch the next page of shared galleries. Call ListNext() with this to fetch the next page of shared galleries. 12839 NextLink *string `json:"nextLink,omitempty"` 12840} 12841 12842// SharedGalleryListIterator provides access to a complete listing of SharedGallery values. 12843type SharedGalleryListIterator struct { 12844 i int 12845 page SharedGalleryListPage 12846} 12847 12848// NextWithContext advances to the next value. If there was an error making 12849// the request the iterator does not advance and the error is returned. 12850func (iter *SharedGalleryListIterator) NextWithContext(ctx context.Context) (err error) { 12851 if tracing.IsEnabled() { 12852 ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryListIterator.NextWithContext") 12853 defer func() { 12854 sc := -1 12855 if iter.Response().Response.Response != nil { 12856 sc = iter.Response().Response.Response.StatusCode 12857 } 12858 tracing.EndSpan(ctx, sc, err) 12859 }() 12860 } 12861 iter.i++ 12862 if iter.i < len(iter.page.Values()) { 12863 return nil 12864 } 12865 err = iter.page.NextWithContext(ctx) 12866 if err != nil { 12867 iter.i-- 12868 return err 12869 } 12870 iter.i = 0 12871 return nil 12872} 12873 12874// Next advances to the next value. If there was an error making 12875// the request the iterator does not advance and the error is returned. 12876// Deprecated: Use NextWithContext() instead. 12877func (iter *SharedGalleryListIterator) Next() error { 12878 return iter.NextWithContext(context.Background()) 12879} 12880 12881// NotDone returns true if the enumeration should be started or is not yet complete. 12882func (iter SharedGalleryListIterator) NotDone() bool { 12883 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 12884} 12885 12886// Response returns the raw server response from the last page request. 12887func (iter SharedGalleryListIterator) Response() SharedGalleryList { 12888 return iter.page.Response() 12889} 12890 12891// Value returns the current value or a zero-initialized value if the 12892// iterator has advanced beyond the end of the collection. 12893func (iter SharedGalleryListIterator) Value() SharedGallery { 12894 if !iter.page.NotDone() { 12895 return SharedGallery{} 12896 } 12897 return iter.page.Values()[iter.i] 12898} 12899 12900// Creates a new instance of the SharedGalleryListIterator type. 12901func NewSharedGalleryListIterator(page SharedGalleryListPage) SharedGalleryListIterator { 12902 return SharedGalleryListIterator{page: page} 12903} 12904 12905// IsEmpty returns true if the ListResult contains no values. 12906func (sgl SharedGalleryList) IsEmpty() bool { 12907 return sgl.Value == nil || len(*sgl.Value) == 0 12908} 12909 12910// hasNextLink returns true if the NextLink is not empty. 12911func (sgl SharedGalleryList) hasNextLink() bool { 12912 return sgl.NextLink != nil && len(*sgl.NextLink) != 0 12913} 12914 12915// sharedGalleryListPreparer prepares a request to retrieve the next set of results. 12916// It returns nil if no more results exist. 12917func (sgl SharedGalleryList) sharedGalleryListPreparer(ctx context.Context) (*http.Request, error) { 12918 if !sgl.hasNextLink() { 12919 return nil, nil 12920 } 12921 return autorest.Prepare((&http.Request{}).WithContext(ctx), 12922 autorest.AsJSON(), 12923 autorest.AsGet(), 12924 autorest.WithBaseURL(to.String(sgl.NextLink))) 12925} 12926 12927// SharedGalleryListPage contains a page of SharedGallery values. 12928type SharedGalleryListPage struct { 12929 fn func(context.Context, SharedGalleryList) (SharedGalleryList, error) 12930 sgl SharedGalleryList 12931} 12932 12933// NextWithContext advances to the next page of values. If there was an error making 12934// the request the page does not advance and the error is returned. 12935func (page *SharedGalleryListPage) NextWithContext(ctx context.Context) (err error) { 12936 if tracing.IsEnabled() { 12937 ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryListPage.NextWithContext") 12938 defer func() { 12939 sc := -1 12940 if page.Response().Response.Response != nil { 12941 sc = page.Response().Response.Response.StatusCode 12942 } 12943 tracing.EndSpan(ctx, sc, err) 12944 }() 12945 } 12946 for { 12947 next, err := page.fn(ctx, page.sgl) 12948 if err != nil { 12949 return err 12950 } 12951 page.sgl = next 12952 if !next.hasNextLink() || !next.IsEmpty() { 12953 break 12954 } 12955 } 12956 return nil 12957} 12958 12959// Next advances to the next page of values. If there was an error making 12960// the request the page does not advance and the error is returned. 12961// Deprecated: Use NextWithContext() instead. 12962func (page *SharedGalleryListPage) Next() error { 12963 return page.NextWithContext(context.Background()) 12964} 12965 12966// NotDone returns true if the page enumeration should be started or is not yet complete. 12967func (page SharedGalleryListPage) NotDone() bool { 12968 return !page.sgl.IsEmpty() 12969} 12970 12971// Response returns the raw server response from the last page request. 12972func (page SharedGalleryListPage) Response() SharedGalleryList { 12973 return page.sgl 12974} 12975 12976// Values returns the slice of values for the current page or nil if there are no values. 12977func (page SharedGalleryListPage) Values() []SharedGallery { 12978 if page.sgl.IsEmpty() { 12979 return nil 12980 } 12981 return *page.sgl.Value 12982} 12983 12984// Creates a new instance of the SharedGalleryListPage type. 12985func NewSharedGalleryListPage(cur SharedGalleryList, getNextPage func(context.Context, SharedGalleryList) (SharedGalleryList, error)) SharedGalleryListPage { 12986 return SharedGalleryListPage{ 12987 fn: getNextPage, 12988 sgl: cur, 12989 } 12990} 12991 12992// ShareInfoElement ... 12993type ShareInfoElement struct { 12994 // VMURI - READ-ONLY; A relative URI containing the ID of the VM that has the disk attached. 12995 VMURI *string `json:"vmUri,omitempty"` 12996} 12997 12998// MarshalJSON is the custom marshaler for ShareInfoElement. 12999func (sie ShareInfoElement) MarshalJSON() ([]byte, error) { 13000 objectMap := make(map[string]interface{}) 13001 return json.Marshal(objectMap) 13002} 13003 13004// SharingProfile profile for gallery sharing to subscription or tenant 13005type SharingProfile struct { 13006 // Permissions - This property allows you to specify the permission of sharing gallery. <br><br> Possible values are: <br><br> **Private** <br><br> **Groups**. Possible values include: 'GallerySharingPermissionTypesPrivate', 'GallerySharingPermissionTypesGroups' 13007 Permissions GallerySharingPermissionTypes `json:"permissions,omitempty"` 13008 // Groups - READ-ONLY; A list of sharing profile groups. 13009 Groups *[]SharingProfileGroup `json:"groups,omitempty"` 13010} 13011 13012// MarshalJSON is the custom marshaler for SharingProfile. 13013func (sp SharingProfile) MarshalJSON() ([]byte, error) { 13014 objectMap := make(map[string]interface{}) 13015 if sp.Permissions != "" { 13016 objectMap["permissions"] = sp.Permissions 13017 } 13018 return json.Marshal(objectMap) 13019} 13020 13021// SharingProfileGroup group of the gallery sharing profile 13022type SharingProfileGroup struct { 13023 // Type - This property allows you to specify the type of sharing group. <br><br> Possible values are: <br><br> **Subscriptions** <br><br> **AADTenants**. Possible values include: 'SharingProfileGroupTypesSubscriptions', 'SharingProfileGroupTypesAADTenants' 13024 Type SharingProfileGroupTypes `json:"type,omitempty"` 13025 // Ids - A list of subscription/tenant ids the gallery is aimed to be shared to. 13026 Ids *[]string `json:"ids,omitempty"` 13027} 13028 13029// SharingUpdate specifies information about the gallery sharing profile update. 13030type SharingUpdate struct { 13031 autorest.Response `json:"-"` 13032 // OperationType - This property allows you to specify the operation type of gallery sharing update. <br><br> Possible values are: <br><br> **Add** <br><br> **Remove** <br><br> **Reset**. Possible values include: 'SharingUpdateOperationTypesAdd', 'SharingUpdateOperationTypesRemove', 'SharingUpdateOperationTypesReset' 13033 OperationType SharingUpdateOperationTypes `json:"operationType,omitempty"` 13034 // Groups - A list of sharing profile groups. 13035 Groups *[]SharingProfileGroup `json:"groups,omitempty"` 13036} 13037 13038// Sku describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware 13039// the scale set is currently on, you need to deallocate the VMs in the scale set before you modify the SKU 13040// name. 13041type Sku struct { 13042 // Name - The sku name. 13043 Name *string `json:"name,omitempty"` 13044 // Tier - Specifies the tier of virtual machines in a scale set.<br /><br /> Possible Values:<br /><br /> **Standard**<br /><br /> **Basic** 13045 Tier *string `json:"tier,omitempty"` 13046 // Capacity - Specifies the number of virtual machines in the scale set. 13047 Capacity *int64 `json:"capacity,omitempty"` 13048} 13049 13050// Snapshot snapshot resource. 13051type Snapshot struct { 13052 autorest.Response `json:"-"` 13053 // ManagedBy - READ-ONLY; Unused. Always Null. 13054 ManagedBy *string `json:"managedBy,omitempty"` 13055 Sku *SnapshotSku `json:"sku,omitempty"` 13056 // ExtendedLocation - The extended location where the snapshot will be created. Extended location cannot be changed. 13057 ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` 13058 *SnapshotProperties `json:"properties,omitempty"` 13059 // ID - READ-ONLY; Resource Id 13060 ID *string `json:"id,omitempty"` 13061 // Name - READ-ONLY; Resource name 13062 Name *string `json:"name,omitempty"` 13063 // Type - READ-ONLY; Resource type 13064 Type *string `json:"type,omitempty"` 13065 // Location - Resource location 13066 Location *string `json:"location,omitempty"` 13067 // Tags - Resource tags 13068 Tags map[string]*string `json:"tags"` 13069} 13070 13071// MarshalJSON is the custom marshaler for Snapshot. 13072func (s Snapshot) MarshalJSON() ([]byte, error) { 13073 objectMap := make(map[string]interface{}) 13074 if s.Sku != nil { 13075 objectMap["sku"] = s.Sku 13076 } 13077 if s.ExtendedLocation != nil { 13078 objectMap["extendedLocation"] = s.ExtendedLocation 13079 } 13080 if s.SnapshotProperties != nil { 13081 objectMap["properties"] = s.SnapshotProperties 13082 } 13083 if s.Location != nil { 13084 objectMap["location"] = s.Location 13085 } 13086 if s.Tags != nil { 13087 objectMap["tags"] = s.Tags 13088 } 13089 return json.Marshal(objectMap) 13090} 13091 13092// UnmarshalJSON is the custom unmarshaler for Snapshot struct. 13093func (s *Snapshot) UnmarshalJSON(body []byte) error { 13094 var m map[string]*json.RawMessage 13095 err := json.Unmarshal(body, &m) 13096 if err != nil { 13097 return err 13098 } 13099 for k, v := range m { 13100 switch k { 13101 case "managedBy": 13102 if v != nil { 13103 var managedBy string 13104 err = json.Unmarshal(*v, &managedBy) 13105 if err != nil { 13106 return err 13107 } 13108 s.ManagedBy = &managedBy 13109 } 13110 case "sku": 13111 if v != nil { 13112 var sku SnapshotSku 13113 err = json.Unmarshal(*v, &sku) 13114 if err != nil { 13115 return err 13116 } 13117 s.Sku = &sku 13118 } 13119 case "extendedLocation": 13120 if v != nil { 13121 var extendedLocation ExtendedLocation 13122 err = json.Unmarshal(*v, &extendedLocation) 13123 if err != nil { 13124 return err 13125 } 13126 s.ExtendedLocation = &extendedLocation 13127 } 13128 case "properties": 13129 if v != nil { 13130 var snapshotProperties SnapshotProperties 13131 err = json.Unmarshal(*v, &snapshotProperties) 13132 if err != nil { 13133 return err 13134 } 13135 s.SnapshotProperties = &snapshotProperties 13136 } 13137 case "id": 13138 if v != nil { 13139 var ID string 13140 err = json.Unmarshal(*v, &ID) 13141 if err != nil { 13142 return err 13143 } 13144 s.ID = &ID 13145 } 13146 case "name": 13147 if v != nil { 13148 var name string 13149 err = json.Unmarshal(*v, &name) 13150 if err != nil { 13151 return err 13152 } 13153 s.Name = &name 13154 } 13155 case "type": 13156 if v != nil { 13157 var typeVar string 13158 err = json.Unmarshal(*v, &typeVar) 13159 if err != nil { 13160 return err 13161 } 13162 s.Type = &typeVar 13163 } 13164 case "location": 13165 if v != nil { 13166 var location string 13167 err = json.Unmarshal(*v, &location) 13168 if err != nil { 13169 return err 13170 } 13171 s.Location = &location 13172 } 13173 case "tags": 13174 if v != nil { 13175 var tags map[string]*string 13176 err = json.Unmarshal(*v, &tags) 13177 if err != nil { 13178 return err 13179 } 13180 s.Tags = tags 13181 } 13182 } 13183 } 13184 13185 return nil 13186} 13187 13188// SnapshotList the List Snapshots operation response. 13189type SnapshotList struct { 13190 autorest.Response `json:"-"` 13191 // Value - A list of snapshots. 13192 Value *[]Snapshot `json:"value,omitempty"` 13193 // NextLink - The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the next page of snapshots. 13194 NextLink *string `json:"nextLink,omitempty"` 13195} 13196 13197// SnapshotListIterator provides access to a complete listing of Snapshot values. 13198type SnapshotListIterator struct { 13199 i int 13200 page SnapshotListPage 13201} 13202 13203// NextWithContext advances to the next value. If there was an error making 13204// the request the iterator does not advance and the error is returned. 13205func (iter *SnapshotListIterator) NextWithContext(ctx context.Context) (err error) { 13206 if tracing.IsEnabled() { 13207 ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotListIterator.NextWithContext") 13208 defer func() { 13209 sc := -1 13210 if iter.Response().Response.Response != nil { 13211 sc = iter.Response().Response.Response.StatusCode 13212 } 13213 tracing.EndSpan(ctx, sc, err) 13214 }() 13215 } 13216 iter.i++ 13217 if iter.i < len(iter.page.Values()) { 13218 return nil 13219 } 13220 err = iter.page.NextWithContext(ctx) 13221 if err != nil { 13222 iter.i-- 13223 return err 13224 } 13225 iter.i = 0 13226 return nil 13227} 13228 13229// Next advances to the next value. If there was an error making 13230// the request the iterator does not advance and the error is returned. 13231// Deprecated: Use NextWithContext() instead. 13232func (iter *SnapshotListIterator) Next() error { 13233 return iter.NextWithContext(context.Background()) 13234} 13235 13236// NotDone returns true if the enumeration should be started or is not yet complete. 13237func (iter SnapshotListIterator) NotDone() bool { 13238 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 13239} 13240 13241// Response returns the raw server response from the last page request. 13242func (iter SnapshotListIterator) Response() SnapshotList { 13243 return iter.page.Response() 13244} 13245 13246// Value returns the current value or a zero-initialized value if the 13247// iterator has advanced beyond the end of the collection. 13248func (iter SnapshotListIterator) Value() Snapshot { 13249 if !iter.page.NotDone() { 13250 return Snapshot{} 13251 } 13252 return iter.page.Values()[iter.i] 13253} 13254 13255// Creates a new instance of the SnapshotListIterator type. 13256func NewSnapshotListIterator(page SnapshotListPage) SnapshotListIterator { 13257 return SnapshotListIterator{page: page} 13258} 13259 13260// IsEmpty returns true if the ListResult contains no values. 13261func (sl SnapshotList) IsEmpty() bool { 13262 return sl.Value == nil || len(*sl.Value) == 0 13263} 13264 13265// hasNextLink returns true if the NextLink is not empty. 13266func (sl SnapshotList) hasNextLink() bool { 13267 return sl.NextLink != nil && len(*sl.NextLink) != 0 13268} 13269 13270// snapshotListPreparer prepares a request to retrieve the next set of results. 13271// It returns nil if no more results exist. 13272func (sl SnapshotList) snapshotListPreparer(ctx context.Context) (*http.Request, error) { 13273 if !sl.hasNextLink() { 13274 return nil, nil 13275 } 13276 return autorest.Prepare((&http.Request{}).WithContext(ctx), 13277 autorest.AsJSON(), 13278 autorest.AsGet(), 13279 autorest.WithBaseURL(to.String(sl.NextLink))) 13280} 13281 13282// SnapshotListPage contains a page of Snapshot values. 13283type SnapshotListPage struct { 13284 fn func(context.Context, SnapshotList) (SnapshotList, error) 13285 sl SnapshotList 13286} 13287 13288// NextWithContext advances to the next page of values. If there was an error making 13289// the request the page does not advance and the error is returned. 13290func (page *SnapshotListPage) NextWithContext(ctx context.Context) (err error) { 13291 if tracing.IsEnabled() { 13292 ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotListPage.NextWithContext") 13293 defer func() { 13294 sc := -1 13295 if page.Response().Response.Response != nil { 13296 sc = page.Response().Response.Response.StatusCode 13297 } 13298 tracing.EndSpan(ctx, sc, err) 13299 }() 13300 } 13301 for { 13302 next, err := page.fn(ctx, page.sl) 13303 if err != nil { 13304 return err 13305 } 13306 page.sl = next 13307 if !next.hasNextLink() || !next.IsEmpty() { 13308 break 13309 } 13310 } 13311 return nil 13312} 13313 13314// Next advances to the next page of values. If there was an error making 13315// the request the page does not advance and the error is returned. 13316// Deprecated: Use NextWithContext() instead. 13317func (page *SnapshotListPage) Next() error { 13318 return page.NextWithContext(context.Background()) 13319} 13320 13321// NotDone returns true if the page enumeration should be started or is not yet complete. 13322func (page SnapshotListPage) NotDone() bool { 13323 return !page.sl.IsEmpty() 13324} 13325 13326// Response returns the raw server response from the last page request. 13327func (page SnapshotListPage) Response() SnapshotList { 13328 return page.sl 13329} 13330 13331// Values returns the slice of values for the current page or nil if there are no values. 13332func (page SnapshotListPage) Values() []Snapshot { 13333 if page.sl.IsEmpty() { 13334 return nil 13335 } 13336 return *page.sl.Value 13337} 13338 13339// Creates a new instance of the SnapshotListPage type. 13340func NewSnapshotListPage(cur SnapshotList, getNextPage func(context.Context, SnapshotList) (SnapshotList, error)) SnapshotListPage { 13341 return SnapshotListPage{ 13342 fn: getNextPage, 13343 sl: cur, 13344 } 13345} 13346 13347// SnapshotProperties snapshot resource properties. 13348type SnapshotProperties struct { 13349 // TimeCreated - READ-ONLY; The time when the snapshot was created. 13350 TimeCreated *date.Time `json:"timeCreated,omitempty"` 13351 // OsType - The Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' 13352 OsType OperatingSystemTypes `json:"osType,omitempty"` 13353 // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'HyperVGenerationV1', 'HyperVGenerationV2' 13354 HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` 13355 // PurchasePlan - Purchase plan information for the image from which the source disk for the snapshot was originally created. 13356 PurchasePlan *PurchasePlan `json:"purchasePlan,omitempty"` 13357 // CreationData - Disk source information. CreationData information cannot be changed after the disk has been created. 13358 CreationData *CreationData `json:"creationData,omitempty"` 13359 // 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. 13360 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 13361 // DiskSizeBytes - READ-ONLY; The size of the disk in bytes. This field is read only. 13362 DiskSizeBytes *int64 `json:"diskSizeBytes,omitempty"` 13363 // DiskState - The state of the snapshot. Possible values include: 'DiskStateUnattached', 'DiskStateAttached', 'DiskStateReserved', 'DiskStateActiveSAS', 'DiskStateReadyToUpload', 'DiskStateActiveUpload' 13364 DiskState DiskState `json:"diskState,omitempty"` 13365 // UniqueID - READ-ONLY; Unique Guid identifying the resource. 13366 UniqueID *string `json:"uniqueId,omitempty"` 13367 // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. 13368 EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` 13369 // ProvisioningState - READ-ONLY; The disk provisioning state. 13370 ProvisioningState *string `json:"provisioningState,omitempty"` 13371 // Incremental - Whether a snapshot is incremental. Incremental snapshots on the same disk occupy less space than full snapshots and can be diffed. 13372 Incremental *bool `json:"incremental,omitempty"` 13373 // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 13374 Encryption *Encryption `json:"encryption,omitempty"` 13375 // NetworkAccessPolicy - Possible values include: 'NetworkAccessPolicyAllowAll', 'NetworkAccessPolicyAllowPrivate', 'NetworkAccessPolicyDenyAll' 13376 NetworkAccessPolicy NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` 13377 // DiskAccessID - ARM id of the DiskAccess resource for using private endpoints on disks. 13378 DiskAccessID *string `json:"diskAccessId,omitempty"` 13379 // SupportsHibernation - Indicates the OS on a snapshot supports hibernation. 13380 SupportsHibernation *bool `json:"supportsHibernation,omitempty"` 13381} 13382 13383// MarshalJSON is the custom marshaler for SnapshotProperties. 13384func (sp SnapshotProperties) MarshalJSON() ([]byte, error) { 13385 objectMap := make(map[string]interface{}) 13386 if sp.OsType != "" { 13387 objectMap["osType"] = sp.OsType 13388 } 13389 if sp.HyperVGeneration != "" { 13390 objectMap["hyperVGeneration"] = sp.HyperVGeneration 13391 } 13392 if sp.PurchasePlan != nil { 13393 objectMap["purchasePlan"] = sp.PurchasePlan 13394 } 13395 if sp.CreationData != nil { 13396 objectMap["creationData"] = sp.CreationData 13397 } 13398 if sp.DiskSizeGB != nil { 13399 objectMap["diskSizeGB"] = sp.DiskSizeGB 13400 } 13401 if sp.DiskState != "" { 13402 objectMap["diskState"] = sp.DiskState 13403 } 13404 if sp.EncryptionSettingsCollection != nil { 13405 objectMap["encryptionSettingsCollection"] = sp.EncryptionSettingsCollection 13406 } 13407 if sp.Incremental != nil { 13408 objectMap["incremental"] = sp.Incremental 13409 } 13410 if sp.Encryption != nil { 13411 objectMap["encryption"] = sp.Encryption 13412 } 13413 if sp.NetworkAccessPolicy != "" { 13414 objectMap["networkAccessPolicy"] = sp.NetworkAccessPolicy 13415 } 13416 if sp.DiskAccessID != nil { 13417 objectMap["diskAccessId"] = sp.DiskAccessID 13418 } 13419 if sp.SupportsHibernation != nil { 13420 objectMap["supportsHibernation"] = sp.SupportsHibernation 13421 } 13422 return json.Marshal(objectMap) 13423} 13424 13425// SnapshotsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 13426// operation. 13427type SnapshotsCreateOrUpdateFuture struct { 13428 azure.FutureAPI 13429 // Result returns the result of the asynchronous operation. 13430 // If the operation has not completed it will return an error. 13431 Result func(SnapshotsClient) (Snapshot, error) 13432} 13433 13434// UnmarshalJSON is the custom unmarshaller for CreateFuture. 13435func (future *SnapshotsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 13436 var azFuture azure.Future 13437 if err := json.Unmarshal(body, &azFuture); err != nil { 13438 return err 13439 } 13440 future.FutureAPI = &azFuture 13441 future.Result = future.result 13442 return nil 13443} 13444 13445// result is the default implementation for SnapshotsCreateOrUpdateFuture.Result. 13446func (future *SnapshotsCreateOrUpdateFuture) result(client SnapshotsClient) (s Snapshot, err error) { 13447 var done bool 13448 done, err = future.DoneWithContext(context.Background(), client) 13449 if err != nil { 13450 err = autorest.NewErrorWithError(err, "compute.SnapshotsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 13451 return 13452 } 13453 if !done { 13454 s.Response.Response = future.Response() 13455 err = azure.NewAsyncOpIncompleteError("compute.SnapshotsCreateOrUpdateFuture") 13456 return 13457 } 13458 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13459 if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { 13460 s, err = client.CreateOrUpdateResponder(s.Response.Response) 13461 if err != nil { 13462 err = autorest.NewErrorWithError(err, "compute.SnapshotsCreateOrUpdateFuture", "Result", s.Response.Response, "Failure responding to request") 13463 } 13464 } 13465 return 13466} 13467 13468// SnapshotsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 13469// operation. 13470type SnapshotsDeleteFuture struct { 13471 azure.FutureAPI 13472 // Result returns the result of the asynchronous operation. 13473 // If the operation has not completed it will return an error. 13474 Result func(SnapshotsClient) (autorest.Response, error) 13475} 13476 13477// UnmarshalJSON is the custom unmarshaller for CreateFuture. 13478func (future *SnapshotsDeleteFuture) UnmarshalJSON(body []byte) error { 13479 var azFuture azure.Future 13480 if err := json.Unmarshal(body, &azFuture); err != nil { 13481 return err 13482 } 13483 future.FutureAPI = &azFuture 13484 future.Result = future.result 13485 return nil 13486} 13487 13488// result is the default implementation for SnapshotsDeleteFuture.Result. 13489func (future *SnapshotsDeleteFuture) result(client SnapshotsClient) (ar autorest.Response, err error) { 13490 var done bool 13491 done, err = future.DoneWithContext(context.Background(), client) 13492 if err != nil { 13493 err = autorest.NewErrorWithError(err, "compute.SnapshotsDeleteFuture", "Result", future.Response(), "Polling failure") 13494 return 13495 } 13496 if !done { 13497 ar.Response = future.Response() 13498 err = azure.NewAsyncOpIncompleteError("compute.SnapshotsDeleteFuture") 13499 return 13500 } 13501 ar.Response = future.Response() 13502 return 13503} 13504 13505// SnapshotsGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running 13506// operation. 13507type SnapshotsGrantAccessFuture struct { 13508 azure.FutureAPI 13509 // Result returns the result of the asynchronous operation. 13510 // If the operation has not completed it will return an error. 13511 Result func(SnapshotsClient) (AccessURI, error) 13512} 13513 13514// UnmarshalJSON is the custom unmarshaller for CreateFuture. 13515func (future *SnapshotsGrantAccessFuture) UnmarshalJSON(body []byte) error { 13516 var azFuture azure.Future 13517 if err := json.Unmarshal(body, &azFuture); err != nil { 13518 return err 13519 } 13520 future.FutureAPI = &azFuture 13521 future.Result = future.result 13522 return nil 13523} 13524 13525// result is the default implementation for SnapshotsGrantAccessFuture.Result. 13526func (future *SnapshotsGrantAccessFuture) result(client SnapshotsClient) (au AccessURI, err error) { 13527 var done bool 13528 done, err = future.DoneWithContext(context.Background(), client) 13529 if err != nil { 13530 err = autorest.NewErrorWithError(err, "compute.SnapshotsGrantAccessFuture", "Result", future.Response(), "Polling failure") 13531 return 13532 } 13533 if !done { 13534 au.Response.Response = future.Response() 13535 err = azure.NewAsyncOpIncompleteError("compute.SnapshotsGrantAccessFuture") 13536 return 13537 } 13538 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13539 if au.Response.Response, err = future.GetResult(sender); err == nil && au.Response.Response.StatusCode != http.StatusNoContent { 13540 au, err = client.GrantAccessResponder(au.Response.Response) 13541 if err != nil { 13542 err = autorest.NewErrorWithError(err, "compute.SnapshotsGrantAccessFuture", "Result", au.Response.Response, "Failure responding to request") 13543 } 13544 } 13545 return 13546} 13547 13548// SnapshotSku the snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This is an 13549// optional parameter for incremental snapshot and the default behavior is the SKU will be set to the same 13550// sku as the previous snapshot 13551type SnapshotSku struct { 13552 // Name - The sku name. Possible values include: 'SnapshotStorageAccountTypesStandardLRS', 'SnapshotStorageAccountTypesPremiumLRS', 'SnapshotStorageAccountTypesStandardZRS' 13553 Name SnapshotStorageAccountTypes `json:"name,omitempty"` 13554 // Tier - READ-ONLY; The sku tier. 13555 Tier *string `json:"tier,omitempty"` 13556} 13557 13558// MarshalJSON is the custom marshaler for SnapshotSku. 13559func (ss SnapshotSku) MarshalJSON() ([]byte, error) { 13560 objectMap := make(map[string]interface{}) 13561 if ss.Name != "" { 13562 objectMap["name"] = ss.Name 13563 } 13564 return json.Marshal(objectMap) 13565} 13566 13567// SnapshotsRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running 13568// operation. 13569type SnapshotsRevokeAccessFuture struct { 13570 azure.FutureAPI 13571 // Result returns the result of the asynchronous operation. 13572 // If the operation has not completed it will return an error. 13573 Result func(SnapshotsClient) (autorest.Response, error) 13574} 13575 13576// UnmarshalJSON is the custom unmarshaller for CreateFuture. 13577func (future *SnapshotsRevokeAccessFuture) UnmarshalJSON(body []byte) error { 13578 var azFuture azure.Future 13579 if err := json.Unmarshal(body, &azFuture); err != nil { 13580 return err 13581 } 13582 future.FutureAPI = &azFuture 13583 future.Result = future.result 13584 return nil 13585} 13586 13587// result is the default implementation for SnapshotsRevokeAccessFuture.Result. 13588func (future *SnapshotsRevokeAccessFuture) result(client SnapshotsClient) (ar autorest.Response, err error) { 13589 var done bool 13590 done, err = future.DoneWithContext(context.Background(), client) 13591 if err != nil { 13592 err = autorest.NewErrorWithError(err, "compute.SnapshotsRevokeAccessFuture", "Result", future.Response(), "Polling failure") 13593 return 13594 } 13595 if !done { 13596 ar.Response = future.Response() 13597 err = azure.NewAsyncOpIncompleteError("compute.SnapshotsRevokeAccessFuture") 13598 return 13599 } 13600 ar.Response = future.Response() 13601 return 13602} 13603 13604// SnapshotsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 13605// operation. 13606type SnapshotsUpdateFuture struct { 13607 azure.FutureAPI 13608 // Result returns the result of the asynchronous operation. 13609 // If the operation has not completed it will return an error. 13610 Result func(SnapshotsClient) (Snapshot, error) 13611} 13612 13613// UnmarshalJSON is the custom unmarshaller for CreateFuture. 13614func (future *SnapshotsUpdateFuture) UnmarshalJSON(body []byte) error { 13615 var azFuture azure.Future 13616 if err := json.Unmarshal(body, &azFuture); err != nil { 13617 return err 13618 } 13619 future.FutureAPI = &azFuture 13620 future.Result = future.result 13621 return nil 13622} 13623 13624// result is the default implementation for SnapshotsUpdateFuture.Result. 13625func (future *SnapshotsUpdateFuture) result(client SnapshotsClient) (s Snapshot, err error) { 13626 var done bool 13627 done, err = future.DoneWithContext(context.Background(), client) 13628 if err != nil { 13629 err = autorest.NewErrorWithError(err, "compute.SnapshotsUpdateFuture", "Result", future.Response(), "Polling failure") 13630 return 13631 } 13632 if !done { 13633 s.Response.Response = future.Response() 13634 err = azure.NewAsyncOpIncompleteError("compute.SnapshotsUpdateFuture") 13635 return 13636 } 13637 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13638 if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { 13639 s, err = client.UpdateResponder(s.Response.Response) 13640 if err != nil { 13641 err = autorest.NewErrorWithError(err, "compute.SnapshotsUpdateFuture", "Result", s.Response.Response, "Failure responding to request") 13642 } 13643 } 13644 return 13645} 13646 13647// SnapshotUpdate snapshot update resource. 13648type SnapshotUpdate struct { 13649 *SnapshotUpdateProperties `json:"properties,omitempty"` 13650 // Tags - Resource tags 13651 Tags map[string]*string `json:"tags"` 13652 Sku *SnapshotSku `json:"sku,omitempty"` 13653} 13654 13655// MarshalJSON is the custom marshaler for SnapshotUpdate. 13656func (su SnapshotUpdate) MarshalJSON() ([]byte, error) { 13657 objectMap := make(map[string]interface{}) 13658 if su.SnapshotUpdateProperties != nil { 13659 objectMap["properties"] = su.SnapshotUpdateProperties 13660 } 13661 if su.Tags != nil { 13662 objectMap["tags"] = su.Tags 13663 } 13664 if su.Sku != nil { 13665 objectMap["sku"] = su.Sku 13666 } 13667 return json.Marshal(objectMap) 13668} 13669 13670// UnmarshalJSON is the custom unmarshaler for SnapshotUpdate struct. 13671func (su *SnapshotUpdate) UnmarshalJSON(body []byte) error { 13672 var m map[string]*json.RawMessage 13673 err := json.Unmarshal(body, &m) 13674 if err != nil { 13675 return err 13676 } 13677 for k, v := range m { 13678 switch k { 13679 case "properties": 13680 if v != nil { 13681 var snapshotUpdateProperties SnapshotUpdateProperties 13682 err = json.Unmarshal(*v, &snapshotUpdateProperties) 13683 if err != nil { 13684 return err 13685 } 13686 su.SnapshotUpdateProperties = &snapshotUpdateProperties 13687 } 13688 case "tags": 13689 if v != nil { 13690 var tags map[string]*string 13691 err = json.Unmarshal(*v, &tags) 13692 if err != nil { 13693 return err 13694 } 13695 su.Tags = tags 13696 } 13697 case "sku": 13698 if v != nil { 13699 var sku SnapshotSku 13700 err = json.Unmarshal(*v, &sku) 13701 if err != nil { 13702 return err 13703 } 13704 su.Sku = &sku 13705 } 13706 } 13707 } 13708 13709 return nil 13710} 13711 13712// SnapshotUpdateProperties snapshot resource update properties. 13713type SnapshotUpdateProperties struct { 13714 // OsType - the Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' 13715 OsType OperatingSystemTypes `json:"osType,omitempty"` 13716 // 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. 13717 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 13718 // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. 13719 EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` 13720 // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 13721 Encryption *Encryption `json:"encryption,omitempty"` 13722 // NetworkAccessPolicy - Possible values include: 'NetworkAccessPolicyAllowAll', 'NetworkAccessPolicyAllowPrivate', 'NetworkAccessPolicyDenyAll' 13723 NetworkAccessPolicy NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` 13724 // DiskAccessID - ARM id of the DiskAccess resource for using private endpoints on disks. 13725 DiskAccessID *string `json:"diskAccessId,omitempty"` 13726 // SupportsHibernation - Indicates the OS on a snapshot supports hibernation. 13727 SupportsHibernation *bool `json:"supportsHibernation,omitempty"` 13728} 13729 13730// SourceVault the vault id is an Azure Resource Manager Resource id in the form 13731// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName} 13732type SourceVault struct { 13733 // ID - Resource Id 13734 ID *string `json:"id,omitempty"` 13735} 13736 13737// SSHConfiguration SSH configuration for Linux based VMs running on Azure 13738type SSHConfiguration struct { 13739 // PublicKeys - The list of SSH public keys used to authenticate with linux based VMs. 13740 PublicKeys *[]SSHPublicKey `json:"publicKeys,omitempty"` 13741} 13742 13743// SSHPublicKey contains information about SSH certificate public key and the path on the Linux VM where 13744// the public key is placed. 13745type SSHPublicKey struct { 13746 // 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 13747 Path *string `json:"path,omitempty"` 13748 // KeyData - SSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit and in ssh-rsa format. <br><br> For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in Azure]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). 13749 KeyData *string `json:"keyData,omitempty"` 13750} 13751 13752// SSHPublicKeyGenerateKeyPairResult response from generation of an SSH key pair. 13753type SSHPublicKeyGenerateKeyPairResult struct { 13754 autorest.Response `json:"-"` 13755 // 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. 13756 PrivateKey *string `json:"privateKey,omitempty"` 13757 // 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. 13758 PublicKey *string `json:"publicKey,omitempty"` 13759 // ID - The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{SshPublicKeyName} 13760 ID *string `json:"id,omitempty"` 13761} 13762 13763// SSHPublicKeyResource specifies information about the SSH public key. 13764type SSHPublicKeyResource struct { 13765 autorest.Response `json:"-"` 13766 // SSHPublicKeyResourceProperties - Properties of the SSH public key. 13767 *SSHPublicKeyResourceProperties `json:"properties,omitempty"` 13768 // ID - READ-ONLY; Resource Id 13769 ID *string `json:"id,omitempty"` 13770 // Name - READ-ONLY; Resource name 13771 Name *string `json:"name,omitempty"` 13772 // Type - READ-ONLY; Resource type 13773 Type *string `json:"type,omitempty"` 13774 // Location - Resource location 13775 Location *string `json:"location,omitempty"` 13776 // Tags - Resource tags 13777 Tags map[string]*string `json:"tags"` 13778} 13779 13780// MarshalJSON is the custom marshaler for SSHPublicKeyResource. 13781func (spkr SSHPublicKeyResource) MarshalJSON() ([]byte, error) { 13782 objectMap := make(map[string]interface{}) 13783 if spkr.SSHPublicKeyResourceProperties != nil { 13784 objectMap["properties"] = spkr.SSHPublicKeyResourceProperties 13785 } 13786 if spkr.Location != nil { 13787 objectMap["location"] = spkr.Location 13788 } 13789 if spkr.Tags != nil { 13790 objectMap["tags"] = spkr.Tags 13791 } 13792 return json.Marshal(objectMap) 13793} 13794 13795// UnmarshalJSON is the custom unmarshaler for SSHPublicKeyResource struct. 13796func (spkr *SSHPublicKeyResource) UnmarshalJSON(body []byte) error { 13797 var m map[string]*json.RawMessage 13798 err := json.Unmarshal(body, &m) 13799 if err != nil { 13800 return err 13801 } 13802 for k, v := range m { 13803 switch k { 13804 case "properties": 13805 if v != nil { 13806 var SSHPublicKeyResourceProperties SSHPublicKeyResourceProperties 13807 err = json.Unmarshal(*v, &SSHPublicKeyResourceProperties) 13808 if err != nil { 13809 return err 13810 } 13811 spkr.SSHPublicKeyResourceProperties = &SSHPublicKeyResourceProperties 13812 } 13813 case "id": 13814 if v != nil { 13815 var ID string 13816 err = json.Unmarshal(*v, &ID) 13817 if err != nil { 13818 return err 13819 } 13820 spkr.ID = &ID 13821 } 13822 case "name": 13823 if v != nil { 13824 var name string 13825 err = json.Unmarshal(*v, &name) 13826 if err != nil { 13827 return err 13828 } 13829 spkr.Name = &name 13830 } 13831 case "type": 13832 if v != nil { 13833 var typeVar string 13834 err = json.Unmarshal(*v, &typeVar) 13835 if err != nil { 13836 return err 13837 } 13838 spkr.Type = &typeVar 13839 } 13840 case "location": 13841 if v != nil { 13842 var location string 13843 err = json.Unmarshal(*v, &location) 13844 if err != nil { 13845 return err 13846 } 13847 spkr.Location = &location 13848 } 13849 case "tags": 13850 if v != nil { 13851 var tags map[string]*string 13852 err = json.Unmarshal(*v, &tags) 13853 if err != nil { 13854 return err 13855 } 13856 spkr.Tags = tags 13857 } 13858 } 13859 } 13860 13861 return nil 13862} 13863 13864// SSHPublicKeyResourceProperties properties of the SSH public key. 13865type SSHPublicKeyResourceProperties struct { 13866 // 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. 13867 PublicKey *string `json:"publicKey,omitempty"` 13868} 13869 13870// SSHPublicKeysGroupListResult the list SSH public keys operation response. 13871type SSHPublicKeysGroupListResult struct { 13872 autorest.Response `json:"-"` 13873 // Value - The list of SSH public keys 13874 Value *[]SSHPublicKeyResource `json:"value,omitempty"` 13875 // 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. 13876 NextLink *string `json:"nextLink,omitempty"` 13877} 13878 13879// SSHPublicKeysGroupListResultIterator provides access to a complete listing of SSHPublicKeyResource 13880// values. 13881type SSHPublicKeysGroupListResultIterator struct { 13882 i int 13883 page SSHPublicKeysGroupListResultPage 13884} 13885 13886// NextWithContext advances to the next value. If there was an error making 13887// the request the iterator does not advance and the error is returned. 13888func (iter *SSHPublicKeysGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { 13889 if tracing.IsEnabled() { 13890 ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysGroupListResultIterator.NextWithContext") 13891 defer func() { 13892 sc := -1 13893 if iter.Response().Response.Response != nil { 13894 sc = iter.Response().Response.Response.StatusCode 13895 } 13896 tracing.EndSpan(ctx, sc, err) 13897 }() 13898 } 13899 iter.i++ 13900 if iter.i < len(iter.page.Values()) { 13901 return nil 13902 } 13903 err = iter.page.NextWithContext(ctx) 13904 if err != nil { 13905 iter.i-- 13906 return err 13907 } 13908 iter.i = 0 13909 return nil 13910} 13911 13912// Next advances to the next value. If there was an error making 13913// the request the iterator does not advance and the error is returned. 13914// Deprecated: Use NextWithContext() instead. 13915func (iter *SSHPublicKeysGroupListResultIterator) Next() error { 13916 return iter.NextWithContext(context.Background()) 13917} 13918 13919// NotDone returns true if the enumeration should be started or is not yet complete. 13920func (iter SSHPublicKeysGroupListResultIterator) NotDone() bool { 13921 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 13922} 13923 13924// Response returns the raw server response from the last page request. 13925func (iter SSHPublicKeysGroupListResultIterator) Response() SSHPublicKeysGroupListResult { 13926 return iter.page.Response() 13927} 13928 13929// Value returns the current value or a zero-initialized value if the 13930// iterator has advanced beyond the end of the collection. 13931func (iter SSHPublicKeysGroupListResultIterator) Value() SSHPublicKeyResource { 13932 if !iter.page.NotDone() { 13933 return SSHPublicKeyResource{} 13934 } 13935 return iter.page.Values()[iter.i] 13936} 13937 13938// Creates a new instance of the SSHPublicKeysGroupListResultIterator type. 13939func NewSSHPublicKeysGroupListResultIterator(page SSHPublicKeysGroupListResultPage) SSHPublicKeysGroupListResultIterator { 13940 return SSHPublicKeysGroupListResultIterator{page: page} 13941} 13942 13943// IsEmpty returns true if the ListResult contains no values. 13944func (spkglr SSHPublicKeysGroupListResult) IsEmpty() bool { 13945 return spkglr.Value == nil || len(*spkglr.Value) == 0 13946} 13947 13948// hasNextLink returns true if the NextLink is not empty. 13949func (spkglr SSHPublicKeysGroupListResult) hasNextLink() bool { 13950 return spkglr.NextLink != nil && len(*spkglr.NextLink) != 0 13951} 13952 13953// sSHPublicKeysGroupListResultPreparer prepares a request to retrieve the next set of results. 13954// It returns nil if no more results exist. 13955func (spkglr SSHPublicKeysGroupListResult) sSHPublicKeysGroupListResultPreparer(ctx context.Context) (*http.Request, error) { 13956 if !spkglr.hasNextLink() { 13957 return nil, nil 13958 } 13959 return autorest.Prepare((&http.Request{}).WithContext(ctx), 13960 autorest.AsJSON(), 13961 autorest.AsGet(), 13962 autorest.WithBaseURL(to.String(spkglr.NextLink))) 13963} 13964 13965// SSHPublicKeysGroupListResultPage contains a page of SSHPublicKeyResource values. 13966type SSHPublicKeysGroupListResultPage struct { 13967 fn func(context.Context, SSHPublicKeysGroupListResult) (SSHPublicKeysGroupListResult, error) 13968 spkglr SSHPublicKeysGroupListResult 13969} 13970 13971// NextWithContext advances to the next page of values. If there was an error making 13972// the request the page does not advance and the error is returned. 13973func (page *SSHPublicKeysGroupListResultPage) NextWithContext(ctx context.Context) (err error) { 13974 if tracing.IsEnabled() { 13975 ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysGroupListResultPage.NextWithContext") 13976 defer func() { 13977 sc := -1 13978 if page.Response().Response.Response != nil { 13979 sc = page.Response().Response.Response.StatusCode 13980 } 13981 tracing.EndSpan(ctx, sc, err) 13982 }() 13983 } 13984 for { 13985 next, err := page.fn(ctx, page.spkglr) 13986 if err != nil { 13987 return err 13988 } 13989 page.spkglr = next 13990 if !next.hasNextLink() || !next.IsEmpty() { 13991 break 13992 } 13993 } 13994 return nil 13995} 13996 13997// Next advances to the next page of values. If there was an error making 13998// the request the page does not advance and the error is returned. 13999// Deprecated: Use NextWithContext() instead. 14000func (page *SSHPublicKeysGroupListResultPage) Next() error { 14001 return page.NextWithContext(context.Background()) 14002} 14003 14004// NotDone returns true if the page enumeration should be started or is not yet complete. 14005func (page SSHPublicKeysGroupListResultPage) NotDone() bool { 14006 return !page.spkglr.IsEmpty() 14007} 14008 14009// Response returns the raw server response from the last page request. 14010func (page SSHPublicKeysGroupListResultPage) Response() SSHPublicKeysGroupListResult { 14011 return page.spkglr 14012} 14013 14014// Values returns the slice of values for the current page or nil if there are no values. 14015func (page SSHPublicKeysGroupListResultPage) Values() []SSHPublicKeyResource { 14016 if page.spkglr.IsEmpty() { 14017 return nil 14018 } 14019 return *page.spkglr.Value 14020} 14021 14022// Creates a new instance of the SSHPublicKeysGroupListResultPage type. 14023func NewSSHPublicKeysGroupListResultPage(cur SSHPublicKeysGroupListResult, getNextPage func(context.Context, SSHPublicKeysGroupListResult) (SSHPublicKeysGroupListResult, error)) SSHPublicKeysGroupListResultPage { 14024 return SSHPublicKeysGroupListResultPage{ 14025 fn: getNextPage, 14026 spkglr: cur, 14027 } 14028} 14029 14030// SSHPublicKeyUpdateResource specifies information about the SSH public key. 14031type SSHPublicKeyUpdateResource struct { 14032 // SSHPublicKeyResourceProperties - Properties of the SSH public key. 14033 *SSHPublicKeyResourceProperties `json:"properties,omitempty"` 14034 // Tags - Resource tags 14035 Tags map[string]*string `json:"tags"` 14036} 14037 14038// MarshalJSON is the custom marshaler for SSHPublicKeyUpdateResource. 14039func (spkur SSHPublicKeyUpdateResource) MarshalJSON() ([]byte, error) { 14040 objectMap := make(map[string]interface{}) 14041 if spkur.SSHPublicKeyResourceProperties != nil { 14042 objectMap["properties"] = spkur.SSHPublicKeyResourceProperties 14043 } 14044 if spkur.Tags != nil { 14045 objectMap["tags"] = spkur.Tags 14046 } 14047 return json.Marshal(objectMap) 14048} 14049 14050// UnmarshalJSON is the custom unmarshaler for SSHPublicKeyUpdateResource struct. 14051func (spkur *SSHPublicKeyUpdateResource) UnmarshalJSON(body []byte) error { 14052 var m map[string]*json.RawMessage 14053 err := json.Unmarshal(body, &m) 14054 if err != nil { 14055 return err 14056 } 14057 for k, v := range m { 14058 switch k { 14059 case "properties": 14060 if v != nil { 14061 var SSHPublicKeyResourceProperties SSHPublicKeyResourceProperties 14062 err = json.Unmarshal(*v, &SSHPublicKeyResourceProperties) 14063 if err != nil { 14064 return err 14065 } 14066 spkur.SSHPublicKeyResourceProperties = &SSHPublicKeyResourceProperties 14067 } 14068 case "tags": 14069 if v != nil { 14070 var tags map[string]*string 14071 err = json.Unmarshal(*v, &tags) 14072 if err != nil { 14073 return err 14074 } 14075 spkur.Tags = tags 14076 } 14077 } 14078 } 14079 14080 return nil 14081} 14082 14083// StatusCodeCount ... 14084type StatusCodeCount struct { 14085 // Code - READ-ONLY; The instance view status code 14086 Code *string `json:"code,omitempty"` 14087 // Count - READ-ONLY; Number of instances having this status code 14088 Count *int32 `json:"count,omitempty"` 14089} 14090 14091// MarshalJSON is the custom marshaler for StatusCodeCount. 14092func (scc StatusCodeCount) MarshalJSON() ([]byte, error) { 14093 objectMap := make(map[string]interface{}) 14094 return json.Marshal(objectMap) 14095} 14096 14097// StorageProfile specifies the storage settings for the virtual machine disks. 14098type StorageProfile struct { 14099 // 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. 14100 ImageReference *ImageReference `json:"imageReference,omitempty"` 14101 // 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/managed-disks-overview). 14102 OsDisk *OSDisk `json:"osDisk,omitempty"` 14103 // 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/managed-disks-overview). 14104 DataDisks *[]DataDisk `json:"dataDisks,omitempty"` 14105} 14106 14107// SubResource ... 14108type SubResource struct { 14109 // ID - Resource Id 14110 ID *string `json:"id,omitempty"` 14111} 14112 14113// SubResourceReadOnly ... 14114type SubResourceReadOnly struct { 14115 // ID - READ-ONLY; Resource Id 14116 ID *string `json:"id,omitempty"` 14117} 14118 14119// MarshalJSON is the custom marshaler for SubResourceReadOnly. 14120func (srro SubResourceReadOnly) MarshalJSON() ([]byte, error) { 14121 objectMap := make(map[string]interface{}) 14122 return json.Marshal(objectMap) 14123} 14124 14125// SubResourceWithColocationStatus ... 14126type SubResourceWithColocationStatus struct { 14127 // ColocationStatus - Describes colocation status of a resource in the Proximity Placement Group. 14128 ColocationStatus *InstanceViewStatus `json:"colocationStatus,omitempty"` 14129 // ID - Resource Id 14130 ID *string `json:"id,omitempty"` 14131} 14132 14133// TargetRegion describes the target region information. 14134type TargetRegion struct { 14135 // Name - The name of the region. 14136 Name *string `json:"name,omitempty"` 14137 // RegionalReplicaCount - The number of replicas of the Image Version to be created per region. This property is updatable. 14138 RegionalReplicaCount *int32 `json:"regionalReplicaCount,omitempty"` 14139 // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' 14140 StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` 14141 Encryption *EncryptionImages `json:"encryption,omitempty"` 14142} 14143 14144// TerminateNotificationProfile ... 14145type TerminateNotificationProfile struct { 14146 // 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) 14147 NotBeforeTimeout *string `json:"notBeforeTimeout,omitempty"` 14148 // Enable - Specifies whether the Terminate Scheduled event is enabled or disabled. 14149 Enable *bool `json:"enable,omitempty"` 14150} 14151 14152// ThrottledRequestsInput api request input for LogAnalytics getThrottledRequests Api. 14153type ThrottledRequestsInput struct { 14154 // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. 14155 BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` 14156 // FromTime - From time of the query 14157 FromTime *date.Time `json:"fromTime,omitempty"` 14158 // ToTime - To time of the query 14159 ToTime *date.Time `json:"toTime,omitempty"` 14160 // GroupByThrottlePolicy - Group query result by Throttle Policy applied. 14161 GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` 14162 // GroupByOperationName - Group query result by Operation Name. 14163 GroupByOperationName *bool `json:"groupByOperationName,omitempty"` 14164 // GroupByResourceName - Group query result by Resource Name. 14165 GroupByResourceName *bool `json:"groupByResourceName,omitempty"` 14166 // GroupByClientApplicationID - Group query result by Client Application ID. 14167 GroupByClientApplicationID *bool `json:"groupByClientApplicationId,omitempty"` 14168 // GroupByUserAgent - Group query result by User Agent. 14169 GroupByUserAgent *bool `json:"groupByUserAgent,omitempty"` 14170} 14171 14172// UefiSettings specifies the security settings like secure boot and vTPM used while creating the virtual 14173// machine. <br><br>Minimum api-version: 2020-12-01 14174type UefiSettings struct { 14175 // SecureBootEnabled - Specifies whether secure boot should be enabled on the virtual machine. <br><br>Minimum api-version: 2020-12-01 14176 SecureBootEnabled *bool `json:"secureBootEnabled,omitempty"` 14177 // VTpmEnabled - Specifies whether vTPM should be enabled on the virtual machine. <br><br>Minimum api-version: 2020-12-01 14178 VTpmEnabled *bool `json:"vTpmEnabled,omitempty"` 14179} 14180 14181// UpdateDomain defines an update domain for the cloud service. 14182type UpdateDomain struct { 14183 autorest.Response `json:"-"` 14184 // ID - READ-ONLY; Resource Id 14185 ID *string `json:"id,omitempty"` 14186 // Name - READ-ONLY; Resource Name 14187 Name *string `json:"name,omitempty"` 14188} 14189 14190// MarshalJSON is the custom marshaler for UpdateDomain. 14191func (ud UpdateDomain) MarshalJSON() ([]byte, error) { 14192 objectMap := make(map[string]interface{}) 14193 return json.Marshal(objectMap) 14194} 14195 14196// UpdateDomainListResult ... 14197type UpdateDomainListResult struct { 14198 autorest.Response `json:"-"` 14199 Value *[]UpdateDomain `json:"value,omitempty"` 14200 NextLink *string `json:"nextLink,omitempty"` 14201} 14202 14203// UpdateDomainListResultIterator provides access to a complete listing of UpdateDomain values. 14204type UpdateDomainListResultIterator struct { 14205 i int 14206 page UpdateDomainListResultPage 14207} 14208 14209// NextWithContext advances to the next value. If there was an error making 14210// the request the iterator does not advance and the error is returned. 14211func (iter *UpdateDomainListResultIterator) NextWithContext(ctx context.Context) (err error) { 14212 if tracing.IsEnabled() { 14213 ctx = tracing.StartSpan(ctx, fqdn+"/UpdateDomainListResultIterator.NextWithContext") 14214 defer func() { 14215 sc := -1 14216 if iter.Response().Response.Response != nil { 14217 sc = iter.Response().Response.Response.StatusCode 14218 } 14219 tracing.EndSpan(ctx, sc, err) 14220 }() 14221 } 14222 iter.i++ 14223 if iter.i < len(iter.page.Values()) { 14224 return nil 14225 } 14226 err = iter.page.NextWithContext(ctx) 14227 if err != nil { 14228 iter.i-- 14229 return err 14230 } 14231 iter.i = 0 14232 return nil 14233} 14234 14235// Next advances to the next value. If there was an error making 14236// the request the iterator does not advance and the error is returned. 14237// Deprecated: Use NextWithContext() instead. 14238func (iter *UpdateDomainListResultIterator) Next() error { 14239 return iter.NextWithContext(context.Background()) 14240} 14241 14242// NotDone returns true if the enumeration should be started or is not yet complete. 14243func (iter UpdateDomainListResultIterator) NotDone() bool { 14244 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 14245} 14246 14247// Response returns the raw server response from the last page request. 14248func (iter UpdateDomainListResultIterator) Response() UpdateDomainListResult { 14249 return iter.page.Response() 14250} 14251 14252// Value returns the current value or a zero-initialized value if the 14253// iterator has advanced beyond the end of the collection. 14254func (iter UpdateDomainListResultIterator) Value() UpdateDomain { 14255 if !iter.page.NotDone() { 14256 return UpdateDomain{} 14257 } 14258 return iter.page.Values()[iter.i] 14259} 14260 14261// Creates a new instance of the UpdateDomainListResultIterator type. 14262func NewUpdateDomainListResultIterator(page UpdateDomainListResultPage) UpdateDomainListResultIterator { 14263 return UpdateDomainListResultIterator{page: page} 14264} 14265 14266// IsEmpty returns true if the ListResult contains no values. 14267func (udlr UpdateDomainListResult) IsEmpty() bool { 14268 return udlr.Value == nil || len(*udlr.Value) == 0 14269} 14270 14271// hasNextLink returns true if the NextLink is not empty. 14272func (udlr UpdateDomainListResult) hasNextLink() bool { 14273 return udlr.NextLink != nil && len(*udlr.NextLink) != 0 14274} 14275 14276// updateDomainListResultPreparer prepares a request to retrieve the next set of results. 14277// It returns nil if no more results exist. 14278func (udlr UpdateDomainListResult) updateDomainListResultPreparer(ctx context.Context) (*http.Request, error) { 14279 if !udlr.hasNextLink() { 14280 return nil, nil 14281 } 14282 return autorest.Prepare((&http.Request{}).WithContext(ctx), 14283 autorest.AsJSON(), 14284 autorest.AsGet(), 14285 autorest.WithBaseURL(to.String(udlr.NextLink))) 14286} 14287 14288// UpdateDomainListResultPage contains a page of UpdateDomain values. 14289type UpdateDomainListResultPage struct { 14290 fn func(context.Context, UpdateDomainListResult) (UpdateDomainListResult, error) 14291 udlr UpdateDomainListResult 14292} 14293 14294// NextWithContext advances to the next page of values. If there was an error making 14295// the request the page does not advance and the error is returned. 14296func (page *UpdateDomainListResultPage) NextWithContext(ctx context.Context) (err error) { 14297 if tracing.IsEnabled() { 14298 ctx = tracing.StartSpan(ctx, fqdn+"/UpdateDomainListResultPage.NextWithContext") 14299 defer func() { 14300 sc := -1 14301 if page.Response().Response.Response != nil { 14302 sc = page.Response().Response.Response.StatusCode 14303 } 14304 tracing.EndSpan(ctx, sc, err) 14305 }() 14306 } 14307 for { 14308 next, err := page.fn(ctx, page.udlr) 14309 if err != nil { 14310 return err 14311 } 14312 page.udlr = next 14313 if !next.hasNextLink() || !next.IsEmpty() { 14314 break 14315 } 14316 } 14317 return nil 14318} 14319 14320// Next advances to the next page of values. If there was an error making 14321// the request the page does not advance and the error is returned. 14322// Deprecated: Use NextWithContext() instead. 14323func (page *UpdateDomainListResultPage) Next() error { 14324 return page.NextWithContext(context.Background()) 14325} 14326 14327// NotDone returns true if the page enumeration should be started or is not yet complete. 14328func (page UpdateDomainListResultPage) NotDone() bool { 14329 return !page.udlr.IsEmpty() 14330} 14331 14332// Response returns the raw server response from the last page request. 14333func (page UpdateDomainListResultPage) Response() UpdateDomainListResult { 14334 return page.udlr 14335} 14336 14337// Values returns the slice of values for the current page or nil if there are no values. 14338func (page UpdateDomainListResultPage) Values() []UpdateDomain { 14339 if page.udlr.IsEmpty() { 14340 return nil 14341 } 14342 return *page.udlr.Value 14343} 14344 14345// Creates a new instance of the UpdateDomainListResultPage type. 14346func NewUpdateDomainListResultPage(cur UpdateDomainListResult, getNextPage func(context.Context, UpdateDomainListResult) (UpdateDomainListResult, error)) UpdateDomainListResultPage { 14347 return UpdateDomainListResultPage{ 14348 fn: getNextPage, 14349 udlr: cur, 14350 } 14351} 14352 14353// UpdateResource the Update Resource model definition. 14354type UpdateResource struct { 14355 // Tags - Resource tags 14356 Tags map[string]*string `json:"tags"` 14357} 14358 14359// MarshalJSON is the custom marshaler for UpdateResource. 14360func (ur UpdateResource) MarshalJSON() ([]byte, error) { 14361 objectMap := make(map[string]interface{}) 14362 if ur.Tags != nil { 14363 objectMap["tags"] = ur.Tags 14364 } 14365 return json.Marshal(objectMap) 14366} 14367 14368// UpdateResourceDefinition the Update Resource model definition. 14369type UpdateResourceDefinition struct { 14370 // ID - READ-ONLY; Resource Id 14371 ID *string `json:"id,omitempty"` 14372 // Name - READ-ONLY; Resource name 14373 Name *string `json:"name,omitempty"` 14374 // Type - READ-ONLY; Resource type 14375 Type *string `json:"type,omitempty"` 14376 // Tags - Resource tags 14377 Tags map[string]*string `json:"tags"` 14378} 14379 14380// MarshalJSON is the custom marshaler for UpdateResourceDefinition. 14381func (urd UpdateResourceDefinition) MarshalJSON() ([]byte, error) { 14382 objectMap := make(map[string]interface{}) 14383 if urd.Tags != nil { 14384 objectMap["tags"] = urd.Tags 14385 } 14386 return json.Marshal(objectMap) 14387} 14388 14389// UpgradeOperationHistoricalStatusInfo virtual Machine Scale Set OS Upgrade History operation response. 14390type UpgradeOperationHistoricalStatusInfo struct { 14391 // Properties - READ-ONLY; Information about the properties of the upgrade operation. 14392 Properties *UpgradeOperationHistoricalStatusInfoProperties `json:"properties,omitempty"` 14393 // Type - READ-ONLY; Resource type 14394 Type *string `json:"type,omitempty"` 14395 // Location - READ-ONLY; Resource location 14396 Location *string `json:"location,omitempty"` 14397} 14398 14399// MarshalJSON is the custom marshaler for UpgradeOperationHistoricalStatusInfo. 14400func (uohsi UpgradeOperationHistoricalStatusInfo) MarshalJSON() ([]byte, error) { 14401 objectMap := make(map[string]interface{}) 14402 return json.Marshal(objectMap) 14403} 14404 14405// UpgradeOperationHistoricalStatusInfoProperties describes each OS upgrade on the Virtual Machine Scale 14406// Set. 14407type UpgradeOperationHistoricalStatusInfoProperties struct { 14408 // RunningStatus - READ-ONLY; Information about the overall status of the upgrade operation. 14409 RunningStatus *UpgradeOperationHistoryStatus `json:"runningStatus,omitempty"` 14410 // Progress - READ-ONLY; Counts of the VMs in each state. 14411 Progress *RollingUpgradeProgressInfo `json:"progress,omitempty"` 14412 // Error - READ-ONLY; Error Details for this upgrade if there are any. 14413 Error *APIError `json:"error,omitempty"` 14414 // StartedBy - READ-ONLY; Invoker of the Upgrade Operation. Possible values include: 'UpgradeOperationInvokerUnknown', 'UpgradeOperationInvokerUser', 'UpgradeOperationInvokerPlatform' 14415 StartedBy UpgradeOperationInvoker `json:"startedBy,omitempty"` 14416 // TargetImageReference - READ-ONLY; Image Reference details 14417 TargetImageReference *ImageReference `json:"targetImageReference,omitempty"` 14418 // RollbackInfo - READ-ONLY; Information about OS rollback if performed 14419 RollbackInfo *RollbackStatusInfo `json:"rollbackInfo,omitempty"` 14420} 14421 14422// MarshalJSON is the custom marshaler for UpgradeOperationHistoricalStatusInfoProperties. 14423func (uohsip UpgradeOperationHistoricalStatusInfoProperties) MarshalJSON() ([]byte, error) { 14424 objectMap := make(map[string]interface{}) 14425 return json.Marshal(objectMap) 14426} 14427 14428// UpgradeOperationHistoryStatus information about the current running state of the overall upgrade. 14429type UpgradeOperationHistoryStatus struct { 14430 // Code - READ-ONLY; Code indicating the current status of the upgrade. Possible values include: 'UpgradeStateRollingForward', 'UpgradeStateCancelled', 'UpgradeStateCompleted', 'UpgradeStateFaulted' 14431 Code UpgradeState `json:"code,omitempty"` 14432 // StartTime - READ-ONLY; Start time of the upgrade. 14433 StartTime *date.Time `json:"startTime,omitempty"` 14434 // EndTime - READ-ONLY; End time of the upgrade. 14435 EndTime *date.Time `json:"endTime,omitempty"` 14436} 14437 14438// MarshalJSON is the custom marshaler for UpgradeOperationHistoryStatus. 14439func (uohs UpgradeOperationHistoryStatus) MarshalJSON() ([]byte, error) { 14440 objectMap := make(map[string]interface{}) 14441 return json.Marshal(objectMap) 14442} 14443 14444// UpgradePolicy describes an upgrade policy - automatic, manual, or rolling. 14445type UpgradePolicy struct { 14446 // 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' 14447 Mode UpgradeMode `json:"mode,omitempty"` 14448 // RollingUpgradePolicy - The configuration parameters used while performing a rolling upgrade. 14449 RollingUpgradePolicy *RollingUpgradePolicy `json:"rollingUpgradePolicy,omitempty"` 14450 // AutomaticOSUpgradePolicy - Configuration parameters used for performing automatic OS Upgrade. 14451 AutomaticOSUpgradePolicy *AutomaticOSUpgradePolicy `json:"automaticOSUpgradePolicy,omitempty"` 14452} 14453 14454// Usage describes Compute Resource Usage. 14455type Usage struct { 14456 // Unit - An enum describing the unit of usage measurement. 14457 Unit *string `json:"unit,omitempty"` 14458 // CurrentValue - The current usage of the resource. 14459 CurrentValue *int32 `json:"currentValue,omitempty"` 14460 // Limit - The maximum permitted usage of the resource. 14461 Limit *int64 `json:"limit,omitempty"` 14462 // Name - The name of the type of usage. 14463 Name *UsageName `json:"name,omitempty"` 14464} 14465 14466// UsageName the Usage Names. 14467type UsageName struct { 14468 // Value - The name of the resource. 14469 Value *string `json:"value,omitempty"` 14470 // LocalizedValue - The localized name of the resource. 14471 LocalizedValue *string `json:"localizedValue,omitempty"` 14472} 14473 14474// UserArtifactManage ... 14475type UserArtifactManage struct { 14476 // Install - Required. The path and arguments to install the gallery application. This is limited to 4096 characters. 14477 Install *string `json:"install,omitempty"` 14478 // Remove - Required. The path and arguments to remove the gallery application. This is limited to 4096 characters. 14479 Remove *string `json:"remove,omitempty"` 14480 // Update - Optional. The path and arguments to update the gallery application. If not present, then update operation will invoke remove command on the previous version and install command on the current version of the gallery application. This is limited to 4096 characters. 14481 Update *string `json:"update,omitempty"` 14482} 14483 14484// UserArtifactSource the source image from which the Image Version is going to be created. 14485type UserArtifactSource struct { 14486 // MediaLink - Required. The mediaLink of the artifact, must be a readable storage page blob. 14487 MediaLink *string `json:"mediaLink,omitempty"` 14488 // DefaultConfigurationLink - Optional. The defaultConfigurationLink of the artifact, must be a readable storage page blob. 14489 DefaultConfigurationLink *string `json:"defaultConfigurationLink,omitempty"` 14490} 14491 14492// VaultCertificate describes a single certificate reference in a Key Vault, and where the certificate 14493// should reside on the VM. 14494type VaultCertificate struct { 14495 // 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>} 14496 CertificateURL *string `json:"certificateUrl,omitempty"` 14497 // 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. 14498 CertificateStore *string `json:"certificateStore,omitempty"` 14499} 14500 14501// VaultSecretGroup describes a set of certificates which are all in the same Key Vault. 14502type VaultSecretGroup struct { 14503 // SourceVault - The relative URL of the Key Vault containing all of the certificates in VaultCertificates. 14504 SourceVault *SubResource `json:"sourceVault,omitempty"` 14505 // VaultCertificates - The list of key vault references in SourceVault which contain certificates. 14506 VaultCertificates *[]VaultCertificate `json:"vaultCertificates,omitempty"` 14507} 14508 14509// VirtualHardDisk describes the uri of a disk. 14510type VirtualHardDisk struct { 14511 // URI - Specifies the virtual hard disk's uri. 14512 URI *string `json:"uri,omitempty"` 14513} 14514 14515// VirtualMachine describes a Virtual Machine. 14516type VirtualMachine struct { 14517 autorest.Response `json:"-"` 14518 // 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**. 14519 Plan *Plan `json:"plan,omitempty"` 14520 *VirtualMachineProperties `json:"properties,omitempty"` 14521 // Resources - READ-ONLY; The virtual machine child extension resources. 14522 Resources *[]VirtualMachineExtension `json:"resources,omitempty"` 14523 // Identity - The identity of the virtual machine, if configured. 14524 Identity *VirtualMachineIdentity `json:"identity,omitempty"` 14525 // Zones - The virtual machine zones. 14526 Zones *[]string `json:"zones,omitempty"` 14527 // ExtendedLocation - The extended location of the Virtual Machine. 14528 ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` 14529 // ID - READ-ONLY; Resource Id 14530 ID *string `json:"id,omitempty"` 14531 // Name - READ-ONLY; Resource name 14532 Name *string `json:"name,omitempty"` 14533 // Type - READ-ONLY; Resource type 14534 Type *string `json:"type,omitempty"` 14535 // Location - Resource location 14536 Location *string `json:"location,omitempty"` 14537 // Tags - Resource tags 14538 Tags map[string]*string `json:"tags"` 14539} 14540 14541// MarshalJSON is the custom marshaler for VirtualMachine. 14542func (VM VirtualMachine) MarshalJSON() ([]byte, error) { 14543 objectMap := make(map[string]interface{}) 14544 if VM.Plan != nil { 14545 objectMap["plan"] = VM.Plan 14546 } 14547 if VM.VirtualMachineProperties != nil { 14548 objectMap["properties"] = VM.VirtualMachineProperties 14549 } 14550 if VM.Identity != nil { 14551 objectMap["identity"] = VM.Identity 14552 } 14553 if VM.Zones != nil { 14554 objectMap["zones"] = VM.Zones 14555 } 14556 if VM.ExtendedLocation != nil { 14557 objectMap["extendedLocation"] = VM.ExtendedLocation 14558 } 14559 if VM.Location != nil { 14560 objectMap["location"] = VM.Location 14561 } 14562 if VM.Tags != nil { 14563 objectMap["tags"] = VM.Tags 14564 } 14565 return json.Marshal(objectMap) 14566} 14567 14568// UnmarshalJSON is the custom unmarshaler for VirtualMachine struct. 14569func (VM *VirtualMachine) UnmarshalJSON(body []byte) error { 14570 var m map[string]*json.RawMessage 14571 err := json.Unmarshal(body, &m) 14572 if err != nil { 14573 return err 14574 } 14575 for k, v := range m { 14576 switch k { 14577 case "plan": 14578 if v != nil { 14579 var plan Plan 14580 err = json.Unmarshal(*v, &plan) 14581 if err != nil { 14582 return err 14583 } 14584 VM.Plan = &plan 14585 } 14586 case "properties": 14587 if v != nil { 14588 var virtualMachineProperties VirtualMachineProperties 14589 err = json.Unmarshal(*v, &virtualMachineProperties) 14590 if err != nil { 14591 return err 14592 } 14593 VM.VirtualMachineProperties = &virtualMachineProperties 14594 } 14595 case "resources": 14596 if v != nil { 14597 var resources []VirtualMachineExtension 14598 err = json.Unmarshal(*v, &resources) 14599 if err != nil { 14600 return err 14601 } 14602 VM.Resources = &resources 14603 } 14604 case "identity": 14605 if v != nil { 14606 var identity VirtualMachineIdentity 14607 err = json.Unmarshal(*v, &identity) 14608 if err != nil { 14609 return err 14610 } 14611 VM.Identity = &identity 14612 } 14613 case "zones": 14614 if v != nil { 14615 var zones []string 14616 err = json.Unmarshal(*v, &zones) 14617 if err != nil { 14618 return err 14619 } 14620 VM.Zones = &zones 14621 } 14622 case "extendedLocation": 14623 if v != nil { 14624 var extendedLocation ExtendedLocation 14625 err = json.Unmarshal(*v, &extendedLocation) 14626 if err != nil { 14627 return err 14628 } 14629 VM.ExtendedLocation = &extendedLocation 14630 } 14631 case "id": 14632 if v != nil { 14633 var ID string 14634 err = json.Unmarshal(*v, &ID) 14635 if err != nil { 14636 return err 14637 } 14638 VM.ID = &ID 14639 } 14640 case "name": 14641 if v != nil { 14642 var name string 14643 err = json.Unmarshal(*v, &name) 14644 if err != nil { 14645 return err 14646 } 14647 VM.Name = &name 14648 } 14649 case "type": 14650 if v != nil { 14651 var typeVar string 14652 err = json.Unmarshal(*v, &typeVar) 14653 if err != nil { 14654 return err 14655 } 14656 VM.Type = &typeVar 14657 } 14658 case "location": 14659 if v != nil { 14660 var location string 14661 err = json.Unmarshal(*v, &location) 14662 if err != nil { 14663 return err 14664 } 14665 VM.Location = &location 14666 } 14667 case "tags": 14668 if v != nil { 14669 var tags map[string]*string 14670 err = json.Unmarshal(*v, &tags) 14671 if err != nil { 14672 return err 14673 } 14674 VM.Tags = tags 14675 } 14676 } 14677 } 14678 14679 return nil 14680} 14681 14682// VirtualMachineAgentInstanceView the instance view of the VM Agent running on the virtual machine. 14683type VirtualMachineAgentInstanceView struct { 14684 // VMAgentVersion - The VM Agent full version. 14685 VMAgentVersion *string `json:"vmAgentVersion,omitempty"` 14686 // ExtensionHandlers - The virtual machine extension handler instance view. 14687 ExtensionHandlers *[]VirtualMachineExtensionHandlerInstanceView `json:"extensionHandlers,omitempty"` 14688 // Statuses - The resource status information. 14689 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 14690} 14691 14692// VirtualMachineAssessPatchesResult describes the properties of an AssessPatches result. 14693type VirtualMachineAssessPatchesResult struct { 14694 autorest.Response `json:"-"` 14695 // 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 "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings.". Possible values include: 'PatchOperationStatusUnknown', 'PatchOperationStatusInProgress', 'PatchOperationStatusFailed', 'PatchOperationStatusSucceeded', 'PatchOperationStatusCompletedWithWarnings' 14696 Status PatchOperationStatus `json:"status,omitempty"` 14697 // AssessmentActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. 14698 AssessmentActivityID *string `json:"assessmentActivityId,omitempty"` 14699 // 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. 14700 RebootPending *bool `json:"rebootPending,omitempty"` 14701 // CriticalAndSecurityPatchCount - READ-ONLY; The number of critical or security patches that have been detected as available and not yet installed. 14702 CriticalAndSecurityPatchCount *int32 `json:"criticalAndSecurityPatchCount,omitempty"` 14703 // OtherPatchCount - READ-ONLY; The number of all available patches excluding critical and security. 14704 OtherPatchCount *int32 `json:"otherPatchCount,omitempty"` 14705 // StartDateTime - READ-ONLY; The UTC timestamp when the operation began. 14706 StartDateTime *date.Time `json:"startDateTime,omitempty"` 14707 // AvailablePatches - READ-ONLY; The list of patches that have been detected as available for installation. 14708 AvailablePatches *[]VirtualMachineSoftwarePatchProperties `json:"availablePatches,omitempty"` 14709 // Error - READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. 14710 Error *APIError `json:"error,omitempty"` 14711} 14712 14713// MarshalJSON is the custom marshaler for VirtualMachineAssessPatchesResult. 14714func (vmapr VirtualMachineAssessPatchesResult) MarshalJSON() ([]byte, error) { 14715 objectMap := make(map[string]interface{}) 14716 return json.Marshal(objectMap) 14717} 14718 14719// VirtualMachineCaptureParameters capture Virtual Machine parameters. 14720type VirtualMachineCaptureParameters struct { 14721 // VhdPrefix - The captured virtual hard disk's name prefix. 14722 VhdPrefix *string `json:"vhdPrefix,omitempty"` 14723 // DestinationContainerName - The destination container name. 14724 DestinationContainerName *string `json:"destinationContainerName,omitempty"` 14725 // OverwriteVhds - Specifies whether to overwrite the destination virtual hard disk, in case of conflict. 14726 OverwriteVhds *bool `json:"overwriteVhds,omitempty"` 14727} 14728 14729// VirtualMachineCaptureResult output of virtual machine capture operation. 14730type VirtualMachineCaptureResult struct { 14731 autorest.Response `json:"-"` 14732 // Schema - READ-ONLY; the schema of the captured virtual machine 14733 Schema *string `json:"$schema,omitempty"` 14734 // ContentVersion - READ-ONLY; the version of the content 14735 ContentVersion *string `json:"contentVersion,omitempty"` 14736 // Parameters - READ-ONLY; parameters of the captured virtual machine 14737 Parameters interface{} `json:"parameters,omitempty"` 14738 // Resources - READ-ONLY; a list of resource items of the captured virtual machine 14739 Resources *[]interface{} `json:"resources,omitempty"` 14740 // ID - Resource Id 14741 ID *string `json:"id,omitempty"` 14742} 14743 14744// MarshalJSON is the custom marshaler for VirtualMachineCaptureResult. 14745func (vmcr VirtualMachineCaptureResult) MarshalJSON() ([]byte, error) { 14746 objectMap := make(map[string]interface{}) 14747 if vmcr.ID != nil { 14748 objectMap["id"] = vmcr.ID 14749 } 14750 return json.Marshal(objectMap) 14751} 14752 14753// VirtualMachineExtension describes a Virtual Machine Extension. 14754type VirtualMachineExtension struct { 14755 autorest.Response `json:"-"` 14756 *VirtualMachineExtensionProperties `json:"properties,omitempty"` 14757 // ID - READ-ONLY; Resource Id 14758 ID *string `json:"id,omitempty"` 14759 // Name - READ-ONLY; Resource name 14760 Name *string `json:"name,omitempty"` 14761 // Type - READ-ONLY; Resource type 14762 Type *string `json:"type,omitempty"` 14763 // Location - Resource location 14764 Location *string `json:"location,omitempty"` 14765 // Tags - Resource tags 14766 Tags map[string]*string `json:"tags"` 14767} 14768 14769// MarshalJSON is the custom marshaler for VirtualMachineExtension. 14770func (vme VirtualMachineExtension) MarshalJSON() ([]byte, error) { 14771 objectMap := make(map[string]interface{}) 14772 if vme.VirtualMachineExtensionProperties != nil { 14773 objectMap["properties"] = vme.VirtualMachineExtensionProperties 14774 } 14775 if vme.Location != nil { 14776 objectMap["location"] = vme.Location 14777 } 14778 if vme.Tags != nil { 14779 objectMap["tags"] = vme.Tags 14780 } 14781 return json.Marshal(objectMap) 14782} 14783 14784// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtension struct. 14785func (vme *VirtualMachineExtension) UnmarshalJSON(body []byte) error { 14786 var m map[string]*json.RawMessage 14787 err := json.Unmarshal(body, &m) 14788 if err != nil { 14789 return err 14790 } 14791 for k, v := range m { 14792 switch k { 14793 case "properties": 14794 if v != nil { 14795 var virtualMachineExtensionProperties VirtualMachineExtensionProperties 14796 err = json.Unmarshal(*v, &virtualMachineExtensionProperties) 14797 if err != nil { 14798 return err 14799 } 14800 vme.VirtualMachineExtensionProperties = &virtualMachineExtensionProperties 14801 } 14802 case "id": 14803 if v != nil { 14804 var ID string 14805 err = json.Unmarshal(*v, &ID) 14806 if err != nil { 14807 return err 14808 } 14809 vme.ID = &ID 14810 } 14811 case "name": 14812 if v != nil { 14813 var name string 14814 err = json.Unmarshal(*v, &name) 14815 if err != nil { 14816 return err 14817 } 14818 vme.Name = &name 14819 } 14820 case "type": 14821 if v != nil { 14822 var typeVar string 14823 err = json.Unmarshal(*v, &typeVar) 14824 if err != nil { 14825 return err 14826 } 14827 vme.Type = &typeVar 14828 } 14829 case "location": 14830 if v != nil { 14831 var location string 14832 err = json.Unmarshal(*v, &location) 14833 if err != nil { 14834 return err 14835 } 14836 vme.Location = &location 14837 } 14838 case "tags": 14839 if v != nil { 14840 var tags map[string]*string 14841 err = json.Unmarshal(*v, &tags) 14842 if err != nil { 14843 return err 14844 } 14845 vme.Tags = tags 14846 } 14847 } 14848 } 14849 14850 return nil 14851} 14852 14853// VirtualMachineExtensionHandlerInstanceView the instance view of a virtual machine extension handler. 14854type VirtualMachineExtensionHandlerInstanceView struct { 14855 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 14856 Type *string `json:"type,omitempty"` 14857 // TypeHandlerVersion - Specifies the version of the script handler. 14858 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 14859 // Status - The extension handler status. 14860 Status *InstanceViewStatus `json:"status,omitempty"` 14861} 14862 14863// VirtualMachineExtensionImage describes a Virtual Machine Extension Image. 14864type VirtualMachineExtensionImage struct { 14865 autorest.Response `json:"-"` 14866 *VirtualMachineExtensionImageProperties `json:"properties,omitempty"` 14867 // ID - READ-ONLY; Resource Id 14868 ID *string `json:"id,omitempty"` 14869 // Name - READ-ONLY; Resource name 14870 Name *string `json:"name,omitempty"` 14871 // Type - READ-ONLY; Resource type 14872 Type *string `json:"type,omitempty"` 14873 // Location - Resource location 14874 Location *string `json:"location,omitempty"` 14875 // Tags - Resource tags 14876 Tags map[string]*string `json:"tags"` 14877} 14878 14879// MarshalJSON is the custom marshaler for VirtualMachineExtensionImage. 14880func (vmei VirtualMachineExtensionImage) MarshalJSON() ([]byte, error) { 14881 objectMap := make(map[string]interface{}) 14882 if vmei.VirtualMachineExtensionImageProperties != nil { 14883 objectMap["properties"] = vmei.VirtualMachineExtensionImageProperties 14884 } 14885 if vmei.Location != nil { 14886 objectMap["location"] = vmei.Location 14887 } 14888 if vmei.Tags != nil { 14889 objectMap["tags"] = vmei.Tags 14890 } 14891 return json.Marshal(objectMap) 14892} 14893 14894// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtensionImage struct. 14895func (vmei *VirtualMachineExtensionImage) UnmarshalJSON(body []byte) error { 14896 var m map[string]*json.RawMessage 14897 err := json.Unmarshal(body, &m) 14898 if err != nil { 14899 return err 14900 } 14901 for k, v := range m { 14902 switch k { 14903 case "properties": 14904 if v != nil { 14905 var virtualMachineExtensionImageProperties VirtualMachineExtensionImageProperties 14906 err = json.Unmarshal(*v, &virtualMachineExtensionImageProperties) 14907 if err != nil { 14908 return err 14909 } 14910 vmei.VirtualMachineExtensionImageProperties = &virtualMachineExtensionImageProperties 14911 } 14912 case "id": 14913 if v != nil { 14914 var ID string 14915 err = json.Unmarshal(*v, &ID) 14916 if err != nil { 14917 return err 14918 } 14919 vmei.ID = &ID 14920 } 14921 case "name": 14922 if v != nil { 14923 var name string 14924 err = json.Unmarshal(*v, &name) 14925 if err != nil { 14926 return err 14927 } 14928 vmei.Name = &name 14929 } 14930 case "type": 14931 if v != nil { 14932 var typeVar string 14933 err = json.Unmarshal(*v, &typeVar) 14934 if err != nil { 14935 return err 14936 } 14937 vmei.Type = &typeVar 14938 } 14939 case "location": 14940 if v != nil { 14941 var location string 14942 err = json.Unmarshal(*v, &location) 14943 if err != nil { 14944 return err 14945 } 14946 vmei.Location = &location 14947 } 14948 case "tags": 14949 if v != nil { 14950 var tags map[string]*string 14951 err = json.Unmarshal(*v, &tags) 14952 if err != nil { 14953 return err 14954 } 14955 vmei.Tags = tags 14956 } 14957 } 14958 } 14959 14960 return nil 14961} 14962 14963// VirtualMachineExtensionImageProperties describes the properties of a Virtual Machine Extension Image. 14964type VirtualMachineExtensionImageProperties struct { 14965 // OperatingSystem - The operating system this extension supports. 14966 OperatingSystem *string `json:"operatingSystem,omitempty"` 14967 // ComputeRole - The type of role (IaaS or PaaS) this extension supports. 14968 ComputeRole *string `json:"computeRole,omitempty"` 14969 // HandlerSchema - The schema defined by publisher, where extension consumers should provide settings in a matching schema. 14970 HandlerSchema *string `json:"handlerSchema,omitempty"` 14971 // 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. 14972 VMScaleSetEnabled *bool `json:"vmScaleSetEnabled,omitempty"` 14973 // SupportsMultipleExtensions - Whether the handler can support multiple extensions. 14974 SupportsMultipleExtensions *bool `json:"supportsMultipleExtensions,omitempty"` 14975} 14976 14977// VirtualMachineExtensionInstanceView the instance view of a virtual machine extension. 14978type VirtualMachineExtensionInstanceView struct { 14979 // Name - The virtual machine extension name. 14980 Name *string `json:"name,omitempty"` 14981 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 14982 Type *string `json:"type,omitempty"` 14983 // TypeHandlerVersion - Specifies the version of the script handler. 14984 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 14985 // Substatuses - The resource status information. 14986 Substatuses *[]InstanceViewStatus `json:"substatuses,omitempty"` 14987 // Statuses - The resource status information. 14988 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 14989} 14990 14991// VirtualMachineExtensionProperties describes the properties of a Virtual Machine Extension. 14992type VirtualMachineExtensionProperties struct { 14993 // ForceUpdateTag - How the extension handler should be forced to update even if the extension configuration has not changed. 14994 ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` 14995 // Publisher - The name of the extension handler publisher. 14996 Publisher *string `json:"publisher,omitempty"` 14997 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 14998 Type *string `json:"type,omitempty"` 14999 // TypeHandlerVersion - Specifies the version of the script handler. 15000 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 15001 // 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. 15002 AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` 15003 // EnableAutomaticUpgrade - Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. 15004 EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` 15005 // Settings - Json formatted public settings for the extension. 15006 Settings interface{} `json:"settings,omitempty"` 15007 // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. 15008 ProtectedSettings interface{} `json:"protectedSettings,omitempty"` 15009 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 15010 ProvisioningState *string `json:"provisioningState,omitempty"` 15011 // InstanceView - The virtual machine extension instance view. 15012 InstanceView *VirtualMachineExtensionInstanceView `json:"instanceView,omitempty"` 15013} 15014 15015// MarshalJSON is the custom marshaler for VirtualMachineExtensionProperties. 15016func (vmep VirtualMachineExtensionProperties) MarshalJSON() ([]byte, error) { 15017 objectMap := make(map[string]interface{}) 15018 if vmep.ForceUpdateTag != nil { 15019 objectMap["forceUpdateTag"] = vmep.ForceUpdateTag 15020 } 15021 if vmep.Publisher != nil { 15022 objectMap["publisher"] = vmep.Publisher 15023 } 15024 if vmep.Type != nil { 15025 objectMap["type"] = vmep.Type 15026 } 15027 if vmep.TypeHandlerVersion != nil { 15028 objectMap["typeHandlerVersion"] = vmep.TypeHandlerVersion 15029 } 15030 if vmep.AutoUpgradeMinorVersion != nil { 15031 objectMap["autoUpgradeMinorVersion"] = vmep.AutoUpgradeMinorVersion 15032 } 15033 if vmep.EnableAutomaticUpgrade != nil { 15034 objectMap["enableAutomaticUpgrade"] = vmep.EnableAutomaticUpgrade 15035 } 15036 if vmep.Settings != nil { 15037 objectMap["settings"] = vmep.Settings 15038 } 15039 if vmep.ProtectedSettings != nil { 15040 objectMap["protectedSettings"] = vmep.ProtectedSettings 15041 } 15042 if vmep.InstanceView != nil { 15043 objectMap["instanceView"] = vmep.InstanceView 15044 } 15045 return json.Marshal(objectMap) 15046} 15047 15048// VirtualMachineExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of 15049// a long-running operation. 15050type VirtualMachineExtensionsCreateOrUpdateFuture struct { 15051 azure.FutureAPI 15052 // Result returns the result of the asynchronous operation. 15053 // If the operation has not completed it will return an error. 15054 Result func(VirtualMachineExtensionsClient) (VirtualMachineExtension, error) 15055} 15056 15057// UnmarshalJSON is the custom unmarshaller for CreateFuture. 15058func (future *VirtualMachineExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 15059 var azFuture azure.Future 15060 if err := json.Unmarshal(body, &azFuture); err != nil { 15061 return err 15062 } 15063 future.FutureAPI = &azFuture 15064 future.Result = future.result 15065 return nil 15066} 15067 15068// result is the default implementation for VirtualMachineExtensionsCreateOrUpdateFuture.Result. 15069func (future *VirtualMachineExtensionsCreateOrUpdateFuture) result(client VirtualMachineExtensionsClient) (vme VirtualMachineExtension, err error) { 15070 var done bool 15071 done, err = future.DoneWithContext(context.Background(), client) 15072 if err != nil { 15073 err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 15074 return 15075 } 15076 if !done { 15077 vme.Response.Response = future.Response() 15078 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsCreateOrUpdateFuture") 15079 return 15080 } 15081 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 15082 if vme.Response.Response, err = future.GetResult(sender); err == nil && vme.Response.Response.StatusCode != http.StatusNoContent { 15083 vme, err = client.CreateOrUpdateResponder(vme.Response.Response) 15084 if err != nil { 15085 err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsCreateOrUpdateFuture", "Result", vme.Response.Response, "Failure responding to request") 15086 } 15087 } 15088 return 15089} 15090 15091// VirtualMachineExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of a 15092// long-running operation. 15093type VirtualMachineExtensionsDeleteFuture struct { 15094 azure.FutureAPI 15095 // Result returns the result of the asynchronous operation. 15096 // If the operation has not completed it will return an error. 15097 Result func(VirtualMachineExtensionsClient) (autorest.Response, error) 15098} 15099 15100// UnmarshalJSON is the custom unmarshaller for CreateFuture. 15101func (future *VirtualMachineExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { 15102 var azFuture azure.Future 15103 if err := json.Unmarshal(body, &azFuture); err != nil { 15104 return err 15105 } 15106 future.FutureAPI = &azFuture 15107 future.Result = future.result 15108 return nil 15109} 15110 15111// result is the default implementation for VirtualMachineExtensionsDeleteFuture.Result. 15112func (future *VirtualMachineExtensionsDeleteFuture) result(client VirtualMachineExtensionsClient) (ar autorest.Response, err error) { 15113 var done bool 15114 done, err = future.DoneWithContext(context.Background(), client) 15115 if err != nil { 15116 err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") 15117 return 15118 } 15119 if !done { 15120 ar.Response = future.Response() 15121 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsDeleteFuture") 15122 return 15123 } 15124 ar.Response = future.Response() 15125 return 15126} 15127 15128// VirtualMachineExtensionsListResult the List Extension operation response 15129type VirtualMachineExtensionsListResult struct { 15130 autorest.Response `json:"-"` 15131 // Value - The list of extensions 15132 Value *[]VirtualMachineExtension `json:"value,omitempty"` 15133} 15134 15135// VirtualMachineExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of a 15136// long-running operation. 15137type VirtualMachineExtensionsUpdateFuture struct { 15138 azure.FutureAPI 15139 // Result returns the result of the asynchronous operation. 15140 // If the operation has not completed it will return an error. 15141 Result func(VirtualMachineExtensionsClient) (VirtualMachineExtension, error) 15142} 15143 15144// UnmarshalJSON is the custom unmarshaller for CreateFuture. 15145func (future *VirtualMachineExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { 15146 var azFuture azure.Future 15147 if err := json.Unmarshal(body, &azFuture); err != nil { 15148 return err 15149 } 15150 future.FutureAPI = &azFuture 15151 future.Result = future.result 15152 return nil 15153} 15154 15155// result is the default implementation for VirtualMachineExtensionsUpdateFuture.Result. 15156func (future *VirtualMachineExtensionsUpdateFuture) result(client VirtualMachineExtensionsClient) (vme VirtualMachineExtension, err error) { 15157 var done bool 15158 done, err = future.DoneWithContext(context.Background(), client) 15159 if err != nil { 15160 err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsUpdateFuture", "Result", future.Response(), "Polling failure") 15161 return 15162 } 15163 if !done { 15164 vme.Response.Response = future.Response() 15165 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsUpdateFuture") 15166 return 15167 } 15168 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 15169 if vme.Response.Response, err = future.GetResult(sender); err == nil && vme.Response.Response.StatusCode != http.StatusNoContent { 15170 vme, err = client.UpdateResponder(vme.Response.Response) 15171 if err != nil { 15172 err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsUpdateFuture", "Result", vme.Response.Response, "Failure responding to request") 15173 } 15174 } 15175 return 15176} 15177 15178// VirtualMachineExtensionUpdate describes a Virtual Machine Extension. 15179type VirtualMachineExtensionUpdate struct { 15180 *VirtualMachineExtensionUpdateProperties `json:"properties,omitempty"` 15181 // Tags - Resource tags 15182 Tags map[string]*string `json:"tags"` 15183} 15184 15185// MarshalJSON is the custom marshaler for VirtualMachineExtensionUpdate. 15186func (vmeu VirtualMachineExtensionUpdate) MarshalJSON() ([]byte, error) { 15187 objectMap := make(map[string]interface{}) 15188 if vmeu.VirtualMachineExtensionUpdateProperties != nil { 15189 objectMap["properties"] = vmeu.VirtualMachineExtensionUpdateProperties 15190 } 15191 if vmeu.Tags != nil { 15192 objectMap["tags"] = vmeu.Tags 15193 } 15194 return json.Marshal(objectMap) 15195} 15196 15197// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtensionUpdate struct. 15198func (vmeu *VirtualMachineExtensionUpdate) UnmarshalJSON(body []byte) error { 15199 var m map[string]*json.RawMessage 15200 err := json.Unmarshal(body, &m) 15201 if err != nil { 15202 return err 15203 } 15204 for k, v := range m { 15205 switch k { 15206 case "properties": 15207 if v != nil { 15208 var virtualMachineExtensionUpdateProperties VirtualMachineExtensionUpdateProperties 15209 err = json.Unmarshal(*v, &virtualMachineExtensionUpdateProperties) 15210 if err != nil { 15211 return err 15212 } 15213 vmeu.VirtualMachineExtensionUpdateProperties = &virtualMachineExtensionUpdateProperties 15214 } 15215 case "tags": 15216 if v != nil { 15217 var tags map[string]*string 15218 err = json.Unmarshal(*v, &tags) 15219 if err != nil { 15220 return err 15221 } 15222 vmeu.Tags = tags 15223 } 15224 } 15225 } 15226 15227 return nil 15228} 15229 15230// VirtualMachineExtensionUpdateProperties describes the properties of a Virtual Machine Extension. 15231type VirtualMachineExtensionUpdateProperties struct { 15232 // ForceUpdateTag - How the extension handler should be forced to update even if the extension configuration has not changed. 15233 ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` 15234 // Publisher - The name of the extension handler publisher. 15235 Publisher *string `json:"publisher,omitempty"` 15236 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 15237 Type *string `json:"type,omitempty"` 15238 // TypeHandlerVersion - Specifies the version of the script handler. 15239 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 15240 // 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. 15241 AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` 15242 // EnableAutomaticUpgrade - Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. 15243 EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` 15244 // Settings - Json formatted public settings for the extension. 15245 Settings interface{} `json:"settings,omitempty"` 15246 // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. 15247 ProtectedSettings interface{} `json:"protectedSettings,omitempty"` 15248} 15249 15250// VirtualMachineHealthStatus the health status of the VM. 15251type VirtualMachineHealthStatus struct { 15252 // Status - READ-ONLY; The health status information for the VM. 15253 Status *InstanceViewStatus `json:"status,omitempty"` 15254} 15255 15256// MarshalJSON is the custom marshaler for VirtualMachineHealthStatus. 15257func (vmhs VirtualMachineHealthStatus) MarshalJSON() ([]byte, error) { 15258 objectMap := make(map[string]interface{}) 15259 return json.Marshal(objectMap) 15260} 15261 15262// VirtualMachineIdentity identity for the virtual machine. 15263type VirtualMachineIdentity struct { 15264 // PrincipalID - READ-ONLY; The principal id of virtual machine identity. This property will only be provided for a system assigned identity. 15265 PrincipalID *string `json:"principalId,omitempty"` 15266 // TenantID - READ-ONLY; The tenant id associated with the virtual machine. This property will only be provided for a system assigned identity. 15267 TenantID *string `json:"tenantId,omitempty"` 15268 // 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' 15269 Type ResourceIdentityType `json:"type,omitempty"` 15270 // 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}'. 15271 UserAssignedIdentities map[string]*VirtualMachineIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` 15272} 15273 15274// MarshalJSON is the custom marshaler for VirtualMachineIdentity. 15275func (vmi VirtualMachineIdentity) MarshalJSON() ([]byte, error) { 15276 objectMap := make(map[string]interface{}) 15277 if vmi.Type != "" { 15278 objectMap["type"] = vmi.Type 15279 } 15280 if vmi.UserAssignedIdentities != nil { 15281 objectMap["userAssignedIdentities"] = vmi.UserAssignedIdentities 15282 } 15283 return json.Marshal(objectMap) 15284} 15285 15286// VirtualMachineIdentityUserAssignedIdentitiesValue ... 15287type VirtualMachineIdentityUserAssignedIdentitiesValue struct { 15288 // PrincipalID - READ-ONLY; The principal id of user assigned identity. 15289 PrincipalID *string `json:"principalId,omitempty"` 15290 // ClientID - READ-ONLY; The client id of user assigned identity. 15291 ClientID *string `json:"clientId,omitempty"` 15292} 15293 15294// MarshalJSON is the custom marshaler for VirtualMachineIdentityUserAssignedIdentitiesValue. 15295func (vmiAiv VirtualMachineIdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) { 15296 objectMap := make(map[string]interface{}) 15297 return json.Marshal(objectMap) 15298} 15299 15300// VirtualMachineImage describes a Virtual Machine Image. 15301type VirtualMachineImage struct { 15302 autorest.Response `json:"-"` 15303 *VirtualMachineImageProperties `json:"properties,omitempty"` 15304 // Name - The name of the resource. 15305 Name *string `json:"name,omitempty"` 15306 // Location - The supported Azure location of the resource. 15307 Location *string `json:"location,omitempty"` 15308 // 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). 15309 Tags map[string]*string `json:"tags"` 15310 // ExtendedLocation - The extended location of the Virtual Machine. 15311 ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` 15312 // ID - Resource Id 15313 ID *string `json:"id,omitempty"` 15314} 15315 15316// MarshalJSON is the custom marshaler for VirtualMachineImage. 15317func (vmi VirtualMachineImage) MarshalJSON() ([]byte, error) { 15318 objectMap := make(map[string]interface{}) 15319 if vmi.VirtualMachineImageProperties != nil { 15320 objectMap["properties"] = vmi.VirtualMachineImageProperties 15321 } 15322 if vmi.Name != nil { 15323 objectMap["name"] = vmi.Name 15324 } 15325 if vmi.Location != nil { 15326 objectMap["location"] = vmi.Location 15327 } 15328 if vmi.Tags != nil { 15329 objectMap["tags"] = vmi.Tags 15330 } 15331 if vmi.ExtendedLocation != nil { 15332 objectMap["extendedLocation"] = vmi.ExtendedLocation 15333 } 15334 if vmi.ID != nil { 15335 objectMap["id"] = vmi.ID 15336 } 15337 return json.Marshal(objectMap) 15338} 15339 15340// UnmarshalJSON is the custom unmarshaler for VirtualMachineImage struct. 15341func (vmi *VirtualMachineImage) UnmarshalJSON(body []byte) error { 15342 var m map[string]*json.RawMessage 15343 err := json.Unmarshal(body, &m) 15344 if err != nil { 15345 return err 15346 } 15347 for k, v := range m { 15348 switch k { 15349 case "properties": 15350 if v != nil { 15351 var virtualMachineImageProperties VirtualMachineImageProperties 15352 err = json.Unmarshal(*v, &virtualMachineImageProperties) 15353 if err != nil { 15354 return err 15355 } 15356 vmi.VirtualMachineImageProperties = &virtualMachineImageProperties 15357 } 15358 case "name": 15359 if v != nil { 15360 var name string 15361 err = json.Unmarshal(*v, &name) 15362 if err != nil { 15363 return err 15364 } 15365 vmi.Name = &name 15366 } 15367 case "location": 15368 if v != nil { 15369 var location string 15370 err = json.Unmarshal(*v, &location) 15371 if err != nil { 15372 return err 15373 } 15374 vmi.Location = &location 15375 } 15376 case "tags": 15377 if v != nil { 15378 var tags map[string]*string 15379 err = json.Unmarshal(*v, &tags) 15380 if err != nil { 15381 return err 15382 } 15383 vmi.Tags = tags 15384 } 15385 case "extendedLocation": 15386 if v != nil { 15387 var extendedLocation ExtendedLocation 15388 err = json.Unmarshal(*v, &extendedLocation) 15389 if err != nil { 15390 return err 15391 } 15392 vmi.ExtendedLocation = &extendedLocation 15393 } 15394 case "id": 15395 if v != nil { 15396 var ID string 15397 err = json.Unmarshal(*v, &ID) 15398 if err != nil { 15399 return err 15400 } 15401 vmi.ID = &ID 15402 } 15403 } 15404 } 15405 15406 return nil 15407} 15408 15409// VirtualMachineImageFeature specifies additional capabilities supported by the image 15410type VirtualMachineImageFeature struct { 15411 // Name - The name of the feature. 15412 Name *string `json:"name,omitempty"` 15413 // Value - The corresponding value for the feature. 15414 Value *string `json:"value,omitempty"` 15415} 15416 15417// VirtualMachineImageProperties describes the properties of a Virtual Machine Image. 15418type VirtualMachineImageProperties struct { 15419 Plan *PurchasePlan `json:"plan,omitempty"` 15420 OsDiskImage *OSDiskImage `json:"osDiskImage,omitempty"` 15421 DataDiskImages *[]DataDiskImage `json:"dataDiskImages,omitempty"` 15422 AutomaticOSUpgradeProperties *AutomaticOSUpgradeProperties `json:"automaticOSUpgradeProperties,omitempty"` 15423 // HyperVGeneration - Possible values include: 'HyperVGenerationTypesV1', 'HyperVGenerationTypesV2' 15424 HyperVGeneration HyperVGenerationTypes `json:"hyperVGeneration,omitempty"` 15425 // Disallowed - Specifies disallowed configuration for the VirtualMachine created from the image 15426 Disallowed *DisallowedConfiguration `json:"disallowed,omitempty"` 15427 Features *[]VirtualMachineImageFeature `json:"features,omitempty"` 15428} 15429 15430// VirtualMachineImageResource virtual machine image resource information. 15431type VirtualMachineImageResource struct { 15432 // Name - The name of the resource. 15433 Name *string `json:"name,omitempty"` 15434 // Location - The supported Azure location of the resource. 15435 Location *string `json:"location,omitempty"` 15436 // 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). 15437 Tags map[string]*string `json:"tags"` 15438 // ExtendedLocation - The extended location of the Virtual Machine. 15439 ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` 15440 // ID - Resource Id 15441 ID *string `json:"id,omitempty"` 15442} 15443 15444// MarshalJSON is the custom marshaler for VirtualMachineImageResource. 15445func (vmir VirtualMachineImageResource) MarshalJSON() ([]byte, error) { 15446 objectMap := make(map[string]interface{}) 15447 if vmir.Name != nil { 15448 objectMap["name"] = vmir.Name 15449 } 15450 if vmir.Location != nil { 15451 objectMap["location"] = vmir.Location 15452 } 15453 if vmir.Tags != nil { 15454 objectMap["tags"] = vmir.Tags 15455 } 15456 if vmir.ExtendedLocation != nil { 15457 objectMap["extendedLocation"] = vmir.ExtendedLocation 15458 } 15459 if vmir.ID != nil { 15460 objectMap["id"] = vmir.ID 15461 } 15462 return json.Marshal(objectMap) 15463} 15464 15465// VirtualMachineInstallPatchesParameters input for InstallPatches as directly received by the API 15466type VirtualMachineInstallPatchesParameters struct { 15467 // MaximumDuration - Specifies the maximum amount of time that the operation will run. It must be an ISO 8601-compliant duration string such as PT4H (4 hours) 15468 MaximumDuration *string `json:"maximumDuration,omitempty"` 15469 // RebootSetting - Defines when it is acceptable to reboot a VM during a software update operation. Possible values include: 'VMGuestPatchRebootSettingIfRequired', 'VMGuestPatchRebootSettingNever', 'VMGuestPatchRebootSettingAlways' 15470 RebootSetting VMGuestPatchRebootSetting `json:"rebootSetting,omitempty"` 15471 // WindowsParameters - Input for InstallPatches on a Windows VM, as directly received by the API 15472 WindowsParameters *WindowsParameters `json:"windowsParameters,omitempty"` 15473 // LinuxParameters - Input for InstallPatches on a Linux VM, as directly received by the API 15474 LinuxParameters *LinuxParameters `json:"linuxParameters,omitempty"` 15475} 15476 15477// VirtualMachineInstallPatchesResult the result summary of an installation operation. 15478type VirtualMachineInstallPatchesResult struct { 15479 autorest.Response `json:"-"` 15480 // 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", "Unknown" or "CompletedWithWarnings.". Possible values include: 'PatchOperationStatusUnknown', 'PatchOperationStatusInProgress', 'PatchOperationStatusFailed', 'PatchOperationStatusSucceeded', 'PatchOperationStatusCompletedWithWarnings' 15481 Status PatchOperationStatus `json:"status,omitempty"` 15482 // InstallationActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. 15483 InstallationActivityID *string `json:"installationActivityId,omitempty"` 15484 // RebootStatus - READ-ONLY; The reboot state of the VM following completion of the operation. Possible values include: 'VMGuestPatchRebootStatusUnknown', 'VMGuestPatchRebootStatusNotNeeded', 'VMGuestPatchRebootStatusRequired', 'VMGuestPatchRebootStatusStarted', 'VMGuestPatchRebootStatusFailed', 'VMGuestPatchRebootStatusCompleted' 15485 RebootStatus VMGuestPatchRebootStatus `json:"rebootStatus,omitempty"` 15486 // MaintenanceWindowExceeded - READ-ONLY; Whether the operation ran out of time before it completed all its intended actions. 15487 MaintenanceWindowExceeded *bool `json:"maintenanceWindowExceeded,omitempty"` 15488 // ExcludedPatchCount - READ-ONLY; The number of patches that were not installed due to the user blocking their installation. 15489 ExcludedPatchCount *int32 `json:"excludedPatchCount,omitempty"` 15490 // NotSelectedPatchCount - READ-ONLY; The number of patches that were detected as available for install, but did not meet the operation's criteria. 15491 NotSelectedPatchCount *int32 `json:"notSelectedPatchCount,omitempty"` 15492 // PendingPatchCount - READ-ONLY; The number of patches that were identified as meeting the installation criteria, but were not able to be installed. Typically this happens when maintenanceWindowExceeded == true. 15493 PendingPatchCount *int32 `json:"pendingPatchCount,omitempty"` 15494 // InstalledPatchCount - READ-ONLY; The number of patches successfully installed. 15495 InstalledPatchCount *int32 `json:"installedPatchCount,omitempty"` 15496 // FailedPatchCount - READ-ONLY; The number of patches that could not be installed due to some issue. See errors for details. 15497 FailedPatchCount *int32 `json:"failedPatchCount,omitempty"` 15498 // Patches - READ-ONLY; The patches that were installed during the operation. 15499 Patches *[]PatchInstallationDetail `json:"patches,omitempty"` 15500 // StartDateTime - READ-ONLY; The UTC timestamp when the operation began. 15501 StartDateTime *date.Time `json:"startDateTime,omitempty"` 15502 // Error - READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. 15503 Error *APIError `json:"error,omitempty"` 15504} 15505 15506// MarshalJSON is the custom marshaler for VirtualMachineInstallPatchesResult. 15507func (vmipr VirtualMachineInstallPatchesResult) MarshalJSON() ([]byte, error) { 15508 objectMap := make(map[string]interface{}) 15509 return json.Marshal(objectMap) 15510} 15511 15512// VirtualMachineInstanceView the instance view of a virtual machine. 15513type VirtualMachineInstanceView struct { 15514 autorest.Response `json:"-"` 15515 // PlatformUpdateDomain - Specifies the update domain of the virtual machine. 15516 PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` 15517 // PlatformFaultDomain - Specifies the fault domain of the virtual machine. 15518 PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` 15519 // ComputerName - The computer name assigned to the virtual machine. 15520 ComputerName *string `json:"computerName,omitempty"` 15521 // OsName - The Operating System running on the virtual machine. 15522 OsName *string `json:"osName,omitempty"` 15523 // OsVersion - The version of Operating System running on the virtual machine. 15524 OsVersion *string `json:"osVersion,omitempty"` 15525 // HyperVGeneration - Specifies the HyperVGeneration Type associated with a resource. Possible values include: 'HyperVGenerationTypeV1', 'HyperVGenerationTypeV2' 15526 HyperVGeneration HyperVGenerationType `json:"hyperVGeneration,omitempty"` 15527 // RdpThumbPrint - The Remote desktop certificate thumbprint. 15528 RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"` 15529 // VMAgent - The VM Agent running on the virtual machine. 15530 VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"` 15531 // MaintenanceRedeployStatus - The Maintenance Operation status on the virtual machine. 15532 MaintenanceRedeployStatus *MaintenanceRedeployStatus `json:"maintenanceRedeployStatus,omitempty"` 15533 // Disks - The virtual machine disk information. 15534 Disks *[]DiskInstanceView `json:"disks,omitempty"` 15535 // Extensions - The extensions information. 15536 Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` 15537 // VMHealth - READ-ONLY; The health status for the VM. 15538 VMHealth *VirtualMachineHealthStatus `json:"vmHealth,omitempty"` 15539 // 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. 15540 BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` 15541 // 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. 15542 AssignedHost *string `json:"assignedHost,omitempty"` 15543 // Statuses - The resource status information. 15544 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 15545 // PatchStatus - [Preview Feature] The status of virtual machine patch operations. 15546 PatchStatus *VirtualMachinePatchStatus `json:"patchStatus,omitempty"` 15547} 15548 15549// MarshalJSON is the custom marshaler for VirtualMachineInstanceView. 15550func (vmiv VirtualMachineInstanceView) MarshalJSON() ([]byte, error) { 15551 objectMap := make(map[string]interface{}) 15552 if vmiv.PlatformUpdateDomain != nil { 15553 objectMap["platformUpdateDomain"] = vmiv.PlatformUpdateDomain 15554 } 15555 if vmiv.PlatformFaultDomain != nil { 15556 objectMap["platformFaultDomain"] = vmiv.PlatformFaultDomain 15557 } 15558 if vmiv.ComputerName != nil { 15559 objectMap["computerName"] = vmiv.ComputerName 15560 } 15561 if vmiv.OsName != nil { 15562 objectMap["osName"] = vmiv.OsName 15563 } 15564 if vmiv.OsVersion != nil { 15565 objectMap["osVersion"] = vmiv.OsVersion 15566 } 15567 if vmiv.HyperVGeneration != "" { 15568 objectMap["hyperVGeneration"] = vmiv.HyperVGeneration 15569 } 15570 if vmiv.RdpThumbPrint != nil { 15571 objectMap["rdpThumbPrint"] = vmiv.RdpThumbPrint 15572 } 15573 if vmiv.VMAgent != nil { 15574 objectMap["vmAgent"] = vmiv.VMAgent 15575 } 15576 if vmiv.MaintenanceRedeployStatus != nil { 15577 objectMap["maintenanceRedeployStatus"] = vmiv.MaintenanceRedeployStatus 15578 } 15579 if vmiv.Disks != nil { 15580 objectMap["disks"] = vmiv.Disks 15581 } 15582 if vmiv.Extensions != nil { 15583 objectMap["extensions"] = vmiv.Extensions 15584 } 15585 if vmiv.BootDiagnostics != nil { 15586 objectMap["bootDiagnostics"] = vmiv.BootDiagnostics 15587 } 15588 if vmiv.Statuses != nil { 15589 objectMap["statuses"] = vmiv.Statuses 15590 } 15591 if vmiv.PatchStatus != nil { 15592 objectMap["patchStatus"] = vmiv.PatchStatus 15593 } 15594 return json.Marshal(objectMap) 15595} 15596 15597// VirtualMachineIPTag contains the IP tag associated with the public IP address. 15598type VirtualMachineIPTag struct { 15599 // IPTagType - IP tag type. Example: FirstPartyUsage. 15600 IPTagType *string `json:"ipTagType,omitempty"` 15601 // Tag - IP tag associated with the public IP. Example: SQL, Storage etc. 15602 Tag *string `json:"tag,omitempty"` 15603} 15604 15605// VirtualMachineListResult the List Virtual Machine operation response. 15606type VirtualMachineListResult struct { 15607 autorest.Response `json:"-"` 15608 // Value - The list of virtual machines. 15609 Value *[]VirtualMachine `json:"value,omitempty"` 15610 // NextLink - The URI to fetch the next page of VMs. Call ListNext() with this URI to fetch the next page of Virtual Machines. 15611 NextLink *string `json:"nextLink,omitempty"` 15612} 15613 15614// VirtualMachineListResultIterator provides access to a complete listing of VirtualMachine values. 15615type VirtualMachineListResultIterator struct { 15616 i int 15617 page VirtualMachineListResultPage 15618} 15619 15620// NextWithContext advances to the next value. If there was an error making 15621// the request the iterator does not advance and the error is returned. 15622func (iter *VirtualMachineListResultIterator) NextWithContext(ctx context.Context) (err error) { 15623 if tracing.IsEnabled() { 15624 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineListResultIterator.NextWithContext") 15625 defer func() { 15626 sc := -1 15627 if iter.Response().Response.Response != nil { 15628 sc = iter.Response().Response.Response.StatusCode 15629 } 15630 tracing.EndSpan(ctx, sc, err) 15631 }() 15632 } 15633 iter.i++ 15634 if iter.i < len(iter.page.Values()) { 15635 return nil 15636 } 15637 err = iter.page.NextWithContext(ctx) 15638 if err != nil { 15639 iter.i-- 15640 return err 15641 } 15642 iter.i = 0 15643 return nil 15644} 15645 15646// Next advances to the next value. If there was an error making 15647// the request the iterator does not advance and the error is returned. 15648// Deprecated: Use NextWithContext() instead. 15649func (iter *VirtualMachineListResultIterator) Next() error { 15650 return iter.NextWithContext(context.Background()) 15651} 15652 15653// NotDone returns true if the enumeration should be started or is not yet complete. 15654func (iter VirtualMachineListResultIterator) NotDone() bool { 15655 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 15656} 15657 15658// Response returns the raw server response from the last page request. 15659func (iter VirtualMachineListResultIterator) Response() VirtualMachineListResult { 15660 return iter.page.Response() 15661} 15662 15663// Value returns the current value or a zero-initialized value if the 15664// iterator has advanced beyond the end of the collection. 15665func (iter VirtualMachineListResultIterator) Value() VirtualMachine { 15666 if !iter.page.NotDone() { 15667 return VirtualMachine{} 15668 } 15669 return iter.page.Values()[iter.i] 15670} 15671 15672// Creates a new instance of the VirtualMachineListResultIterator type. 15673func NewVirtualMachineListResultIterator(page VirtualMachineListResultPage) VirtualMachineListResultIterator { 15674 return VirtualMachineListResultIterator{page: page} 15675} 15676 15677// IsEmpty returns true if the ListResult contains no values. 15678func (vmlr VirtualMachineListResult) IsEmpty() bool { 15679 return vmlr.Value == nil || len(*vmlr.Value) == 0 15680} 15681 15682// hasNextLink returns true if the NextLink is not empty. 15683func (vmlr VirtualMachineListResult) hasNextLink() bool { 15684 return vmlr.NextLink != nil && len(*vmlr.NextLink) != 0 15685} 15686 15687// virtualMachineListResultPreparer prepares a request to retrieve the next set of results. 15688// It returns nil if no more results exist. 15689func (vmlr VirtualMachineListResult) virtualMachineListResultPreparer(ctx context.Context) (*http.Request, error) { 15690 if !vmlr.hasNextLink() { 15691 return nil, nil 15692 } 15693 return autorest.Prepare((&http.Request{}).WithContext(ctx), 15694 autorest.AsJSON(), 15695 autorest.AsGet(), 15696 autorest.WithBaseURL(to.String(vmlr.NextLink))) 15697} 15698 15699// VirtualMachineListResultPage contains a page of VirtualMachine values. 15700type VirtualMachineListResultPage struct { 15701 fn func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error) 15702 vmlr VirtualMachineListResult 15703} 15704 15705// NextWithContext advances to the next page of values. If there was an error making 15706// the request the page does not advance and the error is returned. 15707func (page *VirtualMachineListResultPage) NextWithContext(ctx context.Context) (err error) { 15708 if tracing.IsEnabled() { 15709 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineListResultPage.NextWithContext") 15710 defer func() { 15711 sc := -1 15712 if page.Response().Response.Response != nil { 15713 sc = page.Response().Response.Response.StatusCode 15714 } 15715 tracing.EndSpan(ctx, sc, err) 15716 }() 15717 } 15718 for { 15719 next, err := page.fn(ctx, page.vmlr) 15720 if err != nil { 15721 return err 15722 } 15723 page.vmlr = next 15724 if !next.hasNextLink() || !next.IsEmpty() { 15725 break 15726 } 15727 } 15728 return nil 15729} 15730 15731// Next advances to the next page of values. If there was an error making 15732// the request the page does not advance and the error is returned. 15733// Deprecated: Use NextWithContext() instead. 15734func (page *VirtualMachineListResultPage) Next() error { 15735 return page.NextWithContext(context.Background()) 15736} 15737 15738// NotDone returns true if the page enumeration should be started or is not yet complete. 15739func (page VirtualMachineListResultPage) NotDone() bool { 15740 return !page.vmlr.IsEmpty() 15741} 15742 15743// Response returns the raw server response from the last page request. 15744func (page VirtualMachineListResultPage) Response() VirtualMachineListResult { 15745 return page.vmlr 15746} 15747 15748// Values returns the slice of values for the current page or nil if there are no values. 15749func (page VirtualMachineListResultPage) Values() []VirtualMachine { 15750 if page.vmlr.IsEmpty() { 15751 return nil 15752 } 15753 return *page.vmlr.Value 15754} 15755 15756// Creates a new instance of the VirtualMachineListResultPage type. 15757func NewVirtualMachineListResultPage(cur VirtualMachineListResult, getNextPage func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error)) VirtualMachineListResultPage { 15758 return VirtualMachineListResultPage{ 15759 fn: getNextPage, 15760 vmlr: cur, 15761 } 15762} 15763 15764// VirtualMachineNetworkInterfaceConfiguration describes a virtual machine network interface 15765// configurations. 15766type VirtualMachineNetworkInterfaceConfiguration struct { 15767 // Name - The network interface configuration name. 15768 Name *string `json:"name,omitempty"` 15769 *VirtualMachineNetworkInterfaceConfigurationProperties `json:"properties,omitempty"` 15770} 15771 15772// MarshalJSON is the custom marshaler for VirtualMachineNetworkInterfaceConfiguration. 15773func (vmnic VirtualMachineNetworkInterfaceConfiguration) MarshalJSON() ([]byte, error) { 15774 objectMap := make(map[string]interface{}) 15775 if vmnic.Name != nil { 15776 objectMap["name"] = vmnic.Name 15777 } 15778 if vmnic.VirtualMachineNetworkInterfaceConfigurationProperties != nil { 15779 objectMap["properties"] = vmnic.VirtualMachineNetworkInterfaceConfigurationProperties 15780 } 15781 return json.Marshal(objectMap) 15782} 15783 15784// UnmarshalJSON is the custom unmarshaler for VirtualMachineNetworkInterfaceConfiguration struct. 15785func (vmnic *VirtualMachineNetworkInterfaceConfiguration) UnmarshalJSON(body []byte) error { 15786 var m map[string]*json.RawMessage 15787 err := json.Unmarshal(body, &m) 15788 if err != nil { 15789 return err 15790 } 15791 for k, v := range m { 15792 switch k { 15793 case "name": 15794 if v != nil { 15795 var name string 15796 err = json.Unmarshal(*v, &name) 15797 if err != nil { 15798 return err 15799 } 15800 vmnic.Name = &name 15801 } 15802 case "properties": 15803 if v != nil { 15804 var virtualMachineNetworkInterfaceConfigurationProperties VirtualMachineNetworkInterfaceConfigurationProperties 15805 err = json.Unmarshal(*v, &virtualMachineNetworkInterfaceConfigurationProperties) 15806 if err != nil { 15807 return err 15808 } 15809 vmnic.VirtualMachineNetworkInterfaceConfigurationProperties = &virtualMachineNetworkInterfaceConfigurationProperties 15810 } 15811 } 15812 } 15813 15814 return nil 15815} 15816 15817// VirtualMachineNetworkInterfaceConfigurationProperties describes a virtual machine network profile's IP 15818// configuration. 15819type VirtualMachineNetworkInterfaceConfigurationProperties struct { 15820 // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. 15821 Primary *bool `json:"primary,omitempty"` 15822 // DeleteOption - Specify what happens to the network interface when the VM is deleted. Possible values include: 'DeleteOptionsDelete', 'DeleteOptionsDetach' 15823 DeleteOption DeleteOptions `json:"deleteOption,omitempty"` 15824 // EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled. 15825 EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` 15826 // EnableFpga - Specifies whether the network interface is FPGA networking-enabled. 15827 EnableFpga *bool `json:"enableFpga,omitempty"` 15828 // EnableIPForwarding - Whether IP forwarding enabled on this NIC. 15829 EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` 15830 // NetworkSecurityGroup - The network security group. 15831 NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` 15832 // DNSSettings - The dns settings to be applied on the network interfaces. 15833 DNSSettings *VirtualMachineNetworkInterfaceDNSSettingsConfiguration `json:"dnsSettings,omitempty"` 15834 // IPConfigurations - Specifies the IP configurations of the network interface. 15835 IPConfigurations *[]VirtualMachineNetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` 15836 DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` 15837} 15838 15839// VirtualMachineNetworkInterfaceDNSSettingsConfiguration describes a virtual machines network 15840// configuration's DNS settings. 15841type VirtualMachineNetworkInterfaceDNSSettingsConfiguration struct { 15842 // DNSServers - List of DNS servers IP addresses 15843 DNSServers *[]string `json:"dnsServers,omitempty"` 15844} 15845 15846// VirtualMachineNetworkInterfaceIPConfiguration describes a virtual machine network profile's IP 15847// configuration. 15848type VirtualMachineNetworkInterfaceIPConfiguration struct { 15849 // Name - The IP configuration name. 15850 Name *string `json:"name,omitempty"` 15851 *VirtualMachineNetworkInterfaceIPConfigurationProperties `json:"properties,omitempty"` 15852} 15853 15854// MarshalJSON is the custom marshaler for VirtualMachineNetworkInterfaceIPConfiguration. 15855func (vmniic VirtualMachineNetworkInterfaceIPConfiguration) MarshalJSON() ([]byte, error) { 15856 objectMap := make(map[string]interface{}) 15857 if vmniic.Name != nil { 15858 objectMap["name"] = vmniic.Name 15859 } 15860 if vmniic.VirtualMachineNetworkInterfaceIPConfigurationProperties != nil { 15861 objectMap["properties"] = vmniic.VirtualMachineNetworkInterfaceIPConfigurationProperties 15862 } 15863 return json.Marshal(objectMap) 15864} 15865 15866// UnmarshalJSON is the custom unmarshaler for VirtualMachineNetworkInterfaceIPConfiguration struct. 15867func (vmniic *VirtualMachineNetworkInterfaceIPConfiguration) UnmarshalJSON(body []byte) error { 15868 var m map[string]*json.RawMessage 15869 err := json.Unmarshal(body, &m) 15870 if err != nil { 15871 return err 15872 } 15873 for k, v := range m { 15874 switch k { 15875 case "name": 15876 if v != nil { 15877 var name string 15878 err = json.Unmarshal(*v, &name) 15879 if err != nil { 15880 return err 15881 } 15882 vmniic.Name = &name 15883 } 15884 case "properties": 15885 if v != nil { 15886 var virtualMachineNetworkInterfaceIPConfigurationProperties VirtualMachineNetworkInterfaceIPConfigurationProperties 15887 err = json.Unmarshal(*v, &virtualMachineNetworkInterfaceIPConfigurationProperties) 15888 if err != nil { 15889 return err 15890 } 15891 vmniic.VirtualMachineNetworkInterfaceIPConfigurationProperties = &virtualMachineNetworkInterfaceIPConfigurationProperties 15892 } 15893 } 15894 } 15895 15896 return nil 15897} 15898 15899// VirtualMachineNetworkInterfaceIPConfigurationProperties describes a virtual machine network interface IP 15900// configuration properties. 15901type VirtualMachineNetworkInterfaceIPConfigurationProperties struct { 15902 // Subnet - Specifies the identifier of the subnet. 15903 Subnet *SubResource `json:"subnet,omitempty"` 15904 // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. 15905 Primary *bool `json:"primary,omitempty"` 15906 // PublicIPAddressConfiguration - The publicIPAddressConfiguration. 15907 PublicIPAddressConfiguration *VirtualMachinePublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` 15908 // 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: 'IPVersionsIPv4', 'IPVersionsIPv6' 15909 PrivateIPAddressVersion IPVersions `json:"privateIPAddressVersion,omitempty"` 15910 // ApplicationSecurityGroups - Specifies an array of references to application security group. 15911 ApplicationSecurityGroups *[]SubResource `json:"applicationSecurityGroups,omitempty"` 15912 // ApplicationGatewayBackendAddressPools - Specifies an array of references to backend address pools of application gateways. A virtual machine can reference backend address pools of multiple application gateways. Multiple virtual machines cannot use the same application gateway. 15913 ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` 15914 // LoadBalancerBackendAddressPools - Specifies an array of references to backend address pools of load balancers. A virtual machine can reference backend address pools of one public and one internal load balancer. [Multiple virtual machines cannot use the same basic sku load balancer]. 15915 LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` 15916} 15917 15918// VirtualMachinePatchStatus the status of virtual machine patch operations. 15919type VirtualMachinePatchStatus struct { 15920 // AvailablePatchSummary - The available patch summary of the latest assessment operation for the virtual machine. 15921 AvailablePatchSummary *AvailablePatchSummary `json:"availablePatchSummary,omitempty"` 15922 // LastPatchInstallationSummary - The installation summary of the latest installation operation for the virtual machine. 15923 LastPatchInstallationSummary *LastPatchInstallationSummary `json:"lastPatchInstallationSummary,omitempty"` 15924 // ConfigurationStatuses - READ-ONLY; The enablement status of the specified patchMode 15925 ConfigurationStatuses *[]InstanceViewStatus `json:"configurationStatuses,omitempty"` 15926} 15927 15928// MarshalJSON is the custom marshaler for VirtualMachinePatchStatus. 15929func (vmps VirtualMachinePatchStatus) MarshalJSON() ([]byte, error) { 15930 objectMap := make(map[string]interface{}) 15931 if vmps.AvailablePatchSummary != nil { 15932 objectMap["availablePatchSummary"] = vmps.AvailablePatchSummary 15933 } 15934 if vmps.LastPatchInstallationSummary != nil { 15935 objectMap["lastPatchInstallationSummary"] = vmps.LastPatchInstallationSummary 15936 } 15937 return json.Marshal(objectMap) 15938} 15939 15940// VirtualMachineProperties describes the properties of a Virtual Machine. 15941type VirtualMachineProperties struct { 15942 // HardwareProfile - Specifies the hardware settings for the virtual machine. 15943 HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` 15944 // StorageProfile - Specifies the storage settings for the virtual machine disks. 15945 StorageProfile *StorageProfile `json:"storageProfile,omitempty"` 15946 // AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the virtual machine. 15947 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 15948 // OsProfile - Specifies the operating system settings used while creating the virtual machine. Some of the settings cannot be changed once VM is provisioned. 15949 OsProfile *OSProfile `json:"osProfile,omitempty"` 15950 // NetworkProfile - Specifies the network interfaces of the virtual machine. 15951 NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` 15952 // SecurityProfile - Specifies the Security related profile settings for the virtual machine. 15953 SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` 15954 // DiagnosticsProfile - Specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. 15955 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 15956 // 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 [Availability sets overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). <br><br> For more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates) <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. 15957 AvailabilitySet *SubResource `json:"availabilitySet,omitempty"` 15958 // 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 15959 VirtualMachineScaleSet *SubResource `json:"virtualMachineScaleSet,omitempty"` 15960 // ProximityPlacementGroup - Specifies information about the proximity placement group that the virtual machine should be assigned to. <br><br>Minimum api-version: 2018-04-01. 15961 ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` 15962 // Priority - Specifies the priority for the virtual machine. <br><br>Minimum api-version: 2019-03-01. Possible values include: 'VirtualMachinePriorityTypesRegular', 'VirtualMachinePriorityTypesLow', 'VirtualMachinePriorityTypesSpot' 15963 Priority VirtualMachinePriorityTypes `json:"priority,omitempty"` 15964 // 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: 'VirtualMachineEvictionPolicyTypesDeallocate', 'VirtualMachineEvictionPolicyTypesDelete' 15965 EvictionPolicy VirtualMachineEvictionPolicyTypes `json:"evictionPolicy,omitempty"` 15966 // BillingProfile - Specifies the billing related details of a Azure Spot virtual machine. <br><br>Minimum api-version: 2019-03-01. 15967 BillingProfile *BillingProfile `json:"billingProfile,omitempty"` 15968 // Host - Specifies information about the dedicated host that the virtual machine resides in. <br><br>Minimum api-version: 2018-10-01. 15969 Host *SubResource `json:"host,omitempty"` 15970 // 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. 15971 HostGroup *SubResource `json:"hostGroup,omitempty"` 15972 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 15973 ProvisioningState *string `json:"provisioningState,omitempty"` 15974 // InstanceView - READ-ONLY; The virtual machine instance view. 15975 InstanceView *VirtualMachineInstanceView `json:"instanceView,omitempty"` 15976 // 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 15977 LicenseType *string `json:"licenseType,omitempty"` 15978 // 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. 15979 VMID *string `json:"vmId,omitempty"` 15980 // 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 15981 ExtensionsTimeBudget *string `json:"extensionsTimeBudget,omitempty"` 15982 // PlatformFaultDomain - Specifies the scale set logical fault domain into which the Virtual Machine will be created. By default, the Virtual Machine will by automatically assigned to a fault domain that best maintains balance across available fault domains.<br><li>This is applicable only if the 'virtualMachineScaleSet' property of this Virtual Machine is set.<li>The Virtual Machine Scale Set that is referenced, must have 'platformFaultDomainCount' > 1.<li>This property cannot be updated once the Virtual Machine is created.<li>Fault domain assignment can be viewed in the Virtual Machine Instance View.<br><br>Minimum api‐version: 2020‐12‐01 15983 PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` 15984 // ScheduledEventsProfile - Specifies Scheduled Event related configurations. 15985 ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` 15986 // UserData - UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. <br><br>Minimum api-version: 2021-03-01 15987 UserData *string `json:"userData,omitempty"` 15988} 15989 15990// MarshalJSON is the custom marshaler for VirtualMachineProperties. 15991func (vmp VirtualMachineProperties) MarshalJSON() ([]byte, error) { 15992 objectMap := make(map[string]interface{}) 15993 if vmp.HardwareProfile != nil { 15994 objectMap["hardwareProfile"] = vmp.HardwareProfile 15995 } 15996 if vmp.StorageProfile != nil { 15997 objectMap["storageProfile"] = vmp.StorageProfile 15998 } 15999 if vmp.AdditionalCapabilities != nil { 16000 objectMap["additionalCapabilities"] = vmp.AdditionalCapabilities 16001 } 16002 if vmp.OsProfile != nil { 16003 objectMap["osProfile"] = vmp.OsProfile 16004 } 16005 if vmp.NetworkProfile != nil { 16006 objectMap["networkProfile"] = vmp.NetworkProfile 16007 } 16008 if vmp.SecurityProfile != nil { 16009 objectMap["securityProfile"] = vmp.SecurityProfile 16010 } 16011 if vmp.DiagnosticsProfile != nil { 16012 objectMap["diagnosticsProfile"] = vmp.DiagnosticsProfile 16013 } 16014 if vmp.AvailabilitySet != nil { 16015 objectMap["availabilitySet"] = vmp.AvailabilitySet 16016 } 16017 if vmp.VirtualMachineScaleSet != nil { 16018 objectMap["virtualMachineScaleSet"] = vmp.VirtualMachineScaleSet 16019 } 16020 if vmp.ProximityPlacementGroup != nil { 16021 objectMap["proximityPlacementGroup"] = vmp.ProximityPlacementGroup 16022 } 16023 if vmp.Priority != "" { 16024 objectMap["priority"] = vmp.Priority 16025 } 16026 if vmp.EvictionPolicy != "" { 16027 objectMap["evictionPolicy"] = vmp.EvictionPolicy 16028 } 16029 if vmp.BillingProfile != nil { 16030 objectMap["billingProfile"] = vmp.BillingProfile 16031 } 16032 if vmp.Host != nil { 16033 objectMap["host"] = vmp.Host 16034 } 16035 if vmp.HostGroup != nil { 16036 objectMap["hostGroup"] = vmp.HostGroup 16037 } 16038 if vmp.LicenseType != nil { 16039 objectMap["licenseType"] = vmp.LicenseType 16040 } 16041 if vmp.ExtensionsTimeBudget != nil { 16042 objectMap["extensionsTimeBudget"] = vmp.ExtensionsTimeBudget 16043 } 16044 if vmp.PlatformFaultDomain != nil { 16045 objectMap["platformFaultDomain"] = vmp.PlatformFaultDomain 16046 } 16047 if vmp.ScheduledEventsProfile != nil { 16048 objectMap["scheduledEventsProfile"] = vmp.ScheduledEventsProfile 16049 } 16050 if vmp.UserData != nil { 16051 objectMap["userData"] = vmp.UserData 16052 } 16053 return json.Marshal(objectMap) 16054} 16055 16056// VirtualMachinePublicIPAddressConfiguration describes a virtual machines IP Configuration's 16057// PublicIPAddress configuration 16058type VirtualMachinePublicIPAddressConfiguration struct { 16059 // Name - The publicIP address configuration name. 16060 Name *string `json:"name,omitempty"` 16061 *VirtualMachinePublicIPAddressConfigurationProperties `json:"properties,omitempty"` 16062 Sku *PublicIPAddressSku `json:"sku,omitempty"` 16063} 16064 16065// MarshalJSON is the custom marshaler for VirtualMachinePublicIPAddressConfiguration. 16066func (vmpiac VirtualMachinePublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { 16067 objectMap := make(map[string]interface{}) 16068 if vmpiac.Name != nil { 16069 objectMap["name"] = vmpiac.Name 16070 } 16071 if vmpiac.VirtualMachinePublicIPAddressConfigurationProperties != nil { 16072 objectMap["properties"] = vmpiac.VirtualMachinePublicIPAddressConfigurationProperties 16073 } 16074 if vmpiac.Sku != nil { 16075 objectMap["sku"] = vmpiac.Sku 16076 } 16077 return json.Marshal(objectMap) 16078} 16079 16080// UnmarshalJSON is the custom unmarshaler for VirtualMachinePublicIPAddressConfiguration struct. 16081func (vmpiac *VirtualMachinePublicIPAddressConfiguration) UnmarshalJSON(body []byte) error { 16082 var m map[string]*json.RawMessage 16083 err := json.Unmarshal(body, &m) 16084 if err != nil { 16085 return err 16086 } 16087 for k, v := range m { 16088 switch k { 16089 case "name": 16090 if v != nil { 16091 var name string 16092 err = json.Unmarshal(*v, &name) 16093 if err != nil { 16094 return err 16095 } 16096 vmpiac.Name = &name 16097 } 16098 case "properties": 16099 if v != nil { 16100 var virtualMachinePublicIPAddressConfigurationProperties VirtualMachinePublicIPAddressConfigurationProperties 16101 err = json.Unmarshal(*v, &virtualMachinePublicIPAddressConfigurationProperties) 16102 if err != nil { 16103 return err 16104 } 16105 vmpiac.VirtualMachinePublicIPAddressConfigurationProperties = &virtualMachinePublicIPAddressConfigurationProperties 16106 } 16107 case "sku": 16108 if v != nil { 16109 var sku PublicIPAddressSku 16110 err = json.Unmarshal(*v, &sku) 16111 if err != nil { 16112 return err 16113 } 16114 vmpiac.Sku = &sku 16115 } 16116 } 16117 } 16118 16119 return nil 16120} 16121 16122// VirtualMachinePublicIPAddressConfigurationProperties describes a virtual machines IP Configuration's 16123// PublicIPAddress configuration 16124type VirtualMachinePublicIPAddressConfigurationProperties struct { 16125 // IdleTimeoutInMinutes - The idle timeout of the public IP address. 16126 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` 16127 // DeleteOption - Specify what happens to the public IP address when the VM is deleted. Possible values include: 'DeleteOptionsDelete', 'DeleteOptionsDetach' 16128 DeleteOption DeleteOptions `json:"deleteOption,omitempty"` 16129 // DNSSettings - The dns settings to be applied on the publicIP addresses . 16130 DNSSettings *VirtualMachinePublicIPAddressDNSSettingsConfiguration `json:"dnsSettings,omitempty"` 16131 // IPTags - The list of IP tags associated with the public IP address. 16132 IPTags *[]VirtualMachineIPTag `json:"ipTags,omitempty"` 16133 // PublicIPPrefix - The PublicIPPrefix from which to allocate publicIP addresses. 16134 PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` 16135 // 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: 'IPVersionsIPv4', 'IPVersionsIPv6' 16136 PublicIPAddressVersion IPVersions `json:"publicIPAddressVersion,omitempty"` 16137 // PublicIPAllocationMethod - Specify the public IP allocation type. Possible values include: 'PublicIPAllocationMethodDynamic', 'PublicIPAllocationMethodStatic' 16138 PublicIPAllocationMethod PublicIPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` 16139} 16140 16141// VirtualMachinePublicIPAddressDNSSettingsConfiguration describes a virtual machines network 16142// configuration's DNS settings. 16143type VirtualMachinePublicIPAddressDNSSettingsConfiguration struct { 16144 // DomainNameLabel - The Domain name label prefix of the PublicIPAddress resources that will be created. The generated name label is the concatenation of the domain name label and vm network profile unique ID. 16145 DomainNameLabel *string `json:"domainNameLabel,omitempty"` 16146} 16147 16148// VirtualMachineReimageParameters parameters for Reimaging Virtual Machine. NOTE: Virtual Machine OS disk 16149// will always be reimaged 16150type VirtualMachineReimageParameters struct { 16151 // 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. 16152 TempDisk *bool `json:"tempDisk,omitempty"` 16153} 16154 16155// VirtualMachineRunCommand describes a Virtual Machine run command. 16156type VirtualMachineRunCommand struct { 16157 autorest.Response `json:"-"` 16158 *VirtualMachineRunCommandProperties `json:"properties,omitempty"` 16159 // ID - READ-ONLY; Resource Id 16160 ID *string `json:"id,omitempty"` 16161 // Name - READ-ONLY; Resource name 16162 Name *string `json:"name,omitempty"` 16163 // Type - READ-ONLY; Resource type 16164 Type *string `json:"type,omitempty"` 16165 // Location - Resource location 16166 Location *string `json:"location,omitempty"` 16167 // Tags - Resource tags 16168 Tags map[string]*string `json:"tags"` 16169} 16170 16171// MarshalJSON is the custom marshaler for VirtualMachineRunCommand. 16172func (vmrc VirtualMachineRunCommand) MarshalJSON() ([]byte, error) { 16173 objectMap := make(map[string]interface{}) 16174 if vmrc.VirtualMachineRunCommandProperties != nil { 16175 objectMap["properties"] = vmrc.VirtualMachineRunCommandProperties 16176 } 16177 if vmrc.Location != nil { 16178 objectMap["location"] = vmrc.Location 16179 } 16180 if vmrc.Tags != nil { 16181 objectMap["tags"] = vmrc.Tags 16182 } 16183 return json.Marshal(objectMap) 16184} 16185 16186// UnmarshalJSON is the custom unmarshaler for VirtualMachineRunCommand struct. 16187func (vmrc *VirtualMachineRunCommand) UnmarshalJSON(body []byte) error { 16188 var m map[string]*json.RawMessage 16189 err := json.Unmarshal(body, &m) 16190 if err != nil { 16191 return err 16192 } 16193 for k, v := range m { 16194 switch k { 16195 case "properties": 16196 if v != nil { 16197 var virtualMachineRunCommandProperties VirtualMachineRunCommandProperties 16198 err = json.Unmarshal(*v, &virtualMachineRunCommandProperties) 16199 if err != nil { 16200 return err 16201 } 16202 vmrc.VirtualMachineRunCommandProperties = &virtualMachineRunCommandProperties 16203 } 16204 case "id": 16205 if v != nil { 16206 var ID string 16207 err = json.Unmarshal(*v, &ID) 16208 if err != nil { 16209 return err 16210 } 16211 vmrc.ID = &ID 16212 } 16213 case "name": 16214 if v != nil { 16215 var name string 16216 err = json.Unmarshal(*v, &name) 16217 if err != nil { 16218 return err 16219 } 16220 vmrc.Name = &name 16221 } 16222 case "type": 16223 if v != nil { 16224 var typeVar string 16225 err = json.Unmarshal(*v, &typeVar) 16226 if err != nil { 16227 return err 16228 } 16229 vmrc.Type = &typeVar 16230 } 16231 case "location": 16232 if v != nil { 16233 var location string 16234 err = json.Unmarshal(*v, &location) 16235 if err != nil { 16236 return err 16237 } 16238 vmrc.Location = &location 16239 } 16240 case "tags": 16241 if v != nil { 16242 var tags map[string]*string 16243 err = json.Unmarshal(*v, &tags) 16244 if err != nil { 16245 return err 16246 } 16247 vmrc.Tags = tags 16248 } 16249 } 16250 } 16251 16252 return nil 16253} 16254 16255// VirtualMachineRunCommandInstanceView the instance view of a virtual machine run command. 16256type VirtualMachineRunCommandInstanceView struct { 16257 // ExecutionState - Script execution status. Possible values include: 'ExecutionStateUnknown', 'ExecutionStatePending', 'ExecutionStateRunning', 'ExecutionStateFailed', 'ExecutionStateSucceeded', 'ExecutionStateTimedOut', 'ExecutionStateCanceled' 16258 ExecutionState ExecutionState `json:"executionState,omitempty"` 16259 // ExecutionMessage - Communicate script configuration errors or execution messages. 16260 ExecutionMessage *string `json:"executionMessage,omitempty"` 16261 // ExitCode - Exit code returned from script execution. 16262 ExitCode *int32 `json:"exitCode,omitempty"` 16263 // Output - Script output stream. 16264 Output *string `json:"output,omitempty"` 16265 // Error - Script error stream. 16266 Error *string `json:"error,omitempty"` 16267 // StartTime - Script start time. 16268 StartTime *date.Time `json:"startTime,omitempty"` 16269 // EndTime - Script end time. 16270 EndTime *date.Time `json:"endTime,omitempty"` 16271 // Statuses - The resource status information. 16272 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 16273} 16274 16275// VirtualMachineRunCommandProperties describes the properties of a Virtual Machine run command. 16276type VirtualMachineRunCommandProperties struct { 16277 // Source - The source of the run command script. 16278 Source *VirtualMachineRunCommandScriptSource `json:"source,omitempty"` 16279 // Parameters - The parameters used by the script. 16280 Parameters *[]RunCommandInputParameter `json:"parameters,omitempty"` 16281 // ProtectedParameters - The parameters used by the script. 16282 ProtectedParameters *[]RunCommandInputParameter `json:"protectedParameters,omitempty"` 16283 // AsyncExecution - Optional. If set to true, provisioning will complete as soon as the script starts and will not wait for script to complete. 16284 AsyncExecution *bool `json:"asyncExecution,omitempty"` 16285 // RunAsUser - Specifies the user account on the VM when executing the run command. 16286 RunAsUser *string `json:"runAsUser,omitempty"` 16287 // RunAsPassword - Specifies the user account password on the VM when executing the run command. 16288 RunAsPassword *string `json:"runAsPassword,omitempty"` 16289 // TimeoutInSeconds - The timeout in seconds to execute the run command. 16290 TimeoutInSeconds *int32 `json:"timeoutInSeconds,omitempty"` 16291 // OutputBlobURI - Specifies the Azure storage blob where script output stream will be uploaded. 16292 OutputBlobURI *string `json:"outputBlobUri,omitempty"` 16293 // ErrorBlobURI - Specifies the Azure storage blob where script error stream will be uploaded. 16294 ErrorBlobURI *string `json:"errorBlobUri,omitempty"` 16295 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 16296 ProvisioningState *string `json:"provisioningState,omitempty"` 16297 // InstanceView - READ-ONLY; The virtual machine run command instance view. 16298 InstanceView *VirtualMachineRunCommandInstanceView `json:"instanceView,omitempty"` 16299} 16300 16301// MarshalJSON is the custom marshaler for VirtualMachineRunCommandProperties. 16302func (vmrcp VirtualMachineRunCommandProperties) MarshalJSON() ([]byte, error) { 16303 objectMap := make(map[string]interface{}) 16304 if vmrcp.Source != nil { 16305 objectMap["source"] = vmrcp.Source 16306 } 16307 if vmrcp.Parameters != nil { 16308 objectMap["parameters"] = vmrcp.Parameters 16309 } 16310 if vmrcp.ProtectedParameters != nil { 16311 objectMap["protectedParameters"] = vmrcp.ProtectedParameters 16312 } 16313 if vmrcp.AsyncExecution != nil { 16314 objectMap["asyncExecution"] = vmrcp.AsyncExecution 16315 } 16316 if vmrcp.RunAsUser != nil { 16317 objectMap["runAsUser"] = vmrcp.RunAsUser 16318 } 16319 if vmrcp.RunAsPassword != nil { 16320 objectMap["runAsPassword"] = vmrcp.RunAsPassword 16321 } 16322 if vmrcp.TimeoutInSeconds != nil { 16323 objectMap["timeoutInSeconds"] = vmrcp.TimeoutInSeconds 16324 } 16325 if vmrcp.OutputBlobURI != nil { 16326 objectMap["outputBlobUri"] = vmrcp.OutputBlobURI 16327 } 16328 if vmrcp.ErrorBlobURI != nil { 16329 objectMap["errorBlobUri"] = vmrcp.ErrorBlobURI 16330 } 16331 return json.Marshal(objectMap) 16332} 16333 16334// VirtualMachineRunCommandsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results 16335// of a long-running operation. 16336type VirtualMachineRunCommandsCreateOrUpdateFuture struct { 16337 azure.FutureAPI 16338 // Result returns the result of the asynchronous operation. 16339 // If the operation has not completed it will return an error. 16340 Result func(VirtualMachineRunCommandsClient) (VirtualMachineRunCommand, error) 16341} 16342 16343// UnmarshalJSON is the custom unmarshaller for CreateFuture. 16344func (future *VirtualMachineRunCommandsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 16345 var azFuture azure.Future 16346 if err := json.Unmarshal(body, &azFuture); err != nil { 16347 return err 16348 } 16349 future.FutureAPI = &azFuture 16350 future.Result = future.result 16351 return nil 16352} 16353 16354// result is the default implementation for VirtualMachineRunCommandsCreateOrUpdateFuture.Result. 16355func (future *VirtualMachineRunCommandsCreateOrUpdateFuture) result(client VirtualMachineRunCommandsClient) (vmrc VirtualMachineRunCommand, err error) { 16356 var done bool 16357 done, err = future.DoneWithContext(context.Background(), client) 16358 if err != nil { 16359 err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 16360 return 16361 } 16362 if !done { 16363 vmrc.Response.Response = future.Response() 16364 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineRunCommandsCreateOrUpdateFuture") 16365 return 16366 } 16367 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 16368 if vmrc.Response.Response, err = future.GetResult(sender); err == nil && vmrc.Response.Response.StatusCode != http.StatusNoContent { 16369 vmrc, err = client.CreateOrUpdateResponder(vmrc.Response.Response) 16370 if err != nil { 16371 err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsCreateOrUpdateFuture", "Result", vmrc.Response.Response, "Failure responding to request") 16372 } 16373 } 16374 return 16375} 16376 16377// VirtualMachineRunCommandScriptSource describes the script sources for run command. 16378type VirtualMachineRunCommandScriptSource struct { 16379 // Script - Specifies the script content to be executed on the VM. 16380 Script *string `json:"script,omitempty"` 16381 // ScriptURI - Specifies the script download location. 16382 ScriptURI *string `json:"scriptUri,omitempty"` 16383 // CommandID - Specifies a commandId of predefined built-in script. 16384 CommandID *string `json:"commandId,omitempty"` 16385} 16386 16387// VirtualMachineRunCommandsDeleteFuture an abstraction for monitoring and retrieving the results of a 16388// long-running operation. 16389type VirtualMachineRunCommandsDeleteFuture struct { 16390 azure.FutureAPI 16391 // Result returns the result of the asynchronous operation. 16392 // If the operation has not completed it will return an error. 16393 Result func(VirtualMachineRunCommandsClient) (autorest.Response, error) 16394} 16395 16396// UnmarshalJSON is the custom unmarshaller for CreateFuture. 16397func (future *VirtualMachineRunCommandsDeleteFuture) UnmarshalJSON(body []byte) error { 16398 var azFuture azure.Future 16399 if err := json.Unmarshal(body, &azFuture); err != nil { 16400 return err 16401 } 16402 future.FutureAPI = &azFuture 16403 future.Result = future.result 16404 return nil 16405} 16406 16407// result is the default implementation for VirtualMachineRunCommandsDeleteFuture.Result. 16408func (future *VirtualMachineRunCommandsDeleteFuture) result(client VirtualMachineRunCommandsClient) (ar autorest.Response, err error) { 16409 var done bool 16410 done, err = future.DoneWithContext(context.Background(), client) 16411 if err != nil { 16412 err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsDeleteFuture", "Result", future.Response(), "Polling failure") 16413 return 16414 } 16415 if !done { 16416 ar.Response = future.Response() 16417 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineRunCommandsDeleteFuture") 16418 return 16419 } 16420 ar.Response = future.Response() 16421 return 16422} 16423 16424// VirtualMachineRunCommandsListResult the List run command operation response 16425type VirtualMachineRunCommandsListResult struct { 16426 autorest.Response `json:"-"` 16427 // Value - The list of run commands 16428 Value *[]VirtualMachineRunCommand `json:"value,omitempty"` 16429 // NextLink - The uri to fetch the next page of run commands. 16430 NextLink *string `json:"nextLink,omitempty"` 16431} 16432 16433// VirtualMachineRunCommandsListResultIterator provides access to a complete listing of 16434// VirtualMachineRunCommand values. 16435type VirtualMachineRunCommandsListResultIterator struct { 16436 i int 16437 page VirtualMachineRunCommandsListResultPage 16438} 16439 16440// NextWithContext advances to the next value. If there was an error making 16441// the request the iterator does not advance and the error is returned. 16442func (iter *VirtualMachineRunCommandsListResultIterator) NextWithContext(ctx context.Context) (err error) { 16443 if tracing.IsEnabled() { 16444 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsListResultIterator.NextWithContext") 16445 defer func() { 16446 sc := -1 16447 if iter.Response().Response.Response != nil { 16448 sc = iter.Response().Response.Response.StatusCode 16449 } 16450 tracing.EndSpan(ctx, sc, err) 16451 }() 16452 } 16453 iter.i++ 16454 if iter.i < len(iter.page.Values()) { 16455 return nil 16456 } 16457 err = iter.page.NextWithContext(ctx) 16458 if err != nil { 16459 iter.i-- 16460 return err 16461 } 16462 iter.i = 0 16463 return nil 16464} 16465 16466// Next advances to the next value. If there was an error making 16467// the request the iterator does not advance and the error is returned. 16468// Deprecated: Use NextWithContext() instead. 16469func (iter *VirtualMachineRunCommandsListResultIterator) Next() error { 16470 return iter.NextWithContext(context.Background()) 16471} 16472 16473// NotDone returns true if the enumeration should be started or is not yet complete. 16474func (iter VirtualMachineRunCommandsListResultIterator) NotDone() bool { 16475 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 16476} 16477 16478// Response returns the raw server response from the last page request. 16479func (iter VirtualMachineRunCommandsListResultIterator) Response() VirtualMachineRunCommandsListResult { 16480 return iter.page.Response() 16481} 16482 16483// Value returns the current value or a zero-initialized value if the 16484// iterator has advanced beyond the end of the collection. 16485func (iter VirtualMachineRunCommandsListResultIterator) Value() VirtualMachineRunCommand { 16486 if !iter.page.NotDone() { 16487 return VirtualMachineRunCommand{} 16488 } 16489 return iter.page.Values()[iter.i] 16490} 16491 16492// Creates a new instance of the VirtualMachineRunCommandsListResultIterator type. 16493func NewVirtualMachineRunCommandsListResultIterator(page VirtualMachineRunCommandsListResultPage) VirtualMachineRunCommandsListResultIterator { 16494 return VirtualMachineRunCommandsListResultIterator{page: page} 16495} 16496 16497// IsEmpty returns true if the ListResult contains no values. 16498func (vmrclr VirtualMachineRunCommandsListResult) IsEmpty() bool { 16499 return vmrclr.Value == nil || len(*vmrclr.Value) == 0 16500} 16501 16502// hasNextLink returns true if the NextLink is not empty. 16503func (vmrclr VirtualMachineRunCommandsListResult) hasNextLink() bool { 16504 return vmrclr.NextLink != nil && len(*vmrclr.NextLink) != 0 16505} 16506 16507// virtualMachineRunCommandsListResultPreparer prepares a request to retrieve the next set of results. 16508// It returns nil if no more results exist. 16509func (vmrclr VirtualMachineRunCommandsListResult) virtualMachineRunCommandsListResultPreparer(ctx context.Context) (*http.Request, error) { 16510 if !vmrclr.hasNextLink() { 16511 return nil, nil 16512 } 16513 return autorest.Prepare((&http.Request{}).WithContext(ctx), 16514 autorest.AsJSON(), 16515 autorest.AsGet(), 16516 autorest.WithBaseURL(to.String(vmrclr.NextLink))) 16517} 16518 16519// VirtualMachineRunCommandsListResultPage contains a page of VirtualMachineRunCommand values. 16520type VirtualMachineRunCommandsListResultPage struct { 16521 fn func(context.Context, VirtualMachineRunCommandsListResult) (VirtualMachineRunCommandsListResult, error) 16522 vmrclr VirtualMachineRunCommandsListResult 16523} 16524 16525// NextWithContext advances to the next page of values. If there was an error making 16526// the request the page does not advance and the error is returned. 16527func (page *VirtualMachineRunCommandsListResultPage) NextWithContext(ctx context.Context) (err error) { 16528 if tracing.IsEnabled() { 16529 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsListResultPage.NextWithContext") 16530 defer func() { 16531 sc := -1 16532 if page.Response().Response.Response != nil { 16533 sc = page.Response().Response.Response.StatusCode 16534 } 16535 tracing.EndSpan(ctx, sc, err) 16536 }() 16537 } 16538 for { 16539 next, err := page.fn(ctx, page.vmrclr) 16540 if err != nil { 16541 return err 16542 } 16543 page.vmrclr = next 16544 if !next.hasNextLink() || !next.IsEmpty() { 16545 break 16546 } 16547 } 16548 return nil 16549} 16550 16551// Next advances to the next page of values. If there was an error making 16552// the request the page does not advance and the error is returned. 16553// Deprecated: Use NextWithContext() instead. 16554func (page *VirtualMachineRunCommandsListResultPage) Next() error { 16555 return page.NextWithContext(context.Background()) 16556} 16557 16558// NotDone returns true if the page enumeration should be started or is not yet complete. 16559func (page VirtualMachineRunCommandsListResultPage) NotDone() bool { 16560 return !page.vmrclr.IsEmpty() 16561} 16562 16563// Response returns the raw server response from the last page request. 16564func (page VirtualMachineRunCommandsListResultPage) Response() VirtualMachineRunCommandsListResult { 16565 return page.vmrclr 16566} 16567 16568// Values returns the slice of values for the current page or nil if there are no values. 16569func (page VirtualMachineRunCommandsListResultPage) Values() []VirtualMachineRunCommand { 16570 if page.vmrclr.IsEmpty() { 16571 return nil 16572 } 16573 return *page.vmrclr.Value 16574} 16575 16576// Creates a new instance of the VirtualMachineRunCommandsListResultPage type. 16577func NewVirtualMachineRunCommandsListResultPage(cur VirtualMachineRunCommandsListResult, getNextPage func(context.Context, VirtualMachineRunCommandsListResult) (VirtualMachineRunCommandsListResult, error)) VirtualMachineRunCommandsListResultPage { 16578 return VirtualMachineRunCommandsListResultPage{ 16579 fn: getNextPage, 16580 vmrclr: cur, 16581 } 16582} 16583 16584// VirtualMachineRunCommandsUpdateFuture an abstraction for monitoring and retrieving the results of a 16585// long-running operation. 16586type VirtualMachineRunCommandsUpdateFuture struct { 16587 azure.FutureAPI 16588 // Result returns the result of the asynchronous operation. 16589 // If the operation has not completed it will return an error. 16590 Result func(VirtualMachineRunCommandsClient) (VirtualMachineRunCommand, error) 16591} 16592 16593// UnmarshalJSON is the custom unmarshaller for CreateFuture. 16594func (future *VirtualMachineRunCommandsUpdateFuture) UnmarshalJSON(body []byte) error { 16595 var azFuture azure.Future 16596 if err := json.Unmarshal(body, &azFuture); err != nil { 16597 return err 16598 } 16599 future.FutureAPI = &azFuture 16600 future.Result = future.result 16601 return nil 16602} 16603 16604// result is the default implementation for VirtualMachineRunCommandsUpdateFuture.Result. 16605func (future *VirtualMachineRunCommandsUpdateFuture) result(client VirtualMachineRunCommandsClient) (vmrc VirtualMachineRunCommand, err error) { 16606 var done bool 16607 done, err = future.DoneWithContext(context.Background(), client) 16608 if err != nil { 16609 err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsUpdateFuture", "Result", future.Response(), "Polling failure") 16610 return 16611 } 16612 if !done { 16613 vmrc.Response.Response = future.Response() 16614 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineRunCommandsUpdateFuture") 16615 return 16616 } 16617 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 16618 if vmrc.Response.Response, err = future.GetResult(sender); err == nil && vmrc.Response.Response.StatusCode != http.StatusNoContent { 16619 vmrc, err = client.UpdateResponder(vmrc.Response.Response) 16620 if err != nil { 16621 err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsUpdateFuture", "Result", vmrc.Response.Response, "Failure responding to request") 16622 } 16623 } 16624 return 16625} 16626 16627// VirtualMachineRunCommandUpdate describes a Virtual Machine run command. 16628type VirtualMachineRunCommandUpdate struct { 16629 *VirtualMachineRunCommandProperties `json:"properties,omitempty"` 16630 // Tags - Resource tags 16631 Tags map[string]*string `json:"tags"` 16632} 16633 16634// MarshalJSON is the custom marshaler for VirtualMachineRunCommandUpdate. 16635func (vmrcu VirtualMachineRunCommandUpdate) MarshalJSON() ([]byte, error) { 16636 objectMap := make(map[string]interface{}) 16637 if vmrcu.VirtualMachineRunCommandProperties != nil { 16638 objectMap["properties"] = vmrcu.VirtualMachineRunCommandProperties 16639 } 16640 if vmrcu.Tags != nil { 16641 objectMap["tags"] = vmrcu.Tags 16642 } 16643 return json.Marshal(objectMap) 16644} 16645 16646// UnmarshalJSON is the custom unmarshaler for VirtualMachineRunCommandUpdate struct. 16647func (vmrcu *VirtualMachineRunCommandUpdate) UnmarshalJSON(body []byte) error { 16648 var m map[string]*json.RawMessage 16649 err := json.Unmarshal(body, &m) 16650 if err != nil { 16651 return err 16652 } 16653 for k, v := range m { 16654 switch k { 16655 case "properties": 16656 if v != nil { 16657 var virtualMachineRunCommandProperties VirtualMachineRunCommandProperties 16658 err = json.Unmarshal(*v, &virtualMachineRunCommandProperties) 16659 if err != nil { 16660 return err 16661 } 16662 vmrcu.VirtualMachineRunCommandProperties = &virtualMachineRunCommandProperties 16663 } 16664 case "tags": 16665 if v != nil { 16666 var tags map[string]*string 16667 err = json.Unmarshal(*v, &tags) 16668 if err != nil { 16669 return err 16670 } 16671 vmrcu.Tags = tags 16672 } 16673 } 16674 } 16675 16676 return nil 16677} 16678 16679// VirtualMachinesAssessPatchesFuture an abstraction for monitoring and retrieving the results of a 16680// long-running operation. 16681type VirtualMachinesAssessPatchesFuture struct { 16682 azure.FutureAPI 16683 // Result returns the result of the asynchronous operation. 16684 // If the operation has not completed it will return an error. 16685 Result func(VirtualMachinesClient) (VirtualMachineAssessPatchesResult, error) 16686} 16687 16688// UnmarshalJSON is the custom unmarshaller for CreateFuture. 16689func (future *VirtualMachinesAssessPatchesFuture) UnmarshalJSON(body []byte) error { 16690 var azFuture azure.Future 16691 if err := json.Unmarshal(body, &azFuture); err != nil { 16692 return err 16693 } 16694 future.FutureAPI = &azFuture 16695 future.Result = future.result 16696 return nil 16697} 16698 16699// result is the default implementation for VirtualMachinesAssessPatchesFuture.Result. 16700func (future *VirtualMachinesAssessPatchesFuture) result(client VirtualMachinesClient) (vmapr VirtualMachineAssessPatchesResult, err error) { 16701 var done bool 16702 done, err = future.DoneWithContext(context.Background(), client) 16703 if err != nil { 16704 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesAssessPatchesFuture", "Result", future.Response(), "Polling failure") 16705 return 16706 } 16707 if !done { 16708 vmapr.Response.Response = future.Response() 16709 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesAssessPatchesFuture") 16710 return 16711 } 16712 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 16713 if vmapr.Response.Response, err = future.GetResult(sender); err == nil && vmapr.Response.Response.StatusCode != http.StatusNoContent { 16714 vmapr, err = client.AssessPatchesResponder(vmapr.Response.Response) 16715 if err != nil { 16716 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesAssessPatchesFuture", "Result", vmapr.Response.Response, "Failure responding to request") 16717 } 16718 } 16719 return 16720} 16721 16722// VirtualMachineScaleSet describes a Virtual Machine Scale Set. 16723type VirtualMachineScaleSet struct { 16724 autorest.Response `json:"-"` 16725 // Sku - The virtual machine scale set sku. 16726 Sku *Sku `json:"sku,omitempty"` 16727 // 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**. 16728 Plan *Plan `json:"plan,omitempty"` 16729 *VirtualMachineScaleSetProperties `json:"properties,omitempty"` 16730 // Identity - The identity of the virtual machine scale set, if configured. 16731 Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"` 16732 // Zones - The virtual machine scale set zones. NOTE: Availability zones can only be set when you create the scale set 16733 Zones *[]string `json:"zones,omitempty"` 16734 // ExtendedLocation - The extended location of the Virtual Machine Scale Set. 16735 ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` 16736 // ID - READ-ONLY; Resource Id 16737 ID *string `json:"id,omitempty"` 16738 // Name - READ-ONLY; Resource name 16739 Name *string `json:"name,omitempty"` 16740 // Type - READ-ONLY; Resource type 16741 Type *string `json:"type,omitempty"` 16742 // Location - Resource location 16743 Location *string `json:"location,omitempty"` 16744 // Tags - Resource tags 16745 Tags map[string]*string `json:"tags"` 16746} 16747 16748// MarshalJSON is the custom marshaler for VirtualMachineScaleSet. 16749func (vmss VirtualMachineScaleSet) MarshalJSON() ([]byte, error) { 16750 objectMap := make(map[string]interface{}) 16751 if vmss.Sku != nil { 16752 objectMap["sku"] = vmss.Sku 16753 } 16754 if vmss.Plan != nil { 16755 objectMap["plan"] = vmss.Plan 16756 } 16757 if vmss.VirtualMachineScaleSetProperties != nil { 16758 objectMap["properties"] = vmss.VirtualMachineScaleSetProperties 16759 } 16760 if vmss.Identity != nil { 16761 objectMap["identity"] = vmss.Identity 16762 } 16763 if vmss.Zones != nil { 16764 objectMap["zones"] = vmss.Zones 16765 } 16766 if vmss.ExtendedLocation != nil { 16767 objectMap["extendedLocation"] = vmss.ExtendedLocation 16768 } 16769 if vmss.Location != nil { 16770 objectMap["location"] = vmss.Location 16771 } 16772 if vmss.Tags != nil { 16773 objectMap["tags"] = vmss.Tags 16774 } 16775 return json.Marshal(objectMap) 16776} 16777 16778// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSet struct. 16779func (vmss *VirtualMachineScaleSet) UnmarshalJSON(body []byte) error { 16780 var m map[string]*json.RawMessage 16781 err := json.Unmarshal(body, &m) 16782 if err != nil { 16783 return err 16784 } 16785 for k, v := range m { 16786 switch k { 16787 case "sku": 16788 if v != nil { 16789 var sku Sku 16790 err = json.Unmarshal(*v, &sku) 16791 if err != nil { 16792 return err 16793 } 16794 vmss.Sku = &sku 16795 } 16796 case "plan": 16797 if v != nil { 16798 var plan Plan 16799 err = json.Unmarshal(*v, &plan) 16800 if err != nil { 16801 return err 16802 } 16803 vmss.Plan = &plan 16804 } 16805 case "properties": 16806 if v != nil { 16807 var virtualMachineScaleSetProperties VirtualMachineScaleSetProperties 16808 err = json.Unmarshal(*v, &virtualMachineScaleSetProperties) 16809 if err != nil { 16810 return err 16811 } 16812 vmss.VirtualMachineScaleSetProperties = &virtualMachineScaleSetProperties 16813 } 16814 case "identity": 16815 if v != nil { 16816 var identity VirtualMachineScaleSetIdentity 16817 err = json.Unmarshal(*v, &identity) 16818 if err != nil { 16819 return err 16820 } 16821 vmss.Identity = &identity 16822 } 16823 case "zones": 16824 if v != nil { 16825 var zones []string 16826 err = json.Unmarshal(*v, &zones) 16827 if err != nil { 16828 return err 16829 } 16830 vmss.Zones = &zones 16831 } 16832 case "extendedLocation": 16833 if v != nil { 16834 var extendedLocation ExtendedLocation 16835 err = json.Unmarshal(*v, &extendedLocation) 16836 if err != nil { 16837 return err 16838 } 16839 vmss.ExtendedLocation = &extendedLocation 16840 } 16841 case "id": 16842 if v != nil { 16843 var ID string 16844 err = json.Unmarshal(*v, &ID) 16845 if err != nil { 16846 return err 16847 } 16848 vmss.ID = &ID 16849 } 16850 case "name": 16851 if v != nil { 16852 var name string 16853 err = json.Unmarshal(*v, &name) 16854 if err != nil { 16855 return err 16856 } 16857 vmss.Name = &name 16858 } 16859 case "type": 16860 if v != nil { 16861 var typeVar string 16862 err = json.Unmarshal(*v, &typeVar) 16863 if err != nil { 16864 return err 16865 } 16866 vmss.Type = &typeVar 16867 } 16868 case "location": 16869 if v != nil { 16870 var location string 16871 err = json.Unmarshal(*v, &location) 16872 if err != nil { 16873 return err 16874 } 16875 vmss.Location = &location 16876 } 16877 case "tags": 16878 if v != nil { 16879 var tags map[string]*string 16880 err = json.Unmarshal(*v, &tags) 16881 if err != nil { 16882 return err 16883 } 16884 vmss.Tags = tags 16885 } 16886 } 16887 } 16888 16889 return nil 16890} 16891 16892// VirtualMachineScaleSetDataDisk describes a virtual machine scale set data disk. 16893type VirtualMachineScaleSetDataDisk struct { 16894 // Name - The disk name. 16895 Name *string `json:"name,omitempty"` 16896 // 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. 16897 Lun *int32 `json:"lun,omitempty"` 16898 // 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' 16899 Caching CachingTypes `json:"caching,omitempty"` 16900 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 16901 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 16902 // CreateOption - The create option. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' 16903 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 16904 // 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 16905 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 16906 // ManagedDisk - The managed disk parameters. 16907 ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` 16908 // 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. 16909 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 16910 // 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. 16911 DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` 16912} 16913 16914// VirtualMachineScaleSetExtension describes a Virtual Machine Scale Set Extension. 16915type VirtualMachineScaleSetExtension struct { 16916 autorest.Response `json:"-"` 16917 // Name - The name of the extension. 16918 Name *string `json:"name,omitempty"` 16919 // Type - READ-ONLY; Resource type 16920 Type *string `json:"type,omitempty"` 16921 *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"` 16922 // ID - READ-ONLY; Resource Id 16923 ID *string `json:"id,omitempty"` 16924} 16925 16926// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtension. 16927func (vmsse VirtualMachineScaleSetExtension) MarshalJSON() ([]byte, error) { 16928 objectMap := make(map[string]interface{}) 16929 if vmsse.Name != nil { 16930 objectMap["name"] = vmsse.Name 16931 } 16932 if vmsse.VirtualMachineScaleSetExtensionProperties != nil { 16933 objectMap["properties"] = vmsse.VirtualMachineScaleSetExtensionProperties 16934 } 16935 return json.Marshal(objectMap) 16936} 16937 16938// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetExtension struct. 16939func (vmsse *VirtualMachineScaleSetExtension) UnmarshalJSON(body []byte) error { 16940 var m map[string]*json.RawMessage 16941 err := json.Unmarshal(body, &m) 16942 if err != nil { 16943 return err 16944 } 16945 for k, v := range m { 16946 switch k { 16947 case "name": 16948 if v != nil { 16949 var name string 16950 err = json.Unmarshal(*v, &name) 16951 if err != nil { 16952 return err 16953 } 16954 vmsse.Name = &name 16955 } 16956 case "type": 16957 if v != nil { 16958 var typeVar string 16959 err = json.Unmarshal(*v, &typeVar) 16960 if err != nil { 16961 return err 16962 } 16963 vmsse.Type = &typeVar 16964 } 16965 case "properties": 16966 if v != nil { 16967 var virtualMachineScaleSetExtensionProperties VirtualMachineScaleSetExtensionProperties 16968 err = json.Unmarshal(*v, &virtualMachineScaleSetExtensionProperties) 16969 if err != nil { 16970 return err 16971 } 16972 vmsse.VirtualMachineScaleSetExtensionProperties = &virtualMachineScaleSetExtensionProperties 16973 } 16974 case "id": 16975 if v != nil { 16976 var ID string 16977 err = json.Unmarshal(*v, &ID) 16978 if err != nil { 16979 return err 16980 } 16981 vmsse.ID = &ID 16982 } 16983 } 16984 } 16985 16986 return nil 16987} 16988 16989// VirtualMachineScaleSetExtensionListResult the List VM scale set extension operation response. 16990type VirtualMachineScaleSetExtensionListResult struct { 16991 autorest.Response `json:"-"` 16992 // Value - The list of VM scale set extensions. 16993 Value *[]VirtualMachineScaleSetExtension `json:"value,omitempty"` 16994 // 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. 16995 NextLink *string `json:"nextLink,omitempty"` 16996} 16997 16998// VirtualMachineScaleSetExtensionListResultIterator provides access to a complete listing of 16999// VirtualMachineScaleSetExtension values. 17000type VirtualMachineScaleSetExtensionListResultIterator struct { 17001 i int 17002 page VirtualMachineScaleSetExtensionListResultPage 17003} 17004 17005// NextWithContext advances to the next value. If there was an error making 17006// the request the iterator does not advance and the error is returned. 17007func (iter *VirtualMachineScaleSetExtensionListResultIterator) NextWithContext(ctx context.Context) (err error) { 17008 if tracing.IsEnabled() { 17009 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionListResultIterator.NextWithContext") 17010 defer func() { 17011 sc := -1 17012 if iter.Response().Response.Response != nil { 17013 sc = iter.Response().Response.Response.StatusCode 17014 } 17015 tracing.EndSpan(ctx, sc, err) 17016 }() 17017 } 17018 iter.i++ 17019 if iter.i < len(iter.page.Values()) { 17020 return nil 17021 } 17022 err = iter.page.NextWithContext(ctx) 17023 if err != nil { 17024 iter.i-- 17025 return err 17026 } 17027 iter.i = 0 17028 return nil 17029} 17030 17031// Next advances to the next value. If there was an error making 17032// the request the iterator does not advance and the error is returned. 17033// Deprecated: Use NextWithContext() instead. 17034func (iter *VirtualMachineScaleSetExtensionListResultIterator) Next() error { 17035 return iter.NextWithContext(context.Background()) 17036} 17037 17038// NotDone returns true if the enumeration should be started or is not yet complete. 17039func (iter VirtualMachineScaleSetExtensionListResultIterator) NotDone() bool { 17040 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 17041} 17042 17043// Response returns the raw server response from the last page request. 17044func (iter VirtualMachineScaleSetExtensionListResultIterator) Response() VirtualMachineScaleSetExtensionListResult { 17045 return iter.page.Response() 17046} 17047 17048// Value returns the current value or a zero-initialized value if the 17049// iterator has advanced beyond the end of the collection. 17050func (iter VirtualMachineScaleSetExtensionListResultIterator) Value() VirtualMachineScaleSetExtension { 17051 if !iter.page.NotDone() { 17052 return VirtualMachineScaleSetExtension{} 17053 } 17054 return iter.page.Values()[iter.i] 17055} 17056 17057// Creates a new instance of the VirtualMachineScaleSetExtensionListResultIterator type. 17058func NewVirtualMachineScaleSetExtensionListResultIterator(page VirtualMachineScaleSetExtensionListResultPage) VirtualMachineScaleSetExtensionListResultIterator { 17059 return VirtualMachineScaleSetExtensionListResultIterator{page: page} 17060} 17061 17062// IsEmpty returns true if the ListResult contains no values. 17063func (vmsselr VirtualMachineScaleSetExtensionListResult) IsEmpty() bool { 17064 return vmsselr.Value == nil || len(*vmsselr.Value) == 0 17065} 17066 17067// hasNextLink returns true if the NextLink is not empty. 17068func (vmsselr VirtualMachineScaleSetExtensionListResult) hasNextLink() bool { 17069 return vmsselr.NextLink != nil && len(*vmsselr.NextLink) != 0 17070} 17071 17072// virtualMachineScaleSetExtensionListResultPreparer prepares a request to retrieve the next set of results. 17073// It returns nil if no more results exist. 17074func (vmsselr VirtualMachineScaleSetExtensionListResult) virtualMachineScaleSetExtensionListResultPreparer(ctx context.Context) (*http.Request, error) { 17075 if !vmsselr.hasNextLink() { 17076 return nil, nil 17077 } 17078 return autorest.Prepare((&http.Request{}).WithContext(ctx), 17079 autorest.AsJSON(), 17080 autorest.AsGet(), 17081 autorest.WithBaseURL(to.String(vmsselr.NextLink))) 17082} 17083 17084// VirtualMachineScaleSetExtensionListResultPage contains a page of VirtualMachineScaleSetExtension values. 17085type VirtualMachineScaleSetExtensionListResultPage struct { 17086 fn func(context.Context, VirtualMachineScaleSetExtensionListResult) (VirtualMachineScaleSetExtensionListResult, error) 17087 vmsselr VirtualMachineScaleSetExtensionListResult 17088} 17089 17090// NextWithContext advances to the next page of values. If there was an error making 17091// the request the page does not advance and the error is returned. 17092func (page *VirtualMachineScaleSetExtensionListResultPage) NextWithContext(ctx context.Context) (err error) { 17093 if tracing.IsEnabled() { 17094 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionListResultPage.NextWithContext") 17095 defer func() { 17096 sc := -1 17097 if page.Response().Response.Response != nil { 17098 sc = page.Response().Response.Response.StatusCode 17099 } 17100 tracing.EndSpan(ctx, sc, err) 17101 }() 17102 } 17103 for { 17104 next, err := page.fn(ctx, page.vmsselr) 17105 if err != nil { 17106 return err 17107 } 17108 page.vmsselr = next 17109 if !next.hasNextLink() || !next.IsEmpty() { 17110 break 17111 } 17112 } 17113 return nil 17114} 17115 17116// Next advances to the next page of values. If there was an error making 17117// the request the page does not advance and the error is returned. 17118// Deprecated: Use NextWithContext() instead. 17119func (page *VirtualMachineScaleSetExtensionListResultPage) Next() error { 17120 return page.NextWithContext(context.Background()) 17121} 17122 17123// NotDone returns true if the page enumeration should be started or is not yet complete. 17124func (page VirtualMachineScaleSetExtensionListResultPage) NotDone() bool { 17125 return !page.vmsselr.IsEmpty() 17126} 17127 17128// Response returns the raw server response from the last page request. 17129func (page VirtualMachineScaleSetExtensionListResultPage) Response() VirtualMachineScaleSetExtensionListResult { 17130 return page.vmsselr 17131} 17132 17133// Values returns the slice of values for the current page or nil if there are no values. 17134func (page VirtualMachineScaleSetExtensionListResultPage) Values() []VirtualMachineScaleSetExtension { 17135 if page.vmsselr.IsEmpty() { 17136 return nil 17137 } 17138 return *page.vmsselr.Value 17139} 17140 17141// Creates a new instance of the VirtualMachineScaleSetExtensionListResultPage type. 17142func NewVirtualMachineScaleSetExtensionListResultPage(cur VirtualMachineScaleSetExtensionListResult, getNextPage func(context.Context, VirtualMachineScaleSetExtensionListResult) (VirtualMachineScaleSetExtensionListResult, error)) VirtualMachineScaleSetExtensionListResultPage { 17143 return VirtualMachineScaleSetExtensionListResultPage{ 17144 fn: getNextPage, 17145 vmsselr: cur, 17146 } 17147} 17148 17149// VirtualMachineScaleSetExtensionProfile describes a virtual machine scale set extension profile. 17150type VirtualMachineScaleSetExtensionProfile struct { 17151 // Extensions - The virtual machine scale set child extension resources. 17152 Extensions *[]VirtualMachineScaleSetExtension `json:"extensions,omitempty"` 17153 // 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 17154 ExtensionsTimeBudget *string `json:"extensionsTimeBudget,omitempty"` 17155} 17156 17157// VirtualMachineScaleSetExtensionProperties describes the properties of a Virtual Machine Scale Set 17158// Extension. 17159type VirtualMachineScaleSetExtensionProperties struct { 17160 // 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. 17161 ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` 17162 // Publisher - The name of the extension handler publisher. 17163 Publisher *string `json:"publisher,omitempty"` 17164 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 17165 Type *string `json:"type,omitempty"` 17166 // TypeHandlerVersion - Specifies the version of the script handler. 17167 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 17168 // 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. 17169 AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` 17170 // EnableAutomaticUpgrade - Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. 17171 EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` 17172 // Settings - Json formatted public settings for the extension. 17173 Settings interface{} `json:"settings,omitempty"` 17174 // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. 17175 ProtectedSettings interface{} `json:"protectedSettings,omitempty"` 17176 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 17177 ProvisioningState *string `json:"provisioningState,omitempty"` 17178 // ProvisionAfterExtensions - Collection of extension names after which this extension needs to be provisioned. 17179 ProvisionAfterExtensions *[]string `json:"provisionAfterExtensions,omitempty"` 17180} 17181 17182// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtensionProperties. 17183func (vmssep VirtualMachineScaleSetExtensionProperties) MarshalJSON() ([]byte, error) { 17184 objectMap := make(map[string]interface{}) 17185 if vmssep.ForceUpdateTag != nil { 17186 objectMap["forceUpdateTag"] = vmssep.ForceUpdateTag 17187 } 17188 if vmssep.Publisher != nil { 17189 objectMap["publisher"] = vmssep.Publisher 17190 } 17191 if vmssep.Type != nil { 17192 objectMap["type"] = vmssep.Type 17193 } 17194 if vmssep.TypeHandlerVersion != nil { 17195 objectMap["typeHandlerVersion"] = vmssep.TypeHandlerVersion 17196 } 17197 if vmssep.AutoUpgradeMinorVersion != nil { 17198 objectMap["autoUpgradeMinorVersion"] = vmssep.AutoUpgradeMinorVersion 17199 } 17200 if vmssep.EnableAutomaticUpgrade != nil { 17201 objectMap["enableAutomaticUpgrade"] = vmssep.EnableAutomaticUpgrade 17202 } 17203 if vmssep.Settings != nil { 17204 objectMap["settings"] = vmssep.Settings 17205 } 17206 if vmssep.ProtectedSettings != nil { 17207 objectMap["protectedSettings"] = vmssep.ProtectedSettings 17208 } 17209 if vmssep.ProvisionAfterExtensions != nil { 17210 objectMap["provisionAfterExtensions"] = vmssep.ProvisionAfterExtensions 17211 } 17212 return json.Marshal(objectMap) 17213} 17214 17215// VirtualMachineScaleSetExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the 17216// results of a long-running operation. 17217type VirtualMachineScaleSetExtensionsCreateOrUpdateFuture struct { 17218 azure.FutureAPI 17219 // Result returns the result of the asynchronous operation. 17220 // If the operation has not completed it will return an error. 17221 Result func(VirtualMachineScaleSetExtensionsClient) (VirtualMachineScaleSetExtension, error) 17222} 17223 17224// UnmarshalJSON is the custom unmarshaller for CreateFuture. 17225func (future *VirtualMachineScaleSetExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 17226 var azFuture azure.Future 17227 if err := json.Unmarshal(body, &azFuture); err != nil { 17228 return err 17229 } 17230 future.FutureAPI = &azFuture 17231 future.Result = future.result 17232 return nil 17233} 17234 17235// result is the default implementation for VirtualMachineScaleSetExtensionsCreateOrUpdateFuture.Result. 17236func (future *VirtualMachineScaleSetExtensionsCreateOrUpdateFuture) result(client VirtualMachineScaleSetExtensionsClient) (vmsse VirtualMachineScaleSetExtension, err error) { 17237 var done bool 17238 done, err = future.DoneWithContext(context.Background(), client) 17239 if err != nil { 17240 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 17241 return 17242 } 17243 if !done { 17244 vmsse.Response.Response = future.Response() 17245 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture") 17246 return 17247 } 17248 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 17249 if vmsse.Response.Response, err = future.GetResult(sender); err == nil && vmsse.Response.Response.StatusCode != http.StatusNoContent { 17250 vmsse, err = client.CreateOrUpdateResponder(vmsse.Response.Response) 17251 if err != nil { 17252 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture", "Result", vmsse.Response.Response, "Failure responding to request") 17253 } 17254 } 17255 return 17256} 17257 17258// VirtualMachineScaleSetExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of 17259// a long-running operation. 17260type VirtualMachineScaleSetExtensionsDeleteFuture struct { 17261 azure.FutureAPI 17262 // Result returns the result of the asynchronous operation. 17263 // If the operation has not completed it will return an error. 17264 Result func(VirtualMachineScaleSetExtensionsClient) (autorest.Response, error) 17265} 17266 17267// UnmarshalJSON is the custom unmarshaller for CreateFuture. 17268func (future *VirtualMachineScaleSetExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { 17269 var azFuture azure.Future 17270 if err := json.Unmarshal(body, &azFuture); err != nil { 17271 return err 17272 } 17273 future.FutureAPI = &azFuture 17274 future.Result = future.result 17275 return nil 17276} 17277 17278// result is the default implementation for VirtualMachineScaleSetExtensionsDeleteFuture.Result. 17279func (future *VirtualMachineScaleSetExtensionsDeleteFuture) result(client VirtualMachineScaleSetExtensionsClient) (ar autorest.Response, err error) { 17280 var done bool 17281 done, err = future.DoneWithContext(context.Background(), client) 17282 if err != nil { 17283 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") 17284 return 17285 } 17286 if !done { 17287 ar.Response = future.Response() 17288 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsDeleteFuture") 17289 return 17290 } 17291 ar.Response = future.Response() 17292 return 17293} 17294 17295// VirtualMachineScaleSetExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of 17296// a long-running operation. 17297type VirtualMachineScaleSetExtensionsUpdateFuture struct { 17298 azure.FutureAPI 17299 // Result returns the result of the asynchronous operation. 17300 // If the operation has not completed it will return an error. 17301 Result func(VirtualMachineScaleSetExtensionsClient) (VirtualMachineScaleSetExtension, error) 17302} 17303 17304// UnmarshalJSON is the custom unmarshaller for CreateFuture. 17305func (future *VirtualMachineScaleSetExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { 17306 var azFuture azure.Future 17307 if err := json.Unmarshal(body, &azFuture); err != nil { 17308 return err 17309 } 17310 future.FutureAPI = &azFuture 17311 future.Result = future.result 17312 return nil 17313} 17314 17315// result is the default implementation for VirtualMachineScaleSetExtensionsUpdateFuture.Result. 17316func (future *VirtualMachineScaleSetExtensionsUpdateFuture) result(client VirtualMachineScaleSetExtensionsClient) (vmsse VirtualMachineScaleSetExtension, err error) { 17317 var done bool 17318 done, err = future.DoneWithContext(context.Background(), client) 17319 if err != nil { 17320 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsUpdateFuture", "Result", future.Response(), "Polling failure") 17321 return 17322 } 17323 if !done { 17324 vmsse.Response.Response = future.Response() 17325 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsUpdateFuture") 17326 return 17327 } 17328 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 17329 if vmsse.Response.Response, err = future.GetResult(sender); err == nil && vmsse.Response.Response.StatusCode != http.StatusNoContent { 17330 vmsse, err = client.UpdateResponder(vmsse.Response.Response) 17331 if err != nil { 17332 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsUpdateFuture", "Result", vmsse.Response.Response, "Failure responding to request") 17333 } 17334 } 17335 return 17336} 17337 17338// VirtualMachineScaleSetExtensionUpdate describes a Virtual Machine Scale Set Extension. 17339type VirtualMachineScaleSetExtensionUpdate struct { 17340 // Name - READ-ONLY; The name of the extension. 17341 Name *string `json:"name,omitempty"` 17342 // Type - READ-ONLY; Resource type 17343 Type *string `json:"type,omitempty"` 17344 *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"` 17345 // ID - READ-ONLY; Resource Id 17346 ID *string `json:"id,omitempty"` 17347} 17348 17349// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtensionUpdate. 17350func (vmsseu VirtualMachineScaleSetExtensionUpdate) MarshalJSON() ([]byte, error) { 17351 objectMap := make(map[string]interface{}) 17352 if vmsseu.VirtualMachineScaleSetExtensionProperties != nil { 17353 objectMap["properties"] = vmsseu.VirtualMachineScaleSetExtensionProperties 17354 } 17355 return json.Marshal(objectMap) 17356} 17357 17358// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetExtensionUpdate struct. 17359func (vmsseu *VirtualMachineScaleSetExtensionUpdate) UnmarshalJSON(body []byte) error { 17360 var m map[string]*json.RawMessage 17361 err := json.Unmarshal(body, &m) 17362 if err != nil { 17363 return err 17364 } 17365 for k, v := range m { 17366 switch k { 17367 case "name": 17368 if v != nil { 17369 var name string 17370 err = json.Unmarshal(*v, &name) 17371 if err != nil { 17372 return err 17373 } 17374 vmsseu.Name = &name 17375 } 17376 case "type": 17377 if v != nil { 17378 var typeVar string 17379 err = json.Unmarshal(*v, &typeVar) 17380 if err != nil { 17381 return err 17382 } 17383 vmsseu.Type = &typeVar 17384 } 17385 case "properties": 17386 if v != nil { 17387 var virtualMachineScaleSetExtensionProperties VirtualMachineScaleSetExtensionProperties 17388 err = json.Unmarshal(*v, &virtualMachineScaleSetExtensionProperties) 17389 if err != nil { 17390 return err 17391 } 17392 vmsseu.VirtualMachineScaleSetExtensionProperties = &virtualMachineScaleSetExtensionProperties 17393 } 17394 case "id": 17395 if v != nil { 17396 var ID string 17397 err = json.Unmarshal(*v, &ID) 17398 if err != nil { 17399 return err 17400 } 17401 vmsseu.ID = &ID 17402 } 17403 } 17404 } 17405 17406 return nil 17407} 17408 17409// VirtualMachineScaleSetIdentity identity for the virtual machine scale set. 17410type VirtualMachineScaleSetIdentity struct { 17411 // PrincipalID - READ-ONLY; The principal id of virtual machine scale set identity. This property will only be provided for a system assigned identity. 17412 PrincipalID *string `json:"principalId,omitempty"` 17413 // TenantID - READ-ONLY; The tenant id associated with the virtual machine scale set. This property will only be provided for a system assigned identity. 17414 TenantID *string `json:"tenantId,omitempty"` 17415 // 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' 17416 Type ResourceIdentityType `json:"type,omitempty"` 17417 // 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}'. 17418 UserAssignedIdentities map[string]*VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` 17419} 17420 17421// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIdentity. 17422func (vmssi VirtualMachineScaleSetIdentity) MarshalJSON() ([]byte, error) { 17423 objectMap := make(map[string]interface{}) 17424 if vmssi.Type != "" { 17425 objectMap["type"] = vmssi.Type 17426 } 17427 if vmssi.UserAssignedIdentities != nil { 17428 objectMap["userAssignedIdentities"] = vmssi.UserAssignedIdentities 17429 } 17430 return json.Marshal(objectMap) 17431} 17432 17433// VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue ... 17434type VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue struct { 17435 // PrincipalID - READ-ONLY; The principal id of user assigned identity. 17436 PrincipalID *string `json:"principalId,omitempty"` 17437 // ClientID - READ-ONLY; The client id of user assigned identity. 17438 ClientID *string `json:"clientId,omitempty"` 17439} 17440 17441// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue. 17442func (vmssiAiv VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) { 17443 objectMap := make(map[string]interface{}) 17444 return json.Marshal(objectMap) 17445} 17446 17447// VirtualMachineScaleSetInstanceView the instance view of a virtual machine scale set. 17448type VirtualMachineScaleSetInstanceView struct { 17449 autorest.Response `json:"-"` 17450 // VirtualMachine - READ-ONLY; The instance view status summary for the virtual machine scale set. 17451 VirtualMachine *VirtualMachineScaleSetInstanceViewStatusesSummary `json:"virtualMachine,omitempty"` 17452 // Extensions - READ-ONLY; The extensions information. 17453 Extensions *[]VirtualMachineScaleSetVMExtensionsSummary `json:"extensions,omitempty"` 17454 // Statuses - The resource status information. 17455 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 17456 // OrchestrationServices - READ-ONLY; The orchestration services information. 17457 OrchestrationServices *[]OrchestrationServiceSummary `json:"orchestrationServices,omitempty"` 17458} 17459 17460// MarshalJSON is the custom marshaler for VirtualMachineScaleSetInstanceView. 17461func (vmssiv VirtualMachineScaleSetInstanceView) MarshalJSON() ([]byte, error) { 17462 objectMap := make(map[string]interface{}) 17463 if vmssiv.Statuses != nil { 17464 objectMap["statuses"] = vmssiv.Statuses 17465 } 17466 return json.Marshal(objectMap) 17467} 17468 17469// VirtualMachineScaleSetInstanceViewStatusesSummary instance view statuses summary for virtual machines of 17470// a virtual machine scale set. 17471type VirtualMachineScaleSetInstanceViewStatusesSummary struct { 17472 // StatusesSummary - READ-ONLY; The extensions information. 17473 StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` 17474} 17475 17476// MarshalJSON is the custom marshaler for VirtualMachineScaleSetInstanceViewStatusesSummary. 17477func (vmssivss VirtualMachineScaleSetInstanceViewStatusesSummary) MarshalJSON() ([]byte, error) { 17478 objectMap := make(map[string]interface{}) 17479 return json.Marshal(objectMap) 17480} 17481 17482// VirtualMachineScaleSetIPConfiguration describes a virtual machine scale set network profile's IP 17483// configuration. 17484type VirtualMachineScaleSetIPConfiguration struct { 17485 // Name - The IP configuration name. 17486 Name *string `json:"name,omitempty"` 17487 *VirtualMachineScaleSetIPConfigurationProperties `json:"properties,omitempty"` 17488 // ID - Resource Id 17489 ID *string `json:"id,omitempty"` 17490} 17491 17492// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIPConfiguration. 17493func (vmssic VirtualMachineScaleSetIPConfiguration) MarshalJSON() ([]byte, error) { 17494 objectMap := make(map[string]interface{}) 17495 if vmssic.Name != nil { 17496 objectMap["name"] = vmssic.Name 17497 } 17498 if vmssic.VirtualMachineScaleSetIPConfigurationProperties != nil { 17499 objectMap["properties"] = vmssic.VirtualMachineScaleSetIPConfigurationProperties 17500 } 17501 if vmssic.ID != nil { 17502 objectMap["id"] = vmssic.ID 17503 } 17504 return json.Marshal(objectMap) 17505} 17506 17507// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetIPConfiguration struct. 17508func (vmssic *VirtualMachineScaleSetIPConfiguration) UnmarshalJSON(body []byte) error { 17509 var m map[string]*json.RawMessage 17510 err := json.Unmarshal(body, &m) 17511 if err != nil { 17512 return err 17513 } 17514 for k, v := range m { 17515 switch k { 17516 case "name": 17517 if v != nil { 17518 var name string 17519 err = json.Unmarshal(*v, &name) 17520 if err != nil { 17521 return err 17522 } 17523 vmssic.Name = &name 17524 } 17525 case "properties": 17526 if v != nil { 17527 var virtualMachineScaleSetIPConfigurationProperties VirtualMachineScaleSetIPConfigurationProperties 17528 err = json.Unmarshal(*v, &virtualMachineScaleSetIPConfigurationProperties) 17529 if err != nil { 17530 return err 17531 } 17532 vmssic.VirtualMachineScaleSetIPConfigurationProperties = &virtualMachineScaleSetIPConfigurationProperties 17533 } 17534 case "id": 17535 if v != nil { 17536 var ID string 17537 err = json.Unmarshal(*v, &ID) 17538 if err != nil { 17539 return err 17540 } 17541 vmssic.ID = &ID 17542 } 17543 } 17544 } 17545 17546 return nil 17547} 17548 17549// VirtualMachineScaleSetIPConfigurationProperties describes a virtual machine scale set network profile's 17550// IP configuration properties. 17551type VirtualMachineScaleSetIPConfigurationProperties struct { 17552 // Subnet - Specifies the identifier of the subnet. 17553 Subnet *APIEntityReference `json:"subnet,omitempty"` 17554 // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. 17555 Primary *bool `json:"primary,omitempty"` 17556 // PublicIPAddressConfiguration - The publicIPAddressConfiguration. 17557 PublicIPAddressConfiguration *VirtualMachineScaleSetPublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` 17558 // 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: 'IPVersionIPv4', 'IPVersionIPv6' 17559 PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` 17560 // 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. 17561 ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` 17562 // ApplicationSecurityGroups - Specifies an array of references to application security group. 17563 ApplicationSecurityGroups *[]SubResource `json:"applicationSecurityGroups,omitempty"` 17564 // 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. 17565 LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` 17566 // 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. 17567 LoadBalancerInboundNatPools *[]SubResource `json:"loadBalancerInboundNatPools,omitempty"` 17568} 17569 17570// VirtualMachineScaleSetIPTag contains the IP tag associated with the public IP address. 17571type VirtualMachineScaleSetIPTag struct { 17572 // IPTagType - IP tag type. Example: FirstPartyUsage. 17573 IPTagType *string `json:"ipTagType,omitempty"` 17574 // Tag - IP tag associated with the public IP. Example: SQL, Storage etc. 17575 Tag *string `json:"tag,omitempty"` 17576} 17577 17578// VirtualMachineScaleSetListOSUpgradeHistory list of Virtual Machine Scale Set OS Upgrade History 17579// operation response. 17580type VirtualMachineScaleSetListOSUpgradeHistory struct { 17581 autorest.Response `json:"-"` 17582 // Value - The list of OS upgrades performed on the virtual machine scale set. 17583 Value *[]UpgradeOperationHistoricalStatusInfo `json:"value,omitempty"` 17584 // 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. 17585 NextLink *string `json:"nextLink,omitempty"` 17586} 17587 17588// VirtualMachineScaleSetListOSUpgradeHistoryIterator provides access to a complete listing of 17589// UpgradeOperationHistoricalStatusInfo values. 17590type VirtualMachineScaleSetListOSUpgradeHistoryIterator struct { 17591 i int 17592 page VirtualMachineScaleSetListOSUpgradeHistoryPage 17593} 17594 17595// NextWithContext advances to the next value. If there was an error making 17596// the request the iterator does not advance and the error is returned. 17597func (iter *VirtualMachineScaleSetListOSUpgradeHistoryIterator) NextWithContext(ctx context.Context) (err error) { 17598 if tracing.IsEnabled() { 17599 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListOSUpgradeHistoryIterator.NextWithContext") 17600 defer func() { 17601 sc := -1 17602 if iter.Response().Response.Response != nil { 17603 sc = iter.Response().Response.Response.StatusCode 17604 } 17605 tracing.EndSpan(ctx, sc, err) 17606 }() 17607 } 17608 iter.i++ 17609 if iter.i < len(iter.page.Values()) { 17610 return nil 17611 } 17612 err = iter.page.NextWithContext(ctx) 17613 if err != nil { 17614 iter.i-- 17615 return err 17616 } 17617 iter.i = 0 17618 return nil 17619} 17620 17621// Next advances to the next value. If there was an error making 17622// the request the iterator does not advance and the error is returned. 17623// Deprecated: Use NextWithContext() instead. 17624func (iter *VirtualMachineScaleSetListOSUpgradeHistoryIterator) Next() error { 17625 return iter.NextWithContext(context.Background()) 17626} 17627 17628// NotDone returns true if the enumeration should be started or is not yet complete. 17629func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) NotDone() bool { 17630 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 17631} 17632 17633// Response returns the raw server response from the last page request. 17634func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) Response() VirtualMachineScaleSetListOSUpgradeHistory { 17635 return iter.page.Response() 17636} 17637 17638// Value returns the current value or a zero-initialized value if the 17639// iterator has advanced beyond the end of the collection. 17640func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) Value() UpgradeOperationHistoricalStatusInfo { 17641 if !iter.page.NotDone() { 17642 return UpgradeOperationHistoricalStatusInfo{} 17643 } 17644 return iter.page.Values()[iter.i] 17645} 17646 17647// Creates a new instance of the VirtualMachineScaleSetListOSUpgradeHistoryIterator type. 17648func NewVirtualMachineScaleSetListOSUpgradeHistoryIterator(page VirtualMachineScaleSetListOSUpgradeHistoryPage) VirtualMachineScaleSetListOSUpgradeHistoryIterator { 17649 return VirtualMachineScaleSetListOSUpgradeHistoryIterator{page: page} 17650} 17651 17652// IsEmpty returns true if the ListResult contains no values. 17653func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) IsEmpty() bool { 17654 return vmsslouh.Value == nil || len(*vmsslouh.Value) == 0 17655} 17656 17657// hasNextLink returns true if the NextLink is not empty. 17658func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) hasNextLink() bool { 17659 return vmsslouh.NextLink != nil && len(*vmsslouh.NextLink) != 0 17660} 17661 17662// virtualMachineScaleSetListOSUpgradeHistoryPreparer prepares a request to retrieve the next set of results. 17663// It returns nil if no more results exist. 17664func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) virtualMachineScaleSetListOSUpgradeHistoryPreparer(ctx context.Context) (*http.Request, error) { 17665 if !vmsslouh.hasNextLink() { 17666 return nil, nil 17667 } 17668 return autorest.Prepare((&http.Request{}).WithContext(ctx), 17669 autorest.AsJSON(), 17670 autorest.AsGet(), 17671 autorest.WithBaseURL(to.String(vmsslouh.NextLink))) 17672} 17673 17674// VirtualMachineScaleSetListOSUpgradeHistoryPage contains a page of UpgradeOperationHistoricalStatusInfo 17675// values. 17676type VirtualMachineScaleSetListOSUpgradeHistoryPage struct { 17677 fn func(context.Context, VirtualMachineScaleSetListOSUpgradeHistory) (VirtualMachineScaleSetListOSUpgradeHistory, error) 17678 vmsslouh VirtualMachineScaleSetListOSUpgradeHistory 17679} 17680 17681// NextWithContext advances to the next page of values. If there was an error making 17682// the request the page does not advance and the error is returned. 17683func (page *VirtualMachineScaleSetListOSUpgradeHistoryPage) NextWithContext(ctx context.Context) (err error) { 17684 if tracing.IsEnabled() { 17685 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListOSUpgradeHistoryPage.NextWithContext") 17686 defer func() { 17687 sc := -1 17688 if page.Response().Response.Response != nil { 17689 sc = page.Response().Response.Response.StatusCode 17690 } 17691 tracing.EndSpan(ctx, sc, err) 17692 }() 17693 } 17694 for { 17695 next, err := page.fn(ctx, page.vmsslouh) 17696 if err != nil { 17697 return err 17698 } 17699 page.vmsslouh = next 17700 if !next.hasNextLink() || !next.IsEmpty() { 17701 break 17702 } 17703 } 17704 return nil 17705} 17706 17707// Next advances to the next page of values. If there was an error making 17708// the request the page does not advance and the error is returned. 17709// Deprecated: Use NextWithContext() instead. 17710func (page *VirtualMachineScaleSetListOSUpgradeHistoryPage) Next() error { 17711 return page.NextWithContext(context.Background()) 17712} 17713 17714// NotDone returns true if the page enumeration should be started or is not yet complete. 17715func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) NotDone() bool { 17716 return !page.vmsslouh.IsEmpty() 17717} 17718 17719// Response returns the raw server response from the last page request. 17720func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) Response() VirtualMachineScaleSetListOSUpgradeHistory { 17721 return page.vmsslouh 17722} 17723 17724// Values returns the slice of values for the current page or nil if there are no values. 17725func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) Values() []UpgradeOperationHistoricalStatusInfo { 17726 if page.vmsslouh.IsEmpty() { 17727 return nil 17728 } 17729 return *page.vmsslouh.Value 17730} 17731 17732// Creates a new instance of the VirtualMachineScaleSetListOSUpgradeHistoryPage type. 17733func NewVirtualMachineScaleSetListOSUpgradeHistoryPage(cur VirtualMachineScaleSetListOSUpgradeHistory, getNextPage func(context.Context, VirtualMachineScaleSetListOSUpgradeHistory) (VirtualMachineScaleSetListOSUpgradeHistory, error)) VirtualMachineScaleSetListOSUpgradeHistoryPage { 17734 return VirtualMachineScaleSetListOSUpgradeHistoryPage{ 17735 fn: getNextPage, 17736 vmsslouh: cur, 17737 } 17738} 17739 17740// VirtualMachineScaleSetListResult the List Virtual Machine operation response. 17741type VirtualMachineScaleSetListResult struct { 17742 autorest.Response `json:"-"` 17743 // Value - The list of virtual machine scale sets. 17744 Value *[]VirtualMachineScaleSet `json:"value,omitempty"` 17745 // NextLink - The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with this to fetch the next page of VMSS. 17746 NextLink *string `json:"nextLink,omitempty"` 17747} 17748 17749// VirtualMachineScaleSetListResultIterator provides access to a complete listing of VirtualMachineScaleSet 17750// values. 17751type VirtualMachineScaleSetListResultIterator struct { 17752 i int 17753 page VirtualMachineScaleSetListResultPage 17754} 17755 17756// NextWithContext advances to the next value. If there was an error making 17757// the request the iterator does not advance and the error is returned. 17758func (iter *VirtualMachineScaleSetListResultIterator) NextWithContext(ctx context.Context) (err error) { 17759 if tracing.IsEnabled() { 17760 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListResultIterator.NextWithContext") 17761 defer func() { 17762 sc := -1 17763 if iter.Response().Response.Response != nil { 17764 sc = iter.Response().Response.Response.StatusCode 17765 } 17766 tracing.EndSpan(ctx, sc, err) 17767 }() 17768 } 17769 iter.i++ 17770 if iter.i < len(iter.page.Values()) { 17771 return nil 17772 } 17773 err = iter.page.NextWithContext(ctx) 17774 if err != nil { 17775 iter.i-- 17776 return err 17777 } 17778 iter.i = 0 17779 return nil 17780} 17781 17782// Next advances to the next value. If there was an error making 17783// the request the iterator does not advance and the error is returned. 17784// Deprecated: Use NextWithContext() instead. 17785func (iter *VirtualMachineScaleSetListResultIterator) Next() error { 17786 return iter.NextWithContext(context.Background()) 17787} 17788 17789// NotDone returns true if the enumeration should be started or is not yet complete. 17790func (iter VirtualMachineScaleSetListResultIterator) NotDone() bool { 17791 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 17792} 17793 17794// Response returns the raw server response from the last page request. 17795func (iter VirtualMachineScaleSetListResultIterator) Response() VirtualMachineScaleSetListResult { 17796 return iter.page.Response() 17797} 17798 17799// Value returns the current value or a zero-initialized value if the 17800// iterator has advanced beyond the end of the collection. 17801func (iter VirtualMachineScaleSetListResultIterator) Value() VirtualMachineScaleSet { 17802 if !iter.page.NotDone() { 17803 return VirtualMachineScaleSet{} 17804 } 17805 return iter.page.Values()[iter.i] 17806} 17807 17808// Creates a new instance of the VirtualMachineScaleSetListResultIterator type. 17809func NewVirtualMachineScaleSetListResultIterator(page VirtualMachineScaleSetListResultPage) VirtualMachineScaleSetListResultIterator { 17810 return VirtualMachineScaleSetListResultIterator{page: page} 17811} 17812 17813// IsEmpty returns true if the ListResult contains no values. 17814func (vmsslr VirtualMachineScaleSetListResult) IsEmpty() bool { 17815 return vmsslr.Value == nil || len(*vmsslr.Value) == 0 17816} 17817 17818// hasNextLink returns true if the NextLink is not empty. 17819func (vmsslr VirtualMachineScaleSetListResult) hasNextLink() bool { 17820 return vmsslr.NextLink != nil && len(*vmsslr.NextLink) != 0 17821} 17822 17823// virtualMachineScaleSetListResultPreparer prepares a request to retrieve the next set of results. 17824// It returns nil if no more results exist. 17825func (vmsslr VirtualMachineScaleSetListResult) virtualMachineScaleSetListResultPreparer(ctx context.Context) (*http.Request, error) { 17826 if !vmsslr.hasNextLink() { 17827 return nil, nil 17828 } 17829 return autorest.Prepare((&http.Request{}).WithContext(ctx), 17830 autorest.AsJSON(), 17831 autorest.AsGet(), 17832 autorest.WithBaseURL(to.String(vmsslr.NextLink))) 17833} 17834 17835// VirtualMachineScaleSetListResultPage contains a page of VirtualMachineScaleSet values. 17836type VirtualMachineScaleSetListResultPage struct { 17837 fn func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error) 17838 vmsslr VirtualMachineScaleSetListResult 17839} 17840 17841// NextWithContext advances to the next page of values. If there was an error making 17842// the request the page does not advance and the error is returned. 17843func (page *VirtualMachineScaleSetListResultPage) NextWithContext(ctx context.Context) (err error) { 17844 if tracing.IsEnabled() { 17845 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListResultPage.NextWithContext") 17846 defer func() { 17847 sc := -1 17848 if page.Response().Response.Response != nil { 17849 sc = page.Response().Response.Response.StatusCode 17850 } 17851 tracing.EndSpan(ctx, sc, err) 17852 }() 17853 } 17854 for { 17855 next, err := page.fn(ctx, page.vmsslr) 17856 if err != nil { 17857 return err 17858 } 17859 page.vmsslr = next 17860 if !next.hasNextLink() || !next.IsEmpty() { 17861 break 17862 } 17863 } 17864 return nil 17865} 17866 17867// Next advances to the next page of values. If there was an error making 17868// the request the page does not advance and the error is returned. 17869// Deprecated: Use NextWithContext() instead. 17870func (page *VirtualMachineScaleSetListResultPage) Next() error { 17871 return page.NextWithContext(context.Background()) 17872} 17873 17874// NotDone returns true if the page enumeration should be started or is not yet complete. 17875func (page VirtualMachineScaleSetListResultPage) NotDone() bool { 17876 return !page.vmsslr.IsEmpty() 17877} 17878 17879// Response returns the raw server response from the last page request. 17880func (page VirtualMachineScaleSetListResultPage) Response() VirtualMachineScaleSetListResult { 17881 return page.vmsslr 17882} 17883 17884// Values returns the slice of values for the current page or nil if there are no values. 17885func (page VirtualMachineScaleSetListResultPage) Values() []VirtualMachineScaleSet { 17886 if page.vmsslr.IsEmpty() { 17887 return nil 17888 } 17889 return *page.vmsslr.Value 17890} 17891 17892// Creates a new instance of the VirtualMachineScaleSetListResultPage type. 17893func NewVirtualMachineScaleSetListResultPage(cur VirtualMachineScaleSetListResult, getNextPage func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error)) VirtualMachineScaleSetListResultPage { 17894 return VirtualMachineScaleSetListResultPage{ 17895 fn: getNextPage, 17896 vmsslr: cur, 17897 } 17898} 17899 17900// VirtualMachineScaleSetListSkusResult the Virtual Machine Scale Set List Skus operation response. 17901type VirtualMachineScaleSetListSkusResult struct { 17902 autorest.Response `json:"-"` 17903 // Value - The list of skus available for the virtual machine scale set. 17904 Value *[]VirtualMachineScaleSetSku `json:"value,omitempty"` 17905 // 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. 17906 NextLink *string `json:"nextLink,omitempty"` 17907} 17908 17909// VirtualMachineScaleSetListSkusResultIterator provides access to a complete listing of 17910// VirtualMachineScaleSetSku values. 17911type VirtualMachineScaleSetListSkusResultIterator struct { 17912 i int 17913 page VirtualMachineScaleSetListSkusResultPage 17914} 17915 17916// NextWithContext advances to the next value. If there was an error making 17917// the request the iterator does not advance and the error is returned. 17918func (iter *VirtualMachineScaleSetListSkusResultIterator) NextWithContext(ctx context.Context) (err error) { 17919 if tracing.IsEnabled() { 17920 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListSkusResultIterator.NextWithContext") 17921 defer func() { 17922 sc := -1 17923 if iter.Response().Response.Response != nil { 17924 sc = iter.Response().Response.Response.StatusCode 17925 } 17926 tracing.EndSpan(ctx, sc, err) 17927 }() 17928 } 17929 iter.i++ 17930 if iter.i < len(iter.page.Values()) { 17931 return nil 17932 } 17933 err = iter.page.NextWithContext(ctx) 17934 if err != nil { 17935 iter.i-- 17936 return err 17937 } 17938 iter.i = 0 17939 return nil 17940} 17941 17942// Next advances to the next value. If there was an error making 17943// the request the iterator does not advance and the error is returned. 17944// Deprecated: Use NextWithContext() instead. 17945func (iter *VirtualMachineScaleSetListSkusResultIterator) Next() error { 17946 return iter.NextWithContext(context.Background()) 17947} 17948 17949// NotDone returns true if the enumeration should be started or is not yet complete. 17950func (iter VirtualMachineScaleSetListSkusResultIterator) NotDone() bool { 17951 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 17952} 17953 17954// Response returns the raw server response from the last page request. 17955func (iter VirtualMachineScaleSetListSkusResultIterator) Response() VirtualMachineScaleSetListSkusResult { 17956 return iter.page.Response() 17957} 17958 17959// Value returns the current value or a zero-initialized value if the 17960// iterator has advanced beyond the end of the collection. 17961func (iter VirtualMachineScaleSetListSkusResultIterator) Value() VirtualMachineScaleSetSku { 17962 if !iter.page.NotDone() { 17963 return VirtualMachineScaleSetSku{} 17964 } 17965 return iter.page.Values()[iter.i] 17966} 17967 17968// Creates a new instance of the VirtualMachineScaleSetListSkusResultIterator type. 17969func NewVirtualMachineScaleSetListSkusResultIterator(page VirtualMachineScaleSetListSkusResultPage) VirtualMachineScaleSetListSkusResultIterator { 17970 return VirtualMachineScaleSetListSkusResultIterator{page: page} 17971} 17972 17973// IsEmpty returns true if the ListResult contains no values. 17974func (vmsslsr VirtualMachineScaleSetListSkusResult) IsEmpty() bool { 17975 return vmsslsr.Value == nil || len(*vmsslsr.Value) == 0 17976} 17977 17978// hasNextLink returns true if the NextLink is not empty. 17979func (vmsslsr VirtualMachineScaleSetListSkusResult) hasNextLink() bool { 17980 return vmsslsr.NextLink != nil && len(*vmsslsr.NextLink) != 0 17981} 17982 17983// virtualMachineScaleSetListSkusResultPreparer prepares a request to retrieve the next set of results. 17984// It returns nil if no more results exist. 17985func (vmsslsr VirtualMachineScaleSetListSkusResult) virtualMachineScaleSetListSkusResultPreparer(ctx context.Context) (*http.Request, error) { 17986 if !vmsslsr.hasNextLink() { 17987 return nil, nil 17988 } 17989 return autorest.Prepare((&http.Request{}).WithContext(ctx), 17990 autorest.AsJSON(), 17991 autorest.AsGet(), 17992 autorest.WithBaseURL(to.String(vmsslsr.NextLink))) 17993} 17994 17995// VirtualMachineScaleSetListSkusResultPage contains a page of VirtualMachineScaleSetSku values. 17996type VirtualMachineScaleSetListSkusResultPage struct { 17997 fn func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error) 17998 vmsslsr VirtualMachineScaleSetListSkusResult 17999} 18000 18001// NextWithContext advances to the next page of values. If there was an error making 18002// the request the page does not advance and the error is returned. 18003func (page *VirtualMachineScaleSetListSkusResultPage) NextWithContext(ctx context.Context) (err error) { 18004 if tracing.IsEnabled() { 18005 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListSkusResultPage.NextWithContext") 18006 defer func() { 18007 sc := -1 18008 if page.Response().Response.Response != nil { 18009 sc = page.Response().Response.Response.StatusCode 18010 } 18011 tracing.EndSpan(ctx, sc, err) 18012 }() 18013 } 18014 for { 18015 next, err := page.fn(ctx, page.vmsslsr) 18016 if err != nil { 18017 return err 18018 } 18019 page.vmsslsr = next 18020 if !next.hasNextLink() || !next.IsEmpty() { 18021 break 18022 } 18023 } 18024 return nil 18025} 18026 18027// Next advances to the next page of values. If there was an error making 18028// the request the page does not advance and the error is returned. 18029// Deprecated: Use NextWithContext() instead. 18030func (page *VirtualMachineScaleSetListSkusResultPage) Next() error { 18031 return page.NextWithContext(context.Background()) 18032} 18033 18034// NotDone returns true if the page enumeration should be started or is not yet complete. 18035func (page VirtualMachineScaleSetListSkusResultPage) NotDone() bool { 18036 return !page.vmsslsr.IsEmpty() 18037} 18038 18039// Response returns the raw server response from the last page request. 18040func (page VirtualMachineScaleSetListSkusResultPage) Response() VirtualMachineScaleSetListSkusResult { 18041 return page.vmsslsr 18042} 18043 18044// Values returns the slice of values for the current page or nil if there are no values. 18045func (page VirtualMachineScaleSetListSkusResultPage) Values() []VirtualMachineScaleSetSku { 18046 if page.vmsslsr.IsEmpty() { 18047 return nil 18048 } 18049 return *page.vmsslsr.Value 18050} 18051 18052// Creates a new instance of the VirtualMachineScaleSetListSkusResultPage type. 18053func NewVirtualMachineScaleSetListSkusResultPage(cur VirtualMachineScaleSetListSkusResult, getNextPage func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error)) VirtualMachineScaleSetListSkusResultPage { 18054 return VirtualMachineScaleSetListSkusResultPage{ 18055 fn: getNextPage, 18056 vmsslsr: cur, 18057 } 18058} 18059 18060// VirtualMachineScaleSetListWithLinkResult the List Virtual Machine operation response. 18061type VirtualMachineScaleSetListWithLinkResult struct { 18062 autorest.Response `json:"-"` 18063 // Value - The list of virtual machine scale sets. 18064 Value *[]VirtualMachineScaleSet `json:"value,omitempty"` 18065 // 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. 18066 NextLink *string `json:"nextLink,omitempty"` 18067} 18068 18069// VirtualMachineScaleSetListWithLinkResultIterator provides access to a complete listing of 18070// VirtualMachineScaleSet values. 18071type VirtualMachineScaleSetListWithLinkResultIterator struct { 18072 i int 18073 page VirtualMachineScaleSetListWithLinkResultPage 18074} 18075 18076// NextWithContext advances to the next value. If there was an error making 18077// the request the iterator does not advance and the error is returned. 18078func (iter *VirtualMachineScaleSetListWithLinkResultIterator) NextWithContext(ctx context.Context) (err error) { 18079 if tracing.IsEnabled() { 18080 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListWithLinkResultIterator.NextWithContext") 18081 defer func() { 18082 sc := -1 18083 if iter.Response().Response.Response != nil { 18084 sc = iter.Response().Response.Response.StatusCode 18085 } 18086 tracing.EndSpan(ctx, sc, err) 18087 }() 18088 } 18089 iter.i++ 18090 if iter.i < len(iter.page.Values()) { 18091 return nil 18092 } 18093 err = iter.page.NextWithContext(ctx) 18094 if err != nil { 18095 iter.i-- 18096 return err 18097 } 18098 iter.i = 0 18099 return nil 18100} 18101 18102// Next advances to the next value. If there was an error making 18103// the request the iterator does not advance and the error is returned. 18104// Deprecated: Use NextWithContext() instead. 18105func (iter *VirtualMachineScaleSetListWithLinkResultIterator) Next() error { 18106 return iter.NextWithContext(context.Background()) 18107} 18108 18109// NotDone returns true if the enumeration should be started or is not yet complete. 18110func (iter VirtualMachineScaleSetListWithLinkResultIterator) NotDone() bool { 18111 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 18112} 18113 18114// Response returns the raw server response from the last page request. 18115func (iter VirtualMachineScaleSetListWithLinkResultIterator) Response() VirtualMachineScaleSetListWithLinkResult { 18116 return iter.page.Response() 18117} 18118 18119// Value returns the current value or a zero-initialized value if the 18120// iterator has advanced beyond the end of the collection. 18121func (iter VirtualMachineScaleSetListWithLinkResultIterator) Value() VirtualMachineScaleSet { 18122 if !iter.page.NotDone() { 18123 return VirtualMachineScaleSet{} 18124 } 18125 return iter.page.Values()[iter.i] 18126} 18127 18128// Creates a new instance of the VirtualMachineScaleSetListWithLinkResultIterator type. 18129func NewVirtualMachineScaleSetListWithLinkResultIterator(page VirtualMachineScaleSetListWithLinkResultPage) VirtualMachineScaleSetListWithLinkResultIterator { 18130 return VirtualMachineScaleSetListWithLinkResultIterator{page: page} 18131} 18132 18133// IsEmpty returns true if the ListResult contains no values. 18134func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) IsEmpty() bool { 18135 return vmsslwlr.Value == nil || len(*vmsslwlr.Value) == 0 18136} 18137 18138// hasNextLink returns true if the NextLink is not empty. 18139func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) hasNextLink() bool { 18140 return vmsslwlr.NextLink != nil && len(*vmsslwlr.NextLink) != 0 18141} 18142 18143// virtualMachineScaleSetListWithLinkResultPreparer prepares a request to retrieve the next set of results. 18144// It returns nil if no more results exist. 18145func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) virtualMachineScaleSetListWithLinkResultPreparer(ctx context.Context) (*http.Request, error) { 18146 if !vmsslwlr.hasNextLink() { 18147 return nil, nil 18148 } 18149 return autorest.Prepare((&http.Request{}).WithContext(ctx), 18150 autorest.AsJSON(), 18151 autorest.AsGet(), 18152 autorest.WithBaseURL(to.String(vmsslwlr.NextLink))) 18153} 18154 18155// VirtualMachineScaleSetListWithLinkResultPage contains a page of VirtualMachineScaleSet values. 18156type VirtualMachineScaleSetListWithLinkResultPage struct { 18157 fn func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error) 18158 vmsslwlr VirtualMachineScaleSetListWithLinkResult 18159} 18160 18161// NextWithContext advances to the next page of values. If there was an error making 18162// the request the page does not advance and the error is returned. 18163func (page *VirtualMachineScaleSetListWithLinkResultPage) NextWithContext(ctx context.Context) (err error) { 18164 if tracing.IsEnabled() { 18165 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListWithLinkResultPage.NextWithContext") 18166 defer func() { 18167 sc := -1 18168 if page.Response().Response.Response != nil { 18169 sc = page.Response().Response.Response.StatusCode 18170 } 18171 tracing.EndSpan(ctx, sc, err) 18172 }() 18173 } 18174 for { 18175 next, err := page.fn(ctx, page.vmsslwlr) 18176 if err != nil { 18177 return err 18178 } 18179 page.vmsslwlr = next 18180 if !next.hasNextLink() || !next.IsEmpty() { 18181 break 18182 } 18183 } 18184 return nil 18185} 18186 18187// Next advances to the next page of values. If there was an error making 18188// the request the page does not advance and the error is returned. 18189// Deprecated: Use NextWithContext() instead. 18190func (page *VirtualMachineScaleSetListWithLinkResultPage) Next() error { 18191 return page.NextWithContext(context.Background()) 18192} 18193 18194// NotDone returns true if the page enumeration should be started or is not yet complete. 18195func (page VirtualMachineScaleSetListWithLinkResultPage) NotDone() bool { 18196 return !page.vmsslwlr.IsEmpty() 18197} 18198 18199// Response returns the raw server response from the last page request. 18200func (page VirtualMachineScaleSetListWithLinkResultPage) Response() VirtualMachineScaleSetListWithLinkResult { 18201 return page.vmsslwlr 18202} 18203 18204// Values returns the slice of values for the current page or nil if there are no values. 18205func (page VirtualMachineScaleSetListWithLinkResultPage) Values() []VirtualMachineScaleSet { 18206 if page.vmsslwlr.IsEmpty() { 18207 return nil 18208 } 18209 return *page.vmsslwlr.Value 18210} 18211 18212// Creates a new instance of the VirtualMachineScaleSetListWithLinkResultPage type. 18213func NewVirtualMachineScaleSetListWithLinkResultPage(cur VirtualMachineScaleSetListWithLinkResult, getNextPage func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error)) VirtualMachineScaleSetListWithLinkResultPage { 18214 return VirtualMachineScaleSetListWithLinkResultPage{ 18215 fn: getNextPage, 18216 vmsslwlr: cur, 18217 } 18218} 18219 18220// VirtualMachineScaleSetManagedDiskParameters describes the parameters of a ScaleSet managed disk. 18221type VirtualMachineScaleSetManagedDiskParameters struct { 18222 // 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', 'StorageAccountTypesPremiumZRS', 'StorageAccountTypesStandardSSDZRS' 18223 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 18224 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed disk. 18225 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 18226} 18227 18228// VirtualMachineScaleSetNetworkConfiguration describes a virtual machine scale set network profile's 18229// network configurations. 18230type VirtualMachineScaleSetNetworkConfiguration struct { 18231 // Name - The network configuration name. 18232 Name *string `json:"name,omitempty"` 18233 *VirtualMachineScaleSetNetworkConfigurationProperties `json:"properties,omitempty"` 18234 // ID - Resource Id 18235 ID *string `json:"id,omitempty"` 18236} 18237 18238// MarshalJSON is the custom marshaler for VirtualMachineScaleSetNetworkConfiguration. 18239func (vmssnc VirtualMachineScaleSetNetworkConfiguration) MarshalJSON() ([]byte, error) { 18240 objectMap := make(map[string]interface{}) 18241 if vmssnc.Name != nil { 18242 objectMap["name"] = vmssnc.Name 18243 } 18244 if vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties != nil { 18245 objectMap["properties"] = vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties 18246 } 18247 if vmssnc.ID != nil { 18248 objectMap["id"] = vmssnc.ID 18249 } 18250 return json.Marshal(objectMap) 18251} 18252 18253// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetNetworkConfiguration struct. 18254func (vmssnc *VirtualMachineScaleSetNetworkConfiguration) UnmarshalJSON(body []byte) error { 18255 var m map[string]*json.RawMessage 18256 err := json.Unmarshal(body, &m) 18257 if err != nil { 18258 return err 18259 } 18260 for k, v := range m { 18261 switch k { 18262 case "name": 18263 if v != nil { 18264 var name string 18265 err = json.Unmarshal(*v, &name) 18266 if err != nil { 18267 return err 18268 } 18269 vmssnc.Name = &name 18270 } 18271 case "properties": 18272 if v != nil { 18273 var virtualMachineScaleSetNetworkConfigurationProperties VirtualMachineScaleSetNetworkConfigurationProperties 18274 err = json.Unmarshal(*v, &virtualMachineScaleSetNetworkConfigurationProperties) 18275 if err != nil { 18276 return err 18277 } 18278 vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties = &virtualMachineScaleSetNetworkConfigurationProperties 18279 } 18280 case "id": 18281 if v != nil { 18282 var ID string 18283 err = json.Unmarshal(*v, &ID) 18284 if err != nil { 18285 return err 18286 } 18287 vmssnc.ID = &ID 18288 } 18289 } 18290 } 18291 18292 return nil 18293} 18294 18295// VirtualMachineScaleSetNetworkConfigurationDNSSettings describes a virtual machines scale sets network 18296// configuration's DNS settings. 18297type VirtualMachineScaleSetNetworkConfigurationDNSSettings struct { 18298 // DNSServers - List of DNS servers IP addresses 18299 DNSServers *[]string `json:"dnsServers,omitempty"` 18300} 18301 18302// VirtualMachineScaleSetNetworkConfigurationProperties describes a virtual machine scale set network 18303// profile's IP configuration. 18304type VirtualMachineScaleSetNetworkConfigurationProperties struct { 18305 // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. 18306 Primary *bool `json:"primary,omitempty"` 18307 // EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled. 18308 EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` 18309 // EnableFpga - Specifies whether the network interface is FPGA networking-enabled. 18310 EnableFpga *bool `json:"enableFpga,omitempty"` 18311 // NetworkSecurityGroup - The network security group. 18312 NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` 18313 // DNSSettings - The dns settings to be applied on the network interfaces. 18314 DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings `json:"dnsSettings,omitempty"` 18315 // IPConfigurations - Specifies the IP configurations of the network interface. 18316 IPConfigurations *[]VirtualMachineScaleSetIPConfiguration `json:"ipConfigurations,omitempty"` 18317 // EnableIPForwarding - Whether IP forwarding enabled on this NIC. 18318 EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` 18319 // DeleteOption - Specify what happens to the network interface when the VM is deleted. Possible values include: 'DeleteOptionsDelete', 'DeleteOptionsDetach' 18320 DeleteOption DeleteOptions `json:"deleteOption,omitempty"` 18321} 18322 18323// VirtualMachineScaleSetNetworkProfile describes a virtual machine scale set network profile. 18324type VirtualMachineScaleSetNetworkProfile struct { 18325 // 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}'. 18326 HealthProbe *APIEntityReference `json:"healthProbe,omitempty"` 18327 // NetworkInterfaceConfigurations - The list of network configurations. 18328 NetworkInterfaceConfigurations *[]VirtualMachineScaleSetNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` 18329 // NetworkAPIVersion - specifies the Microsoft.Network API version used when creating networking resources in the Network Interface Configurations for Virtual Machine Scale Set with orchestration mode 'Flexible'. Possible values include: 'NetworkAPIVersionTwoZeroTwoZeroHyphenMinusOneOneHyphenMinusZeroOne' 18330 NetworkAPIVersion NetworkAPIVersion `json:"networkApiVersion,omitempty"` 18331} 18332 18333// VirtualMachineScaleSetOSDisk describes a virtual machine scale set operating system disk. 18334type VirtualMachineScaleSetOSDisk struct { 18335 // Name - The disk name. 18336 Name *string `json:"name,omitempty"` 18337 // 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' 18338 Caching CachingTypes `json:"caching,omitempty"` 18339 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 18340 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 18341 // 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' 18342 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 18343 // DiffDiskSettings - Specifies the ephemeral disk Settings for the operating system disk used by the virtual machine scale set. 18344 DiffDiskSettings *DiffDiskSettings `json:"diffDiskSettings,omitempty"` 18345 // 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 18346 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 18347 // 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: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' 18348 OsType OperatingSystemTypes `json:"osType,omitempty"` 18349 // Image - Specifies information about the unmanaged user image to base the scale set on. 18350 Image *VirtualHardDisk `json:"image,omitempty"` 18351 // VhdContainers - Specifies the container urls that are used to store operating system disks for the scale set. 18352 VhdContainers *[]string `json:"vhdContainers,omitempty"` 18353 // ManagedDisk - The managed disk parameters. 18354 ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` 18355} 18356 18357// VirtualMachineScaleSetOSProfile describes a virtual machine scale set OS profile. 18358type VirtualMachineScaleSetOSProfile struct { 18359 // 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. 18360 ComputerNamePrefix *string `json:"computerNamePrefix,omitempty"` 18361 // 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 18362 AdminUsername *string `json:"adminUsername,omitempty"` 18363 // 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/troubleshoot/azure/virtual-machines/reset-rdp) <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/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection) 18364 AdminPassword *string `json:"adminPassword,omitempty"` 18365 // 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/linux/using-cloud-init) 18366 CustomData *string `json:"customData,omitempty"` 18367 // WindowsConfiguration - Specifies Windows operating system settings on the virtual machine. 18368 WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` 18369 // 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/linux/endorsed-distros). 18370 LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` 18371 // Secrets - Specifies set of certificates that should be installed onto the virtual machines in the scale set. 18372 Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` 18373} 18374 18375// VirtualMachineScaleSetProperties describes the properties of a Virtual Machine Scale Set. 18376type VirtualMachineScaleSetProperties struct { 18377 // UpgradePolicy - The upgrade policy. 18378 UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` 18379 // AutomaticRepairsPolicy - Policy for automatic repairs. 18380 AutomaticRepairsPolicy *AutomaticRepairsPolicy `json:"automaticRepairsPolicy,omitempty"` 18381 // VirtualMachineProfile - The virtual machine profile. 18382 VirtualMachineProfile *VirtualMachineScaleSetVMProfile `json:"virtualMachineProfile,omitempty"` 18383 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 18384 ProvisioningState *string `json:"provisioningState,omitempty"` 18385 // Overprovision - Specifies whether the Virtual Machine Scale Set should be overprovisioned. 18386 Overprovision *bool `json:"overprovision,omitempty"` 18387 // 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. 18388 DoNotRunExtensionsOnOverprovisionedVMs *bool `json:"doNotRunExtensionsOnOverprovisionedVMs,omitempty"` 18389 // UniqueID - READ-ONLY; Specifies the ID which uniquely identifies a Virtual Machine Scale Set. 18390 UniqueID *string `json:"uniqueId,omitempty"` 18391 // 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. 18392 SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"` 18393 // ZoneBalance - Whether to force strictly even Virtual Machine distribution cross x-zones in case there is zone outage. 18394 ZoneBalance *bool `json:"zoneBalance,omitempty"` 18395 // PlatformFaultDomainCount - Fault Domain count for each placement group. 18396 PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` 18397 // 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. 18398 ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` 18399 // HostGroup - Specifies information about the dedicated host group that the virtual machine scale set resides in. <br><br>Minimum api-version: 2020-06-01. 18400 HostGroup *SubResource `json:"hostGroup,omitempty"` 18401 // 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. 18402 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 18403 // ScaleInPolicy - Specifies the scale-in policy that decides which virtual machines are chosen for removal when a Virtual Machine Scale Set is scaled-in. 18404 ScaleInPolicy *ScaleInPolicy `json:"scaleInPolicy,omitempty"` 18405 // OrchestrationMode - Specifies the orchestration mode for the virtual machine scale set. Possible values include: 'OrchestrationModeUniform', 'OrchestrationModeFlexible' 18406 OrchestrationMode OrchestrationMode `json:"orchestrationMode,omitempty"` 18407} 18408 18409// MarshalJSON is the custom marshaler for VirtualMachineScaleSetProperties. 18410func (vmssp VirtualMachineScaleSetProperties) MarshalJSON() ([]byte, error) { 18411 objectMap := make(map[string]interface{}) 18412 if vmssp.UpgradePolicy != nil { 18413 objectMap["upgradePolicy"] = vmssp.UpgradePolicy 18414 } 18415 if vmssp.AutomaticRepairsPolicy != nil { 18416 objectMap["automaticRepairsPolicy"] = vmssp.AutomaticRepairsPolicy 18417 } 18418 if vmssp.VirtualMachineProfile != nil { 18419 objectMap["virtualMachineProfile"] = vmssp.VirtualMachineProfile 18420 } 18421 if vmssp.Overprovision != nil { 18422 objectMap["overprovision"] = vmssp.Overprovision 18423 } 18424 if vmssp.DoNotRunExtensionsOnOverprovisionedVMs != nil { 18425 objectMap["doNotRunExtensionsOnOverprovisionedVMs"] = vmssp.DoNotRunExtensionsOnOverprovisionedVMs 18426 } 18427 if vmssp.SinglePlacementGroup != nil { 18428 objectMap["singlePlacementGroup"] = vmssp.SinglePlacementGroup 18429 } 18430 if vmssp.ZoneBalance != nil { 18431 objectMap["zoneBalance"] = vmssp.ZoneBalance 18432 } 18433 if vmssp.PlatformFaultDomainCount != nil { 18434 objectMap["platformFaultDomainCount"] = vmssp.PlatformFaultDomainCount 18435 } 18436 if vmssp.ProximityPlacementGroup != nil { 18437 objectMap["proximityPlacementGroup"] = vmssp.ProximityPlacementGroup 18438 } 18439 if vmssp.HostGroup != nil { 18440 objectMap["hostGroup"] = vmssp.HostGroup 18441 } 18442 if vmssp.AdditionalCapabilities != nil { 18443 objectMap["additionalCapabilities"] = vmssp.AdditionalCapabilities 18444 } 18445 if vmssp.ScaleInPolicy != nil { 18446 objectMap["scaleInPolicy"] = vmssp.ScaleInPolicy 18447 } 18448 if vmssp.OrchestrationMode != "" { 18449 objectMap["orchestrationMode"] = vmssp.OrchestrationMode 18450 } 18451 return json.Marshal(objectMap) 18452} 18453 18454// VirtualMachineScaleSetPublicIPAddressConfiguration describes a virtual machines scale set IP 18455// Configuration's PublicIPAddress configuration 18456type VirtualMachineScaleSetPublicIPAddressConfiguration struct { 18457 // Name - The publicIP address configuration name. 18458 Name *string `json:"name,omitempty"` 18459 *VirtualMachineScaleSetPublicIPAddressConfigurationProperties `json:"properties,omitempty"` 18460 Sku *PublicIPAddressSku `json:"sku,omitempty"` 18461} 18462 18463// MarshalJSON is the custom marshaler for VirtualMachineScaleSetPublicIPAddressConfiguration. 18464func (vmsspiac VirtualMachineScaleSetPublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { 18465 objectMap := make(map[string]interface{}) 18466 if vmsspiac.Name != nil { 18467 objectMap["name"] = vmsspiac.Name 18468 } 18469 if vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties != nil { 18470 objectMap["properties"] = vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties 18471 } 18472 if vmsspiac.Sku != nil { 18473 objectMap["sku"] = vmsspiac.Sku 18474 } 18475 return json.Marshal(objectMap) 18476} 18477 18478// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetPublicIPAddressConfiguration struct. 18479func (vmsspiac *VirtualMachineScaleSetPublicIPAddressConfiguration) UnmarshalJSON(body []byte) error { 18480 var m map[string]*json.RawMessage 18481 err := json.Unmarshal(body, &m) 18482 if err != nil { 18483 return err 18484 } 18485 for k, v := range m { 18486 switch k { 18487 case "name": 18488 if v != nil { 18489 var name string 18490 err = json.Unmarshal(*v, &name) 18491 if err != nil { 18492 return err 18493 } 18494 vmsspiac.Name = &name 18495 } 18496 case "properties": 18497 if v != nil { 18498 var virtualMachineScaleSetPublicIPAddressConfigurationProperties VirtualMachineScaleSetPublicIPAddressConfigurationProperties 18499 err = json.Unmarshal(*v, &virtualMachineScaleSetPublicIPAddressConfigurationProperties) 18500 if err != nil { 18501 return err 18502 } 18503 vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties = &virtualMachineScaleSetPublicIPAddressConfigurationProperties 18504 } 18505 case "sku": 18506 if v != nil { 18507 var sku PublicIPAddressSku 18508 err = json.Unmarshal(*v, &sku) 18509 if err != nil { 18510 return err 18511 } 18512 vmsspiac.Sku = &sku 18513 } 18514 } 18515 } 18516 18517 return nil 18518} 18519 18520// VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings describes a virtual machines scale sets 18521// network configuration's DNS settings. 18522type VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings struct { 18523 // 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 18524 DomainNameLabel *string `json:"domainNameLabel,omitempty"` 18525} 18526 18527// VirtualMachineScaleSetPublicIPAddressConfigurationProperties describes a virtual machines scale set IP 18528// Configuration's PublicIPAddress configuration 18529type VirtualMachineScaleSetPublicIPAddressConfigurationProperties struct { 18530 // IdleTimeoutInMinutes - The idle timeout of the public IP address. 18531 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` 18532 // DNSSettings - The dns settings to be applied on the publicIP addresses . 18533 DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings `json:"dnsSettings,omitempty"` 18534 // IPTags - The list of IP tags associated with the public IP address. 18535 IPTags *[]VirtualMachineScaleSetIPTag `json:"ipTags,omitempty"` 18536 // PublicIPPrefix - The PublicIPPrefix from which to allocate publicIP addresses. 18537 PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` 18538 // 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: 'IPVersionIPv4', 'IPVersionIPv6' 18539 PublicIPAddressVersion IPVersion `json:"publicIPAddressVersion,omitempty"` 18540 // DeleteOption - Specify what happens to the public IP when the VM is deleted. Possible values include: 'DeleteOptionsDelete', 'DeleteOptionsDetach' 18541 DeleteOption DeleteOptions `json:"deleteOption,omitempty"` 18542} 18543 18544// VirtualMachineScaleSetReimageParameters describes a Virtual Machine Scale Set VM Reimage Parameters. 18545type VirtualMachineScaleSetReimageParameters struct { 18546 // 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. 18547 InstanceIds *[]string `json:"instanceIds,omitempty"` 18548 // 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. 18549 TempDisk *bool `json:"tempDisk,omitempty"` 18550} 18551 18552// VirtualMachineScaleSetRollingUpgradesCancelFuture an abstraction for monitoring and retrieving the 18553// results of a long-running operation. 18554type VirtualMachineScaleSetRollingUpgradesCancelFuture struct { 18555 azure.FutureAPI 18556 // Result returns the result of the asynchronous operation. 18557 // If the operation has not completed it will return an error. 18558 Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) 18559} 18560 18561// UnmarshalJSON is the custom unmarshaller for CreateFuture. 18562func (future *VirtualMachineScaleSetRollingUpgradesCancelFuture) UnmarshalJSON(body []byte) error { 18563 var azFuture azure.Future 18564 if err := json.Unmarshal(body, &azFuture); err != nil { 18565 return err 18566 } 18567 future.FutureAPI = &azFuture 18568 future.Result = future.result 18569 return nil 18570} 18571 18572// result is the default implementation for VirtualMachineScaleSetRollingUpgradesCancelFuture.Result. 18573func (future *VirtualMachineScaleSetRollingUpgradesCancelFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { 18574 var done bool 18575 done, err = future.DoneWithContext(context.Background(), client) 18576 if err != nil { 18577 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesCancelFuture", "Result", future.Response(), "Polling failure") 18578 return 18579 } 18580 if !done { 18581 ar.Response = future.Response() 18582 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesCancelFuture") 18583 return 18584 } 18585 ar.Response = future.Response() 18586 return 18587} 18588 18589// VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture an abstraction for monitoring and 18590// retrieving the results of a long-running operation. 18591type VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture struct { 18592 azure.FutureAPI 18593 // Result returns the result of the asynchronous operation. 18594 // If the operation has not completed it will return an error. 18595 Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) 18596} 18597 18598// UnmarshalJSON is the custom unmarshaller for CreateFuture. 18599func (future *VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture) UnmarshalJSON(body []byte) error { 18600 var azFuture azure.Future 18601 if err := json.Unmarshal(body, &azFuture); err != nil { 18602 return err 18603 } 18604 future.FutureAPI = &azFuture 18605 future.Result = future.result 18606 return nil 18607} 18608 18609// result is the default implementation for VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture.Result. 18610func (future *VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { 18611 var done bool 18612 done, err = future.DoneWithContext(context.Background(), client) 18613 if err != nil { 18614 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture", "Result", future.Response(), "Polling failure") 18615 return 18616 } 18617 if !done { 18618 ar.Response = future.Response() 18619 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture") 18620 return 18621 } 18622 ar.Response = future.Response() 18623 return 18624} 18625 18626// VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture an abstraction for monitoring and retrieving 18627// the results of a long-running operation. 18628type VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture struct { 18629 azure.FutureAPI 18630 // Result returns the result of the asynchronous operation. 18631 // If the operation has not completed it will return an error. 18632 Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) 18633} 18634 18635// UnmarshalJSON is the custom unmarshaller for CreateFuture. 18636func (future *VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture) UnmarshalJSON(body []byte) error { 18637 var azFuture azure.Future 18638 if err := json.Unmarshal(body, &azFuture); err != nil { 18639 return err 18640 } 18641 future.FutureAPI = &azFuture 18642 future.Result = future.result 18643 return nil 18644} 18645 18646// result is the default implementation for VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture.Result. 18647func (future *VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { 18648 var done bool 18649 done, err = future.DoneWithContext(context.Background(), client) 18650 if err != nil { 18651 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture", "Result", future.Response(), "Polling failure") 18652 return 18653 } 18654 if !done { 18655 ar.Response = future.Response() 18656 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture") 18657 return 18658 } 18659 ar.Response = future.Response() 18660 return 18661} 18662 18663// VirtualMachineScaleSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of 18664// a long-running operation. 18665type VirtualMachineScaleSetsCreateOrUpdateFuture struct { 18666 azure.FutureAPI 18667 // Result returns the result of the asynchronous operation. 18668 // If the operation has not completed it will return an error. 18669 Result func(VirtualMachineScaleSetsClient) (VirtualMachineScaleSet, error) 18670} 18671 18672// UnmarshalJSON is the custom unmarshaller for CreateFuture. 18673func (future *VirtualMachineScaleSetsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 18674 var azFuture azure.Future 18675 if err := json.Unmarshal(body, &azFuture); err != nil { 18676 return err 18677 } 18678 future.FutureAPI = &azFuture 18679 future.Result = future.result 18680 return nil 18681} 18682 18683// result is the default implementation for VirtualMachineScaleSetsCreateOrUpdateFuture.Result. 18684func (future *VirtualMachineScaleSetsCreateOrUpdateFuture) result(client VirtualMachineScaleSetsClient) (vmss VirtualMachineScaleSet, err error) { 18685 var done bool 18686 done, err = future.DoneWithContext(context.Background(), client) 18687 if err != nil { 18688 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 18689 return 18690 } 18691 if !done { 18692 vmss.Response.Response = future.Response() 18693 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsCreateOrUpdateFuture") 18694 return 18695 } 18696 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 18697 if vmss.Response.Response, err = future.GetResult(sender); err == nil && vmss.Response.Response.StatusCode != http.StatusNoContent { 18698 vmss, err = client.CreateOrUpdateResponder(vmss.Response.Response) 18699 if err != nil { 18700 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsCreateOrUpdateFuture", "Result", vmss.Response.Response, "Failure responding to request") 18701 } 18702 } 18703 return 18704} 18705 18706// VirtualMachineScaleSetsDeallocateFuture an abstraction for monitoring and retrieving the results of a 18707// long-running operation. 18708type VirtualMachineScaleSetsDeallocateFuture struct { 18709 azure.FutureAPI 18710 // Result returns the result of the asynchronous operation. 18711 // If the operation has not completed it will return an error. 18712 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 18713} 18714 18715// UnmarshalJSON is the custom unmarshaller for CreateFuture. 18716func (future *VirtualMachineScaleSetsDeallocateFuture) UnmarshalJSON(body []byte) error { 18717 var azFuture azure.Future 18718 if err := json.Unmarshal(body, &azFuture); err != nil { 18719 return err 18720 } 18721 future.FutureAPI = &azFuture 18722 future.Result = future.result 18723 return nil 18724} 18725 18726// result is the default implementation for VirtualMachineScaleSetsDeallocateFuture.Result. 18727func (future *VirtualMachineScaleSetsDeallocateFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 18728 var done bool 18729 done, err = future.DoneWithContext(context.Background(), client) 18730 if err != nil { 18731 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeallocateFuture", "Result", future.Response(), "Polling failure") 18732 return 18733 } 18734 if !done { 18735 ar.Response = future.Response() 18736 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeallocateFuture") 18737 return 18738 } 18739 ar.Response = future.Response() 18740 return 18741} 18742 18743// VirtualMachineScaleSetsDeleteFuture an abstraction for monitoring and retrieving the results of a 18744// long-running operation. 18745type VirtualMachineScaleSetsDeleteFuture struct { 18746 azure.FutureAPI 18747 // Result returns the result of the asynchronous operation. 18748 // If the operation has not completed it will return an error. 18749 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 18750} 18751 18752// UnmarshalJSON is the custom unmarshaller for CreateFuture. 18753func (future *VirtualMachineScaleSetsDeleteFuture) UnmarshalJSON(body []byte) error { 18754 var azFuture azure.Future 18755 if err := json.Unmarshal(body, &azFuture); err != nil { 18756 return err 18757 } 18758 future.FutureAPI = &azFuture 18759 future.Result = future.result 18760 return nil 18761} 18762 18763// result is the default implementation for VirtualMachineScaleSetsDeleteFuture.Result. 18764func (future *VirtualMachineScaleSetsDeleteFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 18765 var done bool 18766 done, err = future.DoneWithContext(context.Background(), client) 18767 if err != nil { 18768 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeleteFuture", "Result", future.Response(), "Polling failure") 18769 return 18770 } 18771 if !done { 18772 ar.Response = future.Response() 18773 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeleteFuture") 18774 return 18775 } 18776 ar.Response = future.Response() 18777 return 18778} 18779 18780// VirtualMachineScaleSetsDeleteInstancesFuture an abstraction for monitoring and retrieving the results of 18781// a long-running operation. 18782type VirtualMachineScaleSetsDeleteInstancesFuture struct { 18783 azure.FutureAPI 18784 // Result returns the result of the asynchronous operation. 18785 // If the operation has not completed it will return an error. 18786 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 18787} 18788 18789// UnmarshalJSON is the custom unmarshaller for CreateFuture. 18790func (future *VirtualMachineScaleSetsDeleteInstancesFuture) UnmarshalJSON(body []byte) error { 18791 var azFuture azure.Future 18792 if err := json.Unmarshal(body, &azFuture); err != nil { 18793 return err 18794 } 18795 future.FutureAPI = &azFuture 18796 future.Result = future.result 18797 return nil 18798} 18799 18800// result is the default implementation for VirtualMachineScaleSetsDeleteInstancesFuture.Result. 18801func (future *VirtualMachineScaleSetsDeleteInstancesFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 18802 var done bool 18803 done, err = future.DoneWithContext(context.Background(), client) 18804 if err != nil { 18805 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeleteInstancesFuture", "Result", future.Response(), "Polling failure") 18806 return 18807 } 18808 if !done { 18809 ar.Response = future.Response() 18810 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeleteInstancesFuture") 18811 return 18812 } 18813 ar.Response = future.Response() 18814 return 18815} 18816 18817// VirtualMachineScaleSetSku describes an available virtual machine scale set sku. 18818type VirtualMachineScaleSetSku struct { 18819 // ResourceType - READ-ONLY; The type of resource the sku applies to. 18820 ResourceType *string `json:"resourceType,omitempty"` 18821 // Sku - READ-ONLY; The Sku. 18822 Sku *Sku `json:"sku,omitempty"` 18823 // Capacity - READ-ONLY; Specifies the number of virtual machines in the scale set. 18824 Capacity *VirtualMachineScaleSetSkuCapacity `json:"capacity,omitempty"` 18825} 18826 18827// MarshalJSON is the custom marshaler for VirtualMachineScaleSetSku. 18828func (vmsss VirtualMachineScaleSetSku) MarshalJSON() ([]byte, error) { 18829 objectMap := make(map[string]interface{}) 18830 return json.Marshal(objectMap) 18831} 18832 18833// VirtualMachineScaleSetSkuCapacity describes scaling information of a sku. 18834type VirtualMachineScaleSetSkuCapacity struct { 18835 // Minimum - READ-ONLY; The minimum capacity. 18836 Minimum *int64 `json:"minimum,omitempty"` 18837 // Maximum - READ-ONLY; The maximum capacity that can be set. 18838 Maximum *int64 `json:"maximum,omitempty"` 18839 // DefaultCapacity - READ-ONLY; The default capacity. 18840 DefaultCapacity *int64 `json:"defaultCapacity,omitempty"` 18841 // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'VirtualMachineScaleSetSkuScaleTypeAutomatic', 'VirtualMachineScaleSetSkuScaleTypeNone' 18842 ScaleType VirtualMachineScaleSetSkuScaleType `json:"scaleType,omitempty"` 18843} 18844 18845// MarshalJSON is the custom marshaler for VirtualMachineScaleSetSkuCapacity. 18846func (vmsssc VirtualMachineScaleSetSkuCapacity) MarshalJSON() ([]byte, error) { 18847 objectMap := make(map[string]interface{}) 18848 return json.Marshal(objectMap) 18849} 18850 18851// VirtualMachineScaleSetsPerformMaintenanceFuture an abstraction for monitoring and retrieving the results 18852// of a long-running operation. 18853type VirtualMachineScaleSetsPerformMaintenanceFuture struct { 18854 azure.FutureAPI 18855 // Result returns the result of the asynchronous operation. 18856 // If the operation has not completed it will return an error. 18857 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 18858} 18859 18860// UnmarshalJSON is the custom unmarshaller for CreateFuture. 18861func (future *VirtualMachineScaleSetsPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { 18862 var azFuture azure.Future 18863 if err := json.Unmarshal(body, &azFuture); err != nil { 18864 return err 18865 } 18866 future.FutureAPI = &azFuture 18867 future.Result = future.result 18868 return nil 18869} 18870 18871// result is the default implementation for VirtualMachineScaleSetsPerformMaintenanceFuture.Result. 18872func (future *VirtualMachineScaleSetsPerformMaintenanceFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 18873 var done bool 18874 done, err = future.DoneWithContext(context.Background(), client) 18875 if err != nil { 18876 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsPerformMaintenanceFuture", "Result", future.Response(), "Polling failure") 18877 return 18878 } 18879 if !done { 18880 ar.Response = future.Response() 18881 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsPerformMaintenanceFuture") 18882 return 18883 } 18884 ar.Response = future.Response() 18885 return 18886} 18887 18888// VirtualMachineScaleSetsPowerOffFuture an abstraction for monitoring and retrieving the results of a 18889// long-running operation. 18890type VirtualMachineScaleSetsPowerOffFuture struct { 18891 azure.FutureAPI 18892 // Result returns the result of the asynchronous operation. 18893 // If the operation has not completed it will return an error. 18894 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 18895} 18896 18897// UnmarshalJSON is the custom unmarshaller for CreateFuture. 18898func (future *VirtualMachineScaleSetsPowerOffFuture) UnmarshalJSON(body []byte) error { 18899 var azFuture azure.Future 18900 if err := json.Unmarshal(body, &azFuture); err != nil { 18901 return err 18902 } 18903 future.FutureAPI = &azFuture 18904 future.Result = future.result 18905 return nil 18906} 18907 18908// result is the default implementation for VirtualMachineScaleSetsPowerOffFuture.Result. 18909func (future *VirtualMachineScaleSetsPowerOffFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 18910 var done bool 18911 done, err = future.DoneWithContext(context.Background(), client) 18912 if err != nil { 18913 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsPowerOffFuture", "Result", future.Response(), "Polling failure") 18914 return 18915 } 18916 if !done { 18917 ar.Response = future.Response() 18918 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsPowerOffFuture") 18919 return 18920 } 18921 ar.Response = future.Response() 18922 return 18923} 18924 18925// VirtualMachineScaleSetsRedeployFuture an abstraction for monitoring and retrieving the results of a 18926// long-running operation. 18927type VirtualMachineScaleSetsRedeployFuture struct { 18928 azure.FutureAPI 18929 // Result returns the result of the asynchronous operation. 18930 // If the operation has not completed it will return an error. 18931 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 18932} 18933 18934// UnmarshalJSON is the custom unmarshaller for CreateFuture. 18935func (future *VirtualMachineScaleSetsRedeployFuture) UnmarshalJSON(body []byte) error { 18936 var azFuture azure.Future 18937 if err := json.Unmarshal(body, &azFuture); err != nil { 18938 return err 18939 } 18940 future.FutureAPI = &azFuture 18941 future.Result = future.result 18942 return nil 18943} 18944 18945// result is the default implementation for VirtualMachineScaleSetsRedeployFuture.Result. 18946func (future *VirtualMachineScaleSetsRedeployFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 18947 var done bool 18948 done, err = future.DoneWithContext(context.Background(), client) 18949 if err != nil { 18950 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsRedeployFuture", "Result", future.Response(), "Polling failure") 18951 return 18952 } 18953 if !done { 18954 ar.Response = future.Response() 18955 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsRedeployFuture") 18956 return 18957 } 18958 ar.Response = future.Response() 18959 return 18960} 18961 18962// VirtualMachineScaleSetsReimageAllFuture an abstraction for monitoring and retrieving the results of a 18963// long-running operation. 18964type VirtualMachineScaleSetsReimageAllFuture struct { 18965 azure.FutureAPI 18966 // Result returns the result of the asynchronous operation. 18967 // If the operation has not completed it will return an error. 18968 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 18969} 18970 18971// UnmarshalJSON is the custom unmarshaller for CreateFuture. 18972func (future *VirtualMachineScaleSetsReimageAllFuture) UnmarshalJSON(body []byte) error { 18973 var azFuture azure.Future 18974 if err := json.Unmarshal(body, &azFuture); err != nil { 18975 return err 18976 } 18977 future.FutureAPI = &azFuture 18978 future.Result = future.result 18979 return nil 18980} 18981 18982// result is the default implementation for VirtualMachineScaleSetsReimageAllFuture.Result. 18983func (future *VirtualMachineScaleSetsReimageAllFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 18984 var done bool 18985 done, err = future.DoneWithContext(context.Background(), client) 18986 if err != nil { 18987 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsReimageAllFuture", "Result", future.Response(), "Polling failure") 18988 return 18989 } 18990 if !done { 18991 ar.Response = future.Response() 18992 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsReimageAllFuture") 18993 return 18994 } 18995 ar.Response = future.Response() 18996 return 18997} 18998 18999// VirtualMachineScaleSetsReimageFuture an abstraction for monitoring and retrieving the results of a 19000// long-running operation. 19001type VirtualMachineScaleSetsReimageFuture struct { 19002 azure.FutureAPI 19003 // Result returns the result of the asynchronous operation. 19004 // If the operation has not completed it will return an error. 19005 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 19006} 19007 19008// UnmarshalJSON is the custom unmarshaller for CreateFuture. 19009func (future *VirtualMachineScaleSetsReimageFuture) UnmarshalJSON(body []byte) error { 19010 var azFuture azure.Future 19011 if err := json.Unmarshal(body, &azFuture); err != nil { 19012 return err 19013 } 19014 future.FutureAPI = &azFuture 19015 future.Result = future.result 19016 return nil 19017} 19018 19019// result is the default implementation for VirtualMachineScaleSetsReimageFuture.Result. 19020func (future *VirtualMachineScaleSetsReimageFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 19021 var done bool 19022 done, err = future.DoneWithContext(context.Background(), client) 19023 if err != nil { 19024 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsReimageFuture", "Result", future.Response(), "Polling failure") 19025 return 19026 } 19027 if !done { 19028 ar.Response = future.Response() 19029 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsReimageFuture") 19030 return 19031 } 19032 ar.Response = future.Response() 19033 return 19034} 19035 19036// VirtualMachineScaleSetsRestartFuture an abstraction for monitoring and retrieving the results of a 19037// long-running operation. 19038type VirtualMachineScaleSetsRestartFuture struct { 19039 azure.FutureAPI 19040 // Result returns the result of the asynchronous operation. 19041 // If the operation has not completed it will return an error. 19042 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 19043} 19044 19045// UnmarshalJSON is the custom unmarshaller for CreateFuture. 19046func (future *VirtualMachineScaleSetsRestartFuture) UnmarshalJSON(body []byte) error { 19047 var azFuture azure.Future 19048 if err := json.Unmarshal(body, &azFuture); err != nil { 19049 return err 19050 } 19051 future.FutureAPI = &azFuture 19052 future.Result = future.result 19053 return nil 19054} 19055 19056// result is the default implementation for VirtualMachineScaleSetsRestartFuture.Result. 19057func (future *VirtualMachineScaleSetsRestartFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 19058 var done bool 19059 done, err = future.DoneWithContext(context.Background(), client) 19060 if err != nil { 19061 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsRestartFuture", "Result", future.Response(), "Polling failure") 19062 return 19063 } 19064 if !done { 19065 ar.Response = future.Response() 19066 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsRestartFuture") 19067 return 19068 } 19069 ar.Response = future.Response() 19070 return 19071} 19072 19073// VirtualMachineScaleSetsSetOrchestrationServiceStateFuture an abstraction for monitoring and retrieving 19074// the results of a long-running operation. 19075type VirtualMachineScaleSetsSetOrchestrationServiceStateFuture struct { 19076 azure.FutureAPI 19077 // Result returns the result of the asynchronous operation. 19078 // If the operation has not completed it will return an error. 19079 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 19080} 19081 19082// UnmarshalJSON is the custom unmarshaller for CreateFuture. 19083func (future *VirtualMachineScaleSetsSetOrchestrationServiceStateFuture) UnmarshalJSON(body []byte) error { 19084 var azFuture azure.Future 19085 if err := json.Unmarshal(body, &azFuture); err != nil { 19086 return err 19087 } 19088 future.FutureAPI = &azFuture 19089 future.Result = future.result 19090 return nil 19091} 19092 19093// result is the default implementation for VirtualMachineScaleSetsSetOrchestrationServiceStateFuture.Result. 19094func (future *VirtualMachineScaleSetsSetOrchestrationServiceStateFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 19095 var done bool 19096 done, err = future.DoneWithContext(context.Background(), client) 19097 if err != nil { 19098 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsSetOrchestrationServiceStateFuture", "Result", future.Response(), "Polling failure") 19099 return 19100 } 19101 if !done { 19102 ar.Response = future.Response() 19103 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsSetOrchestrationServiceStateFuture") 19104 return 19105 } 19106 ar.Response = future.Response() 19107 return 19108} 19109 19110// VirtualMachineScaleSetsStartFuture an abstraction for monitoring and retrieving the results of a 19111// long-running operation. 19112type VirtualMachineScaleSetsStartFuture struct { 19113 azure.FutureAPI 19114 // Result returns the result of the asynchronous operation. 19115 // If the operation has not completed it will return an error. 19116 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 19117} 19118 19119// UnmarshalJSON is the custom unmarshaller for CreateFuture. 19120func (future *VirtualMachineScaleSetsStartFuture) UnmarshalJSON(body []byte) error { 19121 var azFuture azure.Future 19122 if err := json.Unmarshal(body, &azFuture); err != nil { 19123 return err 19124 } 19125 future.FutureAPI = &azFuture 19126 future.Result = future.result 19127 return nil 19128} 19129 19130// result is the default implementation for VirtualMachineScaleSetsStartFuture.Result. 19131func (future *VirtualMachineScaleSetsStartFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 19132 var done bool 19133 done, err = future.DoneWithContext(context.Background(), client) 19134 if err != nil { 19135 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsStartFuture", "Result", future.Response(), "Polling failure") 19136 return 19137 } 19138 if !done { 19139 ar.Response = future.Response() 19140 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsStartFuture") 19141 return 19142 } 19143 ar.Response = future.Response() 19144 return 19145} 19146 19147// VirtualMachineScaleSetStorageProfile describes a virtual machine scale set storage profile. 19148type VirtualMachineScaleSetStorageProfile struct { 19149 // 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. 19150 ImageReference *ImageReference `json:"imageReference,omitempty"` 19151 // 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/managed-disks-overview). 19152 OsDisk *VirtualMachineScaleSetOSDisk `json:"osDisk,omitempty"` 19153 // 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/managed-disks-overview). 19154 DataDisks *[]VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"` 19155} 19156 19157// VirtualMachineScaleSetsUpdateFuture an abstraction for monitoring and retrieving the results of a 19158// long-running operation. 19159type VirtualMachineScaleSetsUpdateFuture struct { 19160 azure.FutureAPI 19161 // Result returns the result of the asynchronous operation. 19162 // If the operation has not completed it will return an error. 19163 Result func(VirtualMachineScaleSetsClient) (VirtualMachineScaleSet, error) 19164} 19165 19166// UnmarshalJSON is the custom unmarshaller for CreateFuture. 19167func (future *VirtualMachineScaleSetsUpdateFuture) UnmarshalJSON(body []byte) error { 19168 var azFuture azure.Future 19169 if err := json.Unmarshal(body, &azFuture); err != nil { 19170 return err 19171 } 19172 future.FutureAPI = &azFuture 19173 future.Result = future.result 19174 return nil 19175} 19176 19177// result is the default implementation for VirtualMachineScaleSetsUpdateFuture.Result. 19178func (future *VirtualMachineScaleSetsUpdateFuture) result(client VirtualMachineScaleSetsClient) (vmss VirtualMachineScaleSet, err error) { 19179 var done bool 19180 done, err = future.DoneWithContext(context.Background(), client) 19181 if err != nil { 19182 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateFuture", "Result", future.Response(), "Polling failure") 19183 return 19184 } 19185 if !done { 19186 vmss.Response.Response = future.Response() 19187 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsUpdateFuture") 19188 return 19189 } 19190 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 19191 if vmss.Response.Response, err = future.GetResult(sender); err == nil && vmss.Response.Response.StatusCode != http.StatusNoContent { 19192 vmss, err = client.UpdateResponder(vmss.Response.Response) 19193 if err != nil { 19194 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateFuture", "Result", vmss.Response.Response, "Failure responding to request") 19195 } 19196 } 19197 return 19198} 19199 19200// VirtualMachineScaleSetsUpdateInstancesFuture an abstraction for monitoring and retrieving the results of 19201// a long-running operation. 19202type VirtualMachineScaleSetsUpdateInstancesFuture struct { 19203 azure.FutureAPI 19204 // Result returns the result of the asynchronous operation. 19205 // If the operation has not completed it will return an error. 19206 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 19207} 19208 19209// UnmarshalJSON is the custom unmarshaller for CreateFuture. 19210func (future *VirtualMachineScaleSetsUpdateInstancesFuture) UnmarshalJSON(body []byte) error { 19211 var azFuture azure.Future 19212 if err := json.Unmarshal(body, &azFuture); err != nil { 19213 return err 19214 } 19215 future.FutureAPI = &azFuture 19216 future.Result = future.result 19217 return nil 19218} 19219 19220// result is the default implementation for VirtualMachineScaleSetsUpdateInstancesFuture.Result. 19221func (future *VirtualMachineScaleSetsUpdateInstancesFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 19222 var done bool 19223 done, err = future.DoneWithContext(context.Background(), client) 19224 if err != nil { 19225 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateInstancesFuture", "Result", future.Response(), "Polling failure") 19226 return 19227 } 19228 if !done { 19229 ar.Response = future.Response() 19230 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsUpdateInstancesFuture") 19231 return 19232 } 19233 ar.Response = future.Response() 19234 return 19235} 19236 19237// VirtualMachineScaleSetUpdate describes a Virtual Machine Scale Set. 19238type VirtualMachineScaleSetUpdate struct { 19239 // Sku - The virtual machine scale set sku. 19240 Sku *Sku `json:"sku,omitempty"` 19241 // Plan - The purchase plan when deploying a virtual machine scale set from VM Marketplace images. 19242 Plan *Plan `json:"plan,omitempty"` 19243 *VirtualMachineScaleSetUpdateProperties `json:"properties,omitempty"` 19244 // Identity - The identity of the virtual machine scale set, if configured. 19245 Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"` 19246 // Tags - Resource tags 19247 Tags map[string]*string `json:"tags"` 19248} 19249 19250// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdate. 19251func (vmssu VirtualMachineScaleSetUpdate) MarshalJSON() ([]byte, error) { 19252 objectMap := make(map[string]interface{}) 19253 if vmssu.Sku != nil { 19254 objectMap["sku"] = vmssu.Sku 19255 } 19256 if vmssu.Plan != nil { 19257 objectMap["plan"] = vmssu.Plan 19258 } 19259 if vmssu.VirtualMachineScaleSetUpdateProperties != nil { 19260 objectMap["properties"] = vmssu.VirtualMachineScaleSetUpdateProperties 19261 } 19262 if vmssu.Identity != nil { 19263 objectMap["identity"] = vmssu.Identity 19264 } 19265 if vmssu.Tags != nil { 19266 objectMap["tags"] = vmssu.Tags 19267 } 19268 return json.Marshal(objectMap) 19269} 19270 19271// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdate struct. 19272func (vmssu *VirtualMachineScaleSetUpdate) UnmarshalJSON(body []byte) error { 19273 var m map[string]*json.RawMessage 19274 err := json.Unmarshal(body, &m) 19275 if err != nil { 19276 return err 19277 } 19278 for k, v := range m { 19279 switch k { 19280 case "sku": 19281 if v != nil { 19282 var sku Sku 19283 err = json.Unmarshal(*v, &sku) 19284 if err != nil { 19285 return err 19286 } 19287 vmssu.Sku = &sku 19288 } 19289 case "plan": 19290 if v != nil { 19291 var plan Plan 19292 err = json.Unmarshal(*v, &plan) 19293 if err != nil { 19294 return err 19295 } 19296 vmssu.Plan = &plan 19297 } 19298 case "properties": 19299 if v != nil { 19300 var virtualMachineScaleSetUpdateProperties VirtualMachineScaleSetUpdateProperties 19301 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateProperties) 19302 if err != nil { 19303 return err 19304 } 19305 vmssu.VirtualMachineScaleSetUpdateProperties = &virtualMachineScaleSetUpdateProperties 19306 } 19307 case "identity": 19308 if v != nil { 19309 var identity VirtualMachineScaleSetIdentity 19310 err = json.Unmarshal(*v, &identity) 19311 if err != nil { 19312 return err 19313 } 19314 vmssu.Identity = &identity 19315 } 19316 case "tags": 19317 if v != nil { 19318 var tags map[string]*string 19319 err = json.Unmarshal(*v, &tags) 19320 if err != nil { 19321 return err 19322 } 19323 vmssu.Tags = tags 19324 } 19325 } 19326 } 19327 19328 return nil 19329} 19330 19331// VirtualMachineScaleSetUpdateIPConfiguration describes a virtual machine scale set network profile's IP 19332// configuration. NOTE: The subnet of a scale set may be modified as long as the original subnet and the 19333// new subnet are in the same virtual network 19334type VirtualMachineScaleSetUpdateIPConfiguration struct { 19335 // Name - The IP configuration name. 19336 Name *string `json:"name,omitempty"` 19337 *VirtualMachineScaleSetUpdateIPConfigurationProperties `json:"properties,omitempty"` 19338 // ID - Resource Id 19339 ID *string `json:"id,omitempty"` 19340} 19341 19342// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdateIPConfiguration. 19343func (vmssuic VirtualMachineScaleSetUpdateIPConfiguration) MarshalJSON() ([]byte, error) { 19344 objectMap := make(map[string]interface{}) 19345 if vmssuic.Name != nil { 19346 objectMap["name"] = vmssuic.Name 19347 } 19348 if vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties != nil { 19349 objectMap["properties"] = vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties 19350 } 19351 if vmssuic.ID != nil { 19352 objectMap["id"] = vmssuic.ID 19353 } 19354 return json.Marshal(objectMap) 19355} 19356 19357// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdateIPConfiguration struct. 19358func (vmssuic *VirtualMachineScaleSetUpdateIPConfiguration) UnmarshalJSON(body []byte) error { 19359 var m map[string]*json.RawMessage 19360 err := json.Unmarshal(body, &m) 19361 if err != nil { 19362 return err 19363 } 19364 for k, v := range m { 19365 switch k { 19366 case "name": 19367 if v != nil { 19368 var name string 19369 err = json.Unmarshal(*v, &name) 19370 if err != nil { 19371 return err 19372 } 19373 vmssuic.Name = &name 19374 } 19375 case "properties": 19376 if v != nil { 19377 var virtualMachineScaleSetUpdateIPConfigurationProperties VirtualMachineScaleSetUpdateIPConfigurationProperties 19378 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateIPConfigurationProperties) 19379 if err != nil { 19380 return err 19381 } 19382 vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties = &virtualMachineScaleSetUpdateIPConfigurationProperties 19383 } 19384 case "id": 19385 if v != nil { 19386 var ID string 19387 err = json.Unmarshal(*v, &ID) 19388 if err != nil { 19389 return err 19390 } 19391 vmssuic.ID = &ID 19392 } 19393 } 19394 } 19395 19396 return nil 19397} 19398 19399// VirtualMachineScaleSetUpdateIPConfigurationProperties describes a virtual machine scale set network 19400// profile's IP configuration properties. 19401type VirtualMachineScaleSetUpdateIPConfigurationProperties struct { 19402 // Subnet - The subnet. 19403 Subnet *APIEntityReference `json:"subnet,omitempty"` 19404 // Primary - Specifies the primary IP Configuration in case the network interface has more than one IP Configuration. 19405 Primary *bool `json:"primary,omitempty"` 19406 // PublicIPAddressConfiguration - The publicIPAddressConfiguration. 19407 PublicIPAddressConfiguration *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` 19408 // 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: 'IPVersionIPv4', 'IPVersionIPv6' 19409 PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` 19410 // ApplicationGatewayBackendAddressPools - The application gateway backend address pools. 19411 ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` 19412 // ApplicationSecurityGroups - Specifies an array of references to application security group. 19413 ApplicationSecurityGroups *[]SubResource `json:"applicationSecurityGroups,omitempty"` 19414 // LoadBalancerBackendAddressPools - The load balancer backend address pools. 19415 LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` 19416 // LoadBalancerInboundNatPools - The load balancer inbound nat pools. 19417 LoadBalancerInboundNatPools *[]SubResource `json:"loadBalancerInboundNatPools,omitempty"` 19418} 19419 19420// VirtualMachineScaleSetUpdateNetworkConfiguration describes a virtual machine scale set network profile's 19421// network configurations. 19422type VirtualMachineScaleSetUpdateNetworkConfiguration struct { 19423 // Name - The network configuration name. 19424 Name *string `json:"name,omitempty"` 19425 *VirtualMachineScaleSetUpdateNetworkConfigurationProperties `json:"properties,omitempty"` 19426 // ID - Resource Id 19427 ID *string `json:"id,omitempty"` 19428} 19429 19430// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdateNetworkConfiguration. 19431func (vmssunc VirtualMachineScaleSetUpdateNetworkConfiguration) MarshalJSON() ([]byte, error) { 19432 objectMap := make(map[string]interface{}) 19433 if vmssunc.Name != nil { 19434 objectMap["name"] = vmssunc.Name 19435 } 19436 if vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties != nil { 19437 objectMap["properties"] = vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties 19438 } 19439 if vmssunc.ID != nil { 19440 objectMap["id"] = vmssunc.ID 19441 } 19442 return json.Marshal(objectMap) 19443} 19444 19445// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdateNetworkConfiguration struct. 19446func (vmssunc *VirtualMachineScaleSetUpdateNetworkConfiguration) UnmarshalJSON(body []byte) error { 19447 var m map[string]*json.RawMessage 19448 err := json.Unmarshal(body, &m) 19449 if err != nil { 19450 return err 19451 } 19452 for k, v := range m { 19453 switch k { 19454 case "name": 19455 if v != nil { 19456 var name string 19457 err = json.Unmarshal(*v, &name) 19458 if err != nil { 19459 return err 19460 } 19461 vmssunc.Name = &name 19462 } 19463 case "properties": 19464 if v != nil { 19465 var virtualMachineScaleSetUpdateNetworkConfigurationProperties VirtualMachineScaleSetUpdateNetworkConfigurationProperties 19466 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateNetworkConfigurationProperties) 19467 if err != nil { 19468 return err 19469 } 19470 vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties = &virtualMachineScaleSetUpdateNetworkConfigurationProperties 19471 } 19472 case "id": 19473 if v != nil { 19474 var ID string 19475 err = json.Unmarshal(*v, &ID) 19476 if err != nil { 19477 return err 19478 } 19479 vmssunc.ID = &ID 19480 } 19481 } 19482 } 19483 19484 return nil 19485} 19486 19487// VirtualMachineScaleSetUpdateNetworkConfigurationProperties describes a virtual machine scale set 19488// updatable network profile's IP configuration.Use this object for updating network profile's IP 19489// Configuration. 19490type VirtualMachineScaleSetUpdateNetworkConfigurationProperties struct { 19491 // Primary - Whether this is a primary NIC on a virtual machine. 19492 Primary *bool `json:"primary,omitempty"` 19493 // EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled. 19494 EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` 19495 // EnableFpga - Specifies whether the network interface is FPGA networking-enabled. 19496 EnableFpga *bool `json:"enableFpga,omitempty"` 19497 // NetworkSecurityGroup - The network security group. 19498 NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` 19499 // DNSSettings - The dns settings to be applied on the network interfaces. 19500 DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings `json:"dnsSettings,omitempty"` 19501 // IPConfigurations - The virtual machine scale set IP Configuration. 19502 IPConfigurations *[]VirtualMachineScaleSetUpdateIPConfiguration `json:"ipConfigurations,omitempty"` 19503 // EnableIPForwarding - Whether IP forwarding enabled on this NIC. 19504 EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` 19505 // DeleteOption - Specify what happens to the network interface when the VM is deleted. Possible values include: 'DeleteOptionsDelete', 'DeleteOptionsDetach' 19506 DeleteOption DeleteOptions `json:"deleteOption,omitempty"` 19507} 19508 19509// VirtualMachineScaleSetUpdateNetworkProfile describes a virtual machine scale set network profile. 19510type VirtualMachineScaleSetUpdateNetworkProfile struct { 19511 // 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}'. 19512 HealthProbe *APIEntityReference `json:"healthProbe,omitempty"` 19513 // NetworkInterfaceConfigurations - The list of network configurations. 19514 NetworkInterfaceConfigurations *[]VirtualMachineScaleSetUpdateNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` 19515 // NetworkAPIVersion - specifies the Microsoft.Network API version used when creating networking resources in the Network Interface Configurations for Virtual Machine Scale Set with orchestration mode 'Flexible'. Possible values include: 'NetworkAPIVersionTwoZeroTwoZeroHyphenMinusOneOneHyphenMinusZeroOne' 19516 NetworkAPIVersion NetworkAPIVersion `json:"networkApiVersion,omitempty"` 19517} 19518 19519// VirtualMachineScaleSetUpdateOSDisk describes virtual machine scale set operating system disk Update 19520// Object. This should be used for Updating VMSS OS Disk. 19521type VirtualMachineScaleSetUpdateOSDisk struct { 19522 // Caching - The caching type. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' 19523 Caching CachingTypes `json:"caching,omitempty"` 19524 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 19525 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 19526 // 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 19527 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 19528 // 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. 19529 Image *VirtualHardDisk `json:"image,omitempty"` 19530 // VhdContainers - The list of virtual hard disk container uris. 19531 VhdContainers *[]string `json:"vhdContainers,omitempty"` 19532 // ManagedDisk - The managed disk parameters. 19533 ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` 19534} 19535 19536// VirtualMachineScaleSetUpdateOSProfile describes a virtual machine scale set OS profile. 19537type VirtualMachineScaleSetUpdateOSProfile struct { 19538 // CustomData - A base-64 encoded string of custom data. 19539 CustomData *string `json:"customData,omitempty"` 19540 // WindowsConfiguration - The Windows Configuration of the OS profile. 19541 WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` 19542 // LinuxConfiguration - The Linux Configuration of the OS profile. 19543 LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` 19544 // Secrets - The List of certificates for addition to the VM. 19545 Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` 19546} 19547 19548// VirtualMachineScaleSetUpdateProperties describes the properties of a Virtual Machine Scale Set. 19549type VirtualMachineScaleSetUpdateProperties struct { 19550 // UpgradePolicy - The upgrade policy. 19551 UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` 19552 // AutomaticRepairsPolicy - Policy for automatic repairs. 19553 AutomaticRepairsPolicy *AutomaticRepairsPolicy `json:"automaticRepairsPolicy,omitempty"` 19554 // VirtualMachineProfile - The virtual machine profile. 19555 VirtualMachineProfile *VirtualMachineScaleSetUpdateVMProfile `json:"virtualMachineProfile,omitempty"` 19556 // Overprovision - Specifies whether the Virtual Machine Scale Set should be overprovisioned. 19557 Overprovision *bool `json:"overprovision,omitempty"` 19558 // 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. 19559 DoNotRunExtensionsOnOverprovisionedVMs *bool `json:"doNotRunExtensionsOnOverprovisionedVMs,omitempty"` 19560 // 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. 19561 SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"` 19562 // 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. 19563 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 19564 // ScaleInPolicy - Specifies the scale-in policy that decides which virtual machines are chosen for removal when a Virtual Machine Scale Set is scaled-in. 19565 ScaleInPolicy *ScaleInPolicy `json:"scaleInPolicy,omitempty"` 19566 // 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. 19567 ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` 19568} 19569 19570// VirtualMachineScaleSetUpdatePublicIPAddressConfiguration describes a virtual machines scale set IP 19571// Configuration's PublicIPAddress configuration 19572type VirtualMachineScaleSetUpdatePublicIPAddressConfiguration struct { 19573 // Name - The publicIP address configuration name. 19574 Name *string `json:"name,omitempty"` 19575 *VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties `json:"properties,omitempty"` 19576} 19577 19578// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdatePublicIPAddressConfiguration. 19579func (vmssupiac VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { 19580 objectMap := make(map[string]interface{}) 19581 if vmssupiac.Name != nil { 19582 objectMap["name"] = vmssupiac.Name 19583 } 19584 if vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties != nil { 19585 objectMap["properties"] = vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties 19586 } 19587 return json.Marshal(objectMap) 19588} 19589 19590// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdatePublicIPAddressConfiguration struct. 19591func (vmssupiac *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) UnmarshalJSON(body []byte) error { 19592 var m map[string]*json.RawMessage 19593 err := json.Unmarshal(body, &m) 19594 if err != nil { 19595 return err 19596 } 19597 for k, v := range m { 19598 switch k { 19599 case "name": 19600 if v != nil { 19601 var name string 19602 err = json.Unmarshal(*v, &name) 19603 if err != nil { 19604 return err 19605 } 19606 vmssupiac.Name = &name 19607 } 19608 case "properties": 19609 if v != nil { 19610 var virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties 19611 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties) 19612 if err != nil { 19613 return err 19614 } 19615 vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties = &virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties 19616 } 19617 } 19618 } 19619 19620 return nil 19621} 19622 19623// VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties describes a virtual machines scale 19624// set IP Configuration's PublicIPAddress configuration 19625type VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties struct { 19626 // IdleTimeoutInMinutes - The idle timeout of the public IP address. 19627 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` 19628 // DNSSettings - The dns settings to be applied on the publicIP addresses . 19629 DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings `json:"dnsSettings,omitempty"` 19630 // DeleteOption - Specify what happens to the public IP when the VM is deleted. Possible values include: 'DeleteOptionsDelete', 'DeleteOptionsDetach' 19631 DeleteOption DeleteOptions `json:"deleteOption,omitempty"` 19632} 19633 19634// VirtualMachineScaleSetUpdateStorageProfile describes a virtual machine scale set storage profile. 19635type VirtualMachineScaleSetUpdateStorageProfile struct { 19636 // ImageReference - The image reference. 19637 ImageReference *ImageReference `json:"imageReference,omitempty"` 19638 // OsDisk - The OS disk. 19639 OsDisk *VirtualMachineScaleSetUpdateOSDisk `json:"osDisk,omitempty"` 19640 // DataDisks - The data disks. 19641 DataDisks *[]VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"` 19642} 19643 19644// VirtualMachineScaleSetUpdateVMProfile describes a virtual machine scale set virtual machine profile. 19645type VirtualMachineScaleSetUpdateVMProfile struct { 19646 // OsProfile - The virtual machine scale set OS profile. 19647 OsProfile *VirtualMachineScaleSetUpdateOSProfile `json:"osProfile,omitempty"` 19648 // StorageProfile - The virtual machine scale set storage profile. 19649 StorageProfile *VirtualMachineScaleSetUpdateStorageProfile `json:"storageProfile,omitempty"` 19650 // NetworkProfile - The virtual machine scale set network profile. 19651 NetworkProfile *VirtualMachineScaleSetUpdateNetworkProfile `json:"networkProfile,omitempty"` 19652 // SecurityProfile - The virtual machine scale set Security profile 19653 SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` 19654 // DiagnosticsProfile - The virtual machine scale set diagnostics profile. 19655 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 19656 // ExtensionProfile - The virtual machine scale set extension profile. 19657 ExtensionProfile *VirtualMachineScaleSetExtensionProfile `json:"extensionProfile,omitempty"` 19658 // LicenseType - The license type, which is for bring your own license scenario. 19659 LicenseType *string `json:"licenseType,omitempty"` 19660 // BillingProfile - Specifies the billing related details of a Azure Spot VMSS. <br><br>Minimum api-version: 2019-03-01. 19661 BillingProfile *BillingProfile `json:"billingProfile,omitempty"` 19662 // ScheduledEventsProfile - Specifies Scheduled Event related configurations. 19663 ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` 19664 // UserData - UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. <br><br>Minimum api-version: 2021-03-01 19665 UserData *string `json:"userData,omitempty"` 19666} 19667 19668// VirtualMachineScaleSetVM describes a virtual machine scale set virtual machine. 19669type VirtualMachineScaleSetVM struct { 19670 autorest.Response `json:"-"` 19671 // InstanceID - READ-ONLY; The virtual machine instance ID. 19672 InstanceID *string `json:"instanceId,omitempty"` 19673 // Sku - READ-ONLY; The virtual machine SKU. 19674 Sku *Sku `json:"sku,omitempty"` 19675 *VirtualMachineScaleSetVMProperties `json:"properties,omitempty"` 19676 // 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**. 19677 Plan *Plan `json:"plan,omitempty"` 19678 // Resources - READ-ONLY; The virtual machine child extension resources. 19679 Resources *[]VirtualMachineExtension `json:"resources,omitempty"` 19680 // Zones - READ-ONLY; The virtual machine zones. 19681 Zones *[]string `json:"zones,omitempty"` 19682 // ID - READ-ONLY; Resource Id 19683 ID *string `json:"id,omitempty"` 19684 // Name - READ-ONLY; Resource name 19685 Name *string `json:"name,omitempty"` 19686 // Type - READ-ONLY; Resource type 19687 Type *string `json:"type,omitempty"` 19688 // Location - Resource location 19689 Location *string `json:"location,omitempty"` 19690 // Tags - Resource tags 19691 Tags map[string]*string `json:"tags"` 19692} 19693 19694// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVM. 19695func (vmssv VirtualMachineScaleSetVM) MarshalJSON() ([]byte, error) { 19696 objectMap := make(map[string]interface{}) 19697 if vmssv.VirtualMachineScaleSetVMProperties != nil { 19698 objectMap["properties"] = vmssv.VirtualMachineScaleSetVMProperties 19699 } 19700 if vmssv.Plan != nil { 19701 objectMap["plan"] = vmssv.Plan 19702 } 19703 if vmssv.Location != nil { 19704 objectMap["location"] = vmssv.Location 19705 } 19706 if vmssv.Tags != nil { 19707 objectMap["tags"] = vmssv.Tags 19708 } 19709 return json.Marshal(objectMap) 19710} 19711 19712// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetVM struct. 19713func (vmssv *VirtualMachineScaleSetVM) UnmarshalJSON(body []byte) error { 19714 var m map[string]*json.RawMessage 19715 err := json.Unmarshal(body, &m) 19716 if err != nil { 19717 return err 19718 } 19719 for k, v := range m { 19720 switch k { 19721 case "instanceId": 19722 if v != nil { 19723 var instanceID string 19724 err = json.Unmarshal(*v, &instanceID) 19725 if err != nil { 19726 return err 19727 } 19728 vmssv.InstanceID = &instanceID 19729 } 19730 case "sku": 19731 if v != nil { 19732 var sku Sku 19733 err = json.Unmarshal(*v, &sku) 19734 if err != nil { 19735 return err 19736 } 19737 vmssv.Sku = &sku 19738 } 19739 case "properties": 19740 if v != nil { 19741 var virtualMachineScaleSetVMProperties VirtualMachineScaleSetVMProperties 19742 err = json.Unmarshal(*v, &virtualMachineScaleSetVMProperties) 19743 if err != nil { 19744 return err 19745 } 19746 vmssv.VirtualMachineScaleSetVMProperties = &virtualMachineScaleSetVMProperties 19747 } 19748 case "plan": 19749 if v != nil { 19750 var plan Plan 19751 err = json.Unmarshal(*v, &plan) 19752 if err != nil { 19753 return err 19754 } 19755 vmssv.Plan = &plan 19756 } 19757 case "resources": 19758 if v != nil { 19759 var resources []VirtualMachineExtension 19760 err = json.Unmarshal(*v, &resources) 19761 if err != nil { 19762 return err 19763 } 19764 vmssv.Resources = &resources 19765 } 19766 case "zones": 19767 if v != nil { 19768 var zones []string 19769 err = json.Unmarshal(*v, &zones) 19770 if err != nil { 19771 return err 19772 } 19773 vmssv.Zones = &zones 19774 } 19775 case "id": 19776 if v != nil { 19777 var ID string 19778 err = json.Unmarshal(*v, &ID) 19779 if err != nil { 19780 return err 19781 } 19782 vmssv.ID = &ID 19783 } 19784 case "name": 19785 if v != nil { 19786 var name string 19787 err = json.Unmarshal(*v, &name) 19788 if err != nil { 19789 return err 19790 } 19791 vmssv.Name = &name 19792 } 19793 case "type": 19794 if v != nil { 19795 var typeVar string 19796 err = json.Unmarshal(*v, &typeVar) 19797 if err != nil { 19798 return err 19799 } 19800 vmssv.Type = &typeVar 19801 } 19802 case "location": 19803 if v != nil { 19804 var location string 19805 err = json.Unmarshal(*v, &location) 19806 if err != nil { 19807 return err 19808 } 19809 vmssv.Location = &location 19810 } 19811 case "tags": 19812 if v != nil { 19813 var tags map[string]*string 19814 err = json.Unmarshal(*v, &tags) 19815 if err != nil { 19816 return err 19817 } 19818 vmssv.Tags = tags 19819 } 19820 } 19821 } 19822 19823 return nil 19824} 19825 19826// VirtualMachineScaleSetVMExtension describes a VMSS VM Extension. 19827type VirtualMachineScaleSetVMExtension struct { 19828 autorest.Response `json:"-"` 19829 // Name - READ-ONLY; The name of the extension. 19830 Name *string `json:"name,omitempty"` 19831 // Type - READ-ONLY; Resource type 19832 Type *string `json:"type,omitempty"` 19833 *VirtualMachineExtensionProperties `json:"properties,omitempty"` 19834 // ID - READ-ONLY; Resource Id 19835 ID *string `json:"id,omitempty"` 19836} 19837 19838// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMExtension. 19839func (vmssve VirtualMachineScaleSetVMExtension) MarshalJSON() ([]byte, error) { 19840 objectMap := make(map[string]interface{}) 19841 if vmssve.VirtualMachineExtensionProperties != nil { 19842 objectMap["properties"] = vmssve.VirtualMachineExtensionProperties 19843 } 19844 return json.Marshal(objectMap) 19845} 19846 19847// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetVMExtension struct. 19848func (vmssve *VirtualMachineScaleSetVMExtension) UnmarshalJSON(body []byte) error { 19849 var m map[string]*json.RawMessage 19850 err := json.Unmarshal(body, &m) 19851 if err != nil { 19852 return err 19853 } 19854 for k, v := range m { 19855 switch k { 19856 case "name": 19857 if v != nil { 19858 var name string 19859 err = json.Unmarshal(*v, &name) 19860 if err != nil { 19861 return err 19862 } 19863 vmssve.Name = &name 19864 } 19865 case "type": 19866 if v != nil { 19867 var typeVar string 19868 err = json.Unmarshal(*v, &typeVar) 19869 if err != nil { 19870 return err 19871 } 19872 vmssve.Type = &typeVar 19873 } 19874 case "properties": 19875 if v != nil { 19876 var virtualMachineExtensionProperties VirtualMachineExtensionProperties 19877 err = json.Unmarshal(*v, &virtualMachineExtensionProperties) 19878 if err != nil { 19879 return err 19880 } 19881 vmssve.VirtualMachineExtensionProperties = &virtualMachineExtensionProperties 19882 } 19883 case "id": 19884 if v != nil { 19885 var ID string 19886 err = json.Unmarshal(*v, &ID) 19887 if err != nil { 19888 return err 19889 } 19890 vmssve.ID = &ID 19891 } 19892 } 19893 } 19894 19895 return nil 19896} 19897 19898// VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the 19899// results of a long-running operation. 19900type VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture struct { 19901 azure.FutureAPI 19902 // Result returns the result of the asynchronous operation. 19903 // If the operation has not completed it will return an error. 19904 Result func(VirtualMachineScaleSetVMExtensionsClient) (VirtualMachineScaleSetVMExtension, error) 19905} 19906 19907// UnmarshalJSON is the custom unmarshaller for CreateFuture. 19908func (future *VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 19909 var azFuture azure.Future 19910 if err := json.Unmarshal(body, &azFuture); err != nil { 19911 return err 19912 } 19913 future.FutureAPI = &azFuture 19914 future.Result = future.result 19915 return nil 19916} 19917 19918// result is the default implementation for VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture.Result. 19919func (future *VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture) result(client VirtualMachineScaleSetVMExtensionsClient) (vmssve VirtualMachineScaleSetVMExtension, err error) { 19920 var done bool 19921 done, err = future.DoneWithContext(context.Background(), client) 19922 if err != nil { 19923 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 19924 return 19925 } 19926 if !done { 19927 vmssve.Response.Response = future.Response() 19928 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture") 19929 return 19930 } 19931 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 19932 if vmssve.Response.Response, err = future.GetResult(sender); err == nil && vmssve.Response.Response.StatusCode != http.StatusNoContent { 19933 vmssve, err = client.CreateOrUpdateResponder(vmssve.Response.Response) 19934 if err != nil { 19935 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture", "Result", vmssve.Response.Response, "Failure responding to request") 19936 } 19937 } 19938 return 19939} 19940 19941// VirtualMachineScaleSetVMExtensionsDeleteFuture an abstraction for monitoring and retrieving the results 19942// of a long-running operation. 19943type VirtualMachineScaleSetVMExtensionsDeleteFuture struct { 19944 azure.FutureAPI 19945 // Result returns the result of the asynchronous operation. 19946 // If the operation has not completed it will return an error. 19947 Result func(VirtualMachineScaleSetVMExtensionsClient) (autorest.Response, error) 19948} 19949 19950// UnmarshalJSON is the custom unmarshaller for CreateFuture. 19951func (future *VirtualMachineScaleSetVMExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { 19952 var azFuture azure.Future 19953 if err := json.Unmarshal(body, &azFuture); err != nil { 19954 return err 19955 } 19956 future.FutureAPI = &azFuture 19957 future.Result = future.result 19958 return nil 19959} 19960 19961// result is the default implementation for VirtualMachineScaleSetVMExtensionsDeleteFuture.Result. 19962func (future *VirtualMachineScaleSetVMExtensionsDeleteFuture) result(client VirtualMachineScaleSetVMExtensionsClient) (ar autorest.Response, err error) { 19963 var done bool 19964 done, err = future.DoneWithContext(context.Background(), client) 19965 if err != nil { 19966 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") 19967 return 19968 } 19969 if !done { 19970 ar.Response = future.Response() 19971 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsDeleteFuture") 19972 return 19973 } 19974 ar.Response = future.Response() 19975 return 19976} 19977 19978// VirtualMachineScaleSetVMExtensionsListResult the List VMSS VM Extension operation response 19979type VirtualMachineScaleSetVMExtensionsListResult struct { 19980 autorest.Response `json:"-"` 19981 // Value - The list of VMSS VM extensions 19982 Value *[]VirtualMachineScaleSetVMExtension `json:"value,omitempty"` 19983} 19984 19985// VirtualMachineScaleSetVMExtensionsSummary extensions summary for virtual machines of a virtual machine 19986// scale set. 19987type VirtualMachineScaleSetVMExtensionsSummary struct { 19988 // Name - READ-ONLY; The extension name. 19989 Name *string `json:"name,omitempty"` 19990 // StatusesSummary - READ-ONLY; The extensions information. 19991 StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` 19992} 19993 19994// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMExtensionsSummary. 19995func (vmssves VirtualMachineScaleSetVMExtensionsSummary) MarshalJSON() ([]byte, error) { 19996 objectMap := make(map[string]interface{}) 19997 return json.Marshal(objectMap) 19998} 19999 20000// VirtualMachineScaleSetVMExtensionsUpdateFuture an abstraction for monitoring and retrieving the results 20001// of a long-running operation. 20002type VirtualMachineScaleSetVMExtensionsUpdateFuture struct { 20003 azure.FutureAPI 20004 // Result returns the result of the asynchronous operation. 20005 // If the operation has not completed it will return an error. 20006 Result func(VirtualMachineScaleSetVMExtensionsClient) (VirtualMachineScaleSetVMExtension, error) 20007} 20008 20009// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20010func (future *VirtualMachineScaleSetVMExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { 20011 var azFuture azure.Future 20012 if err := json.Unmarshal(body, &azFuture); err != nil { 20013 return err 20014 } 20015 future.FutureAPI = &azFuture 20016 future.Result = future.result 20017 return nil 20018} 20019 20020// result is the default implementation for VirtualMachineScaleSetVMExtensionsUpdateFuture.Result. 20021func (future *VirtualMachineScaleSetVMExtensionsUpdateFuture) result(client VirtualMachineScaleSetVMExtensionsClient) (vmssve VirtualMachineScaleSetVMExtension, err error) { 20022 var done bool 20023 done, err = future.DoneWithContext(context.Background(), client) 20024 if err != nil { 20025 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsUpdateFuture", "Result", future.Response(), "Polling failure") 20026 return 20027 } 20028 if !done { 20029 vmssve.Response.Response = future.Response() 20030 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsUpdateFuture") 20031 return 20032 } 20033 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 20034 if vmssve.Response.Response, err = future.GetResult(sender); err == nil && vmssve.Response.Response.StatusCode != http.StatusNoContent { 20035 vmssve, err = client.UpdateResponder(vmssve.Response.Response) 20036 if err != nil { 20037 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsUpdateFuture", "Result", vmssve.Response.Response, "Failure responding to request") 20038 } 20039 } 20040 return 20041} 20042 20043// VirtualMachineScaleSetVMExtensionUpdate describes a VMSS VM Extension. 20044type VirtualMachineScaleSetVMExtensionUpdate struct { 20045 // Name - READ-ONLY; The name of the extension. 20046 Name *string `json:"name,omitempty"` 20047 // Type - READ-ONLY; Resource type 20048 Type *string `json:"type,omitempty"` 20049 *VirtualMachineExtensionUpdateProperties `json:"properties,omitempty"` 20050 // ID - READ-ONLY; Resource Id 20051 ID *string `json:"id,omitempty"` 20052} 20053 20054// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMExtensionUpdate. 20055func (vmssveu VirtualMachineScaleSetVMExtensionUpdate) MarshalJSON() ([]byte, error) { 20056 objectMap := make(map[string]interface{}) 20057 if vmssveu.VirtualMachineExtensionUpdateProperties != nil { 20058 objectMap["properties"] = vmssveu.VirtualMachineExtensionUpdateProperties 20059 } 20060 return json.Marshal(objectMap) 20061} 20062 20063// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetVMExtensionUpdate struct. 20064func (vmssveu *VirtualMachineScaleSetVMExtensionUpdate) UnmarshalJSON(body []byte) error { 20065 var m map[string]*json.RawMessage 20066 err := json.Unmarshal(body, &m) 20067 if err != nil { 20068 return err 20069 } 20070 for k, v := range m { 20071 switch k { 20072 case "name": 20073 if v != nil { 20074 var name string 20075 err = json.Unmarshal(*v, &name) 20076 if err != nil { 20077 return err 20078 } 20079 vmssveu.Name = &name 20080 } 20081 case "type": 20082 if v != nil { 20083 var typeVar string 20084 err = json.Unmarshal(*v, &typeVar) 20085 if err != nil { 20086 return err 20087 } 20088 vmssveu.Type = &typeVar 20089 } 20090 case "properties": 20091 if v != nil { 20092 var virtualMachineExtensionUpdateProperties VirtualMachineExtensionUpdateProperties 20093 err = json.Unmarshal(*v, &virtualMachineExtensionUpdateProperties) 20094 if err != nil { 20095 return err 20096 } 20097 vmssveu.VirtualMachineExtensionUpdateProperties = &virtualMachineExtensionUpdateProperties 20098 } 20099 case "id": 20100 if v != nil { 20101 var ID string 20102 err = json.Unmarshal(*v, &ID) 20103 if err != nil { 20104 return err 20105 } 20106 vmssveu.ID = &ID 20107 } 20108 } 20109 } 20110 20111 return nil 20112} 20113 20114// VirtualMachineScaleSetVMInstanceIDs specifies a list of virtual machine instance IDs from the VM scale 20115// set. 20116type VirtualMachineScaleSetVMInstanceIDs struct { 20117 // 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. 20118 InstanceIds *[]string `json:"instanceIds,omitempty"` 20119} 20120 20121// VirtualMachineScaleSetVMInstanceRequiredIDs specifies a list of virtual machine instance IDs from the VM 20122// scale set. 20123type VirtualMachineScaleSetVMInstanceRequiredIDs struct { 20124 // InstanceIds - The virtual machine scale set instance ids. 20125 InstanceIds *[]string `json:"instanceIds,omitempty"` 20126} 20127 20128// VirtualMachineScaleSetVMInstanceView the instance view of a virtual machine scale set VM. 20129type VirtualMachineScaleSetVMInstanceView struct { 20130 autorest.Response `json:"-"` 20131 // PlatformUpdateDomain - The Update Domain count. 20132 PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` 20133 // PlatformFaultDomain - The Fault Domain count. 20134 PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` 20135 // RdpThumbPrint - The Remote desktop certificate thumbprint. 20136 RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"` 20137 // VMAgent - The VM Agent running on the virtual machine. 20138 VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"` 20139 // MaintenanceRedeployStatus - The Maintenance Operation status on the virtual machine. 20140 MaintenanceRedeployStatus *MaintenanceRedeployStatus `json:"maintenanceRedeployStatus,omitempty"` 20141 // Disks - The disks information. 20142 Disks *[]DiskInstanceView `json:"disks,omitempty"` 20143 // Extensions - The extensions information. 20144 Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` 20145 // VMHealth - READ-ONLY; The health status for the VM. 20146 VMHealth *VirtualMachineHealthStatus `json:"vmHealth,omitempty"` 20147 // 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. 20148 BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` 20149 // Statuses - The resource status information. 20150 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 20151 // 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. 20152 AssignedHost *string `json:"assignedHost,omitempty"` 20153 // PlacementGroupID - The placement group in which the VM is running. If the VM is deallocated it will not have a placementGroupId. 20154 PlacementGroupID *string `json:"placementGroupId,omitempty"` 20155} 20156 20157// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMInstanceView. 20158func (vmssviv VirtualMachineScaleSetVMInstanceView) MarshalJSON() ([]byte, error) { 20159 objectMap := make(map[string]interface{}) 20160 if vmssviv.PlatformUpdateDomain != nil { 20161 objectMap["platformUpdateDomain"] = vmssviv.PlatformUpdateDomain 20162 } 20163 if vmssviv.PlatformFaultDomain != nil { 20164 objectMap["platformFaultDomain"] = vmssviv.PlatformFaultDomain 20165 } 20166 if vmssviv.RdpThumbPrint != nil { 20167 objectMap["rdpThumbPrint"] = vmssviv.RdpThumbPrint 20168 } 20169 if vmssviv.VMAgent != nil { 20170 objectMap["vmAgent"] = vmssviv.VMAgent 20171 } 20172 if vmssviv.MaintenanceRedeployStatus != nil { 20173 objectMap["maintenanceRedeployStatus"] = vmssviv.MaintenanceRedeployStatus 20174 } 20175 if vmssviv.Disks != nil { 20176 objectMap["disks"] = vmssviv.Disks 20177 } 20178 if vmssviv.Extensions != nil { 20179 objectMap["extensions"] = vmssviv.Extensions 20180 } 20181 if vmssviv.BootDiagnostics != nil { 20182 objectMap["bootDiagnostics"] = vmssviv.BootDiagnostics 20183 } 20184 if vmssviv.Statuses != nil { 20185 objectMap["statuses"] = vmssviv.Statuses 20186 } 20187 if vmssviv.PlacementGroupID != nil { 20188 objectMap["placementGroupId"] = vmssviv.PlacementGroupID 20189 } 20190 return json.Marshal(objectMap) 20191} 20192 20193// VirtualMachineScaleSetVMListResult the List Virtual Machine Scale Set VMs operation response. 20194type VirtualMachineScaleSetVMListResult struct { 20195 autorest.Response `json:"-"` 20196 // Value - The list of virtual machine scale sets VMs. 20197 Value *[]VirtualMachineScaleSetVM `json:"value,omitempty"` 20198 // 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 20199 NextLink *string `json:"nextLink,omitempty"` 20200} 20201 20202// VirtualMachineScaleSetVMListResultIterator provides access to a complete listing of 20203// VirtualMachineScaleSetVM values. 20204type VirtualMachineScaleSetVMListResultIterator struct { 20205 i int 20206 page VirtualMachineScaleSetVMListResultPage 20207} 20208 20209// NextWithContext advances to the next value. If there was an error making 20210// the request the iterator does not advance and the error is returned. 20211func (iter *VirtualMachineScaleSetVMListResultIterator) NextWithContext(ctx context.Context) (err error) { 20212 if tracing.IsEnabled() { 20213 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMListResultIterator.NextWithContext") 20214 defer func() { 20215 sc := -1 20216 if iter.Response().Response.Response != nil { 20217 sc = iter.Response().Response.Response.StatusCode 20218 } 20219 tracing.EndSpan(ctx, sc, err) 20220 }() 20221 } 20222 iter.i++ 20223 if iter.i < len(iter.page.Values()) { 20224 return nil 20225 } 20226 err = iter.page.NextWithContext(ctx) 20227 if err != nil { 20228 iter.i-- 20229 return err 20230 } 20231 iter.i = 0 20232 return nil 20233} 20234 20235// Next advances to the next value. If there was an error making 20236// the request the iterator does not advance and the error is returned. 20237// Deprecated: Use NextWithContext() instead. 20238func (iter *VirtualMachineScaleSetVMListResultIterator) Next() error { 20239 return iter.NextWithContext(context.Background()) 20240} 20241 20242// NotDone returns true if the enumeration should be started or is not yet complete. 20243func (iter VirtualMachineScaleSetVMListResultIterator) NotDone() bool { 20244 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 20245} 20246 20247// Response returns the raw server response from the last page request. 20248func (iter VirtualMachineScaleSetVMListResultIterator) Response() VirtualMachineScaleSetVMListResult { 20249 return iter.page.Response() 20250} 20251 20252// Value returns the current value or a zero-initialized value if the 20253// iterator has advanced beyond the end of the collection. 20254func (iter VirtualMachineScaleSetVMListResultIterator) Value() VirtualMachineScaleSetVM { 20255 if !iter.page.NotDone() { 20256 return VirtualMachineScaleSetVM{} 20257 } 20258 return iter.page.Values()[iter.i] 20259} 20260 20261// Creates a new instance of the VirtualMachineScaleSetVMListResultIterator type. 20262func NewVirtualMachineScaleSetVMListResultIterator(page VirtualMachineScaleSetVMListResultPage) VirtualMachineScaleSetVMListResultIterator { 20263 return VirtualMachineScaleSetVMListResultIterator{page: page} 20264} 20265 20266// IsEmpty returns true if the ListResult contains no values. 20267func (vmssvlr VirtualMachineScaleSetVMListResult) IsEmpty() bool { 20268 return vmssvlr.Value == nil || len(*vmssvlr.Value) == 0 20269} 20270 20271// hasNextLink returns true if the NextLink is not empty. 20272func (vmssvlr VirtualMachineScaleSetVMListResult) hasNextLink() bool { 20273 return vmssvlr.NextLink != nil && len(*vmssvlr.NextLink) != 0 20274} 20275 20276// virtualMachineScaleSetVMListResultPreparer prepares a request to retrieve the next set of results. 20277// It returns nil if no more results exist. 20278func (vmssvlr VirtualMachineScaleSetVMListResult) virtualMachineScaleSetVMListResultPreparer(ctx context.Context) (*http.Request, error) { 20279 if !vmssvlr.hasNextLink() { 20280 return nil, nil 20281 } 20282 return autorest.Prepare((&http.Request{}).WithContext(ctx), 20283 autorest.AsJSON(), 20284 autorest.AsGet(), 20285 autorest.WithBaseURL(to.String(vmssvlr.NextLink))) 20286} 20287 20288// VirtualMachineScaleSetVMListResultPage contains a page of VirtualMachineScaleSetVM values. 20289type VirtualMachineScaleSetVMListResultPage struct { 20290 fn func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error) 20291 vmssvlr VirtualMachineScaleSetVMListResult 20292} 20293 20294// NextWithContext advances to the next page of values. If there was an error making 20295// the request the page does not advance and the error is returned. 20296func (page *VirtualMachineScaleSetVMListResultPage) NextWithContext(ctx context.Context) (err error) { 20297 if tracing.IsEnabled() { 20298 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMListResultPage.NextWithContext") 20299 defer func() { 20300 sc := -1 20301 if page.Response().Response.Response != nil { 20302 sc = page.Response().Response.Response.StatusCode 20303 } 20304 tracing.EndSpan(ctx, sc, err) 20305 }() 20306 } 20307 for { 20308 next, err := page.fn(ctx, page.vmssvlr) 20309 if err != nil { 20310 return err 20311 } 20312 page.vmssvlr = next 20313 if !next.hasNextLink() || !next.IsEmpty() { 20314 break 20315 } 20316 } 20317 return nil 20318} 20319 20320// Next advances to the next page of values. If there was an error making 20321// the request the page does not advance and the error is returned. 20322// Deprecated: Use NextWithContext() instead. 20323func (page *VirtualMachineScaleSetVMListResultPage) Next() error { 20324 return page.NextWithContext(context.Background()) 20325} 20326 20327// NotDone returns true if the page enumeration should be started or is not yet complete. 20328func (page VirtualMachineScaleSetVMListResultPage) NotDone() bool { 20329 return !page.vmssvlr.IsEmpty() 20330} 20331 20332// Response returns the raw server response from the last page request. 20333func (page VirtualMachineScaleSetVMListResultPage) Response() VirtualMachineScaleSetVMListResult { 20334 return page.vmssvlr 20335} 20336 20337// Values returns the slice of values for the current page or nil if there are no values. 20338func (page VirtualMachineScaleSetVMListResultPage) Values() []VirtualMachineScaleSetVM { 20339 if page.vmssvlr.IsEmpty() { 20340 return nil 20341 } 20342 return *page.vmssvlr.Value 20343} 20344 20345// Creates a new instance of the VirtualMachineScaleSetVMListResultPage type. 20346func NewVirtualMachineScaleSetVMListResultPage(cur VirtualMachineScaleSetVMListResult, getNextPage func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error)) VirtualMachineScaleSetVMListResultPage { 20347 return VirtualMachineScaleSetVMListResultPage{ 20348 fn: getNextPage, 20349 vmssvlr: cur, 20350 } 20351} 20352 20353// VirtualMachineScaleSetVMNetworkProfileConfiguration describes a virtual machine scale set VM network 20354// profile. 20355type VirtualMachineScaleSetVMNetworkProfileConfiguration struct { 20356 // NetworkInterfaceConfigurations - The list of network configurations. 20357 NetworkInterfaceConfigurations *[]VirtualMachineScaleSetNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` 20358} 20359 20360// VirtualMachineScaleSetVMProfile describes a virtual machine scale set virtual machine profile. 20361type VirtualMachineScaleSetVMProfile struct { 20362 // OsProfile - Specifies the operating system settings for the virtual machines in the scale set. 20363 OsProfile *VirtualMachineScaleSetOSProfile `json:"osProfile,omitempty"` 20364 // StorageProfile - Specifies the storage settings for the virtual machine disks. 20365 StorageProfile *VirtualMachineScaleSetStorageProfile `json:"storageProfile,omitempty"` 20366 // NetworkProfile - Specifies properties of the network interfaces of the virtual machines in the scale set. 20367 NetworkProfile *VirtualMachineScaleSetNetworkProfile `json:"networkProfile,omitempty"` 20368 // SecurityProfile - Specifies the Security related profile settings for the virtual machines in the scale set. 20369 SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` 20370 // DiagnosticsProfile - Specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. 20371 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 20372 // ExtensionProfile - Specifies a collection of settings for extensions installed on virtual machines in the scale set. 20373 ExtensionProfile *VirtualMachineScaleSetExtensionProfile `json:"extensionProfile,omitempty"` 20374 // 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 20375 LicenseType *string `json:"licenseType,omitempty"` 20376 // Priority - Specifies the priority for the virtual machines in the scale set. <br><br>Minimum api-version: 2017-10-30-preview. Possible values include: 'VirtualMachinePriorityTypesRegular', 'VirtualMachinePriorityTypesLow', 'VirtualMachinePriorityTypesSpot' 20377 Priority VirtualMachinePriorityTypes `json:"priority,omitempty"` 20378 // 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: 'VirtualMachineEvictionPolicyTypesDeallocate', 'VirtualMachineEvictionPolicyTypesDelete' 20379 EvictionPolicy VirtualMachineEvictionPolicyTypes `json:"evictionPolicy,omitempty"` 20380 // BillingProfile - Specifies the billing related details of a Azure Spot VMSS. <br><br>Minimum api-version: 2019-03-01. 20381 BillingProfile *BillingProfile `json:"billingProfile,omitempty"` 20382 // ScheduledEventsProfile - Specifies Scheduled Event related configurations. 20383 ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` 20384 // UserData - UserData for the virtual machines in the scale set, which must be base-64 encoded. Customer should not pass any secrets in here. <br><br>Minimum api-version: 2021-03-01 20385 UserData *string `json:"userData,omitempty"` 20386} 20387 20388// VirtualMachineScaleSetVMProperties describes the properties of a virtual machine scale set virtual 20389// machine. 20390type VirtualMachineScaleSetVMProperties struct { 20391 // LatestModelApplied - READ-ONLY; Specifies whether the latest model has been applied to the virtual machine. 20392 LatestModelApplied *bool `json:"latestModelApplied,omitempty"` 20393 // VMID - READ-ONLY; Azure VM unique ID. 20394 VMID *string `json:"vmId,omitempty"` 20395 // InstanceView - READ-ONLY; The virtual machine instance view. 20396 InstanceView *VirtualMachineScaleSetVMInstanceView `json:"instanceView,omitempty"` 20397 // HardwareProfile - Specifies the hardware settings for the virtual machine. 20398 HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` 20399 // StorageProfile - Specifies the storage settings for the virtual machine disks. 20400 StorageProfile *StorageProfile `json:"storageProfile,omitempty"` 20401 // 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. 20402 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 20403 // OsProfile - Specifies the operating system settings for the virtual machine. 20404 OsProfile *OSProfile `json:"osProfile,omitempty"` 20405 // SecurityProfile - Specifies the Security related profile settings for the virtual machine. 20406 SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` 20407 // NetworkProfile - Specifies the network interfaces of the virtual machine. 20408 NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` 20409 // NetworkProfileConfiguration - Specifies the network profile configuration of the virtual machine. 20410 NetworkProfileConfiguration *VirtualMachineScaleSetVMNetworkProfileConfiguration `json:"networkProfileConfiguration,omitempty"` 20411 // DiagnosticsProfile - Specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. 20412 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 20413 // 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 [Availability sets overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). <br><br> For more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates) <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. 20414 AvailabilitySet *SubResource `json:"availabilitySet,omitempty"` 20415 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 20416 ProvisioningState *string `json:"provisioningState,omitempty"` 20417 // 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 20418 LicenseType *string `json:"licenseType,omitempty"` 20419 // 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. 20420 ModelDefinitionApplied *string `json:"modelDefinitionApplied,omitempty"` 20421 // ProtectionPolicy - Specifies the protection policy of the virtual machine. 20422 ProtectionPolicy *VirtualMachineScaleSetVMProtectionPolicy `json:"protectionPolicy,omitempty"` 20423 // UserData - UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. <br><br>Minimum api-version: 2021-03-01 20424 UserData *string `json:"userData,omitempty"` 20425} 20426 20427// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMProperties. 20428func (vmssvp VirtualMachineScaleSetVMProperties) MarshalJSON() ([]byte, error) { 20429 objectMap := make(map[string]interface{}) 20430 if vmssvp.HardwareProfile != nil { 20431 objectMap["hardwareProfile"] = vmssvp.HardwareProfile 20432 } 20433 if vmssvp.StorageProfile != nil { 20434 objectMap["storageProfile"] = vmssvp.StorageProfile 20435 } 20436 if vmssvp.AdditionalCapabilities != nil { 20437 objectMap["additionalCapabilities"] = vmssvp.AdditionalCapabilities 20438 } 20439 if vmssvp.OsProfile != nil { 20440 objectMap["osProfile"] = vmssvp.OsProfile 20441 } 20442 if vmssvp.SecurityProfile != nil { 20443 objectMap["securityProfile"] = vmssvp.SecurityProfile 20444 } 20445 if vmssvp.NetworkProfile != nil { 20446 objectMap["networkProfile"] = vmssvp.NetworkProfile 20447 } 20448 if vmssvp.NetworkProfileConfiguration != nil { 20449 objectMap["networkProfileConfiguration"] = vmssvp.NetworkProfileConfiguration 20450 } 20451 if vmssvp.DiagnosticsProfile != nil { 20452 objectMap["diagnosticsProfile"] = vmssvp.DiagnosticsProfile 20453 } 20454 if vmssvp.AvailabilitySet != nil { 20455 objectMap["availabilitySet"] = vmssvp.AvailabilitySet 20456 } 20457 if vmssvp.LicenseType != nil { 20458 objectMap["licenseType"] = vmssvp.LicenseType 20459 } 20460 if vmssvp.ProtectionPolicy != nil { 20461 objectMap["protectionPolicy"] = vmssvp.ProtectionPolicy 20462 } 20463 if vmssvp.UserData != nil { 20464 objectMap["userData"] = vmssvp.UserData 20465 } 20466 return json.Marshal(objectMap) 20467} 20468 20469// VirtualMachineScaleSetVMProtectionPolicy the protection policy of a virtual machine scale set VM. 20470type VirtualMachineScaleSetVMProtectionPolicy struct { 20471 // ProtectFromScaleIn - Indicates that the virtual machine scale set VM shouldn't be considered for deletion during a scale-in operation. 20472 ProtectFromScaleIn *bool `json:"protectFromScaleIn,omitempty"` 20473 // 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. 20474 ProtectFromScaleSetActions *bool `json:"protectFromScaleSetActions,omitempty"` 20475} 20476 20477// VirtualMachineScaleSetVMReimageParameters describes a Virtual Machine Scale Set VM Reimage Parameters. 20478type VirtualMachineScaleSetVMReimageParameters struct { 20479 // 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. 20480 TempDisk *bool `json:"tempDisk,omitempty"` 20481} 20482 20483// VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture an abstraction for monitoring and retrieving the 20484// results of a long-running operation. 20485type VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture struct { 20486 azure.FutureAPI 20487 // Result returns the result of the asynchronous operation. 20488 // If the operation has not completed it will return an error. 20489 Result func(VirtualMachineScaleSetVMRunCommandsClient) (VirtualMachineRunCommand, error) 20490} 20491 20492// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20493func (future *VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 20494 var azFuture azure.Future 20495 if err := json.Unmarshal(body, &azFuture); err != nil { 20496 return err 20497 } 20498 future.FutureAPI = &azFuture 20499 future.Result = future.result 20500 return nil 20501} 20502 20503// result is the default implementation for VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture.Result. 20504func (future *VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture) result(client VirtualMachineScaleSetVMRunCommandsClient) (vmrc VirtualMachineRunCommand, err error) { 20505 var done bool 20506 done, err = future.DoneWithContext(context.Background(), client) 20507 if err != nil { 20508 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 20509 return 20510 } 20511 if !done { 20512 vmrc.Response.Response = future.Response() 20513 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture") 20514 return 20515 } 20516 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 20517 if vmrc.Response.Response, err = future.GetResult(sender); err == nil && vmrc.Response.Response.StatusCode != http.StatusNoContent { 20518 vmrc, err = client.CreateOrUpdateResponder(vmrc.Response.Response) 20519 if err != nil { 20520 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture", "Result", vmrc.Response.Response, "Failure responding to request") 20521 } 20522 } 20523 return 20524} 20525 20526// VirtualMachineScaleSetVMRunCommandsDeleteFuture an abstraction for monitoring and retrieving the results 20527// of a long-running operation. 20528type VirtualMachineScaleSetVMRunCommandsDeleteFuture struct { 20529 azure.FutureAPI 20530 // Result returns the result of the asynchronous operation. 20531 // If the operation has not completed it will return an error. 20532 Result func(VirtualMachineScaleSetVMRunCommandsClient) (autorest.Response, error) 20533} 20534 20535// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20536func (future *VirtualMachineScaleSetVMRunCommandsDeleteFuture) UnmarshalJSON(body []byte) error { 20537 var azFuture azure.Future 20538 if err := json.Unmarshal(body, &azFuture); err != nil { 20539 return err 20540 } 20541 future.FutureAPI = &azFuture 20542 future.Result = future.result 20543 return nil 20544} 20545 20546// result is the default implementation for VirtualMachineScaleSetVMRunCommandsDeleteFuture.Result. 20547func (future *VirtualMachineScaleSetVMRunCommandsDeleteFuture) result(client VirtualMachineScaleSetVMRunCommandsClient) (ar autorest.Response, err error) { 20548 var done bool 20549 done, err = future.DoneWithContext(context.Background(), client) 20550 if err != nil { 20551 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsDeleteFuture", "Result", future.Response(), "Polling failure") 20552 return 20553 } 20554 if !done { 20555 ar.Response = future.Response() 20556 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMRunCommandsDeleteFuture") 20557 return 20558 } 20559 ar.Response = future.Response() 20560 return 20561} 20562 20563// VirtualMachineScaleSetVMRunCommandsUpdateFuture an abstraction for monitoring and retrieving the results 20564// of a long-running operation. 20565type VirtualMachineScaleSetVMRunCommandsUpdateFuture struct { 20566 azure.FutureAPI 20567 // Result returns the result of the asynchronous operation. 20568 // If the operation has not completed it will return an error. 20569 Result func(VirtualMachineScaleSetVMRunCommandsClient) (VirtualMachineRunCommand, error) 20570} 20571 20572// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20573func (future *VirtualMachineScaleSetVMRunCommandsUpdateFuture) UnmarshalJSON(body []byte) error { 20574 var azFuture azure.Future 20575 if err := json.Unmarshal(body, &azFuture); err != nil { 20576 return err 20577 } 20578 future.FutureAPI = &azFuture 20579 future.Result = future.result 20580 return nil 20581} 20582 20583// result is the default implementation for VirtualMachineScaleSetVMRunCommandsUpdateFuture.Result. 20584func (future *VirtualMachineScaleSetVMRunCommandsUpdateFuture) result(client VirtualMachineScaleSetVMRunCommandsClient) (vmrc VirtualMachineRunCommand, err error) { 20585 var done bool 20586 done, err = future.DoneWithContext(context.Background(), client) 20587 if err != nil { 20588 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsUpdateFuture", "Result", future.Response(), "Polling failure") 20589 return 20590 } 20591 if !done { 20592 vmrc.Response.Response = future.Response() 20593 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMRunCommandsUpdateFuture") 20594 return 20595 } 20596 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 20597 if vmrc.Response.Response, err = future.GetResult(sender); err == nil && vmrc.Response.Response.StatusCode != http.StatusNoContent { 20598 vmrc, err = client.UpdateResponder(vmrc.Response.Response) 20599 if err != nil { 20600 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsUpdateFuture", "Result", vmrc.Response.Response, "Failure responding to request") 20601 } 20602 } 20603 return 20604} 20605 20606// VirtualMachineScaleSetVMsDeallocateFuture an abstraction for monitoring and retrieving the results of a 20607// long-running operation. 20608type VirtualMachineScaleSetVMsDeallocateFuture struct { 20609 azure.FutureAPI 20610 // Result returns the result of the asynchronous operation. 20611 // If the operation has not completed it will return an error. 20612 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 20613} 20614 20615// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20616func (future *VirtualMachineScaleSetVMsDeallocateFuture) UnmarshalJSON(body []byte) error { 20617 var azFuture azure.Future 20618 if err := json.Unmarshal(body, &azFuture); err != nil { 20619 return err 20620 } 20621 future.FutureAPI = &azFuture 20622 future.Result = future.result 20623 return nil 20624} 20625 20626// result is the default implementation for VirtualMachineScaleSetVMsDeallocateFuture.Result. 20627func (future *VirtualMachineScaleSetVMsDeallocateFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 20628 var done bool 20629 done, err = future.DoneWithContext(context.Background(), client) 20630 if err != nil { 20631 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsDeallocateFuture", "Result", future.Response(), "Polling failure") 20632 return 20633 } 20634 if !done { 20635 ar.Response = future.Response() 20636 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsDeallocateFuture") 20637 return 20638 } 20639 ar.Response = future.Response() 20640 return 20641} 20642 20643// VirtualMachineScaleSetVMsDeleteFuture an abstraction for monitoring and retrieving the results of a 20644// long-running operation. 20645type VirtualMachineScaleSetVMsDeleteFuture struct { 20646 azure.FutureAPI 20647 // Result returns the result of the asynchronous operation. 20648 // If the operation has not completed it will return an error. 20649 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 20650} 20651 20652// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20653func (future *VirtualMachineScaleSetVMsDeleteFuture) UnmarshalJSON(body []byte) error { 20654 var azFuture azure.Future 20655 if err := json.Unmarshal(body, &azFuture); err != nil { 20656 return err 20657 } 20658 future.FutureAPI = &azFuture 20659 future.Result = future.result 20660 return nil 20661} 20662 20663// result is the default implementation for VirtualMachineScaleSetVMsDeleteFuture.Result. 20664func (future *VirtualMachineScaleSetVMsDeleteFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 20665 var done bool 20666 done, err = future.DoneWithContext(context.Background(), client) 20667 if err != nil { 20668 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsDeleteFuture", "Result", future.Response(), "Polling failure") 20669 return 20670 } 20671 if !done { 20672 ar.Response = future.Response() 20673 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsDeleteFuture") 20674 return 20675 } 20676 ar.Response = future.Response() 20677 return 20678} 20679 20680// VirtualMachineScaleSetVMsPerformMaintenanceFuture an abstraction for monitoring and retrieving the 20681// results of a long-running operation. 20682type VirtualMachineScaleSetVMsPerformMaintenanceFuture struct { 20683 azure.FutureAPI 20684 // Result returns the result of the asynchronous operation. 20685 // If the operation has not completed it will return an error. 20686 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 20687} 20688 20689// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20690func (future *VirtualMachineScaleSetVMsPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { 20691 var azFuture azure.Future 20692 if err := json.Unmarshal(body, &azFuture); err != nil { 20693 return err 20694 } 20695 future.FutureAPI = &azFuture 20696 future.Result = future.result 20697 return nil 20698} 20699 20700// result is the default implementation for VirtualMachineScaleSetVMsPerformMaintenanceFuture.Result. 20701func (future *VirtualMachineScaleSetVMsPerformMaintenanceFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 20702 var done bool 20703 done, err = future.DoneWithContext(context.Background(), client) 20704 if err != nil { 20705 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsPerformMaintenanceFuture", "Result", future.Response(), "Polling failure") 20706 return 20707 } 20708 if !done { 20709 ar.Response = future.Response() 20710 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsPerformMaintenanceFuture") 20711 return 20712 } 20713 ar.Response = future.Response() 20714 return 20715} 20716 20717// VirtualMachineScaleSetVMsPowerOffFuture an abstraction for monitoring and retrieving the results of a 20718// long-running operation. 20719type VirtualMachineScaleSetVMsPowerOffFuture struct { 20720 azure.FutureAPI 20721 // Result returns the result of the asynchronous operation. 20722 // If the operation has not completed it will return an error. 20723 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 20724} 20725 20726// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20727func (future *VirtualMachineScaleSetVMsPowerOffFuture) UnmarshalJSON(body []byte) error { 20728 var azFuture azure.Future 20729 if err := json.Unmarshal(body, &azFuture); err != nil { 20730 return err 20731 } 20732 future.FutureAPI = &azFuture 20733 future.Result = future.result 20734 return nil 20735} 20736 20737// result is the default implementation for VirtualMachineScaleSetVMsPowerOffFuture.Result. 20738func (future *VirtualMachineScaleSetVMsPowerOffFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 20739 var done bool 20740 done, err = future.DoneWithContext(context.Background(), client) 20741 if err != nil { 20742 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsPowerOffFuture", "Result", future.Response(), "Polling failure") 20743 return 20744 } 20745 if !done { 20746 ar.Response = future.Response() 20747 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsPowerOffFuture") 20748 return 20749 } 20750 ar.Response = future.Response() 20751 return 20752} 20753 20754// VirtualMachineScaleSetVMsRedeployFuture an abstraction for monitoring and retrieving the results of a 20755// long-running operation. 20756type VirtualMachineScaleSetVMsRedeployFuture struct { 20757 azure.FutureAPI 20758 // Result returns the result of the asynchronous operation. 20759 // If the operation has not completed it will return an error. 20760 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 20761} 20762 20763// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20764func (future *VirtualMachineScaleSetVMsRedeployFuture) UnmarshalJSON(body []byte) error { 20765 var azFuture azure.Future 20766 if err := json.Unmarshal(body, &azFuture); err != nil { 20767 return err 20768 } 20769 future.FutureAPI = &azFuture 20770 future.Result = future.result 20771 return nil 20772} 20773 20774// result is the default implementation for VirtualMachineScaleSetVMsRedeployFuture.Result. 20775func (future *VirtualMachineScaleSetVMsRedeployFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 20776 var done bool 20777 done, err = future.DoneWithContext(context.Background(), client) 20778 if err != nil { 20779 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRedeployFuture", "Result", future.Response(), "Polling failure") 20780 return 20781 } 20782 if !done { 20783 ar.Response = future.Response() 20784 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRedeployFuture") 20785 return 20786 } 20787 ar.Response = future.Response() 20788 return 20789} 20790 20791// VirtualMachineScaleSetVMsReimageAllFuture an abstraction for monitoring and retrieving the results of a 20792// long-running operation. 20793type VirtualMachineScaleSetVMsReimageAllFuture struct { 20794 azure.FutureAPI 20795 // Result returns the result of the asynchronous operation. 20796 // If the operation has not completed it will return an error. 20797 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 20798} 20799 20800// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20801func (future *VirtualMachineScaleSetVMsReimageAllFuture) UnmarshalJSON(body []byte) error { 20802 var azFuture azure.Future 20803 if err := json.Unmarshal(body, &azFuture); err != nil { 20804 return err 20805 } 20806 future.FutureAPI = &azFuture 20807 future.Result = future.result 20808 return nil 20809} 20810 20811// result is the default implementation for VirtualMachineScaleSetVMsReimageAllFuture.Result. 20812func (future *VirtualMachineScaleSetVMsReimageAllFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 20813 var done bool 20814 done, err = future.DoneWithContext(context.Background(), client) 20815 if err != nil { 20816 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsReimageAllFuture", "Result", future.Response(), "Polling failure") 20817 return 20818 } 20819 if !done { 20820 ar.Response = future.Response() 20821 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsReimageAllFuture") 20822 return 20823 } 20824 ar.Response = future.Response() 20825 return 20826} 20827 20828// VirtualMachineScaleSetVMsReimageFuture an abstraction for monitoring and retrieving the results of a 20829// long-running operation. 20830type VirtualMachineScaleSetVMsReimageFuture struct { 20831 azure.FutureAPI 20832 // Result returns the result of the asynchronous operation. 20833 // If the operation has not completed it will return an error. 20834 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 20835} 20836 20837// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20838func (future *VirtualMachineScaleSetVMsReimageFuture) UnmarshalJSON(body []byte) error { 20839 var azFuture azure.Future 20840 if err := json.Unmarshal(body, &azFuture); err != nil { 20841 return err 20842 } 20843 future.FutureAPI = &azFuture 20844 future.Result = future.result 20845 return nil 20846} 20847 20848// result is the default implementation for VirtualMachineScaleSetVMsReimageFuture.Result. 20849func (future *VirtualMachineScaleSetVMsReimageFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 20850 var done bool 20851 done, err = future.DoneWithContext(context.Background(), client) 20852 if err != nil { 20853 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsReimageFuture", "Result", future.Response(), "Polling failure") 20854 return 20855 } 20856 if !done { 20857 ar.Response = future.Response() 20858 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsReimageFuture") 20859 return 20860 } 20861 ar.Response = future.Response() 20862 return 20863} 20864 20865// VirtualMachineScaleSetVMsRestartFuture an abstraction for monitoring and retrieving the results of a 20866// long-running operation. 20867type VirtualMachineScaleSetVMsRestartFuture struct { 20868 azure.FutureAPI 20869 // Result returns the result of the asynchronous operation. 20870 // If the operation has not completed it will return an error. 20871 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 20872} 20873 20874// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20875func (future *VirtualMachineScaleSetVMsRestartFuture) UnmarshalJSON(body []byte) error { 20876 var azFuture azure.Future 20877 if err := json.Unmarshal(body, &azFuture); err != nil { 20878 return err 20879 } 20880 future.FutureAPI = &azFuture 20881 future.Result = future.result 20882 return nil 20883} 20884 20885// result is the default implementation for VirtualMachineScaleSetVMsRestartFuture.Result. 20886func (future *VirtualMachineScaleSetVMsRestartFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 20887 var done bool 20888 done, err = future.DoneWithContext(context.Background(), client) 20889 if err != nil { 20890 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRestartFuture", "Result", future.Response(), "Polling failure") 20891 return 20892 } 20893 if !done { 20894 ar.Response = future.Response() 20895 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRestartFuture") 20896 return 20897 } 20898 ar.Response = future.Response() 20899 return 20900} 20901 20902// VirtualMachineScaleSetVMsRunCommandFuture an abstraction for monitoring and retrieving the results of a 20903// long-running operation. 20904type VirtualMachineScaleSetVMsRunCommandFuture struct { 20905 azure.FutureAPI 20906 // Result returns the result of the asynchronous operation. 20907 // If the operation has not completed it will return an error. 20908 Result func(VirtualMachineScaleSetVMsClient) (RunCommandResult, error) 20909} 20910 20911// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20912func (future *VirtualMachineScaleSetVMsRunCommandFuture) UnmarshalJSON(body []byte) error { 20913 var azFuture azure.Future 20914 if err := json.Unmarshal(body, &azFuture); err != nil { 20915 return err 20916 } 20917 future.FutureAPI = &azFuture 20918 future.Result = future.result 20919 return nil 20920} 20921 20922// result is the default implementation for VirtualMachineScaleSetVMsRunCommandFuture.Result. 20923func (future *VirtualMachineScaleSetVMsRunCommandFuture) result(client VirtualMachineScaleSetVMsClient) (rcr RunCommandResult, err error) { 20924 var done bool 20925 done, err = future.DoneWithContext(context.Background(), client) 20926 if err != nil { 20927 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRunCommandFuture", "Result", future.Response(), "Polling failure") 20928 return 20929 } 20930 if !done { 20931 rcr.Response.Response = future.Response() 20932 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRunCommandFuture") 20933 return 20934 } 20935 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 20936 if rcr.Response.Response, err = future.GetResult(sender); err == nil && rcr.Response.Response.StatusCode != http.StatusNoContent { 20937 rcr, err = client.RunCommandResponder(rcr.Response.Response) 20938 if err != nil { 20939 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRunCommandFuture", "Result", rcr.Response.Response, "Failure responding to request") 20940 } 20941 } 20942 return 20943} 20944 20945// VirtualMachineScaleSetVMsStartFuture an abstraction for monitoring and retrieving the results of a 20946// long-running operation. 20947type VirtualMachineScaleSetVMsStartFuture struct { 20948 azure.FutureAPI 20949 // Result returns the result of the asynchronous operation. 20950 // If the operation has not completed it will return an error. 20951 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 20952} 20953 20954// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20955func (future *VirtualMachineScaleSetVMsStartFuture) UnmarshalJSON(body []byte) error { 20956 var azFuture azure.Future 20957 if err := json.Unmarshal(body, &azFuture); err != nil { 20958 return err 20959 } 20960 future.FutureAPI = &azFuture 20961 future.Result = future.result 20962 return nil 20963} 20964 20965// result is the default implementation for VirtualMachineScaleSetVMsStartFuture.Result. 20966func (future *VirtualMachineScaleSetVMsStartFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 20967 var done bool 20968 done, err = future.DoneWithContext(context.Background(), client) 20969 if err != nil { 20970 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsStartFuture", "Result", future.Response(), "Polling failure") 20971 return 20972 } 20973 if !done { 20974 ar.Response = future.Response() 20975 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsStartFuture") 20976 return 20977 } 20978 ar.Response = future.Response() 20979 return 20980} 20981 20982// VirtualMachineScaleSetVMsUpdateFuture an abstraction for monitoring and retrieving the results of a 20983// long-running operation. 20984type VirtualMachineScaleSetVMsUpdateFuture struct { 20985 azure.FutureAPI 20986 // Result returns the result of the asynchronous operation. 20987 // If the operation has not completed it will return an error. 20988 Result func(VirtualMachineScaleSetVMsClient) (VirtualMachineScaleSetVM, error) 20989} 20990 20991// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20992func (future *VirtualMachineScaleSetVMsUpdateFuture) UnmarshalJSON(body []byte) error { 20993 var azFuture azure.Future 20994 if err := json.Unmarshal(body, &azFuture); err != nil { 20995 return err 20996 } 20997 future.FutureAPI = &azFuture 20998 future.Result = future.result 20999 return nil 21000} 21001 21002// result is the default implementation for VirtualMachineScaleSetVMsUpdateFuture.Result. 21003func (future *VirtualMachineScaleSetVMsUpdateFuture) result(client VirtualMachineScaleSetVMsClient) (vmssv VirtualMachineScaleSetVM, err error) { 21004 var done bool 21005 done, err = future.DoneWithContext(context.Background(), client) 21006 if err != nil { 21007 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsUpdateFuture", "Result", future.Response(), "Polling failure") 21008 return 21009 } 21010 if !done { 21011 vmssv.Response.Response = future.Response() 21012 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsUpdateFuture") 21013 return 21014 } 21015 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 21016 if vmssv.Response.Response, err = future.GetResult(sender); err == nil && vmssv.Response.Response.StatusCode != http.StatusNoContent { 21017 vmssv, err = client.UpdateResponder(vmssv.Response.Response) 21018 if err != nil { 21019 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsUpdateFuture", "Result", vmssv.Response.Response, "Failure responding to request") 21020 } 21021 } 21022 return 21023} 21024 21025// VirtualMachinesCaptureFuture an abstraction for monitoring and retrieving the results of a long-running 21026// operation. 21027type VirtualMachinesCaptureFuture struct { 21028 azure.FutureAPI 21029 // Result returns the result of the asynchronous operation. 21030 // If the operation has not completed it will return an error. 21031 Result func(VirtualMachinesClient) (VirtualMachineCaptureResult, error) 21032} 21033 21034// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21035func (future *VirtualMachinesCaptureFuture) UnmarshalJSON(body []byte) error { 21036 var azFuture azure.Future 21037 if err := json.Unmarshal(body, &azFuture); err != nil { 21038 return err 21039 } 21040 future.FutureAPI = &azFuture 21041 future.Result = future.result 21042 return nil 21043} 21044 21045// result is the default implementation for VirtualMachinesCaptureFuture.Result. 21046func (future *VirtualMachinesCaptureFuture) result(client VirtualMachinesClient) (vmcr VirtualMachineCaptureResult, err error) { 21047 var done bool 21048 done, err = future.DoneWithContext(context.Background(), client) 21049 if err != nil { 21050 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCaptureFuture", "Result", future.Response(), "Polling failure") 21051 return 21052 } 21053 if !done { 21054 vmcr.Response.Response = future.Response() 21055 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesCaptureFuture") 21056 return 21057 } 21058 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 21059 if vmcr.Response.Response, err = future.GetResult(sender); err == nil && vmcr.Response.Response.StatusCode != http.StatusNoContent { 21060 vmcr, err = client.CaptureResponder(vmcr.Response.Response) 21061 if err != nil { 21062 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCaptureFuture", "Result", vmcr.Response.Response, "Failure responding to request") 21063 } 21064 } 21065 return 21066} 21067 21068// VirtualMachinesConvertToManagedDisksFuture an abstraction for monitoring and retrieving the results of a 21069// long-running operation. 21070type VirtualMachinesConvertToManagedDisksFuture struct { 21071 azure.FutureAPI 21072 // Result returns the result of the asynchronous operation. 21073 // If the operation has not completed it will return an error. 21074 Result func(VirtualMachinesClient) (autorest.Response, error) 21075} 21076 21077// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21078func (future *VirtualMachinesConvertToManagedDisksFuture) UnmarshalJSON(body []byte) error { 21079 var azFuture azure.Future 21080 if err := json.Unmarshal(body, &azFuture); err != nil { 21081 return err 21082 } 21083 future.FutureAPI = &azFuture 21084 future.Result = future.result 21085 return nil 21086} 21087 21088// result is the default implementation for VirtualMachinesConvertToManagedDisksFuture.Result. 21089func (future *VirtualMachinesConvertToManagedDisksFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 21090 var done bool 21091 done, err = future.DoneWithContext(context.Background(), client) 21092 if err != nil { 21093 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesConvertToManagedDisksFuture", "Result", future.Response(), "Polling failure") 21094 return 21095 } 21096 if !done { 21097 ar.Response = future.Response() 21098 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesConvertToManagedDisksFuture") 21099 return 21100 } 21101 ar.Response = future.Response() 21102 return 21103} 21104 21105// VirtualMachinesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 21106// long-running operation. 21107type VirtualMachinesCreateOrUpdateFuture struct { 21108 azure.FutureAPI 21109 // Result returns the result of the asynchronous operation. 21110 // If the operation has not completed it will return an error. 21111 Result func(VirtualMachinesClient) (VirtualMachine, error) 21112} 21113 21114// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21115func (future *VirtualMachinesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 21116 var azFuture azure.Future 21117 if err := json.Unmarshal(body, &azFuture); err != nil { 21118 return err 21119 } 21120 future.FutureAPI = &azFuture 21121 future.Result = future.result 21122 return nil 21123} 21124 21125// result is the default implementation for VirtualMachinesCreateOrUpdateFuture.Result. 21126func (future *VirtualMachinesCreateOrUpdateFuture) result(client VirtualMachinesClient) (VM VirtualMachine, err error) { 21127 var done bool 21128 done, err = future.DoneWithContext(context.Background(), client) 21129 if err != nil { 21130 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 21131 return 21132 } 21133 if !done { 21134 VM.Response.Response = future.Response() 21135 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesCreateOrUpdateFuture") 21136 return 21137 } 21138 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 21139 if VM.Response.Response, err = future.GetResult(sender); err == nil && VM.Response.Response.StatusCode != http.StatusNoContent { 21140 VM, err = client.CreateOrUpdateResponder(VM.Response.Response) 21141 if err != nil { 21142 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCreateOrUpdateFuture", "Result", VM.Response.Response, "Failure responding to request") 21143 } 21144 } 21145 return 21146} 21147 21148// VirtualMachinesDeallocateFuture an abstraction for monitoring and retrieving the results of a 21149// long-running operation. 21150type VirtualMachinesDeallocateFuture struct { 21151 azure.FutureAPI 21152 // Result returns the result of the asynchronous operation. 21153 // If the operation has not completed it will return an error. 21154 Result func(VirtualMachinesClient) (autorest.Response, error) 21155} 21156 21157// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21158func (future *VirtualMachinesDeallocateFuture) UnmarshalJSON(body []byte) error { 21159 var azFuture azure.Future 21160 if err := json.Unmarshal(body, &azFuture); err != nil { 21161 return err 21162 } 21163 future.FutureAPI = &azFuture 21164 future.Result = future.result 21165 return nil 21166} 21167 21168// result is the default implementation for VirtualMachinesDeallocateFuture.Result. 21169func (future *VirtualMachinesDeallocateFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 21170 var done bool 21171 done, err = future.DoneWithContext(context.Background(), client) 21172 if err != nil { 21173 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesDeallocateFuture", "Result", future.Response(), "Polling failure") 21174 return 21175 } 21176 if !done { 21177 ar.Response = future.Response() 21178 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesDeallocateFuture") 21179 return 21180 } 21181 ar.Response = future.Response() 21182 return 21183} 21184 21185// VirtualMachinesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 21186// operation. 21187type VirtualMachinesDeleteFuture struct { 21188 azure.FutureAPI 21189 // Result returns the result of the asynchronous operation. 21190 // If the operation has not completed it will return an error. 21191 Result func(VirtualMachinesClient) (autorest.Response, error) 21192} 21193 21194// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21195func (future *VirtualMachinesDeleteFuture) UnmarshalJSON(body []byte) error { 21196 var azFuture azure.Future 21197 if err := json.Unmarshal(body, &azFuture); err != nil { 21198 return err 21199 } 21200 future.FutureAPI = &azFuture 21201 future.Result = future.result 21202 return nil 21203} 21204 21205// result is the default implementation for VirtualMachinesDeleteFuture.Result. 21206func (future *VirtualMachinesDeleteFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 21207 var done bool 21208 done, err = future.DoneWithContext(context.Background(), client) 21209 if err != nil { 21210 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesDeleteFuture", "Result", future.Response(), "Polling failure") 21211 return 21212 } 21213 if !done { 21214 ar.Response = future.Response() 21215 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesDeleteFuture") 21216 return 21217 } 21218 ar.Response = future.Response() 21219 return 21220} 21221 21222// VirtualMachinesInstallPatchesFuture an abstraction for monitoring and retrieving the results of a 21223// long-running operation. 21224type VirtualMachinesInstallPatchesFuture struct { 21225 azure.FutureAPI 21226 // Result returns the result of the asynchronous operation. 21227 // If the operation has not completed it will return an error. 21228 Result func(VirtualMachinesClient) (VirtualMachineInstallPatchesResult, error) 21229} 21230 21231// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21232func (future *VirtualMachinesInstallPatchesFuture) UnmarshalJSON(body []byte) error { 21233 var azFuture azure.Future 21234 if err := json.Unmarshal(body, &azFuture); err != nil { 21235 return err 21236 } 21237 future.FutureAPI = &azFuture 21238 future.Result = future.result 21239 return nil 21240} 21241 21242// result is the default implementation for VirtualMachinesInstallPatchesFuture.Result. 21243func (future *VirtualMachinesInstallPatchesFuture) result(client VirtualMachinesClient) (vmipr VirtualMachineInstallPatchesResult, err error) { 21244 var done bool 21245 done, err = future.DoneWithContext(context.Background(), client) 21246 if err != nil { 21247 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesInstallPatchesFuture", "Result", future.Response(), "Polling failure") 21248 return 21249 } 21250 if !done { 21251 vmipr.Response.Response = future.Response() 21252 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesInstallPatchesFuture") 21253 return 21254 } 21255 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 21256 if vmipr.Response.Response, err = future.GetResult(sender); err == nil && vmipr.Response.Response.StatusCode != http.StatusNoContent { 21257 vmipr, err = client.InstallPatchesResponder(vmipr.Response.Response) 21258 if err != nil { 21259 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesInstallPatchesFuture", "Result", vmipr.Response.Response, "Failure responding to request") 21260 } 21261 } 21262 return 21263} 21264 21265// VirtualMachineSize describes the properties of a VM size. 21266type VirtualMachineSize struct { 21267 // Name - The name of the virtual machine size. 21268 Name *string `json:"name,omitempty"` 21269 // NumberOfCores - The number of cores supported by the virtual machine size. For Constrained vCPU capable VM sizes, this number represents the total vCPUs of quota that the VM uses. For accurate vCPU count, please refer to https://docs.microsoft.com/azure/virtual-machines/constrained-vcpu or https://docs.microsoft.com/rest/api/compute/resourceskus/list 21270 NumberOfCores *int32 `json:"numberOfCores,omitempty"` 21271 // OsDiskSizeInMB - The OS disk size, in MB, allowed by the virtual machine size. 21272 OsDiskSizeInMB *int32 `json:"osDiskSizeInMB,omitempty"` 21273 // ResourceDiskSizeInMB - The resource disk size, in MB, allowed by the virtual machine size. 21274 ResourceDiskSizeInMB *int32 `json:"resourceDiskSizeInMB,omitempty"` 21275 // MemoryInMB - The amount of memory, in MB, supported by the virtual machine size. 21276 MemoryInMB *int32 `json:"memoryInMB,omitempty"` 21277 // MaxDataDiskCount - The maximum number of data disks that can be attached to the virtual machine size. 21278 MaxDataDiskCount *int32 `json:"maxDataDiskCount,omitempty"` 21279} 21280 21281// VirtualMachineSizeListResult the List Virtual Machine operation response. 21282type VirtualMachineSizeListResult struct { 21283 autorest.Response `json:"-"` 21284 // Value - The list of virtual machine sizes. 21285 Value *[]VirtualMachineSize `json:"value,omitempty"` 21286} 21287 21288// VirtualMachineSoftwarePatchProperties describes the properties of a Virtual Machine software patch. 21289type VirtualMachineSoftwarePatchProperties struct { 21290 // PatchID - READ-ONLY; A unique identifier for the patch. 21291 PatchID *string `json:"patchId,omitempty"` 21292 // Name - READ-ONLY; The friendly name of the patch. 21293 Name *string `json:"name,omitempty"` 21294 // Version - READ-ONLY; The version number of the patch. This property applies only to Linux patches. 21295 Version *string `json:"version,omitempty"` 21296 // KbID - READ-ONLY; The KBID of the patch. Only applies to Windows patches. 21297 KbID *string `json:"kbId,omitempty"` 21298 // Classifications - READ-ONLY; The classification(s) of the patch as provided by the patch publisher. 21299 Classifications *[]string `json:"classifications,omitempty"` 21300 // RebootBehavior - READ-ONLY; Describes the reboot requirements of the patch. Possible values include: 'VMGuestPatchRebootBehaviorUnknown', 'VMGuestPatchRebootBehaviorNeverReboots', 'VMGuestPatchRebootBehaviorAlwaysRequiresReboot', 'VMGuestPatchRebootBehaviorCanRequestReboot' 21301 RebootBehavior VMGuestPatchRebootBehavior `json:"rebootBehavior,omitempty"` 21302 // ActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. 21303 ActivityID *string `json:"activityId,omitempty"` 21304 // PublishedDate - READ-ONLY; The UTC timestamp when the repository published this patch. 21305 PublishedDate *date.Time `json:"publishedDate,omitempty"` 21306 // LastModifiedDateTime - READ-ONLY; The UTC timestamp of the last update to this patch record. 21307 LastModifiedDateTime *date.Time `json:"lastModifiedDateTime,omitempty"` 21308 // AssessmentState - READ-ONLY; Describes the availability of a given patch. Possible values include: 'PatchAssessmentStateUnknown', 'PatchAssessmentStateAvailable' 21309 AssessmentState PatchAssessmentState `json:"assessmentState,omitempty"` 21310} 21311 21312// MarshalJSON is the custom marshaler for VirtualMachineSoftwarePatchProperties. 21313func (vmspp VirtualMachineSoftwarePatchProperties) MarshalJSON() ([]byte, error) { 21314 objectMap := make(map[string]interface{}) 21315 return json.Marshal(objectMap) 21316} 21317 21318// VirtualMachinesPerformMaintenanceFuture an abstraction for monitoring and retrieving the results of a 21319// long-running operation. 21320type VirtualMachinesPerformMaintenanceFuture struct { 21321 azure.FutureAPI 21322 // Result returns the result of the asynchronous operation. 21323 // If the operation has not completed it will return an error. 21324 Result func(VirtualMachinesClient) (autorest.Response, error) 21325} 21326 21327// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21328func (future *VirtualMachinesPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { 21329 var azFuture azure.Future 21330 if err := json.Unmarshal(body, &azFuture); err != nil { 21331 return err 21332 } 21333 future.FutureAPI = &azFuture 21334 future.Result = future.result 21335 return nil 21336} 21337 21338// result is the default implementation for VirtualMachinesPerformMaintenanceFuture.Result. 21339func (future *VirtualMachinesPerformMaintenanceFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 21340 var done bool 21341 done, err = future.DoneWithContext(context.Background(), client) 21342 if err != nil { 21343 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesPerformMaintenanceFuture", "Result", future.Response(), "Polling failure") 21344 return 21345 } 21346 if !done { 21347 ar.Response = future.Response() 21348 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesPerformMaintenanceFuture") 21349 return 21350 } 21351 ar.Response = future.Response() 21352 return 21353} 21354 21355// VirtualMachinesPowerOffFuture an abstraction for monitoring and retrieving the results of a long-running 21356// operation. 21357type VirtualMachinesPowerOffFuture struct { 21358 azure.FutureAPI 21359 // Result returns the result of the asynchronous operation. 21360 // If the operation has not completed it will return an error. 21361 Result func(VirtualMachinesClient) (autorest.Response, error) 21362} 21363 21364// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21365func (future *VirtualMachinesPowerOffFuture) UnmarshalJSON(body []byte) error { 21366 var azFuture azure.Future 21367 if err := json.Unmarshal(body, &azFuture); err != nil { 21368 return err 21369 } 21370 future.FutureAPI = &azFuture 21371 future.Result = future.result 21372 return nil 21373} 21374 21375// result is the default implementation for VirtualMachinesPowerOffFuture.Result. 21376func (future *VirtualMachinesPowerOffFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 21377 var done bool 21378 done, err = future.DoneWithContext(context.Background(), client) 21379 if err != nil { 21380 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesPowerOffFuture", "Result", future.Response(), "Polling failure") 21381 return 21382 } 21383 if !done { 21384 ar.Response = future.Response() 21385 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesPowerOffFuture") 21386 return 21387 } 21388 ar.Response = future.Response() 21389 return 21390} 21391 21392// VirtualMachinesReapplyFuture an abstraction for monitoring and retrieving the results of a long-running 21393// operation. 21394type VirtualMachinesReapplyFuture struct { 21395 azure.FutureAPI 21396 // Result returns the result of the asynchronous operation. 21397 // If the operation has not completed it will return an error. 21398 Result func(VirtualMachinesClient) (autorest.Response, error) 21399} 21400 21401// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21402func (future *VirtualMachinesReapplyFuture) UnmarshalJSON(body []byte) error { 21403 var azFuture azure.Future 21404 if err := json.Unmarshal(body, &azFuture); err != nil { 21405 return err 21406 } 21407 future.FutureAPI = &azFuture 21408 future.Result = future.result 21409 return nil 21410} 21411 21412// result is the default implementation for VirtualMachinesReapplyFuture.Result. 21413func (future *VirtualMachinesReapplyFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 21414 var done bool 21415 done, err = future.DoneWithContext(context.Background(), client) 21416 if err != nil { 21417 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesReapplyFuture", "Result", future.Response(), "Polling failure") 21418 return 21419 } 21420 if !done { 21421 ar.Response = future.Response() 21422 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesReapplyFuture") 21423 return 21424 } 21425 ar.Response = future.Response() 21426 return 21427} 21428 21429// VirtualMachinesRedeployFuture an abstraction for monitoring and retrieving the results of a long-running 21430// operation. 21431type VirtualMachinesRedeployFuture struct { 21432 azure.FutureAPI 21433 // Result returns the result of the asynchronous operation. 21434 // If the operation has not completed it will return an error. 21435 Result func(VirtualMachinesClient) (autorest.Response, error) 21436} 21437 21438// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21439func (future *VirtualMachinesRedeployFuture) UnmarshalJSON(body []byte) error { 21440 var azFuture azure.Future 21441 if err := json.Unmarshal(body, &azFuture); err != nil { 21442 return err 21443 } 21444 future.FutureAPI = &azFuture 21445 future.Result = future.result 21446 return nil 21447} 21448 21449// result is the default implementation for VirtualMachinesRedeployFuture.Result. 21450func (future *VirtualMachinesRedeployFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 21451 var done bool 21452 done, err = future.DoneWithContext(context.Background(), client) 21453 if err != nil { 21454 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRedeployFuture", "Result", future.Response(), "Polling failure") 21455 return 21456 } 21457 if !done { 21458 ar.Response = future.Response() 21459 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRedeployFuture") 21460 return 21461 } 21462 ar.Response = future.Response() 21463 return 21464} 21465 21466// VirtualMachinesReimageFuture an abstraction for monitoring and retrieving the results of a long-running 21467// operation. 21468type VirtualMachinesReimageFuture struct { 21469 azure.FutureAPI 21470 // Result returns the result of the asynchronous operation. 21471 // If the operation has not completed it will return an error. 21472 Result func(VirtualMachinesClient) (autorest.Response, error) 21473} 21474 21475// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21476func (future *VirtualMachinesReimageFuture) UnmarshalJSON(body []byte) error { 21477 var azFuture azure.Future 21478 if err := json.Unmarshal(body, &azFuture); err != nil { 21479 return err 21480 } 21481 future.FutureAPI = &azFuture 21482 future.Result = future.result 21483 return nil 21484} 21485 21486// result is the default implementation for VirtualMachinesReimageFuture.Result. 21487func (future *VirtualMachinesReimageFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 21488 var done bool 21489 done, err = future.DoneWithContext(context.Background(), client) 21490 if err != nil { 21491 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesReimageFuture", "Result", future.Response(), "Polling failure") 21492 return 21493 } 21494 if !done { 21495 ar.Response = future.Response() 21496 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesReimageFuture") 21497 return 21498 } 21499 ar.Response = future.Response() 21500 return 21501} 21502 21503// VirtualMachinesRestartFuture an abstraction for monitoring and retrieving the results of a long-running 21504// operation. 21505type VirtualMachinesRestartFuture struct { 21506 azure.FutureAPI 21507 // Result returns the result of the asynchronous operation. 21508 // If the operation has not completed it will return an error. 21509 Result func(VirtualMachinesClient) (autorest.Response, error) 21510} 21511 21512// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21513func (future *VirtualMachinesRestartFuture) UnmarshalJSON(body []byte) error { 21514 var azFuture azure.Future 21515 if err := json.Unmarshal(body, &azFuture); err != nil { 21516 return err 21517 } 21518 future.FutureAPI = &azFuture 21519 future.Result = future.result 21520 return nil 21521} 21522 21523// result is the default implementation for VirtualMachinesRestartFuture.Result. 21524func (future *VirtualMachinesRestartFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 21525 var done bool 21526 done, err = future.DoneWithContext(context.Background(), client) 21527 if err != nil { 21528 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRestartFuture", "Result", future.Response(), "Polling failure") 21529 return 21530 } 21531 if !done { 21532 ar.Response = future.Response() 21533 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRestartFuture") 21534 return 21535 } 21536 ar.Response = future.Response() 21537 return 21538} 21539 21540// VirtualMachinesRunCommandFuture an abstraction for monitoring and retrieving the results of a 21541// long-running operation. 21542type VirtualMachinesRunCommandFuture struct { 21543 azure.FutureAPI 21544 // Result returns the result of the asynchronous operation. 21545 // If the operation has not completed it will return an error. 21546 Result func(VirtualMachinesClient) (RunCommandResult, error) 21547} 21548 21549// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21550func (future *VirtualMachinesRunCommandFuture) UnmarshalJSON(body []byte) error { 21551 var azFuture azure.Future 21552 if err := json.Unmarshal(body, &azFuture); err != nil { 21553 return err 21554 } 21555 future.FutureAPI = &azFuture 21556 future.Result = future.result 21557 return nil 21558} 21559 21560// result is the default implementation for VirtualMachinesRunCommandFuture.Result. 21561func (future *VirtualMachinesRunCommandFuture) result(client VirtualMachinesClient) (rcr RunCommandResult, err error) { 21562 var done bool 21563 done, err = future.DoneWithContext(context.Background(), client) 21564 if err != nil { 21565 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRunCommandFuture", "Result", future.Response(), "Polling failure") 21566 return 21567 } 21568 if !done { 21569 rcr.Response.Response = future.Response() 21570 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRunCommandFuture") 21571 return 21572 } 21573 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 21574 if rcr.Response.Response, err = future.GetResult(sender); err == nil && rcr.Response.Response.StatusCode != http.StatusNoContent { 21575 rcr, err = client.RunCommandResponder(rcr.Response.Response) 21576 if err != nil { 21577 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRunCommandFuture", "Result", rcr.Response.Response, "Failure responding to request") 21578 } 21579 } 21580 return 21581} 21582 21583// VirtualMachinesStartFuture an abstraction for monitoring and retrieving the results of a long-running 21584// operation. 21585type VirtualMachinesStartFuture struct { 21586 azure.FutureAPI 21587 // Result returns the result of the asynchronous operation. 21588 // If the operation has not completed it will return an error. 21589 Result func(VirtualMachinesClient) (autorest.Response, error) 21590} 21591 21592// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21593func (future *VirtualMachinesStartFuture) UnmarshalJSON(body []byte) error { 21594 var azFuture azure.Future 21595 if err := json.Unmarshal(body, &azFuture); err != nil { 21596 return err 21597 } 21598 future.FutureAPI = &azFuture 21599 future.Result = future.result 21600 return nil 21601} 21602 21603// result is the default implementation for VirtualMachinesStartFuture.Result. 21604func (future *VirtualMachinesStartFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 21605 var done bool 21606 done, err = future.DoneWithContext(context.Background(), client) 21607 if err != nil { 21608 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesStartFuture", "Result", future.Response(), "Polling failure") 21609 return 21610 } 21611 if !done { 21612 ar.Response = future.Response() 21613 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesStartFuture") 21614 return 21615 } 21616 ar.Response = future.Response() 21617 return 21618} 21619 21620// VirtualMachineStatusCodeCount the status code and count of the virtual machine scale set instance view 21621// status summary. 21622type VirtualMachineStatusCodeCount struct { 21623 // Code - READ-ONLY; The instance view status code. 21624 Code *string `json:"code,omitempty"` 21625 // Count - READ-ONLY; The number of instances having a particular status code. 21626 Count *int32 `json:"count,omitempty"` 21627} 21628 21629// MarshalJSON is the custom marshaler for VirtualMachineStatusCodeCount. 21630func (vmscc VirtualMachineStatusCodeCount) MarshalJSON() ([]byte, error) { 21631 objectMap := make(map[string]interface{}) 21632 return json.Marshal(objectMap) 21633} 21634 21635// VirtualMachinesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 21636// operation. 21637type VirtualMachinesUpdateFuture struct { 21638 azure.FutureAPI 21639 // Result returns the result of the asynchronous operation. 21640 // If the operation has not completed it will return an error. 21641 Result func(VirtualMachinesClient) (VirtualMachine, error) 21642} 21643 21644// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21645func (future *VirtualMachinesUpdateFuture) UnmarshalJSON(body []byte) error { 21646 var azFuture azure.Future 21647 if err := json.Unmarshal(body, &azFuture); err != nil { 21648 return err 21649 } 21650 future.FutureAPI = &azFuture 21651 future.Result = future.result 21652 return nil 21653} 21654 21655// result is the default implementation for VirtualMachinesUpdateFuture.Result. 21656func (future *VirtualMachinesUpdateFuture) result(client VirtualMachinesClient) (VM VirtualMachine, err error) { 21657 var done bool 21658 done, err = future.DoneWithContext(context.Background(), client) 21659 if err != nil { 21660 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesUpdateFuture", "Result", future.Response(), "Polling failure") 21661 return 21662 } 21663 if !done { 21664 VM.Response.Response = future.Response() 21665 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesUpdateFuture") 21666 return 21667 } 21668 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 21669 if VM.Response.Response, err = future.GetResult(sender); err == nil && VM.Response.Response.StatusCode != http.StatusNoContent { 21670 VM, err = client.UpdateResponder(VM.Response.Response) 21671 if err != nil { 21672 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesUpdateFuture", "Result", VM.Response.Response, "Failure responding to request") 21673 } 21674 } 21675 return 21676} 21677 21678// VirtualMachineUpdate describes a Virtual Machine Update. 21679type VirtualMachineUpdate struct { 21680 // 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**. 21681 Plan *Plan `json:"plan,omitempty"` 21682 *VirtualMachineProperties `json:"properties,omitempty"` 21683 // Identity - The identity of the virtual machine, if configured. 21684 Identity *VirtualMachineIdentity `json:"identity,omitempty"` 21685 // Zones - The virtual machine zones. 21686 Zones *[]string `json:"zones,omitempty"` 21687 // Tags - Resource tags 21688 Tags map[string]*string `json:"tags"` 21689} 21690 21691// MarshalJSON is the custom marshaler for VirtualMachineUpdate. 21692func (vmu VirtualMachineUpdate) MarshalJSON() ([]byte, error) { 21693 objectMap := make(map[string]interface{}) 21694 if vmu.Plan != nil { 21695 objectMap["plan"] = vmu.Plan 21696 } 21697 if vmu.VirtualMachineProperties != nil { 21698 objectMap["properties"] = vmu.VirtualMachineProperties 21699 } 21700 if vmu.Identity != nil { 21701 objectMap["identity"] = vmu.Identity 21702 } 21703 if vmu.Zones != nil { 21704 objectMap["zones"] = vmu.Zones 21705 } 21706 if vmu.Tags != nil { 21707 objectMap["tags"] = vmu.Tags 21708 } 21709 return json.Marshal(objectMap) 21710} 21711 21712// UnmarshalJSON is the custom unmarshaler for VirtualMachineUpdate struct. 21713func (vmu *VirtualMachineUpdate) UnmarshalJSON(body []byte) error { 21714 var m map[string]*json.RawMessage 21715 err := json.Unmarshal(body, &m) 21716 if err != nil { 21717 return err 21718 } 21719 for k, v := range m { 21720 switch k { 21721 case "plan": 21722 if v != nil { 21723 var plan Plan 21724 err = json.Unmarshal(*v, &plan) 21725 if err != nil { 21726 return err 21727 } 21728 vmu.Plan = &plan 21729 } 21730 case "properties": 21731 if v != nil { 21732 var virtualMachineProperties VirtualMachineProperties 21733 err = json.Unmarshal(*v, &virtualMachineProperties) 21734 if err != nil { 21735 return err 21736 } 21737 vmu.VirtualMachineProperties = &virtualMachineProperties 21738 } 21739 case "identity": 21740 if v != nil { 21741 var identity VirtualMachineIdentity 21742 err = json.Unmarshal(*v, &identity) 21743 if err != nil { 21744 return err 21745 } 21746 vmu.Identity = &identity 21747 } 21748 case "zones": 21749 if v != nil { 21750 var zones []string 21751 err = json.Unmarshal(*v, &zones) 21752 if err != nil { 21753 return err 21754 } 21755 vmu.Zones = &zones 21756 } 21757 case "tags": 21758 if v != nil { 21759 var tags map[string]*string 21760 err = json.Unmarshal(*v, &tags) 21761 if err != nil { 21762 return err 21763 } 21764 vmu.Tags = tags 21765 } 21766 } 21767 } 21768 21769 return nil 21770} 21771 21772// VMScaleSetConvertToSinglePlacementGroupInput ... 21773type VMScaleSetConvertToSinglePlacementGroupInput struct { 21774 // 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. 21775 ActivePlacementGroupID *string `json:"activePlacementGroupId,omitempty"` 21776} 21777 21778// WindowsConfiguration specifies Windows operating system settings on the virtual machine. 21779type WindowsConfiguration struct { 21780 // 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. 21781 ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` 21782 // 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. 21783 EnableAutomaticUpdates *bool `json:"enableAutomaticUpdates,omitempty"` 21784 // 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/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id) value from time zones returned by [TimeZoneInfo.GetSystemTimeZones](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.getsystemtimezones). 21785 TimeZone *string `json:"timeZone,omitempty"` 21786 // AdditionalUnattendContent - Specifies additional base-64 encoded XML formatted information that can be included in the Unattend.xml file, which is used by Windows Setup. 21787 AdditionalUnattendContent *[]AdditionalUnattendContent `json:"additionalUnattendContent,omitempty"` 21788 // PatchSettings - [Preview Feature] Specifies settings related to VM Guest Patching on Windows. 21789 PatchSettings *PatchSettings `json:"patchSettings,omitempty"` 21790 // WinRM - Specifies the Windows Remote Management listeners. This enables remote Windows PowerShell. 21791 WinRM *WinRMConfiguration `json:"winRM,omitempty"` 21792} 21793 21794// WindowsParameters input for InstallPatches on a Windows VM, as directly received by the API 21795type WindowsParameters struct { 21796 // ClassificationsToInclude - The update classifications to select when installing patches for Windows. 21797 ClassificationsToInclude *[]VMGuestPatchClassificationWindows `json:"classificationsToInclude,omitempty"` 21798 // KbNumbersToInclude - Kbs to include in the patch operation 21799 KbNumbersToInclude *[]string `json:"kbNumbersToInclude,omitempty"` 21800 // KbNumbersToExclude - Kbs to exclude in the patch operation 21801 KbNumbersToExclude *[]string `json:"kbNumbersToExclude,omitempty"` 21802 // ExcludeKbsRequiringReboot - Filters out Kbs that don't have an InstallationRebootBehavior of 'NeverReboots' when this is set to true. 21803 ExcludeKbsRequiringReboot *bool `json:"excludeKbsRequiringReboot,omitempty"` 21804 // MaxPatchPublishDate - This is used to install patches that were published on or before this given max published date. 21805 MaxPatchPublishDate *date.Time `json:"maxPatchPublishDate,omitempty"` 21806} 21807 21808// WinRMConfiguration describes Windows Remote Management configuration of the VM 21809type WinRMConfiguration struct { 21810 // Listeners - The list of Windows Remote Management listeners 21811 Listeners *[]WinRMListener `json:"listeners,omitempty"` 21812} 21813 21814// WinRMListener describes Protocol and thumbprint of Windows Remote Management listener 21815type WinRMListener struct { 21816 // Protocol - Specifies the protocol of WinRM listener. <br><br> Possible values are: <br>**http** <br><br> **https**. Possible values include: 'ProtocolTypesHTTP', 'ProtocolTypesHTTPS' 21817 Protocol ProtocolTypes `json:"protocol,omitempty"` 21818 // 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>} 21819 CertificateURL *string `json:"certificateUrl,omitempty"` 21820} 21821