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-07-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 // HibernationEnabled - The flag that enables or disables hibernation capability on the VM. 43 HibernationEnabled *bool `json:"hibernationEnabled,omitempty"` 44} 45 46// AdditionalUnattendContent specifies additional XML formatted information that can be included in the 47// Unattend.xml file, which is used by Windows Setup. Contents are defined by setting name, component name, 48// and the pass in which the content is applied. 49type AdditionalUnattendContent struct { 50 // PassName - The pass name. Currently, the only allowable value is OobeSystem. Possible values include: 'PassNamesOobeSystem' 51 PassName PassNames `json:"passName,omitempty"` 52 // ComponentName - The component name. Currently, the only allowable value is Microsoft-Windows-Shell-Setup. Possible values include: 'ComponentNamesMicrosoftWindowsShellSetup' 53 ComponentName ComponentNames `json:"componentName,omitempty"` 54 // SettingName - Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon. Possible values include: 'SettingNamesAutoLogon', 'SettingNamesFirstLogonCommands' 55 SettingName SettingNames `json:"settingName,omitempty"` 56 // 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. 57 Content *string `json:"content,omitempty"` 58} 59 60// APIEntityReference the API entity reference. 61type APIEntityReference struct { 62 // ID - The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... 63 ID *string `json:"id,omitempty"` 64} 65 66// APIError api error. 67type APIError struct { 68 // Details - The Api error details 69 Details *[]APIErrorBase `json:"details,omitempty"` 70 // Innererror - The Api inner error 71 Innererror *InnerError `json:"innererror,omitempty"` 72 // Code - The error code. 73 Code *string `json:"code,omitempty"` 74 // Target - The target of the particular error. 75 Target *string `json:"target,omitempty"` 76 // Message - The error message. 77 Message *string `json:"message,omitempty"` 78} 79 80// APIErrorBase api error base. 81type APIErrorBase struct { 82 // Code - The error code. 83 Code *string `json:"code,omitempty"` 84 // Target - The target of the particular error. 85 Target *string `json:"target,omitempty"` 86 // Message - The error message. 87 Message *string `json:"message,omitempty"` 88} 89 90// ApplicationProfile contains the list of gallery applications that should be made available to the 91// VM/VMSS 92type ApplicationProfile struct { 93 // GalleryApplications - Specifies the gallery applications that should be made available to the VM/VMSS 94 GalleryApplications *[]VMGalleryApplication `json:"galleryApplications,omitempty"` 95} 96 97// AutomaticOSUpgradePolicy the configuration parameters used for performing automatic OS upgrade. 98type AutomaticOSUpgradePolicy struct { 99 // 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. 100 EnableAutomaticOSUpgrade *bool `json:"enableAutomaticOSUpgrade,omitempty"` 101 // DisableAutomaticRollback - Whether OS image rollback feature should be disabled. Default value is false. 102 DisableAutomaticRollback *bool `json:"disableAutomaticRollback,omitempty"` 103} 104 105// AutomaticOSUpgradeProperties describes automatic OS upgrade properties on the image. 106type AutomaticOSUpgradeProperties struct { 107 // AutomaticOSUpgradeSupported - Specifies whether automatic OS upgrade is supported on the image. 108 AutomaticOSUpgradeSupported *bool `json:"automaticOSUpgradeSupported,omitempty"` 109} 110 111// AutomaticRepairsPolicy specifies the configuration parameters for automatic repairs on the virtual 112// machine scale set. 113type AutomaticRepairsPolicy struct { 114 // Enabled - Specifies whether automatic repairs should be enabled on the virtual machine scale set. The default value is false. 115 Enabled *bool `json:"enabled,omitempty"` 116 // 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). 117 GracePeriod *string `json:"gracePeriod,omitempty"` 118} 119 120// AvailabilitySet specifies information about the availability set that the virtual machine should be 121// assigned to. Virtual machines specified in the same availability set are allocated to different nodes to 122// maximize availability. For more information about availability sets, see [Availability sets 123// overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). <br><br> For 124// more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in 125// Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates) <br><br> Currently, a 126// VM can only be added to availability set at creation time. An existing VM cannot be added to an 127// availability set. 128type AvailabilitySet struct { 129 autorest.Response `json:"-"` 130 *AvailabilitySetProperties `json:"properties,omitempty"` 131 // 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'. 132 Sku *Sku `json:"sku,omitempty"` 133 // ID - READ-ONLY; Resource Id 134 ID *string `json:"id,omitempty"` 135 // Name - READ-ONLY; Resource name 136 Name *string `json:"name,omitempty"` 137 // Type - READ-ONLY; Resource type 138 Type *string `json:"type,omitempty"` 139 // Location - Resource location 140 Location *string `json:"location,omitempty"` 141 // Tags - Resource tags 142 Tags map[string]*string `json:"tags"` 143} 144 145// MarshalJSON is the custom marshaler for AvailabilitySet. 146func (as AvailabilitySet) MarshalJSON() ([]byte, error) { 147 objectMap := make(map[string]interface{}) 148 if as.AvailabilitySetProperties != nil { 149 objectMap["properties"] = as.AvailabilitySetProperties 150 } 151 if as.Sku != nil { 152 objectMap["sku"] = as.Sku 153 } 154 if as.Location != nil { 155 objectMap["location"] = as.Location 156 } 157 if as.Tags != nil { 158 objectMap["tags"] = as.Tags 159 } 160 return json.Marshal(objectMap) 161} 162 163// UnmarshalJSON is the custom unmarshaler for AvailabilitySet struct. 164func (as *AvailabilitySet) UnmarshalJSON(body []byte) error { 165 var m map[string]*json.RawMessage 166 err := json.Unmarshal(body, &m) 167 if err != nil { 168 return err 169 } 170 for k, v := range m { 171 switch k { 172 case "properties": 173 if v != nil { 174 var availabilitySetProperties AvailabilitySetProperties 175 err = json.Unmarshal(*v, &availabilitySetProperties) 176 if err != nil { 177 return err 178 } 179 as.AvailabilitySetProperties = &availabilitySetProperties 180 } 181 case "sku": 182 if v != nil { 183 var sku Sku 184 err = json.Unmarshal(*v, &sku) 185 if err != nil { 186 return err 187 } 188 as.Sku = &sku 189 } 190 case "id": 191 if v != nil { 192 var ID string 193 err = json.Unmarshal(*v, &ID) 194 if err != nil { 195 return err 196 } 197 as.ID = &ID 198 } 199 case "name": 200 if v != nil { 201 var name string 202 err = json.Unmarshal(*v, &name) 203 if err != nil { 204 return err 205 } 206 as.Name = &name 207 } 208 case "type": 209 if v != nil { 210 var typeVar string 211 err = json.Unmarshal(*v, &typeVar) 212 if err != nil { 213 return err 214 } 215 as.Type = &typeVar 216 } 217 case "location": 218 if v != nil { 219 var location string 220 err = json.Unmarshal(*v, &location) 221 if err != nil { 222 return err 223 } 224 as.Location = &location 225 } 226 case "tags": 227 if v != nil { 228 var tags map[string]*string 229 err = json.Unmarshal(*v, &tags) 230 if err != nil { 231 return err 232 } 233 as.Tags = tags 234 } 235 } 236 } 237 238 return nil 239} 240 241// AvailabilitySetListResult the List Availability Set operation response. 242type AvailabilitySetListResult struct { 243 autorest.Response `json:"-"` 244 // Value - The list of availability sets 245 Value *[]AvailabilitySet `json:"value,omitempty"` 246 // NextLink - The URI to fetch the next page of AvailabilitySets. Call ListNext() with this URI to fetch the next page of AvailabilitySets. 247 NextLink *string `json:"nextLink,omitempty"` 248} 249 250// AvailabilitySetListResultIterator provides access to a complete listing of AvailabilitySet values. 251type AvailabilitySetListResultIterator struct { 252 i int 253 page AvailabilitySetListResultPage 254} 255 256// NextWithContext advances to the next value. If there was an error making 257// the request the iterator does not advance and the error is returned. 258func (iter *AvailabilitySetListResultIterator) NextWithContext(ctx context.Context) (err error) { 259 if tracing.IsEnabled() { 260 ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetListResultIterator.NextWithContext") 261 defer func() { 262 sc := -1 263 if iter.Response().Response.Response != nil { 264 sc = iter.Response().Response.Response.StatusCode 265 } 266 tracing.EndSpan(ctx, sc, err) 267 }() 268 } 269 iter.i++ 270 if iter.i < len(iter.page.Values()) { 271 return nil 272 } 273 err = iter.page.NextWithContext(ctx) 274 if err != nil { 275 iter.i-- 276 return err 277 } 278 iter.i = 0 279 return nil 280} 281 282// Next advances to the next value. If there was an error making 283// the request the iterator does not advance and the error is returned. 284// Deprecated: Use NextWithContext() instead. 285func (iter *AvailabilitySetListResultIterator) Next() error { 286 return iter.NextWithContext(context.Background()) 287} 288 289// NotDone returns true if the enumeration should be started or is not yet complete. 290func (iter AvailabilitySetListResultIterator) NotDone() bool { 291 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 292} 293 294// Response returns the raw server response from the last page request. 295func (iter AvailabilitySetListResultIterator) Response() AvailabilitySetListResult { 296 return iter.page.Response() 297} 298 299// Value returns the current value or a zero-initialized value if the 300// iterator has advanced beyond the end of the collection. 301func (iter AvailabilitySetListResultIterator) Value() AvailabilitySet { 302 if !iter.page.NotDone() { 303 return AvailabilitySet{} 304 } 305 return iter.page.Values()[iter.i] 306} 307 308// Creates a new instance of the AvailabilitySetListResultIterator type. 309func NewAvailabilitySetListResultIterator(page AvailabilitySetListResultPage) AvailabilitySetListResultIterator { 310 return AvailabilitySetListResultIterator{page: page} 311} 312 313// IsEmpty returns true if the ListResult contains no values. 314func (aslr AvailabilitySetListResult) IsEmpty() bool { 315 return aslr.Value == nil || len(*aslr.Value) == 0 316} 317 318// hasNextLink returns true if the NextLink is not empty. 319func (aslr AvailabilitySetListResult) hasNextLink() bool { 320 return aslr.NextLink != nil && len(*aslr.NextLink) != 0 321} 322 323// availabilitySetListResultPreparer prepares a request to retrieve the next set of results. 324// It returns nil if no more results exist. 325func (aslr AvailabilitySetListResult) availabilitySetListResultPreparer(ctx context.Context) (*http.Request, error) { 326 if !aslr.hasNextLink() { 327 return nil, nil 328 } 329 return autorest.Prepare((&http.Request{}).WithContext(ctx), 330 autorest.AsJSON(), 331 autorest.AsGet(), 332 autorest.WithBaseURL(to.String(aslr.NextLink))) 333} 334 335// AvailabilitySetListResultPage contains a page of AvailabilitySet values. 336type AvailabilitySetListResultPage struct { 337 fn func(context.Context, AvailabilitySetListResult) (AvailabilitySetListResult, error) 338 aslr AvailabilitySetListResult 339} 340 341// NextWithContext advances to the next page of values. If there was an error making 342// the request the page does not advance and the error is returned. 343func (page *AvailabilitySetListResultPage) NextWithContext(ctx context.Context) (err error) { 344 if tracing.IsEnabled() { 345 ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetListResultPage.NextWithContext") 346 defer func() { 347 sc := -1 348 if page.Response().Response.Response != nil { 349 sc = page.Response().Response.Response.StatusCode 350 } 351 tracing.EndSpan(ctx, sc, err) 352 }() 353 } 354 for { 355 next, err := page.fn(ctx, page.aslr) 356 if err != nil { 357 return err 358 } 359 page.aslr = next 360 if !next.hasNextLink() || !next.IsEmpty() { 361 break 362 } 363 } 364 return nil 365} 366 367// Next advances to the next page of values. If there was an error making 368// the request the page does not advance and the error is returned. 369// Deprecated: Use NextWithContext() instead. 370func (page *AvailabilitySetListResultPage) Next() error { 371 return page.NextWithContext(context.Background()) 372} 373 374// NotDone returns true if the page enumeration should be started or is not yet complete. 375func (page AvailabilitySetListResultPage) NotDone() bool { 376 return !page.aslr.IsEmpty() 377} 378 379// Response returns the raw server response from the last page request. 380func (page AvailabilitySetListResultPage) Response() AvailabilitySetListResult { 381 return page.aslr 382} 383 384// Values returns the slice of values for the current page or nil if there are no values. 385func (page AvailabilitySetListResultPage) Values() []AvailabilitySet { 386 if page.aslr.IsEmpty() { 387 return nil 388 } 389 return *page.aslr.Value 390} 391 392// Creates a new instance of the AvailabilitySetListResultPage type. 393func NewAvailabilitySetListResultPage(cur AvailabilitySetListResult, getNextPage func(context.Context, AvailabilitySetListResult) (AvailabilitySetListResult, error)) AvailabilitySetListResultPage { 394 return AvailabilitySetListResultPage{ 395 fn: getNextPage, 396 aslr: cur, 397 } 398} 399 400// AvailabilitySetProperties the instance view of a resource. 401type AvailabilitySetProperties struct { 402 // PlatformUpdateDomainCount - Update Domain count. 403 PlatformUpdateDomainCount *int32 `json:"platformUpdateDomainCount,omitempty"` 404 // PlatformFaultDomainCount - Fault Domain count. 405 PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` 406 // VirtualMachines - A list of references to all virtual machines in the availability set. 407 VirtualMachines *[]SubResource `json:"virtualMachines,omitempty"` 408 // ProximityPlacementGroup - Specifies information about the proximity placement group that the availability set should be assigned to. <br><br>Minimum api-version: 2018-04-01. 409 ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` 410 // Statuses - READ-ONLY; The resource status information. 411 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 412} 413 414// MarshalJSON is the custom marshaler for AvailabilitySetProperties. 415func (asp AvailabilitySetProperties) MarshalJSON() ([]byte, error) { 416 objectMap := make(map[string]interface{}) 417 if asp.PlatformUpdateDomainCount != nil { 418 objectMap["platformUpdateDomainCount"] = asp.PlatformUpdateDomainCount 419 } 420 if asp.PlatformFaultDomainCount != nil { 421 objectMap["platformFaultDomainCount"] = asp.PlatformFaultDomainCount 422 } 423 if asp.VirtualMachines != nil { 424 objectMap["virtualMachines"] = asp.VirtualMachines 425 } 426 if asp.ProximityPlacementGroup != nil { 427 objectMap["proximityPlacementGroup"] = asp.ProximityPlacementGroup 428 } 429 return json.Marshal(objectMap) 430} 431 432// AvailabilitySetUpdate specifies information about the availability set that the virtual machine should 433// be assigned to. Only tags may be updated. 434type AvailabilitySetUpdate struct { 435 *AvailabilitySetProperties `json:"properties,omitempty"` 436 // Sku - Sku of the availability set 437 Sku *Sku `json:"sku,omitempty"` 438 // Tags - Resource tags 439 Tags map[string]*string `json:"tags"` 440} 441 442// MarshalJSON is the custom marshaler for AvailabilitySetUpdate. 443func (asu AvailabilitySetUpdate) MarshalJSON() ([]byte, error) { 444 objectMap := make(map[string]interface{}) 445 if asu.AvailabilitySetProperties != nil { 446 objectMap["properties"] = asu.AvailabilitySetProperties 447 } 448 if asu.Sku != nil { 449 objectMap["sku"] = asu.Sku 450 } 451 if asu.Tags != nil { 452 objectMap["tags"] = asu.Tags 453 } 454 return json.Marshal(objectMap) 455} 456 457// UnmarshalJSON is the custom unmarshaler for AvailabilitySetUpdate struct. 458func (asu *AvailabilitySetUpdate) UnmarshalJSON(body []byte) error { 459 var m map[string]*json.RawMessage 460 err := json.Unmarshal(body, &m) 461 if err != nil { 462 return err 463 } 464 for k, v := range m { 465 switch k { 466 case "properties": 467 if v != nil { 468 var availabilitySetProperties AvailabilitySetProperties 469 err = json.Unmarshal(*v, &availabilitySetProperties) 470 if err != nil { 471 return err 472 } 473 asu.AvailabilitySetProperties = &availabilitySetProperties 474 } 475 case "sku": 476 if v != nil { 477 var sku Sku 478 err = json.Unmarshal(*v, &sku) 479 if err != nil { 480 return err 481 } 482 asu.Sku = &sku 483 } 484 case "tags": 485 if v != nil { 486 var tags map[string]*string 487 err = json.Unmarshal(*v, &tags) 488 if err != nil { 489 return err 490 } 491 asu.Tags = tags 492 } 493 } 494 } 495 496 return nil 497} 498 499// AvailablePatchSummary describes the properties of an virtual machine instance view for available patch 500// summary. 501type AvailablePatchSummary struct { 502 // 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' 503 Status PatchOperationStatus `json:"status,omitempty"` 504 // AssessmentActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. 505 AssessmentActivityID *string `json:"assessmentActivityId,omitempty"` 506 // 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. 507 RebootPending *bool `json:"rebootPending,omitempty"` 508 // CriticalAndSecurityPatchCount - READ-ONLY; The number of critical or security patches that have been detected as available and not yet installed. 509 CriticalAndSecurityPatchCount *int32 `json:"criticalAndSecurityPatchCount,omitempty"` 510 // OtherPatchCount - READ-ONLY; The number of all available patches excluding critical and security. 511 OtherPatchCount *int32 `json:"otherPatchCount,omitempty"` 512 // StartTime - READ-ONLY; The UTC timestamp when the operation began. 513 StartTime *date.Time `json:"startTime,omitempty"` 514 // LastModifiedTime - READ-ONLY; The UTC timestamp when the operation began. 515 LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` 516 // Error - READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. 517 Error *APIError `json:"error,omitempty"` 518} 519 520// MarshalJSON is the custom marshaler for AvailablePatchSummary. 521func (aps AvailablePatchSummary) MarshalJSON() ([]byte, error) { 522 objectMap := make(map[string]interface{}) 523 return json.Marshal(objectMap) 524} 525 526// BillingProfile specifies the billing related details of a Azure Spot VM or VMSS. <br><br>Minimum 527// api-version: 2019-03-01. 528type BillingProfile struct { 529 // 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. 530 MaxPrice *float64 `json:"maxPrice,omitempty"` 531} 532 533// BootDiagnostics boot Diagnostics is a debugging feature which allows you to view Console Output and 534// Screenshot to diagnose VM status. <br><br> You can easily view the output of your console log. <br><br> 535// Azure also enables you to see a screenshot of the VM from the hypervisor. 536type BootDiagnostics struct { 537 // Enabled - Whether boot diagnostics should be enabled on the Virtual Machine. 538 Enabled *bool `json:"enabled,omitempty"` 539 // 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. 540 StorageURI *string `json:"storageUri,omitempty"` 541} 542 543// BootDiagnosticsInstanceView the instance view of a virtual machine boot diagnostics. 544type BootDiagnosticsInstanceView struct { 545 // 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. 546 ConsoleScreenshotBlobURI *string `json:"consoleScreenshotBlobUri,omitempty"` 547 // 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. 548 SerialConsoleLogBlobURI *string `json:"serialConsoleLogBlobUri,omitempty"` 549 // 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. 550 Status *InstanceViewStatus `json:"status,omitempty"` 551} 552 553// MarshalJSON is the custom marshaler for BootDiagnosticsInstanceView. 554func (bdiv BootDiagnosticsInstanceView) MarshalJSON() ([]byte, error) { 555 objectMap := make(map[string]interface{}) 556 return json.Marshal(objectMap) 557} 558 559// CapacityReservation specifies information about the capacity reservation. 560type CapacityReservation struct { 561 autorest.Response `json:"-"` 562 *CapacityReservationProperties `json:"properties,omitempty"` 563 // Sku - SKU of the resource for which capacity needs be reserved. The SKU name and capacity is required to be set. Currently VM Skus with the capability called 'CapacityReservationSupported' set to true are supported. Refer to List Microsoft.Compute SKUs in a region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values. 564 Sku *Sku `json:"sku,omitempty"` 565 // Zones - Availability Zone to use for this capacity reservation. The zone has to be single value and also should be part for the list of zones specified during the capacity reservation group creation. The zone can be assigned only during creation. If not provided, the reservation supports only non-zonal deployments. If provided, enforces VM/VMSS using this capacity reservation to be in same zone. 566 Zones *[]string `json:"zones,omitempty"` 567 // ID - READ-ONLY; Resource Id 568 ID *string `json:"id,omitempty"` 569 // Name - READ-ONLY; Resource name 570 Name *string `json:"name,omitempty"` 571 // Type - READ-ONLY; Resource type 572 Type *string `json:"type,omitempty"` 573 // Location - Resource location 574 Location *string `json:"location,omitempty"` 575 // Tags - Resource tags 576 Tags map[string]*string `json:"tags"` 577} 578 579// MarshalJSON is the custom marshaler for CapacityReservation. 580func (cr CapacityReservation) MarshalJSON() ([]byte, error) { 581 objectMap := make(map[string]interface{}) 582 if cr.CapacityReservationProperties != nil { 583 objectMap["properties"] = cr.CapacityReservationProperties 584 } 585 if cr.Sku != nil { 586 objectMap["sku"] = cr.Sku 587 } 588 if cr.Zones != nil { 589 objectMap["zones"] = cr.Zones 590 } 591 if cr.Location != nil { 592 objectMap["location"] = cr.Location 593 } 594 if cr.Tags != nil { 595 objectMap["tags"] = cr.Tags 596 } 597 return json.Marshal(objectMap) 598} 599 600// UnmarshalJSON is the custom unmarshaler for CapacityReservation struct. 601func (cr *CapacityReservation) UnmarshalJSON(body []byte) error { 602 var m map[string]*json.RawMessage 603 err := json.Unmarshal(body, &m) 604 if err != nil { 605 return err 606 } 607 for k, v := range m { 608 switch k { 609 case "properties": 610 if v != nil { 611 var capacityReservationProperties CapacityReservationProperties 612 err = json.Unmarshal(*v, &capacityReservationProperties) 613 if err != nil { 614 return err 615 } 616 cr.CapacityReservationProperties = &capacityReservationProperties 617 } 618 case "sku": 619 if v != nil { 620 var sku Sku 621 err = json.Unmarshal(*v, &sku) 622 if err != nil { 623 return err 624 } 625 cr.Sku = &sku 626 } 627 case "zones": 628 if v != nil { 629 var zones []string 630 err = json.Unmarshal(*v, &zones) 631 if err != nil { 632 return err 633 } 634 cr.Zones = &zones 635 } 636 case "id": 637 if v != nil { 638 var ID string 639 err = json.Unmarshal(*v, &ID) 640 if err != nil { 641 return err 642 } 643 cr.ID = &ID 644 } 645 case "name": 646 if v != nil { 647 var name string 648 err = json.Unmarshal(*v, &name) 649 if err != nil { 650 return err 651 } 652 cr.Name = &name 653 } 654 case "type": 655 if v != nil { 656 var typeVar string 657 err = json.Unmarshal(*v, &typeVar) 658 if err != nil { 659 return err 660 } 661 cr.Type = &typeVar 662 } 663 case "location": 664 if v != nil { 665 var location string 666 err = json.Unmarshal(*v, &location) 667 if err != nil { 668 return err 669 } 670 cr.Location = &location 671 } 672 case "tags": 673 if v != nil { 674 var tags map[string]*string 675 err = json.Unmarshal(*v, &tags) 676 if err != nil { 677 return err 678 } 679 cr.Tags = tags 680 } 681 } 682 } 683 684 return nil 685} 686 687// CapacityReservationGroup specifies information about the capacity reservation group that the capacity 688// reservations should be assigned to. <br><br> Currently, a capacity reservation can only be added to a 689// capacity reservation group at creation time. An existing capacity reservation cannot be added or moved 690// to another capacity reservation group. 691type CapacityReservationGroup struct { 692 autorest.Response `json:"-"` 693 *CapacityReservationGroupProperties `json:"properties,omitempty"` 694 // Zones - Availability Zones to use for this capacity reservation group. The zones can be assigned only during creation. If not provided, the group supports only regional resources in the region. If provided, enforces each capacity reservation in the group to be in one of the zones. 695 Zones *[]string `json:"zones,omitempty"` 696 // ID - READ-ONLY; Resource Id 697 ID *string `json:"id,omitempty"` 698 // Name - READ-ONLY; Resource name 699 Name *string `json:"name,omitempty"` 700 // Type - READ-ONLY; Resource type 701 Type *string `json:"type,omitempty"` 702 // Location - Resource location 703 Location *string `json:"location,omitempty"` 704 // Tags - Resource tags 705 Tags map[string]*string `json:"tags"` 706} 707 708// MarshalJSON is the custom marshaler for CapacityReservationGroup. 709func (crg CapacityReservationGroup) MarshalJSON() ([]byte, error) { 710 objectMap := make(map[string]interface{}) 711 if crg.CapacityReservationGroupProperties != nil { 712 objectMap["properties"] = crg.CapacityReservationGroupProperties 713 } 714 if crg.Zones != nil { 715 objectMap["zones"] = crg.Zones 716 } 717 if crg.Location != nil { 718 objectMap["location"] = crg.Location 719 } 720 if crg.Tags != nil { 721 objectMap["tags"] = crg.Tags 722 } 723 return json.Marshal(objectMap) 724} 725 726// UnmarshalJSON is the custom unmarshaler for CapacityReservationGroup struct. 727func (crg *CapacityReservationGroup) UnmarshalJSON(body []byte) error { 728 var m map[string]*json.RawMessage 729 err := json.Unmarshal(body, &m) 730 if err != nil { 731 return err 732 } 733 for k, v := range m { 734 switch k { 735 case "properties": 736 if v != nil { 737 var capacityReservationGroupProperties CapacityReservationGroupProperties 738 err = json.Unmarshal(*v, &capacityReservationGroupProperties) 739 if err != nil { 740 return err 741 } 742 crg.CapacityReservationGroupProperties = &capacityReservationGroupProperties 743 } 744 case "zones": 745 if v != nil { 746 var zones []string 747 err = json.Unmarshal(*v, &zones) 748 if err != nil { 749 return err 750 } 751 crg.Zones = &zones 752 } 753 case "id": 754 if v != nil { 755 var ID string 756 err = json.Unmarshal(*v, &ID) 757 if err != nil { 758 return err 759 } 760 crg.ID = &ID 761 } 762 case "name": 763 if v != nil { 764 var name string 765 err = json.Unmarshal(*v, &name) 766 if err != nil { 767 return err 768 } 769 crg.Name = &name 770 } 771 case "type": 772 if v != nil { 773 var typeVar string 774 err = json.Unmarshal(*v, &typeVar) 775 if err != nil { 776 return err 777 } 778 crg.Type = &typeVar 779 } 780 case "location": 781 if v != nil { 782 var location string 783 err = json.Unmarshal(*v, &location) 784 if err != nil { 785 return err 786 } 787 crg.Location = &location 788 } 789 case "tags": 790 if v != nil { 791 var tags map[string]*string 792 err = json.Unmarshal(*v, &tags) 793 if err != nil { 794 return err 795 } 796 crg.Tags = tags 797 } 798 } 799 } 800 801 return nil 802} 803 804// CapacityReservationGroupInstanceView ... 805type CapacityReservationGroupInstanceView struct { 806 // CapacityReservations - READ-ONLY; List of instance view of the capacity reservations under the capacity reservation group. 807 CapacityReservations *[]CapacityReservationInstanceViewWithName `json:"capacityReservations,omitempty"` 808} 809 810// MarshalJSON is the custom marshaler for CapacityReservationGroupInstanceView. 811func (crgiv CapacityReservationGroupInstanceView) MarshalJSON() ([]byte, error) { 812 objectMap := make(map[string]interface{}) 813 return json.Marshal(objectMap) 814} 815 816// CapacityReservationGroupListResult the List capacity reservation group with resource group response. 817type CapacityReservationGroupListResult struct { 818 autorest.Response `json:"-"` 819 // Value - The list of capacity reservation groups 820 Value *[]CapacityReservationGroup `json:"value,omitempty"` 821 // NextLink - The URI to fetch the next page of capacity reservation groups. Call ListNext() with this URI to fetch the next page of capacity reservation groups. 822 NextLink *string `json:"nextLink,omitempty"` 823} 824 825// CapacityReservationGroupListResultIterator provides access to a complete listing of 826// CapacityReservationGroup values. 827type CapacityReservationGroupListResultIterator struct { 828 i int 829 page CapacityReservationGroupListResultPage 830} 831 832// NextWithContext advances to the next value. If there was an error making 833// the request the iterator does not advance and the error is returned. 834func (iter *CapacityReservationGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { 835 if tracing.IsEnabled() { 836 ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationGroupListResultIterator.NextWithContext") 837 defer func() { 838 sc := -1 839 if iter.Response().Response.Response != nil { 840 sc = iter.Response().Response.Response.StatusCode 841 } 842 tracing.EndSpan(ctx, sc, err) 843 }() 844 } 845 iter.i++ 846 if iter.i < len(iter.page.Values()) { 847 return nil 848 } 849 err = iter.page.NextWithContext(ctx) 850 if err != nil { 851 iter.i-- 852 return err 853 } 854 iter.i = 0 855 return nil 856} 857 858// Next advances to the next value. If there was an error making 859// the request the iterator does not advance and the error is returned. 860// Deprecated: Use NextWithContext() instead. 861func (iter *CapacityReservationGroupListResultIterator) Next() error { 862 return iter.NextWithContext(context.Background()) 863} 864 865// NotDone returns true if the enumeration should be started or is not yet complete. 866func (iter CapacityReservationGroupListResultIterator) NotDone() bool { 867 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 868} 869 870// Response returns the raw server response from the last page request. 871func (iter CapacityReservationGroupListResultIterator) Response() CapacityReservationGroupListResult { 872 return iter.page.Response() 873} 874 875// Value returns the current value or a zero-initialized value if the 876// iterator has advanced beyond the end of the collection. 877func (iter CapacityReservationGroupListResultIterator) Value() CapacityReservationGroup { 878 if !iter.page.NotDone() { 879 return CapacityReservationGroup{} 880 } 881 return iter.page.Values()[iter.i] 882} 883 884// Creates a new instance of the CapacityReservationGroupListResultIterator type. 885func NewCapacityReservationGroupListResultIterator(page CapacityReservationGroupListResultPage) CapacityReservationGroupListResultIterator { 886 return CapacityReservationGroupListResultIterator{page: page} 887} 888 889// IsEmpty returns true if the ListResult contains no values. 890func (crglr CapacityReservationGroupListResult) IsEmpty() bool { 891 return crglr.Value == nil || len(*crglr.Value) == 0 892} 893 894// hasNextLink returns true if the NextLink is not empty. 895func (crglr CapacityReservationGroupListResult) hasNextLink() bool { 896 return crglr.NextLink != nil && len(*crglr.NextLink) != 0 897} 898 899// capacityReservationGroupListResultPreparer prepares a request to retrieve the next set of results. 900// It returns nil if no more results exist. 901func (crglr CapacityReservationGroupListResult) capacityReservationGroupListResultPreparer(ctx context.Context) (*http.Request, error) { 902 if !crglr.hasNextLink() { 903 return nil, nil 904 } 905 return autorest.Prepare((&http.Request{}).WithContext(ctx), 906 autorest.AsJSON(), 907 autorest.AsGet(), 908 autorest.WithBaseURL(to.String(crglr.NextLink))) 909} 910 911// CapacityReservationGroupListResultPage contains a page of CapacityReservationGroup values. 912type CapacityReservationGroupListResultPage struct { 913 fn func(context.Context, CapacityReservationGroupListResult) (CapacityReservationGroupListResult, error) 914 crglr CapacityReservationGroupListResult 915} 916 917// NextWithContext advances to the next page of values. If there was an error making 918// the request the page does not advance and the error is returned. 919func (page *CapacityReservationGroupListResultPage) NextWithContext(ctx context.Context) (err error) { 920 if tracing.IsEnabled() { 921 ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationGroupListResultPage.NextWithContext") 922 defer func() { 923 sc := -1 924 if page.Response().Response.Response != nil { 925 sc = page.Response().Response.Response.StatusCode 926 } 927 tracing.EndSpan(ctx, sc, err) 928 }() 929 } 930 for { 931 next, err := page.fn(ctx, page.crglr) 932 if err != nil { 933 return err 934 } 935 page.crglr = next 936 if !next.hasNextLink() || !next.IsEmpty() { 937 break 938 } 939 } 940 return nil 941} 942 943// Next advances to the next page of values. If there was an error making 944// the request the page does not advance and the error is returned. 945// Deprecated: Use NextWithContext() instead. 946func (page *CapacityReservationGroupListResultPage) Next() error { 947 return page.NextWithContext(context.Background()) 948} 949 950// NotDone returns true if the page enumeration should be started or is not yet complete. 951func (page CapacityReservationGroupListResultPage) NotDone() bool { 952 return !page.crglr.IsEmpty() 953} 954 955// Response returns the raw server response from the last page request. 956func (page CapacityReservationGroupListResultPage) Response() CapacityReservationGroupListResult { 957 return page.crglr 958} 959 960// Values returns the slice of values for the current page or nil if there are no values. 961func (page CapacityReservationGroupListResultPage) Values() []CapacityReservationGroup { 962 if page.crglr.IsEmpty() { 963 return nil 964 } 965 return *page.crglr.Value 966} 967 968// Creates a new instance of the CapacityReservationGroupListResultPage type. 969func NewCapacityReservationGroupListResultPage(cur CapacityReservationGroupListResult, getNextPage func(context.Context, CapacityReservationGroupListResult) (CapacityReservationGroupListResult, error)) CapacityReservationGroupListResultPage { 970 return CapacityReservationGroupListResultPage{ 971 fn: getNextPage, 972 crglr: cur, 973 } 974} 975 976// CapacityReservationGroupProperties capacity reservation group Properties. 977type CapacityReservationGroupProperties struct { 978 // CapacityReservations - READ-ONLY; A list of all capacity reservation resource ids that belong to capacity reservation group. 979 CapacityReservations *[]SubResourceReadOnly `json:"capacityReservations,omitempty"` 980 // VirtualMachinesAssociated - READ-ONLY; A list of references to all virtual machines associated to the capacity reservation group. 981 VirtualMachinesAssociated *[]SubResourceReadOnly `json:"virtualMachinesAssociated,omitempty"` 982 // InstanceView - READ-ONLY; The capacity reservation group instance view which has the list of instance views for all the capacity reservations that belong to the capacity reservation group. 983 InstanceView *CapacityReservationGroupInstanceView `json:"instanceView,omitempty"` 984} 985 986// MarshalJSON is the custom marshaler for CapacityReservationGroupProperties. 987func (crgp CapacityReservationGroupProperties) MarshalJSON() ([]byte, error) { 988 objectMap := make(map[string]interface{}) 989 return json.Marshal(objectMap) 990} 991 992// CapacityReservationGroupUpdate specifies information about the capacity reservation group. Only tags can 993// be updated. 994type CapacityReservationGroupUpdate struct { 995 *CapacityReservationGroupProperties `json:"properties,omitempty"` 996 // Tags - Resource tags 997 Tags map[string]*string `json:"tags"` 998} 999 1000// MarshalJSON is the custom marshaler for CapacityReservationGroupUpdate. 1001func (crgu CapacityReservationGroupUpdate) MarshalJSON() ([]byte, error) { 1002 objectMap := make(map[string]interface{}) 1003 if crgu.CapacityReservationGroupProperties != nil { 1004 objectMap["properties"] = crgu.CapacityReservationGroupProperties 1005 } 1006 if crgu.Tags != nil { 1007 objectMap["tags"] = crgu.Tags 1008 } 1009 return json.Marshal(objectMap) 1010} 1011 1012// UnmarshalJSON is the custom unmarshaler for CapacityReservationGroupUpdate struct. 1013func (crgu *CapacityReservationGroupUpdate) UnmarshalJSON(body []byte) error { 1014 var m map[string]*json.RawMessage 1015 err := json.Unmarshal(body, &m) 1016 if err != nil { 1017 return err 1018 } 1019 for k, v := range m { 1020 switch k { 1021 case "properties": 1022 if v != nil { 1023 var capacityReservationGroupProperties CapacityReservationGroupProperties 1024 err = json.Unmarshal(*v, &capacityReservationGroupProperties) 1025 if err != nil { 1026 return err 1027 } 1028 crgu.CapacityReservationGroupProperties = &capacityReservationGroupProperties 1029 } 1030 case "tags": 1031 if v != nil { 1032 var tags map[string]*string 1033 err = json.Unmarshal(*v, &tags) 1034 if err != nil { 1035 return err 1036 } 1037 crgu.Tags = tags 1038 } 1039 } 1040 } 1041 1042 return nil 1043} 1044 1045// CapacityReservationInstanceView the instance view of a capacity reservation that provides as snapshot of 1046// the runtime properties of the capacity reservation that is managed by the platform and can change 1047// outside of control plane operations. 1048type CapacityReservationInstanceView struct { 1049 // UtilizationInfo - Unutilized capacity of the capacity reservation. 1050 UtilizationInfo *CapacityReservationUtilization `json:"utilizationInfo,omitempty"` 1051 // Statuses - The resource status information. 1052 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 1053} 1054 1055// CapacityReservationInstanceViewWithName the instance view of a capacity reservation that includes the 1056// name of the capacity reservation. It is used for the response to the instance view of a capacity 1057// reservation group. 1058type CapacityReservationInstanceViewWithName struct { 1059 // Name - READ-ONLY; The name of the capacity reservation. 1060 Name *string `json:"name,omitempty"` 1061 // UtilizationInfo - Unutilized capacity of the capacity reservation. 1062 UtilizationInfo *CapacityReservationUtilization `json:"utilizationInfo,omitempty"` 1063 // Statuses - The resource status information. 1064 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 1065} 1066 1067// MarshalJSON is the custom marshaler for CapacityReservationInstanceViewWithName. 1068func (crivwn CapacityReservationInstanceViewWithName) MarshalJSON() ([]byte, error) { 1069 objectMap := make(map[string]interface{}) 1070 if crivwn.UtilizationInfo != nil { 1071 objectMap["utilizationInfo"] = crivwn.UtilizationInfo 1072 } 1073 if crivwn.Statuses != nil { 1074 objectMap["statuses"] = crivwn.Statuses 1075 } 1076 return json.Marshal(objectMap) 1077} 1078 1079// CapacityReservationListResult the list capacity reservation operation response. 1080type CapacityReservationListResult struct { 1081 autorest.Response `json:"-"` 1082 // Value - The list of capacity reservations 1083 Value *[]CapacityReservation `json:"value,omitempty"` 1084 // NextLink - The URI to fetch the next page of capacity reservations. Call ListNext() with this URI to fetch the next page of capacity reservations. 1085 NextLink *string `json:"nextLink,omitempty"` 1086} 1087 1088// CapacityReservationListResultIterator provides access to a complete listing of CapacityReservation 1089// values. 1090type CapacityReservationListResultIterator struct { 1091 i int 1092 page CapacityReservationListResultPage 1093} 1094 1095// NextWithContext advances to the next value. If there was an error making 1096// the request the iterator does not advance and the error is returned. 1097func (iter *CapacityReservationListResultIterator) NextWithContext(ctx context.Context) (err error) { 1098 if tracing.IsEnabled() { 1099 ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationListResultIterator.NextWithContext") 1100 defer func() { 1101 sc := -1 1102 if iter.Response().Response.Response != nil { 1103 sc = iter.Response().Response.Response.StatusCode 1104 } 1105 tracing.EndSpan(ctx, sc, err) 1106 }() 1107 } 1108 iter.i++ 1109 if iter.i < len(iter.page.Values()) { 1110 return nil 1111 } 1112 err = iter.page.NextWithContext(ctx) 1113 if err != nil { 1114 iter.i-- 1115 return err 1116 } 1117 iter.i = 0 1118 return nil 1119} 1120 1121// Next advances to the next value. If there was an error making 1122// the request the iterator does not advance and the error is returned. 1123// Deprecated: Use NextWithContext() instead. 1124func (iter *CapacityReservationListResultIterator) Next() error { 1125 return iter.NextWithContext(context.Background()) 1126} 1127 1128// NotDone returns true if the enumeration should be started or is not yet complete. 1129func (iter CapacityReservationListResultIterator) NotDone() bool { 1130 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1131} 1132 1133// Response returns the raw server response from the last page request. 1134func (iter CapacityReservationListResultIterator) Response() CapacityReservationListResult { 1135 return iter.page.Response() 1136} 1137 1138// Value returns the current value or a zero-initialized value if the 1139// iterator has advanced beyond the end of the collection. 1140func (iter CapacityReservationListResultIterator) Value() CapacityReservation { 1141 if !iter.page.NotDone() { 1142 return CapacityReservation{} 1143 } 1144 return iter.page.Values()[iter.i] 1145} 1146 1147// Creates a new instance of the CapacityReservationListResultIterator type. 1148func NewCapacityReservationListResultIterator(page CapacityReservationListResultPage) CapacityReservationListResultIterator { 1149 return CapacityReservationListResultIterator{page: page} 1150} 1151 1152// IsEmpty returns true if the ListResult contains no values. 1153func (crlr CapacityReservationListResult) IsEmpty() bool { 1154 return crlr.Value == nil || len(*crlr.Value) == 0 1155} 1156 1157// hasNextLink returns true if the NextLink is not empty. 1158func (crlr CapacityReservationListResult) hasNextLink() bool { 1159 return crlr.NextLink != nil && len(*crlr.NextLink) != 0 1160} 1161 1162// capacityReservationListResultPreparer prepares a request to retrieve the next set of results. 1163// It returns nil if no more results exist. 1164func (crlr CapacityReservationListResult) capacityReservationListResultPreparer(ctx context.Context) (*http.Request, error) { 1165 if !crlr.hasNextLink() { 1166 return nil, nil 1167 } 1168 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1169 autorest.AsJSON(), 1170 autorest.AsGet(), 1171 autorest.WithBaseURL(to.String(crlr.NextLink))) 1172} 1173 1174// CapacityReservationListResultPage contains a page of CapacityReservation values. 1175type CapacityReservationListResultPage struct { 1176 fn func(context.Context, CapacityReservationListResult) (CapacityReservationListResult, error) 1177 crlr CapacityReservationListResult 1178} 1179 1180// NextWithContext advances to the next page of values. If there was an error making 1181// the request the page does not advance and the error is returned. 1182func (page *CapacityReservationListResultPage) NextWithContext(ctx context.Context) (err error) { 1183 if tracing.IsEnabled() { 1184 ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationListResultPage.NextWithContext") 1185 defer func() { 1186 sc := -1 1187 if page.Response().Response.Response != nil { 1188 sc = page.Response().Response.Response.StatusCode 1189 } 1190 tracing.EndSpan(ctx, sc, err) 1191 }() 1192 } 1193 for { 1194 next, err := page.fn(ctx, page.crlr) 1195 if err != nil { 1196 return err 1197 } 1198 page.crlr = next 1199 if !next.hasNextLink() || !next.IsEmpty() { 1200 break 1201 } 1202 } 1203 return nil 1204} 1205 1206// Next advances to the next page of values. If there was an error making 1207// the request the page does not advance and the error is returned. 1208// Deprecated: Use NextWithContext() instead. 1209func (page *CapacityReservationListResultPage) Next() error { 1210 return page.NextWithContext(context.Background()) 1211} 1212 1213// NotDone returns true if the page enumeration should be started or is not yet complete. 1214func (page CapacityReservationListResultPage) NotDone() bool { 1215 return !page.crlr.IsEmpty() 1216} 1217 1218// Response returns the raw server response from the last page request. 1219func (page CapacityReservationListResultPage) Response() CapacityReservationListResult { 1220 return page.crlr 1221} 1222 1223// Values returns the slice of values for the current page or nil if there are no values. 1224func (page CapacityReservationListResultPage) Values() []CapacityReservation { 1225 if page.crlr.IsEmpty() { 1226 return nil 1227 } 1228 return *page.crlr.Value 1229} 1230 1231// Creates a new instance of the CapacityReservationListResultPage type. 1232func NewCapacityReservationListResultPage(cur CapacityReservationListResult, getNextPage func(context.Context, CapacityReservationListResult) (CapacityReservationListResult, error)) CapacityReservationListResultPage { 1233 return CapacityReservationListResultPage{ 1234 fn: getNextPage, 1235 crlr: cur, 1236 } 1237} 1238 1239// CapacityReservationProfile the parameters of a capacity reservation Profile. 1240type CapacityReservationProfile struct { 1241 // CapacityReservationGroup - Specifies the capacity reservation group resource id that should be used for allocating the virtual machine or scaleset vm instances provided enough capacity has been reserved. Please refer to https://aka.ms/CapacityReservation for more details. 1242 CapacityReservationGroup *SubResource `json:"capacityReservationGroup,omitempty"` 1243} 1244 1245// CapacityReservationProperties properties of the Capacity reservation. 1246type CapacityReservationProperties struct { 1247 // ReservationID - READ-ONLY; A unique id generated and assigned to the capacity reservation by the platform which does not change throughout the lifetime of the resource. 1248 ReservationID *string `json:"reservationId,omitempty"` 1249 // VirtualMachinesAssociated - READ-ONLY; A list of all virtual machine resource ids that are associated with the capacity reservation. 1250 VirtualMachinesAssociated *[]SubResourceReadOnly `json:"virtualMachinesAssociated,omitempty"` 1251 // ProvisioningTime - READ-ONLY; The date time when the capacity reservation was last updated. 1252 ProvisioningTime *date.Time `json:"provisioningTime,omitempty"` 1253 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 1254 ProvisioningState *string `json:"provisioningState,omitempty"` 1255 // InstanceView - READ-ONLY; The Capacity reservation instance view. 1256 InstanceView *CapacityReservationInstanceView `json:"instanceView,omitempty"` 1257} 1258 1259// MarshalJSON is the custom marshaler for CapacityReservationProperties. 1260func (crp CapacityReservationProperties) MarshalJSON() ([]byte, error) { 1261 objectMap := make(map[string]interface{}) 1262 return json.Marshal(objectMap) 1263} 1264 1265// CapacityReservationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 1266// long-running operation. 1267type CapacityReservationsCreateOrUpdateFuture struct { 1268 azure.FutureAPI 1269 // Result returns the result of the asynchronous operation. 1270 // If the operation has not completed it will return an error. 1271 Result func(CapacityReservationsClient) (CapacityReservation, error) 1272} 1273 1274// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1275func (future *CapacityReservationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 1276 var azFuture azure.Future 1277 if err := json.Unmarshal(body, &azFuture); err != nil { 1278 return err 1279 } 1280 future.FutureAPI = &azFuture 1281 future.Result = future.result 1282 return nil 1283} 1284 1285// result is the default implementation for CapacityReservationsCreateOrUpdateFuture.Result. 1286func (future *CapacityReservationsCreateOrUpdateFuture) result(client CapacityReservationsClient) (cr CapacityReservation, err error) { 1287 var done bool 1288 done, err = future.DoneWithContext(context.Background(), client) 1289 if err != nil { 1290 err = autorest.NewErrorWithError(err, "compute.CapacityReservationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 1291 return 1292 } 1293 if !done { 1294 cr.Response.Response = future.Response() 1295 err = azure.NewAsyncOpIncompleteError("compute.CapacityReservationsCreateOrUpdateFuture") 1296 return 1297 } 1298 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1299 if cr.Response.Response, err = future.GetResult(sender); err == nil && cr.Response.Response.StatusCode != http.StatusNoContent { 1300 cr, err = client.CreateOrUpdateResponder(cr.Response.Response) 1301 if err != nil { 1302 err = autorest.NewErrorWithError(err, "compute.CapacityReservationsCreateOrUpdateFuture", "Result", cr.Response.Response, "Failure responding to request") 1303 } 1304 } 1305 return 1306} 1307 1308// CapacityReservationsDeleteFuture an abstraction for monitoring and retrieving the results of a 1309// long-running operation. 1310type CapacityReservationsDeleteFuture struct { 1311 azure.FutureAPI 1312 // Result returns the result of the asynchronous operation. 1313 // If the operation has not completed it will return an error. 1314 Result func(CapacityReservationsClient) (autorest.Response, error) 1315} 1316 1317// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1318func (future *CapacityReservationsDeleteFuture) UnmarshalJSON(body []byte) error { 1319 var azFuture azure.Future 1320 if err := json.Unmarshal(body, &azFuture); err != nil { 1321 return err 1322 } 1323 future.FutureAPI = &azFuture 1324 future.Result = future.result 1325 return nil 1326} 1327 1328// result is the default implementation for CapacityReservationsDeleteFuture.Result. 1329func (future *CapacityReservationsDeleteFuture) result(client CapacityReservationsClient) (ar autorest.Response, err error) { 1330 var done bool 1331 done, err = future.DoneWithContext(context.Background(), client) 1332 if err != nil { 1333 err = autorest.NewErrorWithError(err, "compute.CapacityReservationsDeleteFuture", "Result", future.Response(), "Polling failure") 1334 return 1335 } 1336 if !done { 1337 ar.Response = future.Response() 1338 err = azure.NewAsyncOpIncompleteError("compute.CapacityReservationsDeleteFuture") 1339 return 1340 } 1341 ar.Response = future.Response() 1342 return 1343} 1344 1345// CapacityReservationsUpdateFuture an abstraction for monitoring and retrieving the results of a 1346// long-running operation. 1347type CapacityReservationsUpdateFuture struct { 1348 azure.FutureAPI 1349 // Result returns the result of the asynchronous operation. 1350 // If the operation has not completed it will return an error. 1351 Result func(CapacityReservationsClient) (CapacityReservation, error) 1352} 1353 1354// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1355func (future *CapacityReservationsUpdateFuture) UnmarshalJSON(body []byte) error { 1356 var azFuture azure.Future 1357 if err := json.Unmarshal(body, &azFuture); err != nil { 1358 return err 1359 } 1360 future.FutureAPI = &azFuture 1361 future.Result = future.result 1362 return nil 1363} 1364 1365// result is the default implementation for CapacityReservationsUpdateFuture.Result. 1366func (future *CapacityReservationsUpdateFuture) result(client CapacityReservationsClient) (cr CapacityReservation, err error) { 1367 var done bool 1368 done, err = future.DoneWithContext(context.Background(), client) 1369 if err != nil { 1370 err = autorest.NewErrorWithError(err, "compute.CapacityReservationsUpdateFuture", "Result", future.Response(), "Polling failure") 1371 return 1372 } 1373 if !done { 1374 cr.Response.Response = future.Response() 1375 err = azure.NewAsyncOpIncompleteError("compute.CapacityReservationsUpdateFuture") 1376 return 1377 } 1378 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1379 if cr.Response.Response, err = future.GetResult(sender); err == nil && cr.Response.Response.StatusCode != http.StatusNoContent { 1380 cr, err = client.UpdateResponder(cr.Response.Response) 1381 if err != nil { 1382 err = autorest.NewErrorWithError(err, "compute.CapacityReservationsUpdateFuture", "Result", cr.Response.Response, "Failure responding to request") 1383 } 1384 } 1385 return 1386} 1387 1388// CapacityReservationUpdate specifies information about the capacity reservation. Only tags and 1389// sku.capacity can be updated. 1390type CapacityReservationUpdate struct { 1391 *CapacityReservationProperties `json:"properties,omitempty"` 1392 // Sku - SKU of the resource for which capacity needs be reserved. The SKU name and capacity is required to be set. Currently VM Skus with the capability called 'CapacityReservationSupported' set to true are supported. Refer to List Microsoft.Compute SKUs in a region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values. 1393 Sku *Sku `json:"sku,omitempty"` 1394 // Tags - Resource tags 1395 Tags map[string]*string `json:"tags"` 1396} 1397 1398// MarshalJSON is the custom marshaler for CapacityReservationUpdate. 1399func (cru CapacityReservationUpdate) MarshalJSON() ([]byte, error) { 1400 objectMap := make(map[string]interface{}) 1401 if cru.CapacityReservationProperties != nil { 1402 objectMap["properties"] = cru.CapacityReservationProperties 1403 } 1404 if cru.Sku != nil { 1405 objectMap["sku"] = cru.Sku 1406 } 1407 if cru.Tags != nil { 1408 objectMap["tags"] = cru.Tags 1409 } 1410 return json.Marshal(objectMap) 1411} 1412 1413// UnmarshalJSON is the custom unmarshaler for CapacityReservationUpdate struct. 1414func (cru *CapacityReservationUpdate) UnmarshalJSON(body []byte) error { 1415 var m map[string]*json.RawMessage 1416 err := json.Unmarshal(body, &m) 1417 if err != nil { 1418 return err 1419 } 1420 for k, v := range m { 1421 switch k { 1422 case "properties": 1423 if v != nil { 1424 var capacityReservationProperties CapacityReservationProperties 1425 err = json.Unmarshal(*v, &capacityReservationProperties) 1426 if err != nil { 1427 return err 1428 } 1429 cru.CapacityReservationProperties = &capacityReservationProperties 1430 } 1431 case "sku": 1432 if v != nil { 1433 var sku Sku 1434 err = json.Unmarshal(*v, &sku) 1435 if err != nil { 1436 return err 1437 } 1438 cru.Sku = &sku 1439 } 1440 case "tags": 1441 if v != nil { 1442 var tags map[string]*string 1443 err = json.Unmarshal(*v, &tags) 1444 if err != nil { 1445 return err 1446 } 1447 cru.Tags = tags 1448 } 1449 } 1450 } 1451 1452 return nil 1453} 1454 1455// CapacityReservationUtilization represents the capacity reservation utilization in terms of resources 1456// allocated. 1457type CapacityReservationUtilization struct { 1458 // VirtualMachinesAllocated - READ-ONLY; A list of all virtual machines resource ids allocated against the capacity reservation. 1459 VirtualMachinesAllocated *[]SubResourceReadOnly `json:"virtualMachinesAllocated,omitempty"` 1460} 1461 1462// MarshalJSON is the custom marshaler for CapacityReservationUtilization. 1463func (cru CapacityReservationUtilization) MarshalJSON() ([]byte, error) { 1464 objectMap := make(map[string]interface{}) 1465 return json.Marshal(objectMap) 1466} 1467 1468// CloudError an error response from the Compute service. 1469type CloudError struct { 1470 Error *APIError `json:"error,omitempty"` 1471} 1472 1473// CloudService describes the cloud service. 1474type CloudService struct { 1475 autorest.Response `json:"-"` 1476 // ID - READ-ONLY; Resource Id. 1477 ID *string `json:"id,omitempty"` 1478 // Name - READ-ONLY; Resource name. 1479 Name *string `json:"name,omitempty"` 1480 // Type - READ-ONLY; Resource type. 1481 Type *string `json:"type,omitempty"` 1482 // Location - Resource location. 1483 Location *string `json:"location,omitempty"` 1484 // Tags - Resource tags. 1485 Tags map[string]*string `json:"tags"` 1486 Properties *CloudServiceProperties `json:"properties,omitempty"` 1487} 1488 1489// MarshalJSON is the custom marshaler for CloudService. 1490func (cs CloudService) MarshalJSON() ([]byte, error) { 1491 objectMap := make(map[string]interface{}) 1492 if cs.Location != nil { 1493 objectMap["location"] = cs.Location 1494 } 1495 if cs.Tags != nil { 1496 objectMap["tags"] = cs.Tags 1497 } 1498 if cs.Properties != nil { 1499 objectMap["properties"] = cs.Properties 1500 } 1501 return json.Marshal(objectMap) 1502} 1503 1504// CloudServiceExtensionProfile describes a cloud service extension profile. 1505type CloudServiceExtensionProfile struct { 1506 // Extensions - List of extensions for the cloud service. 1507 Extensions *[]Extension `json:"extensions,omitempty"` 1508} 1509 1510// CloudServiceExtensionProperties extension Properties. 1511type CloudServiceExtensionProperties struct { 1512 // Publisher - The name of the extension handler publisher. 1513 Publisher *string `json:"publisher,omitempty"` 1514 // Type - Specifies the type of the extension. 1515 Type *string `json:"type,omitempty"` 1516 // 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. 1517 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 1518 // AutoUpgradeMinorVersion - Explicitly specify whether platform can automatically upgrade typeHandlerVersion to higher minor versions when they become available. 1519 AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` 1520 // 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. 1521 Settings *string `json:"settings,omitempty"` 1522 // ProtectedSettings - Protected settings for the extension which are encrypted before sent to the role instance. 1523 ProtectedSettings *string `json:"protectedSettings,omitempty"` 1524 ProtectedSettingsFromKeyVault *CloudServiceVaultAndSecretReference `json:"protectedSettingsFromKeyVault,omitempty"` 1525 // ForceUpdateTag - Tag to force apply the provided public and protected settings. 1526 // Changing the tag value allows for re-running the extension without changing any of the public or protected settings. 1527 // If forceUpdateTag is not changed, updates to public or protected settings would still be applied by the handler. 1528 // If neither forceUpdateTag nor any of public or protected settings change, extension would flow to the role instance with the same sequence-number, and 1529 // it is up to handler implementation whether to re-run it or not 1530 ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` 1531 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 1532 ProvisioningState *string `json:"provisioningState,omitempty"` 1533 // 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. 1534 RolesAppliedTo *[]string `json:"rolesAppliedTo,omitempty"` 1535} 1536 1537// MarshalJSON is the custom marshaler for CloudServiceExtensionProperties. 1538func (csep CloudServiceExtensionProperties) MarshalJSON() ([]byte, error) { 1539 objectMap := make(map[string]interface{}) 1540 if csep.Publisher != nil { 1541 objectMap["publisher"] = csep.Publisher 1542 } 1543 if csep.Type != nil { 1544 objectMap["type"] = csep.Type 1545 } 1546 if csep.TypeHandlerVersion != nil { 1547 objectMap["typeHandlerVersion"] = csep.TypeHandlerVersion 1548 } 1549 if csep.AutoUpgradeMinorVersion != nil { 1550 objectMap["autoUpgradeMinorVersion"] = csep.AutoUpgradeMinorVersion 1551 } 1552 if csep.Settings != nil { 1553 objectMap["settings"] = csep.Settings 1554 } 1555 if csep.ProtectedSettings != nil { 1556 objectMap["protectedSettings"] = csep.ProtectedSettings 1557 } 1558 if csep.ProtectedSettingsFromKeyVault != nil { 1559 objectMap["protectedSettingsFromKeyVault"] = csep.ProtectedSettingsFromKeyVault 1560 } 1561 if csep.ForceUpdateTag != nil { 1562 objectMap["forceUpdateTag"] = csep.ForceUpdateTag 1563 } 1564 if csep.RolesAppliedTo != nil { 1565 objectMap["rolesAppliedTo"] = csep.RolesAppliedTo 1566 } 1567 return json.Marshal(objectMap) 1568} 1569 1570// CloudServiceInstanceView instanceView of CloudService as a whole 1571type CloudServiceInstanceView struct { 1572 autorest.Response `json:"-"` 1573 RoleInstance *InstanceViewStatusesSummary `json:"roleInstance,omitempty"` 1574 // SdkVersion - READ-ONLY; The version of the SDK that was used to generate the package for the cloud service. 1575 SdkVersion *string `json:"sdkVersion,omitempty"` 1576 // 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. 1577 PrivateIds *[]string `json:"privateIds,omitempty"` 1578 // Statuses - READ-ONLY 1579 Statuses *[]ResourceInstanceViewStatus `json:"statuses,omitempty"` 1580} 1581 1582// MarshalJSON is the custom marshaler for CloudServiceInstanceView. 1583func (csiv CloudServiceInstanceView) MarshalJSON() ([]byte, error) { 1584 objectMap := make(map[string]interface{}) 1585 if csiv.RoleInstance != nil { 1586 objectMap["roleInstance"] = csiv.RoleInstance 1587 } 1588 return json.Marshal(objectMap) 1589} 1590 1591// CloudServiceListResult ... 1592type CloudServiceListResult struct { 1593 autorest.Response `json:"-"` 1594 Value *[]CloudService `json:"value,omitempty"` 1595 NextLink *string `json:"nextLink,omitempty"` 1596} 1597 1598// CloudServiceListResultIterator provides access to a complete listing of CloudService values. 1599type CloudServiceListResultIterator struct { 1600 i int 1601 page CloudServiceListResultPage 1602} 1603 1604// NextWithContext advances to the next value. If there was an error making 1605// the request the iterator does not advance and the error is returned. 1606func (iter *CloudServiceListResultIterator) NextWithContext(ctx context.Context) (err error) { 1607 if tracing.IsEnabled() { 1608 ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceListResultIterator.NextWithContext") 1609 defer func() { 1610 sc := -1 1611 if iter.Response().Response.Response != nil { 1612 sc = iter.Response().Response.Response.StatusCode 1613 } 1614 tracing.EndSpan(ctx, sc, err) 1615 }() 1616 } 1617 iter.i++ 1618 if iter.i < len(iter.page.Values()) { 1619 return nil 1620 } 1621 err = iter.page.NextWithContext(ctx) 1622 if err != nil { 1623 iter.i-- 1624 return err 1625 } 1626 iter.i = 0 1627 return nil 1628} 1629 1630// Next advances to the next value. If there was an error making 1631// the request the iterator does not advance and the error is returned. 1632// Deprecated: Use NextWithContext() instead. 1633func (iter *CloudServiceListResultIterator) Next() error { 1634 return iter.NextWithContext(context.Background()) 1635} 1636 1637// NotDone returns true if the enumeration should be started or is not yet complete. 1638func (iter CloudServiceListResultIterator) NotDone() bool { 1639 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1640} 1641 1642// Response returns the raw server response from the last page request. 1643func (iter CloudServiceListResultIterator) Response() CloudServiceListResult { 1644 return iter.page.Response() 1645} 1646 1647// Value returns the current value or a zero-initialized value if the 1648// iterator has advanced beyond the end of the collection. 1649func (iter CloudServiceListResultIterator) Value() CloudService { 1650 if !iter.page.NotDone() { 1651 return CloudService{} 1652 } 1653 return iter.page.Values()[iter.i] 1654} 1655 1656// Creates a new instance of the CloudServiceListResultIterator type. 1657func NewCloudServiceListResultIterator(page CloudServiceListResultPage) CloudServiceListResultIterator { 1658 return CloudServiceListResultIterator{page: page} 1659} 1660 1661// IsEmpty returns true if the ListResult contains no values. 1662func (cslr CloudServiceListResult) IsEmpty() bool { 1663 return cslr.Value == nil || len(*cslr.Value) == 0 1664} 1665 1666// hasNextLink returns true if the NextLink is not empty. 1667func (cslr CloudServiceListResult) hasNextLink() bool { 1668 return cslr.NextLink != nil && len(*cslr.NextLink) != 0 1669} 1670 1671// cloudServiceListResultPreparer prepares a request to retrieve the next set of results. 1672// It returns nil if no more results exist. 1673func (cslr CloudServiceListResult) cloudServiceListResultPreparer(ctx context.Context) (*http.Request, error) { 1674 if !cslr.hasNextLink() { 1675 return nil, nil 1676 } 1677 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1678 autorest.AsJSON(), 1679 autorest.AsGet(), 1680 autorest.WithBaseURL(to.String(cslr.NextLink))) 1681} 1682 1683// CloudServiceListResultPage contains a page of CloudService values. 1684type CloudServiceListResultPage struct { 1685 fn func(context.Context, CloudServiceListResult) (CloudServiceListResult, error) 1686 cslr CloudServiceListResult 1687} 1688 1689// NextWithContext advances to the next page of values. If there was an error making 1690// the request the page does not advance and the error is returned. 1691func (page *CloudServiceListResultPage) NextWithContext(ctx context.Context) (err error) { 1692 if tracing.IsEnabled() { 1693 ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceListResultPage.NextWithContext") 1694 defer func() { 1695 sc := -1 1696 if page.Response().Response.Response != nil { 1697 sc = page.Response().Response.Response.StatusCode 1698 } 1699 tracing.EndSpan(ctx, sc, err) 1700 }() 1701 } 1702 for { 1703 next, err := page.fn(ctx, page.cslr) 1704 if err != nil { 1705 return err 1706 } 1707 page.cslr = next 1708 if !next.hasNextLink() || !next.IsEmpty() { 1709 break 1710 } 1711 } 1712 return nil 1713} 1714 1715// Next advances to the next page of values. If there was an error making 1716// the request the page does not advance and the error is returned. 1717// Deprecated: Use NextWithContext() instead. 1718func (page *CloudServiceListResultPage) Next() error { 1719 return page.NextWithContext(context.Background()) 1720} 1721 1722// NotDone returns true if the page enumeration should be started or is not yet complete. 1723func (page CloudServiceListResultPage) NotDone() bool { 1724 return !page.cslr.IsEmpty() 1725} 1726 1727// Response returns the raw server response from the last page request. 1728func (page CloudServiceListResultPage) Response() CloudServiceListResult { 1729 return page.cslr 1730} 1731 1732// Values returns the slice of values for the current page or nil if there are no values. 1733func (page CloudServiceListResultPage) Values() []CloudService { 1734 if page.cslr.IsEmpty() { 1735 return nil 1736 } 1737 return *page.cslr.Value 1738} 1739 1740// Creates a new instance of the CloudServiceListResultPage type. 1741func NewCloudServiceListResultPage(cur CloudServiceListResult, getNextPage func(context.Context, CloudServiceListResult) (CloudServiceListResult, error)) CloudServiceListResultPage { 1742 return CloudServiceListResultPage{ 1743 fn: getNextPage, 1744 cslr: cur, 1745 } 1746} 1747 1748// CloudServiceNetworkProfile network Profile for the cloud service. 1749type CloudServiceNetworkProfile struct { 1750 // 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. 1751 LoadBalancerConfigurations *[]LoadBalancerConfiguration `json:"loadBalancerConfigurations,omitempty"` 1752 // 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. 1753 SwappableCloudService *SubResource `json:"swappableCloudService,omitempty"` 1754} 1755 1756// CloudServiceOsProfile describes the OS profile for the cloud service. 1757type CloudServiceOsProfile struct { 1758 // Secrets - Specifies set of certificates that should be installed onto the role instances. 1759 Secrets *[]CloudServiceVaultSecretGroup `json:"secrets,omitempty"` 1760} 1761 1762// CloudServiceProperties cloud service properties 1763type CloudServiceProperties struct { 1764 // 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. 1765 // This is a write-only property and is not returned in GET calls. 1766 PackageURL *string `json:"packageUrl,omitempty"` 1767 // Configuration - Specifies the XML service configuration (.cscfg) for the cloud service. 1768 Configuration *string `json:"configuration,omitempty"` 1769 // 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. 1770 // This is a write-only property and is not returned in GET calls. 1771 ConfigurationURL *string `json:"configurationUrl,omitempty"` 1772 // StartCloudService - (Optional) Indicates whether to start the cloud service immediately after it is created. The default value is `true`. 1773 // 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. 1774 StartCloudService *bool `json:"startCloudService,omitempty"` 1775 // 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. 1776 // The default value is `false`. 1777 AllowModelOverride *bool `json:"allowModelOverride,omitempty"` 1778 // UpgradeMode - Possible values include: 'CloudServiceUpgradeModeAuto', 'CloudServiceUpgradeModeManual', 'CloudServiceUpgradeModeSimultaneous' 1779 UpgradeMode CloudServiceUpgradeMode `json:"upgradeMode,omitempty"` 1780 RoleProfile *CloudServiceRoleProfile `json:"roleProfile,omitempty"` 1781 OsProfile *CloudServiceOsProfile `json:"osProfile,omitempty"` 1782 NetworkProfile *CloudServiceNetworkProfile `json:"networkProfile,omitempty"` 1783 ExtensionProfile *CloudServiceExtensionProfile `json:"extensionProfile,omitempty"` 1784 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 1785 ProvisioningState *string `json:"provisioningState,omitempty"` 1786 // UniqueID - READ-ONLY; The unique identifier for the cloud service. 1787 UniqueID *string `json:"uniqueId,omitempty"` 1788} 1789 1790// MarshalJSON is the custom marshaler for CloudServiceProperties. 1791func (csp CloudServiceProperties) MarshalJSON() ([]byte, error) { 1792 objectMap := make(map[string]interface{}) 1793 if csp.PackageURL != nil { 1794 objectMap["packageUrl"] = csp.PackageURL 1795 } 1796 if csp.Configuration != nil { 1797 objectMap["configuration"] = csp.Configuration 1798 } 1799 if csp.ConfigurationURL != nil { 1800 objectMap["configurationUrl"] = csp.ConfigurationURL 1801 } 1802 if csp.StartCloudService != nil { 1803 objectMap["startCloudService"] = csp.StartCloudService 1804 } 1805 if csp.AllowModelOverride != nil { 1806 objectMap["allowModelOverride"] = csp.AllowModelOverride 1807 } 1808 if csp.UpgradeMode != "" { 1809 objectMap["upgradeMode"] = csp.UpgradeMode 1810 } 1811 if csp.RoleProfile != nil { 1812 objectMap["roleProfile"] = csp.RoleProfile 1813 } 1814 if csp.OsProfile != nil { 1815 objectMap["osProfile"] = csp.OsProfile 1816 } 1817 if csp.NetworkProfile != nil { 1818 objectMap["networkProfile"] = csp.NetworkProfile 1819 } 1820 if csp.ExtensionProfile != nil { 1821 objectMap["extensionProfile"] = csp.ExtensionProfile 1822 } 1823 return json.Marshal(objectMap) 1824} 1825 1826// CloudServiceRole describes a role of the cloud service. 1827type CloudServiceRole struct { 1828 autorest.Response `json:"-"` 1829 // ID - READ-ONLY; Resource id 1830 ID *string `json:"id,omitempty"` 1831 // Name - READ-ONLY; Resource name 1832 Name *string `json:"name,omitempty"` 1833 // Type - READ-ONLY; Resource type 1834 Type *string `json:"type,omitempty"` 1835 // Location - READ-ONLY; Resource location 1836 Location *string `json:"location,omitempty"` 1837 Sku *CloudServiceRoleSku `json:"sku,omitempty"` 1838 Properties *CloudServiceRoleProperties `json:"properties,omitempty"` 1839} 1840 1841// MarshalJSON is the custom marshaler for CloudServiceRole. 1842func (csr CloudServiceRole) MarshalJSON() ([]byte, error) { 1843 objectMap := make(map[string]interface{}) 1844 if csr.Sku != nil { 1845 objectMap["sku"] = csr.Sku 1846 } 1847 if csr.Properties != nil { 1848 objectMap["properties"] = csr.Properties 1849 } 1850 return json.Marshal(objectMap) 1851} 1852 1853// CloudServiceRoleInstancesDeleteFuture an abstraction for monitoring and retrieving the results of a 1854// long-running operation. 1855type CloudServiceRoleInstancesDeleteFuture struct { 1856 azure.FutureAPI 1857 // Result returns the result of the asynchronous operation. 1858 // If the operation has not completed it will return an error. 1859 Result func(CloudServiceRoleInstancesClient) (autorest.Response, error) 1860} 1861 1862// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1863func (future *CloudServiceRoleInstancesDeleteFuture) UnmarshalJSON(body []byte) error { 1864 var azFuture azure.Future 1865 if err := json.Unmarshal(body, &azFuture); err != nil { 1866 return err 1867 } 1868 future.FutureAPI = &azFuture 1869 future.Result = future.result 1870 return nil 1871} 1872 1873// result is the default implementation for CloudServiceRoleInstancesDeleteFuture.Result. 1874func (future *CloudServiceRoleInstancesDeleteFuture) result(client CloudServiceRoleInstancesClient) (ar autorest.Response, err error) { 1875 var done bool 1876 done, err = future.DoneWithContext(context.Background(), client) 1877 if err != nil { 1878 err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesDeleteFuture", "Result", future.Response(), "Polling failure") 1879 return 1880 } 1881 if !done { 1882 ar.Response = future.Response() 1883 err = azure.NewAsyncOpIncompleteError("compute.CloudServiceRoleInstancesDeleteFuture") 1884 return 1885 } 1886 ar.Response = future.Response() 1887 return 1888} 1889 1890// CloudServiceRoleInstancesRebuildFuture an abstraction for monitoring and retrieving the results of a 1891// long-running operation. 1892type CloudServiceRoleInstancesRebuildFuture struct { 1893 azure.FutureAPI 1894 // Result returns the result of the asynchronous operation. 1895 // If the operation has not completed it will return an error. 1896 Result func(CloudServiceRoleInstancesClient) (autorest.Response, error) 1897} 1898 1899// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1900func (future *CloudServiceRoleInstancesRebuildFuture) UnmarshalJSON(body []byte) error { 1901 var azFuture azure.Future 1902 if err := json.Unmarshal(body, &azFuture); err != nil { 1903 return err 1904 } 1905 future.FutureAPI = &azFuture 1906 future.Result = future.result 1907 return nil 1908} 1909 1910// result is the default implementation for CloudServiceRoleInstancesRebuildFuture.Result. 1911func (future *CloudServiceRoleInstancesRebuildFuture) result(client CloudServiceRoleInstancesClient) (ar autorest.Response, err error) { 1912 var done bool 1913 done, err = future.DoneWithContext(context.Background(), client) 1914 if err != nil { 1915 err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesRebuildFuture", "Result", future.Response(), "Polling failure") 1916 return 1917 } 1918 if !done { 1919 ar.Response = future.Response() 1920 err = azure.NewAsyncOpIncompleteError("compute.CloudServiceRoleInstancesRebuildFuture") 1921 return 1922 } 1923 ar.Response = future.Response() 1924 return 1925} 1926 1927// CloudServiceRoleInstancesReimageFuture an abstraction for monitoring and retrieving the results of a 1928// long-running operation. 1929type CloudServiceRoleInstancesReimageFuture struct { 1930 azure.FutureAPI 1931 // Result returns the result of the asynchronous operation. 1932 // If the operation has not completed it will return an error. 1933 Result func(CloudServiceRoleInstancesClient) (autorest.Response, error) 1934} 1935 1936// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1937func (future *CloudServiceRoleInstancesReimageFuture) UnmarshalJSON(body []byte) error { 1938 var azFuture azure.Future 1939 if err := json.Unmarshal(body, &azFuture); err != nil { 1940 return err 1941 } 1942 future.FutureAPI = &azFuture 1943 future.Result = future.result 1944 return nil 1945} 1946 1947// result is the default implementation for CloudServiceRoleInstancesReimageFuture.Result. 1948func (future *CloudServiceRoleInstancesReimageFuture) result(client CloudServiceRoleInstancesClient) (ar autorest.Response, err error) { 1949 var done bool 1950 done, err = future.DoneWithContext(context.Background(), client) 1951 if err != nil { 1952 err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesReimageFuture", "Result", future.Response(), "Polling failure") 1953 return 1954 } 1955 if !done { 1956 ar.Response = future.Response() 1957 err = azure.NewAsyncOpIncompleteError("compute.CloudServiceRoleInstancesReimageFuture") 1958 return 1959 } 1960 ar.Response = future.Response() 1961 return 1962} 1963 1964// CloudServiceRoleInstancesRestartFuture an abstraction for monitoring and retrieving the results of a 1965// long-running operation. 1966type CloudServiceRoleInstancesRestartFuture struct { 1967 azure.FutureAPI 1968 // Result returns the result of the asynchronous operation. 1969 // If the operation has not completed it will return an error. 1970 Result func(CloudServiceRoleInstancesClient) (autorest.Response, error) 1971} 1972 1973// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1974func (future *CloudServiceRoleInstancesRestartFuture) UnmarshalJSON(body []byte) error { 1975 var azFuture azure.Future 1976 if err := json.Unmarshal(body, &azFuture); err != nil { 1977 return err 1978 } 1979 future.FutureAPI = &azFuture 1980 future.Result = future.result 1981 return nil 1982} 1983 1984// result is the default implementation for CloudServiceRoleInstancesRestartFuture.Result. 1985func (future *CloudServiceRoleInstancesRestartFuture) result(client CloudServiceRoleInstancesClient) (ar autorest.Response, err error) { 1986 var done bool 1987 done, err = future.DoneWithContext(context.Background(), client) 1988 if err != nil { 1989 err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesRestartFuture", "Result", future.Response(), "Polling failure") 1990 return 1991 } 1992 if !done { 1993 ar.Response = future.Response() 1994 err = azure.NewAsyncOpIncompleteError("compute.CloudServiceRoleInstancesRestartFuture") 1995 return 1996 } 1997 ar.Response = future.Response() 1998 return 1999} 2000 2001// CloudServiceRoleListResult ... 2002type CloudServiceRoleListResult struct { 2003 autorest.Response `json:"-"` 2004 Value *[]CloudServiceRole `json:"value,omitempty"` 2005 NextLink *string `json:"nextLink,omitempty"` 2006} 2007 2008// CloudServiceRoleListResultIterator provides access to a complete listing of CloudServiceRole values. 2009type CloudServiceRoleListResultIterator struct { 2010 i int 2011 page CloudServiceRoleListResultPage 2012} 2013 2014// NextWithContext advances to the next value. If there was an error making 2015// the request the iterator does not advance and the error is returned. 2016func (iter *CloudServiceRoleListResultIterator) NextWithContext(ctx context.Context) (err error) { 2017 if tracing.IsEnabled() { 2018 ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleListResultIterator.NextWithContext") 2019 defer func() { 2020 sc := -1 2021 if iter.Response().Response.Response != nil { 2022 sc = iter.Response().Response.Response.StatusCode 2023 } 2024 tracing.EndSpan(ctx, sc, err) 2025 }() 2026 } 2027 iter.i++ 2028 if iter.i < len(iter.page.Values()) { 2029 return nil 2030 } 2031 err = iter.page.NextWithContext(ctx) 2032 if err != nil { 2033 iter.i-- 2034 return err 2035 } 2036 iter.i = 0 2037 return nil 2038} 2039 2040// Next advances to the next value. If there was an error making 2041// the request the iterator does not advance and the error is returned. 2042// Deprecated: Use NextWithContext() instead. 2043func (iter *CloudServiceRoleListResultIterator) Next() error { 2044 return iter.NextWithContext(context.Background()) 2045} 2046 2047// NotDone returns true if the enumeration should be started or is not yet complete. 2048func (iter CloudServiceRoleListResultIterator) NotDone() bool { 2049 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2050} 2051 2052// Response returns the raw server response from the last page request. 2053func (iter CloudServiceRoleListResultIterator) Response() CloudServiceRoleListResult { 2054 return iter.page.Response() 2055} 2056 2057// Value returns the current value or a zero-initialized value if the 2058// iterator has advanced beyond the end of the collection. 2059func (iter CloudServiceRoleListResultIterator) Value() CloudServiceRole { 2060 if !iter.page.NotDone() { 2061 return CloudServiceRole{} 2062 } 2063 return iter.page.Values()[iter.i] 2064} 2065 2066// Creates a new instance of the CloudServiceRoleListResultIterator type. 2067func NewCloudServiceRoleListResultIterator(page CloudServiceRoleListResultPage) CloudServiceRoleListResultIterator { 2068 return CloudServiceRoleListResultIterator{page: page} 2069} 2070 2071// IsEmpty returns true if the ListResult contains no values. 2072func (csrlr CloudServiceRoleListResult) IsEmpty() bool { 2073 return csrlr.Value == nil || len(*csrlr.Value) == 0 2074} 2075 2076// hasNextLink returns true if the NextLink is not empty. 2077func (csrlr CloudServiceRoleListResult) hasNextLink() bool { 2078 return csrlr.NextLink != nil && len(*csrlr.NextLink) != 0 2079} 2080 2081// cloudServiceRoleListResultPreparer prepares a request to retrieve the next set of results. 2082// It returns nil if no more results exist. 2083func (csrlr CloudServiceRoleListResult) cloudServiceRoleListResultPreparer(ctx context.Context) (*http.Request, error) { 2084 if !csrlr.hasNextLink() { 2085 return nil, nil 2086 } 2087 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2088 autorest.AsJSON(), 2089 autorest.AsGet(), 2090 autorest.WithBaseURL(to.String(csrlr.NextLink))) 2091} 2092 2093// CloudServiceRoleListResultPage contains a page of CloudServiceRole values. 2094type CloudServiceRoleListResultPage struct { 2095 fn func(context.Context, CloudServiceRoleListResult) (CloudServiceRoleListResult, error) 2096 csrlr CloudServiceRoleListResult 2097} 2098 2099// NextWithContext advances to the next page of values. If there was an error making 2100// the request the page does not advance and the error is returned. 2101func (page *CloudServiceRoleListResultPage) NextWithContext(ctx context.Context) (err error) { 2102 if tracing.IsEnabled() { 2103 ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleListResultPage.NextWithContext") 2104 defer func() { 2105 sc := -1 2106 if page.Response().Response.Response != nil { 2107 sc = page.Response().Response.Response.StatusCode 2108 } 2109 tracing.EndSpan(ctx, sc, err) 2110 }() 2111 } 2112 for { 2113 next, err := page.fn(ctx, page.csrlr) 2114 if err != nil { 2115 return err 2116 } 2117 page.csrlr = next 2118 if !next.hasNextLink() || !next.IsEmpty() { 2119 break 2120 } 2121 } 2122 return nil 2123} 2124 2125// Next advances to the next page of values. If there was an error making 2126// the request the page does not advance and the error is returned. 2127// Deprecated: Use NextWithContext() instead. 2128func (page *CloudServiceRoleListResultPage) Next() error { 2129 return page.NextWithContext(context.Background()) 2130} 2131 2132// NotDone returns true if the page enumeration should be started or is not yet complete. 2133func (page CloudServiceRoleListResultPage) NotDone() bool { 2134 return !page.csrlr.IsEmpty() 2135} 2136 2137// Response returns the raw server response from the last page request. 2138func (page CloudServiceRoleListResultPage) Response() CloudServiceRoleListResult { 2139 return page.csrlr 2140} 2141 2142// Values returns the slice of values for the current page or nil if there are no values. 2143func (page CloudServiceRoleListResultPage) Values() []CloudServiceRole { 2144 if page.csrlr.IsEmpty() { 2145 return nil 2146 } 2147 return *page.csrlr.Value 2148} 2149 2150// Creates a new instance of the CloudServiceRoleListResultPage type. 2151func NewCloudServiceRoleListResultPage(cur CloudServiceRoleListResult, getNextPage func(context.Context, CloudServiceRoleListResult) (CloudServiceRoleListResult, error)) CloudServiceRoleListResultPage { 2152 return CloudServiceRoleListResultPage{ 2153 fn: getNextPage, 2154 csrlr: cur, 2155 } 2156} 2157 2158// CloudServiceRoleProfile describes the role profile for the cloud service. 2159type CloudServiceRoleProfile struct { 2160 // Roles - List of roles for the cloud service. 2161 Roles *[]CloudServiceRoleProfileProperties `json:"roles,omitempty"` 2162} 2163 2164// CloudServiceRoleProfileProperties describes the role properties. 2165type CloudServiceRoleProfileProperties struct { 2166 // Name - Resource name. 2167 Name *string `json:"name,omitempty"` 2168 Sku *CloudServiceRoleSku `json:"sku,omitempty"` 2169} 2170 2171// CloudServiceRoleProperties ... 2172type CloudServiceRoleProperties struct { 2173 // UniqueID - READ-ONLY; Specifies the ID which uniquely identifies a cloud service role. 2174 UniqueID *string `json:"uniqueId,omitempty"` 2175} 2176 2177// MarshalJSON is the custom marshaler for CloudServiceRoleProperties. 2178func (csrp CloudServiceRoleProperties) MarshalJSON() ([]byte, error) { 2179 objectMap := make(map[string]interface{}) 2180 return json.Marshal(objectMap) 2181} 2182 2183// CloudServiceRoleSku describes the cloud service role sku. 2184type CloudServiceRoleSku struct { 2185 // 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. 2186 Name *string `json:"name,omitempty"` 2187 // Tier - Specifies the tier of the cloud service. Possible Values are <br /><br /> **Standard** <br /><br /> **Basic** 2188 Tier *string `json:"tier,omitempty"` 2189 // Capacity - Specifies the number of role instances in the cloud service. 2190 Capacity *int64 `json:"capacity,omitempty"` 2191} 2192 2193// CloudServicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 2194// long-running operation. 2195type CloudServicesCreateOrUpdateFuture struct { 2196 azure.FutureAPI 2197 // Result returns the result of the asynchronous operation. 2198 // If the operation has not completed it will return an error. 2199 Result func(CloudServicesClient) (CloudService, error) 2200} 2201 2202// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2203func (future *CloudServicesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 2204 var azFuture azure.Future 2205 if err := json.Unmarshal(body, &azFuture); err != nil { 2206 return err 2207 } 2208 future.FutureAPI = &azFuture 2209 future.Result = future.result 2210 return nil 2211} 2212 2213// result is the default implementation for CloudServicesCreateOrUpdateFuture.Result. 2214func (future *CloudServicesCreateOrUpdateFuture) result(client CloudServicesClient) (cs CloudService, err error) { 2215 var done bool 2216 done, err = future.DoneWithContext(context.Background(), client) 2217 if err != nil { 2218 err = autorest.NewErrorWithError(err, "compute.CloudServicesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 2219 return 2220 } 2221 if !done { 2222 cs.Response.Response = future.Response() 2223 err = azure.NewAsyncOpIncompleteError("compute.CloudServicesCreateOrUpdateFuture") 2224 return 2225 } 2226 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2227 if cs.Response.Response, err = future.GetResult(sender); err == nil && cs.Response.Response.StatusCode != http.StatusNoContent { 2228 cs, err = client.CreateOrUpdateResponder(cs.Response.Response) 2229 if err != nil { 2230 err = autorest.NewErrorWithError(err, "compute.CloudServicesCreateOrUpdateFuture", "Result", cs.Response.Response, "Failure responding to request") 2231 } 2232 } 2233 return 2234} 2235 2236// CloudServicesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 2237// operation. 2238type CloudServicesDeleteFuture struct { 2239 azure.FutureAPI 2240 // Result returns the result of the asynchronous operation. 2241 // If the operation has not completed it will return an error. 2242 Result func(CloudServicesClient) (autorest.Response, error) 2243} 2244 2245// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2246func (future *CloudServicesDeleteFuture) UnmarshalJSON(body []byte) error { 2247 var azFuture azure.Future 2248 if err := json.Unmarshal(body, &azFuture); err != nil { 2249 return err 2250 } 2251 future.FutureAPI = &azFuture 2252 future.Result = future.result 2253 return nil 2254} 2255 2256// result is the default implementation for CloudServicesDeleteFuture.Result. 2257func (future *CloudServicesDeleteFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { 2258 var done bool 2259 done, err = future.DoneWithContext(context.Background(), client) 2260 if err != nil { 2261 err = autorest.NewErrorWithError(err, "compute.CloudServicesDeleteFuture", "Result", future.Response(), "Polling failure") 2262 return 2263 } 2264 if !done { 2265 ar.Response = future.Response() 2266 err = azure.NewAsyncOpIncompleteError("compute.CloudServicesDeleteFuture") 2267 return 2268 } 2269 ar.Response = future.Response() 2270 return 2271} 2272 2273// CloudServicesDeleteInstancesFuture an abstraction for monitoring and retrieving the results of a 2274// long-running operation. 2275type CloudServicesDeleteInstancesFuture struct { 2276 azure.FutureAPI 2277 // Result returns the result of the asynchronous operation. 2278 // If the operation has not completed it will return an error. 2279 Result func(CloudServicesClient) (autorest.Response, error) 2280} 2281 2282// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2283func (future *CloudServicesDeleteInstancesFuture) UnmarshalJSON(body []byte) error { 2284 var azFuture azure.Future 2285 if err := json.Unmarshal(body, &azFuture); err != nil { 2286 return err 2287 } 2288 future.FutureAPI = &azFuture 2289 future.Result = future.result 2290 return nil 2291} 2292 2293// result is the default implementation for CloudServicesDeleteInstancesFuture.Result. 2294func (future *CloudServicesDeleteInstancesFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { 2295 var done bool 2296 done, err = future.DoneWithContext(context.Background(), client) 2297 if err != nil { 2298 err = autorest.NewErrorWithError(err, "compute.CloudServicesDeleteInstancesFuture", "Result", future.Response(), "Polling failure") 2299 return 2300 } 2301 if !done { 2302 ar.Response = future.Response() 2303 err = azure.NewAsyncOpIncompleteError("compute.CloudServicesDeleteInstancesFuture") 2304 return 2305 } 2306 ar.Response = future.Response() 2307 return 2308} 2309 2310// CloudServicesPowerOffFuture an abstraction for monitoring and retrieving the results of a long-running 2311// operation. 2312type CloudServicesPowerOffFuture struct { 2313 azure.FutureAPI 2314 // Result returns the result of the asynchronous operation. 2315 // If the operation has not completed it will return an error. 2316 Result func(CloudServicesClient) (autorest.Response, error) 2317} 2318 2319// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2320func (future *CloudServicesPowerOffFuture) UnmarshalJSON(body []byte) error { 2321 var azFuture azure.Future 2322 if err := json.Unmarshal(body, &azFuture); err != nil { 2323 return err 2324 } 2325 future.FutureAPI = &azFuture 2326 future.Result = future.result 2327 return nil 2328} 2329 2330// result is the default implementation for CloudServicesPowerOffFuture.Result. 2331func (future *CloudServicesPowerOffFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { 2332 var done bool 2333 done, err = future.DoneWithContext(context.Background(), client) 2334 if err != nil { 2335 err = autorest.NewErrorWithError(err, "compute.CloudServicesPowerOffFuture", "Result", future.Response(), "Polling failure") 2336 return 2337 } 2338 if !done { 2339 ar.Response = future.Response() 2340 err = azure.NewAsyncOpIncompleteError("compute.CloudServicesPowerOffFuture") 2341 return 2342 } 2343 ar.Response = future.Response() 2344 return 2345} 2346 2347// CloudServicesRebuildFuture an abstraction for monitoring and retrieving the results of a long-running 2348// operation. 2349type CloudServicesRebuildFuture struct { 2350 azure.FutureAPI 2351 // Result returns the result of the asynchronous operation. 2352 // If the operation has not completed it will return an error. 2353 Result func(CloudServicesClient) (autorest.Response, error) 2354} 2355 2356// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2357func (future *CloudServicesRebuildFuture) UnmarshalJSON(body []byte) error { 2358 var azFuture azure.Future 2359 if err := json.Unmarshal(body, &azFuture); err != nil { 2360 return err 2361 } 2362 future.FutureAPI = &azFuture 2363 future.Result = future.result 2364 return nil 2365} 2366 2367// result is the default implementation for CloudServicesRebuildFuture.Result. 2368func (future *CloudServicesRebuildFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { 2369 var done bool 2370 done, err = future.DoneWithContext(context.Background(), client) 2371 if err != nil { 2372 err = autorest.NewErrorWithError(err, "compute.CloudServicesRebuildFuture", "Result", future.Response(), "Polling failure") 2373 return 2374 } 2375 if !done { 2376 ar.Response = future.Response() 2377 err = azure.NewAsyncOpIncompleteError("compute.CloudServicesRebuildFuture") 2378 return 2379 } 2380 ar.Response = future.Response() 2381 return 2382} 2383 2384// CloudServicesReimageFuture an abstraction for monitoring and retrieving the results of a long-running 2385// operation. 2386type CloudServicesReimageFuture struct { 2387 azure.FutureAPI 2388 // Result returns the result of the asynchronous operation. 2389 // If the operation has not completed it will return an error. 2390 Result func(CloudServicesClient) (autorest.Response, error) 2391} 2392 2393// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2394func (future *CloudServicesReimageFuture) UnmarshalJSON(body []byte) error { 2395 var azFuture azure.Future 2396 if err := json.Unmarshal(body, &azFuture); err != nil { 2397 return err 2398 } 2399 future.FutureAPI = &azFuture 2400 future.Result = future.result 2401 return nil 2402} 2403 2404// result is the default implementation for CloudServicesReimageFuture.Result. 2405func (future *CloudServicesReimageFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { 2406 var done bool 2407 done, err = future.DoneWithContext(context.Background(), client) 2408 if err != nil { 2409 err = autorest.NewErrorWithError(err, "compute.CloudServicesReimageFuture", "Result", future.Response(), "Polling failure") 2410 return 2411 } 2412 if !done { 2413 ar.Response = future.Response() 2414 err = azure.NewAsyncOpIncompleteError("compute.CloudServicesReimageFuture") 2415 return 2416 } 2417 ar.Response = future.Response() 2418 return 2419} 2420 2421// CloudServicesRestartFuture an abstraction for monitoring and retrieving the results of a long-running 2422// operation. 2423type CloudServicesRestartFuture struct { 2424 azure.FutureAPI 2425 // Result returns the result of the asynchronous operation. 2426 // If the operation has not completed it will return an error. 2427 Result func(CloudServicesClient) (autorest.Response, error) 2428} 2429 2430// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2431func (future *CloudServicesRestartFuture) UnmarshalJSON(body []byte) error { 2432 var azFuture azure.Future 2433 if err := json.Unmarshal(body, &azFuture); err != nil { 2434 return err 2435 } 2436 future.FutureAPI = &azFuture 2437 future.Result = future.result 2438 return nil 2439} 2440 2441// result is the default implementation for CloudServicesRestartFuture.Result. 2442func (future *CloudServicesRestartFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { 2443 var done bool 2444 done, err = future.DoneWithContext(context.Background(), client) 2445 if err != nil { 2446 err = autorest.NewErrorWithError(err, "compute.CloudServicesRestartFuture", "Result", future.Response(), "Polling failure") 2447 return 2448 } 2449 if !done { 2450 ar.Response = future.Response() 2451 err = azure.NewAsyncOpIncompleteError("compute.CloudServicesRestartFuture") 2452 return 2453 } 2454 ar.Response = future.Response() 2455 return 2456} 2457 2458// CloudServicesStartFuture an abstraction for monitoring and retrieving the results of a long-running 2459// operation. 2460type CloudServicesStartFuture struct { 2461 azure.FutureAPI 2462 // Result returns the result of the asynchronous operation. 2463 // If the operation has not completed it will return an error. 2464 Result func(CloudServicesClient) (autorest.Response, error) 2465} 2466 2467// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2468func (future *CloudServicesStartFuture) UnmarshalJSON(body []byte) error { 2469 var azFuture azure.Future 2470 if err := json.Unmarshal(body, &azFuture); err != nil { 2471 return err 2472 } 2473 future.FutureAPI = &azFuture 2474 future.Result = future.result 2475 return nil 2476} 2477 2478// result is the default implementation for CloudServicesStartFuture.Result. 2479func (future *CloudServicesStartFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { 2480 var done bool 2481 done, err = future.DoneWithContext(context.Background(), client) 2482 if err != nil { 2483 err = autorest.NewErrorWithError(err, "compute.CloudServicesStartFuture", "Result", future.Response(), "Polling failure") 2484 return 2485 } 2486 if !done { 2487 ar.Response = future.Response() 2488 err = azure.NewAsyncOpIncompleteError("compute.CloudServicesStartFuture") 2489 return 2490 } 2491 ar.Response = future.Response() 2492 return 2493} 2494 2495// CloudServicesUpdateDomainWalkUpdateDomainFuture an abstraction for monitoring and retrieving the results 2496// of a long-running operation. 2497type CloudServicesUpdateDomainWalkUpdateDomainFuture struct { 2498 azure.FutureAPI 2499 // Result returns the result of the asynchronous operation. 2500 // If the operation has not completed it will return an error. 2501 Result func(CloudServicesUpdateDomainClient) (autorest.Response, error) 2502} 2503 2504// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2505func (future *CloudServicesUpdateDomainWalkUpdateDomainFuture) UnmarshalJSON(body []byte) error { 2506 var azFuture azure.Future 2507 if err := json.Unmarshal(body, &azFuture); err != nil { 2508 return err 2509 } 2510 future.FutureAPI = &azFuture 2511 future.Result = future.result 2512 return nil 2513} 2514 2515// result is the default implementation for CloudServicesUpdateDomainWalkUpdateDomainFuture.Result. 2516func (future *CloudServicesUpdateDomainWalkUpdateDomainFuture) result(client CloudServicesUpdateDomainClient) (ar autorest.Response, err error) { 2517 var done bool 2518 done, err = future.DoneWithContext(context.Background(), client) 2519 if err != nil { 2520 err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateDomainWalkUpdateDomainFuture", "Result", future.Response(), "Polling failure") 2521 return 2522 } 2523 if !done { 2524 ar.Response = future.Response() 2525 err = azure.NewAsyncOpIncompleteError("compute.CloudServicesUpdateDomainWalkUpdateDomainFuture") 2526 return 2527 } 2528 ar.Response = future.Response() 2529 return 2530} 2531 2532// CloudServicesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 2533// operation. 2534type CloudServicesUpdateFuture struct { 2535 azure.FutureAPI 2536 // Result returns the result of the asynchronous operation. 2537 // If the operation has not completed it will return an error. 2538 Result func(CloudServicesClient) (CloudService, error) 2539} 2540 2541// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2542func (future *CloudServicesUpdateFuture) UnmarshalJSON(body []byte) error { 2543 var azFuture azure.Future 2544 if err := json.Unmarshal(body, &azFuture); err != nil { 2545 return err 2546 } 2547 future.FutureAPI = &azFuture 2548 future.Result = future.result 2549 return nil 2550} 2551 2552// result is the default implementation for CloudServicesUpdateFuture.Result. 2553func (future *CloudServicesUpdateFuture) result(client CloudServicesClient) (cs CloudService, err error) { 2554 var done bool 2555 done, err = future.DoneWithContext(context.Background(), client) 2556 if err != nil { 2557 err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateFuture", "Result", future.Response(), "Polling failure") 2558 return 2559 } 2560 if !done { 2561 cs.Response.Response = future.Response() 2562 err = azure.NewAsyncOpIncompleteError("compute.CloudServicesUpdateFuture") 2563 return 2564 } 2565 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2566 if cs.Response.Response, err = future.GetResult(sender); err == nil && cs.Response.Response.StatusCode != http.StatusNoContent { 2567 cs, err = client.UpdateResponder(cs.Response.Response) 2568 if err != nil { 2569 err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateFuture", "Result", cs.Response.Response, "Failure responding to request") 2570 } 2571 } 2572 return 2573} 2574 2575// CloudServiceUpdate ... 2576type CloudServiceUpdate struct { 2577 // Tags - Resource tags 2578 Tags map[string]*string `json:"tags"` 2579} 2580 2581// MarshalJSON is the custom marshaler for CloudServiceUpdate. 2582func (csu CloudServiceUpdate) MarshalJSON() ([]byte, error) { 2583 objectMap := make(map[string]interface{}) 2584 if csu.Tags != nil { 2585 objectMap["tags"] = csu.Tags 2586 } 2587 return json.Marshal(objectMap) 2588} 2589 2590// CloudServiceVaultAndSecretReference ... 2591type CloudServiceVaultAndSecretReference struct { 2592 SourceVault *SubResource `json:"sourceVault,omitempty"` 2593 SecretURL *string `json:"secretUrl,omitempty"` 2594} 2595 2596// CloudServiceVaultCertificate describes a single certificate reference in a Key Vault, and where the 2597// certificate should reside on the role instance. 2598type CloudServiceVaultCertificate struct { 2599 // CertificateURL - This is the URL of a certificate that has been uploaded to Key Vault as a secret. 2600 CertificateURL *string `json:"certificateUrl,omitempty"` 2601} 2602 2603// CloudServiceVaultSecretGroup describes a set of certificates which are all in the same Key Vault. 2604type CloudServiceVaultSecretGroup struct { 2605 // SourceVault - The relative URL of the Key Vault containing all of the certificates in VaultCertificates. 2606 SourceVault *SubResource `json:"sourceVault,omitempty"` 2607 // VaultCertificates - The list of key vault references in SourceVault which contain certificates. 2608 VaultCertificates *[]CloudServiceVaultCertificate `json:"vaultCertificates,omitempty"` 2609} 2610 2611// CreationData data used when creating a disk. 2612type CreationData struct { 2613 // CreateOption - This enumerates the possible sources of a disk's creation. Possible values include: 'DiskCreateOptionEmpty', 'DiskCreateOptionAttach', 'DiskCreateOptionFromImage', 'DiskCreateOptionImport', 'DiskCreateOptionCopy', 'DiskCreateOptionRestore', 'DiskCreateOptionUpload' 2614 CreateOption DiskCreateOption `json:"createOption,omitempty"` 2615 // StorageAccountID - Required if createOption is Import. The Azure Resource Manager identifier of the storage account containing the blob to import as a disk. 2616 StorageAccountID *string `json:"storageAccountId,omitempty"` 2617 // ImageReference - Disk source information. 2618 ImageReference *ImageDiskReference `json:"imageReference,omitempty"` 2619 // 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. 2620 GalleryImageReference *ImageDiskReference `json:"galleryImageReference,omitempty"` 2621 // SourceURI - If createOption is Import, this is the URI of a blob to be imported into a managed disk. 2622 SourceURI *string `json:"sourceUri,omitempty"` 2623 // SourceResourceID - If createOption is Copy, this is the ARM id of the source snapshot or disk. 2624 SourceResourceID *string `json:"sourceResourceId,omitempty"` 2625 // SourceUniqueID - READ-ONLY; If this field is set, this is the unique id identifying the source of this resource. 2626 SourceUniqueID *string `json:"sourceUniqueId,omitempty"` 2627 // 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). 2628 UploadSizeBytes *int64 `json:"uploadSizeBytes,omitempty"` 2629 // LogicalSectorSize - Logical sector size in bytes for Ultra disks. Supported values are 512 ad 4096. 4096 is the default. 2630 LogicalSectorSize *int32 `json:"logicalSectorSize,omitempty"` 2631} 2632 2633// MarshalJSON is the custom marshaler for CreationData. 2634func (cd CreationData) MarshalJSON() ([]byte, error) { 2635 objectMap := make(map[string]interface{}) 2636 if cd.CreateOption != "" { 2637 objectMap["createOption"] = cd.CreateOption 2638 } 2639 if cd.StorageAccountID != nil { 2640 objectMap["storageAccountId"] = cd.StorageAccountID 2641 } 2642 if cd.ImageReference != nil { 2643 objectMap["imageReference"] = cd.ImageReference 2644 } 2645 if cd.GalleryImageReference != nil { 2646 objectMap["galleryImageReference"] = cd.GalleryImageReference 2647 } 2648 if cd.SourceURI != nil { 2649 objectMap["sourceUri"] = cd.SourceURI 2650 } 2651 if cd.SourceResourceID != nil { 2652 objectMap["sourceResourceId"] = cd.SourceResourceID 2653 } 2654 if cd.UploadSizeBytes != nil { 2655 objectMap["uploadSizeBytes"] = cd.UploadSizeBytes 2656 } 2657 if cd.LogicalSectorSize != nil { 2658 objectMap["logicalSectorSize"] = cd.LogicalSectorSize 2659 } 2660 return json.Marshal(objectMap) 2661} 2662 2663// DataDisk describes a data disk. 2664type DataDisk struct { 2665 // 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. 2666 Lun *int32 `json:"lun,omitempty"` 2667 // Name - The disk name. 2668 Name *string `json:"name,omitempty"` 2669 // Vhd - The virtual hard disk. 2670 Vhd *VirtualHardDisk `json:"vhd,omitempty"` 2671 // 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. 2672 Image *VirtualHardDisk `json:"image,omitempty"` 2673 // 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' 2674 Caching CachingTypes `json:"caching,omitempty"` 2675 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 2676 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 2677 // 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' 2678 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 2679 // 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 2680 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 2681 // ManagedDisk - The managed disk parameters. 2682 ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` 2683 // ToBeDetached - Specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset 2684 ToBeDetached *bool `json:"toBeDetached,omitempty"` 2685 // 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. 2686 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 2687 // 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. 2688 DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` 2689 // 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' 2690 DetachOption DiskDetachOptionTypes `json:"detachOption,omitempty"` 2691 // 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' 2692 DeleteOption DiskDeleteOptionTypes `json:"deleteOption,omitempty"` 2693} 2694 2695// MarshalJSON is the custom marshaler for DataDisk. 2696func (dd DataDisk) MarshalJSON() ([]byte, error) { 2697 objectMap := make(map[string]interface{}) 2698 if dd.Lun != nil { 2699 objectMap["lun"] = dd.Lun 2700 } 2701 if dd.Name != nil { 2702 objectMap["name"] = dd.Name 2703 } 2704 if dd.Vhd != nil { 2705 objectMap["vhd"] = dd.Vhd 2706 } 2707 if dd.Image != nil { 2708 objectMap["image"] = dd.Image 2709 } 2710 if dd.Caching != "" { 2711 objectMap["caching"] = dd.Caching 2712 } 2713 if dd.WriteAcceleratorEnabled != nil { 2714 objectMap["writeAcceleratorEnabled"] = dd.WriteAcceleratorEnabled 2715 } 2716 if dd.CreateOption != "" { 2717 objectMap["createOption"] = dd.CreateOption 2718 } 2719 if dd.DiskSizeGB != nil { 2720 objectMap["diskSizeGB"] = dd.DiskSizeGB 2721 } 2722 if dd.ManagedDisk != nil { 2723 objectMap["managedDisk"] = dd.ManagedDisk 2724 } 2725 if dd.ToBeDetached != nil { 2726 objectMap["toBeDetached"] = dd.ToBeDetached 2727 } 2728 if dd.DetachOption != "" { 2729 objectMap["detachOption"] = dd.DetachOption 2730 } 2731 if dd.DeleteOption != "" { 2732 objectMap["deleteOption"] = dd.DeleteOption 2733 } 2734 return json.Marshal(objectMap) 2735} 2736 2737// DataDiskImage contains the data disk images information. 2738type DataDiskImage struct { 2739 // 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. 2740 Lun *int32 `json:"lun,omitempty"` 2741} 2742 2743// MarshalJSON is the custom marshaler for DataDiskImage. 2744func (ddi DataDiskImage) MarshalJSON() ([]byte, error) { 2745 objectMap := make(map[string]interface{}) 2746 return json.Marshal(objectMap) 2747} 2748 2749// DataDiskImageEncryption contains encryption settings for a data disk image. 2750type DataDiskImageEncryption struct { 2751 // 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. 2752 Lun *int32 `json:"lun,omitempty"` 2753 // DiskEncryptionSetID - A relative URI containing the resource ID of the disk encryption set. 2754 DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` 2755} 2756 2757// DedicatedHost specifies information about the Dedicated host. 2758type DedicatedHost struct { 2759 autorest.Response `json:"-"` 2760 *DedicatedHostProperties `json:"properties,omitempty"` 2761 // 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. 2762 Sku *Sku `json:"sku,omitempty"` 2763 // ID - READ-ONLY; Resource Id 2764 ID *string `json:"id,omitempty"` 2765 // Name - READ-ONLY; Resource name 2766 Name *string `json:"name,omitempty"` 2767 // Type - READ-ONLY; Resource type 2768 Type *string `json:"type,omitempty"` 2769 // Location - Resource location 2770 Location *string `json:"location,omitempty"` 2771 // Tags - Resource tags 2772 Tags map[string]*string `json:"tags"` 2773} 2774 2775// MarshalJSON is the custom marshaler for DedicatedHost. 2776func (dh DedicatedHost) MarshalJSON() ([]byte, error) { 2777 objectMap := make(map[string]interface{}) 2778 if dh.DedicatedHostProperties != nil { 2779 objectMap["properties"] = dh.DedicatedHostProperties 2780 } 2781 if dh.Sku != nil { 2782 objectMap["sku"] = dh.Sku 2783 } 2784 if dh.Location != nil { 2785 objectMap["location"] = dh.Location 2786 } 2787 if dh.Tags != nil { 2788 objectMap["tags"] = dh.Tags 2789 } 2790 return json.Marshal(objectMap) 2791} 2792 2793// UnmarshalJSON is the custom unmarshaler for DedicatedHost struct. 2794func (dh *DedicatedHost) UnmarshalJSON(body []byte) error { 2795 var m map[string]*json.RawMessage 2796 err := json.Unmarshal(body, &m) 2797 if err != nil { 2798 return err 2799 } 2800 for k, v := range m { 2801 switch k { 2802 case "properties": 2803 if v != nil { 2804 var dedicatedHostProperties DedicatedHostProperties 2805 err = json.Unmarshal(*v, &dedicatedHostProperties) 2806 if err != nil { 2807 return err 2808 } 2809 dh.DedicatedHostProperties = &dedicatedHostProperties 2810 } 2811 case "sku": 2812 if v != nil { 2813 var sku Sku 2814 err = json.Unmarshal(*v, &sku) 2815 if err != nil { 2816 return err 2817 } 2818 dh.Sku = &sku 2819 } 2820 case "id": 2821 if v != nil { 2822 var ID string 2823 err = json.Unmarshal(*v, &ID) 2824 if err != nil { 2825 return err 2826 } 2827 dh.ID = &ID 2828 } 2829 case "name": 2830 if v != nil { 2831 var name string 2832 err = json.Unmarshal(*v, &name) 2833 if err != nil { 2834 return err 2835 } 2836 dh.Name = &name 2837 } 2838 case "type": 2839 if v != nil { 2840 var typeVar string 2841 err = json.Unmarshal(*v, &typeVar) 2842 if err != nil { 2843 return err 2844 } 2845 dh.Type = &typeVar 2846 } 2847 case "location": 2848 if v != nil { 2849 var location string 2850 err = json.Unmarshal(*v, &location) 2851 if err != nil { 2852 return err 2853 } 2854 dh.Location = &location 2855 } 2856 case "tags": 2857 if v != nil { 2858 var tags map[string]*string 2859 err = json.Unmarshal(*v, &tags) 2860 if err != nil { 2861 return err 2862 } 2863 dh.Tags = tags 2864 } 2865 } 2866 } 2867 2868 return nil 2869} 2870 2871// DedicatedHostAllocatableVM represents the dedicated host unutilized capacity in terms of a specific VM 2872// size. 2873type DedicatedHostAllocatableVM struct { 2874 // VMSize - VM size in terms of which the unutilized capacity is represented. 2875 VMSize *string `json:"vmSize,omitempty"` 2876 // Count - Maximum number of VMs of size vmSize that can fit in the dedicated host's remaining capacity. 2877 Count *float64 `json:"count,omitempty"` 2878} 2879 2880// DedicatedHostAvailableCapacity dedicated host unutilized capacity. 2881type DedicatedHostAvailableCapacity struct { 2882 // 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. 2883 AllocatableVMs *[]DedicatedHostAllocatableVM `json:"allocatableVMs,omitempty"` 2884} 2885 2886// DedicatedHostGroup specifies information about the dedicated host group that the dedicated hosts should 2887// be assigned to. <br><br> Currently, a dedicated host can only be added to a dedicated host group at 2888// creation time. An existing dedicated host cannot be added to another dedicated host group. 2889type DedicatedHostGroup struct { 2890 autorest.Response `json:"-"` 2891 *DedicatedHostGroupProperties `json:"properties,omitempty"` 2892 // 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. 2893 Zones *[]string `json:"zones,omitempty"` 2894 // ID - READ-ONLY; Resource Id 2895 ID *string `json:"id,omitempty"` 2896 // Name - READ-ONLY; Resource name 2897 Name *string `json:"name,omitempty"` 2898 // Type - READ-ONLY; Resource type 2899 Type *string `json:"type,omitempty"` 2900 // Location - Resource location 2901 Location *string `json:"location,omitempty"` 2902 // Tags - Resource tags 2903 Tags map[string]*string `json:"tags"` 2904} 2905 2906// MarshalJSON is the custom marshaler for DedicatedHostGroup. 2907func (dhg DedicatedHostGroup) MarshalJSON() ([]byte, error) { 2908 objectMap := make(map[string]interface{}) 2909 if dhg.DedicatedHostGroupProperties != nil { 2910 objectMap["properties"] = dhg.DedicatedHostGroupProperties 2911 } 2912 if dhg.Zones != nil { 2913 objectMap["zones"] = dhg.Zones 2914 } 2915 if dhg.Location != nil { 2916 objectMap["location"] = dhg.Location 2917 } 2918 if dhg.Tags != nil { 2919 objectMap["tags"] = dhg.Tags 2920 } 2921 return json.Marshal(objectMap) 2922} 2923 2924// UnmarshalJSON is the custom unmarshaler for DedicatedHostGroup struct. 2925func (dhg *DedicatedHostGroup) UnmarshalJSON(body []byte) error { 2926 var m map[string]*json.RawMessage 2927 err := json.Unmarshal(body, &m) 2928 if err != nil { 2929 return err 2930 } 2931 for k, v := range m { 2932 switch k { 2933 case "properties": 2934 if v != nil { 2935 var dedicatedHostGroupProperties DedicatedHostGroupProperties 2936 err = json.Unmarshal(*v, &dedicatedHostGroupProperties) 2937 if err != nil { 2938 return err 2939 } 2940 dhg.DedicatedHostGroupProperties = &dedicatedHostGroupProperties 2941 } 2942 case "zones": 2943 if v != nil { 2944 var zones []string 2945 err = json.Unmarshal(*v, &zones) 2946 if err != nil { 2947 return err 2948 } 2949 dhg.Zones = &zones 2950 } 2951 case "id": 2952 if v != nil { 2953 var ID string 2954 err = json.Unmarshal(*v, &ID) 2955 if err != nil { 2956 return err 2957 } 2958 dhg.ID = &ID 2959 } 2960 case "name": 2961 if v != nil { 2962 var name string 2963 err = json.Unmarshal(*v, &name) 2964 if err != nil { 2965 return err 2966 } 2967 dhg.Name = &name 2968 } 2969 case "type": 2970 if v != nil { 2971 var typeVar string 2972 err = json.Unmarshal(*v, &typeVar) 2973 if err != nil { 2974 return err 2975 } 2976 dhg.Type = &typeVar 2977 } 2978 case "location": 2979 if v != nil { 2980 var location string 2981 err = json.Unmarshal(*v, &location) 2982 if err != nil { 2983 return err 2984 } 2985 dhg.Location = &location 2986 } 2987 case "tags": 2988 if v != nil { 2989 var tags map[string]*string 2990 err = json.Unmarshal(*v, &tags) 2991 if err != nil { 2992 return err 2993 } 2994 dhg.Tags = tags 2995 } 2996 } 2997 } 2998 2999 return nil 3000} 3001 3002// DedicatedHostGroupInstanceView ... 3003type DedicatedHostGroupInstanceView struct { 3004 // Hosts - List of instance view of the dedicated hosts under the dedicated host group. 3005 Hosts *[]DedicatedHostInstanceViewWithName `json:"hosts,omitempty"` 3006} 3007 3008// DedicatedHostGroupListResult the List Dedicated Host Group with resource group response. 3009type DedicatedHostGroupListResult struct { 3010 autorest.Response `json:"-"` 3011 // Value - The list of dedicated host groups 3012 Value *[]DedicatedHostGroup `json:"value,omitempty"` 3013 // 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. 3014 NextLink *string `json:"nextLink,omitempty"` 3015} 3016 3017// DedicatedHostGroupListResultIterator provides access to a complete listing of DedicatedHostGroup values. 3018type DedicatedHostGroupListResultIterator struct { 3019 i int 3020 page DedicatedHostGroupListResultPage 3021} 3022 3023// NextWithContext advances to the next value. If there was an error making 3024// the request the iterator does not advance and the error is returned. 3025func (iter *DedicatedHostGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { 3026 if tracing.IsEnabled() { 3027 ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupListResultIterator.NextWithContext") 3028 defer func() { 3029 sc := -1 3030 if iter.Response().Response.Response != nil { 3031 sc = iter.Response().Response.Response.StatusCode 3032 } 3033 tracing.EndSpan(ctx, sc, err) 3034 }() 3035 } 3036 iter.i++ 3037 if iter.i < len(iter.page.Values()) { 3038 return nil 3039 } 3040 err = iter.page.NextWithContext(ctx) 3041 if err != nil { 3042 iter.i-- 3043 return err 3044 } 3045 iter.i = 0 3046 return nil 3047} 3048 3049// Next advances to the next value. If there was an error making 3050// the request the iterator does not advance and the error is returned. 3051// Deprecated: Use NextWithContext() instead. 3052func (iter *DedicatedHostGroupListResultIterator) Next() error { 3053 return iter.NextWithContext(context.Background()) 3054} 3055 3056// NotDone returns true if the enumeration should be started or is not yet complete. 3057func (iter DedicatedHostGroupListResultIterator) NotDone() bool { 3058 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3059} 3060 3061// Response returns the raw server response from the last page request. 3062func (iter DedicatedHostGroupListResultIterator) Response() DedicatedHostGroupListResult { 3063 return iter.page.Response() 3064} 3065 3066// Value returns the current value or a zero-initialized value if the 3067// iterator has advanced beyond the end of the collection. 3068func (iter DedicatedHostGroupListResultIterator) Value() DedicatedHostGroup { 3069 if !iter.page.NotDone() { 3070 return DedicatedHostGroup{} 3071 } 3072 return iter.page.Values()[iter.i] 3073} 3074 3075// Creates a new instance of the DedicatedHostGroupListResultIterator type. 3076func NewDedicatedHostGroupListResultIterator(page DedicatedHostGroupListResultPage) DedicatedHostGroupListResultIterator { 3077 return DedicatedHostGroupListResultIterator{page: page} 3078} 3079 3080// IsEmpty returns true if the ListResult contains no values. 3081func (dhglr DedicatedHostGroupListResult) IsEmpty() bool { 3082 return dhglr.Value == nil || len(*dhglr.Value) == 0 3083} 3084 3085// hasNextLink returns true if the NextLink is not empty. 3086func (dhglr DedicatedHostGroupListResult) hasNextLink() bool { 3087 return dhglr.NextLink != nil && len(*dhglr.NextLink) != 0 3088} 3089 3090// dedicatedHostGroupListResultPreparer prepares a request to retrieve the next set of results. 3091// It returns nil if no more results exist. 3092func (dhglr DedicatedHostGroupListResult) dedicatedHostGroupListResultPreparer(ctx context.Context) (*http.Request, error) { 3093 if !dhglr.hasNextLink() { 3094 return nil, nil 3095 } 3096 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3097 autorest.AsJSON(), 3098 autorest.AsGet(), 3099 autorest.WithBaseURL(to.String(dhglr.NextLink))) 3100} 3101 3102// DedicatedHostGroupListResultPage contains a page of DedicatedHostGroup values. 3103type DedicatedHostGroupListResultPage struct { 3104 fn func(context.Context, DedicatedHostGroupListResult) (DedicatedHostGroupListResult, error) 3105 dhglr DedicatedHostGroupListResult 3106} 3107 3108// NextWithContext advances to the next page of values. If there was an error making 3109// the request the page does not advance and the error is returned. 3110func (page *DedicatedHostGroupListResultPage) NextWithContext(ctx context.Context) (err error) { 3111 if tracing.IsEnabled() { 3112 ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupListResultPage.NextWithContext") 3113 defer func() { 3114 sc := -1 3115 if page.Response().Response.Response != nil { 3116 sc = page.Response().Response.Response.StatusCode 3117 } 3118 tracing.EndSpan(ctx, sc, err) 3119 }() 3120 } 3121 for { 3122 next, err := page.fn(ctx, page.dhglr) 3123 if err != nil { 3124 return err 3125 } 3126 page.dhglr = next 3127 if !next.hasNextLink() || !next.IsEmpty() { 3128 break 3129 } 3130 } 3131 return nil 3132} 3133 3134// Next advances to the next page of values. If there was an error making 3135// the request the page does not advance and the error is returned. 3136// Deprecated: Use NextWithContext() instead. 3137func (page *DedicatedHostGroupListResultPage) Next() error { 3138 return page.NextWithContext(context.Background()) 3139} 3140 3141// NotDone returns true if the page enumeration should be started or is not yet complete. 3142func (page DedicatedHostGroupListResultPage) NotDone() bool { 3143 return !page.dhglr.IsEmpty() 3144} 3145 3146// Response returns the raw server response from the last page request. 3147func (page DedicatedHostGroupListResultPage) Response() DedicatedHostGroupListResult { 3148 return page.dhglr 3149} 3150 3151// Values returns the slice of values for the current page or nil if there are no values. 3152func (page DedicatedHostGroupListResultPage) Values() []DedicatedHostGroup { 3153 if page.dhglr.IsEmpty() { 3154 return nil 3155 } 3156 return *page.dhglr.Value 3157} 3158 3159// Creates a new instance of the DedicatedHostGroupListResultPage type. 3160func NewDedicatedHostGroupListResultPage(cur DedicatedHostGroupListResult, getNextPage func(context.Context, DedicatedHostGroupListResult) (DedicatedHostGroupListResult, error)) DedicatedHostGroupListResultPage { 3161 return DedicatedHostGroupListResultPage{ 3162 fn: getNextPage, 3163 dhglr: cur, 3164 } 3165} 3166 3167// DedicatedHostGroupProperties dedicated Host Group Properties. 3168type DedicatedHostGroupProperties struct { 3169 // PlatformFaultDomainCount - Number of fault domains that the host group can span. 3170 PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` 3171 // Hosts - READ-ONLY; A list of references to all dedicated hosts in the dedicated host group. 3172 Hosts *[]SubResourceReadOnly `json:"hosts,omitempty"` 3173 // 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. 3174 InstanceView *DedicatedHostGroupInstanceView `json:"instanceView,omitempty"` 3175 // 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. 3176 SupportAutomaticPlacement *bool `json:"supportAutomaticPlacement,omitempty"` 3177} 3178 3179// MarshalJSON is the custom marshaler for DedicatedHostGroupProperties. 3180func (dhgp DedicatedHostGroupProperties) MarshalJSON() ([]byte, error) { 3181 objectMap := make(map[string]interface{}) 3182 if dhgp.PlatformFaultDomainCount != nil { 3183 objectMap["platformFaultDomainCount"] = dhgp.PlatformFaultDomainCount 3184 } 3185 if dhgp.SupportAutomaticPlacement != nil { 3186 objectMap["supportAutomaticPlacement"] = dhgp.SupportAutomaticPlacement 3187 } 3188 return json.Marshal(objectMap) 3189} 3190 3191// DedicatedHostGroupUpdate specifies information about the dedicated host group that the dedicated host 3192// should be assigned to. Only tags may be updated. 3193type DedicatedHostGroupUpdate struct { 3194 *DedicatedHostGroupProperties `json:"properties,omitempty"` 3195 // 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. 3196 Zones *[]string `json:"zones,omitempty"` 3197 // Tags - Resource tags 3198 Tags map[string]*string `json:"tags"` 3199} 3200 3201// MarshalJSON is the custom marshaler for DedicatedHostGroupUpdate. 3202func (dhgu DedicatedHostGroupUpdate) MarshalJSON() ([]byte, error) { 3203 objectMap := make(map[string]interface{}) 3204 if dhgu.DedicatedHostGroupProperties != nil { 3205 objectMap["properties"] = dhgu.DedicatedHostGroupProperties 3206 } 3207 if dhgu.Zones != nil { 3208 objectMap["zones"] = dhgu.Zones 3209 } 3210 if dhgu.Tags != nil { 3211 objectMap["tags"] = dhgu.Tags 3212 } 3213 return json.Marshal(objectMap) 3214} 3215 3216// UnmarshalJSON is the custom unmarshaler for DedicatedHostGroupUpdate struct. 3217func (dhgu *DedicatedHostGroupUpdate) UnmarshalJSON(body []byte) error { 3218 var m map[string]*json.RawMessage 3219 err := json.Unmarshal(body, &m) 3220 if err != nil { 3221 return err 3222 } 3223 for k, v := range m { 3224 switch k { 3225 case "properties": 3226 if v != nil { 3227 var dedicatedHostGroupProperties DedicatedHostGroupProperties 3228 err = json.Unmarshal(*v, &dedicatedHostGroupProperties) 3229 if err != nil { 3230 return err 3231 } 3232 dhgu.DedicatedHostGroupProperties = &dedicatedHostGroupProperties 3233 } 3234 case "zones": 3235 if v != nil { 3236 var zones []string 3237 err = json.Unmarshal(*v, &zones) 3238 if err != nil { 3239 return err 3240 } 3241 dhgu.Zones = &zones 3242 } 3243 case "tags": 3244 if v != nil { 3245 var tags map[string]*string 3246 err = json.Unmarshal(*v, &tags) 3247 if err != nil { 3248 return err 3249 } 3250 dhgu.Tags = tags 3251 } 3252 } 3253 } 3254 3255 return nil 3256} 3257 3258// DedicatedHostInstanceView the instance view of a dedicated host. 3259type DedicatedHostInstanceView struct { 3260 // AssetID - READ-ONLY; Specifies the unique id of the dedicated physical machine on which the dedicated host resides. 3261 AssetID *string `json:"assetId,omitempty"` 3262 // AvailableCapacity - Unutilized capacity of the dedicated host. 3263 AvailableCapacity *DedicatedHostAvailableCapacity `json:"availableCapacity,omitempty"` 3264 // Statuses - The resource status information. 3265 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 3266} 3267 3268// MarshalJSON is the custom marshaler for DedicatedHostInstanceView. 3269func (dhiv DedicatedHostInstanceView) MarshalJSON() ([]byte, error) { 3270 objectMap := make(map[string]interface{}) 3271 if dhiv.AvailableCapacity != nil { 3272 objectMap["availableCapacity"] = dhiv.AvailableCapacity 3273 } 3274 if dhiv.Statuses != nil { 3275 objectMap["statuses"] = dhiv.Statuses 3276 } 3277 return json.Marshal(objectMap) 3278} 3279 3280// DedicatedHostInstanceViewWithName the instance view of a dedicated host that includes the name of the 3281// dedicated host. It is used for the response to the instance view of a dedicated host group. 3282type DedicatedHostInstanceViewWithName struct { 3283 // Name - READ-ONLY; The name of the dedicated host. 3284 Name *string `json:"name,omitempty"` 3285 // AssetID - READ-ONLY; Specifies the unique id of the dedicated physical machine on which the dedicated host resides. 3286 AssetID *string `json:"assetId,omitempty"` 3287 // AvailableCapacity - Unutilized capacity of the dedicated host. 3288 AvailableCapacity *DedicatedHostAvailableCapacity `json:"availableCapacity,omitempty"` 3289 // Statuses - The resource status information. 3290 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 3291} 3292 3293// MarshalJSON is the custom marshaler for DedicatedHostInstanceViewWithName. 3294func (dhivwn DedicatedHostInstanceViewWithName) MarshalJSON() ([]byte, error) { 3295 objectMap := make(map[string]interface{}) 3296 if dhivwn.AvailableCapacity != nil { 3297 objectMap["availableCapacity"] = dhivwn.AvailableCapacity 3298 } 3299 if dhivwn.Statuses != nil { 3300 objectMap["statuses"] = dhivwn.Statuses 3301 } 3302 return json.Marshal(objectMap) 3303} 3304 3305// DedicatedHostListResult the list dedicated host operation response. 3306type DedicatedHostListResult struct { 3307 autorest.Response `json:"-"` 3308 // Value - The list of dedicated hosts 3309 Value *[]DedicatedHost `json:"value,omitempty"` 3310 // NextLink - The URI to fetch the next page of dedicated hosts. Call ListNext() with this URI to fetch the next page of dedicated hosts. 3311 NextLink *string `json:"nextLink,omitempty"` 3312} 3313 3314// DedicatedHostListResultIterator provides access to a complete listing of DedicatedHost values. 3315type DedicatedHostListResultIterator struct { 3316 i int 3317 page DedicatedHostListResultPage 3318} 3319 3320// NextWithContext advances to the next value. If there was an error making 3321// the request the iterator does not advance and the error is returned. 3322func (iter *DedicatedHostListResultIterator) NextWithContext(ctx context.Context) (err error) { 3323 if tracing.IsEnabled() { 3324 ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostListResultIterator.NextWithContext") 3325 defer func() { 3326 sc := -1 3327 if iter.Response().Response.Response != nil { 3328 sc = iter.Response().Response.Response.StatusCode 3329 } 3330 tracing.EndSpan(ctx, sc, err) 3331 }() 3332 } 3333 iter.i++ 3334 if iter.i < len(iter.page.Values()) { 3335 return nil 3336 } 3337 err = iter.page.NextWithContext(ctx) 3338 if err != nil { 3339 iter.i-- 3340 return err 3341 } 3342 iter.i = 0 3343 return nil 3344} 3345 3346// Next advances to the next value. If there was an error making 3347// the request the iterator does not advance and the error is returned. 3348// Deprecated: Use NextWithContext() instead. 3349func (iter *DedicatedHostListResultIterator) Next() error { 3350 return iter.NextWithContext(context.Background()) 3351} 3352 3353// NotDone returns true if the enumeration should be started or is not yet complete. 3354func (iter DedicatedHostListResultIterator) NotDone() bool { 3355 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3356} 3357 3358// Response returns the raw server response from the last page request. 3359func (iter DedicatedHostListResultIterator) Response() DedicatedHostListResult { 3360 return iter.page.Response() 3361} 3362 3363// Value returns the current value or a zero-initialized value if the 3364// iterator has advanced beyond the end of the collection. 3365func (iter DedicatedHostListResultIterator) Value() DedicatedHost { 3366 if !iter.page.NotDone() { 3367 return DedicatedHost{} 3368 } 3369 return iter.page.Values()[iter.i] 3370} 3371 3372// Creates a new instance of the DedicatedHostListResultIterator type. 3373func NewDedicatedHostListResultIterator(page DedicatedHostListResultPage) DedicatedHostListResultIterator { 3374 return DedicatedHostListResultIterator{page: page} 3375} 3376 3377// IsEmpty returns true if the ListResult contains no values. 3378func (dhlr DedicatedHostListResult) IsEmpty() bool { 3379 return dhlr.Value == nil || len(*dhlr.Value) == 0 3380} 3381 3382// hasNextLink returns true if the NextLink is not empty. 3383func (dhlr DedicatedHostListResult) hasNextLink() bool { 3384 return dhlr.NextLink != nil && len(*dhlr.NextLink) != 0 3385} 3386 3387// dedicatedHostListResultPreparer prepares a request to retrieve the next set of results. 3388// It returns nil if no more results exist. 3389func (dhlr DedicatedHostListResult) dedicatedHostListResultPreparer(ctx context.Context) (*http.Request, error) { 3390 if !dhlr.hasNextLink() { 3391 return nil, nil 3392 } 3393 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3394 autorest.AsJSON(), 3395 autorest.AsGet(), 3396 autorest.WithBaseURL(to.String(dhlr.NextLink))) 3397} 3398 3399// DedicatedHostListResultPage contains a page of DedicatedHost values. 3400type DedicatedHostListResultPage struct { 3401 fn func(context.Context, DedicatedHostListResult) (DedicatedHostListResult, error) 3402 dhlr DedicatedHostListResult 3403} 3404 3405// NextWithContext advances to the next page of values. If there was an error making 3406// the request the page does not advance and the error is returned. 3407func (page *DedicatedHostListResultPage) NextWithContext(ctx context.Context) (err error) { 3408 if tracing.IsEnabled() { 3409 ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostListResultPage.NextWithContext") 3410 defer func() { 3411 sc := -1 3412 if page.Response().Response.Response != nil { 3413 sc = page.Response().Response.Response.StatusCode 3414 } 3415 tracing.EndSpan(ctx, sc, err) 3416 }() 3417 } 3418 for { 3419 next, err := page.fn(ctx, page.dhlr) 3420 if err != nil { 3421 return err 3422 } 3423 page.dhlr = next 3424 if !next.hasNextLink() || !next.IsEmpty() { 3425 break 3426 } 3427 } 3428 return nil 3429} 3430 3431// Next advances to the next page of values. If there was an error making 3432// the request the page does not advance and the error is returned. 3433// Deprecated: Use NextWithContext() instead. 3434func (page *DedicatedHostListResultPage) Next() error { 3435 return page.NextWithContext(context.Background()) 3436} 3437 3438// NotDone returns true if the page enumeration should be started or is not yet complete. 3439func (page DedicatedHostListResultPage) NotDone() bool { 3440 return !page.dhlr.IsEmpty() 3441} 3442 3443// Response returns the raw server response from the last page request. 3444func (page DedicatedHostListResultPage) Response() DedicatedHostListResult { 3445 return page.dhlr 3446} 3447 3448// Values returns the slice of values for the current page or nil if there are no values. 3449func (page DedicatedHostListResultPage) Values() []DedicatedHost { 3450 if page.dhlr.IsEmpty() { 3451 return nil 3452 } 3453 return *page.dhlr.Value 3454} 3455 3456// Creates a new instance of the DedicatedHostListResultPage type. 3457func NewDedicatedHostListResultPage(cur DedicatedHostListResult, getNextPage func(context.Context, DedicatedHostListResult) (DedicatedHostListResult, error)) DedicatedHostListResultPage { 3458 return DedicatedHostListResultPage{ 3459 fn: getNextPage, 3460 dhlr: cur, 3461 } 3462} 3463 3464// DedicatedHostProperties properties of the dedicated host. 3465type DedicatedHostProperties struct { 3466 // PlatformFaultDomain - Fault domain of the dedicated host within a dedicated host group. 3467 PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` 3468 // AutoReplaceOnFailure - Specifies whether the dedicated host should be replaced automatically in case of a failure. The value is defaulted to 'true' when not provided. 3469 AutoReplaceOnFailure *bool `json:"autoReplaceOnFailure,omitempty"` 3470 // 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. 3471 HostID *string `json:"hostId,omitempty"` 3472 // VirtualMachines - READ-ONLY; A list of references to all virtual machines in the Dedicated Host. 3473 VirtualMachines *[]SubResourceReadOnly `json:"virtualMachines,omitempty"` 3474 // 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' 3475 LicenseType DedicatedHostLicenseTypes `json:"licenseType,omitempty"` 3476 // ProvisioningTime - READ-ONLY; The date when the host was first provisioned. 3477 ProvisioningTime *date.Time `json:"provisioningTime,omitempty"` 3478 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 3479 ProvisioningState *string `json:"provisioningState,omitempty"` 3480 // InstanceView - READ-ONLY; The dedicated host instance view. 3481 InstanceView *DedicatedHostInstanceView `json:"instanceView,omitempty"` 3482} 3483 3484// MarshalJSON is the custom marshaler for DedicatedHostProperties. 3485func (dhp DedicatedHostProperties) MarshalJSON() ([]byte, error) { 3486 objectMap := make(map[string]interface{}) 3487 if dhp.PlatformFaultDomain != nil { 3488 objectMap["platformFaultDomain"] = dhp.PlatformFaultDomain 3489 } 3490 if dhp.AutoReplaceOnFailure != nil { 3491 objectMap["autoReplaceOnFailure"] = dhp.AutoReplaceOnFailure 3492 } 3493 if dhp.LicenseType != "" { 3494 objectMap["licenseType"] = dhp.LicenseType 3495 } 3496 return json.Marshal(objectMap) 3497} 3498 3499// DedicatedHostsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 3500// long-running operation. 3501type DedicatedHostsCreateOrUpdateFuture struct { 3502 azure.FutureAPI 3503 // Result returns the result of the asynchronous operation. 3504 // If the operation has not completed it will return an error. 3505 Result func(DedicatedHostsClient) (DedicatedHost, error) 3506} 3507 3508// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3509func (future *DedicatedHostsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 3510 var azFuture azure.Future 3511 if err := json.Unmarshal(body, &azFuture); err != nil { 3512 return err 3513 } 3514 future.FutureAPI = &azFuture 3515 future.Result = future.result 3516 return nil 3517} 3518 3519// result is the default implementation for DedicatedHostsCreateOrUpdateFuture.Result. 3520func (future *DedicatedHostsCreateOrUpdateFuture) result(client DedicatedHostsClient) (dh DedicatedHost, err error) { 3521 var done bool 3522 done, err = future.DoneWithContext(context.Background(), client) 3523 if err != nil { 3524 err = autorest.NewErrorWithError(err, "compute.DedicatedHostsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 3525 return 3526 } 3527 if !done { 3528 dh.Response.Response = future.Response() 3529 err = azure.NewAsyncOpIncompleteError("compute.DedicatedHostsCreateOrUpdateFuture") 3530 return 3531 } 3532 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3533 if dh.Response.Response, err = future.GetResult(sender); err == nil && dh.Response.Response.StatusCode != http.StatusNoContent { 3534 dh, err = client.CreateOrUpdateResponder(dh.Response.Response) 3535 if err != nil { 3536 err = autorest.NewErrorWithError(err, "compute.DedicatedHostsCreateOrUpdateFuture", "Result", dh.Response.Response, "Failure responding to request") 3537 } 3538 } 3539 return 3540} 3541 3542// DedicatedHostsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 3543// operation. 3544type DedicatedHostsDeleteFuture struct { 3545 azure.FutureAPI 3546 // Result returns the result of the asynchronous operation. 3547 // If the operation has not completed it will return an error. 3548 Result func(DedicatedHostsClient) (autorest.Response, error) 3549} 3550 3551// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3552func (future *DedicatedHostsDeleteFuture) UnmarshalJSON(body []byte) error { 3553 var azFuture azure.Future 3554 if err := json.Unmarshal(body, &azFuture); err != nil { 3555 return err 3556 } 3557 future.FutureAPI = &azFuture 3558 future.Result = future.result 3559 return nil 3560} 3561 3562// result is the default implementation for DedicatedHostsDeleteFuture.Result. 3563func (future *DedicatedHostsDeleteFuture) result(client DedicatedHostsClient) (ar autorest.Response, err error) { 3564 var done bool 3565 done, err = future.DoneWithContext(context.Background(), client) 3566 if err != nil { 3567 err = autorest.NewErrorWithError(err, "compute.DedicatedHostsDeleteFuture", "Result", future.Response(), "Polling failure") 3568 return 3569 } 3570 if !done { 3571 ar.Response = future.Response() 3572 err = azure.NewAsyncOpIncompleteError("compute.DedicatedHostsDeleteFuture") 3573 return 3574 } 3575 ar.Response = future.Response() 3576 return 3577} 3578 3579// DedicatedHostsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 3580// operation. 3581type DedicatedHostsUpdateFuture struct { 3582 azure.FutureAPI 3583 // Result returns the result of the asynchronous operation. 3584 // If the operation has not completed it will return an error. 3585 Result func(DedicatedHostsClient) (DedicatedHost, error) 3586} 3587 3588// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3589func (future *DedicatedHostsUpdateFuture) UnmarshalJSON(body []byte) error { 3590 var azFuture azure.Future 3591 if err := json.Unmarshal(body, &azFuture); err != nil { 3592 return err 3593 } 3594 future.FutureAPI = &azFuture 3595 future.Result = future.result 3596 return nil 3597} 3598 3599// result is the default implementation for DedicatedHostsUpdateFuture.Result. 3600func (future *DedicatedHostsUpdateFuture) result(client DedicatedHostsClient) (dh DedicatedHost, err error) { 3601 var done bool 3602 done, err = future.DoneWithContext(context.Background(), client) 3603 if err != nil { 3604 err = autorest.NewErrorWithError(err, "compute.DedicatedHostsUpdateFuture", "Result", future.Response(), "Polling failure") 3605 return 3606 } 3607 if !done { 3608 dh.Response.Response = future.Response() 3609 err = azure.NewAsyncOpIncompleteError("compute.DedicatedHostsUpdateFuture") 3610 return 3611 } 3612 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3613 if dh.Response.Response, err = future.GetResult(sender); err == nil && dh.Response.Response.StatusCode != http.StatusNoContent { 3614 dh, err = client.UpdateResponder(dh.Response.Response) 3615 if err != nil { 3616 err = autorest.NewErrorWithError(err, "compute.DedicatedHostsUpdateFuture", "Result", dh.Response.Response, "Failure responding to request") 3617 } 3618 } 3619 return 3620} 3621 3622// DedicatedHostUpdate specifies information about the dedicated host. Only tags, autoReplaceOnFailure and 3623// licenseType may be updated. 3624type DedicatedHostUpdate struct { 3625 *DedicatedHostProperties `json:"properties,omitempty"` 3626 // Tags - Resource tags 3627 Tags map[string]*string `json:"tags"` 3628} 3629 3630// MarshalJSON is the custom marshaler for DedicatedHostUpdate. 3631func (dhu DedicatedHostUpdate) MarshalJSON() ([]byte, error) { 3632 objectMap := make(map[string]interface{}) 3633 if dhu.DedicatedHostProperties != nil { 3634 objectMap["properties"] = dhu.DedicatedHostProperties 3635 } 3636 if dhu.Tags != nil { 3637 objectMap["tags"] = dhu.Tags 3638 } 3639 return json.Marshal(objectMap) 3640} 3641 3642// UnmarshalJSON is the custom unmarshaler for DedicatedHostUpdate struct. 3643func (dhu *DedicatedHostUpdate) UnmarshalJSON(body []byte) error { 3644 var m map[string]*json.RawMessage 3645 err := json.Unmarshal(body, &m) 3646 if err != nil { 3647 return err 3648 } 3649 for k, v := range m { 3650 switch k { 3651 case "properties": 3652 if v != nil { 3653 var dedicatedHostProperties DedicatedHostProperties 3654 err = json.Unmarshal(*v, &dedicatedHostProperties) 3655 if err != nil { 3656 return err 3657 } 3658 dhu.DedicatedHostProperties = &dedicatedHostProperties 3659 } 3660 case "tags": 3661 if v != nil { 3662 var tags map[string]*string 3663 err = json.Unmarshal(*v, &tags) 3664 if err != nil { 3665 return err 3666 } 3667 dhu.Tags = tags 3668 } 3669 } 3670 } 3671 3672 return nil 3673} 3674 3675// DiagnosticsProfile specifies the boot diagnostic settings state. <br><br>Minimum api-version: 3676// 2015-06-15. 3677type DiagnosticsProfile struct { 3678 // 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. 3679 BootDiagnostics *BootDiagnostics `json:"bootDiagnostics,omitempty"` 3680} 3681 3682// DiffDiskSettings describes the parameters of ephemeral disk settings that can be specified for operating 3683// system disk. <br><br> NOTE: The ephemeral disk settings can only be specified for managed disk. 3684type DiffDiskSettings struct { 3685 // Option - Specifies the ephemeral disk settings for operating system disk. Possible values include: 'DiffDiskOptionsLocal' 3686 Option DiffDiskOptions `json:"option,omitempty"` 3687 // 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' 3688 Placement DiffDiskPlacement `json:"placement,omitempty"` 3689} 3690 3691// Disallowed describes the disallowed disk types. 3692type Disallowed struct { 3693 // DiskTypes - A list of disk types. 3694 DiskTypes *[]string `json:"diskTypes,omitempty"` 3695} 3696 3697// DisallowedConfiguration specifies the disallowed configuration for a virtual machine image. 3698type DisallowedConfiguration struct { 3699 // VMDiskType - VM disk types which are disallowed. Possible values include: 'VMDiskTypesNone', 'VMDiskTypesUnmanaged' 3700 VMDiskType VMDiskTypes `json:"vmDiskType,omitempty"` 3701} 3702 3703// Disk disk resource. 3704type Disk struct { 3705 autorest.Response `json:"-"` 3706 // ManagedBy - READ-ONLY; A relative URI containing the ID of the VM that has the disk attached. 3707 ManagedBy *string `json:"managedBy,omitempty"` 3708 // 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. 3709 ManagedByExtended *[]string `json:"managedByExtended,omitempty"` 3710 Sku *DiskSku `json:"sku,omitempty"` 3711 // Zones - The Logical zone list for Disk. 3712 Zones *[]string `json:"zones,omitempty"` 3713 // ExtendedLocation - The extended location where the disk will be created. Extended location cannot be changed. 3714 ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` 3715 *DiskProperties `json:"properties,omitempty"` 3716 // ID - READ-ONLY; Resource Id 3717 ID *string `json:"id,omitempty"` 3718 // Name - READ-ONLY; Resource name 3719 Name *string `json:"name,omitempty"` 3720 // Type - READ-ONLY; Resource type 3721 Type *string `json:"type,omitempty"` 3722 // Location - Resource location 3723 Location *string `json:"location,omitempty"` 3724 // Tags - Resource tags 3725 Tags map[string]*string `json:"tags"` 3726} 3727 3728// MarshalJSON is the custom marshaler for Disk. 3729func (d Disk) MarshalJSON() ([]byte, error) { 3730 objectMap := make(map[string]interface{}) 3731 if d.Sku != nil { 3732 objectMap["sku"] = d.Sku 3733 } 3734 if d.Zones != nil { 3735 objectMap["zones"] = d.Zones 3736 } 3737 if d.ExtendedLocation != nil { 3738 objectMap["extendedLocation"] = d.ExtendedLocation 3739 } 3740 if d.DiskProperties != nil { 3741 objectMap["properties"] = d.DiskProperties 3742 } 3743 if d.Location != nil { 3744 objectMap["location"] = d.Location 3745 } 3746 if d.Tags != nil { 3747 objectMap["tags"] = d.Tags 3748 } 3749 return json.Marshal(objectMap) 3750} 3751 3752// UnmarshalJSON is the custom unmarshaler for Disk struct. 3753func (d *Disk) UnmarshalJSON(body []byte) error { 3754 var m map[string]*json.RawMessage 3755 err := json.Unmarshal(body, &m) 3756 if err != nil { 3757 return err 3758 } 3759 for k, v := range m { 3760 switch k { 3761 case "managedBy": 3762 if v != nil { 3763 var managedBy string 3764 err = json.Unmarshal(*v, &managedBy) 3765 if err != nil { 3766 return err 3767 } 3768 d.ManagedBy = &managedBy 3769 } 3770 case "managedByExtended": 3771 if v != nil { 3772 var managedByExtended []string 3773 err = json.Unmarshal(*v, &managedByExtended) 3774 if err != nil { 3775 return err 3776 } 3777 d.ManagedByExtended = &managedByExtended 3778 } 3779 case "sku": 3780 if v != nil { 3781 var sku DiskSku 3782 err = json.Unmarshal(*v, &sku) 3783 if err != nil { 3784 return err 3785 } 3786 d.Sku = &sku 3787 } 3788 case "zones": 3789 if v != nil { 3790 var zones []string 3791 err = json.Unmarshal(*v, &zones) 3792 if err != nil { 3793 return err 3794 } 3795 d.Zones = &zones 3796 } 3797 case "extendedLocation": 3798 if v != nil { 3799 var extendedLocation ExtendedLocation 3800 err = json.Unmarshal(*v, &extendedLocation) 3801 if err != nil { 3802 return err 3803 } 3804 d.ExtendedLocation = &extendedLocation 3805 } 3806 case "properties": 3807 if v != nil { 3808 var diskProperties DiskProperties 3809 err = json.Unmarshal(*v, &diskProperties) 3810 if err != nil { 3811 return err 3812 } 3813 d.DiskProperties = &diskProperties 3814 } 3815 case "id": 3816 if v != nil { 3817 var ID string 3818 err = json.Unmarshal(*v, &ID) 3819 if err != nil { 3820 return err 3821 } 3822 d.ID = &ID 3823 } 3824 case "name": 3825 if v != nil { 3826 var name string 3827 err = json.Unmarshal(*v, &name) 3828 if err != nil { 3829 return err 3830 } 3831 d.Name = &name 3832 } 3833 case "type": 3834 if v != nil { 3835 var typeVar string 3836 err = json.Unmarshal(*v, &typeVar) 3837 if err != nil { 3838 return err 3839 } 3840 d.Type = &typeVar 3841 } 3842 case "location": 3843 if v != nil { 3844 var location string 3845 err = json.Unmarshal(*v, &location) 3846 if err != nil { 3847 return err 3848 } 3849 d.Location = &location 3850 } 3851 case "tags": 3852 if v != nil { 3853 var tags map[string]*string 3854 err = json.Unmarshal(*v, &tags) 3855 if err != nil { 3856 return err 3857 } 3858 d.Tags = tags 3859 } 3860 } 3861 } 3862 3863 return nil 3864} 3865 3866// DiskAccess disk access resource. 3867type DiskAccess struct { 3868 autorest.Response `json:"-"` 3869 *DiskAccessProperties `json:"properties,omitempty"` 3870 // ID - READ-ONLY; Resource Id 3871 ID *string `json:"id,omitempty"` 3872 // Name - READ-ONLY; Resource name 3873 Name *string `json:"name,omitempty"` 3874 // Type - READ-ONLY; Resource type 3875 Type *string `json:"type,omitempty"` 3876 // Location - Resource location 3877 Location *string `json:"location,omitempty"` 3878 // Tags - Resource tags 3879 Tags map[string]*string `json:"tags"` 3880} 3881 3882// MarshalJSON is the custom marshaler for DiskAccess. 3883func (da DiskAccess) MarshalJSON() ([]byte, error) { 3884 objectMap := make(map[string]interface{}) 3885 if da.DiskAccessProperties != nil { 3886 objectMap["properties"] = da.DiskAccessProperties 3887 } 3888 if da.Location != nil { 3889 objectMap["location"] = da.Location 3890 } 3891 if da.Tags != nil { 3892 objectMap["tags"] = da.Tags 3893 } 3894 return json.Marshal(objectMap) 3895} 3896 3897// UnmarshalJSON is the custom unmarshaler for DiskAccess struct. 3898func (da *DiskAccess) UnmarshalJSON(body []byte) error { 3899 var m map[string]*json.RawMessage 3900 err := json.Unmarshal(body, &m) 3901 if err != nil { 3902 return err 3903 } 3904 for k, v := range m { 3905 switch k { 3906 case "properties": 3907 if v != nil { 3908 var diskAccessProperties DiskAccessProperties 3909 err = json.Unmarshal(*v, &diskAccessProperties) 3910 if err != nil { 3911 return err 3912 } 3913 da.DiskAccessProperties = &diskAccessProperties 3914 } 3915 case "id": 3916 if v != nil { 3917 var ID string 3918 err = json.Unmarshal(*v, &ID) 3919 if err != nil { 3920 return err 3921 } 3922 da.ID = &ID 3923 } 3924 case "name": 3925 if v != nil { 3926 var name string 3927 err = json.Unmarshal(*v, &name) 3928 if err != nil { 3929 return err 3930 } 3931 da.Name = &name 3932 } 3933 case "type": 3934 if v != nil { 3935 var typeVar string 3936 err = json.Unmarshal(*v, &typeVar) 3937 if err != nil { 3938 return err 3939 } 3940 da.Type = &typeVar 3941 } 3942 case "location": 3943 if v != nil { 3944 var location string 3945 err = json.Unmarshal(*v, &location) 3946 if err != nil { 3947 return err 3948 } 3949 da.Location = &location 3950 } 3951 case "tags": 3952 if v != nil { 3953 var tags map[string]*string 3954 err = json.Unmarshal(*v, &tags) 3955 if err != nil { 3956 return err 3957 } 3958 da.Tags = tags 3959 } 3960 } 3961 } 3962 3963 return nil 3964} 3965 3966// DiskAccessesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 3967// long-running operation. 3968type DiskAccessesCreateOrUpdateFuture struct { 3969 azure.FutureAPI 3970 // Result returns the result of the asynchronous operation. 3971 // If the operation has not completed it will return an error. 3972 Result func(DiskAccessesClient) (DiskAccess, error) 3973} 3974 3975// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3976func (future *DiskAccessesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 3977 var azFuture azure.Future 3978 if err := json.Unmarshal(body, &azFuture); err != nil { 3979 return err 3980 } 3981 future.FutureAPI = &azFuture 3982 future.Result = future.result 3983 return nil 3984} 3985 3986// result is the default implementation for DiskAccessesCreateOrUpdateFuture.Result. 3987func (future *DiskAccessesCreateOrUpdateFuture) result(client DiskAccessesClient) (da DiskAccess, err error) { 3988 var done bool 3989 done, err = future.DoneWithContext(context.Background(), client) 3990 if err != nil { 3991 err = autorest.NewErrorWithError(err, "compute.DiskAccessesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 3992 return 3993 } 3994 if !done { 3995 da.Response.Response = future.Response() 3996 err = azure.NewAsyncOpIncompleteError("compute.DiskAccessesCreateOrUpdateFuture") 3997 return 3998 } 3999 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4000 if da.Response.Response, err = future.GetResult(sender); err == nil && da.Response.Response.StatusCode != http.StatusNoContent { 4001 da, err = client.CreateOrUpdateResponder(da.Response.Response) 4002 if err != nil { 4003 err = autorest.NewErrorWithError(err, "compute.DiskAccessesCreateOrUpdateFuture", "Result", da.Response.Response, "Failure responding to request") 4004 } 4005 } 4006 return 4007} 4008 4009// DiskAccessesDeleteAPrivateEndpointConnectionFuture an abstraction for monitoring and retrieving the 4010// results of a long-running operation. 4011type DiskAccessesDeleteAPrivateEndpointConnectionFuture struct { 4012 azure.FutureAPI 4013 // Result returns the result of the asynchronous operation. 4014 // If the operation has not completed it will return an error. 4015 Result func(DiskAccessesClient) (autorest.Response, error) 4016} 4017 4018// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4019func (future *DiskAccessesDeleteAPrivateEndpointConnectionFuture) UnmarshalJSON(body []byte) error { 4020 var azFuture azure.Future 4021 if err := json.Unmarshal(body, &azFuture); err != nil { 4022 return err 4023 } 4024 future.FutureAPI = &azFuture 4025 future.Result = future.result 4026 return nil 4027} 4028 4029// result is the default implementation for DiskAccessesDeleteAPrivateEndpointConnectionFuture.Result. 4030func (future *DiskAccessesDeleteAPrivateEndpointConnectionFuture) result(client DiskAccessesClient) (ar autorest.Response, err error) { 4031 var done bool 4032 done, err = future.DoneWithContext(context.Background(), client) 4033 if err != nil { 4034 err = autorest.NewErrorWithError(err, "compute.DiskAccessesDeleteAPrivateEndpointConnectionFuture", "Result", future.Response(), "Polling failure") 4035 return 4036 } 4037 if !done { 4038 ar.Response = future.Response() 4039 err = azure.NewAsyncOpIncompleteError("compute.DiskAccessesDeleteAPrivateEndpointConnectionFuture") 4040 return 4041 } 4042 ar.Response = future.Response() 4043 return 4044} 4045 4046// DiskAccessesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 4047// operation. 4048type DiskAccessesDeleteFuture struct { 4049 azure.FutureAPI 4050 // Result returns the result of the asynchronous operation. 4051 // If the operation has not completed it will return an error. 4052 Result func(DiskAccessesClient) (autorest.Response, error) 4053} 4054 4055// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4056func (future *DiskAccessesDeleteFuture) UnmarshalJSON(body []byte) error { 4057 var azFuture azure.Future 4058 if err := json.Unmarshal(body, &azFuture); err != nil { 4059 return err 4060 } 4061 future.FutureAPI = &azFuture 4062 future.Result = future.result 4063 return nil 4064} 4065 4066// result is the default implementation for DiskAccessesDeleteFuture.Result. 4067func (future *DiskAccessesDeleteFuture) result(client DiskAccessesClient) (ar autorest.Response, err error) { 4068 var done bool 4069 done, err = future.DoneWithContext(context.Background(), client) 4070 if err != nil { 4071 err = autorest.NewErrorWithError(err, "compute.DiskAccessesDeleteFuture", "Result", future.Response(), "Polling failure") 4072 return 4073 } 4074 if !done { 4075 ar.Response = future.Response() 4076 err = azure.NewAsyncOpIncompleteError("compute.DiskAccessesDeleteFuture") 4077 return 4078 } 4079 ar.Response = future.Response() 4080 return 4081} 4082 4083// DiskAccessesUpdateAPrivateEndpointConnectionFuture an abstraction for monitoring and retrieving the 4084// results of a long-running operation. 4085type DiskAccessesUpdateAPrivateEndpointConnectionFuture struct { 4086 azure.FutureAPI 4087 // Result returns the result of the asynchronous operation. 4088 // If the operation has not completed it will return an error. 4089 Result func(DiskAccessesClient) (PrivateEndpointConnection, error) 4090} 4091 4092// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4093func (future *DiskAccessesUpdateAPrivateEndpointConnectionFuture) UnmarshalJSON(body []byte) error { 4094 var azFuture azure.Future 4095 if err := json.Unmarshal(body, &azFuture); err != nil { 4096 return err 4097 } 4098 future.FutureAPI = &azFuture 4099 future.Result = future.result 4100 return nil 4101} 4102 4103// result is the default implementation for DiskAccessesUpdateAPrivateEndpointConnectionFuture.Result. 4104func (future *DiskAccessesUpdateAPrivateEndpointConnectionFuture) result(client DiskAccessesClient) (pec PrivateEndpointConnection, err error) { 4105 var done bool 4106 done, err = future.DoneWithContext(context.Background(), client) 4107 if err != nil { 4108 err = autorest.NewErrorWithError(err, "compute.DiskAccessesUpdateAPrivateEndpointConnectionFuture", "Result", future.Response(), "Polling failure") 4109 return 4110 } 4111 if !done { 4112 pec.Response.Response = future.Response() 4113 err = azure.NewAsyncOpIncompleteError("compute.DiskAccessesUpdateAPrivateEndpointConnectionFuture") 4114 return 4115 } 4116 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4117 if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent { 4118 pec, err = client.UpdateAPrivateEndpointConnectionResponder(pec.Response.Response) 4119 if err != nil { 4120 err = autorest.NewErrorWithError(err, "compute.DiskAccessesUpdateAPrivateEndpointConnectionFuture", "Result", pec.Response.Response, "Failure responding to request") 4121 } 4122 } 4123 return 4124} 4125 4126// DiskAccessesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 4127// operation. 4128type DiskAccessesUpdateFuture struct { 4129 azure.FutureAPI 4130 // Result returns the result of the asynchronous operation. 4131 // If the operation has not completed it will return an error. 4132 Result func(DiskAccessesClient) (DiskAccess, error) 4133} 4134 4135// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4136func (future *DiskAccessesUpdateFuture) UnmarshalJSON(body []byte) error { 4137 var azFuture azure.Future 4138 if err := json.Unmarshal(body, &azFuture); err != nil { 4139 return err 4140 } 4141 future.FutureAPI = &azFuture 4142 future.Result = future.result 4143 return nil 4144} 4145 4146// result is the default implementation for DiskAccessesUpdateFuture.Result. 4147func (future *DiskAccessesUpdateFuture) result(client DiskAccessesClient) (da DiskAccess, err error) { 4148 var done bool 4149 done, err = future.DoneWithContext(context.Background(), client) 4150 if err != nil { 4151 err = autorest.NewErrorWithError(err, "compute.DiskAccessesUpdateFuture", "Result", future.Response(), "Polling failure") 4152 return 4153 } 4154 if !done { 4155 da.Response.Response = future.Response() 4156 err = azure.NewAsyncOpIncompleteError("compute.DiskAccessesUpdateFuture") 4157 return 4158 } 4159 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4160 if da.Response.Response, err = future.GetResult(sender); err == nil && da.Response.Response.StatusCode != http.StatusNoContent { 4161 da, err = client.UpdateResponder(da.Response.Response) 4162 if err != nil { 4163 err = autorest.NewErrorWithError(err, "compute.DiskAccessesUpdateFuture", "Result", da.Response.Response, "Failure responding to request") 4164 } 4165 } 4166 return 4167} 4168 4169// DiskAccessList the List disk access operation response. 4170type DiskAccessList struct { 4171 autorest.Response `json:"-"` 4172 // Value - A list of disk access resources. 4173 Value *[]DiskAccess `json:"value,omitempty"` 4174 // 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. 4175 NextLink *string `json:"nextLink,omitempty"` 4176} 4177 4178// DiskAccessListIterator provides access to a complete listing of DiskAccess values. 4179type DiskAccessListIterator struct { 4180 i int 4181 page DiskAccessListPage 4182} 4183 4184// NextWithContext advances to the next value. If there was an error making 4185// the request the iterator does not advance and the error is returned. 4186func (iter *DiskAccessListIterator) NextWithContext(ctx context.Context) (err error) { 4187 if tracing.IsEnabled() { 4188 ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessListIterator.NextWithContext") 4189 defer func() { 4190 sc := -1 4191 if iter.Response().Response.Response != nil { 4192 sc = iter.Response().Response.Response.StatusCode 4193 } 4194 tracing.EndSpan(ctx, sc, err) 4195 }() 4196 } 4197 iter.i++ 4198 if iter.i < len(iter.page.Values()) { 4199 return nil 4200 } 4201 err = iter.page.NextWithContext(ctx) 4202 if err != nil { 4203 iter.i-- 4204 return err 4205 } 4206 iter.i = 0 4207 return nil 4208} 4209 4210// Next advances to the next value. If there was an error making 4211// the request the iterator does not advance and the error is returned. 4212// Deprecated: Use NextWithContext() instead. 4213func (iter *DiskAccessListIterator) Next() error { 4214 return iter.NextWithContext(context.Background()) 4215} 4216 4217// NotDone returns true if the enumeration should be started or is not yet complete. 4218func (iter DiskAccessListIterator) NotDone() bool { 4219 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4220} 4221 4222// Response returns the raw server response from the last page request. 4223func (iter DiskAccessListIterator) Response() DiskAccessList { 4224 return iter.page.Response() 4225} 4226 4227// Value returns the current value or a zero-initialized value if the 4228// iterator has advanced beyond the end of the collection. 4229func (iter DiskAccessListIterator) Value() DiskAccess { 4230 if !iter.page.NotDone() { 4231 return DiskAccess{} 4232 } 4233 return iter.page.Values()[iter.i] 4234} 4235 4236// Creates a new instance of the DiskAccessListIterator type. 4237func NewDiskAccessListIterator(page DiskAccessListPage) DiskAccessListIterator { 4238 return DiskAccessListIterator{page: page} 4239} 4240 4241// IsEmpty returns true if the ListResult contains no values. 4242func (dal DiskAccessList) IsEmpty() bool { 4243 return dal.Value == nil || len(*dal.Value) == 0 4244} 4245 4246// hasNextLink returns true if the NextLink is not empty. 4247func (dal DiskAccessList) hasNextLink() bool { 4248 return dal.NextLink != nil && len(*dal.NextLink) != 0 4249} 4250 4251// diskAccessListPreparer prepares a request to retrieve the next set of results. 4252// It returns nil if no more results exist. 4253func (dal DiskAccessList) diskAccessListPreparer(ctx context.Context) (*http.Request, error) { 4254 if !dal.hasNextLink() { 4255 return nil, nil 4256 } 4257 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4258 autorest.AsJSON(), 4259 autorest.AsGet(), 4260 autorest.WithBaseURL(to.String(dal.NextLink))) 4261} 4262 4263// DiskAccessListPage contains a page of DiskAccess values. 4264type DiskAccessListPage struct { 4265 fn func(context.Context, DiskAccessList) (DiskAccessList, error) 4266 dal DiskAccessList 4267} 4268 4269// NextWithContext advances to the next page of values. If there was an error making 4270// the request the page does not advance and the error is returned. 4271func (page *DiskAccessListPage) NextWithContext(ctx context.Context) (err error) { 4272 if tracing.IsEnabled() { 4273 ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessListPage.NextWithContext") 4274 defer func() { 4275 sc := -1 4276 if page.Response().Response.Response != nil { 4277 sc = page.Response().Response.Response.StatusCode 4278 } 4279 tracing.EndSpan(ctx, sc, err) 4280 }() 4281 } 4282 for { 4283 next, err := page.fn(ctx, page.dal) 4284 if err != nil { 4285 return err 4286 } 4287 page.dal = next 4288 if !next.hasNextLink() || !next.IsEmpty() { 4289 break 4290 } 4291 } 4292 return nil 4293} 4294 4295// Next advances to the next page of values. If there was an error making 4296// the request the page does not advance and the error is returned. 4297// Deprecated: Use NextWithContext() instead. 4298func (page *DiskAccessListPage) Next() error { 4299 return page.NextWithContext(context.Background()) 4300} 4301 4302// NotDone returns true if the page enumeration should be started or is not yet complete. 4303func (page DiskAccessListPage) NotDone() bool { 4304 return !page.dal.IsEmpty() 4305} 4306 4307// Response returns the raw server response from the last page request. 4308func (page DiskAccessListPage) Response() DiskAccessList { 4309 return page.dal 4310} 4311 4312// Values returns the slice of values for the current page or nil if there are no values. 4313func (page DiskAccessListPage) Values() []DiskAccess { 4314 if page.dal.IsEmpty() { 4315 return nil 4316 } 4317 return *page.dal.Value 4318} 4319 4320// Creates a new instance of the DiskAccessListPage type. 4321func NewDiskAccessListPage(cur DiskAccessList, getNextPage func(context.Context, DiskAccessList) (DiskAccessList, error)) DiskAccessListPage { 4322 return DiskAccessListPage{ 4323 fn: getNextPage, 4324 dal: cur, 4325 } 4326} 4327 4328// DiskAccessProperties ... 4329type DiskAccessProperties struct { 4330 // PrivateEndpointConnections - READ-ONLY; A readonly collection of private endpoint connections created on the disk. Currently only one endpoint connection is supported. 4331 PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` 4332 // ProvisioningState - READ-ONLY; The disk access resource provisioning state. 4333 ProvisioningState *string `json:"provisioningState,omitempty"` 4334 // TimeCreated - READ-ONLY; The time when the disk access was created. 4335 TimeCreated *date.Time `json:"timeCreated,omitempty"` 4336} 4337 4338// MarshalJSON is the custom marshaler for DiskAccessProperties. 4339func (dap DiskAccessProperties) MarshalJSON() ([]byte, error) { 4340 objectMap := make(map[string]interface{}) 4341 return json.Marshal(objectMap) 4342} 4343 4344// DiskAccessUpdate used for updating a disk access resource. 4345type DiskAccessUpdate struct { 4346 // Tags - Resource tags 4347 Tags map[string]*string `json:"tags"` 4348} 4349 4350// MarshalJSON is the custom marshaler for DiskAccessUpdate. 4351func (dau DiskAccessUpdate) MarshalJSON() ([]byte, error) { 4352 objectMap := make(map[string]interface{}) 4353 if dau.Tags != nil { 4354 objectMap["tags"] = dau.Tags 4355 } 4356 return json.Marshal(objectMap) 4357} 4358 4359// DiskEncryptionSet disk encryption set resource. 4360type DiskEncryptionSet struct { 4361 autorest.Response `json:"-"` 4362 Identity *EncryptionSetIdentity `json:"identity,omitempty"` 4363 *EncryptionSetProperties `json:"properties,omitempty"` 4364 // ID - READ-ONLY; Resource Id 4365 ID *string `json:"id,omitempty"` 4366 // Name - READ-ONLY; Resource name 4367 Name *string `json:"name,omitempty"` 4368 // Type - READ-ONLY; Resource type 4369 Type *string `json:"type,omitempty"` 4370 // Location - Resource location 4371 Location *string `json:"location,omitempty"` 4372 // Tags - Resource tags 4373 Tags map[string]*string `json:"tags"` 4374} 4375 4376// MarshalJSON is the custom marshaler for DiskEncryptionSet. 4377func (desVar DiskEncryptionSet) MarshalJSON() ([]byte, error) { 4378 objectMap := make(map[string]interface{}) 4379 if desVar.Identity != nil { 4380 objectMap["identity"] = desVar.Identity 4381 } 4382 if desVar.EncryptionSetProperties != nil { 4383 objectMap["properties"] = desVar.EncryptionSetProperties 4384 } 4385 if desVar.Location != nil { 4386 objectMap["location"] = desVar.Location 4387 } 4388 if desVar.Tags != nil { 4389 objectMap["tags"] = desVar.Tags 4390 } 4391 return json.Marshal(objectMap) 4392} 4393 4394// UnmarshalJSON is the custom unmarshaler for DiskEncryptionSet struct. 4395func (desVar *DiskEncryptionSet) UnmarshalJSON(body []byte) error { 4396 var m map[string]*json.RawMessage 4397 err := json.Unmarshal(body, &m) 4398 if err != nil { 4399 return err 4400 } 4401 for k, v := range m { 4402 switch k { 4403 case "identity": 4404 if v != nil { 4405 var identity EncryptionSetIdentity 4406 err = json.Unmarshal(*v, &identity) 4407 if err != nil { 4408 return err 4409 } 4410 desVar.Identity = &identity 4411 } 4412 case "properties": 4413 if v != nil { 4414 var encryptionSetProperties EncryptionSetProperties 4415 err = json.Unmarshal(*v, &encryptionSetProperties) 4416 if err != nil { 4417 return err 4418 } 4419 desVar.EncryptionSetProperties = &encryptionSetProperties 4420 } 4421 case "id": 4422 if v != nil { 4423 var ID string 4424 err = json.Unmarshal(*v, &ID) 4425 if err != nil { 4426 return err 4427 } 4428 desVar.ID = &ID 4429 } 4430 case "name": 4431 if v != nil { 4432 var name string 4433 err = json.Unmarshal(*v, &name) 4434 if err != nil { 4435 return err 4436 } 4437 desVar.Name = &name 4438 } 4439 case "type": 4440 if v != nil { 4441 var typeVar string 4442 err = json.Unmarshal(*v, &typeVar) 4443 if err != nil { 4444 return err 4445 } 4446 desVar.Type = &typeVar 4447 } 4448 case "location": 4449 if v != nil { 4450 var location string 4451 err = json.Unmarshal(*v, &location) 4452 if err != nil { 4453 return err 4454 } 4455 desVar.Location = &location 4456 } 4457 case "tags": 4458 if v != nil { 4459 var tags map[string]*string 4460 err = json.Unmarshal(*v, &tags) 4461 if err != nil { 4462 return err 4463 } 4464 desVar.Tags = tags 4465 } 4466 } 4467 } 4468 4469 return nil 4470} 4471 4472// DiskEncryptionSetList the List disk encryption set operation response. 4473type DiskEncryptionSetList struct { 4474 autorest.Response `json:"-"` 4475 // Value - A list of disk encryption sets. 4476 Value *[]DiskEncryptionSet `json:"value,omitempty"` 4477 // 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. 4478 NextLink *string `json:"nextLink,omitempty"` 4479} 4480 4481// DiskEncryptionSetListIterator provides access to a complete listing of DiskEncryptionSet values. 4482type DiskEncryptionSetListIterator struct { 4483 i int 4484 page DiskEncryptionSetListPage 4485} 4486 4487// NextWithContext advances to the next value. If there was an error making 4488// the request the iterator does not advance and the error is returned. 4489func (iter *DiskEncryptionSetListIterator) NextWithContext(ctx context.Context) (err error) { 4490 if tracing.IsEnabled() { 4491 ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetListIterator.NextWithContext") 4492 defer func() { 4493 sc := -1 4494 if iter.Response().Response.Response != nil { 4495 sc = iter.Response().Response.Response.StatusCode 4496 } 4497 tracing.EndSpan(ctx, sc, err) 4498 }() 4499 } 4500 iter.i++ 4501 if iter.i < len(iter.page.Values()) { 4502 return nil 4503 } 4504 err = iter.page.NextWithContext(ctx) 4505 if err != nil { 4506 iter.i-- 4507 return err 4508 } 4509 iter.i = 0 4510 return nil 4511} 4512 4513// Next advances to the next value. If there was an error making 4514// the request the iterator does not advance and the error is returned. 4515// Deprecated: Use NextWithContext() instead. 4516func (iter *DiskEncryptionSetListIterator) Next() error { 4517 return iter.NextWithContext(context.Background()) 4518} 4519 4520// NotDone returns true if the enumeration should be started or is not yet complete. 4521func (iter DiskEncryptionSetListIterator) NotDone() bool { 4522 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4523} 4524 4525// Response returns the raw server response from the last page request. 4526func (iter DiskEncryptionSetListIterator) Response() DiskEncryptionSetList { 4527 return iter.page.Response() 4528} 4529 4530// Value returns the current value or a zero-initialized value if the 4531// iterator has advanced beyond the end of the collection. 4532func (iter DiskEncryptionSetListIterator) Value() DiskEncryptionSet { 4533 if !iter.page.NotDone() { 4534 return DiskEncryptionSet{} 4535 } 4536 return iter.page.Values()[iter.i] 4537} 4538 4539// Creates a new instance of the DiskEncryptionSetListIterator type. 4540func NewDiskEncryptionSetListIterator(page DiskEncryptionSetListPage) DiskEncryptionSetListIterator { 4541 return DiskEncryptionSetListIterator{page: page} 4542} 4543 4544// IsEmpty returns true if the ListResult contains no values. 4545func (desl DiskEncryptionSetList) IsEmpty() bool { 4546 return desl.Value == nil || len(*desl.Value) == 0 4547} 4548 4549// hasNextLink returns true if the NextLink is not empty. 4550func (desl DiskEncryptionSetList) hasNextLink() bool { 4551 return desl.NextLink != nil && len(*desl.NextLink) != 0 4552} 4553 4554// diskEncryptionSetListPreparer prepares a request to retrieve the next set of results. 4555// It returns nil if no more results exist. 4556func (desl DiskEncryptionSetList) diskEncryptionSetListPreparer(ctx context.Context) (*http.Request, error) { 4557 if !desl.hasNextLink() { 4558 return nil, nil 4559 } 4560 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4561 autorest.AsJSON(), 4562 autorest.AsGet(), 4563 autorest.WithBaseURL(to.String(desl.NextLink))) 4564} 4565 4566// DiskEncryptionSetListPage contains a page of DiskEncryptionSet values. 4567type DiskEncryptionSetListPage struct { 4568 fn func(context.Context, DiskEncryptionSetList) (DiskEncryptionSetList, error) 4569 desl DiskEncryptionSetList 4570} 4571 4572// NextWithContext advances to the next page of values. If there was an error making 4573// the request the page does not advance and the error is returned. 4574func (page *DiskEncryptionSetListPage) NextWithContext(ctx context.Context) (err error) { 4575 if tracing.IsEnabled() { 4576 ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetListPage.NextWithContext") 4577 defer func() { 4578 sc := -1 4579 if page.Response().Response.Response != nil { 4580 sc = page.Response().Response.Response.StatusCode 4581 } 4582 tracing.EndSpan(ctx, sc, err) 4583 }() 4584 } 4585 for { 4586 next, err := page.fn(ctx, page.desl) 4587 if err != nil { 4588 return err 4589 } 4590 page.desl = next 4591 if !next.hasNextLink() || !next.IsEmpty() { 4592 break 4593 } 4594 } 4595 return nil 4596} 4597 4598// Next advances to the next page of values. If there was an error making 4599// the request the page does not advance and the error is returned. 4600// Deprecated: Use NextWithContext() instead. 4601func (page *DiskEncryptionSetListPage) Next() error { 4602 return page.NextWithContext(context.Background()) 4603} 4604 4605// NotDone returns true if the page enumeration should be started or is not yet complete. 4606func (page DiskEncryptionSetListPage) NotDone() bool { 4607 return !page.desl.IsEmpty() 4608} 4609 4610// Response returns the raw server response from the last page request. 4611func (page DiskEncryptionSetListPage) Response() DiskEncryptionSetList { 4612 return page.desl 4613} 4614 4615// Values returns the slice of values for the current page or nil if there are no values. 4616func (page DiskEncryptionSetListPage) Values() []DiskEncryptionSet { 4617 if page.desl.IsEmpty() { 4618 return nil 4619 } 4620 return *page.desl.Value 4621} 4622 4623// Creates a new instance of the DiskEncryptionSetListPage type. 4624func NewDiskEncryptionSetListPage(cur DiskEncryptionSetList, getNextPage func(context.Context, DiskEncryptionSetList) (DiskEncryptionSetList, error)) DiskEncryptionSetListPage { 4625 return DiskEncryptionSetListPage{ 4626 fn: getNextPage, 4627 desl: cur, 4628 } 4629} 4630 4631// DiskEncryptionSetParameters describes the parameter of customer managed disk encryption set resource id 4632// that can be specified for disk. <br><br> NOTE: The disk encryption set resource id can only be specified 4633// for managed disk. Please refer https://aka.ms/mdssewithcmkoverview for more details. 4634type DiskEncryptionSetParameters struct { 4635 // ID - Resource Id 4636 ID *string `json:"id,omitempty"` 4637} 4638 4639// DiskEncryptionSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 4640// long-running operation. 4641type DiskEncryptionSetsCreateOrUpdateFuture struct { 4642 azure.FutureAPI 4643 // Result returns the result of the asynchronous operation. 4644 // If the operation has not completed it will return an error. 4645 Result func(DiskEncryptionSetsClient) (DiskEncryptionSet, error) 4646} 4647 4648// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4649func (future *DiskEncryptionSetsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 4650 var azFuture azure.Future 4651 if err := json.Unmarshal(body, &azFuture); err != nil { 4652 return err 4653 } 4654 future.FutureAPI = &azFuture 4655 future.Result = future.result 4656 return nil 4657} 4658 4659// result is the default implementation for DiskEncryptionSetsCreateOrUpdateFuture.Result. 4660func (future *DiskEncryptionSetsCreateOrUpdateFuture) result(client DiskEncryptionSetsClient) (desVar DiskEncryptionSet, err error) { 4661 var done bool 4662 done, err = future.DoneWithContext(context.Background(), client) 4663 if err != nil { 4664 err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 4665 return 4666 } 4667 if !done { 4668 desVar.Response.Response = future.Response() 4669 err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsCreateOrUpdateFuture") 4670 return 4671 } 4672 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4673 if desVar.Response.Response, err = future.GetResult(sender); err == nil && desVar.Response.Response.StatusCode != http.StatusNoContent { 4674 desVar, err = client.CreateOrUpdateResponder(desVar.Response.Response) 4675 if err != nil { 4676 err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsCreateOrUpdateFuture", "Result", desVar.Response.Response, "Failure responding to request") 4677 } 4678 } 4679 return 4680} 4681 4682// DiskEncryptionSetsDeleteFuture an abstraction for monitoring and retrieving the results of a 4683// long-running operation. 4684type DiskEncryptionSetsDeleteFuture struct { 4685 azure.FutureAPI 4686 // Result returns the result of the asynchronous operation. 4687 // If the operation has not completed it will return an error. 4688 Result func(DiskEncryptionSetsClient) (autorest.Response, error) 4689} 4690 4691// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4692func (future *DiskEncryptionSetsDeleteFuture) UnmarshalJSON(body []byte) error { 4693 var azFuture azure.Future 4694 if err := json.Unmarshal(body, &azFuture); err != nil { 4695 return err 4696 } 4697 future.FutureAPI = &azFuture 4698 future.Result = future.result 4699 return nil 4700} 4701 4702// result is the default implementation for DiskEncryptionSetsDeleteFuture.Result. 4703func (future *DiskEncryptionSetsDeleteFuture) result(client DiskEncryptionSetsClient) (ar autorest.Response, err error) { 4704 var done bool 4705 done, err = future.DoneWithContext(context.Background(), client) 4706 if err != nil { 4707 err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsDeleteFuture", "Result", future.Response(), "Polling failure") 4708 return 4709 } 4710 if !done { 4711 ar.Response = future.Response() 4712 err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsDeleteFuture") 4713 return 4714 } 4715 ar.Response = future.Response() 4716 return 4717} 4718 4719// DiskEncryptionSetsUpdateFuture an abstraction for monitoring and retrieving the results of a 4720// long-running operation. 4721type DiskEncryptionSetsUpdateFuture struct { 4722 azure.FutureAPI 4723 // Result returns the result of the asynchronous operation. 4724 // If the operation has not completed it will return an error. 4725 Result func(DiskEncryptionSetsClient) (DiskEncryptionSet, error) 4726} 4727 4728// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4729func (future *DiskEncryptionSetsUpdateFuture) UnmarshalJSON(body []byte) error { 4730 var azFuture azure.Future 4731 if err := json.Unmarshal(body, &azFuture); err != nil { 4732 return err 4733 } 4734 future.FutureAPI = &azFuture 4735 future.Result = future.result 4736 return nil 4737} 4738 4739// result is the default implementation for DiskEncryptionSetsUpdateFuture.Result. 4740func (future *DiskEncryptionSetsUpdateFuture) result(client DiskEncryptionSetsClient) (desVar DiskEncryptionSet, err error) { 4741 var done bool 4742 done, err = future.DoneWithContext(context.Background(), client) 4743 if err != nil { 4744 err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsUpdateFuture", "Result", future.Response(), "Polling failure") 4745 return 4746 } 4747 if !done { 4748 desVar.Response.Response = future.Response() 4749 err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsUpdateFuture") 4750 return 4751 } 4752 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4753 if desVar.Response.Response, err = future.GetResult(sender); err == nil && desVar.Response.Response.StatusCode != http.StatusNoContent { 4754 desVar, err = client.UpdateResponder(desVar.Response.Response) 4755 if err != nil { 4756 err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsUpdateFuture", "Result", desVar.Response.Response, "Failure responding to request") 4757 } 4758 } 4759 return 4760} 4761 4762// DiskEncryptionSettings describes a Encryption Settings for a Disk 4763type DiskEncryptionSettings struct { 4764 // DiskEncryptionKey - Specifies the location of the disk encryption key, which is a Key Vault Secret. 4765 DiskEncryptionKey *KeyVaultSecretReference `json:"diskEncryptionKey,omitempty"` 4766 // KeyEncryptionKey - Specifies the location of the key encryption key in Key Vault. 4767 KeyEncryptionKey *KeyVaultKeyReference `json:"keyEncryptionKey,omitempty"` 4768 // Enabled - Specifies whether disk encryption should be enabled on the virtual machine. 4769 Enabled *bool `json:"enabled,omitempty"` 4770} 4771 4772// DiskEncryptionSetUpdate disk encryption set update resource. 4773type DiskEncryptionSetUpdate struct { 4774 *DiskEncryptionSetUpdateProperties `json:"properties,omitempty"` 4775 // Tags - Resource tags 4776 Tags map[string]*string `json:"tags"` 4777 Identity *EncryptionSetIdentity `json:"identity,omitempty"` 4778} 4779 4780// MarshalJSON is the custom marshaler for DiskEncryptionSetUpdate. 4781func (desu DiskEncryptionSetUpdate) MarshalJSON() ([]byte, error) { 4782 objectMap := make(map[string]interface{}) 4783 if desu.DiskEncryptionSetUpdateProperties != nil { 4784 objectMap["properties"] = desu.DiskEncryptionSetUpdateProperties 4785 } 4786 if desu.Tags != nil { 4787 objectMap["tags"] = desu.Tags 4788 } 4789 if desu.Identity != nil { 4790 objectMap["identity"] = desu.Identity 4791 } 4792 return json.Marshal(objectMap) 4793} 4794 4795// UnmarshalJSON is the custom unmarshaler for DiskEncryptionSetUpdate struct. 4796func (desu *DiskEncryptionSetUpdate) UnmarshalJSON(body []byte) error { 4797 var m map[string]*json.RawMessage 4798 err := json.Unmarshal(body, &m) 4799 if err != nil { 4800 return err 4801 } 4802 for k, v := range m { 4803 switch k { 4804 case "properties": 4805 if v != nil { 4806 var diskEncryptionSetUpdateProperties DiskEncryptionSetUpdateProperties 4807 err = json.Unmarshal(*v, &diskEncryptionSetUpdateProperties) 4808 if err != nil { 4809 return err 4810 } 4811 desu.DiskEncryptionSetUpdateProperties = &diskEncryptionSetUpdateProperties 4812 } 4813 case "tags": 4814 if v != nil { 4815 var tags map[string]*string 4816 err = json.Unmarshal(*v, &tags) 4817 if err != nil { 4818 return err 4819 } 4820 desu.Tags = tags 4821 } 4822 case "identity": 4823 if v != nil { 4824 var identity EncryptionSetIdentity 4825 err = json.Unmarshal(*v, &identity) 4826 if err != nil { 4827 return err 4828 } 4829 desu.Identity = &identity 4830 } 4831 } 4832 } 4833 4834 return nil 4835} 4836 4837// DiskEncryptionSetUpdateProperties disk encryption set resource update properties. 4838type DiskEncryptionSetUpdateProperties struct { 4839 // EncryptionType - Possible values include: 'DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey', 'DiskEncryptionSetTypeEncryptionAtRestWithPlatformAndCustomerKeys' 4840 EncryptionType DiskEncryptionSetType `json:"encryptionType,omitempty"` 4841 ActiveKey *KeyForDiskEncryptionSet `json:"activeKey,omitempty"` 4842 // RotationToLatestKeyVersionEnabled - Set this flag to true to enable auto-updating of this disk encryption set to the latest key version. 4843 RotationToLatestKeyVersionEnabled *bool `json:"rotationToLatestKeyVersionEnabled,omitempty"` 4844} 4845 4846// DiskImageEncryption this is the disk image encryption base class. 4847type DiskImageEncryption struct { 4848 // DiskEncryptionSetID - A relative URI containing the resource ID of the disk encryption set. 4849 DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` 4850} 4851 4852// DiskInstanceView the instance view of the disk. 4853type DiskInstanceView struct { 4854 // Name - The disk name. 4855 Name *string `json:"name,omitempty"` 4856 // EncryptionSettings - Specifies the encryption settings for the OS Disk. <br><br> Minimum api-version: 2015-06-15 4857 EncryptionSettings *[]DiskEncryptionSettings `json:"encryptionSettings,omitempty"` 4858 // Statuses - The resource status information. 4859 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 4860} 4861 4862// DiskList the List Disks operation response. 4863type DiskList struct { 4864 autorest.Response `json:"-"` 4865 // Value - A list of disks. 4866 Value *[]Disk `json:"value,omitempty"` 4867 // NextLink - The uri to fetch the next page of disks. Call ListNext() with this to fetch the next page of disks. 4868 NextLink *string `json:"nextLink,omitempty"` 4869} 4870 4871// DiskListIterator provides access to a complete listing of Disk values. 4872type DiskListIterator struct { 4873 i int 4874 page DiskListPage 4875} 4876 4877// NextWithContext advances to the next value. If there was an error making 4878// the request the iterator does not advance and the error is returned. 4879func (iter *DiskListIterator) NextWithContext(ctx context.Context) (err error) { 4880 if tracing.IsEnabled() { 4881 ctx = tracing.StartSpan(ctx, fqdn+"/DiskListIterator.NextWithContext") 4882 defer func() { 4883 sc := -1 4884 if iter.Response().Response.Response != nil { 4885 sc = iter.Response().Response.Response.StatusCode 4886 } 4887 tracing.EndSpan(ctx, sc, err) 4888 }() 4889 } 4890 iter.i++ 4891 if iter.i < len(iter.page.Values()) { 4892 return nil 4893 } 4894 err = iter.page.NextWithContext(ctx) 4895 if err != nil { 4896 iter.i-- 4897 return err 4898 } 4899 iter.i = 0 4900 return nil 4901} 4902 4903// Next advances to the next value. If there was an error making 4904// the request the iterator does not advance and the error is returned. 4905// Deprecated: Use NextWithContext() instead. 4906func (iter *DiskListIterator) Next() error { 4907 return iter.NextWithContext(context.Background()) 4908} 4909 4910// NotDone returns true if the enumeration should be started or is not yet complete. 4911func (iter DiskListIterator) NotDone() bool { 4912 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4913} 4914 4915// Response returns the raw server response from the last page request. 4916func (iter DiskListIterator) Response() DiskList { 4917 return iter.page.Response() 4918} 4919 4920// Value returns the current value or a zero-initialized value if the 4921// iterator has advanced beyond the end of the collection. 4922func (iter DiskListIterator) Value() Disk { 4923 if !iter.page.NotDone() { 4924 return Disk{} 4925 } 4926 return iter.page.Values()[iter.i] 4927} 4928 4929// Creates a new instance of the DiskListIterator type. 4930func NewDiskListIterator(page DiskListPage) DiskListIterator { 4931 return DiskListIterator{page: page} 4932} 4933 4934// IsEmpty returns true if the ListResult contains no values. 4935func (dl DiskList) IsEmpty() bool { 4936 return dl.Value == nil || len(*dl.Value) == 0 4937} 4938 4939// hasNextLink returns true if the NextLink is not empty. 4940func (dl DiskList) hasNextLink() bool { 4941 return dl.NextLink != nil && len(*dl.NextLink) != 0 4942} 4943 4944// diskListPreparer prepares a request to retrieve the next set of results. 4945// It returns nil if no more results exist. 4946func (dl DiskList) diskListPreparer(ctx context.Context) (*http.Request, error) { 4947 if !dl.hasNextLink() { 4948 return nil, nil 4949 } 4950 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4951 autorest.AsJSON(), 4952 autorest.AsGet(), 4953 autorest.WithBaseURL(to.String(dl.NextLink))) 4954} 4955 4956// DiskListPage contains a page of Disk values. 4957type DiskListPage struct { 4958 fn func(context.Context, DiskList) (DiskList, error) 4959 dl DiskList 4960} 4961 4962// NextWithContext advances to the next page of values. If there was an error making 4963// the request the page does not advance and the error is returned. 4964func (page *DiskListPage) NextWithContext(ctx context.Context) (err error) { 4965 if tracing.IsEnabled() { 4966 ctx = tracing.StartSpan(ctx, fqdn+"/DiskListPage.NextWithContext") 4967 defer func() { 4968 sc := -1 4969 if page.Response().Response.Response != nil { 4970 sc = page.Response().Response.Response.StatusCode 4971 } 4972 tracing.EndSpan(ctx, sc, err) 4973 }() 4974 } 4975 for { 4976 next, err := page.fn(ctx, page.dl) 4977 if err != nil { 4978 return err 4979 } 4980 page.dl = next 4981 if !next.hasNextLink() || !next.IsEmpty() { 4982 break 4983 } 4984 } 4985 return nil 4986} 4987 4988// Next advances to the next page of values. If there was an error making 4989// the request the page does not advance and the error is returned. 4990// Deprecated: Use NextWithContext() instead. 4991func (page *DiskListPage) Next() error { 4992 return page.NextWithContext(context.Background()) 4993} 4994 4995// NotDone returns true if the page enumeration should be started or is not yet complete. 4996func (page DiskListPage) NotDone() bool { 4997 return !page.dl.IsEmpty() 4998} 4999 5000// Response returns the raw server response from the last page request. 5001func (page DiskListPage) Response() DiskList { 5002 return page.dl 5003} 5004 5005// Values returns the slice of values for the current page or nil if there are no values. 5006func (page DiskListPage) Values() []Disk { 5007 if page.dl.IsEmpty() { 5008 return nil 5009 } 5010 return *page.dl.Value 5011} 5012 5013// Creates a new instance of the DiskListPage type. 5014func NewDiskListPage(cur DiskList, getNextPage func(context.Context, DiskList) (DiskList, error)) DiskListPage { 5015 return DiskListPage{ 5016 fn: getNextPage, 5017 dl: cur, 5018 } 5019} 5020 5021// DiskProperties disk resource properties. 5022type DiskProperties struct { 5023 // TimeCreated - READ-ONLY; The time when the disk was created. 5024 TimeCreated *date.Time `json:"timeCreated,omitempty"` 5025 // OsType - The Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' 5026 OsType OperatingSystemTypes `json:"osType,omitempty"` 5027 // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'HyperVGenerationV1', 'HyperVGenerationV2' 5028 HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` 5029 // PurchasePlan - Purchase plan information for the the image from which the OS disk was created. E.g. - {name: 2019-Datacenter, publisher: MicrosoftWindowsServer, product: WindowsServer} 5030 PurchasePlan *PurchasePlan `json:"purchasePlan,omitempty"` 5031 // CreationData - Disk source information. CreationData information cannot be changed after the disk has been created. 5032 CreationData *CreationData `json:"creationData,omitempty"` 5033 // 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. 5034 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 5035 // DiskSizeBytes - READ-ONLY; The size of the disk in bytes. This field is read only. 5036 DiskSizeBytes *int64 `json:"diskSizeBytes,omitempty"` 5037 // UniqueID - READ-ONLY; Unique Guid identifying the resource. 5038 UniqueID *string `json:"uniqueId,omitempty"` 5039 // EncryptionSettingsCollection - Encryption settings collection used for Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. 5040 EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` 5041 // ProvisioningState - READ-ONLY; The disk provisioning state. 5042 ProvisioningState *string `json:"provisioningState,omitempty"` 5043 // DiskIOPSReadWrite - The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. 5044 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 5045 // 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. 5046 DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` 5047 // 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. 5048 DiskIOPSReadOnly *int64 `json:"diskIOPSReadOnly,omitempty"` 5049 // 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. 5050 DiskMBpsReadOnly *int64 `json:"diskMBpsReadOnly,omitempty"` 5051 // DiskState - The state of the disk. Possible values include: 'DiskStateUnattached', 'DiskStateAttached', 'DiskStateReserved', 'DiskStateActiveSAS', 'DiskStateReadyToUpload', 'DiskStateActiveUpload' 5052 DiskState DiskState `json:"diskState,omitempty"` 5053 // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 5054 Encryption *Encryption `json:"encryption,omitempty"` 5055 // 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. 5056 MaxShares *int32 `json:"maxShares,omitempty"` 5057 // 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. 5058 ShareInfo *[]ShareInfoElement `json:"shareInfo,omitempty"` 5059 // NetworkAccessPolicy - Possible values include: 'NetworkAccessPolicyAllowAll', 'NetworkAccessPolicyAllowPrivate', 'NetworkAccessPolicyDenyAll' 5060 NetworkAccessPolicy NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` 5061 // DiskAccessID - ARM id of the DiskAccess resource for using private endpoints on disks. 5062 DiskAccessID *string `json:"diskAccessId,omitempty"` 5063 // 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. 5064 Tier *string `json:"tier,omitempty"` 5065 // 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. 5066 BurstingEnabled *bool `json:"burstingEnabled,omitempty"` 5067 // PropertyUpdatesInProgress - READ-ONLY; Properties of the disk for which update is pending. 5068 PropertyUpdatesInProgress *PropertyUpdatesInProgress `json:"propertyUpdatesInProgress,omitempty"` 5069 // SupportsHibernation - Indicates the OS on a disk supports hibernation. 5070 SupportsHibernation *bool `json:"supportsHibernation,omitempty"` 5071 // SecurityProfile - Contains the security related information for the resource. 5072 SecurityProfile *DiskSecurityProfile `json:"securityProfile,omitempty"` 5073} 5074 5075// MarshalJSON is the custom marshaler for DiskProperties. 5076func (dp DiskProperties) MarshalJSON() ([]byte, error) { 5077 objectMap := make(map[string]interface{}) 5078 if dp.OsType != "" { 5079 objectMap["osType"] = dp.OsType 5080 } 5081 if dp.HyperVGeneration != "" { 5082 objectMap["hyperVGeneration"] = dp.HyperVGeneration 5083 } 5084 if dp.PurchasePlan != nil { 5085 objectMap["purchasePlan"] = dp.PurchasePlan 5086 } 5087 if dp.CreationData != nil { 5088 objectMap["creationData"] = dp.CreationData 5089 } 5090 if dp.DiskSizeGB != nil { 5091 objectMap["diskSizeGB"] = dp.DiskSizeGB 5092 } 5093 if dp.EncryptionSettingsCollection != nil { 5094 objectMap["encryptionSettingsCollection"] = dp.EncryptionSettingsCollection 5095 } 5096 if dp.DiskIOPSReadWrite != nil { 5097 objectMap["diskIOPSReadWrite"] = dp.DiskIOPSReadWrite 5098 } 5099 if dp.DiskMBpsReadWrite != nil { 5100 objectMap["diskMBpsReadWrite"] = dp.DiskMBpsReadWrite 5101 } 5102 if dp.DiskIOPSReadOnly != nil { 5103 objectMap["diskIOPSReadOnly"] = dp.DiskIOPSReadOnly 5104 } 5105 if dp.DiskMBpsReadOnly != nil { 5106 objectMap["diskMBpsReadOnly"] = dp.DiskMBpsReadOnly 5107 } 5108 if dp.DiskState != "" { 5109 objectMap["diskState"] = dp.DiskState 5110 } 5111 if dp.Encryption != nil { 5112 objectMap["encryption"] = dp.Encryption 5113 } 5114 if dp.MaxShares != nil { 5115 objectMap["maxShares"] = dp.MaxShares 5116 } 5117 if dp.NetworkAccessPolicy != "" { 5118 objectMap["networkAccessPolicy"] = dp.NetworkAccessPolicy 5119 } 5120 if dp.DiskAccessID != nil { 5121 objectMap["diskAccessId"] = dp.DiskAccessID 5122 } 5123 if dp.Tier != nil { 5124 objectMap["tier"] = dp.Tier 5125 } 5126 if dp.BurstingEnabled != nil { 5127 objectMap["burstingEnabled"] = dp.BurstingEnabled 5128 } 5129 if dp.SupportsHibernation != nil { 5130 objectMap["supportsHibernation"] = dp.SupportsHibernation 5131 } 5132 if dp.SecurityProfile != nil { 5133 objectMap["securityProfile"] = dp.SecurityProfile 5134 } 5135 return json.Marshal(objectMap) 5136} 5137 5138// DiskRestorePoint properties of disk restore point 5139type DiskRestorePoint struct { 5140 autorest.Response `json:"-"` 5141 *DiskRestorePointProperties `json:"properties,omitempty"` 5142 // ID - READ-ONLY; Resource Id 5143 ID *string `json:"id,omitempty"` 5144 // Name - READ-ONLY; Resource name 5145 Name *string `json:"name,omitempty"` 5146 // Type - READ-ONLY; Resource type 5147 Type *string `json:"type,omitempty"` 5148} 5149 5150// MarshalJSON is the custom marshaler for DiskRestorePoint. 5151func (drp DiskRestorePoint) MarshalJSON() ([]byte, error) { 5152 objectMap := make(map[string]interface{}) 5153 if drp.DiskRestorePointProperties != nil { 5154 objectMap["properties"] = drp.DiskRestorePointProperties 5155 } 5156 return json.Marshal(objectMap) 5157} 5158 5159// UnmarshalJSON is the custom unmarshaler for DiskRestorePoint struct. 5160func (drp *DiskRestorePoint) UnmarshalJSON(body []byte) error { 5161 var m map[string]*json.RawMessage 5162 err := json.Unmarshal(body, &m) 5163 if err != nil { 5164 return err 5165 } 5166 for k, v := range m { 5167 switch k { 5168 case "properties": 5169 if v != nil { 5170 var diskRestorePointProperties DiskRestorePointProperties 5171 err = json.Unmarshal(*v, &diskRestorePointProperties) 5172 if err != nil { 5173 return err 5174 } 5175 drp.DiskRestorePointProperties = &diskRestorePointProperties 5176 } 5177 case "id": 5178 if v != nil { 5179 var ID string 5180 err = json.Unmarshal(*v, &ID) 5181 if err != nil { 5182 return err 5183 } 5184 drp.ID = &ID 5185 } 5186 case "name": 5187 if v != nil { 5188 var name string 5189 err = json.Unmarshal(*v, &name) 5190 if err != nil { 5191 return err 5192 } 5193 drp.Name = &name 5194 } 5195 case "type": 5196 if v != nil { 5197 var typeVar string 5198 err = json.Unmarshal(*v, &typeVar) 5199 if err != nil { 5200 return err 5201 } 5202 drp.Type = &typeVar 5203 } 5204 } 5205 } 5206 5207 return nil 5208} 5209 5210// DiskRestorePointGrantAccessFuture an abstraction for monitoring and retrieving the results of a 5211// long-running operation. 5212type DiskRestorePointGrantAccessFuture struct { 5213 azure.FutureAPI 5214 // Result returns the result of the asynchronous operation. 5215 // If the operation has not completed it will return an error. 5216 Result func(DiskRestorePointClient) (AccessURI, error) 5217} 5218 5219// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5220func (future *DiskRestorePointGrantAccessFuture) UnmarshalJSON(body []byte) error { 5221 var azFuture azure.Future 5222 if err := json.Unmarshal(body, &azFuture); err != nil { 5223 return err 5224 } 5225 future.FutureAPI = &azFuture 5226 future.Result = future.result 5227 return nil 5228} 5229 5230// result is the default implementation for DiskRestorePointGrantAccessFuture.Result. 5231func (future *DiskRestorePointGrantAccessFuture) result(client DiskRestorePointClient) (au AccessURI, err error) { 5232 var done bool 5233 done, err = future.DoneWithContext(context.Background(), client) 5234 if err != nil { 5235 err = autorest.NewErrorWithError(err, "compute.DiskRestorePointGrantAccessFuture", "Result", future.Response(), "Polling failure") 5236 return 5237 } 5238 if !done { 5239 au.Response.Response = future.Response() 5240 err = azure.NewAsyncOpIncompleteError("compute.DiskRestorePointGrantAccessFuture") 5241 return 5242 } 5243 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5244 if au.Response.Response, err = future.GetResult(sender); err == nil && au.Response.Response.StatusCode != http.StatusNoContent { 5245 au, err = client.GrantAccessResponder(au.Response.Response) 5246 if err != nil { 5247 err = autorest.NewErrorWithError(err, "compute.DiskRestorePointGrantAccessFuture", "Result", au.Response.Response, "Failure responding to request") 5248 } 5249 } 5250 return 5251} 5252 5253// DiskRestorePointList the List Disk Restore Points operation response. 5254type DiskRestorePointList struct { 5255 autorest.Response `json:"-"` 5256 // Value - A list of disk restore points. 5257 Value *[]DiskRestorePoint `json:"value,omitempty"` 5258 // 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. 5259 NextLink *string `json:"nextLink,omitempty"` 5260} 5261 5262// DiskRestorePointListIterator provides access to a complete listing of DiskRestorePoint values. 5263type DiskRestorePointListIterator struct { 5264 i int 5265 page DiskRestorePointListPage 5266} 5267 5268// NextWithContext advances to the next value. If there was an error making 5269// the request the iterator does not advance and the error is returned. 5270func (iter *DiskRestorePointListIterator) NextWithContext(ctx context.Context) (err error) { 5271 if tracing.IsEnabled() { 5272 ctx = tracing.StartSpan(ctx, fqdn+"/DiskRestorePointListIterator.NextWithContext") 5273 defer func() { 5274 sc := -1 5275 if iter.Response().Response.Response != nil { 5276 sc = iter.Response().Response.Response.StatusCode 5277 } 5278 tracing.EndSpan(ctx, sc, err) 5279 }() 5280 } 5281 iter.i++ 5282 if iter.i < len(iter.page.Values()) { 5283 return nil 5284 } 5285 err = iter.page.NextWithContext(ctx) 5286 if err != nil { 5287 iter.i-- 5288 return err 5289 } 5290 iter.i = 0 5291 return nil 5292} 5293 5294// Next advances to the next value. If there was an error making 5295// the request the iterator does not advance and the error is returned. 5296// Deprecated: Use NextWithContext() instead. 5297func (iter *DiskRestorePointListIterator) Next() error { 5298 return iter.NextWithContext(context.Background()) 5299} 5300 5301// NotDone returns true if the enumeration should be started or is not yet complete. 5302func (iter DiskRestorePointListIterator) NotDone() bool { 5303 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5304} 5305 5306// Response returns the raw server response from the last page request. 5307func (iter DiskRestorePointListIterator) Response() DiskRestorePointList { 5308 return iter.page.Response() 5309} 5310 5311// Value returns the current value or a zero-initialized value if the 5312// iterator has advanced beyond the end of the collection. 5313func (iter DiskRestorePointListIterator) Value() DiskRestorePoint { 5314 if !iter.page.NotDone() { 5315 return DiskRestorePoint{} 5316 } 5317 return iter.page.Values()[iter.i] 5318} 5319 5320// Creates a new instance of the DiskRestorePointListIterator type. 5321func NewDiskRestorePointListIterator(page DiskRestorePointListPage) DiskRestorePointListIterator { 5322 return DiskRestorePointListIterator{page: page} 5323} 5324 5325// IsEmpty returns true if the ListResult contains no values. 5326func (drpl DiskRestorePointList) IsEmpty() bool { 5327 return drpl.Value == nil || len(*drpl.Value) == 0 5328} 5329 5330// hasNextLink returns true if the NextLink is not empty. 5331func (drpl DiskRestorePointList) hasNextLink() bool { 5332 return drpl.NextLink != nil && len(*drpl.NextLink) != 0 5333} 5334 5335// diskRestorePointListPreparer prepares a request to retrieve the next set of results. 5336// It returns nil if no more results exist. 5337func (drpl DiskRestorePointList) diskRestorePointListPreparer(ctx context.Context) (*http.Request, error) { 5338 if !drpl.hasNextLink() { 5339 return nil, nil 5340 } 5341 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5342 autorest.AsJSON(), 5343 autorest.AsGet(), 5344 autorest.WithBaseURL(to.String(drpl.NextLink))) 5345} 5346 5347// DiskRestorePointListPage contains a page of DiskRestorePoint values. 5348type DiskRestorePointListPage struct { 5349 fn func(context.Context, DiskRestorePointList) (DiskRestorePointList, error) 5350 drpl DiskRestorePointList 5351} 5352 5353// NextWithContext advances to the next page of values. If there was an error making 5354// the request the page does not advance and the error is returned. 5355func (page *DiskRestorePointListPage) NextWithContext(ctx context.Context) (err error) { 5356 if tracing.IsEnabled() { 5357 ctx = tracing.StartSpan(ctx, fqdn+"/DiskRestorePointListPage.NextWithContext") 5358 defer func() { 5359 sc := -1 5360 if page.Response().Response.Response != nil { 5361 sc = page.Response().Response.Response.StatusCode 5362 } 5363 tracing.EndSpan(ctx, sc, err) 5364 }() 5365 } 5366 for { 5367 next, err := page.fn(ctx, page.drpl) 5368 if err != nil { 5369 return err 5370 } 5371 page.drpl = next 5372 if !next.hasNextLink() || !next.IsEmpty() { 5373 break 5374 } 5375 } 5376 return nil 5377} 5378 5379// Next advances to the next page of values. If there was an error making 5380// the request the page does not advance and the error is returned. 5381// Deprecated: Use NextWithContext() instead. 5382func (page *DiskRestorePointListPage) Next() error { 5383 return page.NextWithContext(context.Background()) 5384} 5385 5386// NotDone returns true if the page enumeration should be started or is not yet complete. 5387func (page DiskRestorePointListPage) NotDone() bool { 5388 return !page.drpl.IsEmpty() 5389} 5390 5391// Response returns the raw server response from the last page request. 5392func (page DiskRestorePointListPage) Response() DiskRestorePointList { 5393 return page.drpl 5394} 5395 5396// Values returns the slice of values for the current page or nil if there are no values. 5397func (page DiskRestorePointListPage) Values() []DiskRestorePoint { 5398 if page.drpl.IsEmpty() { 5399 return nil 5400 } 5401 return *page.drpl.Value 5402} 5403 5404// Creates a new instance of the DiskRestorePointListPage type. 5405func NewDiskRestorePointListPage(cur DiskRestorePointList, getNextPage func(context.Context, DiskRestorePointList) (DiskRestorePointList, error)) DiskRestorePointListPage { 5406 return DiskRestorePointListPage{ 5407 fn: getNextPage, 5408 drpl: cur, 5409 } 5410} 5411 5412// DiskRestorePointProperties properties of an incremental disk restore point 5413type DiskRestorePointProperties struct { 5414 // TimeCreated - READ-ONLY; The timestamp of restorePoint creation 5415 TimeCreated *date.Time `json:"timeCreated,omitempty"` 5416 // SourceResourceID - READ-ONLY; arm id of source disk 5417 SourceResourceID *string `json:"sourceResourceId,omitempty"` 5418 // OsType - READ-ONLY; The Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' 5419 OsType OperatingSystemTypes `json:"osType,omitempty"` 5420 // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'HyperVGenerationV1', 'HyperVGenerationV2' 5421 HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` 5422 // PurchasePlan - Purchase plan information for the the image from which the OS disk was created. 5423 PurchasePlan *PurchasePlan `json:"purchasePlan,omitempty"` 5424 // FamilyID - READ-ONLY; id of the backing snapshot's MIS family 5425 FamilyID *string `json:"familyId,omitempty"` 5426 // SourceUniqueID - READ-ONLY; unique incarnation id of the source disk 5427 SourceUniqueID *string `json:"sourceUniqueId,omitempty"` 5428 // Encryption - READ-ONLY; Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 5429 Encryption *Encryption `json:"encryption,omitempty"` 5430 // SupportsHibernation - Indicates the OS on a disk supports hibernation. 5431 SupportsHibernation *bool `json:"supportsHibernation,omitempty"` 5432} 5433 5434// MarshalJSON is the custom marshaler for DiskRestorePointProperties. 5435func (drpp DiskRestorePointProperties) MarshalJSON() ([]byte, error) { 5436 objectMap := make(map[string]interface{}) 5437 if drpp.HyperVGeneration != "" { 5438 objectMap["hyperVGeneration"] = drpp.HyperVGeneration 5439 } 5440 if drpp.PurchasePlan != nil { 5441 objectMap["purchasePlan"] = drpp.PurchasePlan 5442 } 5443 if drpp.SupportsHibernation != nil { 5444 objectMap["supportsHibernation"] = drpp.SupportsHibernation 5445 } 5446 return json.Marshal(objectMap) 5447} 5448 5449// DiskRestorePointRevokeAccessFuture an abstraction for monitoring and retrieving the results of a 5450// long-running operation. 5451type DiskRestorePointRevokeAccessFuture struct { 5452 azure.FutureAPI 5453 // Result returns the result of the asynchronous operation. 5454 // If the operation has not completed it will return an error. 5455 Result func(DiskRestorePointClient) (autorest.Response, error) 5456} 5457 5458// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5459func (future *DiskRestorePointRevokeAccessFuture) UnmarshalJSON(body []byte) error { 5460 var azFuture azure.Future 5461 if err := json.Unmarshal(body, &azFuture); err != nil { 5462 return err 5463 } 5464 future.FutureAPI = &azFuture 5465 future.Result = future.result 5466 return nil 5467} 5468 5469// result is the default implementation for DiskRestorePointRevokeAccessFuture.Result. 5470func (future *DiskRestorePointRevokeAccessFuture) result(client DiskRestorePointClient) (ar autorest.Response, err error) { 5471 var done bool 5472 done, err = future.DoneWithContext(context.Background(), client) 5473 if err != nil { 5474 err = autorest.NewErrorWithError(err, "compute.DiskRestorePointRevokeAccessFuture", "Result", future.Response(), "Polling failure") 5475 return 5476 } 5477 if !done { 5478 ar.Response = future.Response() 5479 err = azure.NewAsyncOpIncompleteError("compute.DiskRestorePointRevokeAccessFuture") 5480 return 5481 } 5482 ar.Response = future.Response() 5483 return 5484} 5485 5486// DisksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 5487// operation. 5488type DisksCreateOrUpdateFuture struct { 5489 azure.FutureAPI 5490 // Result returns the result of the asynchronous operation. 5491 // If the operation has not completed it will return an error. 5492 Result func(DisksClient) (Disk, error) 5493} 5494 5495// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5496func (future *DisksCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 5497 var azFuture azure.Future 5498 if err := json.Unmarshal(body, &azFuture); err != nil { 5499 return err 5500 } 5501 future.FutureAPI = &azFuture 5502 future.Result = future.result 5503 return nil 5504} 5505 5506// result is the default implementation for DisksCreateOrUpdateFuture.Result. 5507func (future *DisksCreateOrUpdateFuture) result(client DisksClient) (d Disk, err error) { 5508 var done bool 5509 done, err = future.DoneWithContext(context.Background(), client) 5510 if err != nil { 5511 err = autorest.NewErrorWithError(err, "compute.DisksCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 5512 return 5513 } 5514 if !done { 5515 d.Response.Response = future.Response() 5516 err = azure.NewAsyncOpIncompleteError("compute.DisksCreateOrUpdateFuture") 5517 return 5518 } 5519 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5520 if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent { 5521 d, err = client.CreateOrUpdateResponder(d.Response.Response) 5522 if err != nil { 5523 err = autorest.NewErrorWithError(err, "compute.DisksCreateOrUpdateFuture", "Result", d.Response.Response, "Failure responding to request") 5524 } 5525 } 5526 return 5527} 5528 5529// DisksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 5530type DisksDeleteFuture struct { 5531 azure.FutureAPI 5532 // Result returns the result of the asynchronous operation. 5533 // If the operation has not completed it will return an error. 5534 Result func(DisksClient) (autorest.Response, error) 5535} 5536 5537// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5538func (future *DisksDeleteFuture) UnmarshalJSON(body []byte) error { 5539 var azFuture azure.Future 5540 if err := json.Unmarshal(body, &azFuture); err != nil { 5541 return err 5542 } 5543 future.FutureAPI = &azFuture 5544 future.Result = future.result 5545 return nil 5546} 5547 5548// result is the default implementation for DisksDeleteFuture.Result. 5549func (future *DisksDeleteFuture) result(client DisksClient) (ar autorest.Response, err error) { 5550 var done bool 5551 done, err = future.DoneWithContext(context.Background(), client) 5552 if err != nil { 5553 err = autorest.NewErrorWithError(err, "compute.DisksDeleteFuture", "Result", future.Response(), "Polling failure") 5554 return 5555 } 5556 if !done { 5557 ar.Response = future.Response() 5558 err = azure.NewAsyncOpIncompleteError("compute.DisksDeleteFuture") 5559 return 5560 } 5561 ar.Response = future.Response() 5562 return 5563} 5564 5565// DiskSecurityProfile contains the security related information for the resource. 5566type DiskSecurityProfile struct { 5567 // SecurityType - Possible values include: 'DiskSecurityTypesTrustedLaunch' 5568 SecurityType DiskSecurityTypes `json:"securityType,omitempty"` 5569} 5570 5571// DisksGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running 5572// operation. 5573type DisksGrantAccessFuture struct { 5574 azure.FutureAPI 5575 // Result returns the result of the asynchronous operation. 5576 // If the operation has not completed it will return an error. 5577 Result func(DisksClient) (AccessURI, error) 5578} 5579 5580// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5581func (future *DisksGrantAccessFuture) UnmarshalJSON(body []byte) error { 5582 var azFuture azure.Future 5583 if err := json.Unmarshal(body, &azFuture); err != nil { 5584 return err 5585 } 5586 future.FutureAPI = &azFuture 5587 future.Result = future.result 5588 return nil 5589} 5590 5591// result is the default implementation for DisksGrantAccessFuture.Result. 5592func (future *DisksGrantAccessFuture) result(client DisksClient) (au AccessURI, err error) { 5593 var done bool 5594 done, err = future.DoneWithContext(context.Background(), client) 5595 if err != nil { 5596 err = autorest.NewErrorWithError(err, "compute.DisksGrantAccessFuture", "Result", future.Response(), "Polling failure") 5597 return 5598 } 5599 if !done { 5600 au.Response.Response = future.Response() 5601 err = azure.NewAsyncOpIncompleteError("compute.DisksGrantAccessFuture") 5602 return 5603 } 5604 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5605 if au.Response.Response, err = future.GetResult(sender); err == nil && au.Response.Response.StatusCode != http.StatusNoContent { 5606 au, err = client.GrantAccessResponder(au.Response.Response) 5607 if err != nil { 5608 err = autorest.NewErrorWithError(err, "compute.DisksGrantAccessFuture", "Result", au.Response.Response, "Failure responding to request") 5609 } 5610 } 5611 return 5612} 5613 5614// DiskSku the disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, 5615// Premium_ZRS, or StandardSSD_ZRS. 5616type DiskSku struct { 5617 // Name - The sku name. Possible values include: 'DiskStorageAccountTypesStandardLRS', 'DiskStorageAccountTypesPremiumLRS', 'DiskStorageAccountTypesStandardSSDLRS', 'DiskStorageAccountTypesUltraSSDLRS', 'DiskStorageAccountTypesPremiumZRS', 'DiskStorageAccountTypesStandardSSDZRS' 5618 Name DiskStorageAccountTypes `json:"name,omitempty"` 5619 // Tier - READ-ONLY; The sku tier. 5620 Tier *string `json:"tier,omitempty"` 5621} 5622 5623// MarshalJSON is the custom marshaler for DiskSku. 5624func (ds DiskSku) MarshalJSON() ([]byte, error) { 5625 objectMap := make(map[string]interface{}) 5626 if ds.Name != "" { 5627 objectMap["name"] = ds.Name 5628 } 5629 return json.Marshal(objectMap) 5630} 5631 5632// DisksRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running 5633// operation. 5634type DisksRevokeAccessFuture struct { 5635 azure.FutureAPI 5636 // Result returns the result of the asynchronous operation. 5637 // If the operation has not completed it will return an error. 5638 Result func(DisksClient) (autorest.Response, error) 5639} 5640 5641// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5642func (future *DisksRevokeAccessFuture) UnmarshalJSON(body []byte) error { 5643 var azFuture azure.Future 5644 if err := json.Unmarshal(body, &azFuture); err != nil { 5645 return err 5646 } 5647 future.FutureAPI = &azFuture 5648 future.Result = future.result 5649 return nil 5650} 5651 5652// result is the default implementation for DisksRevokeAccessFuture.Result. 5653func (future *DisksRevokeAccessFuture) result(client DisksClient) (ar autorest.Response, err error) { 5654 var done bool 5655 done, err = future.DoneWithContext(context.Background(), client) 5656 if err != nil { 5657 err = autorest.NewErrorWithError(err, "compute.DisksRevokeAccessFuture", "Result", future.Response(), "Polling failure") 5658 return 5659 } 5660 if !done { 5661 ar.Response = future.Response() 5662 err = azure.NewAsyncOpIncompleteError("compute.DisksRevokeAccessFuture") 5663 return 5664 } 5665 ar.Response = future.Response() 5666 return 5667} 5668 5669// DisksUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. 5670type DisksUpdateFuture struct { 5671 azure.FutureAPI 5672 // Result returns the result of the asynchronous operation. 5673 // If the operation has not completed it will return an error. 5674 Result func(DisksClient) (Disk, error) 5675} 5676 5677// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5678func (future *DisksUpdateFuture) UnmarshalJSON(body []byte) error { 5679 var azFuture azure.Future 5680 if err := json.Unmarshal(body, &azFuture); err != nil { 5681 return err 5682 } 5683 future.FutureAPI = &azFuture 5684 future.Result = future.result 5685 return nil 5686} 5687 5688// result is the default implementation for DisksUpdateFuture.Result. 5689func (future *DisksUpdateFuture) result(client DisksClient) (d Disk, err error) { 5690 var done bool 5691 done, err = future.DoneWithContext(context.Background(), client) 5692 if err != nil { 5693 err = autorest.NewErrorWithError(err, "compute.DisksUpdateFuture", "Result", future.Response(), "Polling failure") 5694 return 5695 } 5696 if !done { 5697 d.Response.Response = future.Response() 5698 err = azure.NewAsyncOpIncompleteError("compute.DisksUpdateFuture") 5699 return 5700 } 5701 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5702 if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent { 5703 d, err = client.UpdateResponder(d.Response.Response) 5704 if err != nil { 5705 err = autorest.NewErrorWithError(err, "compute.DisksUpdateFuture", "Result", d.Response.Response, "Failure responding to request") 5706 } 5707 } 5708 return 5709} 5710 5711// DiskUpdate disk update resource. 5712type DiskUpdate struct { 5713 *DiskUpdateProperties `json:"properties,omitempty"` 5714 // Tags - Resource tags 5715 Tags map[string]*string `json:"tags"` 5716 Sku *DiskSku `json:"sku,omitempty"` 5717} 5718 5719// MarshalJSON is the custom marshaler for DiskUpdate. 5720func (du DiskUpdate) MarshalJSON() ([]byte, error) { 5721 objectMap := make(map[string]interface{}) 5722 if du.DiskUpdateProperties != nil { 5723 objectMap["properties"] = du.DiskUpdateProperties 5724 } 5725 if du.Tags != nil { 5726 objectMap["tags"] = du.Tags 5727 } 5728 if du.Sku != nil { 5729 objectMap["sku"] = du.Sku 5730 } 5731 return json.Marshal(objectMap) 5732} 5733 5734// UnmarshalJSON is the custom unmarshaler for DiskUpdate struct. 5735func (du *DiskUpdate) UnmarshalJSON(body []byte) error { 5736 var m map[string]*json.RawMessage 5737 err := json.Unmarshal(body, &m) 5738 if err != nil { 5739 return err 5740 } 5741 for k, v := range m { 5742 switch k { 5743 case "properties": 5744 if v != nil { 5745 var diskUpdateProperties DiskUpdateProperties 5746 err = json.Unmarshal(*v, &diskUpdateProperties) 5747 if err != nil { 5748 return err 5749 } 5750 du.DiskUpdateProperties = &diskUpdateProperties 5751 } 5752 case "tags": 5753 if v != nil { 5754 var tags map[string]*string 5755 err = json.Unmarshal(*v, &tags) 5756 if err != nil { 5757 return err 5758 } 5759 du.Tags = tags 5760 } 5761 case "sku": 5762 if v != nil { 5763 var sku DiskSku 5764 err = json.Unmarshal(*v, &sku) 5765 if err != nil { 5766 return err 5767 } 5768 du.Sku = &sku 5769 } 5770 } 5771 } 5772 5773 return nil 5774} 5775 5776// DiskUpdateProperties disk resource update properties. 5777type DiskUpdateProperties struct { 5778 // OsType - the Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' 5779 OsType OperatingSystemTypes `json:"osType,omitempty"` 5780 // 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. 5781 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 5782 // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. 5783 EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` 5784 // DiskIOPSReadWrite - The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. 5785 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 5786 // 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. 5787 DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` 5788 // 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. 5789 DiskIOPSReadOnly *int64 `json:"diskIOPSReadOnly,omitempty"` 5790 // 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. 5791 DiskMBpsReadOnly *int64 `json:"diskMBpsReadOnly,omitempty"` 5792 // 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. 5793 MaxShares *int32 `json:"maxShares,omitempty"` 5794 // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 5795 Encryption *Encryption `json:"encryption,omitempty"` 5796 // NetworkAccessPolicy - Possible values include: 'NetworkAccessPolicyAllowAll', 'NetworkAccessPolicyAllowPrivate', 'NetworkAccessPolicyDenyAll' 5797 NetworkAccessPolicy NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` 5798 // DiskAccessID - ARM id of the DiskAccess resource for using private endpoints on disks. 5799 DiskAccessID *string `json:"diskAccessId,omitempty"` 5800 // 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. 5801 Tier *string `json:"tier,omitempty"` 5802 // 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. 5803 BurstingEnabled *bool `json:"burstingEnabled,omitempty"` 5804 // PurchasePlan - Purchase plan information to be added on the OS disk 5805 PurchasePlan *PurchasePlan `json:"purchasePlan,omitempty"` 5806 // PropertyUpdatesInProgress - READ-ONLY; Properties of the disk for which update is pending. 5807 PropertyUpdatesInProgress *PropertyUpdatesInProgress `json:"propertyUpdatesInProgress,omitempty"` 5808 // SupportsHibernation - Indicates the OS on a disk supports hibernation. 5809 SupportsHibernation *bool `json:"supportsHibernation,omitempty"` 5810} 5811 5812// MarshalJSON is the custom marshaler for DiskUpdateProperties. 5813func (dup DiskUpdateProperties) MarshalJSON() ([]byte, error) { 5814 objectMap := make(map[string]interface{}) 5815 if dup.OsType != "" { 5816 objectMap["osType"] = dup.OsType 5817 } 5818 if dup.DiskSizeGB != nil { 5819 objectMap["diskSizeGB"] = dup.DiskSizeGB 5820 } 5821 if dup.EncryptionSettingsCollection != nil { 5822 objectMap["encryptionSettingsCollection"] = dup.EncryptionSettingsCollection 5823 } 5824 if dup.DiskIOPSReadWrite != nil { 5825 objectMap["diskIOPSReadWrite"] = dup.DiskIOPSReadWrite 5826 } 5827 if dup.DiskMBpsReadWrite != nil { 5828 objectMap["diskMBpsReadWrite"] = dup.DiskMBpsReadWrite 5829 } 5830 if dup.DiskIOPSReadOnly != nil { 5831 objectMap["diskIOPSReadOnly"] = dup.DiskIOPSReadOnly 5832 } 5833 if dup.DiskMBpsReadOnly != nil { 5834 objectMap["diskMBpsReadOnly"] = dup.DiskMBpsReadOnly 5835 } 5836 if dup.MaxShares != nil { 5837 objectMap["maxShares"] = dup.MaxShares 5838 } 5839 if dup.Encryption != nil { 5840 objectMap["encryption"] = dup.Encryption 5841 } 5842 if dup.NetworkAccessPolicy != "" { 5843 objectMap["networkAccessPolicy"] = dup.NetworkAccessPolicy 5844 } 5845 if dup.DiskAccessID != nil { 5846 objectMap["diskAccessId"] = dup.DiskAccessID 5847 } 5848 if dup.Tier != nil { 5849 objectMap["tier"] = dup.Tier 5850 } 5851 if dup.BurstingEnabled != nil { 5852 objectMap["burstingEnabled"] = dup.BurstingEnabled 5853 } 5854 if dup.PurchasePlan != nil { 5855 objectMap["purchasePlan"] = dup.PurchasePlan 5856 } 5857 if dup.SupportsHibernation != nil { 5858 objectMap["supportsHibernation"] = dup.SupportsHibernation 5859 } 5860 return json.Marshal(objectMap) 5861} 5862 5863// Encryption encryption at rest settings for disk or snapshot 5864type Encryption struct { 5865 // DiskEncryptionSetID - ResourceId of the disk encryption set to use for enabling encryption at rest. 5866 DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` 5867 // Type - Possible values include: 'EncryptionTypeEncryptionAtRestWithPlatformKey', 'EncryptionTypeEncryptionAtRestWithCustomerKey', 'EncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys' 5868 Type EncryptionType `json:"type,omitempty"` 5869} 5870 5871// EncryptionImages optional. Allows users to provide customer managed keys for encrypting the OS and data 5872// disks in the gallery artifact. 5873type EncryptionImages struct { 5874 OsDiskImage *OSDiskImageEncryption `json:"osDiskImage,omitempty"` 5875 // DataDiskImages - A list of encryption specifications for data disk images. 5876 DataDiskImages *[]DataDiskImageEncryption `json:"dataDiskImages,omitempty"` 5877} 5878 5879// EncryptionSetIdentity the managed identity for the disk encryption set. It should be given permission on 5880// the key vault before it can be used to encrypt disks. 5881type EncryptionSetIdentity struct { 5882 // 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' 5883 Type DiskEncryptionSetIdentityType `json:"type,omitempty"` 5884 // 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 5885 PrincipalID *string `json:"principalId,omitempty"` 5886 // 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 5887 TenantID *string `json:"tenantId,omitempty"` 5888} 5889 5890// MarshalJSON is the custom marshaler for EncryptionSetIdentity. 5891func (esi EncryptionSetIdentity) MarshalJSON() ([]byte, error) { 5892 objectMap := make(map[string]interface{}) 5893 if esi.Type != "" { 5894 objectMap["type"] = esi.Type 5895 } 5896 return json.Marshal(objectMap) 5897} 5898 5899// EncryptionSetProperties ... 5900type EncryptionSetProperties struct { 5901 // EncryptionType - Possible values include: 'DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey', 'DiskEncryptionSetTypeEncryptionAtRestWithPlatformAndCustomerKeys' 5902 EncryptionType DiskEncryptionSetType `json:"encryptionType,omitempty"` 5903 // ActiveKey - The key vault key which is currently used by this disk encryption set. 5904 ActiveKey *KeyForDiskEncryptionSet `json:"activeKey,omitempty"` 5905 // 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. 5906 PreviousKeys *[]KeyForDiskEncryptionSet `json:"previousKeys,omitempty"` 5907 // ProvisioningState - READ-ONLY; The disk encryption set provisioning state. 5908 ProvisioningState *string `json:"provisioningState,omitempty"` 5909 // RotationToLatestKeyVersionEnabled - Set this flag to true to enable auto-updating of this disk encryption set to the latest key version. 5910 RotationToLatestKeyVersionEnabled *bool `json:"rotationToLatestKeyVersionEnabled,omitempty"` 5911 // LastKeyRotationTimestamp - READ-ONLY; The time when the active key of this disk encryption set was updated. 5912 LastKeyRotationTimestamp *date.Time `json:"lastKeyRotationTimestamp,omitempty"` 5913} 5914 5915// MarshalJSON is the custom marshaler for EncryptionSetProperties. 5916func (esp EncryptionSetProperties) MarshalJSON() ([]byte, error) { 5917 objectMap := make(map[string]interface{}) 5918 if esp.EncryptionType != "" { 5919 objectMap["encryptionType"] = esp.EncryptionType 5920 } 5921 if esp.ActiveKey != nil { 5922 objectMap["activeKey"] = esp.ActiveKey 5923 } 5924 if esp.RotationToLatestKeyVersionEnabled != nil { 5925 objectMap["rotationToLatestKeyVersionEnabled"] = esp.RotationToLatestKeyVersionEnabled 5926 } 5927 return json.Marshal(objectMap) 5928} 5929 5930// EncryptionSettingsCollection encryption settings for disk or snapshot 5931type EncryptionSettingsCollection struct { 5932 // 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. 5933 Enabled *bool `json:"enabled,omitempty"` 5934 // EncryptionSettings - A collection of encryption settings, one for each disk volume. 5935 EncryptionSettings *[]EncryptionSettingsElement `json:"encryptionSettings,omitempty"` 5936 // 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. 5937 EncryptionSettingsVersion *string `json:"encryptionSettingsVersion,omitempty"` 5938} 5939 5940// EncryptionSettingsElement encryption settings for one disk volume. 5941type EncryptionSettingsElement struct { 5942 // DiskEncryptionKey - Key Vault Secret Url and vault id of the disk encryption key 5943 DiskEncryptionKey *KeyVaultAndSecretReference `json:"diskEncryptionKey,omitempty"` 5944 // 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. 5945 KeyEncryptionKey *KeyVaultAndKeyReference `json:"keyEncryptionKey,omitempty"` 5946} 5947 5948// ExtendedLocation the complex type of the extended location. 5949type ExtendedLocation struct { 5950 // Name - The name of the extended location. 5951 Name *string `json:"name,omitempty"` 5952 // Type - The type of the extended location. Possible values include: 'ExtendedLocationTypesEdgeZone' 5953 Type ExtendedLocationTypes `json:"type,omitempty"` 5954} 5955 5956// Extension describes a cloud service Extension. 5957type Extension struct { 5958 // Name - The name of the extension. 5959 Name *string `json:"name,omitempty"` 5960 Properties *CloudServiceExtensionProperties `json:"properties,omitempty"` 5961} 5962 5963// GalleriesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 5964// operation. 5965type GalleriesCreateOrUpdateFuture struct { 5966 azure.FutureAPI 5967 // Result returns the result of the asynchronous operation. 5968 // If the operation has not completed it will return an error. 5969 Result func(GalleriesClient) (Gallery, error) 5970} 5971 5972// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5973func (future *GalleriesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 5974 var azFuture azure.Future 5975 if err := json.Unmarshal(body, &azFuture); err != nil { 5976 return err 5977 } 5978 future.FutureAPI = &azFuture 5979 future.Result = future.result 5980 return nil 5981} 5982 5983// result is the default implementation for GalleriesCreateOrUpdateFuture.Result. 5984func (future *GalleriesCreateOrUpdateFuture) result(client GalleriesClient) (g Gallery, err error) { 5985 var done bool 5986 done, err = future.DoneWithContext(context.Background(), client) 5987 if err != nil { 5988 err = autorest.NewErrorWithError(err, "compute.GalleriesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 5989 return 5990 } 5991 if !done { 5992 g.Response.Response = future.Response() 5993 err = azure.NewAsyncOpIncompleteError("compute.GalleriesCreateOrUpdateFuture") 5994 return 5995 } 5996 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5997 if g.Response.Response, err = future.GetResult(sender); err == nil && g.Response.Response.StatusCode != http.StatusNoContent { 5998 g, err = client.CreateOrUpdateResponder(g.Response.Response) 5999 if err != nil { 6000 err = autorest.NewErrorWithError(err, "compute.GalleriesCreateOrUpdateFuture", "Result", g.Response.Response, "Failure responding to request") 6001 } 6002 } 6003 return 6004} 6005 6006// GalleriesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 6007// operation. 6008type GalleriesDeleteFuture struct { 6009 azure.FutureAPI 6010 // Result returns the result of the asynchronous operation. 6011 // If the operation has not completed it will return an error. 6012 Result func(GalleriesClient) (autorest.Response, error) 6013} 6014 6015// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6016func (future *GalleriesDeleteFuture) UnmarshalJSON(body []byte) error { 6017 var azFuture azure.Future 6018 if err := json.Unmarshal(body, &azFuture); err != nil { 6019 return err 6020 } 6021 future.FutureAPI = &azFuture 6022 future.Result = future.result 6023 return nil 6024} 6025 6026// result is the default implementation for GalleriesDeleteFuture.Result. 6027func (future *GalleriesDeleteFuture) result(client GalleriesClient) (ar autorest.Response, err error) { 6028 var done bool 6029 done, err = future.DoneWithContext(context.Background(), client) 6030 if err != nil { 6031 err = autorest.NewErrorWithError(err, "compute.GalleriesDeleteFuture", "Result", future.Response(), "Polling failure") 6032 return 6033 } 6034 if !done { 6035 ar.Response = future.Response() 6036 err = azure.NewAsyncOpIncompleteError("compute.GalleriesDeleteFuture") 6037 return 6038 } 6039 ar.Response = future.Response() 6040 return 6041} 6042 6043// GalleriesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 6044// operation. 6045type GalleriesUpdateFuture struct { 6046 azure.FutureAPI 6047 // Result returns the result of the asynchronous operation. 6048 // If the operation has not completed it will return an error. 6049 Result func(GalleriesClient) (Gallery, error) 6050} 6051 6052// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6053func (future *GalleriesUpdateFuture) UnmarshalJSON(body []byte) error { 6054 var azFuture azure.Future 6055 if err := json.Unmarshal(body, &azFuture); err != nil { 6056 return err 6057 } 6058 future.FutureAPI = &azFuture 6059 future.Result = future.result 6060 return nil 6061} 6062 6063// result is the default implementation for GalleriesUpdateFuture.Result. 6064func (future *GalleriesUpdateFuture) result(client GalleriesClient) (g Gallery, err error) { 6065 var done bool 6066 done, err = future.DoneWithContext(context.Background(), client) 6067 if err != nil { 6068 err = autorest.NewErrorWithError(err, "compute.GalleriesUpdateFuture", "Result", future.Response(), "Polling failure") 6069 return 6070 } 6071 if !done { 6072 g.Response.Response = future.Response() 6073 err = azure.NewAsyncOpIncompleteError("compute.GalleriesUpdateFuture") 6074 return 6075 } 6076 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6077 if g.Response.Response, err = future.GetResult(sender); err == nil && g.Response.Response.StatusCode != http.StatusNoContent { 6078 g, err = client.UpdateResponder(g.Response.Response) 6079 if err != nil { 6080 err = autorest.NewErrorWithError(err, "compute.GalleriesUpdateFuture", "Result", g.Response.Response, "Failure responding to request") 6081 } 6082 } 6083 return 6084} 6085 6086// Gallery specifies information about the Shared Image Gallery that you want to create or update. 6087type Gallery struct { 6088 autorest.Response `json:"-"` 6089 *GalleryProperties `json:"properties,omitempty"` 6090 // ID - READ-ONLY; Resource Id 6091 ID *string `json:"id,omitempty"` 6092 // Name - READ-ONLY; Resource name 6093 Name *string `json:"name,omitempty"` 6094 // Type - READ-ONLY; Resource type 6095 Type *string `json:"type,omitempty"` 6096 // Location - Resource location 6097 Location *string `json:"location,omitempty"` 6098 // Tags - Resource tags 6099 Tags map[string]*string `json:"tags"` 6100} 6101 6102// MarshalJSON is the custom marshaler for Gallery. 6103func (g Gallery) MarshalJSON() ([]byte, error) { 6104 objectMap := make(map[string]interface{}) 6105 if g.GalleryProperties != nil { 6106 objectMap["properties"] = g.GalleryProperties 6107 } 6108 if g.Location != nil { 6109 objectMap["location"] = g.Location 6110 } 6111 if g.Tags != nil { 6112 objectMap["tags"] = g.Tags 6113 } 6114 return json.Marshal(objectMap) 6115} 6116 6117// UnmarshalJSON is the custom unmarshaler for Gallery struct. 6118func (g *Gallery) UnmarshalJSON(body []byte) error { 6119 var m map[string]*json.RawMessage 6120 err := json.Unmarshal(body, &m) 6121 if err != nil { 6122 return err 6123 } 6124 for k, v := range m { 6125 switch k { 6126 case "properties": 6127 if v != nil { 6128 var galleryProperties GalleryProperties 6129 err = json.Unmarshal(*v, &galleryProperties) 6130 if err != nil { 6131 return err 6132 } 6133 g.GalleryProperties = &galleryProperties 6134 } 6135 case "id": 6136 if v != nil { 6137 var ID string 6138 err = json.Unmarshal(*v, &ID) 6139 if err != nil { 6140 return err 6141 } 6142 g.ID = &ID 6143 } 6144 case "name": 6145 if v != nil { 6146 var name string 6147 err = json.Unmarshal(*v, &name) 6148 if err != nil { 6149 return err 6150 } 6151 g.Name = &name 6152 } 6153 case "type": 6154 if v != nil { 6155 var typeVar string 6156 err = json.Unmarshal(*v, &typeVar) 6157 if err != nil { 6158 return err 6159 } 6160 g.Type = &typeVar 6161 } 6162 case "location": 6163 if v != nil { 6164 var location string 6165 err = json.Unmarshal(*v, &location) 6166 if err != nil { 6167 return err 6168 } 6169 g.Location = &location 6170 } 6171 case "tags": 6172 if v != nil { 6173 var tags map[string]*string 6174 err = json.Unmarshal(*v, &tags) 6175 if err != nil { 6176 return err 6177 } 6178 g.Tags = tags 6179 } 6180 } 6181 } 6182 6183 return nil 6184} 6185 6186// GalleryApplication specifies information about the gallery Application Definition that you want to 6187// create or update. 6188type GalleryApplication struct { 6189 autorest.Response `json:"-"` 6190 *GalleryApplicationProperties `json:"properties,omitempty"` 6191 // ID - READ-ONLY; Resource Id 6192 ID *string `json:"id,omitempty"` 6193 // Name - READ-ONLY; Resource name 6194 Name *string `json:"name,omitempty"` 6195 // Type - READ-ONLY; Resource type 6196 Type *string `json:"type,omitempty"` 6197 // Location - Resource location 6198 Location *string `json:"location,omitempty"` 6199 // Tags - Resource tags 6200 Tags map[string]*string `json:"tags"` 6201} 6202 6203// MarshalJSON is the custom marshaler for GalleryApplication. 6204func (ga GalleryApplication) MarshalJSON() ([]byte, error) { 6205 objectMap := make(map[string]interface{}) 6206 if ga.GalleryApplicationProperties != nil { 6207 objectMap["properties"] = ga.GalleryApplicationProperties 6208 } 6209 if ga.Location != nil { 6210 objectMap["location"] = ga.Location 6211 } 6212 if ga.Tags != nil { 6213 objectMap["tags"] = ga.Tags 6214 } 6215 return json.Marshal(objectMap) 6216} 6217 6218// UnmarshalJSON is the custom unmarshaler for GalleryApplication struct. 6219func (ga *GalleryApplication) UnmarshalJSON(body []byte) error { 6220 var m map[string]*json.RawMessage 6221 err := json.Unmarshal(body, &m) 6222 if err != nil { 6223 return err 6224 } 6225 for k, v := range m { 6226 switch k { 6227 case "properties": 6228 if v != nil { 6229 var galleryApplicationProperties GalleryApplicationProperties 6230 err = json.Unmarshal(*v, &galleryApplicationProperties) 6231 if err != nil { 6232 return err 6233 } 6234 ga.GalleryApplicationProperties = &galleryApplicationProperties 6235 } 6236 case "id": 6237 if v != nil { 6238 var ID string 6239 err = json.Unmarshal(*v, &ID) 6240 if err != nil { 6241 return err 6242 } 6243 ga.ID = &ID 6244 } 6245 case "name": 6246 if v != nil { 6247 var name string 6248 err = json.Unmarshal(*v, &name) 6249 if err != nil { 6250 return err 6251 } 6252 ga.Name = &name 6253 } 6254 case "type": 6255 if v != nil { 6256 var typeVar string 6257 err = json.Unmarshal(*v, &typeVar) 6258 if err != nil { 6259 return err 6260 } 6261 ga.Type = &typeVar 6262 } 6263 case "location": 6264 if v != nil { 6265 var location string 6266 err = json.Unmarshal(*v, &location) 6267 if err != nil { 6268 return err 6269 } 6270 ga.Location = &location 6271 } 6272 case "tags": 6273 if v != nil { 6274 var tags map[string]*string 6275 err = json.Unmarshal(*v, &tags) 6276 if err != nil { 6277 return err 6278 } 6279 ga.Tags = tags 6280 } 6281 } 6282 } 6283 6284 return nil 6285} 6286 6287// GalleryApplicationList the List Gallery Applications operation response. 6288type GalleryApplicationList struct { 6289 autorest.Response `json:"-"` 6290 // Value - A list of Gallery Applications. 6291 Value *[]GalleryApplication `json:"value,omitempty"` 6292 // 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. 6293 NextLink *string `json:"nextLink,omitempty"` 6294} 6295 6296// GalleryApplicationListIterator provides access to a complete listing of GalleryApplication values. 6297type GalleryApplicationListIterator struct { 6298 i int 6299 page GalleryApplicationListPage 6300} 6301 6302// NextWithContext advances to the next value. If there was an error making 6303// the request the iterator does not advance and the error is returned. 6304func (iter *GalleryApplicationListIterator) NextWithContext(ctx context.Context) (err error) { 6305 if tracing.IsEnabled() { 6306 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationListIterator.NextWithContext") 6307 defer func() { 6308 sc := -1 6309 if iter.Response().Response.Response != nil { 6310 sc = iter.Response().Response.Response.StatusCode 6311 } 6312 tracing.EndSpan(ctx, sc, err) 6313 }() 6314 } 6315 iter.i++ 6316 if iter.i < len(iter.page.Values()) { 6317 return nil 6318 } 6319 err = iter.page.NextWithContext(ctx) 6320 if err != nil { 6321 iter.i-- 6322 return err 6323 } 6324 iter.i = 0 6325 return nil 6326} 6327 6328// Next advances to the next value. If there was an error making 6329// the request the iterator does not advance and the error is returned. 6330// Deprecated: Use NextWithContext() instead. 6331func (iter *GalleryApplicationListIterator) Next() error { 6332 return iter.NextWithContext(context.Background()) 6333} 6334 6335// NotDone returns true if the enumeration should be started or is not yet complete. 6336func (iter GalleryApplicationListIterator) NotDone() bool { 6337 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6338} 6339 6340// Response returns the raw server response from the last page request. 6341func (iter GalleryApplicationListIterator) Response() GalleryApplicationList { 6342 return iter.page.Response() 6343} 6344 6345// Value returns the current value or a zero-initialized value if the 6346// iterator has advanced beyond the end of the collection. 6347func (iter GalleryApplicationListIterator) Value() GalleryApplication { 6348 if !iter.page.NotDone() { 6349 return GalleryApplication{} 6350 } 6351 return iter.page.Values()[iter.i] 6352} 6353 6354// Creates a new instance of the GalleryApplicationListIterator type. 6355func NewGalleryApplicationListIterator(page GalleryApplicationListPage) GalleryApplicationListIterator { 6356 return GalleryApplicationListIterator{page: page} 6357} 6358 6359// IsEmpty returns true if the ListResult contains no values. 6360func (gal GalleryApplicationList) IsEmpty() bool { 6361 return gal.Value == nil || len(*gal.Value) == 0 6362} 6363 6364// hasNextLink returns true if the NextLink is not empty. 6365func (gal GalleryApplicationList) hasNextLink() bool { 6366 return gal.NextLink != nil && len(*gal.NextLink) != 0 6367} 6368 6369// galleryApplicationListPreparer prepares a request to retrieve the next set of results. 6370// It returns nil if no more results exist. 6371func (gal GalleryApplicationList) galleryApplicationListPreparer(ctx context.Context) (*http.Request, error) { 6372 if !gal.hasNextLink() { 6373 return nil, nil 6374 } 6375 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6376 autorest.AsJSON(), 6377 autorest.AsGet(), 6378 autorest.WithBaseURL(to.String(gal.NextLink))) 6379} 6380 6381// GalleryApplicationListPage contains a page of GalleryApplication values. 6382type GalleryApplicationListPage struct { 6383 fn func(context.Context, GalleryApplicationList) (GalleryApplicationList, error) 6384 gal GalleryApplicationList 6385} 6386 6387// NextWithContext advances to the next page of values. If there was an error making 6388// the request the page does not advance and the error is returned. 6389func (page *GalleryApplicationListPage) NextWithContext(ctx context.Context) (err error) { 6390 if tracing.IsEnabled() { 6391 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationListPage.NextWithContext") 6392 defer func() { 6393 sc := -1 6394 if page.Response().Response.Response != nil { 6395 sc = page.Response().Response.Response.StatusCode 6396 } 6397 tracing.EndSpan(ctx, sc, err) 6398 }() 6399 } 6400 for { 6401 next, err := page.fn(ctx, page.gal) 6402 if err != nil { 6403 return err 6404 } 6405 page.gal = next 6406 if !next.hasNextLink() || !next.IsEmpty() { 6407 break 6408 } 6409 } 6410 return nil 6411} 6412 6413// Next advances to the next page of values. If there was an error making 6414// the request the page does not advance and the error is returned. 6415// Deprecated: Use NextWithContext() instead. 6416func (page *GalleryApplicationListPage) Next() error { 6417 return page.NextWithContext(context.Background()) 6418} 6419 6420// NotDone returns true if the page enumeration should be started or is not yet complete. 6421func (page GalleryApplicationListPage) NotDone() bool { 6422 return !page.gal.IsEmpty() 6423} 6424 6425// Response returns the raw server response from the last page request. 6426func (page GalleryApplicationListPage) Response() GalleryApplicationList { 6427 return page.gal 6428} 6429 6430// Values returns the slice of values for the current page or nil if there are no values. 6431func (page GalleryApplicationListPage) Values() []GalleryApplication { 6432 if page.gal.IsEmpty() { 6433 return nil 6434 } 6435 return *page.gal.Value 6436} 6437 6438// Creates a new instance of the GalleryApplicationListPage type. 6439func NewGalleryApplicationListPage(cur GalleryApplicationList, getNextPage func(context.Context, GalleryApplicationList) (GalleryApplicationList, error)) GalleryApplicationListPage { 6440 return GalleryApplicationListPage{ 6441 fn: getNextPage, 6442 gal: cur, 6443 } 6444} 6445 6446// GalleryApplicationProperties describes the properties of a gallery Application Definition. 6447type GalleryApplicationProperties struct { 6448 // Description - The description of this gallery Application Definition resource. This property is updatable. 6449 Description *string `json:"description,omitempty"` 6450 // Eula - The Eula agreement for the gallery Application Definition. 6451 Eula *string `json:"eula,omitempty"` 6452 // PrivacyStatementURI - The privacy statement uri. 6453 PrivacyStatementURI *string `json:"privacyStatementUri,omitempty"` 6454 // ReleaseNoteURI - The release note uri. 6455 ReleaseNoteURI *string `json:"releaseNoteUri,omitempty"` 6456 // EndOfLifeDate - The end of life date of the gallery Application Definition. This property can be used for decommissioning purposes. This property is updatable. 6457 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 6458 // 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' 6459 SupportedOSType OperatingSystemTypes `json:"supportedOSType,omitempty"` 6460} 6461 6462// GalleryApplicationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 6463// long-running operation. 6464type GalleryApplicationsCreateOrUpdateFuture struct { 6465 azure.FutureAPI 6466 // Result returns the result of the asynchronous operation. 6467 // If the operation has not completed it will return an error. 6468 Result func(GalleryApplicationsClient) (GalleryApplication, error) 6469} 6470 6471// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6472func (future *GalleryApplicationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 6473 var azFuture azure.Future 6474 if err := json.Unmarshal(body, &azFuture); err != nil { 6475 return err 6476 } 6477 future.FutureAPI = &azFuture 6478 future.Result = future.result 6479 return nil 6480} 6481 6482// result is the default implementation for GalleryApplicationsCreateOrUpdateFuture.Result. 6483func (future *GalleryApplicationsCreateOrUpdateFuture) result(client GalleryApplicationsClient) (ga GalleryApplication, err error) { 6484 var done bool 6485 done, err = future.DoneWithContext(context.Background(), client) 6486 if err != nil { 6487 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 6488 return 6489 } 6490 if !done { 6491 ga.Response.Response = future.Response() 6492 err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationsCreateOrUpdateFuture") 6493 return 6494 } 6495 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6496 if ga.Response.Response, err = future.GetResult(sender); err == nil && ga.Response.Response.StatusCode != http.StatusNoContent { 6497 ga, err = client.CreateOrUpdateResponder(ga.Response.Response) 6498 if err != nil { 6499 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsCreateOrUpdateFuture", "Result", ga.Response.Response, "Failure responding to request") 6500 } 6501 } 6502 return 6503} 6504 6505// GalleryApplicationsDeleteFuture an abstraction for monitoring and retrieving the results of a 6506// long-running operation. 6507type GalleryApplicationsDeleteFuture struct { 6508 azure.FutureAPI 6509 // Result returns the result of the asynchronous operation. 6510 // If the operation has not completed it will return an error. 6511 Result func(GalleryApplicationsClient) (autorest.Response, error) 6512} 6513 6514// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6515func (future *GalleryApplicationsDeleteFuture) UnmarshalJSON(body []byte) error { 6516 var azFuture azure.Future 6517 if err := json.Unmarshal(body, &azFuture); err != nil { 6518 return err 6519 } 6520 future.FutureAPI = &azFuture 6521 future.Result = future.result 6522 return nil 6523} 6524 6525// result is the default implementation for GalleryApplicationsDeleteFuture.Result. 6526func (future *GalleryApplicationsDeleteFuture) result(client GalleryApplicationsClient) (ar autorest.Response, err error) { 6527 var done bool 6528 done, err = future.DoneWithContext(context.Background(), client) 6529 if err != nil { 6530 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsDeleteFuture", "Result", future.Response(), "Polling failure") 6531 return 6532 } 6533 if !done { 6534 ar.Response = future.Response() 6535 err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationsDeleteFuture") 6536 return 6537 } 6538 ar.Response = future.Response() 6539 return 6540} 6541 6542// GalleryApplicationsUpdateFuture an abstraction for monitoring and retrieving the results of a 6543// long-running operation. 6544type GalleryApplicationsUpdateFuture struct { 6545 azure.FutureAPI 6546 // Result returns the result of the asynchronous operation. 6547 // If the operation has not completed it will return an error. 6548 Result func(GalleryApplicationsClient) (GalleryApplication, error) 6549} 6550 6551// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6552func (future *GalleryApplicationsUpdateFuture) UnmarshalJSON(body []byte) error { 6553 var azFuture azure.Future 6554 if err := json.Unmarshal(body, &azFuture); err != nil { 6555 return err 6556 } 6557 future.FutureAPI = &azFuture 6558 future.Result = future.result 6559 return nil 6560} 6561 6562// result is the default implementation for GalleryApplicationsUpdateFuture.Result. 6563func (future *GalleryApplicationsUpdateFuture) result(client GalleryApplicationsClient) (ga GalleryApplication, err error) { 6564 var done bool 6565 done, err = future.DoneWithContext(context.Background(), client) 6566 if err != nil { 6567 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsUpdateFuture", "Result", future.Response(), "Polling failure") 6568 return 6569 } 6570 if !done { 6571 ga.Response.Response = future.Response() 6572 err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationsUpdateFuture") 6573 return 6574 } 6575 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6576 if ga.Response.Response, err = future.GetResult(sender); err == nil && ga.Response.Response.StatusCode != http.StatusNoContent { 6577 ga, err = client.UpdateResponder(ga.Response.Response) 6578 if err != nil { 6579 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsUpdateFuture", "Result", ga.Response.Response, "Failure responding to request") 6580 } 6581 } 6582 return 6583} 6584 6585// GalleryApplicationUpdate specifies information about the gallery Application Definition that you want to 6586// update. 6587type GalleryApplicationUpdate struct { 6588 *GalleryApplicationProperties `json:"properties,omitempty"` 6589 // ID - READ-ONLY; Resource Id 6590 ID *string `json:"id,omitempty"` 6591 // Name - READ-ONLY; Resource name 6592 Name *string `json:"name,omitempty"` 6593 // Type - READ-ONLY; Resource type 6594 Type *string `json:"type,omitempty"` 6595 // Tags - Resource tags 6596 Tags map[string]*string `json:"tags"` 6597} 6598 6599// MarshalJSON is the custom marshaler for GalleryApplicationUpdate. 6600func (gau GalleryApplicationUpdate) MarshalJSON() ([]byte, error) { 6601 objectMap := make(map[string]interface{}) 6602 if gau.GalleryApplicationProperties != nil { 6603 objectMap["properties"] = gau.GalleryApplicationProperties 6604 } 6605 if gau.Tags != nil { 6606 objectMap["tags"] = gau.Tags 6607 } 6608 return json.Marshal(objectMap) 6609} 6610 6611// UnmarshalJSON is the custom unmarshaler for GalleryApplicationUpdate struct. 6612func (gau *GalleryApplicationUpdate) UnmarshalJSON(body []byte) error { 6613 var m map[string]*json.RawMessage 6614 err := json.Unmarshal(body, &m) 6615 if err != nil { 6616 return err 6617 } 6618 for k, v := range m { 6619 switch k { 6620 case "properties": 6621 if v != nil { 6622 var galleryApplicationProperties GalleryApplicationProperties 6623 err = json.Unmarshal(*v, &galleryApplicationProperties) 6624 if err != nil { 6625 return err 6626 } 6627 gau.GalleryApplicationProperties = &galleryApplicationProperties 6628 } 6629 case "id": 6630 if v != nil { 6631 var ID string 6632 err = json.Unmarshal(*v, &ID) 6633 if err != nil { 6634 return err 6635 } 6636 gau.ID = &ID 6637 } 6638 case "name": 6639 if v != nil { 6640 var name string 6641 err = json.Unmarshal(*v, &name) 6642 if err != nil { 6643 return err 6644 } 6645 gau.Name = &name 6646 } 6647 case "type": 6648 if v != nil { 6649 var typeVar string 6650 err = json.Unmarshal(*v, &typeVar) 6651 if err != nil { 6652 return err 6653 } 6654 gau.Type = &typeVar 6655 } 6656 case "tags": 6657 if v != nil { 6658 var tags map[string]*string 6659 err = json.Unmarshal(*v, &tags) 6660 if err != nil { 6661 return err 6662 } 6663 gau.Tags = tags 6664 } 6665 } 6666 } 6667 6668 return nil 6669} 6670 6671// GalleryApplicationVersion specifies information about the gallery Application Version that you want to 6672// create or update. 6673type GalleryApplicationVersion struct { 6674 autorest.Response `json:"-"` 6675 *GalleryApplicationVersionProperties `json:"properties,omitempty"` 6676 // ID - READ-ONLY; Resource Id 6677 ID *string `json:"id,omitempty"` 6678 // Name - READ-ONLY; Resource name 6679 Name *string `json:"name,omitempty"` 6680 // Type - READ-ONLY; Resource type 6681 Type *string `json:"type,omitempty"` 6682 // Location - Resource location 6683 Location *string `json:"location,omitempty"` 6684 // Tags - Resource tags 6685 Tags map[string]*string `json:"tags"` 6686} 6687 6688// MarshalJSON is the custom marshaler for GalleryApplicationVersion. 6689func (gav GalleryApplicationVersion) MarshalJSON() ([]byte, error) { 6690 objectMap := make(map[string]interface{}) 6691 if gav.GalleryApplicationVersionProperties != nil { 6692 objectMap["properties"] = gav.GalleryApplicationVersionProperties 6693 } 6694 if gav.Location != nil { 6695 objectMap["location"] = gav.Location 6696 } 6697 if gav.Tags != nil { 6698 objectMap["tags"] = gav.Tags 6699 } 6700 return json.Marshal(objectMap) 6701} 6702 6703// UnmarshalJSON is the custom unmarshaler for GalleryApplicationVersion struct. 6704func (gav *GalleryApplicationVersion) UnmarshalJSON(body []byte) error { 6705 var m map[string]*json.RawMessage 6706 err := json.Unmarshal(body, &m) 6707 if err != nil { 6708 return err 6709 } 6710 for k, v := range m { 6711 switch k { 6712 case "properties": 6713 if v != nil { 6714 var galleryApplicationVersionProperties GalleryApplicationVersionProperties 6715 err = json.Unmarshal(*v, &galleryApplicationVersionProperties) 6716 if err != nil { 6717 return err 6718 } 6719 gav.GalleryApplicationVersionProperties = &galleryApplicationVersionProperties 6720 } 6721 case "id": 6722 if v != nil { 6723 var ID string 6724 err = json.Unmarshal(*v, &ID) 6725 if err != nil { 6726 return err 6727 } 6728 gav.ID = &ID 6729 } 6730 case "name": 6731 if v != nil { 6732 var name string 6733 err = json.Unmarshal(*v, &name) 6734 if err != nil { 6735 return err 6736 } 6737 gav.Name = &name 6738 } 6739 case "type": 6740 if v != nil { 6741 var typeVar string 6742 err = json.Unmarshal(*v, &typeVar) 6743 if err != nil { 6744 return err 6745 } 6746 gav.Type = &typeVar 6747 } 6748 case "location": 6749 if v != nil { 6750 var location string 6751 err = json.Unmarshal(*v, &location) 6752 if err != nil { 6753 return err 6754 } 6755 gav.Location = &location 6756 } 6757 case "tags": 6758 if v != nil { 6759 var tags map[string]*string 6760 err = json.Unmarshal(*v, &tags) 6761 if err != nil { 6762 return err 6763 } 6764 gav.Tags = tags 6765 } 6766 } 6767 } 6768 6769 return nil 6770} 6771 6772// GalleryApplicationVersionList the List Gallery Application version operation response. 6773type GalleryApplicationVersionList struct { 6774 autorest.Response `json:"-"` 6775 // Value - A list of gallery Application Versions. 6776 Value *[]GalleryApplicationVersion `json:"value,omitempty"` 6777 // 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. 6778 NextLink *string `json:"nextLink,omitempty"` 6779} 6780 6781// GalleryApplicationVersionListIterator provides access to a complete listing of GalleryApplicationVersion 6782// values. 6783type GalleryApplicationVersionListIterator struct { 6784 i int 6785 page GalleryApplicationVersionListPage 6786} 6787 6788// NextWithContext advances to the next value. If there was an error making 6789// the request the iterator does not advance and the error is returned. 6790func (iter *GalleryApplicationVersionListIterator) NextWithContext(ctx context.Context) (err error) { 6791 if tracing.IsEnabled() { 6792 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionListIterator.NextWithContext") 6793 defer func() { 6794 sc := -1 6795 if iter.Response().Response.Response != nil { 6796 sc = iter.Response().Response.Response.StatusCode 6797 } 6798 tracing.EndSpan(ctx, sc, err) 6799 }() 6800 } 6801 iter.i++ 6802 if iter.i < len(iter.page.Values()) { 6803 return nil 6804 } 6805 err = iter.page.NextWithContext(ctx) 6806 if err != nil { 6807 iter.i-- 6808 return err 6809 } 6810 iter.i = 0 6811 return nil 6812} 6813 6814// Next advances to the next value. If there was an error making 6815// the request the iterator does not advance and the error is returned. 6816// Deprecated: Use NextWithContext() instead. 6817func (iter *GalleryApplicationVersionListIterator) Next() error { 6818 return iter.NextWithContext(context.Background()) 6819} 6820 6821// NotDone returns true if the enumeration should be started or is not yet complete. 6822func (iter GalleryApplicationVersionListIterator) NotDone() bool { 6823 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6824} 6825 6826// Response returns the raw server response from the last page request. 6827func (iter GalleryApplicationVersionListIterator) Response() GalleryApplicationVersionList { 6828 return iter.page.Response() 6829} 6830 6831// Value returns the current value or a zero-initialized value if the 6832// iterator has advanced beyond the end of the collection. 6833func (iter GalleryApplicationVersionListIterator) Value() GalleryApplicationVersion { 6834 if !iter.page.NotDone() { 6835 return GalleryApplicationVersion{} 6836 } 6837 return iter.page.Values()[iter.i] 6838} 6839 6840// Creates a new instance of the GalleryApplicationVersionListIterator type. 6841func NewGalleryApplicationVersionListIterator(page GalleryApplicationVersionListPage) GalleryApplicationVersionListIterator { 6842 return GalleryApplicationVersionListIterator{page: page} 6843} 6844 6845// IsEmpty returns true if the ListResult contains no values. 6846func (gavl GalleryApplicationVersionList) IsEmpty() bool { 6847 return gavl.Value == nil || len(*gavl.Value) == 0 6848} 6849 6850// hasNextLink returns true if the NextLink is not empty. 6851func (gavl GalleryApplicationVersionList) hasNextLink() bool { 6852 return gavl.NextLink != nil && len(*gavl.NextLink) != 0 6853} 6854 6855// galleryApplicationVersionListPreparer prepares a request to retrieve the next set of results. 6856// It returns nil if no more results exist. 6857func (gavl GalleryApplicationVersionList) galleryApplicationVersionListPreparer(ctx context.Context) (*http.Request, error) { 6858 if !gavl.hasNextLink() { 6859 return nil, nil 6860 } 6861 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6862 autorest.AsJSON(), 6863 autorest.AsGet(), 6864 autorest.WithBaseURL(to.String(gavl.NextLink))) 6865} 6866 6867// GalleryApplicationVersionListPage contains a page of GalleryApplicationVersion values. 6868type GalleryApplicationVersionListPage struct { 6869 fn func(context.Context, GalleryApplicationVersionList) (GalleryApplicationVersionList, error) 6870 gavl GalleryApplicationVersionList 6871} 6872 6873// NextWithContext advances to the next page of values. If there was an error making 6874// the request the page does not advance and the error is returned. 6875func (page *GalleryApplicationVersionListPage) NextWithContext(ctx context.Context) (err error) { 6876 if tracing.IsEnabled() { 6877 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionListPage.NextWithContext") 6878 defer func() { 6879 sc := -1 6880 if page.Response().Response.Response != nil { 6881 sc = page.Response().Response.Response.StatusCode 6882 } 6883 tracing.EndSpan(ctx, sc, err) 6884 }() 6885 } 6886 for { 6887 next, err := page.fn(ctx, page.gavl) 6888 if err != nil { 6889 return err 6890 } 6891 page.gavl = next 6892 if !next.hasNextLink() || !next.IsEmpty() { 6893 break 6894 } 6895 } 6896 return nil 6897} 6898 6899// Next advances to the next page of values. If there was an error making 6900// the request the page does not advance and the error is returned. 6901// Deprecated: Use NextWithContext() instead. 6902func (page *GalleryApplicationVersionListPage) Next() error { 6903 return page.NextWithContext(context.Background()) 6904} 6905 6906// NotDone returns true if the page enumeration should be started or is not yet complete. 6907func (page GalleryApplicationVersionListPage) NotDone() bool { 6908 return !page.gavl.IsEmpty() 6909} 6910 6911// Response returns the raw server response from the last page request. 6912func (page GalleryApplicationVersionListPage) Response() GalleryApplicationVersionList { 6913 return page.gavl 6914} 6915 6916// Values returns the slice of values for the current page or nil if there are no values. 6917func (page GalleryApplicationVersionListPage) Values() []GalleryApplicationVersion { 6918 if page.gavl.IsEmpty() { 6919 return nil 6920 } 6921 return *page.gavl.Value 6922} 6923 6924// Creates a new instance of the GalleryApplicationVersionListPage type. 6925func NewGalleryApplicationVersionListPage(cur GalleryApplicationVersionList, getNextPage func(context.Context, GalleryApplicationVersionList) (GalleryApplicationVersionList, error)) GalleryApplicationVersionListPage { 6926 return GalleryApplicationVersionListPage{ 6927 fn: getNextPage, 6928 gavl: cur, 6929 } 6930} 6931 6932// GalleryApplicationVersionProperties describes the properties of a gallery image version. 6933type GalleryApplicationVersionProperties struct { 6934 PublishingProfile *GalleryApplicationVersionPublishingProfile `json:"publishingProfile,omitempty"` 6935 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningState1Creating', 'ProvisioningState1Updating', 'ProvisioningState1Failed', 'ProvisioningState1Succeeded', 'ProvisioningState1Deleting', 'ProvisioningState1Migrating' 6936 ProvisioningState ProvisioningState1 `json:"provisioningState,omitempty"` 6937 // ReplicationStatus - READ-ONLY 6938 ReplicationStatus *ReplicationStatus `json:"replicationStatus,omitempty"` 6939} 6940 6941// MarshalJSON is the custom marshaler for GalleryApplicationVersionProperties. 6942func (gavp GalleryApplicationVersionProperties) MarshalJSON() ([]byte, error) { 6943 objectMap := make(map[string]interface{}) 6944 if gavp.PublishingProfile != nil { 6945 objectMap["publishingProfile"] = gavp.PublishingProfile 6946 } 6947 return json.Marshal(objectMap) 6948} 6949 6950// GalleryApplicationVersionPublishingProfile the publishing profile of a gallery image version. 6951type GalleryApplicationVersionPublishingProfile struct { 6952 Source *UserArtifactSource `json:"source,omitempty"` 6953 ManageActions *UserArtifactManage `json:"manageActions,omitempty"` 6954 // EnableHealthCheck - Optional. Whether or not this application reports health. 6955 EnableHealthCheck *bool `json:"enableHealthCheck,omitempty"` 6956 // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. 6957 TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` 6958 // 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. 6959 ReplicaCount *int32 `json:"replicaCount,omitempty"` 6960 // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. 6961 ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` 6962 // PublishedDate - READ-ONLY; The timestamp for when the gallery image version is published. 6963 PublishedDate *date.Time `json:"publishedDate,omitempty"` 6964 // EndOfLifeDate - The end of life date of the gallery image version. This property can be used for decommissioning purposes. This property is updatable. 6965 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 6966 // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' 6967 StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` 6968 // ReplicationMode - Optional parameter which specifies the mode to be used for replication. This property is not updatable. Possible values include: 'ReplicationModeFull', 'ReplicationModeShallow' 6969 ReplicationMode ReplicationMode `json:"replicationMode,omitempty"` 6970} 6971 6972// MarshalJSON is the custom marshaler for GalleryApplicationVersionPublishingProfile. 6973func (gavpp GalleryApplicationVersionPublishingProfile) MarshalJSON() ([]byte, error) { 6974 objectMap := make(map[string]interface{}) 6975 if gavpp.Source != nil { 6976 objectMap["source"] = gavpp.Source 6977 } 6978 if gavpp.ManageActions != nil { 6979 objectMap["manageActions"] = gavpp.ManageActions 6980 } 6981 if gavpp.EnableHealthCheck != nil { 6982 objectMap["enableHealthCheck"] = gavpp.EnableHealthCheck 6983 } 6984 if gavpp.TargetRegions != nil { 6985 objectMap["targetRegions"] = gavpp.TargetRegions 6986 } 6987 if gavpp.ReplicaCount != nil { 6988 objectMap["replicaCount"] = gavpp.ReplicaCount 6989 } 6990 if gavpp.ExcludeFromLatest != nil { 6991 objectMap["excludeFromLatest"] = gavpp.ExcludeFromLatest 6992 } 6993 if gavpp.EndOfLifeDate != nil { 6994 objectMap["endOfLifeDate"] = gavpp.EndOfLifeDate 6995 } 6996 if gavpp.StorageAccountType != "" { 6997 objectMap["storageAccountType"] = gavpp.StorageAccountType 6998 } 6999 if gavpp.ReplicationMode != "" { 7000 objectMap["replicationMode"] = gavpp.ReplicationMode 7001 } 7002 return json.Marshal(objectMap) 7003} 7004 7005// GalleryApplicationVersionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results 7006// of a long-running operation. 7007type GalleryApplicationVersionsCreateOrUpdateFuture struct { 7008 azure.FutureAPI 7009 // Result returns the result of the asynchronous operation. 7010 // If the operation has not completed it will return an error. 7011 Result func(GalleryApplicationVersionsClient) (GalleryApplicationVersion, error) 7012} 7013 7014// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7015func (future *GalleryApplicationVersionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 7016 var azFuture azure.Future 7017 if err := json.Unmarshal(body, &azFuture); err != nil { 7018 return err 7019 } 7020 future.FutureAPI = &azFuture 7021 future.Result = future.result 7022 return nil 7023} 7024 7025// result is the default implementation for GalleryApplicationVersionsCreateOrUpdateFuture.Result. 7026func (future *GalleryApplicationVersionsCreateOrUpdateFuture) result(client GalleryApplicationVersionsClient) (gav GalleryApplicationVersion, err error) { 7027 var done bool 7028 done, err = future.DoneWithContext(context.Background(), client) 7029 if err != nil { 7030 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 7031 return 7032 } 7033 if !done { 7034 gav.Response.Response = future.Response() 7035 err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationVersionsCreateOrUpdateFuture") 7036 return 7037 } 7038 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7039 if gav.Response.Response, err = future.GetResult(sender); err == nil && gav.Response.Response.StatusCode != http.StatusNoContent { 7040 gav, err = client.CreateOrUpdateResponder(gav.Response.Response) 7041 if err != nil { 7042 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsCreateOrUpdateFuture", "Result", gav.Response.Response, "Failure responding to request") 7043 } 7044 } 7045 return 7046} 7047 7048// GalleryApplicationVersionsDeleteFuture an abstraction for monitoring and retrieving the results of a 7049// long-running operation. 7050type GalleryApplicationVersionsDeleteFuture struct { 7051 azure.FutureAPI 7052 // Result returns the result of the asynchronous operation. 7053 // If the operation has not completed it will return an error. 7054 Result func(GalleryApplicationVersionsClient) (autorest.Response, error) 7055} 7056 7057// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7058func (future *GalleryApplicationVersionsDeleteFuture) UnmarshalJSON(body []byte) error { 7059 var azFuture azure.Future 7060 if err := json.Unmarshal(body, &azFuture); err != nil { 7061 return err 7062 } 7063 future.FutureAPI = &azFuture 7064 future.Result = future.result 7065 return nil 7066} 7067 7068// result is the default implementation for GalleryApplicationVersionsDeleteFuture.Result. 7069func (future *GalleryApplicationVersionsDeleteFuture) result(client GalleryApplicationVersionsClient) (ar autorest.Response, err error) { 7070 var done bool 7071 done, err = future.DoneWithContext(context.Background(), client) 7072 if err != nil { 7073 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsDeleteFuture", "Result", future.Response(), "Polling failure") 7074 return 7075 } 7076 if !done { 7077 ar.Response = future.Response() 7078 err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationVersionsDeleteFuture") 7079 return 7080 } 7081 ar.Response = future.Response() 7082 return 7083} 7084 7085// GalleryApplicationVersionsUpdateFuture an abstraction for monitoring and retrieving the results of a 7086// long-running operation. 7087type GalleryApplicationVersionsUpdateFuture struct { 7088 azure.FutureAPI 7089 // Result returns the result of the asynchronous operation. 7090 // If the operation has not completed it will return an error. 7091 Result func(GalleryApplicationVersionsClient) (GalleryApplicationVersion, error) 7092} 7093 7094// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7095func (future *GalleryApplicationVersionsUpdateFuture) UnmarshalJSON(body []byte) error { 7096 var azFuture azure.Future 7097 if err := json.Unmarshal(body, &azFuture); err != nil { 7098 return err 7099 } 7100 future.FutureAPI = &azFuture 7101 future.Result = future.result 7102 return nil 7103} 7104 7105// result is the default implementation for GalleryApplicationVersionsUpdateFuture.Result. 7106func (future *GalleryApplicationVersionsUpdateFuture) result(client GalleryApplicationVersionsClient) (gav GalleryApplicationVersion, err error) { 7107 var done bool 7108 done, err = future.DoneWithContext(context.Background(), client) 7109 if err != nil { 7110 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsUpdateFuture", "Result", future.Response(), "Polling failure") 7111 return 7112 } 7113 if !done { 7114 gav.Response.Response = future.Response() 7115 err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationVersionsUpdateFuture") 7116 return 7117 } 7118 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7119 if gav.Response.Response, err = future.GetResult(sender); err == nil && gav.Response.Response.StatusCode != http.StatusNoContent { 7120 gav, err = client.UpdateResponder(gav.Response.Response) 7121 if err != nil { 7122 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsUpdateFuture", "Result", gav.Response.Response, "Failure responding to request") 7123 } 7124 } 7125 return 7126} 7127 7128// GalleryApplicationVersionUpdate specifies information about the gallery Application Version that you 7129// want to update. 7130type GalleryApplicationVersionUpdate struct { 7131 *GalleryApplicationVersionProperties `json:"properties,omitempty"` 7132 // ID - READ-ONLY; Resource Id 7133 ID *string `json:"id,omitempty"` 7134 // Name - READ-ONLY; Resource name 7135 Name *string `json:"name,omitempty"` 7136 // Type - READ-ONLY; Resource type 7137 Type *string `json:"type,omitempty"` 7138 // Tags - Resource tags 7139 Tags map[string]*string `json:"tags"` 7140} 7141 7142// MarshalJSON is the custom marshaler for GalleryApplicationVersionUpdate. 7143func (gavu GalleryApplicationVersionUpdate) MarshalJSON() ([]byte, error) { 7144 objectMap := make(map[string]interface{}) 7145 if gavu.GalleryApplicationVersionProperties != nil { 7146 objectMap["properties"] = gavu.GalleryApplicationVersionProperties 7147 } 7148 if gavu.Tags != nil { 7149 objectMap["tags"] = gavu.Tags 7150 } 7151 return json.Marshal(objectMap) 7152} 7153 7154// UnmarshalJSON is the custom unmarshaler for GalleryApplicationVersionUpdate struct. 7155func (gavu *GalleryApplicationVersionUpdate) UnmarshalJSON(body []byte) error { 7156 var m map[string]*json.RawMessage 7157 err := json.Unmarshal(body, &m) 7158 if err != nil { 7159 return err 7160 } 7161 for k, v := range m { 7162 switch k { 7163 case "properties": 7164 if v != nil { 7165 var galleryApplicationVersionProperties GalleryApplicationVersionProperties 7166 err = json.Unmarshal(*v, &galleryApplicationVersionProperties) 7167 if err != nil { 7168 return err 7169 } 7170 gavu.GalleryApplicationVersionProperties = &galleryApplicationVersionProperties 7171 } 7172 case "id": 7173 if v != nil { 7174 var ID string 7175 err = json.Unmarshal(*v, &ID) 7176 if err != nil { 7177 return err 7178 } 7179 gavu.ID = &ID 7180 } 7181 case "name": 7182 if v != nil { 7183 var name string 7184 err = json.Unmarshal(*v, &name) 7185 if err != nil { 7186 return err 7187 } 7188 gavu.Name = &name 7189 } 7190 case "type": 7191 if v != nil { 7192 var typeVar string 7193 err = json.Unmarshal(*v, &typeVar) 7194 if err != nil { 7195 return err 7196 } 7197 gavu.Type = &typeVar 7198 } 7199 case "tags": 7200 if v != nil { 7201 var tags map[string]*string 7202 err = json.Unmarshal(*v, &tags) 7203 if err != nil { 7204 return err 7205 } 7206 gavu.Tags = tags 7207 } 7208 } 7209 } 7210 7211 return nil 7212} 7213 7214// GalleryArtifactPublishingProfileBase describes the basic gallery artifact publishing profile. 7215type GalleryArtifactPublishingProfileBase struct { 7216 // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. 7217 TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` 7218 // 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. 7219 ReplicaCount *int32 `json:"replicaCount,omitempty"` 7220 // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. 7221 ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` 7222 // PublishedDate - READ-ONLY; The timestamp for when the gallery image version is published. 7223 PublishedDate *date.Time `json:"publishedDate,omitempty"` 7224 // EndOfLifeDate - The end of life date of the gallery image version. This property can be used for decommissioning purposes. This property is updatable. 7225 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 7226 // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' 7227 StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` 7228 // ReplicationMode - Optional parameter which specifies the mode to be used for replication. This property is not updatable. Possible values include: 'ReplicationModeFull', 'ReplicationModeShallow' 7229 ReplicationMode ReplicationMode `json:"replicationMode,omitempty"` 7230} 7231 7232// MarshalJSON is the custom marshaler for GalleryArtifactPublishingProfileBase. 7233func (gappb GalleryArtifactPublishingProfileBase) MarshalJSON() ([]byte, error) { 7234 objectMap := make(map[string]interface{}) 7235 if gappb.TargetRegions != nil { 7236 objectMap["targetRegions"] = gappb.TargetRegions 7237 } 7238 if gappb.ReplicaCount != nil { 7239 objectMap["replicaCount"] = gappb.ReplicaCount 7240 } 7241 if gappb.ExcludeFromLatest != nil { 7242 objectMap["excludeFromLatest"] = gappb.ExcludeFromLatest 7243 } 7244 if gappb.EndOfLifeDate != nil { 7245 objectMap["endOfLifeDate"] = gappb.EndOfLifeDate 7246 } 7247 if gappb.StorageAccountType != "" { 7248 objectMap["storageAccountType"] = gappb.StorageAccountType 7249 } 7250 if gappb.ReplicationMode != "" { 7251 objectMap["replicationMode"] = gappb.ReplicationMode 7252 } 7253 return json.Marshal(objectMap) 7254} 7255 7256// GalleryArtifactSource the source image from which the Image Version is going to be created. 7257type GalleryArtifactSource struct { 7258 ManagedImage *ManagedArtifact `json:"managedImage,omitempty"` 7259} 7260 7261// GalleryArtifactVersionSource the gallery artifact version source. 7262type GalleryArtifactVersionSource struct { 7263 // ID - The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, user image or storage account resource. 7264 ID *string `json:"id,omitempty"` 7265 // URI - The uri of the gallery artifact version source. Currently used to specify vhd/blob source. 7266 URI *string `json:"uri,omitempty"` 7267} 7268 7269// GalleryDataDiskImage this is the data disk image. 7270type GalleryDataDiskImage struct { 7271 // 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. 7272 Lun *int32 `json:"lun,omitempty"` 7273 // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. 7274 SizeInGB *int32 `json:"sizeInGB,omitempty"` 7275 // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' 7276 HostCaching HostCaching `json:"hostCaching,omitempty"` 7277 Source *GalleryArtifactVersionSource `json:"source,omitempty"` 7278} 7279 7280// MarshalJSON is the custom marshaler for GalleryDataDiskImage. 7281func (gddi GalleryDataDiskImage) MarshalJSON() ([]byte, error) { 7282 objectMap := make(map[string]interface{}) 7283 if gddi.Lun != nil { 7284 objectMap["lun"] = gddi.Lun 7285 } 7286 if gddi.HostCaching != "" { 7287 objectMap["hostCaching"] = gddi.HostCaching 7288 } 7289 if gddi.Source != nil { 7290 objectMap["source"] = gddi.Source 7291 } 7292 return json.Marshal(objectMap) 7293} 7294 7295// GalleryDiskImage this is the disk image base class. 7296type GalleryDiskImage struct { 7297 // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. 7298 SizeInGB *int32 `json:"sizeInGB,omitempty"` 7299 // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' 7300 HostCaching HostCaching `json:"hostCaching,omitempty"` 7301 Source *GalleryArtifactVersionSource `json:"source,omitempty"` 7302} 7303 7304// MarshalJSON is the custom marshaler for GalleryDiskImage. 7305func (gdi GalleryDiskImage) MarshalJSON() ([]byte, error) { 7306 objectMap := make(map[string]interface{}) 7307 if gdi.HostCaching != "" { 7308 objectMap["hostCaching"] = gdi.HostCaching 7309 } 7310 if gdi.Source != nil { 7311 objectMap["source"] = gdi.Source 7312 } 7313 return json.Marshal(objectMap) 7314} 7315 7316// GalleryIdentifier describes the gallery unique name. 7317type GalleryIdentifier struct { 7318 // UniqueName - READ-ONLY; The unique name of the Shared Image Gallery. This name is generated automatically by Azure. 7319 UniqueName *string `json:"uniqueName,omitempty"` 7320} 7321 7322// MarshalJSON is the custom marshaler for GalleryIdentifier. 7323func (gi GalleryIdentifier) MarshalJSON() ([]byte, error) { 7324 objectMap := make(map[string]interface{}) 7325 return json.Marshal(objectMap) 7326} 7327 7328// GalleryImage specifies information about the gallery image definition that you want to create or update. 7329type GalleryImage struct { 7330 autorest.Response `json:"-"` 7331 *GalleryImageProperties `json:"properties,omitempty"` 7332 // ID - READ-ONLY; Resource Id 7333 ID *string `json:"id,omitempty"` 7334 // Name - READ-ONLY; Resource name 7335 Name *string `json:"name,omitempty"` 7336 // Type - READ-ONLY; Resource type 7337 Type *string `json:"type,omitempty"` 7338 // Location - Resource location 7339 Location *string `json:"location,omitempty"` 7340 // Tags - Resource tags 7341 Tags map[string]*string `json:"tags"` 7342} 7343 7344// MarshalJSON is the custom marshaler for GalleryImage. 7345func (gi GalleryImage) MarshalJSON() ([]byte, error) { 7346 objectMap := make(map[string]interface{}) 7347 if gi.GalleryImageProperties != nil { 7348 objectMap["properties"] = gi.GalleryImageProperties 7349 } 7350 if gi.Location != nil { 7351 objectMap["location"] = gi.Location 7352 } 7353 if gi.Tags != nil { 7354 objectMap["tags"] = gi.Tags 7355 } 7356 return json.Marshal(objectMap) 7357} 7358 7359// UnmarshalJSON is the custom unmarshaler for GalleryImage struct. 7360func (gi *GalleryImage) UnmarshalJSON(body []byte) error { 7361 var m map[string]*json.RawMessage 7362 err := json.Unmarshal(body, &m) 7363 if err != nil { 7364 return err 7365 } 7366 for k, v := range m { 7367 switch k { 7368 case "properties": 7369 if v != nil { 7370 var galleryImageProperties GalleryImageProperties 7371 err = json.Unmarshal(*v, &galleryImageProperties) 7372 if err != nil { 7373 return err 7374 } 7375 gi.GalleryImageProperties = &galleryImageProperties 7376 } 7377 case "id": 7378 if v != nil { 7379 var ID string 7380 err = json.Unmarshal(*v, &ID) 7381 if err != nil { 7382 return err 7383 } 7384 gi.ID = &ID 7385 } 7386 case "name": 7387 if v != nil { 7388 var name string 7389 err = json.Unmarshal(*v, &name) 7390 if err != nil { 7391 return err 7392 } 7393 gi.Name = &name 7394 } 7395 case "type": 7396 if v != nil { 7397 var typeVar string 7398 err = json.Unmarshal(*v, &typeVar) 7399 if err != nil { 7400 return err 7401 } 7402 gi.Type = &typeVar 7403 } 7404 case "location": 7405 if v != nil { 7406 var location string 7407 err = json.Unmarshal(*v, &location) 7408 if err != nil { 7409 return err 7410 } 7411 gi.Location = &location 7412 } 7413 case "tags": 7414 if v != nil { 7415 var tags map[string]*string 7416 err = json.Unmarshal(*v, &tags) 7417 if err != nil { 7418 return err 7419 } 7420 gi.Tags = tags 7421 } 7422 } 7423 } 7424 7425 return nil 7426} 7427 7428// GalleryImageFeature a feature for gallery image. 7429type GalleryImageFeature struct { 7430 // Name - The name of the gallery image feature. 7431 Name *string `json:"name,omitempty"` 7432 // Value - The value of the gallery image feature. 7433 Value *string `json:"value,omitempty"` 7434} 7435 7436// GalleryImageIdentifier this is the gallery image definition identifier. 7437type GalleryImageIdentifier struct { 7438 // Publisher - The name of the gallery image definition publisher. 7439 Publisher *string `json:"publisher,omitempty"` 7440 // Offer - The name of the gallery image definition offer. 7441 Offer *string `json:"offer,omitempty"` 7442 // Sku - The name of the gallery image definition SKU. 7443 Sku *string `json:"sku,omitempty"` 7444} 7445 7446// GalleryImageList the List Gallery Images operation response. 7447type GalleryImageList struct { 7448 autorest.Response `json:"-"` 7449 // Value - A list of Shared Image Gallery images. 7450 Value *[]GalleryImage `json:"value,omitempty"` 7451 // 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. 7452 NextLink *string `json:"nextLink,omitempty"` 7453} 7454 7455// GalleryImageListIterator provides access to a complete listing of GalleryImage values. 7456type GalleryImageListIterator struct { 7457 i int 7458 page GalleryImageListPage 7459} 7460 7461// NextWithContext advances to the next value. If there was an error making 7462// the request the iterator does not advance and the error is returned. 7463func (iter *GalleryImageListIterator) NextWithContext(ctx context.Context) (err error) { 7464 if tracing.IsEnabled() { 7465 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageListIterator.NextWithContext") 7466 defer func() { 7467 sc := -1 7468 if iter.Response().Response.Response != nil { 7469 sc = iter.Response().Response.Response.StatusCode 7470 } 7471 tracing.EndSpan(ctx, sc, err) 7472 }() 7473 } 7474 iter.i++ 7475 if iter.i < len(iter.page.Values()) { 7476 return nil 7477 } 7478 err = iter.page.NextWithContext(ctx) 7479 if err != nil { 7480 iter.i-- 7481 return err 7482 } 7483 iter.i = 0 7484 return nil 7485} 7486 7487// Next advances to the next value. If there was an error making 7488// the request the iterator does not advance and the error is returned. 7489// Deprecated: Use NextWithContext() instead. 7490func (iter *GalleryImageListIterator) Next() error { 7491 return iter.NextWithContext(context.Background()) 7492} 7493 7494// NotDone returns true if the enumeration should be started or is not yet complete. 7495func (iter GalleryImageListIterator) NotDone() bool { 7496 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7497} 7498 7499// Response returns the raw server response from the last page request. 7500func (iter GalleryImageListIterator) Response() GalleryImageList { 7501 return iter.page.Response() 7502} 7503 7504// Value returns the current value or a zero-initialized value if the 7505// iterator has advanced beyond the end of the collection. 7506func (iter GalleryImageListIterator) Value() GalleryImage { 7507 if !iter.page.NotDone() { 7508 return GalleryImage{} 7509 } 7510 return iter.page.Values()[iter.i] 7511} 7512 7513// Creates a new instance of the GalleryImageListIterator type. 7514func NewGalleryImageListIterator(page GalleryImageListPage) GalleryImageListIterator { 7515 return GalleryImageListIterator{page: page} 7516} 7517 7518// IsEmpty returns true if the ListResult contains no values. 7519func (gil GalleryImageList) IsEmpty() bool { 7520 return gil.Value == nil || len(*gil.Value) == 0 7521} 7522 7523// hasNextLink returns true if the NextLink is not empty. 7524func (gil GalleryImageList) hasNextLink() bool { 7525 return gil.NextLink != nil && len(*gil.NextLink) != 0 7526} 7527 7528// galleryImageListPreparer prepares a request to retrieve the next set of results. 7529// It returns nil if no more results exist. 7530func (gil GalleryImageList) galleryImageListPreparer(ctx context.Context) (*http.Request, error) { 7531 if !gil.hasNextLink() { 7532 return nil, nil 7533 } 7534 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7535 autorest.AsJSON(), 7536 autorest.AsGet(), 7537 autorest.WithBaseURL(to.String(gil.NextLink))) 7538} 7539 7540// GalleryImageListPage contains a page of GalleryImage values. 7541type GalleryImageListPage struct { 7542 fn func(context.Context, GalleryImageList) (GalleryImageList, error) 7543 gil GalleryImageList 7544} 7545 7546// NextWithContext advances to the next page of values. If there was an error making 7547// the request the page does not advance and the error is returned. 7548func (page *GalleryImageListPage) NextWithContext(ctx context.Context) (err error) { 7549 if tracing.IsEnabled() { 7550 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageListPage.NextWithContext") 7551 defer func() { 7552 sc := -1 7553 if page.Response().Response.Response != nil { 7554 sc = page.Response().Response.Response.StatusCode 7555 } 7556 tracing.EndSpan(ctx, sc, err) 7557 }() 7558 } 7559 for { 7560 next, err := page.fn(ctx, page.gil) 7561 if err != nil { 7562 return err 7563 } 7564 page.gil = next 7565 if !next.hasNextLink() || !next.IsEmpty() { 7566 break 7567 } 7568 } 7569 return nil 7570} 7571 7572// Next advances to the next page of values. If there was an error making 7573// the request the page does not advance and the error is returned. 7574// Deprecated: Use NextWithContext() instead. 7575func (page *GalleryImageListPage) Next() error { 7576 return page.NextWithContext(context.Background()) 7577} 7578 7579// NotDone returns true if the page enumeration should be started or is not yet complete. 7580func (page GalleryImageListPage) NotDone() bool { 7581 return !page.gil.IsEmpty() 7582} 7583 7584// Response returns the raw server response from the last page request. 7585func (page GalleryImageListPage) Response() GalleryImageList { 7586 return page.gil 7587} 7588 7589// Values returns the slice of values for the current page or nil if there are no values. 7590func (page GalleryImageListPage) Values() []GalleryImage { 7591 if page.gil.IsEmpty() { 7592 return nil 7593 } 7594 return *page.gil.Value 7595} 7596 7597// Creates a new instance of the GalleryImageListPage type. 7598func NewGalleryImageListPage(cur GalleryImageList, getNextPage func(context.Context, GalleryImageList) (GalleryImageList, error)) GalleryImageListPage { 7599 return GalleryImageListPage{ 7600 fn: getNextPage, 7601 gil: cur, 7602 } 7603} 7604 7605// GalleryImageProperties describes the properties of a gallery image definition. 7606type GalleryImageProperties struct { 7607 // Description - The description of this gallery image definition resource. This property is updatable. 7608 Description *string `json:"description,omitempty"` 7609 // Eula - The Eula agreement for the gallery image definition. 7610 Eula *string `json:"eula,omitempty"` 7611 // PrivacyStatementURI - The privacy statement uri. 7612 PrivacyStatementURI *string `json:"privacyStatementUri,omitempty"` 7613 // ReleaseNoteURI - The release note uri. 7614 ReleaseNoteURI *string `json:"releaseNoteUri,omitempty"` 7615 // 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' 7616 OsType OperatingSystemTypes `json:"osType,omitempty"` 7617 // 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' 7618 OsState OperatingSystemStateTypes `json:"osState,omitempty"` 7619 // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'HyperVGenerationV1', 'HyperVGenerationV2' 7620 HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` 7621 // EndOfLifeDate - The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property is updatable. 7622 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 7623 Identifier *GalleryImageIdentifier `json:"identifier,omitempty"` 7624 Recommended *RecommendedMachineConfiguration `json:"recommended,omitempty"` 7625 Disallowed *Disallowed `json:"disallowed,omitempty"` 7626 PurchasePlan *ImagePurchasePlan `json:"purchasePlan,omitempty"` 7627 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningState2Creating', 'ProvisioningState2Updating', 'ProvisioningState2Failed', 'ProvisioningState2Succeeded', 'ProvisioningState2Deleting', 'ProvisioningState2Migrating' 7628 ProvisioningState ProvisioningState2 `json:"provisioningState,omitempty"` 7629 // Features - A list of gallery image features. 7630 Features *[]GalleryImageFeature `json:"features,omitempty"` 7631} 7632 7633// MarshalJSON is the custom marshaler for GalleryImageProperties. 7634func (gip GalleryImageProperties) MarshalJSON() ([]byte, error) { 7635 objectMap := make(map[string]interface{}) 7636 if gip.Description != nil { 7637 objectMap["description"] = gip.Description 7638 } 7639 if gip.Eula != nil { 7640 objectMap["eula"] = gip.Eula 7641 } 7642 if gip.PrivacyStatementURI != nil { 7643 objectMap["privacyStatementUri"] = gip.PrivacyStatementURI 7644 } 7645 if gip.ReleaseNoteURI != nil { 7646 objectMap["releaseNoteUri"] = gip.ReleaseNoteURI 7647 } 7648 if gip.OsType != "" { 7649 objectMap["osType"] = gip.OsType 7650 } 7651 if gip.OsState != "" { 7652 objectMap["osState"] = gip.OsState 7653 } 7654 if gip.HyperVGeneration != "" { 7655 objectMap["hyperVGeneration"] = gip.HyperVGeneration 7656 } 7657 if gip.EndOfLifeDate != nil { 7658 objectMap["endOfLifeDate"] = gip.EndOfLifeDate 7659 } 7660 if gip.Identifier != nil { 7661 objectMap["identifier"] = gip.Identifier 7662 } 7663 if gip.Recommended != nil { 7664 objectMap["recommended"] = gip.Recommended 7665 } 7666 if gip.Disallowed != nil { 7667 objectMap["disallowed"] = gip.Disallowed 7668 } 7669 if gip.PurchasePlan != nil { 7670 objectMap["purchasePlan"] = gip.PurchasePlan 7671 } 7672 if gip.Features != nil { 7673 objectMap["features"] = gip.Features 7674 } 7675 return json.Marshal(objectMap) 7676} 7677 7678// GalleryImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 7679// long-running operation. 7680type GalleryImagesCreateOrUpdateFuture struct { 7681 azure.FutureAPI 7682 // Result returns the result of the asynchronous operation. 7683 // If the operation has not completed it will return an error. 7684 Result func(GalleryImagesClient) (GalleryImage, error) 7685} 7686 7687// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7688func (future *GalleryImagesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 7689 var azFuture azure.Future 7690 if err := json.Unmarshal(body, &azFuture); err != nil { 7691 return err 7692 } 7693 future.FutureAPI = &azFuture 7694 future.Result = future.result 7695 return nil 7696} 7697 7698// result is the default implementation for GalleryImagesCreateOrUpdateFuture.Result. 7699func (future *GalleryImagesCreateOrUpdateFuture) result(client GalleryImagesClient) (gi GalleryImage, err error) { 7700 var done bool 7701 done, err = future.DoneWithContext(context.Background(), client) 7702 if err != nil { 7703 err = autorest.NewErrorWithError(err, "compute.GalleryImagesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 7704 return 7705 } 7706 if !done { 7707 gi.Response.Response = future.Response() 7708 err = azure.NewAsyncOpIncompleteError("compute.GalleryImagesCreateOrUpdateFuture") 7709 return 7710 } 7711 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7712 if gi.Response.Response, err = future.GetResult(sender); err == nil && gi.Response.Response.StatusCode != http.StatusNoContent { 7713 gi, err = client.CreateOrUpdateResponder(gi.Response.Response) 7714 if err != nil { 7715 err = autorest.NewErrorWithError(err, "compute.GalleryImagesCreateOrUpdateFuture", "Result", gi.Response.Response, "Failure responding to request") 7716 } 7717 } 7718 return 7719} 7720 7721// GalleryImagesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 7722// operation. 7723type GalleryImagesDeleteFuture struct { 7724 azure.FutureAPI 7725 // Result returns the result of the asynchronous operation. 7726 // If the operation has not completed it will return an error. 7727 Result func(GalleryImagesClient) (autorest.Response, error) 7728} 7729 7730// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7731func (future *GalleryImagesDeleteFuture) UnmarshalJSON(body []byte) error { 7732 var azFuture azure.Future 7733 if err := json.Unmarshal(body, &azFuture); err != nil { 7734 return err 7735 } 7736 future.FutureAPI = &azFuture 7737 future.Result = future.result 7738 return nil 7739} 7740 7741// result is the default implementation for GalleryImagesDeleteFuture.Result. 7742func (future *GalleryImagesDeleteFuture) result(client GalleryImagesClient) (ar autorest.Response, err error) { 7743 var done bool 7744 done, err = future.DoneWithContext(context.Background(), client) 7745 if err != nil { 7746 err = autorest.NewErrorWithError(err, "compute.GalleryImagesDeleteFuture", "Result", future.Response(), "Polling failure") 7747 return 7748 } 7749 if !done { 7750 ar.Response = future.Response() 7751 err = azure.NewAsyncOpIncompleteError("compute.GalleryImagesDeleteFuture") 7752 return 7753 } 7754 ar.Response = future.Response() 7755 return 7756} 7757 7758// GalleryImagesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 7759// operation. 7760type GalleryImagesUpdateFuture struct { 7761 azure.FutureAPI 7762 // Result returns the result of the asynchronous operation. 7763 // If the operation has not completed it will return an error. 7764 Result func(GalleryImagesClient) (GalleryImage, error) 7765} 7766 7767// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7768func (future *GalleryImagesUpdateFuture) UnmarshalJSON(body []byte) error { 7769 var azFuture azure.Future 7770 if err := json.Unmarshal(body, &azFuture); err != nil { 7771 return err 7772 } 7773 future.FutureAPI = &azFuture 7774 future.Result = future.result 7775 return nil 7776} 7777 7778// result is the default implementation for GalleryImagesUpdateFuture.Result. 7779func (future *GalleryImagesUpdateFuture) result(client GalleryImagesClient) (gi GalleryImage, err error) { 7780 var done bool 7781 done, err = future.DoneWithContext(context.Background(), client) 7782 if err != nil { 7783 err = autorest.NewErrorWithError(err, "compute.GalleryImagesUpdateFuture", "Result", future.Response(), "Polling failure") 7784 return 7785 } 7786 if !done { 7787 gi.Response.Response = future.Response() 7788 err = azure.NewAsyncOpIncompleteError("compute.GalleryImagesUpdateFuture") 7789 return 7790 } 7791 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7792 if gi.Response.Response, err = future.GetResult(sender); err == nil && gi.Response.Response.StatusCode != http.StatusNoContent { 7793 gi, err = client.UpdateResponder(gi.Response.Response) 7794 if err != nil { 7795 err = autorest.NewErrorWithError(err, "compute.GalleryImagesUpdateFuture", "Result", gi.Response.Response, "Failure responding to request") 7796 } 7797 } 7798 return 7799} 7800 7801// GalleryImageUpdate specifies information about the gallery image definition that you want to update. 7802type GalleryImageUpdate struct { 7803 *GalleryImageProperties `json:"properties,omitempty"` 7804 // ID - READ-ONLY; Resource Id 7805 ID *string `json:"id,omitempty"` 7806 // Name - READ-ONLY; Resource name 7807 Name *string `json:"name,omitempty"` 7808 // Type - READ-ONLY; Resource type 7809 Type *string `json:"type,omitempty"` 7810 // Tags - Resource tags 7811 Tags map[string]*string `json:"tags"` 7812} 7813 7814// MarshalJSON is the custom marshaler for GalleryImageUpdate. 7815func (giu GalleryImageUpdate) MarshalJSON() ([]byte, error) { 7816 objectMap := make(map[string]interface{}) 7817 if giu.GalleryImageProperties != nil { 7818 objectMap["properties"] = giu.GalleryImageProperties 7819 } 7820 if giu.Tags != nil { 7821 objectMap["tags"] = giu.Tags 7822 } 7823 return json.Marshal(objectMap) 7824} 7825 7826// UnmarshalJSON is the custom unmarshaler for GalleryImageUpdate struct. 7827func (giu *GalleryImageUpdate) UnmarshalJSON(body []byte) error { 7828 var m map[string]*json.RawMessage 7829 err := json.Unmarshal(body, &m) 7830 if err != nil { 7831 return err 7832 } 7833 for k, v := range m { 7834 switch k { 7835 case "properties": 7836 if v != nil { 7837 var galleryImageProperties GalleryImageProperties 7838 err = json.Unmarshal(*v, &galleryImageProperties) 7839 if err != nil { 7840 return err 7841 } 7842 giu.GalleryImageProperties = &galleryImageProperties 7843 } 7844 case "id": 7845 if v != nil { 7846 var ID string 7847 err = json.Unmarshal(*v, &ID) 7848 if err != nil { 7849 return err 7850 } 7851 giu.ID = &ID 7852 } 7853 case "name": 7854 if v != nil { 7855 var name string 7856 err = json.Unmarshal(*v, &name) 7857 if err != nil { 7858 return err 7859 } 7860 giu.Name = &name 7861 } 7862 case "type": 7863 if v != nil { 7864 var typeVar string 7865 err = json.Unmarshal(*v, &typeVar) 7866 if err != nil { 7867 return err 7868 } 7869 giu.Type = &typeVar 7870 } 7871 case "tags": 7872 if v != nil { 7873 var tags map[string]*string 7874 err = json.Unmarshal(*v, &tags) 7875 if err != nil { 7876 return err 7877 } 7878 giu.Tags = tags 7879 } 7880 } 7881 } 7882 7883 return nil 7884} 7885 7886// GalleryImageVersion specifies information about the gallery image version that you want to create or 7887// update. 7888type GalleryImageVersion struct { 7889 autorest.Response `json:"-"` 7890 *GalleryImageVersionProperties `json:"properties,omitempty"` 7891 // ID - READ-ONLY; Resource Id 7892 ID *string `json:"id,omitempty"` 7893 // Name - READ-ONLY; Resource name 7894 Name *string `json:"name,omitempty"` 7895 // Type - READ-ONLY; Resource type 7896 Type *string `json:"type,omitempty"` 7897 // Location - Resource location 7898 Location *string `json:"location,omitempty"` 7899 // Tags - Resource tags 7900 Tags map[string]*string `json:"tags"` 7901} 7902 7903// MarshalJSON is the custom marshaler for GalleryImageVersion. 7904func (giv GalleryImageVersion) MarshalJSON() ([]byte, error) { 7905 objectMap := make(map[string]interface{}) 7906 if giv.GalleryImageVersionProperties != nil { 7907 objectMap["properties"] = giv.GalleryImageVersionProperties 7908 } 7909 if giv.Location != nil { 7910 objectMap["location"] = giv.Location 7911 } 7912 if giv.Tags != nil { 7913 objectMap["tags"] = giv.Tags 7914 } 7915 return json.Marshal(objectMap) 7916} 7917 7918// UnmarshalJSON is the custom unmarshaler for GalleryImageVersion struct. 7919func (giv *GalleryImageVersion) UnmarshalJSON(body []byte) error { 7920 var m map[string]*json.RawMessage 7921 err := json.Unmarshal(body, &m) 7922 if err != nil { 7923 return err 7924 } 7925 for k, v := range m { 7926 switch k { 7927 case "properties": 7928 if v != nil { 7929 var galleryImageVersionProperties GalleryImageVersionProperties 7930 err = json.Unmarshal(*v, &galleryImageVersionProperties) 7931 if err != nil { 7932 return err 7933 } 7934 giv.GalleryImageVersionProperties = &galleryImageVersionProperties 7935 } 7936 case "id": 7937 if v != nil { 7938 var ID string 7939 err = json.Unmarshal(*v, &ID) 7940 if err != nil { 7941 return err 7942 } 7943 giv.ID = &ID 7944 } 7945 case "name": 7946 if v != nil { 7947 var name string 7948 err = json.Unmarshal(*v, &name) 7949 if err != nil { 7950 return err 7951 } 7952 giv.Name = &name 7953 } 7954 case "type": 7955 if v != nil { 7956 var typeVar string 7957 err = json.Unmarshal(*v, &typeVar) 7958 if err != nil { 7959 return err 7960 } 7961 giv.Type = &typeVar 7962 } 7963 case "location": 7964 if v != nil { 7965 var location string 7966 err = json.Unmarshal(*v, &location) 7967 if err != nil { 7968 return err 7969 } 7970 giv.Location = &location 7971 } 7972 case "tags": 7973 if v != nil { 7974 var tags map[string]*string 7975 err = json.Unmarshal(*v, &tags) 7976 if err != nil { 7977 return err 7978 } 7979 giv.Tags = tags 7980 } 7981 } 7982 } 7983 7984 return nil 7985} 7986 7987// GalleryImageVersionList the List Gallery Image version operation response. 7988type GalleryImageVersionList struct { 7989 autorest.Response `json:"-"` 7990 // Value - A list of gallery image versions. 7991 Value *[]GalleryImageVersion `json:"value,omitempty"` 7992 // 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. 7993 NextLink *string `json:"nextLink,omitempty"` 7994} 7995 7996// GalleryImageVersionListIterator provides access to a complete listing of GalleryImageVersion values. 7997type GalleryImageVersionListIterator struct { 7998 i int 7999 page GalleryImageVersionListPage 8000} 8001 8002// NextWithContext advances to the next value. If there was an error making 8003// the request the iterator does not advance and the error is returned. 8004func (iter *GalleryImageVersionListIterator) NextWithContext(ctx context.Context) (err error) { 8005 if tracing.IsEnabled() { 8006 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionListIterator.NextWithContext") 8007 defer func() { 8008 sc := -1 8009 if iter.Response().Response.Response != nil { 8010 sc = iter.Response().Response.Response.StatusCode 8011 } 8012 tracing.EndSpan(ctx, sc, err) 8013 }() 8014 } 8015 iter.i++ 8016 if iter.i < len(iter.page.Values()) { 8017 return nil 8018 } 8019 err = iter.page.NextWithContext(ctx) 8020 if err != nil { 8021 iter.i-- 8022 return err 8023 } 8024 iter.i = 0 8025 return nil 8026} 8027 8028// Next advances to the next value. If there was an error making 8029// the request the iterator does not advance and the error is returned. 8030// Deprecated: Use NextWithContext() instead. 8031func (iter *GalleryImageVersionListIterator) Next() error { 8032 return iter.NextWithContext(context.Background()) 8033} 8034 8035// NotDone returns true if the enumeration should be started or is not yet complete. 8036func (iter GalleryImageVersionListIterator) NotDone() bool { 8037 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8038} 8039 8040// Response returns the raw server response from the last page request. 8041func (iter GalleryImageVersionListIterator) Response() GalleryImageVersionList { 8042 return iter.page.Response() 8043} 8044 8045// Value returns the current value or a zero-initialized value if the 8046// iterator has advanced beyond the end of the collection. 8047func (iter GalleryImageVersionListIterator) Value() GalleryImageVersion { 8048 if !iter.page.NotDone() { 8049 return GalleryImageVersion{} 8050 } 8051 return iter.page.Values()[iter.i] 8052} 8053 8054// Creates a new instance of the GalleryImageVersionListIterator type. 8055func NewGalleryImageVersionListIterator(page GalleryImageVersionListPage) GalleryImageVersionListIterator { 8056 return GalleryImageVersionListIterator{page: page} 8057} 8058 8059// IsEmpty returns true if the ListResult contains no values. 8060func (givl GalleryImageVersionList) IsEmpty() bool { 8061 return givl.Value == nil || len(*givl.Value) == 0 8062} 8063 8064// hasNextLink returns true if the NextLink is not empty. 8065func (givl GalleryImageVersionList) hasNextLink() bool { 8066 return givl.NextLink != nil && len(*givl.NextLink) != 0 8067} 8068 8069// galleryImageVersionListPreparer prepares a request to retrieve the next set of results. 8070// It returns nil if no more results exist. 8071func (givl GalleryImageVersionList) galleryImageVersionListPreparer(ctx context.Context) (*http.Request, error) { 8072 if !givl.hasNextLink() { 8073 return nil, nil 8074 } 8075 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8076 autorest.AsJSON(), 8077 autorest.AsGet(), 8078 autorest.WithBaseURL(to.String(givl.NextLink))) 8079} 8080 8081// GalleryImageVersionListPage contains a page of GalleryImageVersion values. 8082type GalleryImageVersionListPage struct { 8083 fn func(context.Context, GalleryImageVersionList) (GalleryImageVersionList, error) 8084 givl GalleryImageVersionList 8085} 8086 8087// NextWithContext advances to the next page of values. If there was an error making 8088// the request the page does not advance and the error is returned. 8089func (page *GalleryImageVersionListPage) NextWithContext(ctx context.Context) (err error) { 8090 if tracing.IsEnabled() { 8091 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionListPage.NextWithContext") 8092 defer func() { 8093 sc := -1 8094 if page.Response().Response.Response != nil { 8095 sc = page.Response().Response.Response.StatusCode 8096 } 8097 tracing.EndSpan(ctx, sc, err) 8098 }() 8099 } 8100 for { 8101 next, err := page.fn(ctx, page.givl) 8102 if err != nil { 8103 return err 8104 } 8105 page.givl = next 8106 if !next.hasNextLink() || !next.IsEmpty() { 8107 break 8108 } 8109 } 8110 return nil 8111} 8112 8113// Next advances to the next page of values. If there was an error making 8114// the request the page does not advance and the error is returned. 8115// Deprecated: Use NextWithContext() instead. 8116func (page *GalleryImageVersionListPage) Next() error { 8117 return page.NextWithContext(context.Background()) 8118} 8119 8120// NotDone returns true if the page enumeration should be started or is not yet complete. 8121func (page GalleryImageVersionListPage) NotDone() bool { 8122 return !page.givl.IsEmpty() 8123} 8124 8125// Response returns the raw server response from the last page request. 8126func (page GalleryImageVersionListPage) Response() GalleryImageVersionList { 8127 return page.givl 8128} 8129 8130// Values returns the slice of values for the current page or nil if there are no values. 8131func (page GalleryImageVersionListPage) Values() []GalleryImageVersion { 8132 if page.givl.IsEmpty() { 8133 return nil 8134 } 8135 return *page.givl.Value 8136} 8137 8138// Creates a new instance of the GalleryImageVersionListPage type. 8139func NewGalleryImageVersionListPage(cur GalleryImageVersionList, getNextPage func(context.Context, GalleryImageVersionList) (GalleryImageVersionList, error)) GalleryImageVersionListPage { 8140 return GalleryImageVersionListPage{ 8141 fn: getNextPage, 8142 givl: cur, 8143 } 8144} 8145 8146// GalleryImageVersionProperties describes the properties of a gallery image version. 8147type GalleryImageVersionProperties struct { 8148 PublishingProfile *GalleryImageVersionPublishingProfile `json:"publishingProfile,omitempty"` 8149 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningState3Creating', 'ProvisioningState3Updating', 'ProvisioningState3Failed', 'ProvisioningState3Succeeded', 'ProvisioningState3Deleting', 'ProvisioningState3Migrating' 8150 ProvisioningState ProvisioningState3 `json:"provisioningState,omitempty"` 8151 StorageProfile *GalleryImageVersionStorageProfile `json:"storageProfile,omitempty"` 8152 // ReplicationStatus - READ-ONLY 8153 ReplicationStatus *ReplicationStatus `json:"replicationStatus,omitempty"` 8154} 8155 8156// MarshalJSON is the custom marshaler for GalleryImageVersionProperties. 8157func (givp GalleryImageVersionProperties) MarshalJSON() ([]byte, error) { 8158 objectMap := make(map[string]interface{}) 8159 if givp.PublishingProfile != nil { 8160 objectMap["publishingProfile"] = givp.PublishingProfile 8161 } 8162 if givp.StorageProfile != nil { 8163 objectMap["storageProfile"] = givp.StorageProfile 8164 } 8165 return json.Marshal(objectMap) 8166} 8167 8168// GalleryImageVersionPublishingProfile the publishing profile of a gallery image Version. 8169type GalleryImageVersionPublishingProfile struct { 8170 // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. 8171 TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` 8172 // 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. 8173 ReplicaCount *int32 `json:"replicaCount,omitempty"` 8174 // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. 8175 ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` 8176 // PublishedDate - READ-ONLY; The timestamp for when the gallery image version is published. 8177 PublishedDate *date.Time `json:"publishedDate,omitempty"` 8178 // EndOfLifeDate - The end of life date of the gallery image version. This property can be used for decommissioning purposes. This property is updatable. 8179 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 8180 // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' 8181 StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` 8182 // ReplicationMode - Optional parameter which specifies the mode to be used for replication. This property is not updatable. Possible values include: 'ReplicationModeFull', 'ReplicationModeShallow' 8183 ReplicationMode ReplicationMode `json:"replicationMode,omitempty"` 8184} 8185 8186// MarshalJSON is the custom marshaler for GalleryImageVersionPublishingProfile. 8187func (givpp GalleryImageVersionPublishingProfile) MarshalJSON() ([]byte, error) { 8188 objectMap := make(map[string]interface{}) 8189 if givpp.TargetRegions != nil { 8190 objectMap["targetRegions"] = givpp.TargetRegions 8191 } 8192 if givpp.ReplicaCount != nil { 8193 objectMap["replicaCount"] = givpp.ReplicaCount 8194 } 8195 if givpp.ExcludeFromLatest != nil { 8196 objectMap["excludeFromLatest"] = givpp.ExcludeFromLatest 8197 } 8198 if givpp.EndOfLifeDate != nil { 8199 objectMap["endOfLifeDate"] = givpp.EndOfLifeDate 8200 } 8201 if givpp.StorageAccountType != "" { 8202 objectMap["storageAccountType"] = givpp.StorageAccountType 8203 } 8204 if givpp.ReplicationMode != "" { 8205 objectMap["replicationMode"] = givpp.ReplicationMode 8206 } 8207 return json.Marshal(objectMap) 8208} 8209 8210// GalleryImageVersionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 8211// long-running operation. 8212type GalleryImageVersionsCreateOrUpdateFuture struct { 8213 azure.FutureAPI 8214 // Result returns the result of the asynchronous operation. 8215 // If the operation has not completed it will return an error. 8216 Result func(GalleryImageVersionsClient) (GalleryImageVersion, error) 8217} 8218 8219// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8220func (future *GalleryImageVersionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 8221 var azFuture azure.Future 8222 if err := json.Unmarshal(body, &azFuture); err != nil { 8223 return err 8224 } 8225 future.FutureAPI = &azFuture 8226 future.Result = future.result 8227 return nil 8228} 8229 8230// result is the default implementation for GalleryImageVersionsCreateOrUpdateFuture.Result. 8231func (future *GalleryImageVersionsCreateOrUpdateFuture) result(client GalleryImageVersionsClient) (giv GalleryImageVersion, err error) { 8232 var done bool 8233 done, err = future.DoneWithContext(context.Background(), client) 8234 if err != nil { 8235 err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 8236 return 8237 } 8238 if !done { 8239 giv.Response.Response = future.Response() 8240 err = azure.NewAsyncOpIncompleteError("compute.GalleryImageVersionsCreateOrUpdateFuture") 8241 return 8242 } 8243 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8244 if giv.Response.Response, err = future.GetResult(sender); err == nil && giv.Response.Response.StatusCode != http.StatusNoContent { 8245 giv, err = client.CreateOrUpdateResponder(giv.Response.Response) 8246 if err != nil { 8247 err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsCreateOrUpdateFuture", "Result", giv.Response.Response, "Failure responding to request") 8248 } 8249 } 8250 return 8251} 8252 8253// GalleryImageVersionsDeleteFuture an abstraction for monitoring and retrieving the results of a 8254// long-running operation. 8255type GalleryImageVersionsDeleteFuture struct { 8256 azure.FutureAPI 8257 // Result returns the result of the asynchronous operation. 8258 // If the operation has not completed it will return an error. 8259 Result func(GalleryImageVersionsClient) (autorest.Response, error) 8260} 8261 8262// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8263func (future *GalleryImageVersionsDeleteFuture) UnmarshalJSON(body []byte) error { 8264 var azFuture azure.Future 8265 if err := json.Unmarshal(body, &azFuture); err != nil { 8266 return err 8267 } 8268 future.FutureAPI = &azFuture 8269 future.Result = future.result 8270 return nil 8271} 8272 8273// result is the default implementation for GalleryImageVersionsDeleteFuture.Result. 8274func (future *GalleryImageVersionsDeleteFuture) result(client GalleryImageVersionsClient) (ar autorest.Response, err error) { 8275 var done bool 8276 done, err = future.DoneWithContext(context.Background(), client) 8277 if err != nil { 8278 err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsDeleteFuture", "Result", future.Response(), "Polling failure") 8279 return 8280 } 8281 if !done { 8282 ar.Response = future.Response() 8283 err = azure.NewAsyncOpIncompleteError("compute.GalleryImageVersionsDeleteFuture") 8284 return 8285 } 8286 ar.Response = future.Response() 8287 return 8288} 8289 8290// GalleryImageVersionStorageProfile this is the storage profile of a Gallery Image Version. 8291type GalleryImageVersionStorageProfile struct { 8292 Source *GalleryArtifactVersionSource `json:"source,omitempty"` 8293 OsDiskImage *GalleryOSDiskImage `json:"osDiskImage,omitempty"` 8294 // DataDiskImages - A list of data disk images. 8295 DataDiskImages *[]GalleryDataDiskImage `json:"dataDiskImages,omitempty"` 8296} 8297 8298// GalleryImageVersionsUpdateFuture an abstraction for monitoring and retrieving the results of a 8299// long-running operation. 8300type GalleryImageVersionsUpdateFuture struct { 8301 azure.FutureAPI 8302 // Result returns the result of the asynchronous operation. 8303 // If the operation has not completed it will return an error. 8304 Result func(GalleryImageVersionsClient) (GalleryImageVersion, error) 8305} 8306 8307// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8308func (future *GalleryImageVersionsUpdateFuture) UnmarshalJSON(body []byte) error { 8309 var azFuture azure.Future 8310 if err := json.Unmarshal(body, &azFuture); err != nil { 8311 return err 8312 } 8313 future.FutureAPI = &azFuture 8314 future.Result = future.result 8315 return nil 8316} 8317 8318// result is the default implementation for GalleryImageVersionsUpdateFuture.Result. 8319func (future *GalleryImageVersionsUpdateFuture) result(client GalleryImageVersionsClient) (giv GalleryImageVersion, err error) { 8320 var done bool 8321 done, err = future.DoneWithContext(context.Background(), client) 8322 if err != nil { 8323 err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsUpdateFuture", "Result", future.Response(), "Polling failure") 8324 return 8325 } 8326 if !done { 8327 giv.Response.Response = future.Response() 8328 err = azure.NewAsyncOpIncompleteError("compute.GalleryImageVersionsUpdateFuture") 8329 return 8330 } 8331 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8332 if giv.Response.Response, err = future.GetResult(sender); err == nil && giv.Response.Response.StatusCode != http.StatusNoContent { 8333 giv, err = client.UpdateResponder(giv.Response.Response) 8334 if err != nil { 8335 err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsUpdateFuture", "Result", giv.Response.Response, "Failure responding to request") 8336 } 8337 } 8338 return 8339} 8340 8341// GalleryImageVersionUpdate specifies information about the gallery image version that you want to update. 8342type GalleryImageVersionUpdate struct { 8343 *GalleryImageVersionProperties `json:"properties,omitempty"` 8344 // ID - READ-ONLY; Resource Id 8345 ID *string `json:"id,omitempty"` 8346 // Name - READ-ONLY; Resource name 8347 Name *string `json:"name,omitempty"` 8348 // Type - READ-ONLY; Resource type 8349 Type *string `json:"type,omitempty"` 8350 // Tags - Resource tags 8351 Tags map[string]*string `json:"tags"` 8352} 8353 8354// MarshalJSON is the custom marshaler for GalleryImageVersionUpdate. 8355func (givu GalleryImageVersionUpdate) MarshalJSON() ([]byte, error) { 8356 objectMap := make(map[string]interface{}) 8357 if givu.GalleryImageVersionProperties != nil { 8358 objectMap["properties"] = givu.GalleryImageVersionProperties 8359 } 8360 if givu.Tags != nil { 8361 objectMap["tags"] = givu.Tags 8362 } 8363 return json.Marshal(objectMap) 8364} 8365 8366// UnmarshalJSON is the custom unmarshaler for GalleryImageVersionUpdate struct. 8367func (givu *GalleryImageVersionUpdate) UnmarshalJSON(body []byte) error { 8368 var m map[string]*json.RawMessage 8369 err := json.Unmarshal(body, &m) 8370 if err != nil { 8371 return err 8372 } 8373 for k, v := range m { 8374 switch k { 8375 case "properties": 8376 if v != nil { 8377 var galleryImageVersionProperties GalleryImageVersionProperties 8378 err = json.Unmarshal(*v, &galleryImageVersionProperties) 8379 if err != nil { 8380 return err 8381 } 8382 givu.GalleryImageVersionProperties = &galleryImageVersionProperties 8383 } 8384 case "id": 8385 if v != nil { 8386 var ID string 8387 err = json.Unmarshal(*v, &ID) 8388 if err != nil { 8389 return err 8390 } 8391 givu.ID = &ID 8392 } 8393 case "name": 8394 if v != nil { 8395 var name string 8396 err = json.Unmarshal(*v, &name) 8397 if err != nil { 8398 return err 8399 } 8400 givu.Name = &name 8401 } 8402 case "type": 8403 if v != nil { 8404 var typeVar string 8405 err = json.Unmarshal(*v, &typeVar) 8406 if err != nil { 8407 return err 8408 } 8409 givu.Type = &typeVar 8410 } 8411 case "tags": 8412 if v != nil { 8413 var tags map[string]*string 8414 err = json.Unmarshal(*v, &tags) 8415 if err != nil { 8416 return err 8417 } 8418 givu.Tags = tags 8419 } 8420 } 8421 } 8422 8423 return nil 8424} 8425 8426// GalleryList the List Galleries operation response. 8427type GalleryList struct { 8428 autorest.Response `json:"-"` 8429 // Value - A list of galleries. 8430 Value *[]Gallery `json:"value,omitempty"` 8431 // NextLink - The uri to fetch the next page of galleries. Call ListNext() with this to fetch the next page of galleries. 8432 NextLink *string `json:"nextLink,omitempty"` 8433} 8434 8435// GalleryListIterator provides access to a complete listing of Gallery values. 8436type GalleryListIterator struct { 8437 i int 8438 page GalleryListPage 8439} 8440 8441// NextWithContext advances to the next value. If there was an error making 8442// the request the iterator does not advance and the error is returned. 8443func (iter *GalleryListIterator) NextWithContext(ctx context.Context) (err error) { 8444 if tracing.IsEnabled() { 8445 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryListIterator.NextWithContext") 8446 defer func() { 8447 sc := -1 8448 if iter.Response().Response.Response != nil { 8449 sc = iter.Response().Response.Response.StatusCode 8450 } 8451 tracing.EndSpan(ctx, sc, err) 8452 }() 8453 } 8454 iter.i++ 8455 if iter.i < len(iter.page.Values()) { 8456 return nil 8457 } 8458 err = iter.page.NextWithContext(ctx) 8459 if err != nil { 8460 iter.i-- 8461 return err 8462 } 8463 iter.i = 0 8464 return nil 8465} 8466 8467// Next advances to the next value. If there was an error making 8468// the request the iterator does not advance and the error is returned. 8469// Deprecated: Use NextWithContext() instead. 8470func (iter *GalleryListIterator) Next() error { 8471 return iter.NextWithContext(context.Background()) 8472} 8473 8474// NotDone returns true if the enumeration should be started or is not yet complete. 8475func (iter GalleryListIterator) NotDone() bool { 8476 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8477} 8478 8479// Response returns the raw server response from the last page request. 8480func (iter GalleryListIterator) Response() GalleryList { 8481 return iter.page.Response() 8482} 8483 8484// Value returns the current value or a zero-initialized value if the 8485// iterator has advanced beyond the end of the collection. 8486func (iter GalleryListIterator) Value() Gallery { 8487 if !iter.page.NotDone() { 8488 return Gallery{} 8489 } 8490 return iter.page.Values()[iter.i] 8491} 8492 8493// Creates a new instance of the GalleryListIterator type. 8494func NewGalleryListIterator(page GalleryListPage) GalleryListIterator { 8495 return GalleryListIterator{page: page} 8496} 8497 8498// IsEmpty returns true if the ListResult contains no values. 8499func (gl GalleryList) IsEmpty() bool { 8500 return gl.Value == nil || len(*gl.Value) == 0 8501} 8502 8503// hasNextLink returns true if the NextLink is not empty. 8504func (gl GalleryList) hasNextLink() bool { 8505 return gl.NextLink != nil && len(*gl.NextLink) != 0 8506} 8507 8508// galleryListPreparer prepares a request to retrieve the next set of results. 8509// It returns nil if no more results exist. 8510func (gl GalleryList) galleryListPreparer(ctx context.Context) (*http.Request, error) { 8511 if !gl.hasNextLink() { 8512 return nil, nil 8513 } 8514 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8515 autorest.AsJSON(), 8516 autorest.AsGet(), 8517 autorest.WithBaseURL(to.String(gl.NextLink))) 8518} 8519 8520// GalleryListPage contains a page of Gallery values. 8521type GalleryListPage struct { 8522 fn func(context.Context, GalleryList) (GalleryList, error) 8523 gl GalleryList 8524} 8525 8526// NextWithContext advances to the next page of values. If there was an error making 8527// the request the page does not advance and the error is returned. 8528func (page *GalleryListPage) NextWithContext(ctx context.Context) (err error) { 8529 if tracing.IsEnabled() { 8530 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryListPage.NextWithContext") 8531 defer func() { 8532 sc := -1 8533 if page.Response().Response.Response != nil { 8534 sc = page.Response().Response.Response.StatusCode 8535 } 8536 tracing.EndSpan(ctx, sc, err) 8537 }() 8538 } 8539 for { 8540 next, err := page.fn(ctx, page.gl) 8541 if err != nil { 8542 return err 8543 } 8544 page.gl = next 8545 if !next.hasNextLink() || !next.IsEmpty() { 8546 break 8547 } 8548 } 8549 return nil 8550} 8551 8552// Next advances to the next page of values. If there was an error making 8553// the request the page does not advance and the error is returned. 8554// Deprecated: Use NextWithContext() instead. 8555func (page *GalleryListPage) Next() error { 8556 return page.NextWithContext(context.Background()) 8557} 8558 8559// NotDone returns true if the page enumeration should be started or is not yet complete. 8560func (page GalleryListPage) NotDone() bool { 8561 return !page.gl.IsEmpty() 8562} 8563 8564// Response returns the raw server response from the last page request. 8565func (page GalleryListPage) Response() GalleryList { 8566 return page.gl 8567} 8568 8569// Values returns the slice of values for the current page or nil if there are no values. 8570func (page GalleryListPage) Values() []Gallery { 8571 if page.gl.IsEmpty() { 8572 return nil 8573 } 8574 return *page.gl.Value 8575} 8576 8577// Creates a new instance of the GalleryListPage type. 8578func NewGalleryListPage(cur GalleryList, getNextPage func(context.Context, GalleryList) (GalleryList, error)) GalleryListPage { 8579 return GalleryListPage{ 8580 fn: getNextPage, 8581 gl: cur, 8582 } 8583} 8584 8585// GalleryOSDiskImage this is the OS disk image. 8586type GalleryOSDiskImage struct { 8587 // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. 8588 SizeInGB *int32 `json:"sizeInGB,omitempty"` 8589 // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' 8590 HostCaching HostCaching `json:"hostCaching,omitempty"` 8591 Source *GalleryArtifactVersionSource `json:"source,omitempty"` 8592} 8593 8594// MarshalJSON is the custom marshaler for GalleryOSDiskImage. 8595func (godi GalleryOSDiskImage) MarshalJSON() ([]byte, error) { 8596 objectMap := make(map[string]interface{}) 8597 if godi.HostCaching != "" { 8598 objectMap["hostCaching"] = godi.HostCaching 8599 } 8600 if godi.Source != nil { 8601 objectMap["source"] = godi.Source 8602 } 8603 return json.Marshal(objectMap) 8604} 8605 8606// GalleryProperties describes the properties of a Shared Image Gallery. 8607type GalleryProperties struct { 8608 // Description - The description of this Shared Image Gallery resource. This property is updatable. 8609 Description *string `json:"description,omitempty"` 8610 Identifier *GalleryIdentifier `json:"identifier,omitempty"` 8611 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningStateCreating', 'ProvisioningStateUpdating', 'ProvisioningStateFailed', 'ProvisioningStateSucceeded', 'ProvisioningStateDeleting', 'ProvisioningStateMigrating' 8612 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 8613 SharingProfile *SharingProfile `json:"sharingProfile,omitempty"` 8614 SoftDeletePolicy *SoftDeletePolicy `json:"softDeletePolicy,omitempty"` 8615} 8616 8617// MarshalJSON is the custom marshaler for GalleryProperties. 8618func (gp GalleryProperties) MarshalJSON() ([]byte, error) { 8619 objectMap := make(map[string]interface{}) 8620 if gp.Description != nil { 8621 objectMap["description"] = gp.Description 8622 } 8623 if gp.Identifier != nil { 8624 objectMap["identifier"] = gp.Identifier 8625 } 8626 if gp.SharingProfile != nil { 8627 objectMap["sharingProfile"] = gp.SharingProfile 8628 } 8629 if gp.SoftDeletePolicy != nil { 8630 objectMap["softDeletePolicy"] = gp.SoftDeletePolicy 8631 } 8632 return json.Marshal(objectMap) 8633} 8634 8635// GallerySharingProfileUpdateFuture an abstraction for monitoring and retrieving the results of a 8636// long-running operation. 8637type GallerySharingProfileUpdateFuture struct { 8638 azure.FutureAPI 8639 // Result returns the result of the asynchronous operation. 8640 // If the operation has not completed it will return an error. 8641 Result func(GallerySharingProfileClient) (SharingUpdate, error) 8642} 8643 8644// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8645func (future *GallerySharingProfileUpdateFuture) UnmarshalJSON(body []byte) error { 8646 var azFuture azure.Future 8647 if err := json.Unmarshal(body, &azFuture); err != nil { 8648 return err 8649 } 8650 future.FutureAPI = &azFuture 8651 future.Result = future.result 8652 return nil 8653} 8654 8655// result is the default implementation for GallerySharingProfileUpdateFuture.Result. 8656func (future *GallerySharingProfileUpdateFuture) result(client GallerySharingProfileClient) (su SharingUpdate, err error) { 8657 var done bool 8658 done, err = future.DoneWithContext(context.Background(), client) 8659 if err != nil { 8660 err = autorest.NewErrorWithError(err, "compute.GallerySharingProfileUpdateFuture", "Result", future.Response(), "Polling failure") 8661 return 8662 } 8663 if !done { 8664 su.Response.Response = future.Response() 8665 err = azure.NewAsyncOpIncompleteError("compute.GallerySharingProfileUpdateFuture") 8666 return 8667 } 8668 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8669 if su.Response.Response, err = future.GetResult(sender); err == nil && su.Response.Response.StatusCode != http.StatusNoContent { 8670 su, err = client.UpdateResponder(su.Response.Response) 8671 if err != nil { 8672 err = autorest.NewErrorWithError(err, "compute.GallerySharingProfileUpdateFuture", "Result", su.Response.Response, "Failure responding to request") 8673 } 8674 } 8675 return 8676} 8677 8678// GalleryUpdate specifies information about the Shared Image Gallery that you want to update. 8679type GalleryUpdate struct { 8680 *GalleryProperties `json:"properties,omitempty"` 8681 // ID - READ-ONLY; Resource Id 8682 ID *string `json:"id,omitempty"` 8683 // Name - READ-ONLY; Resource name 8684 Name *string `json:"name,omitempty"` 8685 // Type - READ-ONLY; Resource type 8686 Type *string `json:"type,omitempty"` 8687 // Tags - Resource tags 8688 Tags map[string]*string `json:"tags"` 8689} 8690 8691// MarshalJSON is the custom marshaler for GalleryUpdate. 8692func (gu GalleryUpdate) MarshalJSON() ([]byte, error) { 8693 objectMap := make(map[string]interface{}) 8694 if gu.GalleryProperties != nil { 8695 objectMap["properties"] = gu.GalleryProperties 8696 } 8697 if gu.Tags != nil { 8698 objectMap["tags"] = gu.Tags 8699 } 8700 return json.Marshal(objectMap) 8701} 8702 8703// UnmarshalJSON is the custom unmarshaler for GalleryUpdate struct. 8704func (gu *GalleryUpdate) UnmarshalJSON(body []byte) error { 8705 var m map[string]*json.RawMessage 8706 err := json.Unmarshal(body, &m) 8707 if err != nil { 8708 return err 8709 } 8710 for k, v := range m { 8711 switch k { 8712 case "properties": 8713 if v != nil { 8714 var galleryProperties GalleryProperties 8715 err = json.Unmarshal(*v, &galleryProperties) 8716 if err != nil { 8717 return err 8718 } 8719 gu.GalleryProperties = &galleryProperties 8720 } 8721 case "id": 8722 if v != nil { 8723 var ID string 8724 err = json.Unmarshal(*v, &ID) 8725 if err != nil { 8726 return err 8727 } 8728 gu.ID = &ID 8729 } 8730 case "name": 8731 if v != nil { 8732 var name string 8733 err = json.Unmarshal(*v, &name) 8734 if err != nil { 8735 return err 8736 } 8737 gu.Name = &name 8738 } 8739 case "type": 8740 if v != nil { 8741 var typeVar string 8742 err = json.Unmarshal(*v, &typeVar) 8743 if err != nil { 8744 return err 8745 } 8746 gu.Type = &typeVar 8747 } 8748 case "tags": 8749 if v != nil { 8750 var tags map[string]*string 8751 err = json.Unmarshal(*v, &tags) 8752 if err != nil { 8753 return err 8754 } 8755 gu.Tags = tags 8756 } 8757 } 8758 } 8759 8760 return nil 8761} 8762 8763// GrantAccessData data used for requesting a SAS. 8764type GrantAccessData struct { 8765 // Access - Possible values include: 'AccessLevelNone', 'AccessLevelRead', 'AccessLevelWrite' 8766 Access AccessLevel `json:"access,omitempty"` 8767 // DurationInSeconds - Time duration in seconds until the SAS access expires. 8768 DurationInSeconds *int32 `json:"durationInSeconds,omitempty"` 8769} 8770 8771// HardwareProfile specifies the hardware settings for the virtual machine. 8772type HardwareProfile struct { 8773 // 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' 8774 VMSize VirtualMachineSizeTypes `json:"vmSize,omitempty"` 8775 // VMSizeProperties - Specifies the properties for customizing the size of the virtual machine. Minimum api-version: 2021-07-01. <br><br> This feature is still in preview mode and is not supported for VirtualMachineScaleSet. <br><br> Please follow the instructions in [VM Customization](https://aka.ms/vmcustomization) for more details. 8776 VMSizeProperties *VMSizeProperties `json:"vmSizeProperties,omitempty"` 8777} 8778 8779// Image the source user image virtual hard disk. The virtual hard disk will be copied before being 8780// attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not 8781// exist. 8782type Image struct { 8783 autorest.Response `json:"-"` 8784 *ImageProperties `json:"properties,omitempty"` 8785 // ExtendedLocation - The extended location of the Image. 8786 ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` 8787 // ID - READ-ONLY; Resource Id 8788 ID *string `json:"id,omitempty"` 8789 // Name - READ-ONLY; Resource name 8790 Name *string `json:"name,omitempty"` 8791 // Type - READ-ONLY; Resource type 8792 Type *string `json:"type,omitempty"` 8793 // Location - Resource location 8794 Location *string `json:"location,omitempty"` 8795 // Tags - Resource tags 8796 Tags map[string]*string `json:"tags"` 8797} 8798 8799// MarshalJSON is the custom marshaler for Image. 8800func (i Image) MarshalJSON() ([]byte, error) { 8801 objectMap := make(map[string]interface{}) 8802 if i.ImageProperties != nil { 8803 objectMap["properties"] = i.ImageProperties 8804 } 8805 if i.ExtendedLocation != nil { 8806 objectMap["extendedLocation"] = i.ExtendedLocation 8807 } 8808 if i.Location != nil { 8809 objectMap["location"] = i.Location 8810 } 8811 if i.Tags != nil { 8812 objectMap["tags"] = i.Tags 8813 } 8814 return json.Marshal(objectMap) 8815} 8816 8817// UnmarshalJSON is the custom unmarshaler for Image struct. 8818func (i *Image) UnmarshalJSON(body []byte) error { 8819 var m map[string]*json.RawMessage 8820 err := json.Unmarshal(body, &m) 8821 if err != nil { 8822 return err 8823 } 8824 for k, v := range m { 8825 switch k { 8826 case "properties": 8827 if v != nil { 8828 var imageProperties ImageProperties 8829 err = json.Unmarshal(*v, &imageProperties) 8830 if err != nil { 8831 return err 8832 } 8833 i.ImageProperties = &imageProperties 8834 } 8835 case "extendedLocation": 8836 if v != nil { 8837 var extendedLocation ExtendedLocation 8838 err = json.Unmarshal(*v, &extendedLocation) 8839 if err != nil { 8840 return err 8841 } 8842 i.ExtendedLocation = &extendedLocation 8843 } 8844 case "id": 8845 if v != nil { 8846 var ID string 8847 err = json.Unmarshal(*v, &ID) 8848 if err != nil { 8849 return err 8850 } 8851 i.ID = &ID 8852 } 8853 case "name": 8854 if v != nil { 8855 var name string 8856 err = json.Unmarshal(*v, &name) 8857 if err != nil { 8858 return err 8859 } 8860 i.Name = &name 8861 } 8862 case "type": 8863 if v != nil { 8864 var typeVar string 8865 err = json.Unmarshal(*v, &typeVar) 8866 if err != nil { 8867 return err 8868 } 8869 i.Type = &typeVar 8870 } 8871 case "location": 8872 if v != nil { 8873 var location string 8874 err = json.Unmarshal(*v, &location) 8875 if err != nil { 8876 return err 8877 } 8878 i.Location = &location 8879 } 8880 case "tags": 8881 if v != nil { 8882 var tags map[string]*string 8883 err = json.Unmarshal(*v, &tags) 8884 if err != nil { 8885 return err 8886 } 8887 i.Tags = tags 8888 } 8889 } 8890 } 8891 8892 return nil 8893} 8894 8895// ImageDataDisk describes a data disk. 8896type ImageDataDisk struct { 8897 // 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. 8898 Lun *int32 `json:"lun,omitempty"` 8899 // Snapshot - The snapshot. 8900 Snapshot *SubResource `json:"snapshot,omitempty"` 8901 // ManagedDisk - The managedDisk. 8902 ManagedDisk *SubResource `json:"managedDisk,omitempty"` 8903 // BlobURI - The Virtual Hard Disk. 8904 BlobURI *string `json:"blobUri,omitempty"` 8905 // 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' 8906 Caching CachingTypes `json:"caching,omitempty"` 8907 // 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 8908 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 8909 // 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' 8910 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 8911 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. 8912 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 8913} 8914 8915// ImageDisk describes a image disk. 8916type ImageDisk struct { 8917 // Snapshot - The snapshot. 8918 Snapshot *SubResource `json:"snapshot,omitempty"` 8919 // ManagedDisk - The managedDisk. 8920 ManagedDisk *SubResource `json:"managedDisk,omitempty"` 8921 // BlobURI - The Virtual Hard Disk. 8922 BlobURI *string `json:"blobUri,omitempty"` 8923 // 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' 8924 Caching CachingTypes `json:"caching,omitempty"` 8925 // 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 8926 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 8927 // 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' 8928 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 8929 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. 8930 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 8931} 8932 8933// ImageDiskReference the source image used for creating the disk. 8934type ImageDiskReference struct { 8935 // ID - A relative uri containing either a Platform Image Repository or user image reference. 8936 ID *string `json:"id,omitempty"` 8937 // 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. 8938 Lun *int32 `json:"lun,omitempty"` 8939} 8940 8941// ImageListResult the List Image operation response. 8942type ImageListResult struct { 8943 autorest.Response `json:"-"` 8944 // Value - The list of Images. 8945 Value *[]Image `json:"value,omitempty"` 8946 // NextLink - The uri to fetch the next page of Images. Call ListNext() with this to fetch the next page of Images. 8947 NextLink *string `json:"nextLink,omitempty"` 8948} 8949 8950// ImageListResultIterator provides access to a complete listing of Image values. 8951type ImageListResultIterator struct { 8952 i int 8953 page ImageListResultPage 8954} 8955 8956// NextWithContext advances to the next value. If there was an error making 8957// the request the iterator does not advance and the error is returned. 8958func (iter *ImageListResultIterator) NextWithContext(ctx context.Context) (err error) { 8959 if tracing.IsEnabled() { 8960 ctx = tracing.StartSpan(ctx, fqdn+"/ImageListResultIterator.NextWithContext") 8961 defer func() { 8962 sc := -1 8963 if iter.Response().Response.Response != nil { 8964 sc = iter.Response().Response.Response.StatusCode 8965 } 8966 tracing.EndSpan(ctx, sc, err) 8967 }() 8968 } 8969 iter.i++ 8970 if iter.i < len(iter.page.Values()) { 8971 return nil 8972 } 8973 err = iter.page.NextWithContext(ctx) 8974 if err != nil { 8975 iter.i-- 8976 return err 8977 } 8978 iter.i = 0 8979 return nil 8980} 8981 8982// Next advances to the next value. If there was an error making 8983// the request the iterator does not advance and the error is returned. 8984// Deprecated: Use NextWithContext() instead. 8985func (iter *ImageListResultIterator) Next() error { 8986 return iter.NextWithContext(context.Background()) 8987} 8988 8989// NotDone returns true if the enumeration should be started or is not yet complete. 8990func (iter ImageListResultIterator) NotDone() bool { 8991 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8992} 8993 8994// Response returns the raw server response from the last page request. 8995func (iter ImageListResultIterator) Response() ImageListResult { 8996 return iter.page.Response() 8997} 8998 8999// Value returns the current value or a zero-initialized value if the 9000// iterator has advanced beyond the end of the collection. 9001func (iter ImageListResultIterator) Value() Image { 9002 if !iter.page.NotDone() { 9003 return Image{} 9004 } 9005 return iter.page.Values()[iter.i] 9006} 9007 9008// Creates a new instance of the ImageListResultIterator type. 9009func NewImageListResultIterator(page ImageListResultPage) ImageListResultIterator { 9010 return ImageListResultIterator{page: page} 9011} 9012 9013// IsEmpty returns true if the ListResult contains no values. 9014func (ilr ImageListResult) IsEmpty() bool { 9015 return ilr.Value == nil || len(*ilr.Value) == 0 9016} 9017 9018// hasNextLink returns true if the NextLink is not empty. 9019func (ilr ImageListResult) hasNextLink() bool { 9020 return ilr.NextLink != nil && len(*ilr.NextLink) != 0 9021} 9022 9023// imageListResultPreparer prepares a request to retrieve the next set of results. 9024// It returns nil if no more results exist. 9025func (ilr ImageListResult) imageListResultPreparer(ctx context.Context) (*http.Request, error) { 9026 if !ilr.hasNextLink() { 9027 return nil, nil 9028 } 9029 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9030 autorest.AsJSON(), 9031 autorest.AsGet(), 9032 autorest.WithBaseURL(to.String(ilr.NextLink))) 9033} 9034 9035// ImageListResultPage contains a page of Image values. 9036type ImageListResultPage struct { 9037 fn func(context.Context, ImageListResult) (ImageListResult, error) 9038 ilr ImageListResult 9039} 9040 9041// NextWithContext advances to the next page of values. If there was an error making 9042// the request the page does not advance and the error is returned. 9043func (page *ImageListResultPage) NextWithContext(ctx context.Context) (err error) { 9044 if tracing.IsEnabled() { 9045 ctx = tracing.StartSpan(ctx, fqdn+"/ImageListResultPage.NextWithContext") 9046 defer func() { 9047 sc := -1 9048 if page.Response().Response.Response != nil { 9049 sc = page.Response().Response.Response.StatusCode 9050 } 9051 tracing.EndSpan(ctx, sc, err) 9052 }() 9053 } 9054 for { 9055 next, err := page.fn(ctx, page.ilr) 9056 if err != nil { 9057 return err 9058 } 9059 page.ilr = next 9060 if !next.hasNextLink() || !next.IsEmpty() { 9061 break 9062 } 9063 } 9064 return nil 9065} 9066 9067// Next advances to the next page of values. If there was an error making 9068// the request the page does not advance and the error is returned. 9069// Deprecated: Use NextWithContext() instead. 9070func (page *ImageListResultPage) Next() error { 9071 return page.NextWithContext(context.Background()) 9072} 9073 9074// NotDone returns true if the page enumeration should be started or is not yet complete. 9075func (page ImageListResultPage) NotDone() bool { 9076 return !page.ilr.IsEmpty() 9077} 9078 9079// Response returns the raw server response from the last page request. 9080func (page ImageListResultPage) Response() ImageListResult { 9081 return page.ilr 9082} 9083 9084// Values returns the slice of values for the current page or nil if there are no values. 9085func (page ImageListResultPage) Values() []Image { 9086 if page.ilr.IsEmpty() { 9087 return nil 9088 } 9089 return *page.ilr.Value 9090} 9091 9092// Creates a new instance of the ImageListResultPage type. 9093func NewImageListResultPage(cur ImageListResult, getNextPage func(context.Context, ImageListResult) (ImageListResult, error)) ImageListResultPage { 9094 return ImageListResultPage{ 9095 fn: getNextPage, 9096 ilr: cur, 9097 } 9098} 9099 9100// ImageOSDisk describes an Operating System disk. 9101type ImageOSDisk struct { 9102 // 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' 9103 OsType OperatingSystemTypes `json:"osType,omitempty"` 9104 // OsState - The OS State. Possible values include: 'OperatingSystemStateTypesGeneralized', 'OperatingSystemStateTypesSpecialized' 9105 OsState OperatingSystemStateTypes `json:"osState,omitempty"` 9106 // Snapshot - The snapshot. 9107 Snapshot *SubResource `json:"snapshot,omitempty"` 9108 // ManagedDisk - The managedDisk. 9109 ManagedDisk *SubResource `json:"managedDisk,omitempty"` 9110 // BlobURI - The Virtual Hard Disk. 9111 BlobURI *string `json:"blobUri,omitempty"` 9112 // 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' 9113 Caching CachingTypes `json:"caching,omitempty"` 9114 // 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 9115 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 9116 // 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' 9117 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 9118 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. 9119 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 9120} 9121 9122// ImageProperties describes the properties of an Image. 9123type ImageProperties struct { 9124 // SourceVirtualMachine - The source virtual machine from which Image is created. 9125 SourceVirtualMachine *SubResource `json:"sourceVirtualMachine,omitempty"` 9126 // StorageProfile - Specifies the storage settings for the virtual machine disks. 9127 StorageProfile *ImageStorageProfile `json:"storageProfile,omitempty"` 9128 // ProvisioningState - READ-ONLY; The provisioning state. 9129 ProvisioningState *string `json:"provisioningState,omitempty"` 9130 // 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' 9131 HyperVGeneration HyperVGenerationTypes `json:"hyperVGeneration,omitempty"` 9132} 9133 9134// MarshalJSON is the custom marshaler for ImageProperties. 9135func (IP ImageProperties) MarshalJSON() ([]byte, error) { 9136 objectMap := make(map[string]interface{}) 9137 if IP.SourceVirtualMachine != nil { 9138 objectMap["sourceVirtualMachine"] = IP.SourceVirtualMachine 9139 } 9140 if IP.StorageProfile != nil { 9141 objectMap["storageProfile"] = IP.StorageProfile 9142 } 9143 if IP.HyperVGeneration != "" { 9144 objectMap["hyperVGeneration"] = IP.HyperVGeneration 9145 } 9146 return json.Marshal(objectMap) 9147} 9148 9149// ImagePurchasePlan describes the gallery image definition purchase plan. This is used by marketplace 9150// images. 9151type ImagePurchasePlan struct { 9152 // Name - The plan ID. 9153 Name *string `json:"name,omitempty"` 9154 // Publisher - The publisher ID. 9155 Publisher *string `json:"publisher,omitempty"` 9156 // Product - The product ID. 9157 Product *string `json:"product,omitempty"` 9158} 9159 9160// ImageReference specifies information about the image to use. You can specify information about platform 9161// images, marketplace images, or virtual machine images. This element is required when you want to use a 9162// platform image, marketplace image, or virtual machine image, but is not used in other creation 9163// operations. NOTE: Image reference publisher and offer can only be set when you create the scale set. 9164type ImageReference struct { 9165 // Publisher - The image publisher. 9166 Publisher *string `json:"publisher,omitempty"` 9167 // Offer - Specifies the offer of the platform image or marketplace image used to create the virtual machine. 9168 Offer *string `json:"offer,omitempty"` 9169 // Sku - The image SKU. 9170 Sku *string `json:"sku,omitempty"` 9171 // 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. 9172 Version *string `json:"version,omitempty"` 9173 // 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'. 9174 ExactVersion *string `json:"exactVersion,omitempty"` 9175 // SharedGalleryImageID - Specified the shared gallery image unique id for vm deployment. This can be fetched from shared gallery image GET call. 9176 SharedGalleryImageID *string `json:"sharedGalleryImageId,omitempty"` 9177 // ID - Resource Id 9178 ID *string `json:"id,omitempty"` 9179} 9180 9181// MarshalJSON is the custom marshaler for ImageReference. 9182func (ir ImageReference) MarshalJSON() ([]byte, error) { 9183 objectMap := make(map[string]interface{}) 9184 if ir.Publisher != nil { 9185 objectMap["publisher"] = ir.Publisher 9186 } 9187 if ir.Offer != nil { 9188 objectMap["offer"] = ir.Offer 9189 } 9190 if ir.Sku != nil { 9191 objectMap["sku"] = ir.Sku 9192 } 9193 if ir.Version != nil { 9194 objectMap["version"] = ir.Version 9195 } 9196 if ir.SharedGalleryImageID != nil { 9197 objectMap["sharedGalleryImageId"] = ir.SharedGalleryImageID 9198 } 9199 if ir.ID != nil { 9200 objectMap["id"] = ir.ID 9201 } 9202 return json.Marshal(objectMap) 9203} 9204 9205// ImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 9206// operation. 9207type ImagesCreateOrUpdateFuture struct { 9208 azure.FutureAPI 9209 // Result returns the result of the asynchronous operation. 9210 // If the operation has not completed it will return an error. 9211 Result func(ImagesClient) (Image, error) 9212} 9213 9214// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9215func (future *ImagesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 9216 var azFuture azure.Future 9217 if err := json.Unmarshal(body, &azFuture); err != nil { 9218 return err 9219 } 9220 future.FutureAPI = &azFuture 9221 future.Result = future.result 9222 return nil 9223} 9224 9225// result is the default implementation for ImagesCreateOrUpdateFuture.Result. 9226func (future *ImagesCreateOrUpdateFuture) result(client ImagesClient) (i Image, err error) { 9227 var done bool 9228 done, err = future.DoneWithContext(context.Background(), client) 9229 if err != nil { 9230 err = autorest.NewErrorWithError(err, "compute.ImagesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 9231 return 9232 } 9233 if !done { 9234 i.Response.Response = future.Response() 9235 err = azure.NewAsyncOpIncompleteError("compute.ImagesCreateOrUpdateFuture") 9236 return 9237 } 9238 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9239 if i.Response.Response, err = future.GetResult(sender); err == nil && i.Response.Response.StatusCode != http.StatusNoContent { 9240 i, err = client.CreateOrUpdateResponder(i.Response.Response) 9241 if err != nil { 9242 err = autorest.NewErrorWithError(err, "compute.ImagesCreateOrUpdateFuture", "Result", i.Response.Response, "Failure responding to request") 9243 } 9244 } 9245 return 9246} 9247 9248// ImagesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 9249type ImagesDeleteFuture struct { 9250 azure.FutureAPI 9251 // Result returns the result of the asynchronous operation. 9252 // If the operation has not completed it will return an error. 9253 Result func(ImagesClient) (autorest.Response, error) 9254} 9255 9256// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9257func (future *ImagesDeleteFuture) UnmarshalJSON(body []byte) error { 9258 var azFuture azure.Future 9259 if err := json.Unmarshal(body, &azFuture); err != nil { 9260 return err 9261 } 9262 future.FutureAPI = &azFuture 9263 future.Result = future.result 9264 return nil 9265} 9266 9267// result is the default implementation for ImagesDeleteFuture.Result. 9268func (future *ImagesDeleteFuture) result(client ImagesClient) (ar autorest.Response, err error) { 9269 var done bool 9270 done, err = future.DoneWithContext(context.Background(), client) 9271 if err != nil { 9272 err = autorest.NewErrorWithError(err, "compute.ImagesDeleteFuture", "Result", future.Response(), "Polling failure") 9273 return 9274 } 9275 if !done { 9276 ar.Response = future.Response() 9277 err = azure.NewAsyncOpIncompleteError("compute.ImagesDeleteFuture") 9278 return 9279 } 9280 ar.Response = future.Response() 9281 return 9282} 9283 9284// ImageStorageProfile describes a storage profile. 9285type ImageStorageProfile struct { 9286 // 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). 9287 OsDisk *ImageOSDisk `json:"osDisk,omitempty"` 9288 // 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). 9289 DataDisks *[]ImageDataDisk `json:"dataDisks,omitempty"` 9290 // 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). 9291 ZoneResilient *bool `json:"zoneResilient,omitempty"` 9292} 9293 9294// ImagesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. 9295type ImagesUpdateFuture struct { 9296 azure.FutureAPI 9297 // Result returns the result of the asynchronous operation. 9298 // If the operation has not completed it will return an error. 9299 Result func(ImagesClient) (Image, error) 9300} 9301 9302// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9303func (future *ImagesUpdateFuture) UnmarshalJSON(body []byte) error { 9304 var azFuture azure.Future 9305 if err := json.Unmarshal(body, &azFuture); err != nil { 9306 return err 9307 } 9308 future.FutureAPI = &azFuture 9309 future.Result = future.result 9310 return nil 9311} 9312 9313// result is the default implementation for ImagesUpdateFuture.Result. 9314func (future *ImagesUpdateFuture) result(client ImagesClient) (i Image, err error) { 9315 var done bool 9316 done, err = future.DoneWithContext(context.Background(), client) 9317 if err != nil { 9318 err = autorest.NewErrorWithError(err, "compute.ImagesUpdateFuture", "Result", future.Response(), "Polling failure") 9319 return 9320 } 9321 if !done { 9322 i.Response.Response = future.Response() 9323 err = azure.NewAsyncOpIncompleteError("compute.ImagesUpdateFuture") 9324 return 9325 } 9326 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9327 if i.Response.Response, err = future.GetResult(sender); err == nil && i.Response.Response.StatusCode != http.StatusNoContent { 9328 i, err = client.UpdateResponder(i.Response.Response) 9329 if err != nil { 9330 err = autorest.NewErrorWithError(err, "compute.ImagesUpdateFuture", "Result", i.Response.Response, "Failure responding to request") 9331 } 9332 } 9333 return 9334} 9335 9336// ImageUpdate the source user image virtual hard disk. Only tags may be updated. 9337type ImageUpdate struct { 9338 *ImageProperties `json:"properties,omitempty"` 9339 // Tags - Resource tags 9340 Tags map[string]*string `json:"tags"` 9341} 9342 9343// MarshalJSON is the custom marshaler for ImageUpdate. 9344func (iu ImageUpdate) MarshalJSON() ([]byte, error) { 9345 objectMap := make(map[string]interface{}) 9346 if iu.ImageProperties != nil { 9347 objectMap["properties"] = iu.ImageProperties 9348 } 9349 if iu.Tags != nil { 9350 objectMap["tags"] = iu.Tags 9351 } 9352 return json.Marshal(objectMap) 9353} 9354 9355// UnmarshalJSON is the custom unmarshaler for ImageUpdate struct. 9356func (iu *ImageUpdate) UnmarshalJSON(body []byte) error { 9357 var m map[string]*json.RawMessage 9358 err := json.Unmarshal(body, &m) 9359 if err != nil { 9360 return err 9361 } 9362 for k, v := range m { 9363 switch k { 9364 case "properties": 9365 if v != nil { 9366 var imageProperties ImageProperties 9367 err = json.Unmarshal(*v, &imageProperties) 9368 if err != nil { 9369 return err 9370 } 9371 iu.ImageProperties = &imageProperties 9372 } 9373 case "tags": 9374 if v != nil { 9375 var tags map[string]*string 9376 err = json.Unmarshal(*v, &tags) 9377 if err != nil { 9378 return err 9379 } 9380 iu.Tags = tags 9381 } 9382 } 9383 } 9384 9385 return nil 9386} 9387 9388// InnerError inner error details. 9389type InnerError struct { 9390 // Exceptiontype - The exception type. 9391 Exceptiontype *string `json:"exceptiontype,omitempty"` 9392 // Errordetail - The internal error message or exception dump. 9393 Errordetail *string `json:"errordetail,omitempty"` 9394} 9395 9396// InstanceSku ... 9397type InstanceSku struct { 9398 // Name - READ-ONLY; The sku name. 9399 Name *string `json:"name,omitempty"` 9400 // Tier - READ-ONLY; The tier of the cloud service role instance. 9401 Tier *string `json:"tier,omitempty"` 9402} 9403 9404// MarshalJSON is the custom marshaler for InstanceSku. 9405func (is InstanceSku) MarshalJSON() ([]byte, error) { 9406 objectMap := make(map[string]interface{}) 9407 return json.Marshal(objectMap) 9408} 9409 9410// InstanceViewStatus instance view status. 9411type InstanceViewStatus struct { 9412 // Code - The status code. 9413 Code *string `json:"code,omitempty"` 9414 // Level - The level code. Possible values include: 'StatusLevelTypesInfo', 'StatusLevelTypesWarning', 'StatusLevelTypesError' 9415 Level StatusLevelTypes `json:"level,omitempty"` 9416 // DisplayStatus - The short localizable label for the status. 9417 DisplayStatus *string `json:"displayStatus,omitempty"` 9418 // Message - The detailed status message, including for alerts and error messages. 9419 Message *string `json:"message,omitempty"` 9420 // Time - The time of the status. 9421 Time *date.Time `json:"time,omitempty"` 9422} 9423 9424// InstanceViewStatusesSummary instance view statuses. 9425type InstanceViewStatusesSummary struct { 9426 // StatusesSummary - READ-ONLY 9427 StatusesSummary *[]StatusCodeCount `json:"statusesSummary,omitempty"` 9428} 9429 9430// MarshalJSON is the custom marshaler for InstanceViewStatusesSummary. 9431func (ivss InstanceViewStatusesSummary) MarshalJSON() ([]byte, error) { 9432 objectMap := make(map[string]interface{}) 9433 return json.Marshal(objectMap) 9434} 9435 9436// KeyForDiskEncryptionSet key Vault Key Url to be used for server side encryption of Managed Disks and 9437// Snapshots 9438type KeyForDiskEncryptionSet struct { 9439 // 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. 9440 SourceVault *SourceVault `json:"sourceVault,omitempty"` 9441 // KeyURL - Fully versioned Key Url pointing to a key in KeyVault. Version segment of the Url is required regardless of rotationToLatestKeyVersionEnabled value. 9442 KeyURL *string `json:"keyUrl,omitempty"` 9443} 9444 9445// KeyVaultAndKeyReference key Vault Key Url and vault id of KeK, KeK is optional and when provided is used 9446// to unwrap the encryptionKey 9447type KeyVaultAndKeyReference struct { 9448 // SourceVault - Resource id of the KeyVault containing the key or secret 9449 SourceVault *SourceVault `json:"sourceVault,omitempty"` 9450 // KeyURL - Url pointing to a key or secret in KeyVault 9451 KeyURL *string `json:"keyUrl,omitempty"` 9452} 9453 9454// KeyVaultAndSecretReference key Vault Secret Url and vault id of the encryption key 9455type KeyVaultAndSecretReference struct { 9456 // SourceVault - Resource id of the KeyVault containing the key or secret 9457 SourceVault *SourceVault `json:"sourceVault,omitempty"` 9458 // SecretURL - Url pointing to a key or secret in KeyVault 9459 SecretURL *string `json:"secretUrl,omitempty"` 9460} 9461 9462// KeyVaultKeyReference describes a reference to Key Vault Key 9463type KeyVaultKeyReference struct { 9464 // KeyURL - The URL referencing a key encryption key in Key Vault. 9465 KeyURL *string `json:"keyUrl,omitempty"` 9466 // SourceVault - The relative URL of the Key Vault containing the key. 9467 SourceVault *SubResource `json:"sourceVault,omitempty"` 9468} 9469 9470// KeyVaultSecretReference describes a reference to Key Vault Secret 9471type KeyVaultSecretReference struct { 9472 // SecretURL - The URL referencing a secret in a Key Vault. 9473 SecretURL *string `json:"secretUrl,omitempty"` 9474 // SourceVault - The relative URL of the Key Vault containing the secret. 9475 SourceVault *SubResource `json:"sourceVault,omitempty"` 9476} 9477 9478// LastPatchInstallationSummary describes the properties of the last installed patch summary. 9479type LastPatchInstallationSummary struct { 9480 // 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' 9481 Status PatchOperationStatus `json:"status,omitempty"` 9482 // InstallationActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. 9483 InstallationActivityID *string `json:"installationActivityId,omitempty"` 9484 // MaintenanceWindowExceeded - READ-ONLY; Describes whether the operation ran out of time before it completed all its intended actions 9485 MaintenanceWindowExceeded *bool `json:"maintenanceWindowExceeded,omitempty"` 9486 // 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. 9487 NotSelectedPatchCount *int32 `json:"notSelectedPatchCount,omitempty"` 9488 // ExcludedPatchCount - READ-ONLY; The number of all available patches but excluded explicitly by a customer-specified exclusion list match. 9489 ExcludedPatchCount *int32 `json:"excludedPatchCount,omitempty"` 9490 // PendingPatchCount - READ-ONLY; The number of all available patches expected to be installed over the course of the patch installation operation. 9491 PendingPatchCount *int32 `json:"pendingPatchCount,omitempty"` 9492 // InstalledPatchCount - READ-ONLY; The count of patches that successfully installed. 9493 InstalledPatchCount *int32 `json:"installedPatchCount,omitempty"` 9494 // FailedPatchCount - READ-ONLY; The count of patches that failed installation. 9495 FailedPatchCount *int32 `json:"failedPatchCount,omitempty"` 9496 // StartTime - READ-ONLY; The UTC timestamp when the operation began. 9497 StartTime *date.Time `json:"startTime,omitempty"` 9498 // LastModifiedTime - READ-ONLY; The UTC timestamp when the operation began. 9499 LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` 9500 // Error - READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. 9501 Error *APIError `json:"error,omitempty"` 9502} 9503 9504// MarshalJSON is the custom marshaler for LastPatchInstallationSummary. 9505func (lpis LastPatchInstallationSummary) MarshalJSON() ([]byte, error) { 9506 objectMap := make(map[string]interface{}) 9507 return json.Marshal(objectMap) 9508} 9509 9510// LinuxConfiguration specifies the Linux operating system settings on the virtual machine. <br><br>For a 9511// list of supported Linux distributions, see [Linux on Azure-Endorsed 9512// Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). 9513type LinuxConfiguration struct { 9514 // DisablePasswordAuthentication - Specifies whether password authentication should be disabled. 9515 DisablePasswordAuthentication *bool `json:"disablePasswordAuthentication,omitempty"` 9516 // SSH - Specifies the ssh key configuration for a Linux OS. 9517 SSH *SSHConfiguration `json:"ssh,omitempty"` 9518 // 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. 9519 ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` 9520 // PatchSettings - [Preview Feature] Specifies settings related to VM Guest Patching on Linux. 9521 PatchSettings *LinuxPatchSettings `json:"patchSettings,omitempty"` 9522} 9523 9524// LinuxParameters input for InstallPatches on a Linux VM, as directly received by the API 9525type LinuxParameters struct { 9526 // ClassificationsToInclude - The update classifications to select when installing patches for Linux. 9527 ClassificationsToInclude *[]VMGuestPatchClassificationLinux `json:"classificationsToInclude,omitempty"` 9528 // PackageNameMasksToInclude - packages to include in the patch operation. Format: packageName_packageVersion 9529 PackageNameMasksToInclude *[]string `json:"packageNameMasksToInclude,omitempty"` 9530 // PackageNameMasksToExclude - packages to exclude in the patch operation. Format: packageName_packageVersion 9531 PackageNameMasksToExclude *[]string `json:"packageNameMasksToExclude,omitempty"` 9532 // MaintenanceRunID - This is used as a maintenance run identifier for Auto VM Guest Patching in Linux. 9533 MaintenanceRunID *string `json:"maintenanceRunId,omitempty"` 9534} 9535 9536// LinuxPatchSettings specifies settings related to VM Guest Patching on Linux. 9537type LinuxPatchSettings struct { 9538 // 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' 9539 PatchMode LinuxVMGuestPatchMode `json:"patchMode,omitempty"` 9540 // 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' 9541 AssessmentMode LinuxPatchAssessmentMode `json:"assessmentMode,omitempty"` 9542} 9543 9544// ListUsagesResult the List Usages operation response. 9545type ListUsagesResult struct { 9546 autorest.Response `json:"-"` 9547 // Value - The list of compute resource usages. 9548 Value *[]Usage `json:"value,omitempty"` 9549 // 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. 9550 NextLink *string `json:"nextLink,omitempty"` 9551} 9552 9553// ListUsagesResultIterator provides access to a complete listing of Usage values. 9554type ListUsagesResultIterator struct { 9555 i int 9556 page ListUsagesResultPage 9557} 9558 9559// NextWithContext advances to the next value. If there was an error making 9560// the request the iterator does not advance and the error is returned. 9561func (iter *ListUsagesResultIterator) NextWithContext(ctx context.Context) (err error) { 9562 if tracing.IsEnabled() { 9563 ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultIterator.NextWithContext") 9564 defer func() { 9565 sc := -1 9566 if iter.Response().Response.Response != nil { 9567 sc = iter.Response().Response.Response.StatusCode 9568 } 9569 tracing.EndSpan(ctx, sc, err) 9570 }() 9571 } 9572 iter.i++ 9573 if iter.i < len(iter.page.Values()) { 9574 return nil 9575 } 9576 err = iter.page.NextWithContext(ctx) 9577 if err != nil { 9578 iter.i-- 9579 return err 9580 } 9581 iter.i = 0 9582 return nil 9583} 9584 9585// Next advances to the next value. If there was an error making 9586// the request the iterator does not advance and the error is returned. 9587// Deprecated: Use NextWithContext() instead. 9588func (iter *ListUsagesResultIterator) Next() error { 9589 return iter.NextWithContext(context.Background()) 9590} 9591 9592// NotDone returns true if the enumeration should be started or is not yet complete. 9593func (iter ListUsagesResultIterator) NotDone() bool { 9594 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9595} 9596 9597// Response returns the raw server response from the last page request. 9598func (iter ListUsagesResultIterator) Response() ListUsagesResult { 9599 return iter.page.Response() 9600} 9601 9602// Value returns the current value or a zero-initialized value if the 9603// iterator has advanced beyond the end of the collection. 9604func (iter ListUsagesResultIterator) Value() Usage { 9605 if !iter.page.NotDone() { 9606 return Usage{} 9607 } 9608 return iter.page.Values()[iter.i] 9609} 9610 9611// Creates a new instance of the ListUsagesResultIterator type. 9612func NewListUsagesResultIterator(page ListUsagesResultPage) ListUsagesResultIterator { 9613 return ListUsagesResultIterator{page: page} 9614} 9615 9616// IsEmpty returns true if the ListResult contains no values. 9617func (lur ListUsagesResult) IsEmpty() bool { 9618 return lur.Value == nil || len(*lur.Value) == 0 9619} 9620 9621// hasNextLink returns true if the NextLink is not empty. 9622func (lur ListUsagesResult) hasNextLink() bool { 9623 return lur.NextLink != nil && len(*lur.NextLink) != 0 9624} 9625 9626// listUsagesResultPreparer prepares a request to retrieve the next set of results. 9627// It returns nil if no more results exist. 9628func (lur ListUsagesResult) listUsagesResultPreparer(ctx context.Context) (*http.Request, error) { 9629 if !lur.hasNextLink() { 9630 return nil, nil 9631 } 9632 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9633 autorest.AsJSON(), 9634 autorest.AsGet(), 9635 autorest.WithBaseURL(to.String(lur.NextLink))) 9636} 9637 9638// ListUsagesResultPage contains a page of Usage values. 9639type ListUsagesResultPage struct { 9640 fn func(context.Context, ListUsagesResult) (ListUsagesResult, error) 9641 lur ListUsagesResult 9642} 9643 9644// NextWithContext advances to the next page of values. If there was an error making 9645// the request the page does not advance and the error is returned. 9646func (page *ListUsagesResultPage) NextWithContext(ctx context.Context) (err error) { 9647 if tracing.IsEnabled() { 9648 ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultPage.NextWithContext") 9649 defer func() { 9650 sc := -1 9651 if page.Response().Response.Response != nil { 9652 sc = page.Response().Response.Response.StatusCode 9653 } 9654 tracing.EndSpan(ctx, sc, err) 9655 }() 9656 } 9657 for { 9658 next, err := page.fn(ctx, page.lur) 9659 if err != nil { 9660 return err 9661 } 9662 page.lur = next 9663 if !next.hasNextLink() || !next.IsEmpty() { 9664 break 9665 } 9666 } 9667 return nil 9668} 9669 9670// Next advances to the next page of values. If there was an error making 9671// the request the page does not advance and the error is returned. 9672// Deprecated: Use NextWithContext() instead. 9673func (page *ListUsagesResultPage) Next() error { 9674 return page.NextWithContext(context.Background()) 9675} 9676 9677// NotDone returns true if the page enumeration should be started or is not yet complete. 9678func (page ListUsagesResultPage) NotDone() bool { 9679 return !page.lur.IsEmpty() 9680} 9681 9682// Response returns the raw server response from the last page request. 9683func (page ListUsagesResultPage) Response() ListUsagesResult { 9684 return page.lur 9685} 9686 9687// Values returns the slice of values for the current page or nil if there are no values. 9688func (page ListUsagesResultPage) Values() []Usage { 9689 if page.lur.IsEmpty() { 9690 return nil 9691 } 9692 return *page.lur.Value 9693} 9694 9695// Creates a new instance of the ListUsagesResultPage type. 9696func NewListUsagesResultPage(cur ListUsagesResult, getNextPage func(context.Context, ListUsagesResult) (ListUsagesResult, error)) ListUsagesResultPage { 9697 return ListUsagesResultPage{ 9698 fn: getNextPage, 9699 lur: cur, 9700 } 9701} 9702 9703// ListVirtualMachineExtensionImage ... 9704type ListVirtualMachineExtensionImage struct { 9705 autorest.Response `json:"-"` 9706 Value *[]VirtualMachineExtensionImage `json:"value,omitempty"` 9707} 9708 9709// ListVirtualMachineImageResource ... 9710type ListVirtualMachineImageResource struct { 9711 autorest.Response `json:"-"` 9712 Value *[]VirtualMachineImageResource `json:"value,omitempty"` 9713} 9714 9715// LoadBalancerConfiguration describes the load balancer configuration. 9716type LoadBalancerConfiguration struct { 9717 // ID - Resource Id 9718 ID *string `json:"id,omitempty"` 9719 // Name - The name of the Load balancer 9720 Name *string `json:"name,omitempty"` 9721 // Properties - Properties of the load balancer configuration. 9722 Properties *LoadBalancerConfigurationProperties `json:"properties,omitempty"` 9723} 9724 9725// LoadBalancerConfigurationProperties ... 9726type LoadBalancerConfigurationProperties struct { 9727 // 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. 9728 FrontendIPConfigurations *[]LoadBalancerFrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` 9729} 9730 9731// LoadBalancerFrontendIPConfiguration ... 9732type LoadBalancerFrontendIPConfiguration struct { 9733 // 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. 9734 Name *string `json:"name,omitempty"` 9735 // Properties - Properties of load balancer frontend ip configuration. 9736 Properties *LoadBalancerFrontendIPConfigurationProperties `json:"properties,omitempty"` 9737} 9738 9739// LoadBalancerFrontendIPConfigurationProperties describes a cloud service IP Configuration 9740type LoadBalancerFrontendIPConfigurationProperties struct { 9741 // PublicIPAddress - The reference to the public ip address resource. 9742 PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` 9743 // Subnet - The reference to the virtual network subnet resource. 9744 Subnet *SubResource `json:"subnet,omitempty"` 9745 // PrivateIPAddress - The virtual network private IP address of the IP configuration. 9746 PrivateIPAddress *string `json:"privateIPAddress,omitempty"` 9747} 9748 9749// LogAnalyticsExportRequestRateByIntervalFuture an abstraction for monitoring and retrieving the results 9750// of a long-running operation. 9751type LogAnalyticsExportRequestRateByIntervalFuture struct { 9752 azure.FutureAPI 9753 // Result returns the result of the asynchronous operation. 9754 // If the operation has not completed it will return an error. 9755 Result func(LogAnalyticsClient) (LogAnalyticsOperationResult, error) 9756} 9757 9758// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9759func (future *LogAnalyticsExportRequestRateByIntervalFuture) UnmarshalJSON(body []byte) error { 9760 var azFuture azure.Future 9761 if err := json.Unmarshal(body, &azFuture); err != nil { 9762 return err 9763 } 9764 future.FutureAPI = &azFuture 9765 future.Result = future.result 9766 return nil 9767} 9768 9769// result is the default implementation for LogAnalyticsExportRequestRateByIntervalFuture.Result. 9770func (future *LogAnalyticsExportRequestRateByIntervalFuture) result(client LogAnalyticsClient) (laor LogAnalyticsOperationResult, err error) { 9771 var done bool 9772 done, err = future.DoneWithContext(context.Background(), client) 9773 if err != nil { 9774 err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportRequestRateByIntervalFuture", "Result", future.Response(), "Polling failure") 9775 return 9776 } 9777 if !done { 9778 laor.Response.Response = future.Response() 9779 err = azure.NewAsyncOpIncompleteError("compute.LogAnalyticsExportRequestRateByIntervalFuture") 9780 return 9781 } 9782 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9783 if laor.Response.Response, err = future.GetResult(sender); err == nil && laor.Response.Response.StatusCode != http.StatusNoContent { 9784 laor, err = client.ExportRequestRateByIntervalResponder(laor.Response.Response) 9785 if err != nil { 9786 err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportRequestRateByIntervalFuture", "Result", laor.Response.Response, "Failure responding to request") 9787 } 9788 } 9789 return 9790} 9791 9792// LogAnalyticsExportThrottledRequestsFuture an abstraction for monitoring and retrieving the results of a 9793// long-running operation. 9794type LogAnalyticsExportThrottledRequestsFuture struct { 9795 azure.FutureAPI 9796 // Result returns the result of the asynchronous operation. 9797 // If the operation has not completed it will return an error. 9798 Result func(LogAnalyticsClient) (LogAnalyticsOperationResult, error) 9799} 9800 9801// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9802func (future *LogAnalyticsExportThrottledRequestsFuture) UnmarshalJSON(body []byte) error { 9803 var azFuture azure.Future 9804 if err := json.Unmarshal(body, &azFuture); err != nil { 9805 return err 9806 } 9807 future.FutureAPI = &azFuture 9808 future.Result = future.result 9809 return nil 9810} 9811 9812// result is the default implementation for LogAnalyticsExportThrottledRequestsFuture.Result. 9813func (future *LogAnalyticsExportThrottledRequestsFuture) result(client LogAnalyticsClient) (laor LogAnalyticsOperationResult, err error) { 9814 var done bool 9815 done, err = future.DoneWithContext(context.Background(), client) 9816 if err != nil { 9817 err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportThrottledRequestsFuture", "Result", future.Response(), "Polling failure") 9818 return 9819 } 9820 if !done { 9821 laor.Response.Response = future.Response() 9822 err = azure.NewAsyncOpIncompleteError("compute.LogAnalyticsExportThrottledRequestsFuture") 9823 return 9824 } 9825 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9826 if laor.Response.Response, err = future.GetResult(sender); err == nil && laor.Response.Response.StatusCode != http.StatusNoContent { 9827 laor, err = client.ExportThrottledRequestsResponder(laor.Response.Response) 9828 if err != nil { 9829 err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportThrottledRequestsFuture", "Result", laor.Response.Response, "Failure responding to request") 9830 } 9831 } 9832 return 9833} 9834 9835// LogAnalyticsInputBase api input base class for LogAnalytics Api. 9836type LogAnalyticsInputBase struct { 9837 // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. 9838 BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` 9839 // FromTime - From time of the query 9840 FromTime *date.Time `json:"fromTime,omitempty"` 9841 // ToTime - To time of the query 9842 ToTime *date.Time `json:"toTime,omitempty"` 9843 // GroupByThrottlePolicy - Group query result by Throttle Policy applied. 9844 GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` 9845 // GroupByOperationName - Group query result by Operation Name. 9846 GroupByOperationName *bool `json:"groupByOperationName,omitempty"` 9847 // GroupByResourceName - Group query result by Resource Name. 9848 GroupByResourceName *bool `json:"groupByResourceName,omitempty"` 9849 // GroupByClientApplicationID - Group query result by Client Application ID. 9850 GroupByClientApplicationID *bool `json:"groupByClientApplicationId,omitempty"` 9851 // GroupByUserAgent - Group query result by User Agent. 9852 GroupByUserAgent *bool `json:"groupByUserAgent,omitempty"` 9853} 9854 9855// LogAnalyticsOperationResult logAnalytics operation status response 9856type LogAnalyticsOperationResult struct { 9857 autorest.Response `json:"-"` 9858 // Properties - READ-ONLY; LogAnalyticsOutput 9859 Properties *LogAnalyticsOutput `json:"properties,omitempty"` 9860} 9861 9862// MarshalJSON is the custom marshaler for LogAnalyticsOperationResult. 9863func (laor LogAnalyticsOperationResult) MarshalJSON() ([]byte, error) { 9864 objectMap := make(map[string]interface{}) 9865 return json.Marshal(objectMap) 9866} 9867 9868// LogAnalyticsOutput logAnalytics output properties 9869type LogAnalyticsOutput struct { 9870 // Output - READ-ONLY; Output file Uri path to blob container. 9871 Output *string `json:"output,omitempty"` 9872} 9873 9874// MarshalJSON is the custom marshaler for LogAnalyticsOutput. 9875func (lao LogAnalyticsOutput) MarshalJSON() ([]byte, error) { 9876 objectMap := make(map[string]interface{}) 9877 return json.Marshal(objectMap) 9878} 9879 9880// MaintenanceRedeployStatus maintenance Operation Status. 9881type MaintenanceRedeployStatus struct { 9882 // IsCustomerInitiatedMaintenanceAllowed - True, if customer is allowed to perform Maintenance. 9883 IsCustomerInitiatedMaintenanceAllowed *bool `json:"isCustomerInitiatedMaintenanceAllowed,omitempty"` 9884 // PreMaintenanceWindowStartTime - Start Time for the Pre Maintenance Window. 9885 PreMaintenanceWindowStartTime *date.Time `json:"preMaintenanceWindowStartTime,omitempty"` 9886 // PreMaintenanceWindowEndTime - End Time for the Pre Maintenance Window. 9887 PreMaintenanceWindowEndTime *date.Time `json:"preMaintenanceWindowEndTime,omitempty"` 9888 // MaintenanceWindowStartTime - Start Time for the Maintenance Window. 9889 MaintenanceWindowStartTime *date.Time `json:"maintenanceWindowStartTime,omitempty"` 9890 // MaintenanceWindowEndTime - End Time for the Maintenance Window. 9891 MaintenanceWindowEndTime *date.Time `json:"maintenanceWindowEndTime,omitempty"` 9892 // LastOperationResultCode - The Last Maintenance Operation Result Code. Possible values include: 'MaintenanceOperationResultCodeTypesNone', 'MaintenanceOperationResultCodeTypesRetryLater', 'MaintenanceOperationResultCodeTypesMaintenanceAborted', 'MaintenanceOperationResultCodeTypesMaintenanceCompleted' 9893 LastOperationResultCode MaintenanceOperationResultCodeTypes `json:"lastOperationResultCode,omitempty"` 9894 // LastOperationMessage - Message returned for the last Maintenance Operation. 9895 LastOperationMessage *string `json:"lastOperationMessage,omitempty"` 9896} 9897 9898// ManagedArtifact the managed artifact. 9899type ManagedArtifact struct { 9900 // ID - The managed artifact id. 9901 ID *string `json:"id,omitempty"` 9902} 9903 9904// ManagedDiskParameters the parameters of a managed disk. 9905type ManagedDiskParameters struct { 9906 // 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' 9907 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 9908 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed disk. 9909 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 9910 // ID - Resource Id 9911 ID *string `json:"id,omitempty"` 9912} 9913 9914// NetworkInterfaceReference describes a network interface reference. 9915type NetworkInterfaceReference struct { 9916 *NetworkInterfaceReferenceProperties `json:"properties,omitempty"` 9917 // ID - Resource Id 9918 ID *string `json:"id,omitempty"` 9919} 9920 9921// MarshalJSON is the custom marshaler for NetworkInterfaceReference. 9922func (nir NetworkInterfaceReference) MarshalJSON() ([]byte, error) { 9923 objectMap := make(map[string]interface{}) 9924 if nir.NetworkInterfaceReferenceProperties != nil { 9925 objectMap["properties"] = nir.NetworkInterfaceReferenceProperties 9926 } 9927 if nir.ID != nil { 9928 objectMap["id"] = nir.ID 9929 } 9930 return json.Marshal(objectMap) 9931} 9932 9933// UnmarshalJSON is the custom unmarshaler for NetworkInterfaceReference struct. 9934func (nir *NetworkInterfaceReference) UnmarshalJSON(body []byte) error { 9935 var m map[string]*json.RawMessage 9936 err := json.Unmarshal(body, &m) 9937 if err != nil { 9938 return err 9939 } 9940 for k, v := range m { 9941 switch k { 9942 case "properties": 9943 if v != nil { 9944 var networkInterfaceReferenceProperties NetworkInterfaceReferenceProperties 9945 err = json.Unmarshal(*v, &networkInterfaceReferenceProperties) 9946 if err != nil { 9947 return err 9948 } 9949 nir.NetworkInterfaceReferenceProperties = &networkInterfaceReferenceProperties 9950 } 9951 case "id": 9952 if v != nil { 9953 var ID string 9954 err = json.Unmarshal(*v, &ID) 9955 if err != nil { 9956 return err 9957 } 9958 nir.ID = &ID 9959 } 9960 } 9961 } 9962 9963 return nil 9964} 9965 9966// NetworkInterfaceReferenceProperties describes a network interface reference properties. 9967type NetworkInterfaceReferenceProperties struct { 9968 // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. 9969 Primary *bool `json:"primary,omitempty"` 9970 // DeleteOption - Specify what happens to the network interface when the VM is deleted. Possible values include: 'DeleteOptionsDelete', 'DeleteOptionsDetach' 9971 DeleteOption DeleteOptions `json:"deleteOption,omitempty"` 9972} 9973 9974// NetworkProfile specifies the network interfaces or the networking configuration of the virtual machine. 9975type NetworkProfile struct { 9976 // NetworkInterfaces - Specifies the list of resource Ids for the network interfaces associated with the virtual machine. 9977 NetworkInterfaces *[]NetworkInterfaceReference `json:"networkInterfaces,omitempty"` 9978 // NetworkAPIVersion - specifies the Microsoft.Network API version used when creating networking resources in the Network Interface Configurations. Possible values include: 'NetworkAPIVersionTwoZeroTwoZeroHyphenMinusOneOneHyphenMinusZeroOne' 9979 NetworkAPIVersion NetworkAPIVersion `json:"networkApiVersion,omitempty"` 9980 // NetworkInterfaceConfigurations - Specifies the networking configurations that will be used to create the virtual machine networking resources. 9981 NetworkInterfaceConfigurations *[]VirtualMachineNetworkInterfaceConfiguration `json:"networkInterfaceConfigurations,omitempty"` 9982} 9983 9984// OperationListResult the List Compute Operation operation response. 9985type OperationListResult struct { 9986 autorest.Response `json:"-"` 9987 // Value - READ-ONLY; The list of compute operations 9988 Value *[]OperationValue `json:"value,omitempty"` 9989} 9990 9991// MarshalJSON is the custom marshaler for OperationListResult. 9992func (olr OperationListResult) MarshalJSON() ([]byte, error) { 9993 objectMap := make(map[string]interface{}) 9994 return json.Marshal(objectMap) 9995} 9996 9997// OperationValue describes the properties of a Compute Operation value. 9998type OperationValue struct { 9999 // Origin - READ-ONLY; The origin of the compute operation. 10000 Origin *string `json:"origin,omitempty"` 10001 // Name - READ-ONLY; The name of the compute operation. 10002 Name *string `json:"name,omitempty"` 10003 *OperationValueDisplay `json:"display,omitempty"` 10004} 10005 10006// MarshalJSON is the custom marshaler for OperationValue. 10007func (ov OperationValue) MarshalJSON() ([]byte, error) { 10008 objectMap := make(map[string]interface{}) 10009 if ov.OperationValueDisplay != nil { 10010 objectMap["display"] = ov.OperationValueDisplay 10011 } 10012 return json.Marshal(objectMap) 10013} 10014 10015// UnmarshalJSON is the custom unmarshaler for OperationValue struct. 10016func (ov *OperationValue) UnmarshalJSON(body []byte) error { 10017 var m map[string]*json.RawMessage 10018 err := json.Unmarshal(body, &m) 10019 if err != nil { 10020 return err 10021 } 10022 for k, v := range m { 10023 switch k { 10024 case "origin": 10025 if v != nil { 10026 var origin string 10027 err = json.Unmarshal(*v, &origin) 10028 if err != nil { 10029 return err 10030 } 10031 ov.Origin = &origin 10032 } 10033 case "name": 10034 if v != nil { 10035 var name string 10036 err = json.Unmarshal(*v, &name) 10037 if err != nil { 10038 return err 10039 } 10040 ov.Name = &name 10041 } 10042 case "display": 10043 if v != nil { 10044 var operationValueDisplay OperationValueDisplay 10045 err = json.Unmarshal(*v, &operationValueDisplay) 10046 if err != nil { 10047 return err 10048 } 10049 ov.OperationValueDisplay = &operationValueDisplay 10050 } 10051 } 10052 } 10053 10054 return nil 10055} 10056 10057// OperationValueDisplay describes the properties of a Compute Operation Value Display. 10058type OperationValueDisplay struct { 10059 // Operation - READ-ONLY; The display name of the compute operation. 10060 Operation *string `json:"operation,omitempty"` 10061 // Resource - READ-ONLY; The display name of the resource the operation applies to. 10062 Resource *string `json:"resource,omitempty"` 10063 // Description - READ-ONLY; The description of the operation. 10064 Description *string `json:"description,omitempty"` 10065 // Provider - READ-ONLY; The resource provider for the operation. 10066 Provider *string `json:"provider,omitempty"` 10067} 10068 10069// MarshalJSON is the custom marshaler for OperationValueDisplay. 10070func (ovd OperationValueDisplay) MarshalJSON() ([]byte, error) { 10071 objectMap := make(map[string]interface{}) 10072 return json.Marshal(objectMap) 10073} 10074 10075// OrchestrationServiceStateInput the input for OrchestrationServiceState 10076type OrchestrationServiceStateInput struct { 10077 // ServiceName - The name of the service. Possible values include: 'OrchestrationServiceNamesAutomaticRepairs' 10078 ServiceName OrchestrationServiceNames `json:"serviceName,omitempty"` 10079 // Action - The action to be performed. Possible values include: 'OrchestrationServiceStateActionResume', 'OrchestrationServiceStateActionSuspend' 10080 Action OrchestrationServiceStateAction `json:"action,omitempty"` 10081} 10082 10083// OrchestrationServiceSummary summary for an orchestration service of a virtual machine scale set. 10084type OrchestrationServiceSummary struct { 10085 // ServiceName - READ-ONLY; The name of the service. Possible values include: 'OrchestrationServiceNamesAutomaticRepairs', 'OrchestrationServiceNamesDummyOrchestrationServiceName' 10086 ServiceName OrchestrationServiceNames `json:"serviceName,omitempty"` 10087 // ServiceState - READ-ONLY; The current state of the service. Possible values include: 'OrchestrationServiceStateNotRunning', 'OrchestrationServiceStateRunning', 'OrchestrationServiceStateSuspended' 10088 ServiceState OrchestrationServiceState `json:"serviceState,omitempty"` 10089} 10090 10091// MarshalJSON is the custom marshaler for OrchestrationServiceSummary. 10092func (oss OrchestrationServiceSummary) MarshalJSON() ([]byte, error) { 10093 objectMap := make(map[string]interface{}) 10094 return json.Marshal(objectMap) 10095} 10096 10097// OSDisk specifies information about the operating system disk used by the virtual machine. <br><br> For 10098// more information about disks, see [About disks and VHDs for Azure virtual 10099// machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). 10100type OSDisk struct { 10101 // 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' 10102 OsType OperatingSystemTypes `json:"osType,omitempty"` 10103 // EncryptionSettings - Specifies the encryption settings for the OS Disk. <br><br> Minimum api-version: 2015-06-15 10104 EncryptionSettings *DiskEncryptionSettings `json:"encryptionSettings,omitempty"` 10105 // Name - The disk name. 10106 Name *string `json:"name,omitempty"` 10107 // Vhd - The virtual hard disk. 10108 Vhd *VirtualHardDisk `json:"vhd,omitempty"` 10109 // 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. 10110 Image *VirtualHardDisk `json:"image,omitempty"` 10111 // 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' 10112 Caching CachingTypes `json:"caching,omitempty"` 10113 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 10114 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 10115 // DiffDiskSettings - Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine. 10116 DiffDiskSettings *DiffDiskSettings `json:"diffDiskSettings,omitempty"` 10117 // 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' 10118 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 10119 // 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 10120 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 10121 // ManagedDisk - The managed disk parameters. 10122 ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` 10123 // 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' 10124 DeleteOption DiskDeleteOptionTypes `json:"deleteOption,omitempty"` 10125} 10126 10127// OSDiskImage contains the os disk image information. 10128type OSDiskImage struct { 10129 // OperatingSystem - The operating system of the osDiskImage. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' 10130 OperatingSystem OperatingSystemTypes `json:"operatingSystem,omitempty"` 10131} 10132 10133// OSDiskImageEncryption contains encryption settings for an OS disk image. 10134type OSDiskImageEncryption struct { 10135 // DiskEncryptionSetID - A relative URI containing the resource ID of the disk encryption set. 10136 DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` 10137} 10138 10139// OSFamily describes a cloud service OS family. 10140type OSFamily struct { 10141 autorest.Response `json:"-"` 10142 // ID - READ-ONLY; Resource Id. 10143 ID *string `json:"id,omitempty"` 10144 // Name - READ-ONLY; Resource name. 10145 Name *string `json:"name,omitempty"` 10146 // Type - READ-ONLY; Resource type. 10147 Type *string `json:"type,omitempty"` 10148 // Location - READ-ONLY; Resource location. 10149 Location *string `json:"location,omitempty"` 10150 Properties *OSFamilyProperties `json:"properties,omitempty"` 10151} 10152 10153// MarshalJSON is the custom marshaler for OSFamily. 10154func (of OSFamily) MarshalJSON() ([]byte, error) { 10155 objectMap := make(map[string]interface{}) 10156 if of.Properties != nil { 10157 objectMap["properties"] = of.Properties 10158 } 10159 return json.Marshal(objectMap) 10160} 10161 10162// OSFamilyListResult ... 10163type OSFamilyListResult struct { 10164 autorest.Response `json:"-"` 10165 Value *[]OSFamily `json:"value,omitempty"` 10166 NextLink *string `json:"nextLink,omitempty"` 10167} 10168 10169// OSFamilyListResultIterator provides access to a complete listing of OSFamily values. 10170type OSFamilyListResultIterator struct { 10171 i int 10172 page OSFamilyListResultPage 10173} 10174 10175// NextWithContext advances to the next value. If there was an error making 10176// the request the iterator does not advance and the error is returned. 10177func (iter *OSFamilyListResultIterator) NextWithContext(ctx context.Context) (err error) { 10178 if tracing.IsEnabled() { 10179 ctx = tracing.StartSpan(ctx, fqdn+"/OSFamilyListResultIterator.NextWithContext") 10180 defer func() { 10181 sc := -1 10182 if iter.Response().Response.Response != nil { 10183 sc = iter.Response().Response.Response.StatusCode 10184 } 10185 tracing.EndSpan(ctx, sc, err) 10186 }() 10187 } 10188 iter.i++ 10189 if iter.i < len(iter.page.Values()) { 10190 return nil 10191 } 10192 err = iter.page.NextWithContext(ctx) 10193 if err != nil { 10194 iter.i-- 10195 return err 10196 } 10197 iter.i = 0 10198 return nil 10199} 10200 10201// Next advances to the next value. If there was an error making 10202// the request the iterator does not advance and the error is returned. 10203// Deprecated: Use NextWithContext() instead. 10204func (iter *OSFamilyListResultIterator) Next() error { 10205 return iter.NextWithContext(context.Background()) 10206} 10207 10208// NotDone returns true if the enumeration should be started or is not yet complete. 10209func (iter OSFamilyListResultIterator) NotDone() bool { 10210 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10211} 10212 10213// Response returns the raw server response from the last page request. 10214func (iter OSFamilyListResultIterator) Response() OSFamilyListResult { 10215 return iter.page.Response() 10216} 10217 10218// Value returns the current value or a zero-initialized value if the 10219// iterator has advanced beyond the end of the collection. 10220func (iter OSFamilyListResultIterator) Value() OSFamily { 10221 if !iter.page.NotDone() { 10222 return OSFamily{} 10223 } 10224 return iter.page.Values()[iter.i] 10225} 10226 10227// Creates a new instance of the OSFamilyListResultIterator type. 10228func NewOSFamilyListResultIterator(page OSFamilyListResultPage) OSFamilyListResultIterator { 10229 return OSFamilyListResultIterator{page: page} 10230} 10231 10232// IsEmpty returns true if the ListResult contains no values. 10233func (oflr OSFamilyListResult) IsEmpty() bool { 10234 return oflr.Value == nil || len(*oflr.Value) == 0 10235} 10236 10237// hasNextLink returns true if the NextLink is not empty. 10238func (oflr OSFamilyListResult) hasNextLink() bool { 10239 return oflr.NextLink != nil && len(*oflr.NextLink) != 0 10240} 10241 10242// oSFamilyListResultPreparer prepares a request to retrieve the next set of results. 10243// It returns nil if no more results exist. 10244func (oflr OSFamilyListResult) oSFamilyListResultPreparer(ctx context.Context) (*http.Request, error) { 10245 if !oflr.hasNextLink() { 10246 return nil, nil 10247 } 10248 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10249 autorest.AsJSON(), 10250 autorest.AsGet(), 10251 autorest.WithBaseURL(to.String(oflr.NextLink))) 10252} 10253 10254// OSFamilyListResultPage contains a page of OSFamily values. 10255type OSFamilyListResultPage struct { 10256 fn func(context.Context, OSFamilyListResult) (OSFamilyListResult, error) 10257 oflr OSFamilyListResult 10258} 10259 10260// NextWithContext advances to the next page of values. If there was an error making 10261// the request the page does not advance and the error is returned. 10262func (page *OSFamilyListResultPage) NextWithContext(ctx context.Context) (err error) { 10263 if tracing.IsEnabled() { 10264 ctx = tracing.StartSpan(ctx, fqdn+"/OSFamilyListResultPage.NextWithContext") 10265 defer func() { 10266 sc := -1 10267 if page.Response().Response.Response != nil { 10268 sc = page.Response().Response.Response.StatusCode 10269 } 10270 tracing.EndSpan(ctx, sc, err) 10271 }() 10272 } 10273 for { 10274 next, err := page.fn(ctx, page.oflr) 10275 if err != nil { 10276 return err 10277 } 10278 page.oflr = next 10279 if !next.hasNextLink() || !next.IsEmpty() { 10280 break 10281 } 10282 } 10283 return nil 10284} 10285 10286// Next advances to the next page of values. If there was an error making 10287// the request the page does not advance and the error is returned. 10288// Deprecated: Use NextWithContext() instead. 10289func (page *OSFamilyListResultPage) Next() error { 10290 return page.NextWithContext(context.Background()) 10291} 10292 10293// NotDone returns true if the page enumeration should be started or is not yet complete. 10294func (page OSFamilyListResultPage) NotDone() bool { 10295 return !page.oflr.IsEmpty() 10296} 10297 10298// Response returns the raw server response from the last page request. 10299func (page OSFamilyListResultPage) Response() OSFamilyListResult { 10300 return page.oflr 10301} 10302 10303// Values returns the slice of values for the current page or nil if there are no values. 10304func (page OSFamilyListResultPage) Values() []OSFamily { 10305 if page.oflr.IsEmpty() { 10306 return nil 10307 } 10308 return *page.oflr.Value 10309} 10310 10311// Creates a new instance of the OSFamilyListResultPage type. 10312func NewOSFamilyListResultPage(cur OSFamilyListResult, getNextPage func(context.Context, OSFamilyListResult) (OSFamilyListResult, error)) OSFamilyListResultPage { 10313 return OSFamilyListResultPage{ 10314 fn: getNextPage, 10315 oflr: cur, 10316 } 10317} 10318 10319// OSFamilyProperties OS family properties. 10320type OSFamilyProperties struct { 10321 // Name - READ-ONLY; The OS family name. 10322 Name *string `json:"name,omitempty"` 10323 // Label - READ-ONLY; The OS family label. 10324 Label *string `json:"label,omitempty"` 10325 // Versions - READ-ONLY; List of OS versions belonging to this family. 10326 Versions *[]OSVersionPropertiesBase `json:"versions,omitempty"` 10327} 10328 10329// MarshalJSON is the custom marshaler for OSFamilyProperties. 10330func (ofp OSFamilyProperties) MarshalJSON() ([]byte, error) { 10331 objectMap := make(map[string]interface{}) 10332 return json.Marshal(objectMap) 10333} 10334 10335// OSProfile specifies the operating system settings for the virtual machine. Some of the settings cannot 10336// be changed once VM is provisioned. 10337type OSProfile struct { 10338 // 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). 10339 ComputerName *string `json:"computerName,omitempty"` 10340 // 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. 10341 AdminUsername *string `json:"adminUsername,omitempty"` 10342 // 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) 10343 AdminPassword *string `json:"adminPassword,omitempty"` 10344 // 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) 10345 CustomData *string `json:"customData,omitempty"` 10346 // WindowsConfiguration - Specifies Windows operating system settings on the virtual machine. 10347 WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` 10348 // 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). 10349 LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` 10350 // Secrets - Specifies set of certificates that should be installed onto the virtual machine. To install certificates on a virtual machine it is recommended to use the [Azure Key Vault virtual machine extension for Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) or the [Azure Key Vault virtual machine extension for Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). 10351 Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` 10352 // 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. 10353 AllowExtensionOperations *bool `json:"allowExtensionOperations,omitempty"` 10354 // 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.** 10355 RequireGuestProvisionSignal *bool `json:"requireGuestProvisionSignal,omitempty"` 10356} 10357 10358// OSVersion describes a cloud service OS version. 10359type OSVersion struct { 10360 autorest.Response `json:"-"` 10361 // ID - READ-ONLY; Resource Id. 10362 ID *string `json:"id,omitempty"` 10363 // Name - READ-ONLY; Resource name. 10364 Name *string `json:"name,omitempty"` 10365 // Type - READ-ONLY; Resource type. 10366 Type *string `json:"type,omitempty"` 10367 // Location - READ-ONLY; Resource location. 10368 Location *string `json:"location,omitempty"` 10369 Properties *OSVersionProperties `json:"properties,omitempty"` 10370} 10371 10372// MarshalJSON is the custom marshaler for OSVersion. 10373func (ov OSVersion) MarshalJSON() ([]byte, error) { 10374 objectMap := make(map[string]interface{}) 10375 if ov.Properties != nil { 10376 objectMap["properties"] = ov.Properties 10377 } 10378 return json.Marshal(objectMap) 10379} 10380 10381// OSVersionListResult ... 10382type OSVersionListResult struct { 10383 autorest.Response `json:"-"` 10384 Value *[]OSVersion `json:"value,omitempty"` 10385 NextLink *string `json:"nextLink,omitempty"` 10386} 10387 10388// OSVersionListResultIterator provides access to a complete listing of OSVersion values. 10389type OSVersionListResultIterator struct { 10390 i int 10391 page OSVersionListResultPage 10392} 10393 10394// NextWithContext advances to the next value. If there was an error making 10395// the request the iterator does not advance and the error is returned. 10396func (iter *OSVersionListResultIterator) NextWithContext(ctx context.Context) (err error) { 10397 if tracing.IsEnabled() { 10398 ctx = tracing.StartSpan(ctx, fqdn+"/OSVersionListResultIterator.NextWithContext") 10399 defer func() { 10400 sc := -1 10401 if iter.Response().Response.Response != nil { 10402 sc = iter.Response().Response.Response.StatusCode 10403 } 10404 tracing.EndSpan(ctx, sc, err) 10405 }() 10406 } 10407 iter.i++ 10408 if iter.i < len(iter.page.Values()) { 10409 return nil 10410 } 10411 err = iter.page.NextWithContext(ctx) 10412 if err != nil { 10413 iter.i-- 10414 return err 10415 } 10416 iter.i = 0 10417 return nil 10418} 10419 10420// Next advances to the next value. If there was an error making 10421// the request the iterator does not advance and the error is returned. 10422// Deprecated: Use NextWithContext() instead. 10423func (iter *OSVersionListResultIterator) Next() error { 10424 return iter.NextWithContext(context.Background()) 10425} 10426 10427// NotDone returns true if the enumeration should be started or is not yet complete. 10428func (iter OSVersionListResultIterator) NotDone() bool { 10429 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10430} 10431 10432// Response returns the raw server response from the last page request. 10433func (iter OSVersionListResultIterator) Response() OSVersionListResult { 10434 return iter.page.Response() 10435} 10436 10437// Value returns the current value or a zero-initialized value if the 10438// iterator has advanced beyond the end of the collection. 10439func (iter OSVersionListResultIterator) Value() OSVersion { 10440 if !iter.page.NotDone() { 10441 return OSVersion{} 10442 } 10443 return iter.page.Values()[iter.i] 10444} 10445 10446// Creates a new instance of the OSVersionListResultIterator type. 10447func NewOSVersionListResultIterator(page OSVersionListResultPage) OSVersionListResultIterator { 10448 return OSVersionListResultIterator{page: page} 10449} 10450 10451// IsEmpty returns true if the ListResult contains no values. 10452func (ovlr OSVersionListResult) IsEmpty() bool { 10453 return ovlr.Value == nil || len(*ovlr.Value) == 0 10454} 10455 10456// hasNextLink returns true if the NextLink is not empty. 10457func (ovlr OSVersionListResult) hasNextLink() bool { 10458 return ovlr.NextLink != nil && len(*ovlr.NextLink) != 0 10459} 10460 10461// oSVersionListResultPreparer prepares a request to retrieve the next set of results. 10462// It returns nil if no more results exist. 10463func (ovlr OSVersionListResult) oSVersionListResultPreparer(ctx context.Context) (*http.Request, error) { 10464 if !ovlr.hasNextLink() { 10465 return nil, nil 10466 } 10467 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10468 autorest.AsJSON(), 10469 autorest.AsGet(), 10470 autorest.WithBaseURL(to.String(ovlr.NextLink))) 10471} 10472 10473// OSVersionListResultPage contains a page of OSVersion values. 10474type OSVersionListResultPage struct { 10475 fn func(context.Context, OSVersionListResult) (OSVersionListResult, error) 10476 ovlr OSVersionListResult 10477} 10478 10479// NextWithContext advances to the next page of values. If there was an error making 10480// the request the page does not advance and the error is returned. 10481func (page *OSVersionListResultPage) NextWithContext(ctx context.Context) (err error) { 10482 if tracing.IsEnabled() { 10483 ctx = tracing.StartSpan(ctx, fqdn+"/OSVersionListResultPage.NextWithContext") 10484 defer func() { 10485 sc := -1 10486 if page.Response().Response.Response != nil { 10487 sc = page.Response().Response.Response.StatusCode 10488 } 10489 tracing.EndSpan(ctx, sc, err) 10490 }() 10491 } 10492 for { 10493 next, err := page.fn(ctx, page.ovlr) 10494 if err != nil { 10495 return err 10496 } 10497 page.ovlr = next 10498 if !next.hasNextLink() || !next.IsEmpty() { 10499 break 10500 } 10501 } 10502 return nil 10503} 10504 10505// Next advances to the next page of values. If there was an error making 10506// the request the page does not advance and the error is returned. 10507// Deprecated: Use NextWithContext() instead. 10508func (page *OSVersionListResultPage) Next() error { 10509 return page.NextWithContext(context.Background()) 10510} 10511 10512// NotDone returns true if the page enumeration should be started or is not yet complete. 10513func (page OSVersionListResultPage) NotDone() bool { 10514 return !page.ovlr.IsEmpty() 10515} 10516 10517// Response returns the raw server response from the last page request. 10518func (page OSVersionListResultPage) Response() OSVersionListResult { 10519 return page.ovlr 10520} 10521 10522// Values returns the slice of values for the current page or nil if there are no values. 10523func (page OSVersionListResultPage) Values() []OSVersion { 10524 if page.ovlr.IsEmpty() { 10525 return nil 10526 } 10527 return *page.ovlr.Value 10528} 10529 10530// Creates a new instance of the OSVersionListResultPage type. 10531func NewOSVersionListResultPage(cur OSVersionListResult, getNextPage func(context.Context, OSVersionListResult) (OSVersionListResult, error)) OSVersionListResultPage { 10532 return OSVersionListResultPage{ 10533 fn: getNextPage, 10534 ovlr: cur, 10535 } 10536} 10537 10538// OSVersionProperties OS version properties. 10539type OSVersionProperties struct { 10540 // Family - READ-ONLY; The family of this OS version. 10541 Family *string `json:"family,omitempty"` 10542 // FamilyLabel - READ-ONLY; The family label of this OS version. 10543 FamilyLabel *string `json:"familyLabel,omitempty"` 10544 // Version - READ-ONLY; The OS version. 10545 Version *string `json:"version,omitempty"` 10546 // Label - READ-ONLY; The OS version label. 10547 Label *string `json:"label,omitempty"` 10548 // IsDefault - READ-ONLY; Specifies whether this is the default OS version for its family. 10549 IsDefault *bool `json:"isDefault,omitempty"` 10550 // IsActive - READ-ONLY; Specifies whether this OS version is active. 10551 IsActive *bool `json:"isActive,omitempty"` 10552} 10553 10554// MarshalJSON is the custom marshaler for OSVersionProperties. 10555func (ovp OSVersionProperties) MarshalJSON() ([]byte, error) { 10556 objectMap := make(map[string]interface{}) 10557 return json.Marshal(objectMap) 10558} 10559 10560// OSVersionPropertiesBase configuration view of an OS version. 10561type OSVersionPropertiesBase struct { 10562 // Version - READ-ONLY; The OS version. 10563 Version *string `json:"version,omitempty"` 10564 // Label - READ-ONLY; The OS version label. 10565 Label *string `json:"label,omitempty"` 10566 // IsDefault - READ-ONLY; Specifies whether this is the default OS version for its family. 10567 IsDefault *bool `json:"isDefault,omitempty"` 10568 // IsActive - READ-ONLY; Specifies whether this OS version is active. 10569 IsActive *bool `json:"isActive,omitempty"` 10570} 10571 10572// MarshalJSON is the custom marshaler for OSVersionPropertiesBase. 10573func (ovpb OSVersionPropertiesBase) MarshalJSON() ([]byte, error) { 10574 objectMap := make(map[string]interface{}) 10575 return json.Marshal(objectMap) 10576} 10577 10578// PatchInstallationDetail information about a specific patch that was encountered during an installation 10579// action. 10580type PatchInstallationDetail struct { 10581 // PatchID - READ-ONLY; A unique identifier for the patch. 10582 PatchID *string `json:"patchId,omitempty"` 10583 // Name - READ-ONLY; The friendly name of the patch. 10584 Name *string `json:"name,omitempty"` 10585 // Version - READ-ONLY; The version string of the package. It may conform to Semantic Versioning. Only applies to Linux. 10586 Version *string `json:"version,omitempty"` 10587 // KbID - READ-ONLY; The KBID of the patch. Only applies to Windows patches. 10588 KbID *string `json:"kbId,omitempty"` 10589 // Classifications - READ-ONLY; The classification(s) of the patch as provided by the patch publisher. 10590 Classifications *[]string `json:"classifications,omitempty"` 10591 // InstallationState - READ-ONLY; The state of the patch after the installation operation completed. Possible values include: 'PatchInstallationStateUnknown', 'PatchInstallationStateInstalled', 'PatchInstallationStateFailed', 'PatchInstallationStateExcluded', 'PatchInstallationStateNotSelected', 'PatchInstallationStatePending' 10592 InstallationState PatchInstallationState `json:"installationState,omitempty"` 10593} 10594 10595// MarshalJSON is the custom marshaler for PatchInstallationDetail. 10596func (pid PatchInstallationDetail) MarshalJSON() ([]byte, error) { 10597 objectMap := make(map[string]interface{}) 10598 return json.Marshal(objectMap) 10599} 10600 10601// PatchSettings specifies settings related to VM Guest Patching on Windows. 10602type PatchSettings struct { 10603 // 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' 10604 PatchMode WindowsVMGuestPatchMode `json:"patchMode,omitempty"` 10605 // 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'. 10606 EnableHotpatching *bool `json:"enableHotpatching,omitempty"` 10607 // 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' 10608 AssessmentMode WindowsPatchAssessmentMode `json:"assessmentMode,omitempty"` 10609} 10610 10611// PirResource the Resource model definition. 10612type PirResource struct { 10613 // Name - READ-ONLY; Resource name 10614 Name *string `json:"name,omitempty"` 10615 // Location - READ-ONLY; Resource location 10616 Location *string `json:"location,omitempty"` 10617} 10618 10619// MarshalJSON is the custom marshaler for PirResource. 10620func (pr PirResource) MarshalJSON() ([]byte, error) { 10621 objectMap := make(map[string]interface{}) 10622 return json.Marshal(objectMap) 10623} 10624 10625// PirSharedGalleryResource base information about the shared gallery resource in pir. 10626type PirSharedGalleryResource struct { 10627 *SharedGalleryIdentifier `json:"identifier,omitempty"` 10628 // Name - READ-ONLY; Resource name 10629 Name *string `json:"name,omitempty"` 10630 // Location - READ-ONLY; Resource location 10631 Location *string `json:"location,omitempty"` 10632} 10633 10634// MarshalJSON is the custom marshaler for PirSharedGalleryResource. 10635func (psgr PirSharedGalleryResource) MarshalJSON() ([]byte, error) { 10636 objectMap := make(map[string]interface{}) 10637 if psgr.SharedGalleryIdentifier != nil { 10638 objectMap["identifier"] = psgr.SharedGalleryIdentifier 10639 } 10640 return json.Marshal(objectMap) 10641} 10642 10643// UnmarshalJSON is the custom unmarshaler for PirSharedGalleryResource struct. 10644func (psgr *PirSharedGalleryResource) UnmarshalJSON(body []byte) error { 10645 var m map[string]*json.RawMessage 10646 err := json.Unmarshal(body, &m) 10647 if err != nil { 10648 return err 10649 } 10650 for k, v := range m { 10651 switch k { 10652 case "identifier": 10653 if v != nil { 10654 var sharedGalleryIdentifier SharedGalleryIdentifier 10655 err = json.Unmarshal(*v, &sharedGalleryIdentifier) 10656 if err != nil { 10657 return err 10658 } 10659 psgr.SharedGalleryIdentifier = &sharedGalleryIdentifier 10660 } 10661 case "name": 10662 if v != nil { 10663 var name string 10664 err = json.Unmarshal(*v, &name) 10665 if err != nil { 10666 return err 10667 } 10668 psgr.Name = &name 10669 } 10670 case "location": 10671 if v != nil { 10672 var location string 10673 err = json.Unmarshal(*v, &location) 10674 if err != nil { 10675 return err 10676 } 10677 psgr.Location = &location 10678 } 10679 } 10680 } 10681 10682 return nil 10683} 10684 10685// Plan specifies information about the marketplace image used to create the virtual machine. This element 10686// is only used for marketplace images. Before you can use a marketplace image from an API, you must enable 10687// the image for programmatic use. In the Azure portal, find the marketplace image that you want to use 10688// and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and 10689// then click **Save**. 10690type Plan struct { 10691 // Name - The plan ID. 10692 Name *string `json:"name,omitempty"` 10693 // Publisher - The publisher ID. 10694 Publisher *string `json:"publisher,omitempty"` 10695 // Product - Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. 10696 Product *string `json:"product,omitempty"` 10697 // PromotionCode - The promotion code. 10698 PromotionCode *string `json:"promotionCode,omitempty"` 10699} 10700 10701// PrivateEndpoint the Private Endpoint resource. 10702type PrivateEndpoint struct { 10703 // ID - READ-ONLY; The ARM identifier for Private Endpoint 10704 ID *string `json:"id,omitempty"` 10705} 10706 10707// MarshalJSON is the custom marshaler for PrivateEndpoint. 10708func (peVar PrivateEndpoint) MarshalJSON() ([]byte, error) { 10709 objectMap := make(map[string]interface{}) 10710 return json.Marshal(objectMap) 10711} 10712 10713// PrivateEndpointConnection the Private Endpoint Connection resource. 10714type PrivateEndpointConnection struct { 10715 autorest.Response `json:"-"` 10716 // PrivateEndpointConnectionProperties - Resource properties. 10717 *PrivateEndpointConnectionProperties `json:"properties,omitempty"` 10718 // ID - READ-ONLY; private endpoint connection Id 10719 ID *string `json:"id,omitempty"` 10720 // Name - READ-ONLY; private endpoint connection name 10721 Name *string `json:"name,omitempty"` 10722 // Type - READ-ONLY; private endpoint connection type 10723 Type *string `json:"type,omitempty"` 10724} 10725 10726// MarshalJSON is the custom marshaler for PrivateEndpointConnection. 10727func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) { 10728 objectMap := make(map[string]interface{}) 10729 if pec.PrivateEndpointConnectionProperties != nil { 10730 objectMap["properties"] = pec.PrivateEndpointConnectionProperties 10731 } 10732 return json.Marshal(objectMap) 10733} 10734 10735// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct. 10736func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error { 10737 var m map[string]*json.RawMessage 10738 err := json.Unmarshal(body, &m) 10739 if err != nil { 10740 return err 10741 } 10742 for k, v := range m { 10743 switch k { 10744 case "properties": 10745 if v != nil { 10746 var privateEndpointConnectionProperties PrivateEndpointConnectionProperties 10747 err = json.Unmarshal(*v, &privateEndpointConnectionProperties) 10748 if err != nil { 10749 return err 10750 } 10751 pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties 10752 } 10753 case "id": 10754 if v != nil { 10755 var ID string 10756 err = json.Unmarshal(*v, &ID) 10757 if err != nil { 10758 return err 10759 } 10760 pec.ID = &ID 10761 } 10762 case "name": 10763 if v != nil { 10764 var name string 10765 err = json.Unmarshal(*v, &name) 10766 if err != nil { 10767 return err 10768 } 10769 pec.Name = &name 10770 } 10771 case "type": 10772 if v != nil { 10773 var typeVar string 10774 err = json.Unmarshal(*v, &typeVar) 10775 if err != nil { 10776 return err 10777 } 10778 pec.Type = &typeVar 10779 } 10780 } 10781 } 10782 10783 return nil 10784} 10785 10786// PrivateEndpointConnectionListResult a list of private link resources 10787type PrivateEndpointConnectionListResult struct { 10788 autorest.Response `json:"-"` 10789 // Value - Array of private endpoint connections 10790 Value *[]PrivateEndpointConnection `json:"value,omitempty"` 10791 // NextLink - The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the next page of snapshots. 10792 NextLink *string `json:"nextLink,omitempty"` 10793} 10794 10795// PrivateEndpointConnectionListResultIterator provides access to a complete listing of 10796// PrivateEndpointConnection values. 10797type PrivateEndpointConnectionListResultIterator struct { 10798 i int 10799 page PrivateEndpointConnectionListResultPage 10800} 10801 10802// NextWithContext advances to the next value. If there was an error making 10803// the request the iterator does not advance and the error is returned. 10804func (iter *PrivateEndpointConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) { 10805 if tracing.IsEnabled() { 10806 ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultIterator.NextWithContext") 10807 defer func() { 10808 sc := -1 10809 if iter.Response().Response.Response != nil { 10810 sc = iter.Response().Response.Response.StatusCode 10811 } 10812 tracing.EndSpan(ctx, sc, err) 10813 }() 10814 } 10815 iter.i++ 10816 if iter.i < len(iter.page.Values()) { 10817 return nil 10818 } 10819 err = iter.page.NextWithContext(ctx) 10820 if err != nil { 10821 iter.i-- 10822 return err 10823 } 10824 iter.i = 0 10825 return nil 10826} 10827 10828// Next advances to the next value. If there was an error making 10829// the request the iterator does not advance and the error is returned. 10830// Deprecated: Use NextWithContext() instead. 10831func (iter *PrivateEndpointConnectionListResultIterator) Next() error { 10832 return iter.NextWithContext(context.Background()) 10833} 10834 10835// NotDone returns true if the enumeration should be started or is not yet complete. 10836func (iter PrivateEndpointConnectionListResultIterator) NotDone() bool { 10837 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10838} 10839 10840// Response returns the raw server response from the last page request. 10841func (iter PrivateEndpointConnectionListResultIterator) Response() PrivateEndpointConnectionListResult { 10842 return iter.page.Response() 10843} 10844 10845// Value returns the current value or a zero-initialized value if the 10846// iterator has advanced beyond the end of the collection. 10847func (iter PrivateEndpointConnectionListResultIterator) Value() PrivateEndpointConnection { 10848 if !iter.page.NotDone() { 10849 return PrivateEndpointConnection{} 10850 } 10851 return iter.page.Values()[iter.i] 10852} 10853 10854// Creates a new instance of the PrivateEndpointConnectionListResultIterator type. 10855func NewPrivateEndpointConnectionListResultIterator(page PrivateEndpointConnectionListResultPage) PrivateEndpointConnectionListResultIterator { 10856 return PrivateEndpointConnectionListResultIterator{page: page} 10857} 10858 10859// IsEmpty returns true if the ListResult contains no values. 10860func (peclr PrivateEndpointConnectionListResult) IsEmpty() bool { 10861 return peclr.Value == nil || len(*peclr.Value) == 0 10862} 10863 10864// hasNextLink returns true if the NextLink is not empty. 10865func (peclr PrivateEndpointConnectionListResult) hasNextLink() bool { 10866 return peclr.NextLink != nil && len(*peclr.NextLink) != 0 10867} 10868 10869// privateEndpointConnectionListResultPreparer prepares a request to retrieve the next set of results. 10870// It returns nil if no more results exist. 10871func (peclr PrivateEndpointConnectionListResult) privateEndpointConnectionListResultPreparer(ctx context.Context) (*http.Request, error) { 10872 if !peclr.hasNextLink() { 10873 return nil, nil 10874 } 10875 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10876 autorest.AsJSON(), 10877 autorest.AsGet(), 10878 autorest.WithBaseURL(to.String(peclr.NextLink))) 10879} 10880 10881// PrivateEndpointConnectionListResultPage contains a page of PrivateEndpointConnection values. 10882type PrivateEndpointConnectionListResultPage struct { 10883 fn func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error) 10884 peclr PrivateEndpointConnectionListResult 10885} 10886 10887// NextWithContext advances to the next page of values. If there was an error making 10888// the request the page does not advance and the error is returned. 10889func (page *PrivateEndpointConnectionListResultPage) NextWithContext(ctx context.Context) (err error) { 10890 if tracing.IsEnabled() { 10891 ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultPage.NextWithContext") 10892 defer func() { 10893 sc := -1 10894 if page.Response().Response.Response != nil { 10895 sc = page.Response().Response.Response.StatusCode 10896 } 10897 tracing.EndSpan(ctx, sc, err) 10898 }() 10899 } 10900 for { 10901 next, err := page.fn(ctx, page.peclr) 10902 if err != nil { 10903 return err 10904 } 10905 page.peclr = next 10906 if !next.hasNextLink() || !next.IsEmpty() { 10907 break 10908 } 10909 } 10910 return nil 10911} 10912 10913// Next advances to the next page of values. If there was an error making 10914// the request the page does not advance and the error is returned. 10915// Deprecated: Use NextWithContext() instead. 10916func (page *PrivateEndpointConnectionListResultPage) Next() error { 10917 return page.NextWithContext(context.Background()) 10918} 10919 10920// NotDone returns true if the page enumeration should be started or is not yet complete. 10921func (page PrivateEndpointConnectionListResultPage) NotDone() bool { 10922 return !page.peclr.IsEmpty() 10923} 10924 10925// Response returns the raw server response from the last page request. 10926func (page PrivateEndpointConnectionListResultPage) Response() PrivateEndpointConnectionListResult { 10927 return page.peclr 10928} 10929 10930// Values returns the slice of values for the current page or nil if there are no values. 10931func (page PrivateEndpointConnectionListResultPage) Values() []PrivateEndpointConnection { 10932 if page.peclr.IsEmpty() { 10933 return nil 10934 } 10935 return *page.peclr.Value 10936} 10937 10938// Creates a new instance of the PrivateEndpointConnectionListResultPage type. 10939func NewPrivateEndpointConnectionListResultPage(cur PrivateEndpointConnectionListResult, getNextPage func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error)) PrivateEndpointConnectionListResultPage { 10940 return PrivateEndpointConnectionListResultPage{ 10941 fn: getNextPage, 10942 peclr: cur, 10943 } 10944} 10945 10946// PrivateEndpointConnectionProperties properties of the PrivateEndpointConnectProperties. 10947type PrivateEndpointConnectionProperties struct { 10948 // PrivateEndpoint - READ-ONLY; The resource of private end point. 10949 PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` 10950 // PrivateLinkServiceConnectionState - A collection of information about the state of the connection between DiskAccess and Virtual Network. 10951 PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` 10952 // ProvisioningState - The provisioning state of the private endpoint connection resource. Possible values include: 'PrivateEndpointConnectionProvisioningStateSucceeded', 'PrivateEndpointConnectionProvisioningStateCreating', 'PrivateEndpointConnectionProvisioningStateDeleting', 'PrivateEndpointConnectionProvisioningStateFailed' 10953 ProvisioningState PrivateEndpointConnectionProvisioningState `json:"provisioningState,omitempty"` 10954} 10955 10956// MarshalJSON is the custom marshaler for PrivateEndpointConnectionProperties. 10957func (pecp PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { 10958 objectMap := make(map[string]interface{}) 10959 if pecp.PrivateLinkServiceConnectionState != nil { 10960 objectMap["privateLinkServiceConnectionState"] = pecp.PrivateLinkServiceConnectionState 10961 } 10962 if pecp.ProvisioningState != "" { 10963 objectMap["provisioningState"] = pecp.ProvisioningState 10964 } 10965 return json.Marshal(objectMap) 10966} 10967 10968// PrivateLinkResource a private link resource 10969type PrivateLinkResource struct { 10970 // PrivateLinkResourceProperties - Resource properties. 10971 *PrivateLinkResourceProperties `json:"properties,omitempty"` 10972 // ID - READ-ONLY; private link resource Id 10973 ID *string `json:"id,omitempty"` 10974 // Name - READ-ONLY; private link resource name 10975 Name *string `json:"name,omitempty"` 10976 // Type - READ-ONLY; private link resource type 10977 Type *string `json:"type,omitempty"` 10978} 10979 10980// MarshalJSON is the custom marshaler for PrivateLinkResource. 10981func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) { 10982 objectMap := make(map[string]interface{}) 10983 if plr.PrivateLinkResourceProperties != nil { 10984 objectMap["properties"] = plr.PrivateLinkResourceProperties 10985 } 10986 return json.Marshal(objectMap) 10987} 10988 10989// UnmarshalJSON is the custom unmarshaler for PrivateLinkResource struct. 10990func (plr *PrivateLinkResource) UnmarshalJSON(body []byte) error { 10991 var m map[string]*json.RawMessage 10992 err := json.Unmarshal(body, &m) 10993 if err != nil { 10994 return err 10995 } 10996 for k, v := range m { 10997 switch k { 10998 case "properties": 10999 if v != nil { 11000 var privateLinkResourceProperties PrivateLinkResourceProperties 11001 err = json.Unmarshal(*v, &privateLinkResourceProperties) 11002 if err != nil { 11003 return err 11004 } 11005 plr.PrivateLinkResourceProperties = &privateLinkResourceProperties 11006 } 11007 case "id": 11008 if v != nil { 11009 var ID string 11010 err = json.Unmarshal(*v, &ID) 11011 if err != nil { 11012 return err 11013 } 11014 plr.ID = &ID 11015 } 11016 case "name": 11017 if v != nil { 11018 var name string 11019 err = json.Unmarshal(*v, &name) 11020 if err != nil { 11021 return err 11022 } 11023 plr.Name = &name 11024 } 11025 case "type": 11026 if v != nil { 11027 var typeVar string 11028 err = json.Unmarshal(*v, &typeVar) 11029 if err != nil { 11030 return err 11031 } 11032 plr.Type = &typeVar 11033 } 11034 } 11035 } 11036 11037 return nil 11038} 11039 11040// PrivateLinkResourceListResult a list of private link resources 11041type PrivateLinkResourceListResult struct { 11042 autorest.Response `json:"-"` 11043 // Value - Array of private link resources 11044 Value *[]PrivateLinkResource `json:"value,omitempty"` 11045} 11046 11047// PrivateLinkResourceProperties properties of a private link resource. 11048type PrivateLinkResourceProperties struct { 11049 // GroupID - READ-ONLY; The private link resource group id. 11050 GroupID *string `json:"groupId,omitempty"` 11051 // RequiredMembers - READ-ONLY; The private link resource required member names. 11052 RequiredMembers *[]string `json:"requiredMembers,omitempty"` 11053 // RequiredZoneNames - The private link resource DNS zone name. 11054 RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` 11055} 11056 11057// MarshalJSON is the custom marshaler for PrivateLinkResourceProperties. 11058func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { 11059 objectMap := make(map[string]interface{}) 11060 if plrp.RequiredZoneNames != nil { 11061 objectMap["requiredZoneNames"] = plrp.RequiredZoneNames 11062 } 11063 return json.Marshal(objectMap) 11064} 11065 11066// PrivateLinkServiceConnectionState a collection of information about the state of the connection between 11067// service consumer and provider. 11068type PrivateLinkServiceConnectionState struct { 11069 // Status - Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: 'PrivateEndpointServiceConnectionStatusPending', 'PrivateEndpointServiceConnectionStatusApproved', 'PrivateEndpointServiceConnectionStatusRejected' 11070 Status PrivateEndpointServiceConnectionStatus `json:"status,omitempty"` 11071 // Description - The reason for approval/rejection of the connection. 11072 Description *string `json:"description,omitempty"` 11073 // ActionsRequired - A message indicating if changes on the service provider require any updates on the consumer. 11074 ActionsRequired *string `json:"actionsRequired,omitempty"` 11075} 11076 11077// PropertyUpdatesInProgress properties of the disk for which update is pending. 11078type PropertyUpdatesInProgress struct { 11079 // TargetTier - The target performance tier of the disk if a tier change operation is in progress. 11080 TargetTier *string `json:"targetTier,omitempty"` 11081} 11082 11083// ProximityPlacementGroup specifies information about the proximity placement group. 11084type ProximityPlacementGroup struct { 11085 autorest.Response `json:"-"` 11086 // ProximityPlacementGroupProperties - Describes the properties of a Proximity Placement Group. 11087 *ProximityPlacementGroupProperties `json:"properties,omitempty"` 11088 // ID - READ-ONLY; Resource Id 11089 ID *string `json:"id,omitempty"` 11090 // Name - READ-ONLY; Resource name 11091 Name *string `json:"name,omitempty"` 11092 // Type - READ-ONLY; Resource type 11093 Type *string `json:"type,omitempty"` 11094 // Location - Resource location 11095 Location *string `json:"location,omitempty"` 11096 // Tags - Resource tags 11097 Tags map[string]*string `json:"tags"` 11098} 11099 11100// MarshalJSON is the custom marshaler for ProximityPlacementGroup. 11101func (ppg ProximityPlacementGroup) MarshalJSON() ([]byte, error) { 11102 objectMap := make(map[string]interface{}) 11103 if ppg.ProximityPlacementGroupProperties != nil { 11104 objectMap["properties"] = ppg.ProximityPlacementGroupProperties 11105 } 11106 if ppg.Location != nil { 11107 objectMap["location"] = ppg.Location 11108 } 11109 if ppg.Tags != nil { 11110 objectMap["tags"] = ppg.Tags 11111 } 11112 return json.Marshal(objectMap) 11113} 11114 11115// UnmarshalJSON is the custom unmarshaler for ProximityPlacementGroup struct. 11116func (ppg *ProximityPlacementGroup) UnmarshalJSON(body []byte) error { 11117 var m map[string]*json.RawMessage 11118 err := json.Unmarshal(body, &m) 11119 if err != nil { 11120 return err 11121 } 11122 for k, v := range m { 11123 switch k { 11124 case "properties": 11125 if v != nil { 11126 var proximityPlacementGroupProperties ProximityPlacementGroupProperties 11127 err = json.Unmarshal(*v, &proximityPlacementGroupProperties) 11128 if err != nil { 11129 return err 11130 } 11131 ppg.ProximityPlacementGroupProperties = &proximityPlacementGroupProperties 11132 } 11133 case "id": 11134 if v != nil { 11135 var ID string 11136 err = json.Unmarshal(*v, &ID) 11137 if err != nil { 11138 return err 11139 } 11140 ppg.ID = &ID 11141 } 11142 case "name": 11143 if v != nil { 11144 var name string 11145 err = json.Unmarshal(*v, &name) 11146 if err != nil { 11147 return err 11148 } 11149 ppg.Name = &name 11150 } 11151 case "type": 11152 if v != nil { 11153 var typeVar string 11154 err = json.Unmarshal(*v, &typeVar) 11155 if err != nil { 11156 return err 11157 } 11158 ppg.Type = &typeVar 11159 } 11160 case "location": 11161 if v != nil { 11162 var location string 11163 err = json.Unmarshal(*v, &location) 11164 if err != nil { 11165 return err 11166 } 11167 ppg.Location = &location 11168 } 11169 case "tags": 11170 if v != nil { 11171 var tags map[string]*string 11172 err = json.Unmarshal(*v, &tags) 11173 if err != nil { 11174 return err 11175 } 11176 ppg.Tags = tags 11177 } 11178 } 11179 } 11180 11181 return nil 11182} 11183 11184// ProximityPlacementGroupListResult the List Proximity Placement Group operation response. 11185type ProximityPlacementGroupListResult struct { 11186 autorest.Response `json:"-"` 11187 // Value - The list of proximity placement groups 11188 Value *[]ProximityPlacementGroup `json:"value,omitempty"` 11189 // NextLink - The URI to fetch the next page of proximity placement groups. 11190 NextLink *string `json:"nextLink,omitempty"` 11191} 11192 11193// ProximityPlacementGroupListResultIterator provides access to a complete listing of 11194// ProximityPlacementGroup values. 11195type ProximityPlacementGroupListResultIterator struct { 11196 i int 11197 page ProximityPlacementGroupListResultPage 11198} 11199 11200// NextWithContext advances to the next value. If there was an error making 11201// the request the iterator does not advance and the error is returned. 11202func (iter *ProximityPlacementGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { 11203 if tracing.IsEnabled() { 11204 ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupListResultIterator.NextWithContext") 11205 defer func() { 11206 sc := -1 11207 if iter.Response().Response.Response != nil { 11208 sc = iter.Response().Response.Response.StatusCode 11209 } 11210 tracing.EndSpan(ctx, sc, err) 11211 }() 11212 } 11213 iter.i++ 11214 if iter.i < len(iter.page.Values()) { 11215 return nil 11216 } 11217 err = iter.page.NextWithContext(ctx) 11218 if err != nil { 11219 iter.i-- 11220 return err 11221 } 11222 iter.i = 0 11223 return nil 11224} 11225 11226// Next advances to the next value. If there was an error making 11227// the request the iterator does not advance and the error is returned. 11228// Deprecated: Use NextWithContext() instead. 11229func (iter *ProximityPlacementGroupListResultIterator) Next() error { 11230 return iter.NextWithContext(context.Background()) 11231} 11232 11233// NotDone returns true if the enumeration should be started or is not yet complete. 11234func (iter ProximityPlacementGroupListResultIterator) NotDone() bool { 11235 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11236} 11237 11238// Response returns the raw server response from the last page request. 11239func (iter ProximityPlacementGroupListResultIterator) Response() ProximityPlacementGroupListResult { 11240 return iter.page.Response() 11241} 11242 11243// Value returns the current value or a zero-initialized value if the 11244// iterator has advanced beyond the end of the collection. 11245func (iter ProximityPlacementGroupListResultIterator) Value() ProximityPlacementGroup { 11246 if !iter.page.NotDone() { 11247 return ProximityPlacementGroup{} 11248 } 11249 return iter.page.Values()[iter.i] 11250} 11251 11252// Creates a new instance of the ProximityPlacementGroupListResultIterator type. 11253func NewProximityPlacementGroupListResultIterator(page ProximityPlacementGroupListResultPage) ProximityPlacementGroupListResultIterator { 11254 return ProximityPlacementGroupListResultIterator{page: page} 11255} 11256 11257// IsEmpty returns true if the ListResult contains no values. 11258func (ppglr ProximityPlacementGroupListResult) IsEmpty() bool { 11259 return ppglr.Value == nil || len(*ppglr.Value) == 0 11260} 11261 11262// hasNextLink returns true if the NextLink is not empty. 11263func (ppglr ProximityPlacementGroupListResult) hasNextLink() bool { 11264 return ppglr.NextLink != nil && len(*ppglr.NextLink) != 0 11265} 11266 11267// proximityPlacementGroupListResultPreparer prepares a request to retrieve the next set of results. 11268// It returns nil if no more results exist. 11269func (ppglr ProximityPlacementGroupListResult) proximityPlacementGroupListResultPreparer(ctx context.Context) (*http.Request, error) { 11270 if !ppglr.hasNextLink() { 11271 return nil, nil 11272 } 11273 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11274 autorest.AsJSON(), 11275 autorest.AsGet(), 11276 autorest.WithBaseURL(to.String(ppglr.NextLink))) 11277} 11278 11279// ProximityPlacementGroupListResultPage contains a page of ProximityPlacementGroup values. 11280type ProximityPlacementGroupListResultPage struct { 11281 fn func(context.Context, ProximityPlacementGroupListResult) (ProximityPlacementGroupListResult, error) 11282 ppglr ProximityPlacementGroupListResult 11283} 11284 11285// NextWithContext advances to the next page of values. If there was an error making 11286// the request the page does not advance and the error is returned. 11287func (page *ProximityPlacementGroupListResultPage) NextWithContext(ctx context.Context) (err error) { 11288 if tracing.IsEnabled() { 11289 ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupListResultPage.NextWithContext") 11290 defer func() { 11291 sc := -1 11292 if page.Response().Response.Response != nil { 11293 sc = page.Response().Response.Response.StatusCode 11294 } 11295 tracing.EndSpan(ctx, sc, err) 11296 }() 11297 } 11298 for { 11299 next, err := page.fn(ctx, page.ppglr) 11300 if err != nil { 11301 return err 11302 } 11303 page.ppglr = next 11304 if !next.hasNextLink() || !next.IsEmpty() { 11305 break 11306 } 11307 } 11308 return nil 11309} 11310 11311// Next advances to the next page of values. If there was an error making 11312// the request the page does not advance and the error is returned. 11313// Deprecated: Use NextWithContext() instead. 11314func (page *ProximityPlacementGroupListResultPage) Next() error { 11315 return page.NextWithContext(context.Background()) 11316} 11317 11318// NotDone returns true if the page enumeration should be started or is not yet complete. 11319func (page ProximityPlacementGroupListResultPage) NotDone() bool { 11320 return !page.ppglr.IsEmpty() 11321} 11322 11323// Response returns the raw server response from the last page request. 11324func (page ProximityPlacementGroupListResultPage) Response() ProximityPlacementGroupListResult { 11325 return page.ppglr 11326} 11327 11328// Values returns the slice of values for the current page or nil if there are no values. 11329func (page ProximityPlacementGroupListResultPage) Values() []ProximityPlacementGroup { 11330 if page.ppglr.IsEmpty() { 11331 return nil 11332 } 11333 return *page.ppglr.Value 11334} 11335 11336// Creates a new instance of the ProximityPlacementGroupListResultPage type. 11337func NewProximityPlacementGroupListResultPage(cur ProximityPlacementGroupListResult, getNextPage func(context.Context, ProximityPlacementGroupListResult) (ProximityPlacementGroupListResult, error)) ProximityPlacementGroupListResultPage { 11338 return ProximityPlacementGroupListResultPage{ 11339 fn: getNextPage, 11340 ppglr: cur, 11341 } 11342} 11343 11344// ProximityPlacementGroupProperties describes the properties of a Proximity Placement Group. 11345type ProximityPlacementGroupProperties struct { 11346 // 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' 11347 ProximityPlacementGroupType ProximityPlacementGroupType `json:"proximityPlacementGroupType,omitempty"` 11348 // VirtualMachines - READ-ONLY; A list of references to all virtual machines in the proximity placement group. 11349 VirtualMachines *[]SubResourceWithColocationStatus `json:"virtualMachines,omitempty"` 11350 // VirtualMachineScaleSets - READ-ONLY; A list of references to all virtual machine scale sets in the proximity placement group. 11351 VirtualMachineScaleSets *[]SubResourceWithColocationStatus `json:"virtualMachineScaleSets,omitempty"` 11352 // AvailabilitySets - READ-ONLY; A list of references to all availability sets in the proximity placement group. 11353 AvailabilitySets *[]SubResourceWithColocationStatus `json:"availabilitySets,omitempty"` 11354 // ColocationStatus - Describes colocation status of the Proximity Placement Group. 11355 ColocationStatus *InstanceViewStatus `json:"colocationStatus,omitempty"` 11356} 11357 11358// MarshalJSON is the custom marshaler for ProximityPlacementGroupProperties. 11359func (ppgp ProximityPlacementGroupProperties) MarshalJSON() ([]byte, error) { 11360 objectMap := make(map[string]interface{}) 11361 if ppgp.ProximityPlacementGroupType != "" { 11362 objectMap["proximityPlacementGroupType"] = ppgp.ProximityPlacementGroupType 11363 } 11364 if ppgp.ColocationStatus != nil { 11365 objectMap["colocationStatus"] = ppgp.ColocationStatus 11366 } 11367 return json.Marshal(objectMap) 11368} 11369 11370// ProximityPlacementGroupUpdate specifies information about the proximity placement group. 11371type ProximityPlacementGroupUpdate struct { 11372 // Tags - Resource tags 11373 Tags map[string]*string `json:"tags"` 11374} 11375 11376// MarshalJSON is the custom marshaler for ProximityPlacementGroupUpdate. 11377func (ppgu ProximityPlacementGroupUpdate) MarshalJSON() ([]byte, error) { 11378 objectMap := make(map[string]interface{}) 11379 if ppgu.Tags != nil { 11380 objectMap["tags"] = ppgu.Tags 11381 } 11382 return json.Marshal(objectMap) 11383} 11384 11385// ProxyOnlyResource the ProxyOnly Resource model definition. 11386type ProxyOnlyResource struct { 11387 // ID - READ-ONLY; Resource Id 11388 ID *string `json:"id,omitempty"` 11389 // Name - READ-ONLY; Resource name 11390 Name *string `json:"name,omitempty"` 11391 // Type - READ-ONLY; Resource type 11392 Type *string `json:"type,omitempty"` 11393} 11394 11395// MarshalJSON is the custom marshaler for ProxyOnlyResource. 11396func (por ProxyOnlyResource) MarshalJSON() ([]byte, error) { 11397 objectMap := make(map[string]interface{}) 11398 return json.Marshal(objectMap) 11399} 11400 11401// ProxyResource the resource model definition for an Azure Resource Manager proxy resource. It will not 11402// have tags and a location 11403type ProxyResource struct { 11404 // ID - READ-ONLY; Resource Id 11405 ID *string `json:"id,omitempty"` 11406 // Name - READ-ONLY; Resource name 11407 Name *string `json:"name,omitempty"` 11408 // Type - READ-ONLY; Resource type 11409 Type *string `json:"type,omitempty"` 11410} 11411 11412// MarshalJSON is the custom marshaler for ProxyResource. 11413func (pr ProxyResource) MarshalJSON() ([]byte, error) { 11414 objectMap := make(map[string]interface{}) 11415 return json.Marshal(objectMap) 11416} 11417 11418// PublicIPAddressSku describes the public IP Sku 11419type PublicIPAddressSku struct { 11420 // Name - Specify public IP sku name. Possible values include: 'PublicIPAddressSkuNameBasic', 'PublicIPAddressSkuNameStandard' 11421 Name PublicIPAddressSkuName `json:"name,omitempty"` 11422 // Tier - Specify public IP sku tier. Possible values include: 'PublicIPAddressSkuTierRegional', 'PublicIPAddressSkuTierGlobal' 11423 Tier PublicIPAddressSkuTier `json:"tier,omitempty"` 11424} 11425 11426// PurchasePlan used for establishing the purchase context of any 3rd Party artifact through MarketPlace. 11427type PurchasePlan struct { 11428 // Publisher - The publisher ID. 11429 Publisher *string `json:"publisher,omitempty"` 11430 // Name - The plan ID. 11431 Name *string `json:"name,omitempty"` 11432 // Product - Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. 11433 Product *string `json:"product,omitempty"` 11434 // PromotionCode - The Offer Promotion Code. 11435 PromotionCode *string `json:"promotionCode,omitempty"` 11436} 11437 11438// ReadCloser ... 11439type ReadCloser struct { 11440 autorest.Response `json:"-"` 11441 Value *io.ReadCloser `json:"value,omitempty"` 11442} 11443 11444// RecommendedMachineConfiguration the properties describe the recommended machine configuration for this 11445// Image Definition. These properties are updatable. 11446type RecommendedMachineConfiguration struct { 11447 VCPUs *ResourceRange `json:"vCPUs,omitempty"` 11448 Memory *ResourceRange `json:"memory,omitempty"` 11449} 11450 11451// RecoveryWalkResponse response after calling a manual recovery walk 11452type RecoveryWalkResponse struct { 11453 autorest.Response `json:"-"` 11454 // WalkPerformed - READ-ONLY; Whether the recovery walk was performed 11455 WalkPerformed *bool `json:"walkPerformed,omitempty"` 11456 // NextPlatformUpdateDomain - READ-ONLY; The next update domain that needs to be walked. Null means walk spanning all update domains has been completed 11457 NextPlatformUpdateDomain *int32 `json:"nextPlatformUpdateDomain,omitempty"` 11458} 11459 11460// MarshalJSON is the custom marshaler for RecoveryWalkResponse. 11461func (rwr RecoveryWalkResponse) MarshalJSON() ([]byte, error) { 11462 objectMap := make(map[string]interface{}) 11463 return json.Marshal(objectMap) 11464} 11465 11466// RegionalReplicationStatus this is the regional replication status. 11467type RegionalReplicationStatus struct { 11468 // Region - READ-ONLY; The region to which the gallery image version is being replicated to. 11469 Region *string `json:"region,omitempty"` 11470 // State - READ-ONLY; This is the regional replication state. Possible values include: 'ReplicationStateUnknown', 'ReplicationStateReplicating', 'ReplicationStateCompleted', 'ReplicationStateFailed' 11471 State ReplicationState `json:"state,omitempty"` 11472 // Details - READ-ONLY; The details of the replication status. 11473 Details *string `json:"details,omitempty"` 11474 // Progress - READ-ONLY; It indicates progress of the replication job. 11475 Progress *int32 `json:"progress,omitempty"` 11476} 11477 11478// MarshalJSON is the custom marshaler for RegionalReplicationStatus. 11479func (rrs RegionalReplicationStatus) MarshalJSON() ([]byte, error) { 11480 objectMap := make(map[string]interface{}) 11481 return json.Marshal(objectMap) 11482} 11483 11484// ReplicationStatus this is the replication status of the gallery image version. 11485type ReplicationStatus struct { 11486 // AggregatedState - READ-ONLY; This is the aggregated replication status based on all the regional replication status flags. Possible values include: 'AggregatedReplicationStateUnknown', 'AggregatedReplicationStateInProgress', 'AggregatedReplicationStateCompleted', 'AggregatedReplicationStateFailed' 11487 AggregatedState AggregatedReplicationState `json:"aggregatedState,omitempty"` 11488 // Summary - READ-ONLY; This is a summary of replication status for each region. 11489 Summary *[]RegionalReplicationStatus `json:"summary,omitempty"` 11490} 11491 11492// MarshalJSON is the custom marshaler for ReplicationStatus. 11493func (rs ReplicationStatus) MarshalJSON() ([]byte, error) { 11494 objectMap := make(map[string]interface{}) 11495 return json.Marshal(objectMap) 11496} 11497 11498// RequestRateByIntervalInput api request input for LogAnalytics getRequestRateByInterval Api. 11499type RequestRateByIntervalInput struct { 11500 // IntervalLength - Interval value in minutes used to create LogAnalytics call rate logs. Possible values include: 'IntervalInMinsThreeMins', 'IntervalInMinsFiveMins', 'IntervalInMinsThirtyMins', 'IntervalInMinsSixtyMins' 11501 IntervalLength IntervalInMins `json:"intervalLength,omitempty"` 11502 // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. 11503 BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` 11504 // FromTime - From time of the query 11505 FromTime *date.Time `json:"fromTime,omitempty"` 11506 // ToTime - To time of the query 11507 ToTime *date.Time `json:"toTime,omitempty"` 11508 // GroupByThrottlePolicy - Group query result by Throttle Policy applied. 11509 GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` 11510 // GroupByOperationName - Group query result by Operation Name. 11511 GroupByOperationName *bool `json:"groupByOperationName,omitempty"` 11512 // GroupByResourceName - Group query result by Resource Name. 11513 GroupByResourceName *bool `json:"groupByResourceName,omitempty"` 11514 // GroupByClientApplicationID - Group query result by Client Application ID. 11515 GroupByClientApplicationID *bool `json:"groupByClientApplicationId,omitempty"` 11516 // GroupByUserAgent - Group query result by User Agent. 11517 GroupByUserAgent *bool `json:"groupByUserAgent,omitempty"` 11518} 11519 11520// Resource the Resource model definition. 11521type Resource struct { 11522 // ID - READ-ONLY; Resource Id 11523 ID *string `json:"id,omitempty"` 11524 // Name - READ-ONLY; Resource name 11525 Name *string `json:"name,omitempty"` 11526 // Type - READ-ONLY; Resource type 11527 Type *string `json:"type,omitempty"` 11528 // Location - Resource location 11529 Location *string `json:"location,omitempty"` 11530 // Tags - Resource tags 11531 Tags map[string]*string `json:"tags"` 11532} 11533 11534// MarshalJSON is the custom marshaler for Resource. 11535func (r Resource) MarshalJSON() ([]byte, error) { 11536 objectMap := make(map[string]interface{}) 11537 if r.Location != nil { 11538 objectMap["location"] = r.Location 11539 } 11540 if r.Tags != nil { 11541 objectMap["tags"] = r.Tags 11542 } 11543 return json.Marshal(objectMap) 11544} 11545 11546// ResourceInstanceViewStatus instance view status. 11547type ResourceInstanceViewStatus struct { 11548 // Code - READ-ONLY; The status code. 11549 Code *string `json:"code,omitempty"` 11550 // DisplayStatus - READ-ONLY; The short localizable label for the status. 11551 DisplayStatus *string `json:"displayStatus,omitempty"` 11552 // Message - READ-ONLY; The detailed status message, including for alerts and error messages. 11553 Message *string `json:"message,omitempty"` 11554 // Time - READ-ONLY; The time of the status. 11555 Time *date.Time `json:"time,omitempty"` 11556 // Level - The level code. Possible values include: 'StatusLevelTypesInfo', 'StatusLevelTypesWarning', 'StatusLevelTypesError' 11557 Level StatusLevelTypes `json:"level,omitempty"` 11558} 11559 11560// MarshalJSON is the custom marshaler for ResourceInstanceViewStatus. 11561func (rivs ResourceInstanceViewStatus) MarshalJSON() ([]byte, error) { 11562 objectMap := make(map[string]interface{}) 11563 if rivs.Level != "" { 11564 objectMap["level"] = rivs.Level 11565 } 11566 return json.Marshal(objectMap) 11567} 11568 11569// ResourceRange describes the resource range. 11570type ResourceRange struct { 11571 // Min - The minimum number of the resource. 11572 Min *int32 `json:"min,omitempty"` 11573 // Max - The maximum number of the resource. 11574 Max *int32 `json:"max,omitempty"` 11575} 11576 11577// ResourceSku describes an available Compute SKU. 11578type ResourceSku struct { 11579 // ResourceType - READ-ONLY; The type of resource the SKU applies to. 11580 ResourceType *string `json:"resourceType,omitempty"` 11581 // Name - READ-ONLY; The name of SKU. 11582 Name *string `json:"name,omitempty"` 11583 // Tier - READ-ONLY; Specifies the tier of virtual machines in a scale set.<br /><br /> Possible Values:<br /><br /> **Standard**<br /><br /> **Basic** 11584 Tier *string `json:"tier,omitempty"` 11585 // Size - READ-ONLY; The Size of the SKU. 11586 Size *string `json:"size,omitempty"` 11587 // Family - READ-ONLY; The Family of this particular SKU. 11588 Family *string `json:"family,omitempty"` 11589 // Kind - READ-ONLY; The Kind of resources that are supported in this SKU. 11590 Kind *string `json:"kind,omitempty"` 11591 // Capacity - READ-ONLY; Specifies the number of virtual machines in the scale set. 11592 Capacity *ResourceSkuCapacity `json:"capacity,omitempty"` 11593 // Locations - READ-ONLY; The set of locations that the SKU is available. 11594 Locations *[]string `json:"locations,omitempty"` 11595 // LocationInfo - READ-ONLY; A list of locations and availability zones in those locations where the SKU is available. 11596 LocationInfo *[]ResourceSkuLocationInfo `json:"locationInfo,omitempty"` 11597 // APIVersions - READ-ONLY; The api versions that support this SKU. 11598 APIVersions *[]string `json:"apiVersions,omitempty"` 11599 // Costs - READ-ONLY; Metadata for retrieving price info. 11600 Costs *[]ResourceSkuCosts `json:"costs,omitempty"` 11601 // Capabilities - READ-ONLY; A name value pair to describe the capability. 11602 Capabilities *[]ResourceSkuCapabilities `json:"capabilities,omitempty"` 11603 // Restrictions - READ-ONLY; The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. 11604 Restrictions *[]ResourceSkuRestrictions `json:"restrictions,omitempty"` 11605} 11606 11607// MarshalJSON is the custom marshaler for ResourceSku. 11608func (rs ResourceSku) MarshalJSON() ([]byte, error) { 11609 objectMap := make(map[string]interface{}) 11610 return json.Marshal(objectMap) 11611} 11612 11613// ResourceSkuCapabilities describes The SKU capabilities object. 11614type ResourceSkuCapabilities struct { 11615 // Name - READ-ONLY; An invariant to describe the feature. 11616 Name *string `json:"name,omitempty"` 11617 // Value - READ-ONLY; An invariant if the feature is measured by quantity. 11618 Value *string `json:"value,omitempty"` 11619} 11620 11621// MarshalJSON is the custom marshaler for ResourceSkuCapabilities. 11622func (rsc ResourceSkuCapabilities) MarshalJSON() ([]byte, error) { 11623 objectMap := make(map[string]interface{}) 11624 return json.Marshal(objectMap) 11625} 11626 11627// ResourceSkuCapacity describes scaling information of a SKU. 11628type ResourceSkuCapacity struct { 11629 // Minimum - READ-ONLY; The minimum capacity. 11630 Minimum *int64 `json:"minimum,omitempty"` 11631 // Maximum - READ-ONLY; The maximum capacity that can be set. 11632 Maximum *int64 `json:"maximum,omitempty"` 11633 // Default - READ-ONLY; The default capacity. 11634 Default *int64 `json:"default,omitempty"` 11635 // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'ResourceSkuCapacityScaleTypeAutomatic', 'ResourceSkuCapacityScaleTypeManual', 'ResourceSkuCapacityScaleTypeNone' 11636 ScaleType ResourceSkuCapacityScaleType `json:"scaleType,omitempty"` 11637} 11638 11639// MarshalJSON is the custom marshaler for ResourceSkuCapacity. 11640func (rsc ResourceSkuCapacity) MarshalJSON() ([]byte, error) { 11641 objectMap := make(map[string]interface{}) 11642 return json.Marshal(objectMap) 11643} 11644 11645// ResourceSkuCosts describes metadata for retrieving price info. 11646type ResourceSkuCosts struct { 11647 // MeterID - READ-ONLY; Used for querying price from commerce. 11648 MeterID *string `json:"meterID,omitempty"` 11649 // Quantity - READ-ONLY; The multiplier is needed to extend the base metered cost. 11650 Quantity *int64 `json:"quantity,omitempty"` 11651 // ExtendedUnit - READ-ONLY; An invariant to show the extended unit. 11652 ExtendedUnit *string `json:"extendedUnit,omitempty"` 11653} 11654 11655// MarshalJSON is the custom marshaler for ResourceSkuCosts. 11656func (rsc ResourceSkuCosts) MarshalJSON() ([]byte, error) { 11657 objectMap := make(map[string]interface{}) 11658 return json.Marshal(objectMap) 11659} 11660 11661// ResourceSkuLocationInfo describes an available Compute SKU Location Information. 11662type ResourceSkuLocationInfo struct { 11663 // Location - READ-ONLY; Location of the SKU 11664 Location *string `json:"location,omitempty"` 11665 // Zones - READ-ONLY; List of availability zones where the SKU is supported. 11666 Zones *[]string `json:"zones,omitempty"` 11667 // ZoneDetails - READ-ONLY; Details of capabilities available to a SKU in specific zones. 11668 ZoneDetails *[]ResourceSkuZoneDetails `json:"zoneDetails,omitempty"` 11669 // ExtendedLocations - READ-ONLY; The names of extended locations. 11670 ExtendedLocations *[]string `json:"extendedLocations,omitempty"` 11671 // Type - READ-ONLY; The type of the extended location. Possible values include: 'ExtendedLocationTypeEdgeZone' 11672 Type ExtendedLocationType `json:"type,omitempty"` 11673} 11674 11675// MarshalJSON is the custom marshaler for ResourceSkuLocationInfo. 11676func (rsli ResourceSkuLocationInfo) MarshalJSON() ([]byte, error) { 11677 objectMap := make(map[string]interface{}) 11678 return json.Marshal(objectMap) 11679} 11680 11681// ResourceSkuRestrictionInfo describes an available Compute SKU Restriction Information. 11682type ResourceSkuRestrictionInfo struct { 11683 // Locations - READ-ONLY; Locations where the SKU is restricted 11684 Locations *[]string `json:"locations,omitempty"` 11685 // Zones - READ-ONLY; List of availability zones where the SKU is restricted. 11686 Zones *[]string `json:"zones,omitempty"` 11687} 11688 11689// MarshalJSON is the custom marshaler for ResourceSkuRestrictionInfo. 11690func (rsri ResourceSkuRestrictionInfo) MarshalJSON() ([]byte, error) { 11691 objectMap := make(map[string]interface{}) 11692 return json.Marshal(objectMap) 11693} 11694 11695// ResourceSkuRestrictions describes scaling information of a SKU. 11696type ResourceSkuRestrictions struct { 11697 // Type - READ-ONLY; The type of restrictions. Possible values include: 'ResourceSkuRestrictionsTypeLocation', 'ResourceSkuRestrictionsTypeZone' 11698 Type ResourceSkuRestrictionsType `json:"type,omitempty"` 11699 // 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. 11700 Values *[]string `json:"values,omitempty"` 11701 // RestrictionInfo - READ-ONLY; The information about the restriction where the SKU cannot be used. 11702 RestrictionInfo *ResourceSkuRestrictionInfo `json:"restrictionInfo,omitempty"` 11703 // ReasonCode - READ-ONLY; The reason for restriction. Possible values include: 'ResourceSkuRestrictionsReasonCodeQuotaID', 'ResourceSkuRestrictionsReasonCodeNotAvailableForSubscription' 11704 ReasonCode ResourceSkuRestrictionsReasonCode `json:"reasonCode,omitempty"` 11705} 11706 11707// MarshalJSON is the custom marshaler for ResourceSkuRestrictions. 11708func (rsr ResourceSkuRestrictions) MarshalJSON() ([]byte, error) { 11709 objectMap := make(map[string]interface{}) 11710 return json.Marshal(objectMap) 11711} 11712 11713// ResourceSkusResult the List Resource Skus operation response. 11714type ResourceSkusResult struct { 11715 autorest.Response `json:"-"` 11716 // Value - The list of skus available for the subscription. 11717 Value *[]ResourceSku `json:"value,omitempty"` 11718 // NextLink - The URI to fetch the next page of Resource Skus. Call ListNext() with this URI to fetch the next page of Resource Skus 11719 NextLink *string `json:"nextLink,omitempty"` 11720} 11721 11722// ResourceSkusResultIterator provides access to a complete listing of ResourceSku values. 11723type ResourceSkusResultIterator struct { 11724 i int 11725 page ResourceSkusResultPage 11726} 11727 11728// NextWithContext advances to the next value. If there was an error making 11729// the request the iterator does not advance and the error is returned. 11730func (iter *ResourceSkusResultIterator) NextWithContext(ctx context.Context) (err error) { 11731 if tracing.IsEnabled() { 11732 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusResultIterator.NextWithContext") 11733 defer func() { 11734 sc := -1 11735 if iter.Response().Response.Response != nil { 11736 sc = iter.Response().Response.Response.StatusCode 11737 } 11738 tracing.EndSpan(ctx, sc, err) 11739 }() 11740 } 11741 iter.i++ 11742 if iter.i < len(iter.page.Values()) { 11743 return nil 11744 } 11745 err = iter.page.NextWithContext(ctx) 11746 if err != nil { 11747 iter.i-- 11748 return err 11749 } 11750 iter.i = 0 11751 return nil 11752} 11753 11754// Next advances to the next value. If there was an error making 11755// the request the iterator does not advance and the error is returned. 11756// Deprecated: Use NextWithContext() instead. 11757func (iter *ResourceSkusResultIterator) Next() error { 11758 return iter.NextWithContext(context.Background()) 11759} 11760 11761// NotDone returns true if the enumeration should be started or is not yet complete. 11762func (iter ResourceSkusResultIterator) NotDone() bool { 11763 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11764} 11765 11766// Response returns the raw server response from the last page request. 11767func (iter ResourceSkusResultIterator) Response() ResourceSkusResult { 11768 return iter.page.Response() 11769} 11770 11771// Value returns the current value or a zero-initialized value if the 11772// iterator has advanced beyond the end of the collection. 11773func (iter ResourceSkusResultIterator) Value() ResourceSku { 11774 if !iter.page.NotDone() { 11775 return ResourceSku{} 11776 } 11777 return iter.page.Values()[iter.i] 11778} 11779 11780// Creates a new instance of the ResourceSkusResultIterator type. 11781func NewResourceSkusResultIterator(page ResourceSkusResultPage) ResourceSkusResultIterator { 11782 return ResourceSkusResultIterator{page: page} 11783} 11784 11785// IsEmpty returns true if the ListResult contains no values. 11786func (rsr ResourceSkusResult) IsEmpty() bool { 11787 return rsr.Value == nil || len(*rsr.Value) == 0 11788} 11789 11790// hasNextLink returns true if the NextLink is not empty. 11791func (rsr ResourceSkusResult) hasNextLink() bool { 11792 return rsr.NextLink != nil && len(*rsr.NextLink) != 0 11793} 11794 11795// resourceSkusResultPreparer prepares a request to retrieve the next set of results. 11796// It returns nil if no more results exist. 11797func (rsr ResourceSkusResult) resourceSkusResultPreparer(ctx context.Context) (*http.Request, error) { 11798 if !rsr.hasNextLink() { 11799 return nil, nil 11800 } 11801 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11802 autorest.AsJSON(), 11803 autorest.AsGet(), 11804 autorest.WithBaseURL(to.String(rsr.NextLink))) 11805} 11806 11807// ResourceSkusResultPage contains a page of ResourceSku values. 11808type ResourceSkusResultPage struct { 11809 fn func(context.Context, ResourceSkusResult) (ResourceSkusResult, error) 11810 rsr ResourceSkusResult 11811} 11812 11813// NextWithContext advances to the next page of values. If there was an error making 11814// the request the page does not advance and the error is returned. 11815func (page *ResourceSkusResultPage) NextWithContext(ctx context.Context) (err error) { 11816 if tracing.IsEnabled() { 11817 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusResultPage.NextWithContext") 11818 defer func() { 11819 sc := -1 11820 if page.Response().Response.Response != nil { 11821 sc = page.Response().Response.Response.StatusCode 11822 } 11823 tracing.EndSpan(ctx, sc, err) 11824 }() 11825 } 11826 for { 11827 next, err := page.fn(ctx, page.rsr) 11828 if err != nil { 11829 return err 11830 } 11831 page.rsr = next 11832 if !next.hasNextLink() || !next.IsEmpty() { 11833 break 11834 } 11835 } 11836 return nil 11837} 11838 11839// Next advances to the next page of values. If there was an error making 11840// the request the page does not advance and the error is returned. 11841// Deprecated: Use NextWithContext() instead. 11842func (page *ResourceSkusResultPage) Next() error { 11843 return page.NextWithContext(context.Background()) 11844} 11845 11846// NotDone returns true if the page enumeration should be started or is not yet complete. 11847func (page ResourceSkusResultPage) NotDone() bool { 11848 return !page.rsr.IsEmpty() 11849} 11850 11851// Response returns the raw server response from the last page request. 11852func (page ResourceSkusResultPage) Response() ResourceSkusResult { 11853 return page.rsr 11854} 11855 11856// Values returns the slice of values for the current page or nil if there are no values. 11857func (page ResourceSkusResultPage) Values() []ResourceSku { 11858 if page.rsr.IsEmpty() { 11859 return nil 11860 } 11861 return *page.rsr.Value 11862} 11863 11864// Creates a new instance of the ResourceSkusResultPage type. 11865func NewResourceSkusResultPage(cur ResourceSkusResult, getNextPage func(context.Context, ResourceSkusResult) (ResourceSkusResult, error)) ResourceSkusResultPage { 11866 return ResourceSkusResultPage{ 11867 fn: getNextPage, 11868 rsr: cur, 11869 } 11870} 11871 11872// ResourceSkuZoneDetails describes The zonal capabilities of a SKU. 11873type ResourceSkuZoneDetails struct { 11874 // Name - READ-ONLY; The set of zones that the SKU is available in with the specified capabilities. 11875 Name *[]string `json:"name,omitempty"` 11876 // Capabilities - READ-ONLY; A list of capabilities that are available for the SKU in the specified list of zones. 11877 Capabilities *[]ResourceSkuCapabilities `json:"capabilities,omitempty"` 11878} 11879 11880// MarshalJSON is the custom marshaler for ResourceSkuZoneDetails. 11881func (rszd ResourceSkuZoneDetails) MarshalJSON() ([]byte, error) { 11882 objectMap := make(map[string]interface{}) 11883 return json.Marshal(objectMap) 11884} 11885 11886// ResourceURIList the List resources which are encrypted with the disk encryption set. 11887type ResourceURIList struct { 11888 autorest.Response `json:"-"` 11889 // Value - A list of IDs or Owner IDs of resources which are encrypted with the disk encryption set. 11890 Value *[]string `json:"value,omitempty"` 11891 // NextLink - The uri to fetch the next page of encrypted resources. Call ListNext() with this to fetch the next page of encrypted resources. 11892 NextLink *string `json:"nextLink,omitempty"` 11893} 11894 11895// ResourceURIListIterator provides access to a complete listing of string values. 11896type ResourceURIListIterator struct { 11897 i int 11898 page ResourceURIListPage 11899} 11900 11901// NextWithContext advances to the next value. If there was an error making 11902// the request the iterator does not advance and the error is returned. 11903func (iter *ResourceURIListIterator) NextWithContext(ctx context.Context) (err error) { 11904 if tracing.IsEnabled() { 11905 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceURIListIterator.NextWithContext") 11906 defer func() { 11907 sc := -1 11908 if iter.Response().Response.Response != nil { 11909 sc = iter.Response().Response.Response.StatusCode 11910 } 11911 tracing.EndSpan(ctx, sc, err) 11912 }() 11913 } 11914 iter.i++ 11915 if iter.i < len(iter.page.Values()) { 11916 return nil 11917 } 11918 err = iter.page.NextWithContext(ctx) 11919 if err != nil { 11920 iter.i-- 11921 return err 11922 } 11923 iter.i = 0 11924 return nil 11925} 11926 11927// Next advances to the next value. If there was an error making 11928// the request the iterator does not advance and the error is returned. 11929// Deprecated: Use NextWithContext() instead. 11930func (iter *ResourceURIListIterator) Next() error { 11931 return iter.NextWithContext(context.Background()) 11932} 11933 11934// NotDone returns true if the enumeration should be started or is not yet complete. 11935func (iter ResourceURIListIterator) NotDone() bool { 11936 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11937} 11938 11939// Response returns the raw server response from the last page request. 11940func (iter ResourceURIListIterator) Response() ResourceURIList { 11941 return iter.page.Response() 11942} 11943 11944// Value returns the current value or a zero-initialized value if the 11945// iterator has advanced beyond the end of the collection. 11946func (iter ResourceURIListIterator) Value() string { 11947 if !iter.page.NotDone() { 11948 return "" 11949 } 11950 return iter.page.Values()[iter.i] 11951} 11952 11953// Creates a new instance of the ResourceURIListIterator type. 11954func NewResourceURIListIterator(page ResourceURIListPage) ResourceURIListIterator { 11955 return ResourceURIListIterator{page: page} 11956} 11957 11958// IsEmpty returns true if the ListResult contains no values. 11959func (rul ResourceURIList) IsEmpty() bool { 11960 return rul.Value == nil || len(*rul.Value) == 0 11961} 11962 11963// hasNextLink returns true if the NextLink is not empty. 11964func (rul ResourceURIList) hasNextLink() bool { 11965 return rul.NextLink != nil && len(*rul.NextLink) != 0 11966} 11967 11968// resourceURIListPreparer prepares a request to retrieve the next set of results. 11969// It returns nil if no more results exist. 11970func (rul ResourceURIList) resourceURIListPreparer(ctx context.Context) (*http.Request, error) { 11971 if !rul.hasNextLink() { 11972 return nil, nil 11973 } 11974 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11975 autorest.AsJSON(), 11976 autorest.AsGet(), 11977 autorest.WithBaseURL(to.String(rul.NextLink))) 11978} 11979 11980// ResourceURIListPage contains a page of string values. 11981type ResourceURIListPage struct { 11982 fn func(context.Context, ResourceURIList) (ResourceURIList, error) 11983 rul ResourceURIList 11984} 11985 11986// NextWithContext advances to the next page of values. If there was an error making 11987// the request the page does not advance and the error is returned. 11988func (page *ResourceURIListPage) NextWithContext(ctx context.Context) (err error) { 11989 if tracing.IsEnabled() { 11990 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceURIListPage.NextWithContext") 11991 defer func() { 11992 sc := -1 11993 if page.Response().Response.Response != nil { 11994 sc = page.Response().Response.Response.StatusCode 11995 } 11996 tracing.EndSpan(ctx, sc, err) 11997 }() 11998 } 11999 for { 12000 next, err := page.fn(ctx, page.rul) 12001 if err != nil { 12002 return err 12003 } 12004 page.rul = next 12005 if !next.hasNextLink() || !next.IsEmpty() { 12006 break 12007 } 12008 } 12009 return nil 12010} 12011 12012// Next advances to the next page of values. If there was an error making 12013// the request the page does not advance and the error is returned. 12014// Deprecated: Use NextWithContext() instead. 12015func (page *ResourceURIListPage) Next() error { 12016 return page.NextWithContext(context.Background()) 12017} 12018 12019// NotDone returns true if the page enumeration should be started or is not yet complete. 12020func (page ResourceURIListPage) NotDone() bool { 12021 return !page.rul.IsEmpty() 12022} 12023 12024// Response returns the raw server response from the last page request. 12025func (page ResourceURIListPage) Response() ResourceURIList { 12026 return page.rul 12027} 12028 12029// Values returns the slice of values for the current page or nil if there are no values. 12030func (page ResourceURIListPage) Values() []string { 12031 if page.rul.IsEmpty() { 12032 return nil 12033 } 12034 return *page.rul.Value 12035} 12036 12037// Creates a new instance of the ResourceURIListPage type. 12038func NewResourceURIListPage(cur ResourceURIList, getNextPage func(context.Context, ResourceURIList) (ResourceURIList, error)) ResourceURIListPage { 12039 return ResourceURIListPage{ 12040 fn: getNextPage, 12041 rul: cur, 12042 } 12043} 12044 12045// RestorePoint restore Point details. 12046type RestorePoint struct { 12047 autorest.Response `json:"-"` 12048 *RestorePointProperties `json:"properties,omitempty"` 12049 // ID - READ-ONLY; Resource Id 12050 ID *string `json:"id,omitempty"` 12051 // Name - READ-ONLY; Resource name 12052 Name *string `json:"name,omitempty"` 12053 // Type - READ-ONLY; Resource type 12054 Type *string `json:"type,omitempty"` 12055} 12056 12057// MarshalJSON is the custom marshaler for RestorePoint. 12058func (rp RestorePoint) MarshalJSON() ([]byte, error) { 12059 objectMap := make(map[string]interface{}) 12060 if rp.RestorePointProperties != nil { 12061 objectMap["properties"] = rp.RestorePointProperties 12062 } 12063 return json.Marshal(objectMap) 12064} 12065 12066// UnmarshalJSON is the custom unmarshaler for RestorePoint struct. 12067func (rp *RestorePoint) UnmarshalJSON(body []byte) error { 12068 var m map[string]*json.RawMessage 12069 err := json.Unmarshal(body, &m) 12070 if err != nil { 12071 return err 12072 } 12073 for k, v := range m { 12074 switch k { 12075 case "properties": 12076 if v != nil { 12077 var restorePointProperties RestorePointProperties 12078 err = json.Unmarshal(*v, &restorePointProperties) 12079 if err != nil { 12080 return err 12081 } 12082 rp.RestorePointProperties = &restorePointProperties 12083 } 12084 case "id": 12085 if v != nil { 12086 var ID string 12087 err = json.Unmarshal(*v, &ID) 12088 if err != nil { 12089 return err 12090 } 12091 rp.ID = &ID 12092 } 12093 case "name": 12094 if v != nil { 12095 var name string 12096 err = json.Unmarshal(*v, &name) 12097 if err != nil { 12098 return err 12099 } 12100 rp.Name = &name 12101 } 12102 case "type": 12103 if v != nil { 12104 var typeVar string 12105 err = json.Unmarshal(*v, &typeVar) 12106 if err != nil { 12107 return err 12108 } 12109 rp.Type = &typeVar 12110 } 12111 } 12112 } 12113 12114 return nil 12115} 12116 12117// RestorePointCollection create or update Restore Point collection parameters. 12118type RestorePointCollection struct { 12119 autorest.Response `json:"-"` 12120 *RestorePointCollectionProperties `json:"properties,omitempty"` 12121 // ID - READ-ONLY; Resource Id 12122 ID *string `json:"id,omitempty"` 12123 // Name - READ-ONLY; Resource name 12124 Name *string `json:"name,omitempty"` 12125 // Type - READ-ONLY; Resource type 12126 Type *string `json:"type,omitempty"` 12127 // Location - Resource location 12128 Location *string `json:"location,omitempty"` 12129 // Tags - Resource tags 12130 Tags map[string]*string `json:"tags"` 12131} 12132 12133// MarshalJSON is the custom marshaler for RestorePointCollection. 12134func (RPCVar RestorePointCollection) MarshalJSON() ([]byte, error) { 12135 objectMap := make(map[string]interface{}) 12136 if RPCVar.RestorePointCollectionProperties != nil { 12137 objectMap["properties"] = RPCVar.RestorePointCollectionProperties 12138 } 12139 if RPCVar.Location != nil { 12140 objectMap["location"] = RPCVar.Location 12141 } 12142 if RPCVar.Tags != nil { 12143 objectMap["tags"] = RPCVar.Tags 12144 } 12145 return json.Marshal(objectMap) 12146} 12147 12148// UnmarshalJSON is the custom unmarshaler for RestorePointCollection struct. 12149func (RPCVar *RestorePointCollection) UnmarshalJSON(body []byte) error { 12150 var m map[string]*json.RawMessage 12151 err := json.Unmarshal(body, &m) 12152 if err != nil { 12153 return err 12154 } 12155 for k, v := range m { 12156 switch k { 12157 case "properties": 12158 if v != nil { 12159 var restorePointCollectionProperties RestorePointCollectionProperties 12160 err = json.Unmarshal(*v, &restorePointCollectionProperties) 12161 if err != nil { 12162 return err 12163 } 12164 RPCVar.RestorePointCollectionProperties = &restorePointCollectionProperties 12165 } 12166 case "id": 12167 if v != nil { 12168 var ID string 12169 err = json.Unmarshal(*v, &ID) 12170 if err != nil { 12171 return err 12172 } 12173 RPCVar.ID = &ID 12174 } 12175 case "name": 12176 if v != nil { 12177 var name string 12178 err = json.Unmarshal(*v, &name) 12179 if err != nil { 12180 return err 12181 } 12182 RPCVar.Name = &name 12183 } 12184 case "type": 12185 if v != nil { 12186 var typeVar string 12187 err = json.Unmarshal(*v, &typeVar) 12188 if err != nil { 12189 return err 12190 } 12191 RPCVar.Type = &typeVar 12192 } 12193 case "location": 12194 if v != nil { 12195 var location string 12196 err = json.Unmarshal(*v, &location) 12197 if err != nil { 12198 return err 12199 } 12200 RPCVar.Location = &location 12201 } 12202 case "tags": 12203 if v != nil { 12204 var tags map[string]*string 12205 err = json.Unmarshal(*v, &tags) 12206 if err != nil { 12207 return err 12208 } 12209 RPCVar.Tags = tags 12210 } 12211 } 12212 } 12213 12214 return nil 12215} 12216 12217// RestorePointCollectionListResult the List restore point collection operation response. 12218type RestorePointCollectionListResult struct { 12219 autorest.Response `json:"-"` 12220 // Value - Gets the list of restore point collections. 12221 Value *[]RestorePointCollection `json:"value,omitempty"` 12222 // NextLink - The uri to fetch the next page of RestorePointCollections. Call ListNext() with this to fetch the next page of RestorePointCollections 12223 NextLink *string `json:"nextLink,omitempty"` 12224} 12225 12226// RestorePointCollectionListResultIterator provides access to a complete listing of RestorePointCollection 12227// values. 12228type RestorePointCollectionListResultIterator struct { 12229 i int 12230 page RestorePointCollectionListResultPage 12231} 12232 12233// NextWithContext advances to the next value. If there was an error making 12234// the request the iterator does not advance and the error is returned. 12235func (iter *RestorePointCollectionListResultIterator) NextWithContext(ctx context.Context) (err error) { 12236 if tracing.IsEnabled() { 12237 ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointCollectionListResultIterator.NextWithContext") 12238 defer func() { 12239 sc := -1 12240 if iter.Response().Response.Response != nil { 12241 sc = iter.Response().Response.Response.StatusCode 12242 } 12243 tracing.EndSpan(ctx, sc, err) 12244 }() 12245 } 12246 iter.i++ 12247 if iter.i < len(iter.page.Values()) { 12248 return nil 12249 } 12250 err = iter.page.NextWithContext(ctx) 12251 if err != nil { 12252 iter.i-- 12253 return err 12254 } 12255 iter.i = 0 12256 return nil 12257} 12258 12259// Next advances to the next value. If there was an error making 12260// the request the iterator does not advance and the error is returned. 12261// Deprecated: Use NextWithContext() instead. 12262func (iter *RestorePointCollectionListResultIterator) Next() error { 12263 return iter.NextWithContext(context.Background()) 12264} 12265 12266// NotDone returns true if the enumeration should be started or is not yet complete. 12267func (iter RestorePointCollectionListResultIterator) NotDone() bool { 12268 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 12269} 12270 12271// Response returns the raw server response from the last page request. 12272func (iter RestorePointCollectionListResultIterator) Response() RestorePointCollectionListResult { 12273 return iter.page.Response() 12274} 12275 12276// Value returns the current value or a zero-initialized value if the 12277// iterator has advanced beyond the end of the collection. 12278func (iter RestorePointCollectionListResultIterator) Value() RestorePointCollection { 12279 if !iter.page.NotDone() { 12280 return RestorePointCollection{} 12281 } 12282 return iter.page.Values()[iter.i] 12283} 12284 12285// Creates a new instance of the RestorePointCollectionListResultIterator type. 12286func NewRestorePointCollectionListResultIterator(page RestorePointCollectionListResultPage) RestorePointCollectionListResultIterator { 12287 return RestorePointCollectionListResultIterator{page: page} 12288} 12289 12290// IsEmpty returns true if the ListResult contains no values. 12291func (rpclr RestorePointCollectionListResult) IsEmpty() bool { 12292 return rpclr.Value == nil || len(*rpclr.Value) == 0 12293} 12294 12295// hasNextLink returns true if the NextLink is not empty. 12296func (rpclr RestorePointCollectionListResult) hasNextLink() bool { 12297 return rpclr.NextLink != nil && len(*rpclr.NextLink) != 0 12298} 12299 12300// restorePointCollectionListResultPreparer prepares a request to retrieve the next set of results. 12301// It returns nil if no more results exist. 12302func (rpclr RestorePointCollectionListResult) restorePointCollectionListResultPreparer(ctx context.Context) (*http.Request, error) { 12303 if !rpclr.hasNextLink() { 12304 return nil, nil 12305 } 12306 return autorest.Prepare((&http.Request{}).WithContext(ctx), 12307 autorest.AsJSON(), 12308 autorest.AsGet(), 12309 autorest.WithBaseURL(to.String(rpclr.NextLink))) 12310} 12311 12312// RestorePointCollectionListResultPage contains a page of RestorePointCollection values. 12313type RestorePointCollectionListResultPage struct { 12314 fn func(context.Context, RestorePointCollectionListResult) (RestorePointCollectionListResult, error) 12315 rpclr RestorePointCollectionListResult 12316} 12317 12318// NextWithContext advances to the next page of values. If there was an error making 12319// the request the page does not advance and the error is returned. 12320func (page *RestorePointCollectionListResultPage) NextWithContext(ctx context.Context) (err error) { 12321 if tracing.IsEnabled() { 12322 ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointCollectionListResultPage.NextWithContext") 12323 defer func() { 12324 sc := -1 12325 if page.Response().Response.Response != nil { 12326 sc = page.Response().Response.Response.StatusCode 12327 } 12328 tracing.EndSpan(ctx, sc, err) 12329 }() 12330 } 12331 for { 12332 next, err := page.fn(ctx, page.rpclr) 12333 if err != nil { 12334 return err 12335 } 12336 page.rpclr = next 12337 if !next.hasNextLink() || !next.IsEmpty() { 12338 break 12339 } 12340 } 12341 return nil 12342} 12343 12344// Next advances to the next page of values. If there was an error making 12345// the request the page does not advance and the error is returned. 12346// Deprecated: Use NextWithContext() instead. 12347func (page *RestorePointCollectionListResultPage) Next() error { 12348 return page.NextWithContext(context.Background()) 12349} 12350 12351// NotDone returns true if the page enumeration should be started or is not yet complete. 12352func (page RestorePointCollectionListResultPage) NotDone() bool { 12353 return !page.rpclr.IsEmpty() 12354} 12355 12356// Response returns the raw server response from the last page request. 12357func (page RestorePointCollectionListResultPage) Response() RestorePointCollectionListResult { 12358 return page.rpclr 12359} 12360 12361// Values returns the slice of values for the current page or nil if there are no values. 12362func (page RestorePointCollectionListResultPage) Values() []RestorePointCollection { 12363 if page.rpclr.IsEmpty() { 12364 return nil 12365 } 12366 return *page.rpclr.Value 12367} 12368 12369// Creates a new instance of the RestorePointCollectionListResultPage type. 12370func NewRestorePointCollectionListResultPage(cur RestorePointCollectionListResult, getNextPage func(context.Context, RestorePointCollectionListResult) (RestorePointCollectionListResult, error)) RestorePointCollectionListResultPage { 12371 return RestorePointCollectionListResultPage{ 12372 fn: getNextPage, 12373 rpclr: cur, 12374 } 12375} 12376 12377// RestorePointCollectionProperties the restore point collection properties. 12378type RestorePointCollectionProperties struct { 12379 Source *RestorePointCollectionSourceProperties `json:"source,omitempty"` 12380 // ProvisioningState - READ-ONLY; The provisioning state of the restore point collection. 12381 ProvisioningState *string `json:"provisioningState,omitempty"` 12382 // RestorePointCollectionID - READ-ONLY; The unique id of the restore point collection. 12383 RestorePointCollectionID *string `json:"restorePointCollectionId,omitempty"` 12384 // RestorePoints - READ-ONLY; A list containing all restore points created under this restore point collection. 12385 RestorePoints *[]RestorePoint `json:"restorePoints,omitempty"` 12386} 12387 12388// MarshalJSON is the custom marshaler for RestorePointCollectionProperties. 12389func (rpcp RestorePointCollectionProperties) MarshalJSON() ([]byte, error) { 12390 objectMap := make(map[string]interface{}) 12391 if rpcp.Source != nil { 12392 objectMap["source"] = rpcp.Source 12393 } 12394 return json.Marshal(objectMap) 12395} 12396 12397// RestorePointCollectionsDeleteFuture an abstraction for monitoring and retrieving the results of a 12398// long-running operation. 12399type RestorePointCollectionsDeleteFuture struct { 12400 azure.FutureAPI 12401 // Result returns the result of the asynchronous operation. 12402 // If the operation has not completed it will return an error. 12403 Result func(RestorePointCollectionsClient) (autorest.Response, error) 12404} 12405 12406// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12407func (future *RestorePointCollectionsDeleteFuture) UnmarshalJSON(body []byte) error { 12408 var azFuture azure.Future 12409 if err := json.Unmarshal(body, &azFuture); err != nil { 12410 return err 12411 } 12412 future.FutureAPI = &azFuture 12413 future.Result = future.result 12414 return nil 12415} 12416 12417// result is the default implementation for RestorePointCollectionsDeleteFuture.Result. 12418func (future *RestorePointCollectionsDeleteFuture) result(client RestorePointCollectionsClient) (ar autorest.Response, err error) { 12419 var done bool 12420 done, err = future.DoneWithContext(context.Background(), client) 12421 if err != nil { 12422 err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsDeleteFuture", "Result", future.Response(), "Polling failure") 12423 return 12424 } 12425 if !done { 12426 ar.Response = future.Response() 12427 err = azure.NewAsyncOpIncompleteError("compute.RestorePointCollectionsDeleteFuture") 12428 return 12429 } 12430 ar.Response = future.Response() 12431 return 12432} 12433 12434// RestorePointCollectionSourceProperties the properties of the source resource that this restore point 12435// collection is created from. 12436type RestorePointCollectionSourceProperties struct { 12437 // Location - READ-ONLY; Location of the source resource used to create this restore point collection. 12438 Location *string `json:"location,omitempty"` 12439 // ID - Resource Id of the source resource used to create this restore point collection 12440 ID *string `json:"id,omitempty"` 12441} 12442 12443// MarshalJSON is the custom marshaler for RestorePointCollectionSourceProperties. 12444func (rpcsp RestorePointCollectionSourceProperties) MarshalJSON() ([]byte, error) { 12445 objectMap := make(map[string]interface{}) 12446 if rpcsp.ID != nil { 12447 objectMap["id"] = rpcsp.ID 12448 } 12449 return json.Marshal(objectMap) 12450} 12451 12452// RestorePointCollectionUpdate update Restore Point collection parameters. 12453type RestorePointCollectionUpdate struct { 12454 *RestorePointCollectionProperties `json:"properties,omitempty"` 12455 // Tags - Resource tags 12456 Tags map[string]*string `json:"tags"` 12457} 12458 12459// MarshalJSON is the custom marshaler for RestorePointCollectionUpdate. 12460func (rpcu RestorePointCollectionUpdate) MarshalJSON() ([]byte, error) { 12461 objectMap := make(map[string]interface{}) 12462 if rpcu.RestorePointCollectionProperties != nil { 12463 objectMap["properties"] = rpcu.RestorePointCollectionProperties 12464 } 12465 if rpcu.Tags != nil { 12466 objectMap["tags"] = rpcu.Tags 12467 } 12468 return json.Marshal(objectMap) 12469} 12470 12471// UnmarshalJSON is the custom unmarshaler for RestorePointCollectionUpdate struct. 12472func (rpcu *RestorePointCollectionUpdate) UnmarshalJSON(body []byte) error { 12473 var m map[string]*json.RawMessage 12474 err := json.Unmarshal(body, &m) 12475 if err != nil { 12476 return err 12477 } 12478 for k, v := range m { 12479 switch k { 12480 case "properties": 12481 if v != nil { 12482 var restorePointCollectionProperties RestorePointCollectionProperties 12483 err = json.Unmarshal(*v, &restorePointCollectionProperties) 12484 if err != nil { 12485 return err 12486 } 12487 rpcu.RestorePointCollectionProperties = &restorePointCollectionProperties 12488 } 12489 case "tags": 12490 if v != nil { 12491 var tags map[string]*string 12492 err = json.Unmarshal(*v, &tags) 12493 if err != nil { 12494 return err 12495 } 12496 rpcu.Tags = tags 12497 } 12498 } 12499 } 12500 12501 return nil 12502} 12503 12504// RestorePointProperties the restore point properties. 12505type RestorePointProperties struct { 12506 // 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. 12507 ExcludeDisks *[]APIEntityReference `json:"excludeDisks,omitempty"` 12508 // SourceMetadata - READ-ONLY; Gets the details of the VM captured at the time of the restore point creation. 12509 SourceMetadata *RestorePointSourceMetadata `json:"sourceMetadata,omitempty"` 12510 // ProvisioningState - READ-ONLY; Gets the provisioning state of the restore point. 12511 ProvisioningState *string `json:"provisioningState,omitempty"` 12512 // 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' 12513 ConsistencyMode ConsistencyModeTypes `json:"consistencyMode,omitempty"` 12514 // ProvisioningDetails - READ-ONLY; Gets the provisioning details set by the server during Create restore point operation. 12515 ProvisioningDetails *RestorePointProvisioningDetails `json:"provisioningDetails,omitempty"` 12516} 12517 12518// MarshalJSON is the custom marshaler for RestorePointProperties. 12519func (rpp RestorePointProperties) MarshalJSON() ([]byte, error) { 12520 objectMap := make(map[string]interface{}) 12521 if rpp.ExcludeDisks != nil { 12522 objectMap["excludeDisks"] = rpp.ExcludeDisks 12523 } 12524 return json.Marshal(objectMap) 12525} 12526 12527// RestorePointProvisioningDetails restore Point Provisioning details. 12528type RestorePointProvisioningDetails struct { 12529 // CreationTime - Gets the creation time of the restore point. 12530 CreationTime *date.Time `json:"creationTime,omitempty"` 12531 // TotalUsedSizeInBytes - Gets the total size of the data in all the disks which are part of the restore point. 12532 TotalUsedSizeInBytes *int64 `json:"totalUsedSizeInBytes,omitempty"` 12533 // StatusCode - Gets the status of the Create restore point operation. 12534 StatusCode *int32 `json:"statusCode,omitempty"` 12535 // StatusMessage - Gets the status message of the Create restore point operation. 12536 StatusMessage *string `json:"statusMessage,omitempty"` 12537} 12538 12539// RestorePointsCreateFuture an abstraction for monitoring and retrieving the results of a long-running 12540// operation. 12541type RestorePointsCreateFuture struct { 12542 azure.FutureAPI 12543 // Result returns the result of the asynchronous operation. 12544 // If the operation has not completed it will return an error. 12545 Result func(RestorePointsClient) (RestorePoint, error) 12546} 12547 12548// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12549func (future *RestorePointsCreateFuture) UnmarshalJSON(body []byte) error { 12550 var azFuture azure.Future 12551 if err := json.Unmarshal(body, &azFuture); err != nil { 12552 return err 12553 } 12554 future.FutureAPI = &azFuture 12555 future.Result = future.result 12556 return nil 12557} 12558 12559// result is the default implementation for RestorePointsCreateFuture.Result. 12560func (future *RestorePointsCreateFuture) result(client RestorePointsClient) (rp RestorePoint, err error) { 12561 var done bool 12562 done, err = future.DoneWithContext(context.Background(), client) 12563 if err != nil { 12564 err = autorest.NewErrorWithError(err, "compute.RestorePointsCreateFuture", "Result", future.Response(), "Polling failure") 12565 return 12566 } 12567 if !done { 12568 rp.Response.Response = future.Response() 12569 err = azure.NewAsyncOpIncompleteError("compute.RestorePointsCreateFuture") 12570 return 12571 } 12572 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 12573 if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { 12574 rp, err = client.CreateResponder(rp.Response.Response) 12575 if err != nil { 12576 err = autorest.NewErrorWithError(err, "compute.RestorePointsCreateFuture", "Result", rp.Response.Response, "Failure responding to request") 12577 } 12578 } 12579 return 12580} 12581 12582// RestorePointsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 12583// operation. 12584type RestorePointsDeleteFuture struct { 12585 azure.FutureAPI 12586 // Result returns the result of the asynchronous operation. 12587 // If the operation has not completed it will return an error. 12588 Result func(RestorePointsClient) (autorest.Response, error) 12589} 12590 12591// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12592func (future *RestorePointsDeleteFuture) UnmarshalJSON(body []byte) error { 12593 var azFuture azure.Future 12594 if err := json.Unmarshal(body, &azFuture); err != nil { 12595 return err 12596 } 12597 future.FutureAPI = &azFuture 12598 future.Result = future.result 12599 return nil 12600} 12601 12602// result is the default implementation for RestorePointsDeleteFuture.Result. 12603func (future *RestorePointsDeleteFuture) result(client RestorePointsClient) (ar autorest.Response, err error) { 12604 var done bool 12605 done, err = future.DoneWithContext(context.Background(), client) 12606 if err != nil { 12607 err = autorest.NewErrorWithError(err, "compute.RestorePointsDeleteFuture", "Result", future.Response(), "Polling failure") 12608 return 12609 } 12610 if !done { 12611 ar.Response = future.Response() 12612 err = azure.NewAsyncOpIncompleteError("compute.RestorePointsDeleteFuture") 12613 return 12614 } 12615 ar.Response = future.Response() 12616 return 12617} 12618 12619// RestorePointSourceMetadata describes the properties of the Virtual Machine for which the restore point 12620// was created. The properties provided are a subset and the snapshot of the overall Virtual Machine 12621// properties captured at the time of the restore point creation. 12622type RestorePointSourceMetadata struct { 12623 // HardwareProfile - Gets the hardware profile. 12624 HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` 12625 // StorageProfile - Gets the storage profile. 12626 StorageProfile *RestorePointSourceVMStorageProfile `json:"storageProfile,omitempty"` 12627 // OsProfile - Gets the OS profile. 12628 OsProfile *OSProfile `json:"osProfile,omitempty"` 12629 // DiagnosticsProfile - Gets the diagnostics profile. 12630 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 12631 // LicenseType - Gets the license type, which is for bring your own license scenario. 12632 LicenseType *string `json:"licenseType,omitempty"` 12633 // VMID - Gets the virtual machine unique id. 12634 VMID *string `json:"vmId,omitempty"` 12635 // SecurityProfile - Gets the security profile. 12636 SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` 12637 // Location - Location of the VM from which the restore point was created. 12638 Location *string `json:"location,omitempty"` 12639} 12640 12641// RestorePointSourceVMDataDisk describes a data disk. 12642type RestorePointSourceVMDataDisk struct { 12643 // Lun - Gets the logical unit number. 12644 Lun *int32 `json:"lun,omitempty"` 12645 // Name - Gets the disk name. 12646 Name *string `json:"name,omitempty"` 12647 // Caching - Gets the caching type. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' 12648 Caching CachingTypes `json:"caching,omitempty"` 12649 // DiskSizeGB - Gets the initial disk size in GB for blank data disks, and the new desired size for existing OS and Data disks. 12650 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 12651 // ManagedDisk - Gets the managed disk details 12652 ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` 12653 // DiskRestorePoint - Gets the disk restore point Id. 12654 DiskRestorePoint *APIEntityReference `json:"diskRestorePoint,omitempty"` 12655} 12656 12657// RestorePointSourceVMOSDisk describes an Operating System disk. 12658type RestorePointSourceVMOSDisk struct { 12659 // OsType - Gets the Operating System type. Possible values include: 'OperatingSystemTypeWindows', 'OperatingSystemTypeLinux' 12660 OsType OperatingSystemType `json:"osType,omitempty"` 12661 // EncryptionSettings - Gets the disk encryption settings. 12662 EncryptionSettings *DiskEncryptionSettings `json:"encryptionSettings,omitempty"` 12663 // Name - Gets the disk name. 12664 Name *string `json:"name,omitempty"` 12665 // Caching - Gets the caching type. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' 12666 Caching CachingTypes `json:"caching,omitempty"` 12667 // DiskSizeGB - Gets the disk size in GB. 12668 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 12669 // ManagedDisk - Gets the managed disk details 12670 ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` 12671 // DiskRestorePoint - Gets the disk restore point Id. 12672 DiskRestorePoint *APIEntityReference `json:"diskRestorePoint,omitempty"` 12673} 12674 12675// RestorePointSourceVMStorageProfile describes the storage profile. 12676type RestorePointSourceVMStorageProfile struct { 12677 // OsDisk - Gets the OS disk of the VM captured at the time of the restore point creation. 12678 OsDisk *RestorePointSourceVMOSDisk `json:"osDisk,omitempty"` 12679 // DataDisks - Gets the data disks of the VM captured at the time of the restore point creation. 12680 DataDisks *[]RestorePointSourceVMDataDisk `json:"dataDisks,omitempty"` 12681} 12682 12683// RetrieveBootDiagnosticsDataResult the SAS URIs of the console screenshot and serial log blobs. 12684type RetrieveBootDiagnosticsDataResult struct { 12685 autorest.Response `json:"-"` 12686 // ConsoleScreenshotBlobURI - READ-ONLY; The console screenshot blob URI 12687 ConsoleScreenshotBlobURI *string `json:"consoleScreenshotBlobUri,omitempty"` 12688 // SerialConsoleLogBlobURI - READ-ONLY; The serial console log blob URI. 12689 SerialConsoleLogBlobURI *string `json:"serialConsoleLogBlobUri,omitempty"` 12690} 12691 12692// MarshalJSON is the custom marshaler for RetrieveBootDiagnosticsDataResult. 12693func (rbddr RetrieveBootDiagnosticsDataResult) MarshalJSON() ([]byte, error) { 12694 objectMap := make(map[string]interface{}) 12695 return json.Marshal(objectMap) 12696} 12697 12698// RoleInstance ... 12699type RoleInstance struct { 12700 autorest.Response `json:"-"` 12701 // ID - READ-ONLY; Resource Id 12702 ID *string `json:"id,omitempty"` 12703 // Name - READ-ONLY; Resource Name. 12704 Name *string `json:"name,omitempty"` 12705 // Type - READ-ONLY; Resource Type. 12706 Type *string `json:"type,omitempty"` 12707 // Location - READ-ONLY; Resource Location. 12708 Location *string `json:"location,omitempty"` 12709 // Tags - READ-ONLY; Resource tags. 12710 Tags map[string]*string `json:"tags"` 12711 Sku *InstanceSku `json:"sku,omitempty"` 12712 Properties *RoleInstanceProperties `json:"properties,omitempty"` 12713} 12714 12715// MarshalJSON is the custom marshaler for RoleInstance. 12716func (ri RoleInstance) MarshalJSON() ([]byte, error) { 12717 objectMap := make(map[string]interface{}) 12718 if ri.Sku != nil { 12719 objectMap["sku"] = ri.Sku 12720 } 12721 if ri.Properties != nil { 12722 objectMap["properties"] = ri.Properties 12723 } 12724 return json.Marshal(objectMap) 12725} 12726 12727// RoleInstanceInstanceView the instance view of the role instance. 12728type RoleInstanceInstanceView struct { 12729 autorest.Response `json:"-"` 12730 // PlatformUpdateDomain - READ-ONLY; The Update Domain. 12731 PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` 12732 // PlatformFaultDomain - READ-ONLY; The Fault Domain. 12733 PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` 12734 // 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. 12735 PrivateID *string `json:"privateId,omitempty"` 12736 // Statuses - READ-ONLY 12737 Statuses *[]ResourceInstanceViewStatus `json:"statuses,omitempty"` 12738} 12739 12740// MarshalJSON is the custom marshaler for RoleInstanceInstanceView. 12741func (riiv RoleInstanceInstanceView) MarshalJSON() ([]byte, error) { 12742 objectMap := make(map[string]interface{}) 12743 return json.Marshal(objectMap) 12744} 12745 12746// RoleInstanceListResult ... 12747type RoleInstanceListResult struct { 12748 autorest.Response `json:"-"` 12749 Value *[]RoleInstance `json:"value,omitempty"` 12750 NextLink *string `json:"nextLink,omitempty"` 12751} 12752 12753// RoleInstanceListResultIterator provides access to a complete listing of RoleInstance values. 12754type RoleInstanceListResultIterator struct { 12755 i int 12756 page RoleInstanceListResultPage 12757} 12758 12759// NextWithContext advances to the next value. If there was an error making 12760// the request the iterator does not advance and the error is returned. 12761func (iter *RoleInstanceListResultIterator) NextWithContext(ctx context.Context) (err error) { 12762 if tracing.IsEnabled() { 12763 ctx = tracing.StartSpan(ctx, fqdn+"/RoleInstanceListResultIterator.NextWithContext") 12764 defer func() { 12765 sc := -1 12766 if iter.Response().Response.Response != nil { 12767 sc = iter.Response().Response.Response.StatusCode 12768 } 12769 tracing.EndSpan(ctx, sc, err) 12770 }() 12771 } 12772 iter.i++ 12773 if iter.i < len(iter.page.Values()) { 12774 return nil 12775 } 12776 err = iter.page.NextWithContext(ctx) 12777 if err != nil { 12778 iter.i-- 12779 return err 12780 } 12781 iter.i = 0 12782 return nil 12783} 12784 12785// Next advances to the next value. If there was an error making 12786// the request the iterator does not advance and the error is returned. 12787// Deprecated: Use NextWithContext() instead. 12788func (iter *RoleInstanceListResultIterator) Next() error { 12789 return iter.NextWithContext(context.Background()) 12790} 12791 12792// NotDone returns true if the enumeration should be started or is not yet complete. 12793func (iter RoleInstanceListResultIterator) NotDone() bool { 12794 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 12795} 12796 12797// Response returns the raw server response from the last page request. 12798func (iter RoleInstanceListResultIterator) Response() RoleInstanceListResult { 12799 return iter.page.Response() 12800} 12801 12802// Value returns the current value or a zero-initialized value if the 12803// iterator has advanced beyond the end of the collection. 12804func (iter RoleInstanceListResultIterator) Value() RoleInstance { 12805 if !iter.page.NotDone() { 12806 return RoleInstance{} 12807 } 12808 return iter.page.Values()[iter.i] 12809} 12810 12811// Creates a new instance of the RoleInstanceListResultIterator type. 12812func NewRoleInstanceListResultIterator(page RoleInstanceListResultPage) RoleInstanceListResultIterator { 12813 return RoleInstanceListResultIterator{page: page} 12814} 12815 12816// IsEmpty returns true if the ListResult contains no values. 12817func (rilr RoleInstanceListResult) IsEmpty() bool { 12818 return rilr.Value == nil || len(*rilr.Value) == 0 12819} 12820 12821// hasNextLink returns true if the NextLink is not empty. 12822func (rilr RoleInstanceListResult) hasNextLink() bool { 12823 return rilr.NextLink != nil && len(*rilr.NextLink) != 0 12824} 12825 12826// roleInstanceListResultPreparer prepares a request to retrieve the next set of results. 12827// It returns nil if no more results exist. 12828func (rilr RoleInstanceListResult) roleInstanceListResultPreparer(ctx context.Context) (*http.Request, error) { 12829 if !rilr.hasNextLink() { 12830 return nil, nil 12831 } 12832 return autorest.Prepare((&http.Request{}).WithContext(ctx), 12833 autorest.AsJSON(), 12834 autorest.AsGet(), 12835 autorest.WithBaseURL(to.String(rilr.NextLink))) 12836} 12837 12838// RoleInstanceListResultPage contains a page of RoleInstance values. 12839type RoleInstanceListResultPage struct { 12840 fn func(context.Context, RoleInstanceListResult) (RoleInstanceListResult, error) 12841 rilr RoleInstanceListResult 12842} 12843 12844// NextWithContext advances to the next page of values. If there was an error making 12845// the request the page does not advance and the error is returned. 12846func (page *RoleInstanceListResultPage) NextWithContext(ctx context.Context) (err error) { 12847 if tracing.IsEnabled() { 12848 ctx = tracing.StartSpan(ctx, fqdn+"/RoleInstanceListResultPage.NextWithContext") 12849 defer func() { 12850 sc := -1 12851 if page.Response().Response.Response != nil { 12852 sc = page.Response().Response.Response.StatusCode 12853 } 12854 tracing.EndSpan(ctx, sc, err) 12855 }() 12856 } 12857 for { 12858 next, err := page.fn(ctx, page.rilr) 12859 if err != nil { 12860 return err 12861 } 12862 page.rilr = next 12863 if !next.hasNextLink() || !next.IsEmpty() { 12864 break 12865 } 12866 } 12867 return nil 12868} 12869 12870// Next advances to the next page of values. If there was an error making 12871// the request the page does not advance and the error is returned. 12872// Deprecated: Use NextWithContext() instead. 12873func (page *RoleInstanceListResultPage) Next() error { 12874 return page.NextWithContext(context.Background()) 12875} 12876 12877// NotDone returns true if the page enumeration should be started or is not yet complete. 12878func (page RoleInstanceListResultPage) NotDone() bool { 12879 return !page.rilr.IsEmpty() 12880} 12881 12882// Response returns the raw server response from the last page request. 12883func (page RoleInstanceListResultPage) Response() RoleInstanceListResult { 12884 return page.rilr 12885} 12886 12887// Values returns the slice of values for the current page or nil if there are no values. 12888func (page RoleInstanceListResultPage) Values() []RoleInstance { 12889 if page.rilr.IsEmpty() { 12890 return nil 12891 } 12892 return *page.rilr.Value 12893} 12894 12895// Creates a new instance of the RoleInstanceListResultPage type. 12896func NewRoleInstanceListResultPage(cur RoleInstanceListResult, getNextPage func(context.Context, RoleInstanceListResult) (RoleInstanceListResult, error)) RoleInstanceListResultPage { 12897 return RoleInstanceListResultPage{ 12898 fn: getNextPage, 12899 rilr: cur, 12900 } 12901} 12902 12903// RoleInstanceNetworkProfile describes the network profile for the role instance. 12904type RoleInstanceNetworkProfile struct { 12905 // NetworkInterfaces - READ-ONLY; Specifies the list of resource Ids for the network interfaces associated with the role instance. 12906 NetworkInterfaces *[]SubResource `json:"networkInterfaces,omitempty"` 12907} 12908 12909// MarshalJSON is the custom marshaler for RoleInstanceNetworkProfile. 12910func (rinp RoleInstanceNetworkProfile) MarshalJSON() ([]byte, error) { 12911 objectMap := make(map[string]interface{}) 12912 return json.Marshal(objectMap) 12913} 12914 12915// RoleInstanceProperties ... 12916type RoleInstanceProperties struct { 12917 NetworkProfile *RoleInstanceNetworkProfile `json:"networkProfile,omitempty"` 12918 InstanceView *RoleInstanceInstanceView `json:"instanceView,omitempty"` 12919} 12920 12921// RoleInstances specifies a list of role instances from the cloud service. 12922type RoleInstances struct { 12923 // RoleInstances - List of cloud service role instance names. Value of '*' will signify all role instances of the cloud service. 12924 RoleInstances *[]string `json:"roleInstances,omitempty"` 12925} 12926 12927// RollbackStatusInfo information about rollback on failed VM instances after a OS Upgrade operation. 12928type RollbackStatusInfo struct { 12929 // SuccessfullyRolledbackInstanceCount - READ-ONLY; The number of instances which have been successfully rolled back. 12930 SuccessfullyRolledbackInstanceCount *int32 `json:"successfullyRolledbackInstanceCount,omitempty"` 12931 // FailedRolledbackInstanceCount - READ-ONLY; The number of instances which failed to rollback. 12932 FailedRolledbackInstanceCount *int32 `json:"failedRolledbackInstanceCount,omitempty"` 12933 // RollbackError - READ-ONLY; Error details if OS rollback failed. 12934 RollbackError *APIError `json:"rollbackError,omitempty"` 12935} 12936 12937// MarshalJSON is the custom marshaler for RollbackStatusInfo. 12938func (rsi RollbackStatusInfo) MarshalJSON() ([]byte, error) { 12939 objectMap := make(map[string]interface{}) 12940 return json.Marshal(objectMap) 12941} 12942 12943// RollingUpgradePolicy the configuration parameters used while performing a rolling upgrade. 12944type RollingUpgradePolicy struct { 12945 // 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%. 12946 MaxBatchInstancePercent *int32 `json:"maxBatchInstancePercent,omitempty"` 12947 // 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%. 12948 MaxUnhealthyInstancePercent *int32 `json:"maxUnhealthyInstancePercent,omitempty"` 12949 // 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%. 12950 MaxUnhealthyUpgradedInstancePercent *int32 `json:"maxUnhealthyUpgradedInstancePercent,omitempty"` 12951 // 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). 12952 PauseTimeBetweenBatches *string `json:"pauseTimeBetweenBatches,omitempty"` 12953 // EnableCrossZoneUpgrade - Allow VMSS to ignore AZ boundaries when constructing upgrade batches. Take into consideration the Update Domain and maxBatchInstancePercent to determine the batch size. 12954 EnableCrossZoneUpgrade *bool `json:"enableCrossZoneUpgrade,omitempty"` 12955 // PrioritizeUnhealthyInstances - Upgrade all unhealthy instances in a scale set before any healthy instances. 12956 PrioritizeUnhealthyInstances *bool `json:"prioritizeUnhealthyInstances,omitempty"` 12957} 12958 12959// RollingUpgradeProgressInfo information about the number of virtual machine instances in each upgrade 12960// state. 12961type RollingUpgradeProgressInfo struct { 12962 // SuccessfulInstanceCount - READ-ONLY; The number of instances that have been successfully upgraded. 12963 SuccessfulInstanceCount *int32 `json:"successfulInstanceCount,omitempty"` 12964 // FailedInstanceCount - READ-ONLY; The number of instances that have failed to be upgraded successfully. 12965 FailedInstanceCount *int32 `json:"failedInstanceCount,omitempty"` 12966 // InProgressInstanceCount - READ-ONLY; The number of instances that are currently being upgraded. 12967 InProgressInstanceCount *int32 `json:"inProgressInstanceCount,omitempty"` 12968 // PendingInstanceCount - READ-ONLY; The number of instances that have not yet begun to be upgraded. 12969 PendingInstanceCount *int32 `json:"pendingInstanceCount,omitempty"` 12970} 12971 12972// MarshalJSON is the custom marshaler for RollingUpgradeProgressInfo. 12973func (rupi RollingUpgradeProgressInfo) MarshalJSON() ([]byte, error) { 12974 objectMap := make(map[string]interface{}) 12975 return json.Marshal(objectMap) 12976} 12977 12978// RollingUpgradeRunningStatus information about the current running state of the overall upgrade. 12979type RollingUpgradeRunningStatus struct { 12980 // Code - READ-ONLY; Code indicating the current status of the upgrade. Possible values include: 'RollingUpgradeStatusCodeRollingForward', 'RollingUpgradeStatusCodeCancelled', 'RollingUpgradeStatusCodeCompleted', 'RollingUpgradeStatusCodeFaulted' 12981 Code RollingUpgradeStatusCode `json:"code,omitempty"` 12982 // StartTime - READ-ONLY; Start time of the upgrade. 12983 StartTime *date.Time `json:"startTime,omitempty"` 12984 // LastAction - READ-ONLY; The last action performed on the rolling upgrade. Possible values include: 'RollingUpgradeActionTypeStart', 'RollingUpgradeActionTypeCancel' 12985 LastAction RollingUpgradeActionType `json:"lastAction,omitempty"` 12986 // LastActionTime - READ-ONLY; Last action time of the upgrade. 12987 LastActionTime *date.Time `json:"lastActionTime,omitempty"` 12988} 12989 12990// MarshalJSON is the custom marshaler for RollingUpgradeRunningStatus. 12991func (rurs RollingUpgradeRunningStatus) MarshalJSON() ([]byte, error) { 12992 objectMap := make(map[string]interface{}) 12993 return json.Marshal(objectMap) 12994} 12995 12996// RollingUpgradeStatusInfo the status of the latest virtual machine scale set rolling upgrade. 12997type RollingUpgradeStatusInfo struct { 12998 autorest.Response `json:"-"` 12999 *RollingUpgradeStatusInfoProperties `json:"properties,omitempty"` 13000 // ID - READ-ONLY; Resource Id 13001 ID *string `json:"id,omitempty"` 13002 // Name - READ-ONLY; Resource name 13003 Name *string `json:"name,omitempty"` 13004 // Type - READ-ONLY; Resource type 13005 Type *string `json:"type,omitempty"` 13006 // Location - Resource location 13007 Location *string `json:"location,omitempty"` 13008 // Tags - Resource tags 13009 Tags map[string]*string `json:"tags"` 13010} 13011 13012// MarshalJSON is the custom marshaler for RollingUpgradeStatusInfo. 13013func (rusi RollingUpgradeStatusInfo) MarshalJSON() ([]byte, error) { 13014 objectMap := make(map[string]interface{}) 13015 if rusi.RollingUpgradeStatusInfoProperties != nil { 13016 objectMap["properties"] = rusi.RollingUpgradeStatusInfoProperties 13017 } 13018 if rusi.Location != nil { 13019 objectMap["location"] = rusi.Location 13020 } 13021 if rusi.Tags != nil { 13022 objectMap["tags"] = rusi.Tags 13023 } 13024 return json.Marshal(objectMap) 13025} 13026 13027// UnmarshalJSON is the custom unmarshaler for RollingUpgradeStatusInfo struct. 13028func (rusi *RollingUpgradeStatusInfo) UnmarshalJSON(body []byte) error { 13029 var m map[string]*json.RawMessage 13030 err := json.Unmarshal(body, &m) 13031 if err != nil { 13032 return err 13033 } 13034 for k, v := range m { 13035 switch k { 13036 case "properties": 13037 if v != nil { 13038 var rollingUpgradeStatusInfoProperties RollingUpgradeStatusInfoProperties 13039 err = json.Unmarshal(*v, &rollingUpgradeStatusInfoProperties) 13040 if err != nil { 13041 return err 13042 } 13043 rusi.RollingUpgradeStatusInfoProperties = &rollingUpgradeStatusInfoProperties 13044 } 13045 case "id": 13046 if v != nil { 13047 var ID string 13048 err = json.Unmarshal(*v, &ID) 13049 if err != nil { 13050 return err 13051 } 13052 rusi.ID = &ID 13053 } 13054 case "name": 13055 if v != nil { 13056 var name string 13057 err = json.Unmarshal(*v, &name) 13058 if err != nil { 13059 return err 13060 } 13061 rusi.Name = &name 13062 } 13063 case "type": 13064 if v != nil { 13065 var typeVar string 13066 err = json.Unmarshal(*v, &typeVar) 13067 if err != nil { 13068 return err 13069 } 13070 rusi.Type = &typeVar 13071 } 13072 case "location": 13073 if v != nil { 13074 var location string 13075 err = json.Unmarshal(*v, &location) 13076 if err != nil { 13077 return err 13078 } 13079 rusi.Location = &location 13080 } 13081 case "tags": 13082 if v != nil { 13083 var tags map[string]*string 13084 err = json.Unmarshal(*v, &tags) 13085 if err != nil { 13086 return err 13087 } 13088 rusi.Tags = tags 13089 } 13090 } 13091 } 13092 13093 return nil 13094} 13095 13096// RollingUpgradeStatusInfoProperties the status of the latest virtual machine scale set rolling upgrade. 13097type RollingUpgradeStatusInfoProperties struct { 13098 // Policy - READ-ONLY; The rolling upgrade policies applied for this upgrade. 13099 Policy *RollingUpgradePolicy `json:"policy,omitempty"` 13100 // RunningStatus - READ-ONLY; Information about the current running state of the overall upgrade. 13101 RunningStatus *RollingUpgradeRunningStatus `json:"runningStatus,omitempty"` 13102 // Progress - READ-ONLY; Information about the number of virtual machine instances in each upgrade state. 13103 Progress *RollingUpgradeProgressInfo `json:"progress,omitempty"` 13104 // Error - READ-ONLY; Error details for this upgrade, if there are any. 13105 Error *APIError `json:"error,omitempty"` 13106} 13107 13108// MarshalJSON is the custom marshaler for RollingUpgradeStatusInfoProperties. 13109func (rusip RollingUpgradeStatusInfoProperties) MarshalJSON() ([]byte, error) { 13110 objectMap := make(map[string]interface{}) 13111 return json.Marshal(objectMap) 13112} 13113 13114// RunCommandDocument describes the properties of a Run Command. 13115type RunCommandDocument struct { 13116 autorest.Response `json:"-"` 13117 // Script - The script to be executed. 13118 Script *[]string `json:"script,omitempty"` 13119 // Parameters - The parameters used by the script. 13120 Parameters *[]RunCommandParameterDefinition `json:"parameters,omitempty"` 13121 // Schema - The VM run command schema. 13122 Schema *string `json:"$schema,omitempty"` 13123 // ID - The VM run command id. 13124 ID *string `json:"id,omitempty"` 13125 // OsType - The Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' 13126 OsType OperatingSystemTypes `json:"osType,omitempty"` 13127 // Label - The VM run command label. 13128 Label *string `json:"label,omitempty"` 13129 // Description - The VM run command description. 13130 Description *string `json:"description,omitempty"` 13131} 13132 13133// RunCommandDocumentBase describes the properties of a Run Command metadata. 13134type RunCommandDocumentBase struct { 13135 // Schema - The VM run command schema. 13136 Schema *string `json:"$schema,omitempty"` 13137 // ID - The VM run command id. 13138 ID *string `json:"id,omitempty"` 13139 // OsType - The Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' 13140 OsType OperatingSystemTypes `json:"osType,omitempty"` 13141 // Label - The VM run command label. 13142 Label *string `json:"label,omitempty"` 13143 // Description - The VM run command description. 13144 Description *string `json:"description,omitempty"` 13145} 13146 13147// RunCommandInput capture Virtual Machine parameters. 13148type RunCommandInput struct { 13149 // CommandID - The run command id. 13150 CommandID *string `json:"commandId,omitempty"` 13151 // Script - Optional. The script to be executed. When this value is given, the given script will override the default script of the command. 13152 Script *[]string `json:"script,omitempty"` 13153 // Parameters - The run command parameters. 13154 Parameters *[]RunCommandInputParameter `json:"parameters,omitempty"` 13155} 13156 13157// RunCommandInputParameter describes the properties of a run command parameter. 13158type RunCommandInputParameter struct { 13159 // Name - The run command parameter name. 13160 Name *string `json:"name,omitempty"` 13161 // Value - The run command parameter value. 13162 Value *string `json:"value,omitempty"` 13163} 13164 13165// RunCommandListResult the List Virtual Machine operation response. 13166type RunCommandListResult struct { 13167 autorest.Response `json:"-"` 13168 // Value - The list of virtual machine run commands. 13169 Value *[]RunCommandDocumentBase `json:"value,omitempty"` 13170 // NextLink - The uri to fetch the next page of run commands. Call ListNext() with this to fetch the next page of run commands. 13171 NextLink *string `json:"nextLink,omitempty"` 13172} 13173 13174// RunCommandListResultIterator provides access to a complete listing of RunCommandDocumentBase values. 13175type RunCommandListResultIterator struct { 13176 i int 13177 page RunCommandListResultPage 13178} 13179 13180// NextWithContext advances to the next value. If there was an error making 13181// the request the iterator does not advance and the error is returned. 13182func (iter *RunCommandListResultIterator) NextWithContext(ctx context.Context) (err error) { 13183 if tracing.IsEnabled() { 13184 ctx = tracing.StartSpan(ctx, fqdn+"/RunCommandListResultIterator.NextWithContext") 13185 defer func() { 13186 sc := -1 13187 if iter.Response().Response.Response != nil { 13188 sc = iter.Response().Response.Response.StatusCode 13189 } 13190 tracing.EndSpan(ctx, sc, err) 13191 }() 13192 } 13193 iter.i++ 13194 if iter.i < len(iter.page.Values()) { 13195 return nil 13196 } 13197 err = iter.page.NextWithContext(ctx) 13198 if err != nil { 13199 iter.i-- 13200 return err 13201 } 13202 iter.i = 0 13203 return nil 13204} 13205 13206// Next advances to the next value. If there was an error making 13207// the request the iterator does not advance and the error is returned. 13208// Deprecated: Use NextWithContext() instead. 13209func (iter *RunCommandListResultIterator) Next() error { 13210 return iter.NextWithContext(context.Background()) 13211} 13212 13213// NotDone returns true if the enumeration should be started or is not yet complete. 13214func (iter RunCommandListResultIterator) NotDone() bool { 13215 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 13216} 13217 13218// Response returns the raw server response from the last page request. 13219func (iter RunCommandListResultIterator) Response() RunCommandListResult { 13220 return iter.page.Response() 13221} 13222 13223// Value returns the current value or a zero-initialized value if the 13224// iterator has advanced beyond the end of the collection. 13225func (iter RunCommandListResultIterator) Value() RunCommandDocumentBase { 13226 if !iter.page.NotDone() { 13227 return RunCommandDocumentBase{} 13228 } 13229 return iter.page.Values()[iter.i] 13230} 13231 13232// Creates a new instance of the RunCommandListResultIterator type. 13233func NewRunCommandListResultIterator(page RunCommandListResultPage) RunCommandListResultIterator { 13234 return RunCommandListResultIterator{page: page} 13235} 13236 13237// IsEmpty returns true if the ListResult contains no values. 13238func (rclr RunCommandListResult) IsEmpty() bool { 13239 return rclr.Value == nil || len(*rclr.Value) == 0 13240} 13241 13242// hasNextLink returns true if the NextLink is not empty. 13243func (rclr RunCommandListResult) hasNextLink() bool { 13244 return rclr.NextLink != nil && len(*rclr.NextLink) != 0 13245} 13246 13247// runCommandListResultPreparer prepares a request to retrieve the next set of results. 13248// It returns nil if no more results exist. 13249func (rclr RunCommandListResult) runCommandListResultPreparer(ctx context.Context) (*http.Request, error) { 13250 if !rclr.hasNextLink() { 13251 return nil, nil 13252 } 13253 return autorest.Prepare((&http.Request{}).WithContext(ctx), 13254 autorest.AsJSON(), 13255 autorest.AsGet(), 13256 autorest.WithBaseURL(to.String(rclr.NextLink))) 13257} 13258 13259// RunCommandListResultPage contains a page of RunCommandDocumentBase values. 13260type RunCommandListResultPage struct { 13261 fn func(context.Context, RunCommandListResult) (RunCommandListResult, error) 13262 rclr RunCommandListResult 13263} 13264 13265// NextWithContext advances to the next page of values. If there was an error making 13266// the request the page does not advance and the error is returned. 13267func (page *RunCommandListResultPage) NextWithContext(ctx context.Context) (err error) { 13268 if tracing.IsEnabled() { 13269 ctx = tracing.StartSpan(ctx, fqdn+"/RunCommandListResultPage.NextWithContext") 13270 defer func() { 13271 sc := -1 13272 if page.Response().Response.Response != nil { 13273 sc = page.Response().Response.Response.StatusCode 13274 } 13275 tracing.EndSpan(ctx, sc, err) 13276 }() 13277 } 13278 for { 13279 next, err := page.fn(ctx, page.rclr) 13280 if err != nil { 13281 return err 13282 } 13283 page.rclr = next 13284 if !next.hasNextLink() || !next.IsEmpty() { 13285 break 13286 } 13287 } 13288 return nil 13289} 13290 13291// Next advances to the next page of values. If there was an error making 13292// the request the page does not advance and the error is returned. 13293// Deprecated: Use NextWithContext() instead. 13294func (page *RunCommandListResultPage) Next() error { 13295 return page.NextWithContext(context.Background()) 13296} 13297 13298// NotDone returns true if the page enumeration should be started or is not yet complete. 13299func (page RunCommandListResultPage) NotDone() bool { 13300 return !page.rclr.IsEmpty() 13301} 13302 13303// Response returns the raw server response from the last page request. 13304func (page RunCommandListResultPage) Response() RunCommandListResult { 13305 return page.rclr 13306} 13307 13308// Values returns the slice of values for the current page or nil if there are no values. 13309func (page RunCommandListResultPage) Values() []RunCommandDocumentBase { 13310 if page.rclr.IsEmpty() { 13311 return nil 13312 } 13313 return *page.rclr.Value 13314} 13315 13316// Creates a new instance of the RunCommandListResultPage type. 13317func NewRunCommandListResultPage(cur RunCommandListResult, getNextPage func(context.Context, RunCommandListResult) (RunCommandListResult, error)) RunCommandListResultPage { 13318 return RunCommandListResultPage{ 13319 fn: getNextPage, 13320 rclr: cur, 13321 } 13322} 13323 13324// RunCommandParameterDefinition describes the properties of a run command parameter. 13325type RunCommandParameterDefinition struct { 13326 // Name - The run command parameter name. 13327 Name *string `json:"name,omitempty"` 13328 // Type - The run command parameter type. 13329 Type *string `json:"type,omitempty"` 13330 // DefaultValue - The run command parameter default value. 13331 DefaultValue *string `json:"defaultValue,omitempty"` 13332 // Required - The run command parameter required. 13333 Required *bool `json:"required,omitempty"` 13334} 13335 13336// RunCommandResult ... 13337type RunCommandResult struct { 13338 autorest.Response `json:"-"` 13339 // Value - Run command operation response. 13340 Value *[]InstanceViewStatus `json:"value,omitempty"` 13341} 13342 13343// ScaleInPolicy describes a scale-in policy for a virtual machine scale set. 13344type ScaleInPolicy struct { 13345 // 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> 13346 Rules *[]VirtualMachineScaleSetScaleInRules `json:"rules,omitempty"` 13347 // ForceDeletion - This property allows you to specify if virtual machines chosen for removal have to be force deleted when a virtual machine scale set is being scaled-in.(Feature in Preview) 13348 ForceDeletion *bool `json:"forceDeletion,omitempty"` 13349} 13350 13351// ScheduledEventsProfile ... 13352type ScheduledEventsProfile struct { 13353 // TerminateNotificationProfile - Specifies Terminate Scheduled Event related configurations. 13354 TerminateNotificationProfile *TerminateNotificationProfile `json:"terminateNotificationProfile,omitempty"` 13355} 13356 13357// SecurityProfile specifies the Security profile settings for the virtual machine or virtual machine scale 13358// set. 13359type SecurityProfile struct { 13360 // UefiSettings - Specifies the security settings like secure boot and vTPM used while creating the virtual machine. <br><br>Minimum api-version: 2020-12-01 13361 UefiSettings *UefiSettings `json:"uefiSettings,omitempty"` 13362 // 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. 13363 EncryptionAtHost *bool `json:"encryptionAtHost,omitempty"` 13364 // 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' 13365 SecurityType SecurityTypes `json:"securityType,omitempty"` 13366} 13367 13368// SharedGallery specifies information about the Shared Gallery that you want to create or update. 13369type SharedGallery struct { 13370 autorest.Response `json:"-"` 13371 *SharedGalleryIdentifier `json:"identifier,omitempty"` 13372 // Name - READ-ONLY; Resource name 13373 Name *string `json:"name,omitempty"` 13374 // Location - READ-ONLY; Resource location 13375 Location *string `json:"location,omitempty"` 13376} 13377 13378// MarshalJSON is the custom marshaler for SharedGallery. 13379func (sg SharedGallery) MarshalJSON() ([]byte, error) { 13380 objectMap := make(map[string]interface{}) 13381 if sg.SharedGalleryIdentifier != nil { 13382 objectMap["identifier"] = sg.SharedGalleryIdentifier 13383 } 13384 return json.Marshal(objectMap) 13385} 13386 13387// UnmarshalJSON is the custom unmarshaler for SharedGallery struct. 13388func (sg *SharedGallery) UnmarshalJSON(body []byte) error { 13389 var m map[string]*json.RawMessage 13390 err := json.Unmarshal(body, &m) 13391 if err != nil { 13392 return err 13393 } 13394 for k, v := range m { 13395 switch k { 13396 case "identifier": 13397 if v != nil { 13398 var sharedGalleryIdentifier SharedGalleryIdentifier 13399 err = json.Unmarshal(*v, &sharedGalleryIdentifier) 13400 if err != nil { 13401 return err 13402 } 13403 sg.SharedGalleryIdentifier = &sharedGalleryIdentifier 13404 } 13405 case "name": 13406 if v != nil { 13407 var name string 13408 err = json.Unmarshal(*v, &name) 13409 if err != nil { 13410 return err 13411 } 13412 sg.Name = &name 13413 } 13414 case "location": 13415 if v != nil { 13416 var location string 13417 err = json.Unmarshal(*v, &location) 13418 if err != nil { 13419 return err 13420 } 13421 sg.Location = &location 13422 } 13423 } 13424 } 13425 13426 return nil 13427} 13428 13429// SharedGalleryIdentifier the identifier information of shared gallery. 13430type SharedGalleryIdentifier struct { 13431 // UniqueID - The unique id of this shared gallery. 13432 UniqueID *string `json:"uniqueId,omitempty"` 13433} 13434 13435// SharedGalleryImage specifies information about the gallery image definition that you want to create or 13436// update. 13437type SharedGalleryImage struct { 13438 autorest.Response `json:"-"` 13439 *SharedGalleryImageProperties `json:"properties,omitempty"` 13440 *SharedGalleryIdentifier `json:"identifier,omitempty"` 13441 // Name - READ-ONLY; Resource name 13442 Name *string `json:"name,omitempty"` 13443 // Location - READ-ONLY; Resource location 13444 Location *string `json:"location,omitempty"` 13445} 13446 13447// MarshalJSON is the custom marshaler for SharedGalleryImage. 13448func (sgi SharedGalleryImage) MarshalJSON() ([]byte, error) { 13449 objectMap := make(map[string]interface{}) 13450 if sgi.SharedGalleryImageProperties != nil { 13451 objectMap["properties"] = sgi.SharedGalleryImageProperties 13452 } 13453 if sgi.SharedGalleryIdentifier != nil { 13454 objectMap["identifier"] = sgi.SharedGalleryIdentifier 13455 } 13456 return json.Marshal(objectMap) 13457} 13458 13459// UnmarshalJSON is the custom unmarshaler for SharedGalleryImage struct. 13460func (sgi *SharedGalleryImage) UnmarshalJSON(body []byte) error { 13461 var m map[string]*json.RawMessage 13462 err := json.Unmarshal(body, &m) 13463 if err != nil { 13464 return err 13465 } 13466 for k, v := range m { 13467 switch k { 13468 case "properties": 13469 if v != nil { 13470 var sharedGalleryImageProperties SharedGalleryImageProperties 13471 err = json.Unmarshal(*v, &sharedGalleryImageProperties) 13472 if err != nil { 13473 return err 13474 } 13475 sgi.SharedGalleryImageProperties = &sharedGalleryImageProperties 13476 } 13477 case "identifier": 13478 if v != nil { 13479 var sharedGalleryIdentifier SharedGalleryIdentifier 13480 err = json.Unmarshal(*v, &sharedGalleryIdentifier) 13481 if err != nil { 13482 return err 13483 } 13484 sgi.SharedGalleryIdentifier = &sharedGalleryIdentifier 13485 } 13486 case "name": 13487 if v != nil { 13488 var name string 13489 err = json.Unmarshal(*v, &name) 13490 if err != nil { 13491 return err 13492 } 13493 sgi.Name = &name 13494 } 13495 case "location": 13496 if v != nil { 13497 var location string 13498 err = json.Unmarshal(*v, &location) 13499 if err != nil { 13500 return err 13501 } 13502 sgi.Location = &location 13503 } 13504 } 13505 } 13506 13507 return nil 13508} 13509 13510// SharedGalleryImageList the List Shared Gallery Images operation response. 13511type SharedGalleryImageList struct { 13512 autorest.Response `json:"-"` 13513 // Value - A list of shared gallery images. 13514 Value *[]SharedGalleryImage `json:"value,omitempty"` 13515 // 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. 13516 NextLink *string `json:"nextLink,omitempty"` 13517} 13518 13519// SharedGalleryImageListIterator provides access to a complete listing of SharedGalleryImage values. 13520type SharedGalleryImageListIterator struct { 13521 i int 13522 page SharedGalleryImageListPage 13523} 13524 13525// NextWithContext advances to the next value. If there was an error making 13526// the request the iterator does not advance and the error is returned. 13527func (iter *SharedGalleryImageListIterator) NextWithContext(ctx context.Context) (err error) { 13528 if tracing.IsEnabled() { 13529 ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImageListIterator.NextWithContext") 13530 defer func() { 13531 sc := -1 13532 if iter.Response().Response.Response != nil { 13533 sc = iter.Response().Response.Response.StatusCode 13534 } 13535 tracing.EndSpan(ctx, sc, err) 13536 }() 13537 } 13538 iter.i++ 13539 if iter.i < len(iter.page.Values()) { 13540 return nil 13541 } 13542 err = iter.page.NextWithContext(ctx) 13543 if err != nil { 13544 iter.i-- 13545 return err 13546 } 13547 iter.i = 0 13548 return nil 13549} 13550 13551// Next advances to the next value. If there was an error making 13552// the request the iterator does not advance and the error is returned. 13553// Deprecated: Use NextWithContext() instead. 13554func (iter *SharedGalleryImageListIterator) Next() error { 13555 return iter.NextWithContext(context.Background()) 13556} 13557 13558// NotDone returns true if the enumeration should be started or is not yet complete. 13559func (iter SharedGalleryImageListIterator) NotDone() bool { 13560 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 13561} 13562 13563// Response returns the raw server response from the last page request. 13564func (iter SharedGalleryImageListIterator) Response() SharedGalleryImageList { 13565 return iter.page.Response() 13566} 13567 13568// Value returns the current value or a zero-initialized value if the 13569// iterator has advanced beyond the end of the collection. 13570func (iter SharedGalleryImageListIterator) Value() SharedGalleryImage { 13571 if !iter.page.NotDone() { 13572 return SharedGalleryImage{} 13573 } 13574 return iter.page.Values()[iter.i] 13575} 13576 13577// Creates a new instance of the SharedGalleryImageListIterator type. 13578func NewSharedGalleryImageListIterator(page SharedGalleryImageListPage) SharedGalleryImageListIterator { 13579 return SharedGalleryImageListIterator{page: page} 13580} 13581 13582// IsEmpty returns true if the ListResult contains no values. 13583func (sgil SharedGalleryImageList) IsEmpty() bool { 13584 return sgil.Value == nil || len(*sgil.Value) == 0 13585} 13586 13587// hasNextLink returns true if the NextLink is not empty. 13588func (sgil SharedGalleryImageList) hasNextLink() bool { 13589 return sgil.NextLink != nil && len(*sgil.NextLink) != 0 13590} 13591 13592// sharedGalleryImageListPreparer prepares a request to retrieve the next set of results. 13593// It returns nil if no more results exist. 13594func (sgil SharedGalleryImageList) sharedGalleryImageListPreparer(ctx context.Context) (*http.Request, error) { 13595 if !sgil.hasNextLink() { 13596 return nil, nil 13597 } 13598 return autorest.Prepare((&http.Request{}).WithContext(ctx), 13599 autorest.AsJSON(), 13600 autorest.AsGet(), 13601 autorest.WithBaseURL(to.String(sgil.NextLink))) 13602} 13603 13604// SharedGalleryImageListPage contains a page of SharedGalleryImage values. 13605type SharedGalleryImageListPage struct { 13606 fn func(context.Context, SharedGalleryImageList) (SharedGalleryImageList, error) 13607 sgil SharedGalleryImageList 13608} 13609 13610// NextWithContext advances to the next page of values. If there was an error making 13611// the request the page does not advance and the error is returned. 13612func (page *SharedGalleryImageListPage) NextWithContext(ctx context.Context) (err error) { 13613 if tracing.IsEnabled() { 13614 ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImageListPage.NextWithContext") 13615 defer func() { 13616 sc := -1 13617 if page.Response().Response.Response != nil { 13618 sc = page.Response().Response.Response.StatusCode 13619 } 13620 tracing.EndSpan(ctx, sc, err) 13621 }() 13622 } 13623 for { 13624 next, err := page.fn(ctx, page.sgil) 13625 if err != nil { 13626 return err 13627 } 13628 page.sgil = next 13629 if !next.hasNextLink() || !next.IsEmpty() { 13630 break 13631 } 13632 } 13633 return nil 13634} 13635 13636// Next advances to the next page of values. If there was an error making 13637// the request the page does not advance and the error is returned. 13638// Deprecated: Use NextWithContext() instead. 13639func (page *SharedGalleryImageListPage) Next() error { 13640 return page.NextWithContext(context.Background()) 13641} 13642 13643// NotDone returns true if the page enumeration should be started or is not yet complete. 13644func (page SharedGalleryImageListPage) NotDone() bool { 13645 return !page.sgil.IsEmpty() 13646} 13647 13648// Response returns the raw server response from the last page request. 13649func (page SharedGalleryImageListPage) Response() SharedGalleryImageList { 13650 return page.sgil 13651} 13652 13653// Values returns the slice of values for the current page or nil if there are no values. 13654func (page SharedGalleryImageListPage) Values() []SharedGalleryImage { 13655 if page.sgil.IsEmpty() { 13656 return nil 13657 } 13658 return *page.sgil.Value 13659} 13660 13661// Creates a new instance of the SharedGalleryImageListPage type. 13662func NewSharedGalleryImageListPage(cur SharedGalleryImageList, getNextPage func(context.Context, SharedGalleryImageList) (SharedGalleryImageList, error)) SharedGalleryImageListPage { 13663 return SharedGalleryImageListPage{ 13664 fn: getNextPage, 13665 sgil: cur, 13666 } 13667} 13668 13669// SharedGalleryImageProperties describes the properties of a gallery image definition. 13670type SharedGalleryImageProperties struct { 13671 // 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' 13672 OsType OperatingSystemTypes `json:"osType,omitempty"` 13673 // 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' 13674 OsState OperatingSystemStateTypes `json:"osState,omitempty"` 13675 // EndOfLifeDate - The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property is updatable. 13676 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 13677 Identifier *GalleryImageIdentifier `json:"identifier,omitempty"` 13678 Recommended *RecommendedMachineConfiguration `json:"recommended,omitempty"` 13679 Disallowed *Disallowed `json:"disallowed,omitempty"` 13680 // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'HyperVGenerationV1', 'HyperVGenerationV2' 13681 HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` 13682 // Features - A list of gallery image features. 13683 Features *[]GalleryImageFeature `json:"features,omitempty"` 13684 PurchasePlan *ImagePurchasePlan `json:"purchasePlan,omitempty"` 13685} 13686 13687// SharedGalleryImageVersion specifies information about the gallery image version that you want to create 13688// or update. 13689type SharedGalleryImageVersion struct { 13690 autorest.Response `json:"-"` 13691 *SharedGalleryImageVersionProperties `json:"properties,omitempty"` 13692 *SharedGalleryIdentifier `json:"identifier,omitempty"` 13693 // Name - READ-ONLY; Resource name 13694 Name *string `json:"name,omitempty"` 13695 // Location - READ-ONLY; Resource location 13696 Location *string `json:"location,omitempty"` 13697} 13698 13699// MarshalJSON is the custom marshaler for SharedGalleryImageVersion. 13700func (sgiv SharedGalleryImageVersion) MarshalJSON() ([]byte, error) { 13701 objectMap := make(map[string]interface{}) 13702 if sgiv.SharedGalleryImageVersionProperties != nil { 13703 objectMap["properties"] = sgiv.SharedGalleryImageVersionProperties 13704 } 13705 if sgiv.SharedGalleryIdentifier != nil { 13706 objectMap["identifier"] = sgiv.SharedGalleryIdentifier 13707 } 13708 return json.Marshal(objectMap) 13709} 13710 13711// UnmarshalJSON is the custom unmarshaler for SharedGalleryImageVersion struct. 13712func (sgiv *SharedGalleryImageVersion) UnmarshalJSON(body []byte) error { 13713 var m map[string]*json.RawMessage 13714 err := json.Unmarshal(body, &m) 13715 if err != nil { 13716 return err 13717 } 13718 for k, v := range m { 13719 switch k { 13720 case "properties": 13721 if v != nil { 13722 var sharedGalleryImageVersionProperties SharedGalleryImageVersionProperties 13723 err = json.Unmarshal(*v, &sharedGalleryImageVersionProperties) 13724 if err != nil { 13725 return err 13726 } 13727 sgiv.SharedGalleryImageVersionProperties = &sharedGalleryImageVersionProperties 13728 } 13729 case "identifier": 13730 if v != nil { 13731 var sharedGalleryIdentifier SharedGalleryIdentifier 13732 err = json.Unmarshal(*v, &sharedGalleryIdentifier) 13733 if err != nil { 13734 return err 13735 } 13736 sgiv.SharedGalleryIdentifier = &sharedGalleryIdentifier 13737 } 13738 case "name": 13739 if v != nil { 13740 var name string 13741 err = json.Unmarshal(*v, &name) 13742 if err != nil { 13743 return err 13744 } 13745 sgiv.Name = &name 13746 } 13747 case "location": 13748 if v != nil { 13749 var location string 13750 err = json.Unmarshal(*v, &location) 13751 if err != nil { 13752 return err 13753 } 13754 sgiv.Location = &location 13755 } 13756 } 13757 } 13758 13759 return nil 13760} 13761 13762// SharedGalleryImageVersionList the List Shared Gallery Image versions operation response. 13763type SharedGalleryImageVersionList struct { 13764 autorest.Response `json:"-"` 13765 // Value - A list of shared gallery images versions. 13766 Value *[]SharedGalleryImageVersion `json:"value,omitempty"` 13767 // 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. 13768 NextLink *string `json:"nextLink,omitempty"` 13769} 13770 13771// SharedGalleryImageVersionListIterator provides access to a complete listing of SharedGalleryImageVersion 13772// values. 13773type SharedGalleryImageVersionListIterator struct { 13774 i int 13775 page SharedGalleryImageVersionListPage 13776} 13777 13778// NextWithContext advances to the next value. If there was an error making 13779// the request the iterator does not advance and the error is returned. 13780func (iter *SharedGalleryImageVersionListIterator) NextWithContext(ctx context.Context) (err error) { 13781 if tracing.IsEnabled() { 13782 ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImageVersionListIterator.NextWithContext") 13783 defer func() { 13784 sc := -1 13785 if iter.Response().Response.Response != nil { 13786 sc = iter.Response().Response.Response.StatusCode 13787 } 13788 tracing.EndSpan(ctx, sc, err) 13789 }() 13790 } 13791 iter.i++ 13792 if iter.i < len(iter.page.Values()) { 13793 return nil 13794 } 13795 err = iter.page.NextWithContext(ctx) 13796 if err != nil { 13797 iter.i-- 13798 return err 13799 } 13800 iter.i = 0 13801 return nil 13802} 13803 13804// Next advances to the next value. If there was an error making 13805// the request the iterator does not advance and the error is returned. 13806// Deprecated: Use NextWithContext() instead. 13807func (iter *SharedGalleryImageVersionListIterator) Next() error { 13808 return iter.NextWithContext(context.Background()) 13809} 13810 13811// NotDone returns true if the enumeration should be started or is not yet complete. 13812func (iter SharedGalleryImageVersionListIterator) NotDone() bool { 13813 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 13814} 13815 13816// Response returns the raw server response from the last page request. 13817func (iter SharedGalleryImageVersionListIterator) Response() SharedGalleryImageVersionList { 13818 return iter.page.Response() 13819} 13820 13821// Value returns the current value or a zero-initialized value if the 13822// iterator has advanced beyond the end of the collection. 13823func (iter SharedGalleryImageVersionListIterator) Value() SharedGalleryImageVersion { 13824 if !iter.page.NotDone() { 13825 return SharedGalleryImageVersion{} 13826 } 13827 return iter.page.Values()[iter.i] 13828} 13829 13830// Creates a new instance of the SharedGalleryImageVersionListIterator type. 13831func NewSharedGalleryImageVersionListIterator(page SharedGalleryImageVersionListPage) SharedGalleryImageVersionListIterator { 13832 return SharedGalleryImageVersionListIterator{page: page} 13833} 13834 13835// IsEmpty returns true if the ListResult contains no values. 13836func (sgivl SharedGalleryImageVersionList) IsEmpty() bool { 13837 return sgivl.Value == nil || len(*sgivl.Value) == 0 13838} 13839 13840// hasNextLink returns true if the NextLink is not empty. 13841func (sgivl SharedGalleryImageVersionList) hasNextLink() bool { 13842 return sgivl.NextLink != nil && len(*sgivl.NextLink) != 0 13843} 13844 13845// sharedGalleryImageVersionListPreparer prepares a request to retrieve the next set of results. 13846// It returns nil if no more results exist. 13847func (sgivl SharedGalleryImageVersionList) sharedGalleryImageVersionListPreparer(ctx context.Context) (*http.Request, error) { 13848 if !sgivl.hasNextLink() { 13849 return nil, nil 13850 } 13851 return autorest.Prepare((&http.Request{}).WithContext(ctx), 13852 autorest.AsJSON(), 13853 autorest.AsGet(), 13854 autorest.WithBaseURL(to.String(sgivl.NextLink))) 13855} 13856 13857// SharedGalleryImageVersionListPage contains a page of SharedGalleryImageVersion values. 13858type SharedGalleryImageVersionListPage struct { 13859 fn func(context.Context, SharedGalleryImageVersionList) (SharedGalleryImageVersionList, error) 13860 sgivl SharedGalleryImageVersionList 13861} 13862 13863// NextWithContext advances to the next page of values. If there was an error making 13864// the request the page does not advance and the error is returned. 13865func (page *SharedGalleryImageVersionListPage) NextWithContext(ctx context.Context) (err error) { 13866 if tracing.IsEnabled() { 13867 ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImageVersionListPage.NextWithContext") 13868 defer func() { 13869 sc := -1 13870 if page.Response().Response.Response != nil { 13871 sc = page.Response().Response.Response.StatusCode 13872 } 13873 tracing.EndSpan(ctx, sc, err) 13874 }() 13875 } 13876 for { 13877 next, err := page.fn(ctx, page.sgivl) 13878 if err != nil { 13879 return err 13880 } 13881 page.sgivl = next 13882 if !next.hasNextLink() || !next.IsEmpty() { 13883 break 13884 } 13885 } 13886 return nil 13887} 13888 13889// Next advances to the next page of values. If there was an error making 13890// the request the page does not advance and the error is returned. 13891// Deprecated: Use NextWithContext() instead. 13892func (page *SharedGalleryImageVersionListPage) Next() error { 13893 return page.NextWithContext(context.Background()) 13894} 13895 13896// NotDone returns true if the page enumeration should be started or is not yet complete. 13897func (page SharedGalleryImageVersionListPage) NotDone() bool { 13898 return !page.sgivl.IsEmpty() 13899} 13900 13901// Response returns the raw server response from the last page request. 13902func (page SharedGalleryImageVersionListPage) Response() SharedGalleryImageVersionList { 13903 return page.sgivl 13904} 13905 13906// Values returns the slice of values for the current page or nil if there are no values. 13907func (page SharedGalleryImageVersionListPage) Values() []SharedGalleryImageVersion { 13908 if page.sgivl.IsEmpty() { 13909 return nil 13910 } 13911 return *page.sgivl.Value 13912} 13913 13914// Creates a new instance of the SharedGalleryImageVersionListPage type. 13915func NewSharedGalleryImageVersionListPage(cur SharedGalleryImageVersionList, getNextPage func(context.Context, SharedGalleryImageVersionList) (SharedGalleryImageVersionList, error)) SharedGalleryImageVersionListPage { 13916 return SharedGalleryImageVersionListPage{ 13917 fn: getNextPage, 13918 sgivl: cur, 13919 } 13920} 13921 13922// SharedGalleryImageVersionProperties describes the properties of a gallery image version. 13923type SharedGalleryImageVersionProperties struct { 13924 // PublishedDate - The published date of the gallery image version Definition. This property can be used for decommissioning purposes. This property is updatable. 13925 PublishedDate *date.Time `json:"publishedDate,omitempty"` 13926 // EndOfLifeDate - The end of life date of the gallery image version Definition. This property can be used for decommissioning purposes. This property is updatable. 13927 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 13928} 13929 13930// SharedGalleryList the List Shared Galleries operation response. 13931type SharedGalleryList struct { 13932 autorest.Response `json:"-"` 13933 // Value - A list of shared galleries. 13934 Value *[]SharedGallery `json:"value,omitempty"` 13935 // NextLink - The uri to fetch the next page of shared galleries. Call ListNext() with this to fetch the next page of shared galleries. 13936 NextLink *string `json:"nextLink,omitempty"` 13937} 13938 13939// SharedGalleryListIterator provides access to a complete listing of SharedGallery values. 13940type SharedGalleryListIterator struct { 13941 i int 13942 page SharedGalleryListPage 13943} 13944 13945// NextWithContext advances to the next value. If there was an error making 13946// the request the iterator does not advance and the error is returned. 13947func (iter *SharedGalleryListIterator) NextWithContext(ctx context.Context) (err error) { 13948 if tracing.IsEnabled() { 13949 ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryListIterator.NextWithContext") 13950 defer func() { 13951 sc := -1 13952 if iter.Response().Response.Response != nil { 13953 sc = iter.Response().Response.Response.StatusCode 13954 } 13955 tracing.EndSpan(ctx, sc, err) 13956 }() 13957 } 13958 iter.i++ 13959 if iter.i < len(iter.page.Values()) { 13960 return nil 13961 } 13962 err = iter.page.NextWithContext(ctx) 13963 if err != nil { 13964 iter.i-- 13965 return err 13966 } 13967 iter.i = 0 13968 return nil 13969} 13970 13971// Next advances to the next value. If there was an error making 13972// the request the iterator does not advance and the error is returned. 13973// Deprecated: Use NextWithContext() instead. 13974func (iter *SharedGalleryListIterator) Next() error { 13975 return iter.NextWithContext(context.Background()) 13976} 13977 13978// NotDone returns true if the enumeration should be started or is not yet complete. 13979func (iter SharedGalleryListIterator) NotDone() bool { 13980 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 13981} 13982 13983// Response returns the raw server response from the last page request. 13984func (iter SharedGalleryListIterator) Response() SharedGalleryList { 13985 return iter.page.Response() 13986} 13987 13988// Value returns the current value or a zero-initialized value if the 13989// iterator has advanced beyond the end of the collection. 13990func (iter SharedGalleryListIterator) Value() SharedGallery { 13991 if !iter.page.NotDone() { 13992 return SharedGallery{} 13993 } 13994 return iter.page.Values()[iter.i] 13995} 13996 13997// Creates a new instance of the SharedGalleryListIterator type. 13998func NewSharedGalleryListIterator(page SharedGalleryListPage) SharedGalleryListIterator { 13999 return SharedGalleryListIterator{page: page} 14000} 14001 14002// IsEmpty returns true if the ListResult contains no values. 14003func (sgl SharedGalleryList) IsEmpty() bool { 14004 return sgl.Value == nil || len(*sgl.Value) == 0 14005} 14006 14007// hasNextLink returns true if the NextLink is not empty. 14008func (sgl SharedGalleryList) hasNextLink() bool { 14009 return sgl.NextLink != nil && len(*sgl.NextLink) != 0 14010} 14011 14012// sharedGalleryListPreparer prepares a request to retrieve the next set of results. 14013// It returns nil if no more results exist. 14014func (sgl SharedGalleryList) sharedGalleryListPreparer(ctx context.Context) (*http.Request, error) { 14015 if !sgl.hasNextLink() { 14016 return nil, nil 14017 } 14018 return autorest.Prepare((&http.Request{}).WithContext(ctx), 14019 autorest.AsJSON(), 14020 autorest.AsGet(), 14021 autorest.WithBaseURL(to.String(sgl.NextLink))) 14022} 14023 14024// SharedGalleryListPage contains a page of SharedGallery values. 14025type SharedGalleryListPage struct { 14026 fn func(context.Context, SharedGalleryList) (SharedGalleryList, error) 14027 sgl SharedGalleryList 14028} 14029 14030// NextWithContext advances to the next page of values. If there was an error making 14031// the request the page does not advance and the error is returned. 14032func (page *SharedGalleryListPage) NextWithContext(ctx context.Context) (err error) { 14033 if tracing.IsEnabled() { 14034 ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryListPage.NextWithContext") 14035 defer func() { 14036 sc := -1 14037 if page.Response().Response.Response != nil { 14038 sc = page.Response().Response.Response.StatusCode 14039 } 14040 tracing.EndSpan(ctx, sc, err) 14041 }() 14042 } 14043 for { 14044 next, err := page.fn(ctx, page.sgl) 14045 if err != nil { 14046 return err 14047 } 14048 page.sgl = next 14049 if !next.hasNextLink() || !next.IsEmpty() { 14050 break 14051 } 14052 } 14053 return nil 14054} 14055 14056// Next advances to the next page of values. If there was an error making 14057// the request the page does not advance and the error is returned. 14058// Deprecated: Use NextWithContext() instead. 14059func (page *SharedGalleryListPage) Next() error { 14060 return page.NextWithContext(context.Background()) 14061} 14062 14063// NotDone returns true if the page enumeration should be started or is not yet complete. 14064func (page SharedGalleryListPage) NotDone() bool { 14065 return !page.sgl.IsEmpty() 14066} 14067 14068// Response returns the raw server response from the last page request. 14069func (page SharedGalleryListPage) Response() SharedGalleryList { 14070 return page.sgl 14071} 14072 14073// Values returns the slice of values for the current page or nil if there are no values. 14074func (page SharedGalleryListPage) Values() []SharedGallery { 14075 if page.sgl.IsEmpty() { 14076 return nil 14077 } 14078 return *page.sgl.Value 14079} 14080 14081// Creates a new instance of the SharedGalleryListPage type. 14082func NewSharedGalleryListPage(cur SharedGalleryList, getNextPage func(context.Context, SharedGalleryList) (SharedGalleryList, error)) SharedGalleryListPage { 14083 return SharedGalleryListPage{ 14084 fn: getNextPage, 14085 sgl: cur, 14086 } 14087} 14088 14089// ShareInfoElement ... 14090type ShareInfoElement struct { 14091 // VMURI - READ-ONLY; A relative URI containing the ID of the VM that has the disk attached. 14092 VMURI *string `json:"vmUri,omitempty"` 14093} 14094 14095// MarshalJSON is the custom marshaler for ShareInfoElement. 14096func (sie ShareInfoElement) MarshalJSON() ([]byte, error) { 14097 objectMap := make(map[string]interface{}) 14098 return json.Marshal(objectMap) 14099} 14100 14101// SharingProfile profile for gallery sharing to subscription or tenant 14102type SharingProfile struct { 14103 // 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' 14104 Permissions GallerySharingPermissionTypes `json:"permissions,omitempty"` 14105 // Groups - READ-ONLY; A list of sharing profile groups. 14106 Groups *[]SharingProfileGroup `json:"groups,omitempty"` 14107} 14108 14109// MarshalJSON is the custom marshaler for SharingProfile. 14110func (sp SharingProfile) MarshalJSON() ([]byte, error) { 14111 objectMap := make(map[string]interface{}) 14112 if sp.Permissions != "" { 14113 objectMap["permissions"] = sp.Permissions 14114 } 14115 return json.Marshal(objectMap) 14116} 14117 14118// SharingProfileGroup group of the gallery sharing profile 14119type SharingProfileGroup struct { 14120 // 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' 14121 Type SharingProfileGroupTypes `json:"type,omitempty"` 14122 // Ids - A list of subscription/tenant ids the gallery is aimed to be shared to. 14123 Ids *[]string `json:"ids,omitempty"` 14124} 14125 14126// SharingUpdate specifies information about the gallery sharing profile update. 14127type SharingUpdate struct { 14128 autorest.Response `json:"-"` 14129 // 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' 14130 OperationType SharingUpdateOperationTypes `json:"operationType,omitempty"` 14131 // Groups - A list of sharing profile groups. 14132 Groups *[]SharingProfileGroup `json:"groups,omitempty"` 14133} 14134 14135// Sku describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware 14136// the scale set is currently on, you need to deallocate the VMs in the scale set before you modify the SKU 14137// name. 14138type Sku struct { 14139 // Name - The sku name. 14140 Name *string `json:"name,omitempty"` 14141 // Tier - Specifies the tier of virtual machines in a scale set.<br /><br /> Possible Values:<br /><br /> **Standard**<br /><br /> **Basic** 14142 Tier *string `json:"tier,omitempty"` 14143 // Capacity - Specifies the number of virtual machines in the scale set. 14144 Capacity *int64 `json:"capacity,omitempty"` 14145} 14146 14147// Snapshot snapshot resource. 14148type Snapshot struct { 14149 autorest.Response `json:"-"` 14150 // ManagedBy - READ-ONLY; Unused. Always Null. 14151 ManagedBy *string `json:"managedBy,omitempty"` 14152 Sku *SnapshotSku `json:"sku,omitempty"` 14153 // ExtendedLocation - The extended location where the snapshot will be created. Extended location cannot be changed. 14154 ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` 14155 *SnapshotProperties `json:"properties,omitempty"` 14156 // ID - READ-ONLY; Resource Id 14157 ID *string `json:"id,omitempty"` 14158 // Name - READ-ONLY; Resource name 14159 Name *string `json:"name,omitempty"` 14160 // Type - READ-ONLY; Resource type 14161 Type *string `json:"type,omitempty"` 14162 // Location - Resource location 14163 Location *string `json:"location,omitempty"` 14164 // Tags - Resource tags 14165 Tags map[string]*string `json:"tags"` 14166} 14167 14168// MarshalJSON is the custom marshaler for Snapshot. 14169func (s Snapshot) MarshalJSON() ([]byte, error) { 14170 objectMap := make(map[string]interface{}) 14171 if s.Sku != nil { 14172 objectMap["sku"] = s.Sku 14173 } 14174 if s.ExtendedLocation != nil { 14175 objectMap["extendedLocation"] = s.ExtendedLocation 14176 } 14177 if s.SnapshotProperties != nil { 14178 objectMap["properties"] = s.SnapshotProperties 14179 } 14180 if s.Location != nil { 14181 objectMap["location"] = s.Location 14182 } 14183 if s.Tags != nil { 14184 objectMap["tags"] = s.Tags 14185 } 14186 return json.Marshal(objectMap) 14187} 14188 14189// UnmarshalJSON is the custom unmarshaler for Snapshot struct. 14190func (s *Snapshot) UnmarshalJSON(body []byte) error { 14191 var m map[string]*json.RawMessage 14192 err := json.Unmarshal(body, &m) 14193 if err != nil { 14194 return err 14195 } 14196 for k, v := range m { 14197 switch k { 14198 case "managedBy": 14199 if v != nil { 14200 var managedBy string 14201 err = json.Unmarshal(*v, &managedBy) 14202 if err != nil { 14203 return err 14204 } 14205 s.ManagedBy = &managedBy 14206 } 14207 case "sku": 14208 if v != nil { 14209 var sku SnapshotSku 14210 err = json.Unmarshal(*v, &sku) 14211 if err != nil { 14212 return err 14213 } 14214 s.Sku = &sku 14215 } 14216 case "extendedLocation": 14217 if v != nil { 14218 var extendedLocation ExtendedLocation 14219 err = json.Unmarshal(*v, &extendedLocation) 14220 if err != nil { 14221 return err 14222 } 14223 s.ExtendedLocation = &extendedLocation 14224 } 14225 case "properties": 14226 if v != nil { 14227 var snapshotProperties SnapshotProperties 14228 err = json.Unmarshal(*v, &snapshotProperties) 14229 if err != nil { 14230 return err 14231 } 14232 s.SnapshotProperties = &snapshotProperties 14233 } 14234 case "id": 14235 if v != nil { 14236 var ID string 14237 err = json.Unmarshal(*v, &ID) 14238 if err != nil { 14239 return err 14240 } 14241 s.ID = &ID 14242 } 14243 case "name": 14244 if v != nil { 14245 var name string 14246 err = json.Unmarshal(*v, &name) 14247 if err != nil { 14248 return err 14249 } 14250 s.Name = &name 14251 } 14252 case "type": 14253 if v != nil { 14254 var typeVar string 14255 err = json.Unmarshal(*v, &typeVar) 14256 if err != nil { 14257 return err 14258 } 14259 s.Type = &typeVar 14260 } 14261 case "location": 14262 if v != nil { 14263 var location string 14264 err = json.Unmarshal(*v, &location) 14265 if err != nil { 14266 return err 14267 } 14268 s.Location = &location 14269 } 14270 case "tags": 14271 if v != nil { 14272 var tags map[string]*string 14273 err = json.Unmarshal(*v, &tags) 14274 if err != nil { 14275 return err 14276 } 14277 s.Tags = tags 14278 } 14279 } 14280 } 14281 14282 return nil 14283} 14284 14285// SnapshotList the List Snapshots operation response. 14286type SnapshotList struct { 14287 autorest.Response `json:"-"` 14288 // Value - A list of snapshots. 14289 Value *[]Snapshot `json:"value,omitempty"` 14290 // NextLink - The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the next page of snapshots. 14291 NextLink *string `json:"nextLink,omitempty"` 14292} 14293 14294// SnapshotListIterator provides access to a complete listing of Snapshot values. 14295type SnapshotListIterator struct { 14296 i int 14297 page SnapshotListPage 14298} 14299 14300// NextWithContext advances to the next value. If there was an error making 14301// the request the iterator does not advance and the error is returned. 14302func (iter *SnapshotListIterator) NextWithContext(ctx context.Context) (err error) { 14303 if tracing.IsEnabled() { 14304 ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotListIterator.NextWithContext") 14305 defer func() { 14306 sc := -1 14307 if iter.Response().Response.Response != nil { 14308 sc = iter.Response().Response.Response.StatusCode 14309 } 14310 tracing.EndSpan(ctx, sc, err) 14311 }() 14312 } 14313 iter.i++ 14314 if iter.i < len(iter.page.Values()) { 14315 return nil 14316 } 14317 err = iter.page.NextWithContext(ctx) 14318 if err != nil { 14319 iter.i-- 14320 return err 14321 } 14322 iter.i = 0 14323 return nil 14324} 14325 14326// Next advances to the next value. If there was an error making 14327// the request the iterator does not advance and the error is returned. 14328// Deprecated: Use NextWithContext() instead. 14329func (iter *SnapshotListIterator) Next() error { 14330 return iter.NextWithContext(context.Background()) 14331} 14332 14333// NotDone returns true if the enumeration should be started or is not yet complete. 14334func (iter SnapshotListIterator) NotDone() bool { 14335 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 14336} 14337 14338// Response returns the raw server response from the last page request. 14339func (iter SnapshotListIterator) Response() SnapshotList { 14340 return iter.page.Response() 14341} 14342 14343// Value returns the current value or a zero-initialized value if the 14344// iterator has advanced beyond the end of the collection. 14345func (iter SnapshotListIterator) Value() Snapshot { 14346 if !iter.page.NotDone() { 14347 return Snapshot{} 14348 } 14349 return iter.page.Values()[iter.i] 14350} 14351 14352// Creates a new instance of the SnapshotListIterator type. 14353func NewSnapshotListIterator(page SnapshotListPage) SnapshotListIterator { 14354 return SnapshotListIterator{page: page} 14355} 14356 14357// IsEmpty returns true if the ListResult contains no values. 14358func (sl SnapshotList) IsEmpty() bool { 14359 return sl.Value == nil || len(*sl.Value) == 0 14360} 14361 14362// hasNextLink returns true if the NextLink is not empty. 14363func (sl SnapshotList) hasNextLink() bool { 14364 return sl.NextLink != nil && len(*sl.NextLink) != 0 14365} 14366 14367// snapshotListPreparer prepares a request to retrieve the next set of results. 14368// It returns nil if no more results exist. 14369func (sl SnapshotList) snapshotListPreparer(ctx context.Context) (*http.Request, error) { 14370 if !sl.hasNextLink() { 14371 return nil, nil 14372 } 14373 return autorest.Prepare((&http.Request{}).WithContext(ctx), 14374 autorest.AsJSON(), 14375 autorest.AsGet(), 14376 autorest.WithBaseURL(to.String(sl.NextLink))) 14377} 14378 14379// SnapshotListPage contains a page of Snapshot values. 14380type SnapshotListPage struct { 14381 fn func(context.Context, SnapshotList) (SnapshotList, error) 14382 sl SnapshotList 14383} 14384 14385// NextWithContext advances to the next page of values. If there was an error making 14386// the request the page does not advance and the error is returned. 14387func (page *SnapshotListPage) NextWithContext(ctx context.Context) (err error) { 14388 if tracing.IsEnabled() { 14389 ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotListPage.NextWithContext") 14390 defer func() { 14391 sc := -1 14392 if page.Response().Response.Response != nil { 14393 sc = page.Response().Response.Response.StatusCode 14394 } 14395 tracing.EndSpan(ctx, sc, err) 14396 }() 14397 } 14398 for { 14399 next, err := page.fn(ctx, page.sl) 14400 if err != nil { 14401 return err 14402 } 14403 page.sl = next 14404 if !next.hasNextLink() || !next.IsEmpty() { 14405 break 14406 } 14407 } 14408 return nil 14409} 14410 14411// Next advances to the next page of values. If there was an error making 14412// the request the page does not advance and the error is returned. 14413// Deprecated: Use NextWithContext() instead. 14414func (page *SnapshotListPage) Next() error { 14415 return page.NextWithContext(context.Background()) 14416} 14417 14418// NotDone returns true if the page enumeration should be started or is not yet complete. 14419func (page SnapshotListPage) NotDone() bool { 14420 return !page.sl.IsEmpty() 14421} 14422 14423// Response returns the raw server response from the last page request. 14424func (page SnapshotListPage) Response() SnapshotList { 14425 return page.sl 14426} 14427 14428// Values returns the slice of values for the current page or nil if there are no values. 14429func (page SnapshotListPage) Values() []Snapshot { 14430 if page.sl.IsEmpty() { 14431 return nil 14432 } 14433 return *page.sl.Value 14434} 14435 14436// Creates a new instance of the SnapshotListPage type. 14437func NewSnapshotListPage(cur SnapshotList, getNextPage func(context.Context, SnapshotList) (SnapshotList, error)) SnapshotListPage { 14438 return SnapshotListPage{ 14439 fn: getNextPage, 14440 sl: cur, 14441 } 14442} 14443 14444// SnapshotProperties snapshot resource properties. 14445type SnapshotProperties struct { 14446 // TimeCreated - READ-ONLY; The time when the snapshot was created. 14447 TimeCreated *date.Time `json:"timeCreated,omitempty"` 14448 // OsType - The Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' 14449 OsType OperatingSystemTypes `json:"osType,omitempty"` 14450 // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'HyperVGenerationV1', 'HyperVGenerationV2' 14451 HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` 14452 // PurchasePlan - Purchase plan information for the image from which the source disk for the snapshot was originally created. 14453 PurchasePlan *PurchasePlan `json:"purchasePlan,omitempty"` 14454 // CreationData - Disk source information. CreationData information cannot be changed after the disk has been created. 14455 CreationData *CreationData `json:"creationData,omitempty"` 14456 // 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. 14457 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 14458 // DiskSizeBytes - READ-ONLY; The size of the disk in bytes. This field is read only. 14459 DiskSizeBytes *int64 `json:"diskSizeBytes,omitempty"` 14460 // DiskState - The state of the snapshot. Possible values include: 'DiskStateUnattached', 'DiskStateAttached', 'DiskStateReserved', 'DiskStateActiveSAS', 'DiskStateReadyToUpload', 'DiskStateActiveUpload' 14461 DiskState DiskState `json:"diskState,omitempty"` 14462 // UniqueID - READ-ONLY; Unique Guid identifying the resource. 14463 UniqueID *string `json:"uniqueId,omitempty"` 14464 // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. 14465 EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` 14466 // ProvisioningState - READ-ONLY; The disk provisioning state. 14467 ProvisioningState *string `json:"provisioningState,omitempty"` 14468 // Incremental - Whether a snapshot is incremental. Incremental snapshots on the same disk occupy less space than full snapshots and can be diffed. 14469 Incremental *bool `json:"incremental,omitempty"` 14470 // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 14471 Encryption *Encryption `json:"encryption,omitempty"` 14472 // NetworkAccessPolicy - Possible values include: 'NetworkAccessPolicyAllowAll', 'NetworkAccessPolicyAllowPrivate', 'NetworkAccessPolicyDenyAll' 14473 NetworkAccessPolicy NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` 14474 // DiskAccessID - ARM id of the DiskAccess resource for using private endpoints on disks. 14475 DiskAccessID *string `json:"diskAccessId,omitempty"` 14476 // SupportsHibernation - Indicates the OS on a snapshot supports hibernation. 14477 SupportsHibernation *bool `json:"supportsHibernation,omitempty"` 14478} 14479 14480// MarshalJSON is the custom marshaler for SnapshotProperties. 14481func (sp SnapshotProperties) MarshalJSON() ([]byte, error) { 14482 objectMap := make(map[string]interface{}) 14483 if sp.OsType != "" { 14484 objectMap["osType"] = sp.OsType 14485 } 14486 if sp.HyperVGeneration != "" { 14487 objectMap["hyperVGeneration"] = sp.HyperVGeneration 14488 } 14489 if sp.PurchasePlan != nil { 14490 objectMap["purchasePlan"] = sp.PurchasePlan 14491 } 14492 if sp.CreationData != nil { 14493 objectMap["creationData"] = sp.CreationData 14494 } 14495 if sp.DiskSizeGB != nil { 14496 objectMap["diskSizeGB"] = sp.DiskSizeGB 14497 } 14498 if sp.DiskState != "" { 14499 objectMap["diskState"] = sp.DiskState 14500 } 14501 if sp.EncryptionSettingsCollection != nil { 14502 objectMap["encryptionSettingsCollection"] = sp.EncryptionSettingsCollection 14503 } 14504 if sp.Incremental != nil { 14505 objectMap["incremental"] = sp.Incremental 14506 } 14507 if sp.Encryption != nil { 14508 objectMap["encryption"] = sp.Encryption 14509 } 14510 if sp.NetworkAccessPolicy != "" { 14511 objectMap["networkAccessPolicy"] = sp.NetworkAccessPolicy 14512 } 14513 if sp.DiskAccessID != nil { 14514 objectMap["diskAccessId"] = sp.DiskAccessID 14515 } 14516 if sp.SupportsHibernation != nil { 14517 objectMap["supportsHibernation"] = sp.SupportsHibernation 14518 } 14519 return json.Marshal(objectMap) 14520} 14521 14522// SnapshotsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 14523// operation. 14524type SnapshotsCreateOrUpdateFuture struct { 14525 azure.FutureAPI 14526 // Result returns the result of the asynchronous operation. 14527 // If the operation has not completed it will return an error. 14528 Result func(SnapshotsClient) (Snapshot, error) 14529} 14530 14531// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14532func (future *SnapshotsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 14533 var azFuture azure.Future 14534 if err := json.Unmarshal(body, &azFuture); err != nil { 14535 return err 14536 } 14537 future.FutureAPI = &azFuture 14538 future.Result = future.result 14539 return nil 14540} 14541 14542// result is the default implementation for SnapshotsCreateOrUpdateFuture.Result. 14543func (future *SnapshotsCreateOrUpdateFuture) result(client SnapshotsClient) (s Snapshot, err error) { 14544 var done bool 14545 done, err = future.DoneWithContext(context.Background(), client) 14546 if err != nil { 14547 err = autorest.NewErrorWithError(err, "compute.SnapshotsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 14548 return 14549 } 14550 if !done { 14551 s.Response.Response = future.Response() 14552 err = azure.NewAsyncOpIncompleteError("compute.SnapshotsCreateOrUpdateFuture") 14553 return 14554 } 14555 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 14556 if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { 14557 s, err = client.CreateOrUpdateResponder(s.Response.Response) 14558 if err != nil { 14559 err = autorest.NewErrorWithError(err, "compute.SnapshotsCreateOrUpdateFuture", "Result", s.Response.Response, "Failure responding to request") 14560 } 14561 } 14562 return 14563} 14564 14565// SnapshotsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 14566// operation. 14567type SnapshotsDeleteFuture struct { 14568 azure.FutureAPI 14569 // Result returns the result of the asynchronous operation. 14570 // If the operation has not completed it will return an error. 14571 Result func(SnapshotsClient) (autorest.Response, error) 14572} 14573 14574// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14575func (future *SnapshotsDeleteFuture) UnmarshalJSON(body []byte) error { 14576 var azFuture azure.Future 14577 if err := json.Unmarshal(body, &azFuture); err != nil { 14578 return err 14579 } 14580 future.FutureAPI = &azFuture 14581 future.Result = future.result 14582 return nil 14583} 14584 14585// result is the default implementation for SnapshotsDeleteFuture.Result. 14586func (future *SnapshotsDeleteFuture) result(client SnapshotsClient) (ar autorest.Response, err error) { 14587 var done bool 14588 done, err = future.DoneWithContext(context.Background(), client) 14589 if err != nil { 14590 err = autorest.NewErrorWithError(err, "compute.SnapshotsDeleteFuture", "Result", future.Response(), "Polling failure") 14591 return 14592 } 14593 if !done { 14594 ar.Response = future.Response() 14595 err = azure.NewAsyncOpIncompleteError("compute.SnapshotsDeleteFuture") 14596 return 14597 } 14598 ar.Response = future.Response() 14599 return 14600} 14601 14602// SnapshotsGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running 14603// operation. 14604type SnapshotsGrantAccessFuture struct { 14605 azure.FutureAPI 14606 // Result returns the result of the asynchronous operation. 14607 // If the operation has not completed it will return an error. 14608 Result func(SnapshotsClient) (AccessURI, error) 14609} 14610 14611// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14612func (future *SnapshotsGrantAccessFuture) UnmarshalJSON(body []byte) error { 14613 var azFuture azure.Future 14614 if err := json.Unmarshal(body, &azFuture); err != nil { 14615 return err 14616 } 14617 future.FutureAPI = &azFuture 14618 future.Result = future.result 14619 return nil 14620} 14621 14622// result is the default implementation for SnapshotsGrantAccessFuture.Result. 14623func (future *SnapshotsGrantAccessFuture) result(client SnapshotsClient) (au AccessURI, err error) { 14624 var done bool 14625 done, err = future.DoneWithContext(context.Background(), client) 14626 if err != nil { 14627 err = autorest.NewErrorWithError(err, "compute.SnapshotsGrantAccessFuture", "Result", future.Response(), "Polling failure") 14628 return 14629 } 14630 if !done { 14631 au.Response.Response = future.Response() 14632 err = azure.NewAsyncOpIncompleteError("compute.SnapshotsGrantAccessFuture") 14633 return 14634 } 14635 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 14636 if au.Response.Response, err = future.GetResult(sender); err == nil && au.Response.Response.StatusCode != http.StatusNoContent { 14637 au, err = client.GrantAccessResponder(au.Response.Response) 14638 if err != nil { 14639 err = autorest.NewErrorWithError(err, "compute.SnapshotsGrantAccessFuture", "Result", au.Response.Response, "Failure responding to request") 14640 } 14641 } 14642 return 14643} 14644 14645// SnapshotSku the snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This is an 14646// optional parameter for incremental snapshot and the default behavior is the SKU will be set to the same 14647// sku as the previous snapshot 14648type SnapshotSku struct { 14649 // Name - The sku name. Possible values include: 'SnapshotStorageAccountTypesStandardLRS', 'SnapshotStorageAccountTypesPremiumLRS', 'SnapshotStorageAccountTypesStandardZRS' 14650 Name SnapshotStorageAccountTypes `json:"name,omitempty"` 14651 // Tier - READ-ONLY; The sku tier. 14652 Tier *string `json:"tier,omitempty"` 14653} 14654 14655// MarshalJSON is the custom marshaler for SnapshotSku. 14656func (ss SnapshotSku) MarshalJSON() ([]byte, error) { 14657 objectMap := make(map[string]interface{}) 14658 if ss.Name != "" { 14659 objectMap["name"] = ss.Name 14660 } 14661 return json.Marshal(objectMap) 14662} 14663 14664// SnapshotsRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running 14665// operation. 14666type SnapshotsRevokeAccessFuture struct { 14667 azure.FutureAPI 14668 // Result returns the result of the asynchronous operation. 14669 // If the operation has not completed it will return an error. 14670 Result func(SnapshotsClient) (autorest.Response, error) 14671} 14672 14673// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14674func (future *SnapshotsRevokeAccessFuture) UnmarshalJSON(body []byte) error { 14675 var azFuture azure.Future 14676 if err := json.Unmarshal(body, &azFuture); err != nil { 14677 return err 14678 } 14679 future.FutureAPI = &azFuture 14680 future.Result = future.result 14681 return nil 14682} 14683 14684// result is the default implementation for SnapshotsRevokeAccessFuture.Result. 14685func (future *SnapshotsRevokeAccessFuture) result(client SnapshotsClient) (ar autorest.Response, err error) { 14686 var done bool 14687 done, err = future.DoneWithContext(context.Background(), client) 14688 if err != nil { 14689 err = autorest.NewErrorWithError(err, "compute.SnapshotsRevokeAccessFuture", "Result", future.Response(), "Polling failure") 14690 return 14691 } 14692 if !done { 14693 ar.Response = future.Response() 14694 err = azure.NewAsyncOpIncompleteError("compute.SnapshotsRevokeAccessFuture") 14695 return 14696 } 14697 ar.Response = future.Response() 14698 return 14699} 14700 14701// SnapshotsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 14702// operation. 14703type SnapshotsUpdateFuture struct { 14704 azure.FutureAPI 14705 // Result returns the result of the asynchronous operation. 14706 // If the operation has not completed it will return an error. 14707 Result func(SnapshotsClient) (Snapshot, error) 14708} 14709 14710// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14711func (future *SnapshotsUpdateFuture) UnmarshalJSON(body []byte) error { 14712 var azFuture azure.Future 14713 if err := json.Unmarshal(body, &azFuture); err != nil { 14714 return err 14715 } 14716 future.FutureAPI = &azFuture 14717 future.Result = future.result 14718 return nil 14719} 14720 14721// result is the default implementation for SnapshotsUpdateFuture.Result. 14722func (future *SnapshotsUpdateFuture) result(client SnapshotsClient) (s Snapshot, err error) { 14723 var done bool 14724 done, err = future.DoneWithContext(context.Background(), client) 14725 if err != nil { 14726 err = autorest.NewErrorWithError(err, "compute.SnapshotsUpdateFuture", "Result", future.Response(), "Polling failure") 14727 return 14728 } 14729 if !done { 14730 s.Response.Response = future.Response() 14731 err = azure.NewAsyncOpIncompleteError("compute.SnapshotsUpdateFuture") 14732 return 14733 } 14734 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 14735 if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { 14736 s, err = client.UpdateResponder(s.Response.Response) 14737 if err != nil { 14738 err = autorest.NewErrorWithError(err, "compute.SnapshotsUpdateFuture", "Result", s.Response.Response, "Failure responding to request") 14739 } 14740 } 14741 return 14742} 14743 14744// SnapshotUpdate snapshot update resource. 14745type SnapshotUpdate struct { 14746 *SnapshotUpdateProperties `json:"properties,omitempty"` 14747 // Tags - Resource tags 14748 Tags map[string]*string `json:"tags"` 14749 Sku *SnapshotSku `json:"sku,omitempty"` 14750} 14751 14752// MarshalJSON is the custom marshaler for SnapshotUpdate. 14753func (su SnapshotUpdate) MarshalJSON() ([]byte, error) { 14754 objectMap := make(map[string]interface{}) 14755 if su.SnapshotUpdateProperties != nil { 14756 objectMap["properties"] = su.SnapshotUpdateProperties 14757 } 14758 if su.Tags != nil { 14759 objectMap["tags"] = su.Tags 14760 } 14761 if su.Sku != nil { 14762 objectMap["sku"] = su.Sku 14763 } 14764 return json.Marshal(objectMap) 14765} 14766 14767// UnmarshalJSON is the custom unmarshaler for SnapshotUpdate struct. 14768func (su *SnapshotUpdate) UnmarshalJSON(body []byte) error { 14769 var m map[string]*json.RawMessage 14770 err := json.Unmarshal(body, &m) 14771 if err != nil { 14772 return err 14773 } 14774 for k, v := range m { 14775 switch k { 14776 case "properties": 14777 if v != nil { 14778 var snapshotUpdateProperties SnapshotUpdateProperties 14779 err = json.Unmarshal(*v, &snapshotUpdateProperties) 14780 if err != nil { 14781 return err 14782 } 14783 su.SnapshotUpdateProperties = &snapshotUpdateProperties 14784 } 14785 case "tags": 14786 if v != nil { 14787 var tags map[string]*string 14788 err = json.Unmarshal(*v, &tags) 14789 if err != nil { 14790 return err 14791 } 14792 su.Tags = tags 14793 } 14794 case "sku": 14795 if v != nil { 14796 var sku SnapshotSku 14797 err = json.Unmarshal(*v, &sku) 14798 if err != nil { 14799 return err 14800 } 14801 su.Sku = &sku 14802 } 14803 } 14804 } 14805 14806 return nil 14807} 14808 14809// SnapshotUpdateProperties snapshot resource update properties. 14810type SnapshotUpdateProperties struct { 14811 // OsType - the Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' 14812 OsType OperatingSystemTypes `json:"osType,omitempty"` 14813 // 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. 14814 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 14815 // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. 14816 EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` 14817 // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 14818 Encryption *Encryption `json:"encryption,omitempty"` 14819 // NetworkAccessPolicy - Possible values include: 'NetworkAccessPolicyAllowAll', 'NetworkAccessPolicyAllowPrivate', 'NetworkAccessPolicyDenyAll' 14820 NetworkAccessPolicy NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` 14821 // DiskAccessID - ARM id of the DiskAccess resource for using private endpoints on disks. 14822 DiskAccessID *string `json:"diskAccessId,omitempty"` 14823 // SupportsHibernation - Indicates the OS on a snapshot supports hibernation. 14824 SupportsHibernation *bool `json:"supportsHibernation,omitempty"` 14825} 14826 14827// SoftDeletePolicy contains information about the soft deletion policy of the gallery. 14828type SoftDeletePolicy struct { 14829 // IsSoftDeleteEnabled - Enables soft-deletion for resources in this gallery, allowing them to be recovered within retention time. 14830 IsSoftDeleteEnabled *bool `json:"isSoftDeleteEnabled,omitempty"` 14831} 14832 14833// SourceVault the vault id is an Azure Resource Manager Resource id in the form 14834// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName} 14835type SourceVault struct { 14836 // ID - Resource Id 14837 ID *string `json:"id,omitempty"` 14838} 14839 14840// SpotRestorePolicy specifies the Spot-Try-Restore properties for the virtual machine scale set. <br><br> 14841// With this property customer can enable or disable automatic restore of the evicted Spot VMSS VM 14842// instances opportunistically based on capacity availability and pricing constraint. 14843type SpotRestorePolicy struct { 14844 // Enabled - Enables the Spot-Try-Restore feature where evicted VMSS SPOT instances will be tried to be restored opportunistically based on capacity availability and pricing constraints 14845 Enabled *bool `json:"enabled,omitempty"` 14846 // RestoreTimeout - Timeout value expressed as an ISO 8601 time duration after which the platform will not try to restore the VMSS SPOT instances 14847 RestoreTimeout *string `json:"restoreTimeout,omitempty"` 14848} 14849 14850// SSHConfiguration SSH configuration for Linux based VMs running on Azure 14851type SSHConfiguration struct { 14852 // PublicKeys - The list of SSH public keys used to authenticate with linux based VMs. 14853 PublicKeys *[]SSHPublicKey `json:"publicKeys,omitempty"` 14854} 14855 14856// SSHPublicKey contains information about SSH certificate public key and the path on the Linux VM where 14857// the public key is placed. 14858type SSHPublicKey struct { 14859 // 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 14860 Path *string `json:"path,omitempty"` 14861 // 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). 14862 KeyData *string `json:"keyData,omitempty"` 14863} 14864 14865// SSHPublicKeyGenerateKeyPairResult response from generation of an SSH key pair. 14866type SSHPublicKeyGenerateKeyPairResult struct { 14867 autorest.Response `json:"-"` 14868 // 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. 14869 PrivateKey *string `json:"privateKey,omitempty"` 14870 // 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. 14871 PublicKey *string `json:"publicKey,omitempty"` 14872 // ID - The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{SshPublicKeyName} 14873 ID *string `json:"id,omitempty"` 14874} 14875 14876// SSHPublicKeyResource specifies information about the SSH public key. 14877type SSHPublicKeyResource struct { 14878 autorest.Response `json:"-"` 14879 // SSHPublicKeyResourceProperties - Properties of the SSH public key. 14880 *SSHPublicKeyResourceProperties `json:"properties,omitempty"` 14881 // ID - READ-ONLY; Resource Id 14882 ID *string `json:"id,omitempty"` 14883 // Name - READ-ONLY; Resource name 14884 Name *string `json:"name,omitempty"` 14885 // Type - READ-ONLY; Resource type 14886 Type *string `json:"type,omitempty"` 14887 // Location - Resource location 14888 Location *string `json:"location,omitempty"` 14889 // Tags - Resource tags 14890 Tags map[string]*string `json:"tags"` 14891} 14892 14893// MarshalJSON is the custom marshaler for SSHPublicKeyResource. 14894func (spkr SSHPublicKeyResource) MarshalJSON() ([]byte, error) { 14895 objectMap := make(map[string]interface{}) 14896 if spkr.SSHPublicKeyResourceProperties != nil { 14897 objectMap["properties"] = spkr.SSHPublicKeyResourceProperties 14898 } 14899 if spkr.Location != nil { 14900 objectMap["location"] = spkr.Location 14901 } 14902 if spkr.Tags != nil { 14903 objectMap["tags"] = spkr.Tags 14904 } 14905 return json.Marshal(objectMap) 14906} 14907 14908// UnmarshalJSON is the custom unmarshaler for SSHPublicKeyResource struct. 14909func (spkr *SSHPublicKeyResource) UnmarshalJSON(body []byte) error { 14910 var m map[string]*json.RawMessage 14911 err := json.Unmarshal(body, &m) 14912 if err != nil { 14913 return err 14914 } 14915 for k, v := range m { 14916 switch k { 14917 case "properties": 14918 if v != nil { 14919 var SSHPublicKeyResourceProperties SSHPublicKeyResourceProperties 14920 err = json.Unmarshal(*v, &SSHPublicKeyResourceProperties) 14921 if err != nil { 14922 return err 14923 } 14924 spkr.SSHPublicKeyResourceProperties = &SSHPublicKeyResourceProperties 14925 } 14926 case "id": 14927 if v != nil { 14928 var ID string 14929 err = json.Unmarshal(*v, &ID) 14930 if err != nil { 14931 return err 14932 } 14933 spkr.ID = &ID 14934 } 14935 case "name": 14936 if v != nil { 14937 var name string 14938 err = json.Unmarshal(*v, &name) 14939 if err != nil { 14940 return err 14941 } 14942 spkr.Name = &name 14943 } 14944 case "type": 14945 if v != nil { 14946 var typeVar string 14947 err = json.Unmarshal(*v, &typeVar) 14948 if err != nil { 14949 return err 14950 } 14951 spkr.Type = &typeVar 14952 } 14953 case "location": 14954 if v != nil { 14955 var location string 14956 err = json.Unmarshal(*v, &location) 14957 if err != nil { 14958 return err 14959 } 14960 spkr.Location = &location 14961 } 14962 case "tags": 14963 if v != nil { 14964 var tags map[string]*string 14965 err = json.Unmarshal(*v, &tags) 14966 if err != nil { 14967 return err 14968 } 14969 spkr.Tags = tags 14970 } 14971 } 14972 } 14973 14974 return nil 14975} 14976 14977// SSHPublicKeyResourceProperties properties of the SSH public key. 14978type SSHPublicKeyResourceProperties struct { 14979 // 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. 14980 PublicKey *string `json:"publicKey,omitempty"` 14981} 14982 14983// SSHPublicKeysGroupListResult the list SSH public keys operation response. 14984type SSHPublicKeysGroupListResult struct { 14985 autorest.Response `json:"-"` 14986 // Value - The list of SSH public keys 14987 Value *[]SSHPublicKeyResource `json:"value,omitempty"` 14988 // 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. 14989 NextLink *string `json:"nextLink,omitempty"` 14990} 14991 14992// SSHPublicKeysGroupListResultIterator provides access to a complete listing of SSHPublicKeyResource 14993// values. 14994type SSHPublicKeysGroupListResultIterator struct { 14995 i int 14996 page SSHPublicKeysGroupListResultPage 14997} 14998 14999// NextWithContext advances to the next value. If there was an error making 15000// the request the iterator does not advance and the error is returned. 15001func (iter *SSHPublicKeysGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { 15002 if tracing.IsEnabled() { 15003 ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysGroupListResultIterator.NextWithContext") 15004 defer func() { 15005 sc := -1 15006 if iter.Response().Response.Response != nil { 15007 sc = iter.Response().Response.Response.StatusCode 15008 } 15009 tracing.EndSpan(ctx, sc, err) 15010 }() 15011 } 15012 iter.i++ 15013 if iter.i < len(iter.page.Values()) { 15014 return nil 15015 } 15016 err = iter.page.NextWithContext(ctx) 15017 if err != nil { 15018 iter.i-- 15019 return err 15020 } 15021 iter.i = 0 15022 return nil 15023} 15024 15025// Next advances to the next value. If there was an error making 15026// the request the iterator does not advance and the error is returned. 15027// Deprecated: Use NextWithContext() instead. 15028func (iter *SSHPublicKeysGroupListResultIterator) Next() error { 15029 return iter.NextWithContext(context.Background()) 15030} 15031 15032// NotDone returns true if the enumeration should be started or is not yet complete. 15033func (iter SSHPublicKeysGroupListResultIterator) NotDone() bool { 15034 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 15035} 15036 15037// Response returns the raw server response from the last page request. 15038func (iter SSHPublicKeysGroupListResultIterator) Response() SSHPublicKeysGroupListResult { 15039 return iter.page.Response() 15040} 15041 15042// Value returns the current value or a zero-initialized value if the 15043// iterator has advanced beyond the end of the collection. 15044func (iter SSHPublicKeysGroupListResultIterator) Value() SSHPublicKeyResource { 15045 if !iter.page.NotDone() { 15046 return SSHPublicKeyResource{} 15047 } 15048 return iter.page.Values()[iter.i] 15049} 15050 15051// Creates a new instance of the SSHPublicKeysGroupListResultIterator type. 15052func NewSSHPublicKeysGroupListResultIterator(page SSHPublicKeysGroupListResultPage) SSHPublicKeysGroupListResultIterator { 15053 return SSHPublicKeysGroupListResultIterator{page: page} 15054} 15055 15056// IsEmpty returns true if the ListResult contains no values. 15057func (spkglr SSHPublicKeysGroupListResult) IsEmpty() bool { 15058 return spkglr.Value == nil || len(*spkglr.Value) == 0 15059} 15060 15061// hasNextLink returns true if the NextLink is not empty. 15062func (spkglr SSHPublicKeysGroupListResult) hasNextLink() bool { 15063 return spkglr.NextLink != nil && len(*spkglr.NextLink) != 0 15064} 15065 15066// sSHPublicKeysGroupListResultPreparer prepares a request to retrieve the next set of results. 15067// It returns nil if no more results exist. 15068func (spkglr SSHPublicKeysGroupListResult) sSHPublicKeysGroupListResultPreparer(ctx context.Context) (*http.Request, error) { 15069 if !spkglr.hasNextLink() { 15070 return nil, nil 15071 } 15072 return autorest.Prepare((&http.Request{}).WithContext(ctx), 15073 autorest.AsJSON(), 15074 autorest.AsGet(), 15075 autorest.WithBaseURL(to.String(spkglr.NextLink))) 15076} 15077 15078// SSHPublicKeysGroupListResultPage contains a page of SSHPublicKeyResource values. 15079type SSHPublicKeysGroupListResultPage struct { 15080 fn func(context.Context, SSHPublicKeysGroupListResult) (SSHPublicKeysGroupListResult, error) 15081 spkglr SSHPublicKeysGroupListResult 15082} 15083 15084// NextWithContext advances to the next page of values. If there was an error making 15085// the request the page does not advance and the error is returned. 15086func (page *SSHPublicKeysGroupListResultPage) NextWithContext(ctx context.Context) (err error) { 15087 if tracing.IsEnabled() { 15088 ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysGroupListResultPage.NextWithContext") 15089 defer func() { 15090 sc := -1 15091 if page.Response().Response.Response != nil { 15092 sc = page.Response().Response.Response.StatusCode 15093 } 15094 tracing.EndSpan(ctx, sc, err) 15095 }() 15096 } 15097 for { 15098 next, err := page.fn(ctx, page.spkglr) 15099 if err != nil { 15100 return err 15101 } 15102 page.spkglr = next 15103 if !next.hasNextLink() || !next.IsEmpty() { 15104 break 15105 } 15106 } 15107 return nil 15108} 15109 15110// Next advances to the next page of values. If there was an error making 15111// the request the page does not advance and the error is returned. 15112// Deprecated: Use NextWithContext() instead. 15113func (page *SSHPublicKeysGroupListResultPage) Next() error { 15114 return page.NextWithContext(context.Background()) 15115} 15116 15117// NotDone returns true if the page enumeration should be started or is not yet complete. 15118func (page SSHPublicKeysGroupListResultPage) NotDone() bool { 15119 return !page.spkglr.IsEmpty() 15120} 15121 15122// Response returns the raw server response from the last page request. 15123func (page SSHPublicKeysGroupListResultPage) Response() SSHPublicKeysGroupListResult { 15124 return page.spkglr 15125} 15126 15127// Values returns the slice of values for the current page or nil if there are no values. 15128func (page SSHPublicKeysGroupListResultPage) Values() []SSHPublicKeyResource { 15129 if page.spkglr.IsEmpty() { 15130 return nil 15131 } 15132 return *page.spkglr.Value 15133} 15134 15135// Creates a new instance of the SSHPublicKeysGroupListResultPage type. 15136func NewSSHPublicKeysGroupListResultPage(cur SSHPublicKeysGroupListResult, getNextPage func(context.Context, SSHPublicKeysGroupListResult) (SSHPublicKeysGroupListResult, error)) SSHPublicKeysGroupListResultPage { 15137 return SSHPublicKeysGroupListResultPage{ 15138 fn: getNextPage, 15139 spkglr: cur, 15140 } 15141} 15142 15143// SSHPublicKeyUpdateResource specifies information about the SSH public key. 15144type SSHPublicKeyUpdateResource struct { 15145 // SSHPublicKeyResourceProperties - Properties of the SSH public key. 15146 *SSHPublicKeyResourceProperties `json:"properties,omitempty"` 15147 // Tags - Resource tags 15148 Tags map[string]*string `json:"tags"` 15149} 15150 15151// MarshalJSON is the custom marshaler for SSHPublicKeyUpdateResource. 15152func (spkur SSHPublicKeyUpdateResource) MarshalJSON() ([]byte, error) { 15153 objectMap := make(map[string]interface{}) 15154 if spkur.SSHPublicKeyResourceProperties != nil { 15155 objectMap["properties"] = spkur.SSHPublicKeyResourceProperties 15156 } 15157 if spkur.Tags != nil { 15158 objectMap["tags"] = spkur.Tags 15159 } 15160 return json.Marshal(objectMap) 15161} 15162 15163// UnmarshalJSON is the custom unmarshaler for SSHPublicKeyUpdateResource struct. 15164func (spkur *SSHPublicKeyUpdateResource) UnmarshalJSON(body []byte) error { 15165 var m map[string]*json.RawMessage 15166 err := json.Unmarshal(body, &m) 15167 if err != nil { 15168 return err 15169 } 15170 for k, v := range m { 15171 switch k { 15172 case "properties": 15173 if v != nil { 15174 var SSHPublicKeyResourceProperties SSHPublicKeyResourceProperties 15175 err = json.Unmarshal(*v, &SSHPublicKeyResourceProperties) 15176 if err != nil { 15177 return err 15178 } 15179 spkur.SSHPublicKeyResourceProperties = &SSHPublicKeyResourceProperties 15180 } 15181 case "tags": 15182 if v != nil { 15183 var tags map[string]*string 15184 err = json.Unmarshal(*v, &tags) 15185 if err != nil { 15186 return err 15187 } 15188 spkur.Tags = tags 15189 } 15190 } 15191 } 15192 15193 return nil 15194} 15195 15196// StatusCodeCount ... 15197type StatusCodeCount struct { 15198 // Code - READ-ONLY; The instance view status code 15199 Code *string `json:"code,omitempty"` 15200 // Count - READ-ONLY; Number of instances having this status code 15201 Count *int32 `json:"count,omitempty"` 15202} 15203 15204// MarshalJSON is the custom marshaler for StatusCodeCount. 15205func (scc StatusCodeCount) MarshalJSON() ([]byte, error) { 15206 objectMap := make(map[string]interface{}) 15207 return json.Marshal(objectMap) 15208} 15209 15210// StorageProfile specifies the storage settings for the virtual machine disks. 15211type StorageProfile struct { 15212 // 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. 15213 ImageReference *ImageReference `json:"imageReference,omitempty"` 15214 // 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). 15215 OsDisk *OSDisk `json:"osDisk,omitempty"` 15216 // 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). 15217 DataDisks *[]DataDisk `json:"dataDisks,omitempty"` 15218} 15219 15220// SubResource ... 15221type SubResource struct { 15222 // ID - Resource Id 15223 ID *string `json:"id,omitempty"` 15224} 15225 15226// SubResourceReadOnly ... 15227type SubResourceReadOnly struct { 15228 // ID - READ-ONLY; Resource Id 15229 ID *string `json:"id,omitempty"` 15230} 15231 15232// MarshalJSON is the custom marshaler for SubResourceReadOnly. 15233func (srro SubResourceReadOnly) MarshalJSON() ([]byte, error) { 15234 objectMap := make(map[string]interface{}) 15235 return json.Marshal(objectMap) 15236} 15237 15238// SubResourceWithColocationStatus ... 15239type SubResourceWithColocationStatus struct { 15240 // ColocationStatus - Describes colocation status of a resource in the Proximity Placement Group. 15241 ColocationStatus *InstanceViewStatus `json:"colocationStatus,omitempty"` 15242 // ID - Resource Id 15243 ID *string `json:"id,omitempty"` 15244} 15245 15246// TargetRegion describes the target region information. 15247type TargetRegion struct { 15248 // Name - The name of the region. 15249 Name *string `json:"name,omitempty"` 15250 // RegionalReplicaCount - The number of replicas of the Image Version to be created per region. This property is updatable. 15251 RegionalReplicaCount *int32 `json:"regionalReplicaCount,omitempty"` 15252 // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' 15253 StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` 15254 Encryption *EncryptionImages `json:"encryption,omitempty"` 15255} 15256 15257// TerminateNotificationProfile ... 15258type TerminateNotificationProfile struct { 15259 // 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) 15260 NotBeforeTimeout *string `json:"notBeforeTimeout,omitempty"` 15261 // Enable - Specifies whether the Terminate Scheduled event is enabled or disabled. 15262 Enable *bool `json:"enable,omitempty"` 15263} 15264 15265// ThrottledRequestsInput api request input for LogAnalytics getThrottledRequests Api. 15266type ThrottledRequestsInput struct { 15267 // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. 15268 BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` 15269 // FromTime - From time of the query 15270 FromTime *date.Time `json:"fromTime,omitempty"` 15271 // ToTime - To time of the query 15272 ToTime *date.Time `json:"toTime,omitempty"` 15273 // GroupByThrottlePolicy - Group query result by Throttle Policy applied. 15274 GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` 15275 // GroupByOperationName - Group query result by Operation Name. 15276 GroupByOperationName *bool `json:"groupByOperationName,omitempty"` 15277 // GroupByResourceName - Group query result by Resource Name. 15278 GroupByResourceName *bool `json:"groupByResourceName,omitempty"` 15279 // GroupByClientApplicationID - Group query result by Client Application ID. 15280 GroupByClientApplicationID *bool `json:"groupByClientApplicationId,omitempty"` 15281 // GroupByUserAgent - Group query result by User Agent. 15282 GroupByUserAgent *bool `json:"groupByUserAgent,omitempty"` 15283} 15284 15285// UefiSettings specifies the security settings like secure boot and vTPM used while creating the virtual 15286// machine. <br><br>Minimum api-version: 2020-12-01 15287type UefiSettings struct { 15288 // SecureBootEnabled - Specifies whether secure boot should be enabled on the virtual machine. <br><br>Minimum api-version: 2020-12-01 15289 SecureBootEnabled *bool `json:"secureBootEnabled,omitempty"` 15290 // VTpmEnabled - Specifies whether vTPM should be enabled on the virtual machine. <br><br>Minimum api-version: 2020-12-01 15291 VTpmEnabled *bool `json:"vTpmEnabled,omitempty"` 15292} 15293 15294// UpdateDomain defines an update domain for the cloud service. 15295type UpdateDomain struct { 15296 autorest.Response `json:"-"` 15297 // ID - READ-ONLY; Resource Id 15298 ID *string `json:"id,omitempty"` 15299 // Name - READ-ONLY; Resource Name 15300 Name *string `json:"name,omitempty"` 15301} 15302 15303// MarshalJSON is the custom marshaler for UpdateDomain. 15304func (ud UpdateDomain) MarshalJSON() ([]byte, error) { 15305 objectMap := make(map[string]interface{}) 15306 return json.Marshal(objectMap) 15307} 15308 15309// UpdateDomainListResult ... 15310type UpdateDomainListResult struct { 15311 autorest.Response `json:"-"` 15312 Value *[]UpdateDomain `json:"value,omitempty"` 15313 NextLink *string `json:"nextLink,omitempty"` 15314} 15315 15316// UpdateDomainListResultIterator provides access to a complete listing of UpdateDomain values. 15317type UpdateDomainListResultIterator struct { 15318 i int 15319 page UpdateDomainListResultPage 15320} 15321 15322// NextWithContext advances to the next value. If there was an error making 15323// the request the iterator does not advance and the error is returned. 15324func (iter *UpdateDomainListResultIterator) NextWithContext(ctx context.Context) (err error) { 15325 if tracing.IsEnabled() { 15326 ctx = tracing.StartSpan(ctx, fqdn+"/UpdateDomainListResultIterator.NextWithContext") 15327 defer func() { 15328 sc := -1 15329 if iter.Response().Response.Response != nil { 15330 sc = iter.Response().Response.Response.StatusCode 15331 } 15332 tracing.EndSpan(ctx, sc, err) 15333 }() 15334 } 15335 iter.i++ 15336 if iter.i < len(iter.page.Values()) { 15337 return nil 15338 } 15339 err = iter.page.NextWithContext(ctx) 15340 if err != nil { 15341 iter.i-- 15342 return err 15343 } 15344 iter.i = 0 15345 return nil 15346} 15347 15348// Next advances to the next value. If there was an error making 15349// the request the iterator does not advance and the error is returned. 15350// Deprecated: Use NextWithContext() instead. 15351func (iter *UpdateDomainListResultIterator) Next() error { 15352 return iter.NextWithContext(context.Background()) 15353} 15354 15355// NotDone returns true if the enumeration should be started or is not yet complete. 15356func (iter UpdateDomainListResultIterator) NotDone() bool { 15357 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 15358} 15359 15360// Response returns the raw server response from the last page request. 15361func (iter UpdateDomainListResultIterator) Response() UpdateDomainListResult { 15362 return iter.page.Response() 15363} 15364 15365// Value returns the current value or a zero-initialized value if the 15366// iterator has advanced beyond the end of the collection. 15367func (iter UpdateDomainListResultIterator) Value() UpdateDomain { 15368 if !iter.page.NotDone() { 15369 return UpdateDomain{} 15370 } 15371 return iter.page.Values()[iter.i] 15372} 15373 15374// Creates a new instance of the UpdateDomainListResultIterator type. 15375func NewUpdateDomainListResultIterator(page UpdateDomainListResultPage) UpdateDomainListResultIterator { 15376 return UpdateDomainListResultIterator{page: page} 15377} 15378 15379// IsEmpty returns true if the ListResult contains no values. 15380func (udlr UpdateDomainListResult) IsEmpty() bool { 15381 return udlr.Value == nil || len(*udlr.Value) == 0 15382} 15383 15384// hasNextLink returns true if the NextLink is not empty. 15385func (udlr UpdateDomainListResult) hasNextLink() bool { 15386 return udlr.NextLink != nil && len(*udlr.NextLink) != 0 15387} 15388 15389// updateDomainListResultPreparer prepares a request to retrieve the next set of results. 15390// It returns nil if no more results exist. 15391func (udlr UpdateDomainListResult) updateDomainListResultPreparer(ctx context.Context) (*http.Request, error) { 15392 if !udlr.hasNextLink() { 15393 return nil, nil 15394 } 15395 return autorest.Prepare((&http.Request{}).WithContext(ctx), 15396 autorest.AsJSON(), 15397 autorest.AsGet(), 15398 autorest.WithBaseURL(to.String(udlr.NextLink))) 15399} 15400 15401// UpdateDomainListResultPage contains a page of UpdateDomain values. 15402type UpdateDomainListResultPage struct { 15403 fn func(context.Context, UpdateDomainListResult) (UpdateDomainListResult, error) 15404 udlr UpdateDomainListResult 15405} 15406 15407// NextWithContext advances to the next page of values. If there was an error making 15408// the request the page does not advance and the error is returned. 15409func (page *UpdateDomainListResultPage) NextWithContext(ctx context.Context) (err error) { 15410 if tracing.IsEnabled() { 15411 ctx = tracing.StartSpan(ctx, fqdn+"/UpdateDomainListResultPage.NextWithContext") 15412 defer func() { 15413 sc := -1 15414 if page.Response().Response.Response != nil { 15415 sc = page.Response().Response.Response.StatusCode 15416 } 15417 tracing.EndSpan(ctx, sc, err) 15418 }() 15419 } 15420 for { 15421 next, err := page.fn(ctx, page.udlr) 15422 if err != nil { 15423 return err 15424 } 15425 page.udlr = next 15426 if !next.hasNextLink() || !next.IsEmpty() { 15427 break 15428 } 15429 } 15430 return nil 15431} 15432 15433// Next advances to the next page of values. If there was an error making 15434// the request the page does not advance and the error is returned. 15435// Deprecated: Use NextWithContext() instead. 15436func (page *UpdateDomainListResultPage) Next() error { 15437 return page.NextWithContext(context.Background()) 15438} 15439 15440// NotDone returns true if the page enumeration should be started or is not yet complete. 15441func (page UpdateDomainListResultPage) NotDone() bool { 15442 return !page.udlr.IsEmpty() 15443} 15444 15445// Response returns the raw server response from the last page request. 15446func (page UpdateDomainListResultPage) Response() UpdateDomainListResult { 15447 return page.udlr 15448} 15449 15450// Values returns the slice of values for the current page or nil if there are no values. 15451func (page UpdateDomainListResultPage) Values() []UpdateDomain { 15452 if page.udlr.IsEmpty() { 15453 return nil 15454 } 15455 return *page.udlr.Value 15456} 15457 15458// Creates a new instance of the UpdateDomainListResultPage type. 15459func NewUpdateDomainListResultPage(cur UpdateDomainListResult, getNextPage func(context.Context, UpdateDomainListResult) (UpdateDomainListResult, error)) UpdateDomainListResultPage { 15460 return UpdateDomainListResultPage{ 15461 fn: getNextPage, 15462 udlr: cur, 15463 } 15464} 15465 15466// UpdateResource the Update Resource model definition. 15467type UpdateResource struct { 15468 // Tags - Resource tags 15469 Tags map[string]*string `json:"tags"` 15470} 15471 15472// MarshalJSON is the custom marshaler for UpdateResource. 15473func (ur UpdateResource) MarshalJSON() ([]byte, error) { 15474 objectMap := make(map[string]interface{}) 15475 if ur.Tags != nil { 15476 objectMap["tags"] = ur.Tags 15477 } 15478 return json.Marshal(objectMap) 15479} 15480 15481// UpdateResourceDefinition the Update Resource model definition. 15482type UpdateResourceDefinition struct { 15483 // ID - READ-ONLY; Resource Id 15484 ID *string `json:"id,omitempty"` 15485 // Name - READ-ONLY; Resource name 15486 Name *string `json:"name,omitempty"` 15487 // Type - READ-ONLY; Resource type 15488 Type *string `json:"type,omitempty"` 15489 // Tags - Resource tags 15490 Tags map[string]*string `json:"tags"` 15491} 15492 15493// MarshalJSON is the custom marshaler for UpdateResourceDefinition. 15494func (urd UpdateResourceDefinition) MarshalJSON() ([]byte, error) { 15495 objectMap := make(map[string]interface{}) 15496 if urd.Tags != nil { 15497 objectMap["tags"] = urd.Tags 15498 } 15499 return json.Marshal(objectMap) 15500} 15501 15502// UpgradeOperationHistoricalStatusInfo virtual Machine Scale Set OS Upgrade History operation response. 15503type UpgradeOperationHistoricalStatusInfo struct { 15504 // Properties - READ-ONLY; Information about the properties of the upgrade operation. 15505 Properties *UpgradeOperationHistoricalStatusInfoProperties `json:"properties,omitempty"` 15506 // Type - READ-ONLY; Resource type 15507 Type *string `json:"type,omitempty"` 15508 // Location - READ-ONLY; Resource location 15509 Location *string `json:"location,omitempty"` 15510} 15511 15512// MarshalJSON is the custom marshaler for UpgradeOperationHistoricalStatusInfo. 15513func (uohsi UpgradeOperationHistoricalStatusInfo) MarshalJSON() ([]byte, error) { 15514 objectMap := make(map[string]interface{}) 15515 return json.Marshal(objectMap) 15516} 15517 15518// UpgradeOperationHistoricalStatusInfoProperties describes each OS upgrade on the Virtual Machine Scale 15519// Set. 15520type UpgradeOperationHistoricalStatusInfoProperties struct { 15521 // RunningStatus - READ-ONLY; Information about the overall status of the upgrade operation. 15522 RunningStatus *UpgradeOperationHistoryStatus `json:"runningStatus,omitempty"` 15523 // Progress - READ-ONLY; Counts of the VMs in each state. 15524 Progress *RollingUpgradeProgressInfo `json:"progress,omitempty"` 15525 // Error - READ-ONLY; Error Details for this upgrade if there are any. 15526 Error *APIError `json:"error,omitempty"` 15527 // StartedBy - READ-ONLY; Invoker of the Upgrade Operation. Possible values include: 'UpgradeOperationInvokerUnknown', 'UpgradeOperationInvokerUser', 'UpgradeOperationInvokerPlatform' 15528 StartedBy UpgradeOperationInvoker `json:"startedBy,omitempty"` 15529 // TargetImageReference - READ-ONLY; Image Reference details 15530 TargetImageReference *ImageReference `json:"targetImageReference,omitempty"` 15531 // RollbackInfo - READ-ONLY; Information about OS rollback if performed 15532 RollbackInfo *RollbackStatusInfo `json:"rollbackInfo,omitempty"` 15533} 15534 15535// MarshalJSON is the custom marshaler for UpgradeOperationHistoricalStatusInfoProperties. 15536func (uohsip UpgradeOperationHistoricalStatusInfoProperties) MarshalJSON() ([]byte, error) { 15537 objectMap := make(map[string]interface{}) 15538 return json.Marshal(objectMap) 15539} 15540 15541// UpgradeOperationHistoryStatus information about the current running state of the overall upgrade. 15542type UpgradeOperationHistoryStatus struct { 15543 // Code - READ-ONLY; Code indicating the current status of the upgrade. Possible values include: 'UpgradeStateRollingForward', 'UpgradeStateCancelled', 'UpgradeStateCompleted', 'UpgradeStateFaulted' 15544 Code UpgradeState `json:"code,omitempty"` 15545 // StartTime - READ-ONLY; Start time of the upgrade. 15546 StartTime *date.Time `json:"startTime,omitempty"` 15547 // EndTime - READ-ONLY; End time of the upgrade. 15548 EndTime *date.Time `json:"endTime,omitempty"` 15549} 15550 15551// MarshalJSON is the custom marshaler for UpgradeOperationHistoryStatus. 15552func (uohs UpgradeOperationHistoryStatus) MarshalJSON() ([]byte, error) { 15553 objectMap := make(map[string]interface{}) 15554 return json.Marshal(objectMap) 15555} 15556 15557// UpgradePolicy describes an upgrade policy - automatic, manual, or rolling. 15558type UpgradePolicy struct { 15559 // 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' 15560 Mode UpgradeMode `json:"mode,omitempty"` 15561 // RollingUpgradePolicy - The configuration parameters used while performing a rolling upgrade. 15562 RollingUpgradePolicy *RollingUpgradePolicy `json:"rollingUpgradePolicy,omitempty"` 15563 // AutomaticOSUpgradePolicy - Configuration parameters used for performing automatic OS Upgrade. 15564 AutomaticOSUpgradePolicy *AutomaticOSUpgradePolicy `json:"automaticOSUpgradePolicy,omitempty"` 15565} 15566 15567// Usage describes Compute Resource Usage. 15568type Usage struct { 15569 // Unit - An enum describing the unit of usage measurement. 15570 Unit *string `json:"unit,omitempty"` 15571 // CurrentValue - The current usage of the resource. 15572 CurrentValue *int32 `json:"currentValue,omitempty"` 15573 // Limit - The maximum permitted usage of the resource. 15574 Limit *int64 `json:"limit,omitempty"` 15575 // Name - The name of the type of usage. 15576 Name *UsageName `json:"name,omitempty"` 15577} 15578 15579// UsageName the Usage Names. 15580type UsageName struct { 15581 // Value - The name of the resource. 15582 Value *string `json:"value,omitempty"` 15583 // LocalizedValue - The localized name of the resource. 15584 LocalizedValue *string `json:"localizedValue,omitempty"` 15585} 15586 15587// UserArtifactManage ... 15588type UserArtifactManage struct { 15589 // Install - Required. The path and arguments to install the gallery application. This is limited to 4096 characters. 15590 Install *string `json:"install,omitempty"` 15591 // Remove - Required. The path and arguments to remove the gallery application. This is limited to 4096 characters. 15592 Remove *string `json:"remove,omitempty"` 15593 // 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. 15594 Update *string `json:"update,omitempty"` 15595} 15596 15597// UserArtifactSource the source image from which the Image Version is going to be created. 15598type UserArtifactSource struct { 15599 // MediaLink - Required. The mediaLink of the artifact, must be a readable storage page blob. 15600 MediaLink *string `json:"mediaLink,omitempty"` 15601 // DefaultConfigurationLink - Optional. The defaultConfigurationLink of the artifact, must be a readable storage page blob. 15602 DefaultConfigurationLink *string `json:"defaultConfigurationLink,omitempty"` 15603} 15604 15605// VaultCertificate describes a single certificate reference in a Key Vault, and where the certificate 15606// should reside on the VM. 15607type VaultCertificate struct { 15608 // 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>} <br> To install certificates on a virtual machine it is recommended to use the [Azure Key Vault virtual machine extension for Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) or the [Azure Key Vault virtual machine extension for Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). 15609 CertificateURL *string `json:"certificateUrl,omitempty"` 15610 // 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. 15611 CertificateStore *string `json:"certificateStore,omitempty"` 15612} 15613 15614// VaultSecretGroup describes a set of certificates which are all in the same Key Vault. 15615type VaultSecretGroup struct { 15616 // SourceVault - The relative URL of the Key Vault containing all of the certificates in VaultCertificates. 15617 SourceVault *SubResource `json:"sourceVault,omitempty"` 15618 // VaultCertificates - The list of key vault references in SourceVault which contain certificates. 15619 VaultCertificates *[]VaultCertificate `json:"vaultCertificates,omitempty"` 15620} 15621 15622// VirtualHardDisk describes the uri of a disk. 15623type VirtualHardDisk struct { 15624 // URI - Specifies the virtual hard disk's uri. 15625 URI *string `json:"uri,omitempty"` 15626} 15627 15628// VirtualMachine describes a Virtual Machine. 15629type VirtualMachine struct { 15630 autorest.Response `json:"-"` 15631 // 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**. 15632 Plan *Plan `json:"plan,omitempty"` 15633 *VirtualMachineProperties `json:"properties,omitempty"` 15634 // Resources - READ-ONLY; The virtual machine child extension resources. 15635 Resources *[]VirtualMachineExtension `json:"resources,omitempty"` 15636 // Identity - The identity of the virtual machine, if configured. 15637 Identity *VirtualMachineIdentity `json:"identity,omitempty"` 15638 // Zones - The virtual machine zones. 15639 Zones *[]string `json:"zones,omitempty"` 15640 // ExtendedLocation - The extended location of the Virtual Machine. 15641 ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` 15642 // ID - READ-ONLY; Resource Id 15643 ID *string `json:"id,omitempty"` 15644 // Name - READ-ONLY; Resource name 15645 Name *string `json:"name,omitempty"` 15646 // Type - READ-ONLY; Resource type 15647 Type *string `json:"type,omitempty"` 15648 // Location - Resource location 15649 Location *string `json:"location,omitempty"` 15650 // Tags - Resource tags 15651 Tags map[string]*string `json:"tags"` 15652} 15653 15654// MarshalJSON is the custom marshaler for VirtualMachine. 15655func (VM VirtualMachine) MarshalJSON() ([]byte, error) { 15656 objectMap := make(map[string]interface{}) 15657 if VM.Plan != nil { 15658 objectMap["plan"] = VM.Plan 15659 } 15660 if VM.VirtualMachineProperties != nil { 15661 objectMap["properties"] = VM.VirtualMachineProperties 15662 } 15663 if VM.Identity != nil { 15664 objectMap["identity"] = VM.Identity 15665 } 15666 if VM.Zones != nil { 15667 objectMap["zones"] = VM.Zones 15668 } 15669 if VM.ExtendedLocation != nil { 15670 objectMap["extendedLocation"] = VM.ExtendedLocation 15671 } 15672 if VM.Location != nil { 15673 objectMap["location"] = VM.Location 15674 } 15675 if VM.Tags != nil { 15676 objectMap["tags"] = VM.Tags 15677 } 15678 return json.Marshal(objectMap) 15679} 15680 15681// UnmarshalJSON is the custom unmarshaler for VirtualMachine struct. 15682func (VM *VirtualMachine) UnmarshalJSON(body []byte) error { 15683 var m map[string]*json.RawMessage 15684 err := json.Unmarshal(body, &m) 15685 if err != nil { 15686 return err 15687 } 15688 for k, v := range m { 15689 switch k { 15690 case "plan": 15691 if v != nil { 15692 var plan Plan 15693 err = json.Unmarshal(*v, &plan) 15694 if err != nil { 15695 return err 15696 } 15697 VM.Plan = &plan 15698 } 15699 case "properties": 15700 if v != nil { 15701 var virtualMachineProperties VirtualMachineProperties 15702 err = json.Unmarshal(*v, &virtualMachineProperties) 15703 if err != nil { 15704 return err 15705 } 15706 VM.VirtualMachineProperties = &virtualMachineProperties 15707 } 15708 case "resources": 15709 if v != nil { 15710 var resources []VirtualMachineExtension 15711 err = json.Unmarshal(*v, &resources) 15712 if err != nil { 15713 return err 15714 } 15715 VM.Resources = &resources 15716 } 15717 case "identity": 15718 if v != nil { 15719 var identity VirtualMachineIdentity 15720 err = json.Unmarshal(*v, &identity) 15721 if err != nil { 15722 return err 15723 } 15724 VM.Identity = &identity 15725 } 15726 case "zones": 15727 if v != nil { 15728 var zones []string 15729 err = json.Unmarshal(*v, &zones) 15730 if err != nil { 15731 return err 15732 } 15733 VM.Zones = &zones 15734 } 15735 case "extendedLocation": 15736 if v != nil { 15737 var extendedLocation ExtendedLocation 15738 err = json.Unmarshal(*v, &extendedLocation) 15739 if err != nil { 15740 return err 15741 } 15742 VM.ExtendedLocation = &extendedLocation 15743 } 15744 case "id": 15745 if v != nil { 15746 var ID string 15747 err = json.Unmarshal(*v, &ID) 15748 if err != nil { 15749 return err 15750 } 15751 VM.ID = &ID 15752 } 15753 case "name": 15754 if v != nil { 15755 var name string 15756 err = json.Unmarshal(*v, &name) 15757 if err != nil { 15758 return err 15759 } 15760 VM.Name = &name 15761 } 15762 case "type": 15763 if v != nil { 15764 var typeVar string 15765 err = json.Unmarshal(*v, &typeVar) 15766 if err != nil { 15767 return err 15768 } 15769 VM.Type = &typeVar 15770 } 15771 case "location": 15772 if v != nil { 15773 var location string 15774 err = json.Unmarshal(*v, &location) 15775 if err != nil { 15776 return err 15777 } 15778 VM.Location = &location 15779 } 15780 case "tags": 15781 if v != nil { 15782 var tags map[string]*string 15783 err = json.Unmarshal(*v, &tags) 15784 if err != nil { 15785 return err 15786 } 15787 VM.Tags = tags 15788 } 15789 } 15790 } 15791 15792 return nil 15793} 15794 15795// VirtualMachineAgentInstanceView the instance view of the VM Agent running on the virtual machine. 15796type VirtualMachineAgentInstanceView struct { 15797 // VMAgentVersion - The VM Agent full version. 15798 VMAgentVersion *string `json:"vmAgentVersion,omitempty"` 15799 // ExtensionHandlers - The virtual machine extension handler instance view. 15800 ExtensionHandlers *[]VirtualMachineExtensionHandlerInstanceView `json:"extensionHandlers,omitempty"` 15801 // Statuses - The resource status information. 15802 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 15803} 15804 15805// VirtualMachineAssessPatchesResult describes the properties of an AssessPatches result. 15806type VirtualMachineAssessPatchesResult struct { 15807 autorest.Response `json:"-"` 15808 // 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' 15809 Status PatchOperationStatus `json:"status,omitempty"` 15810 // AssessmentActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. 15811 AssessmentActivityID *string `json:"assessmentActivityId,omitempty"` 15812 // 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. 15813 RebootPending *bool `json:"rebootPending,omitempty"` 15814 // CriticalAndSecurityPatchCount - READ-ONLY; The number of critical or security patches that have been detected as available and not yet installed. 15815 CriticalAndSecurityPatchCount *int32 `json:"criticalAndSecurityPatchCount,omitempty"` 15816 // OtherPatchCount - READ-ONLY; The number of all available patches excluding critical and security. 15817 OtherPatchCount *int32 `json:"otherPatchCount,omitempty"` 15818 // StartDateTime - READ-ONLY; The UTC timestamp when the operation began. 15819 StartDateTime *date.Time `json:"startDateTime,omitempty"` 15820 // AvailablePatches - READ-ONLY; The list of patches that have been detected as available for installation. 15821 AvailablePatches *[]VirtualMachineSoftwarePatchProperties `json:"availablePatches,omitempty"` 15822 // Error - READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. 15823 Error *APIError `json:"error,omitempty"` 15824} 15825 15826// MarshalJSON is the custom marshaler for VirtualMachineAssessPatchesResult. 15827func (vmapr VirtualMachineAssessPatchesResult) MarshalJSON() ([]byte, error) { 15828 objectMap := make(map[string]interface{}) 15829 return json.Marshal(objectMap) 15830} 15831 15832// VirtualMachineCaptureParameters capture Virtual Machine parameters. 15833type VirtualMachineCaptureParameters struct { 15834 // VhdPrefix - The captured virtual hard disk's name prefix. 15835 VhdPrefix *string `json:"vhdPrefix,omitempty"` 15836 // DestinationContainerName - The destination container name. 15837 DestinationContainerName *string `json:"destinationContainerName,omitempty"` 15838 // OverwriteVhds - Specifies whether to overwrite the destination virtual hard disk, in case of conflict. 15839 OverwriteVhds *bool `json:"overwriteVhds,omitempty"` 15840} 15841 15842// VirtualMachineCaptureResult output of virtual machine capture operation. 15843type VirtualMachineCaptureResult struct { 15844 autorest.Response `json:"-"` 15845 // Schema - READ-ONLY; the schema of the captured virtual machine 15846 Schema *string `json:"$schema,omitempty"` 15847 // ContentVersion - READ-ONLY; the version of the content 15848 ContentVersion *string `json:"contentVersion,omitempty"` 15849 // Parameters - READ-ONLY; parameters of the captured virtual machine 15850 Parameters interface{} `json:"parameters,omitempty"` 15851 // Resources - READ-ONLY; a list of resource items of the captured virtual machine 15852 Resources *[]interface{} `json:"resources,omitempty"` 15853 // ID - Resource Id 15854 ID *string `json:"id,omitempty"` 15855} 15856 15857// MarshalJSON is the custom marshaler for VirtualMachineCaptureResult. 15858func (vmcr VirtualMachineCaptureResult) MarshalJSON() ([]byte, error) { 15859 objectMap := make(map[string]interface{}) 15860 if vmcr.ID != nil { 15861 objectMap["id"] = vmcr.ID 15862 } 15863 return json.Marshal(objectMap) 15864} 15865 15866// VirtualMachineExtension describes a Virtual Machine Extension. 15867type VirtualMachineExtension struct { 15868 autorest.Response `json:"-"` 15869 *VirtualMachineExtensionProperties `json:"properties,omitempty"` 15870 // ID - READ-ONLY; Resource Id 15871 ID *string `json:"id,omitempty"` 15872 // Name - READ-ONLY; Resource name 15873 Name *string `json:"name,omitempty"` 15874 // Type - READ-ONLY; Resource type 15875 Type *string `json:"type,omitempty"` 15876 // Location - Resource location 15877 Location *string `json:"location,omitempty"` 15878 // Tags - Resource tags 15879 Tags map[string]*string `json:"tags"` 15880} 15881 15882// MarshalJSON is the custom marshaler for VirtualMachineExtension. 15883func (vme VirtualMachineExtension) MarshalJSON() ([]byte, error) { 15884 objectMap := make(map[string]interface{}) 15885 if vme.VirtualMachineExtensionProperties != nil { 15886 objectMap["properties"] = vme.VirtualMachineExtensionProperties 15887 } 15888 if vme.Location != nil { 15889 objectMap["location"] = vme.Location 15890 } 15891 if vme.Tags != nil { 15892 objectMap["tags"] = vme.Tags 15893 } 15894 return json.Marshal(objectMap) 15895} 15896 15897// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtension struct. 15898func (vme *VirtualMachineExtension) UnmarshalJSON(body []byte) error { 15899 var m map[string]*json.RawMessage 15900 err := json.Unmarshal(body, &m) 15901 if err != nil { 15902 return err 15903 } 15904 for k, v := range m { 15905 switch k { 15906 case "properties": 15907 if v != nil { 15908 var virtualMachineExtensionProperties VirtualMachineExtensionProperties 15909 err = json.Unmarshal(*v, &virtualMachineExtensionProperties) 15910 if err != nil { 15911 return err 15912 } 15913 vme.VirtualMachineExtensionProperties = &virtualMachineExtensionProperties 15914 } 15915 case "id": 15916 if v != nil { 15917 var ID string 15918 err = json.Unmarshal(*v, &ID) 15919 if err != nil { 15920 return err 15921 } 15922 vme.ID = &ID 15923 } 15924 case "name": 15925 if v != nil { 15926 var name string 15927 err = json.Unmarshal(*v, &name) 15928 if err != nil { 15929 return err 15930 } 15931 vme.Name = &name 15932 } 15933 case "type": 15934 if v != nil { 15935 var typeVar string 15936 err = json.Unmarshal(*v, &typeVar) 15937 if err != nil { 15938 return err 15939 } 15940 vme.Type = &typeVar 15941 } 15942 case "location": 15943 if v != nil { 15944 var location string 15945 err = json.Unmarshal(*v, &location) 15946 if err != nil { 15947 return err 15948 } 15949 vme.Location = &location 15950 } 15951 case "tags": 15952 if v != nil { 15953 var tags map[string]*string 15954 err = json.Unmarshal(*v, &tags) 15955 if err != nil { 15956 return err 15957 } 15958 vme.Tags = tags 15959 } 15960 } 15961 } 15962 15963 return nil 15964} 15965 15966// VirtualMachineExtensionHandlerInstanceView the instance view of a virtual machine extension handler. 15967type VirtualMachineExtensionHandlerInstanceView struct { 15968 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 15969 Type *string `json:"type,omitempty"` 15970 // TypeHandlerVersion - Specifies the version of the script handler. 15971 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 15972 // Status - The extension handler status. 15973 Status *InstanceViewStatus `json:"status,omitempty"` 15974} 15975 15976// VirtualMachineExtensionImage describes a Virtual Machine Extension Image. 15977type VirtualMachineExtensionImage struct { 15978 autorest.Response `json:"-"` 15979 *VirtualMachineExtensionImageProperties `json:"properties,omitempty"` 15980 // ID - READ-ONLY; Resource Id 15981 ID *string `json:"id,omitempty"` 15982 // Name - READ-ONLY; Resource name 15983 Name *string `json:"name,omitempty"` 15984 // Type - READ-ONLY; Resource type 15985 Type *string `json:"type,omitempty"` 15986 // Location - Resource location 15987 Location *string `json:"location,omitempty"` 15988 // Tags - Resource tags 15989 Tags map[string]*string `json:"tags"` 15990} 15991 15992// MarshalJSON is the custom marshaler for VirtualMachineExtensionImage. 15993func (vmei VirtualMachineExtensionImage) MarshalJSON() ([]byte, error) { 15994 objectMap := make(map[string]interface{}) 15995 if vmei.VirtualMachineExtensionImageProperties != nil { 15996 objectMap["properties"] = vmei.VirtualMachineExtensionImageProperties 15997 } 15998 if vmei.Location != nil { 15999 objectMap["location"] = vmei.Location 16000 } 16001 if vmei.Tags != nil { 16002 objectMap["tags"] = vmei.Tags 16003 } 16004 return json.Marshal(objectMap) 16005} 16006 16007// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtensionImage struct. 16008func (vmei *VirtualMachineExtensionImage) UnmarshalJSON(body []byte) error { 16009 var m map[string]*json.RawMessage 16010 err := json.Unmarshal(body, &m) 16011 if err != nil { 16012 return err 16013 } 16014 for k, v := range m { 16015 switch k { 16016 case "properties": 16017 if v != nil { 16018 var virtualMachineExtensionImageProperties VirtualMachineExtensionImageProperties 16019 err = json.Unmarshal(*v, &virtualMachineExtensionImageProperties) 16020 if err != nil { 16021 return err 16022 } 16023 vmei.VirtualMachineExtensionImageProperties = &virtualMachineExtensionImageProperties 16024 } 16025 case "id": 16026 if v != nil { 16027 var ID string 16028 err = json.Unmarshal(*v, &ID) 16029 if err != nil { 16030 return err 16031 } 16032 vmei.ID = &ID 16033 } 16034 case "name": 16035 if v != nil { 16036 var name string 16037 err = json.Unmarshal(*v, &name) 16038 if err != nil { 16039 return err 16040 } 16041 vmei.Name = &name 16042 } 16043 case "type": 16044 if v != nil { 16045 var typeVar string 16046 err = json.Unmarshal(*v, &typeVar) 16047 if err != nil { 16048 return err 16049 } 16050 vmei.Type = &typeVar 16051 } 16052 case "location": 16053 if v != nil { 16054 var location string 16055 err = json.Unmarshal(*v, &location) 16056 if err != nil { 16057 return err 16058 } 16059 vmei.Location = &location 16060 } 16061 case "tags": 16062 if v != nil { 16063 var tags map[string]*string 16064 err = json.Unmarshal(*v, &tags) 16065 if err != nil { 16066 return err 16067 } 16068 vmei.Tags = tags 16069 } 16070 } 16071 } 16072 16073 return nil 16074} 16075 16076// VirtualMachineExtensionImageProperties describes the properties of a Virtual Machine Extension Image. 16077type VirtualMachineExtensionImageProperties struct { 16078 // OperatingSystem - The operating system this extension supports. 16079 OperatingSystem *string `json:"operatingSystem,omitempty"` 16080 // ComputeRole - The type of role (IaaS or PaaS) this extension supports. 16081 ComputeRole *string `json:"computeRole,omitempty"` 16082 // HandlerSchema - The schema defined by publisher, where extension consumers should provide settings in a matching schema. 16083 HandlerSchema *string `json:"handlerSchema,omitempty"` 16084 // 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. 16085 VMScaleSetEnabled *bool `json:"vmScaleSetEnabled,omitempty"` 16086 // SupportsMultipleExtensions - Whether the handler can support multiple extensions. 16087 SupportsMultipleExtensions *bool `json:"supportsMultipleExtensions,omitempty"` 16088} 16089 16090// VirtualMachineExtensionInstanceView the instance view of a virtual machine extension. 16091type VirtualMachineExtensionInstanceView struct { 16092 // Name - The virtual machine extension name. 16093 Name *string `json:"name,omitempty"` 16094 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 16095 Type *string `json:"type,omitempty"` 16096 // TypeHandlerVersion - Specifies the version of the script handler. 16097 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 16098 // Substatuses - The resource status information. 16099 Substatuses *[]InstanceViewStatus `json:"substatuses,omitempty"` 16100 // Statuses - The resource status information. 16101 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 16102} 16103 16104// VirtualMachineExtensionProperties describes the properties of a Virtual Machine Extension. 16105type VirtualMachineExtensionProperties struct { 16106 // ForceUpdateTag - How the extension handler should be forced to update even if the extension configuration has not changed. 16107 ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` 16108 // Publisher - The name of the extension handler publisher. 16109 Publisher *string `json:"publisher,omitempty"` 16110 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 16111 Type *string `json:"type,omitempty"` 16112 // TypeHandlerVersion - Specifies the version of the script handler. 16113 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 16114 // 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. 16115 AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` 16116 // EnableAutomaticUpgrade - Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. 16117 EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` 16118 // Settings - Json formatted public settings for the extension. 16119 Settings interface{} `json:"settings,omitempty"` 16120 // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. 16121 ProtectedSettings interface{} `json:"protectedSettings,omitempty"` 16122 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 16123 ProvisioningState *string `json:"provisioningState,omitempty"` 16124 // InstanceView - The virtual machine extension instance view. 16125 InstanceView *VirtualMachineExtensionInstanceView `json:"instanceView,omitempty"` 16126 // SuppressFailures - Indicates whether failures stemming from the extension will be suppressed (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The default is false. 16127 SuppressFailures *bool `json:"suppressFailures,omitempty"` 16128} 16129 16130// MarshalJSON is the custom marshaler for VirtualMachineExtensionProperties. 16131func (vmep VirtualMachineExtensionProperties) MarshalJSON() ([]byte, error) { 16132 objectMap := make(map[string]interface{}) 16133 if vmep.ForceUpdateTag != nil { 16134 objectMap["forceUpdateTag"] = vmep.ForceUpdateTag 16135 } 16136 if vmep.Publisher != nil { 16137 objectMap["publisher"] = vmep.Publisher 16138 } 16139 if vmep.Type != nil { 16140 objectMap["type"] = vmep.Type 16141 } 16142 if vmep.TypeHandlerVersion != nil { 16143 objectMap["typeHandlerVersion"] = vmep.TypeHandlerVersion 16144 } 16145 if vmep.AutoUpgradeMinorVersion != nil { 16146 objectMap["autoUpgradeMinorVersion"] = vmep.AutoUpgradeMinorVersion 16147 } 16148 if vmep.EnableAutomaticUpgrade != nil { 16149 objectMap["enableAutomaticUpgrade"] = vmep.EnableAutomaticUpgrade 16150 } 16151 if vmep.Settings != nil { 16152 objectMap["settings"] = vmep.Settings 16153 } 16154 if vmep.ProtectedSettings != nil { 16155 objectMap["protectedSettings"] = vmep.ProtectedSettings 16156 } 16157 if vmep.InstanceView != nil { 16158 objectMap["instanceView"] = vmep.InstanceView 16159 } 16160 if vmep.SuppressFailures != nil { 16161 objectMap["suppressFailures"] = vmep.SuppressFailures 16162 } 16163 return json.Marshal(objectMap) 16164} 16165 16166// VirtualMachineExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of 16167// a long-running operation. 16168type VirtualMachineExtensionsCreateOrUpdateFuture struct { 16169 azure.FutureAPI 16170 // Result returns the result of the asynchronous operation. 16171 // If the operation has not completed it will return an error. 16172 Result func(VirtualMachineExtensionsClient) (VirtualMachineExtension, error) 16173} 16174 16175// UnmarshalJSON is the custom unmarshaller for CreateFuture. 16176func (future *VirtualMachineExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 16177 var azFuture azure.Future 16178 if err := json.Unmarshal(body, &azFuture); err != nil { 16179 return err 16180 } 16181 future.FutureAPI = &azFuture 16182 future.Result = future.result 16183 return nil 16184} 16185 16186// result is the default implementation for VirtualMachineExtensionsCreateOrUpdateFuture.Result. 16187func (future *VirtualMachineExtensionsCreateOrUpdateFuture) result(client VirtualMachineExtensionsClient) (vme VirtualMachineExtension, err error) { 16188 var done bool 16189 done, err = future.DoneWithContext(context.Background(), client) 16190 if err != nil { 16191 err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 16192 return 16193 } 16194 if !done { 16195 vme.Response.Response = future.Response() 16196 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsCreateOrUpdateFuture") 16197 return 16198 } 16199 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 16200 if vme.Response.Response, err = future.GetResult(sender); err == nil && vme.Response.Response.StatusCode != http.StatusNoContent { 16201 vme, err = client.CreateOrUpdateResponder(vme.Response.Response) 16202 if err != nil { 16203 err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsCreateOrUpdateFuture", "Result", vme.Response.Response, "Failure responding to request") 16204 } 16205 } 16206 return 16207} 16208 16209// VirtualMachineExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of a 16210// long-running operation. 16211type VirtualMachineExtensionsDeleteFuture struct { 16212 azure.FutureAPI 16213 // Result returns the result of the asynchronous operation. 16214 // If the operation has not completed it will return an error. 16215 Result func(VirtualMachineExtensionsClient) (autorest.Response, error) 16216} 16217 16218// UnmarshalJSON is the custom unmarshaller for CreateFuture. 16219func (future *VirtualMachineExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { 16220 var azFuture azure.Future 16221 if err := json.Unmarshal(body, &azFuture); err != nil { 16222 return err 16223 } 16224 future.FutureAPI = &azFuture 16225 future.Result = future.result 16226 return nil 16227} 16228 16229// result is the default implementation for VirtualMachineExtensionsDeleteFuture.Result. 16230func (future *VirtualMachineExtensionsDeleteFuture) result(client VirtualMachineExtensionsClient) (ar autorest.Response, err error) { 16231 var done bool 16232 done, err = future.DoneWithContext(context.Background(), client) 16233 if err != nil { 16234 err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") 16235 return 16236 } 16237 if !done { 16238 ar.Response = future.Response() 16239 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsDeleteFuture") 16240 return 16241 } 16242 ar.Response = future.Response() 16243 return 16244} 16245 16246// VirtualMachineExtensionsListResult the List Extension operation response 16247type VirtualMachineExtensionsListResult struct { 16248 autorest.Response `json:"-"` 16249 // Value - The list of extensions 16250 Value *[]VirtualMachineExtension `json:"value,omitempty"` 16251} 16252 16253// VirtualMachineExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of a 16254// long-running operation. 16255type VirtualMachineExtensionsUpdateFuture struct { 16256 azure.FutureAPI 16257 // Result returns the result of the asynchronous operation. 16258 // If the operation has not completed it will return an error. 16259 Result func(VirtualMachineExtensionsClient) (VirtualMachineExtension, error) 16260} 16261 16262// UnmarshalJSON is the custom unmarshaller for CreateFuture. 16263func (future *VirtualMachineExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { 16264 var azFuture azure.Future 16265 if err := json.Unmarshal(body, &azFuture); err != nil { 16266 return err 16267 } 16268 future.FutureAPI = &azFuture 16269 future.Result = future.result 16270 return nil 16271} 16272 16273// result is the default implementation for VirtualMachineExtensionsUpdateFuture.Result. 16274func (future *VirtualMachineExtensionsUpdateFuture) result(client VirtualMachineExtensionsClient) (vme VirtualMachineExtension, err error) { 16275 var done bool 16276 done, err = future.DoneWithContext(context.Background(), client) 16277 if err != nil { 16278 err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsUpdateFuture", "Result", future.Response(), "Polling failure") 16279 return 16280 } 16281 if !done { 16282 vme.Response.Response = future.Response() 16283 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsUpdateFuture") 16284 return 16285 } 16286 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 16287 if vme.Response.Response, err = future.GetResult(sender); err == nil && vme.Response.Response.StatusCode != http.StatusNoContent { 16288 vme, err = client.UpdateResponder(vme.Response.Response) 16289 if err != nil { 16290 err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsUpdateFuture", "Result", vme.Response.Response, "Failure responding to request") 16291 } 16292 } 16293 return 16294} 16295 16296// VirtualMachineExtensionUpdate describes a Virtual Machine Extension. 16297type VirtualMachineExtensionUpdate struct { 16298 *VirtualMachineExtensionUpdateProperties `json:"properties,omitempty"` 16299 // Tags - Resource tags 16300 Tags map[string]*string `json:"tags"` 16301} 16302 16303// MarshalJSON is the custom marshaler for VirtualMachineExtensionUpdate. 16304func (vmeu VirtualMachineExtensionUpdate) MarshalJSON() ([]byte, error) { 16305 objectMap := make(map[string]interface{}) 16306 if vmeu.VirtualMachineExtensionUpdateProperties != nil { 16307 objectMap["properties"] = vmeu.VirtualMachineExtensionUpdateProperties 16308 } 16309 if vmeu.Tags != nil { 16310 objectMap["tags"] = vmeu.Tags 16311 } 16312 return json.Marshal(objectMap) 16313} 16314 16315// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtensionUpdate struct. 16316func (vmeu *VirtualMachineExtensionUpdate) UnmarshalJSON(body []byte) error { 16317 var m map[string]*json.RawMessage 16318 err := json.Unmarshal(body, &m) 16319 if err != nil { 16320 return err 16321 } 16322 for k, v := range m { 16323 switch k { 16324 case "properties": 16325 if v != nil { 16326 var virtualMachineExtensionUpdateProperties VirtualMachineExtensionUpdateProperties 16327 err = json.Unmarshal(*v, &virtualMachineExtensionUpdateProperties) 16328 if err != nil { 16329 return err 16330 } 16331 vmeu.VirtualMachineExtensionUpdateProperties = &virtualMachineExtensionUpdateProperties 16332 } 16333 case "tags": 16334 if v != nil { 16335 var tags map[string]*string 16336 err = json.Unmarshal(*v, &tags) 16337 if err != nil { 16338 return err 16339 } 16340 vmeu.Tags = tags 16341 } 16342 } 16343 } 16344 16345 return nil 16346} 16347 16348// VirtualMachineExtensionUpdateProperties describes the properties of a Virtual Machine Extension. 16349type VirtualMachineExtensionUpdateProperties struct { 16350 // ForceUpdateTag - How the extension handler should be forced to update even if the extension configuration has not changed. 16351 ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` 16352 // Publisher - The name of the extension handler publisher. 16353 Publisher *string `json:"publisher,omitempty"` 16354 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 16355 Type *string `json:"type,omitempty"` 16356 // TypeHandlerVersion - Specifies the version of the script handler. 16357 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 16358 // 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. 16359 AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` 16360 // EnableAutomaticUpgrade - Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. 16361 EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` 16362 // Settings - Json formatted public settings for the extension. 16363 Settings interface{} `json:"settings,omitempty"` 16364 // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. 16365 ProtectedSettings interface{} `json:"protectedSettings,omitempty"` 16366 // SuppressFailures - Indicates whether failures stemming from the extension will be suppressed (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The default is false. 16367 SuppressFailures *bool `json:"suppressFailures,omitempty"` 16368} 16369 16370// VirtualMachineHealthStatus the health status of the VM. 16371type VirtualMachineHealthStatus struct { 16372 // Status - READ-ONLY; The health status information for the VM. 16373 Status *InstanceViewStatus `json:"status,omitempty"` 16374} 16375 16376// MarshalJSON is the custom marshaler for VirtualMachineHealthStatus. 16377func (vmhs VirtualMachineHealthStatus) MarshalJSON() ([]byte, error) { 16378 objectMap := make(map[string]interface{}) 16379 return json.Marshal(objectMap) 16380} 16381 16382// VirtualMachineIdentity identity for the virtual machine. 16383type VirtualMachineIdentity struct { 16384 // PrincipalID - READ-ONLY; The principal id of virtual machine identity. This property will only be provided for a system assigned identity. 16385 PrincipalID *string `json:"principalId,omitempty"` 16386 // TenantID - READ-ONLY; The tenant id associated with the virtual machine. This property will only be provided for a system assigned identity. 16387 TenantID *string `json:"tenantId,omitempty"` 16388 // 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' 16389 Type ResourceIdentityType `json:"type,omitempty"` 16390 // 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}'. 16391 UserAssignedIdentities map[string]*VirtualMachineIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` 16392} 16393 16394// MarshalJSON is the custom marshaler for VirtualMachineIdentity. 16395func (vmi VirtualMachineIdentity) MarshalJSON() ([]byte, error) { 16396 objectMap := make(map[string]interface{}) 16397 if vmi.Type != "" { 16398 objectMap["type"] = vmi.Type 16399 } 16400 if vmi.UserAssignedIdentities != nil { 16401 objectMap["userAssignedIdentities"] = vmi.UserAssignedIdentities 16402 } 16403 return json.Marshal(objectMap) 16404} 16405 16406// VirtualMachineIdentityUserAssignedIdentitiesValue ... 16407type VirtualMachineIdentityUserAssignedIdentitiesValue struct { 16408 // PrincipalID - READ-ONLY; The principal id of user assigned identity. 16409 PrincipalID *string `json:"principalId,omitempty"` 16410 // ClientID - READ-ONLY; The client id of user assigned identity. 16411 ClientID *string `json:"clientId,omitempty"` 16412} 16413 16414// MarshalJSON is the custom marshaler for VirtualMachineIdentityUserAssignedIdentitiesValue. 16415func (vmiAiv VirtualMachineIdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) { 16416 objectMap := make(map[string]interface{}) 16417 return json.Marshal(objectMap) 16418} 16419 16420// VirtualMachineImage describes a Virtual Machine Image. 16421type VirtualMachineImage struct { 16422 autorest.Response `json:"-"` 16423 *VirtualMachineImageProperties `json:"properties,omitempty"` 16424 // Name - The name of the resource. 16425 Name *string `json:"name,omitempty"` 16426 // Location - The supported Azure location of the resource. 16427 Location *string `json:"location,omitempty"` 16428 // 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). 16429 Tags map[string]*string `json:"tags"` 16430 // ExtendedLocation - The extended location of the Virtual Machine. 16431 ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` 16432 // ID - Resource Id 16433 ID *string `json:"id,omitempty"` 16434} 16435 16436// MarshalJSON is the custom marshaler for VirtualMachineImage. 16437func (vmi VirtualMachineImage) MarshalJSON() ([]byte, error) { 16438 objectMap := make(map[string]interface{}) 16439 if vmi.VirtualMachineImageProperties != nil { 16440 objectMap["properties"] = vmi.VirtualMachineImageProperties 16441 } 16442 if vmi.Name != nil { 16443 objectMap["name"] = vmi.Name 16444 } 16445 if vmi.Location != nil { 16446 objectMap["location"] = vmi.Location 16447 } 16448 if vmi.Tags != nil { 16449 objectMap["tags"] = vmi.Tags 16450 } 16451 if vmi.ExtendedLocation != nil { 16452 objectMap["extendedLocation"] = vmi.ExtendedLocation 16453 } 16454 if vmi.ID != nil { 16455 objectMap["id"] = vmi.ID 16456 } 16457 return json.Marshal(objectMap) 16458} 16459 16460// UnmarshalJSON is the custom unmarshaler for VirtualMachineImage struct. 16461func (vmi *VirtualMachineImage) UnmarshalJSON(body []byte) error { 16462 var m map[string]*json.RawMessage 16463 err := json.Unmarshal(body, &m) 16464 if err != nil { 16465 return err 16466 } 16467 for k, v := range m { 16468 switch k { 16469 case "properties": 16470 if v != nil { 16471 var virtualMachineImageProperties VirtualMachineImageProperties 16472 err = json.Unmarshal(*v, &virtualMachineImageProperties) 16473 if err != nil { 16474 return err 16475 } 16476 vmi.VirtualMachineImageProperties = &virtualMachineImageProperties 16477 } 16478 case "name": 16479 if v != nil { 16480 var name string 16481 err = json.Unmarshal(*v, &name) 16482 if err != nil { 16483 return err 16484 } 16485 vmi.Name = &name 16486 } 16487 case "location": 16488 if v != nil { 16489 var location string 16490 err = json.Unmarshal(*v, &location) 16491 if err != nil { 16492 return err 16493 } 16494 vmi.Location = &location 16495 } 16496 case "tags": 16497 if v != nil { 16498 var tags map[string]*string 16499 err = json.Unmarshal(*v, &tags) 16500 if err != nil { 16501 return err 16502 } 16503 vmi.Tags = tags 16504 } 16505 case "extendedLocation": 16506 if v != nil { 16507 var extendedLocation ExtendedLocation 16508 err = json.Unmarshal(*v, &extendedLocation) 16509 if err != nil { 16510 return err 16511 } 16512 vmi.ExtendedLocation = &extendedLocation 16513 } 16514 case "id": 16515 if v != nil { 16516 var ID string 16517 err = json.Unmarshal(*v, &ID) 16518 if err != nil { 16519 return err 16520 } 16521 vmi.ID = &ID 16522 } 16523 } 16524 } 16525 16526 return nil 16527} 16528 16529// VirtualMachineImageFeature specifies additional capabilities supported by the image 16530type VirtualMachineImageFeature struct { 16531 // Name - The name of the feature. 16532 Name *string `json:"name,omitempty"` 16533 // Value - The corresponding value for the feature. 16534 Value *string `json:"value,omitempty"` 16535} 16536 16537// VirtualMachineImageProperties describes the properties of a Virtual Machine Image. 16538type VirtualMachineImageProperties struct { 16539 Plan *PurchasePlan `json:"plan,omitempty"` 16540 OsDiskImage *OSDiskImage `json:"osDiskImage,omitempty"` 16541 DataDiskImages *[]DataDiskImage `json:"dataDiskImages,omitempty"` 16542 AutomaticOSUpgradeProperties *AutomaticOSUpgradeProperties `json:"automaticOSUpgradeProperties,omitempty"` 16543 // HyperVGeneration - Possible values include: 'HyperVGenerationTypesV1', 'HyperVGenerationTypesV2' 16544 HyperVGeneration HyperVGenerationTypes `json:"hyperVGeneration,omitempty"` 16545 // Disallowed - Specifies disallowed configuration for the VirtualMachine created from the image 16546 Disallowed *DisallowedConfiguration `json:"disallowed,omitempty"` 16547 Features *[]VirtualMachineImageFeature `json:"features,omitempty"` 16548} 16549 16550// VirtualMachineImageResource virtual machine image resource information. 16551type VirtualMachineImageResource struct { 16552 // Name - The name of the resource. 16553 Name *string `json:"name,omitempty"` 16554 // Location - The supported Azure location of the resource. 16555 Location *string `json:"location,omitempty"` 16556 // 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). 16557 Tags map[string]*string `json:"tags"` 16558 // ExtendedLocation - The extended location of the Virtual Machine. 16559 ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` 16560 // ID - Resource Id 16561 ID *string `json:"id,omitempty"` 16562} 16563 16564// MarshalJSON is the custom marshaler for VirtualMachineImageResource. 16565func (vmir VirtualMachineImageResource) MarshalJSON() ([]byte, error) { 16566 objectMap := make(map[string]interface{}) 16567 if vmir.Name != nil { 16568 objectMap["name"] = vmir.Name 16569 } 16570 if vmir.Location != nil { 16571 objectMap["location"] = vmir.Location 16572 } 16573 if vmir.Tags != nil { 16574 objectMap["tags"] = vmir.Tags 16575 } 16576 if vmir.ExtendedLocation != nil { 16577 objectMap["extendedLocation"] = vmir.ExtendedLocation 16578 } 16579 if vmir.ID != nil { 16580 objectMap["id"] = vmir.ID 16581 } 16582 return json.Marshal(objectMap) 16583} 16584 16585// VirtualMachineInstallPatchesParameters input for InstallPatches as directly received by the API 16586type VirtualMachineInstallPatchesParameters struct { 16587 // 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) 16588 MaximumDuration *string `json:"maximumDuration,omitempty"` 16589 // RebootSetting - Defines when it is acceptable to reboot a VM during a software update operation. Possible values include: 'VMGuestPatchRebootSettingIfRequired', 'VMGuestPatchRebootSettingNever', 'VMGuestPatchRebootSettingAlways' 16590 RebootSetting VMGuestPatchRebootSetting `json:"rebootSetting,omitempty"` 16591 // WindowsParameters - Input for InstallPatches on a Windows VM, as directly received by the API 16592 WindowsParameters *WindowsParameters `json:"windowsParameters,omitempty"` 16593 // LinuxParameters - Input for InstallPatches on a Linux VM, as directly received by the API 16594 LinuxParameters *LinuxParameters `json:"linuxParameters,omitempty"` 16595} 16596 16597// VirtualMachineInstallPatchesResult the result summary of an installation operation. 16598type VirtualMachineInstallPatchesResult struct { 16599 autorest.Response `json:"-"` 16600 // 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' 16601 Status PatchOperationStatus `json:"status,omitempty"` 16602 // InstallationActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. 16603 InstallationActivityID *string `json:"installationActivityId,omitempty"` 16604 // RebootStatus - READ-ONLY; The reboot state of the VM following completion of the operation. Possible values include: 'VMGuestPatchRebootStatusUnknown', 'VMGuestPatchRebootStatusNotNeeded', 'VMGuestPatchRebootStatusRequired', 'VMGuestPatchRebootStatusStarted', 'VMGuestPatchRebootStatusFailed', 'VMGuestPatchRebootStatusCompleted' 16605 RebootStatus VMGuestPatchRebootStatus `json:"rebootStatus,omitempty"` 16606 // MaintenanceWindowExceeded - READ-ONLY; Whether the operation ran out of time before it completed all its intended actions. 16607 MaintenanceWindowExceeded *bool `json:"maintenanceWindowExceeded,omitempty"` 16608 // ExcludedPatchCount - READ-ONLY; The number of patches that were not installed due to the user blocking their installation. 16609 ExcludedPatchCount *int32 `json:"excludedPatchCount,omitempty"` 16610 // NotSelectedPatchCount - READ-ONLY; The number of patches that were detected as available for install, but did not meet the operation's criteria. 16611 NotSelectedPatchCount *int32 `json:"notSelectedPatchCount,omitempty"` 16612 // 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. 16613 PendingPatchCount *int32 `json:"pendingPatchCount,omitempty"` 16614 // InstalledPatchCount - READ-ONLY; The number of patches successfully installed. 16615 InstalledPatchCount *int32 `json:"installedPatchCount,omitempty"` 16616 // FailedPatchCount - READ-ONLY; The number of patches that could not be installed due to some issue. See errors for details. 16617 FailedPatchCount *int32 `json:"failedPatchCount,omitempty"` 16618 // Patches - READ-ONLY; The patches that were installed during the operation. 16619 Patches *[]PatchInstallationDetail `json:"patches,omitempty"` 16620 // StartDateTime - READ-ONLY; The UTC timestamp when the operation began. 16621 StartDateTime *date.Time `json:"startDateTime,omitempty"` 16622 // Error - READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. 16623 Error *APIError `json:"error,omitempty"` 16624} 16625 16626// MarshalJSON is the custom marshaler for VirtualMachineInstallPatchesResult. 16627func (vmipr VirtualMachineInstallPatchesResult) MarshalJSON() ([]byte, error) { 16628 objectMap := make(map[string]interface{}) 16629 return json.Marshal(objectMap) 16630} 16631 16632// VirtualMachineInstanceView the instance view of a virtual machine. 16633type VirtualMachineInstanceView struct { 16634 autorest.Response `json:"-"` 16635 // PlatformUpdateDomain - Specifies the update domain of the virtual machine. 16636 PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` 16637 // PlatformFaultDomain - Specifies the fault domain of the virtual machine. 16638 PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` 16639 // ComputerName - The computer name assigned to the virtual machine. 16640 ComputerName *string `json:"computerName,omitempty"` 16641 // OsName - The Operating System running on the virtual machine. 16642 OsName *string `json:"osName,omitempty"` 16643 // OsVersion - The version of Operating System running on the virtual machine. 16644 OsVersion *string `json:"osVersion,omitempty"` 16645 // HyperVGeneration - Specifies the HyperVGeneration Type associated with a resource. Possible values include: 'HyperVGenerationTypeV1', 'HyperVGenerationTypeV2' 16646 HyperVGeneration HyperVGenerationType `json:"hyperVGeneration,omitempty"` 16647 // RdpThumbPrint - The Remote desktop certificate thumbprint. 16648 RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"` 16649 // VMAgent - The VM Agent running on the virtual machine. 16650 VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"` 16651 // MaintenanceRedeployStatus - The Maintenance Operation status on the virtual machine. 16652 MaintenanceRedeployStatus *MaintenanceRedeployStatus `json:"maintenanceRedeployStatus,omitempty"` 16653 // Disks - The virtual machine disk information. 16654 Disks *[]DiskInstanceView `json:"disks,omitempty"` 16655 // Extensions - The extensions information. 16656 Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` 16657 // VMHealth - READ-ONLY; The health status for the VM. 16658 VMHealth *VirtualMachineHealthStatus `json:"vmHealth,omitempty"` 16659 // 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. 16660 BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` 16661 // 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. 16662 AssignedHost *string `json:"assignedHost,omitempty"` 16663 // Statuses - The resource status information. 16664 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 16665 // PatchStatus - [Preview Feature] The status of virtual machine patch operations. 16666 PatchStatus *VirtualMachinePatchStatus `json:"patchStatus,omitempty"` 16667} 16668 16669// MarshalJSON is the custom marshaler for VirtualMachineInstanceView. 16670func (vmiv VirtualMachineInstanceView) MarshalJSON() ([]byte, error) { 16671 objectMap := make(map[string]interface{}) 16672 if vmiv.PlatformUpdateDomain != nil { 16673 objectMap["platformUpdateDomain"] = vmiv.PlatformUpdateDomain 16674 } 16675 if vmiv.PlatformFaultDomain != nil { 16676 objectMap["platformFaultDomain"] = vmiv.PlatformFaultDomain 16677 } 16678 if vmiv.ComputerName != nil { 16679 objectMap["computerName"] = vmiv.ComputerName 16680 } 16681 if vmiv.OsName != nil { 16682 objectMap["osName"] = vmiv.OsName 16683 } 16684 if vmiv.OsVersion != nil { 16685 objectMap["osVersion"] = vmiv.OsVersion 16686 } 16687 if vmiv.HyperVGeneration != "" { 16688 objectMap["hyperVGeneration"] = vmiv.HyperVGeneration 16689 } 16690 if vmiv.RdpThumbPrint != nil { 16691 objectMap["rdpThumbPrint"] = vmiv.RdpThumbPrint 16692 } 16693 if vmiv.VMAgent != nil { 16694 objectMap["vmAgent"] = vmiv.VMAgent 16695 } 16696 if vmiv.MaintenanceRedeployStatus != nil { 16697 objectMap["maintenanceRedeployStatus"] = vmiv.MaintenanceRedeployStatus 16698 } 16699 if vmiv.Disks != nil { 16700 objectMap["disks"] = vmiv.Disks 16701 } 16702 if vmiv.Extensions != nil { 16703 objectMap["extensions"] = vmiv.Extensions 16704 } 16705 if vmiv.BootDiagnostics != nil { 16706 objectMap["bootDiagnostics"] = vmiv.BootDiagnostics 16707 } 16708 if vmiv.Statuses != nil { 16709 objectMap["statuses"] = vmiv.Statuses 16710 } 16711 if vmiv.PatchStatus != nil { 16712 objectMap["patchStatus"] = vmiv.PatchStatus 16713 } 16714 return json.Marshal(objectMap) 16715} 16716 16717// VirtualMachineIPTag contains the IP tag associated with the public IP address. 16718type VirtualMachineIPTag struct { 16719 // IPTagType - IP tag type. Example: FirstPartyUsage. 16720 IPTagType *string `json:"ipTagType,omitempty"` 16721 // Tag - IP tag associated with the public IP. Example: SQL, Storage etc. 16722 Tag *string `json:"tag,omitempty"` 16723} 16724 16725// VirtualMachineListResult the List Virtual Machine operation response. 16726type VirtualMachineListResult struct { 16727 autorest.Response `json:"-"` 16728 // Value - The list of virtual machines. 16729 Value *[]VirtualMachine `json:"value,omitempty"` 16730 // NextLink - The URI to fetch the next page of VMs. Call ListNext() with this URI to fetch the next page of Virtual Machines. 16731 NextLink *string `json:"nextLink,omitempty"` 16732} 16733 16734// VirtualMachineListResultIterator provides access to a complete listing of VirtualMachine values. 16735type VirtualMachineListResultIterator struct { 16736 i int 16737 page VirtualMachineListResultPage 16738} 16739 16740// NextWithContext advances to the next value. If there was an error making 16741// the request the iterator does not advance and the error is returned. 16742func (iter *VirtualMachineListResultIterator) NextWithContext(ctx context.Context) (err error) { 16743 if tracing.IsEnabled() { 16744 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineListResultIterator.NextWithContext") 16745 defer func() { 16746 sc := -1 16747 if iter.Response().Response.Response != nil { 16748 sc = iter.Response().Response.Response.StatusCode 16749 } 16750 tracing.EndSpan(ctx, sc, err) 16751 }() 16752 } 16753 iter.i++ 16754 if iter.i < len(iter.page.Values()) { 16755 return nil 16756 } 16757 err = iter.page.NextWithContext(ctx) 16758 if err != nil { 16759 iter.i-- 16760 return err 16761 } 16762 iter.i = 0 16763 return nil 16764} 16765 16766// Next advances to the next value. If there was an error making 16767// the request the iterator does not advance and the error is returned. 16768// Deprecated: Use NextWithContext() instead. 16769func (iter *VirtualMachineListResultIterator) Next() error { 16770 return iter.NextWithContext(context.Background()) 16771} 16772 16773// NotDone returns true if the enumeration should be started or is not yet complete. 16774func (iter VirtualMachineListResultIterator) NotDone() bool { 16775 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 16776} 16777 16778// Response returns the raw server response from the last page request. 16779func (iter VirtualMachineListResultIterator) Response() VirtualMachineListResult { 16780 return iter.page.Response() 16781} 16782 16783// Value returns the current value or a zero-initialized value if the 16784// iterator has advanced beyond the end of the collection. 16785func (iter VirtualMachineListResultIterator) Value() VirtualMachine { 16786 if !iter.page.NotDone() { 16787 return VirtualMachine{} 16788 } 16789 return iter.page.Values()[iter.i] 16790} 16791 16792// Creates a new instance of the VirtualMachineListResultIterator type. 16793func NewVirtualMachineListResultIterator(page VirtualMachineListResultPage) VirtualMachineListResultIterator { 16794 return VirtualMachineListResultIterator{page: page} 16795} 16796 16797// IsEmpty returns true if the ListResult contains no values. 16798func (vmlr VirtualMachineListResult) IsEmpty() bool { 16799 return vmlr.Value == nil || len(*vmlr.Value) == 0 16800} 16801 16802// hasNextLink returns true if the NextLink is not empty. 16803func (vmlr VirtualMachineListResult) hasNextLink() bool { 16804 return vmlr.NextLink != nil && len(*vmlr.NextLink) != 0 16805} 16806 16807// virtualMachineListResultPreparer prepares a request to retrieve the next set of results. 16808// It returns nil if no more results exist. 16809func (vmlr VirtualMachineListResult) virtualMachineListResultPreparer(ctx context.Context) (*http.Request, error) { 16810 if !vmlr.hasNextLink() { 16811 return nil, nil 16812 } 16813 return autorest.Prepare((&http.Request{}).WithContext(ctx), 16814 autorest.AsJSON(), 16815 autorest.AsGet(), 16816 autorest.WithBaseURL(to.String(vmlr.NextLink))) 16817} 16818 16819// VirtualMachineListResultPage contains a page of VirtualMachine values. 16820type VirtualMachineListResultPage struct { 16821 fn func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error) 16822 vmlr VirtualMachineListResult 16823} 16824 16825// NextWithContext advances to the next page of values. If there was an error making 16826// the request the page does not advance and the error is returned. 16827func (page *VirtualMachineListResultPage) NextWithContext(ctx context.Context) (err error) { 16828 if tracing.IsEnabled() { 16829 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineListResultPage.NextWithContext") 16830 defer func() { 16831 sc := -1 16832 if page.Response().Response.Response != nil { 16833 sc = page.Response().Response.Response.StatusCode 16834 } 16835 tracing.EndSpan(ctx, sc, err) 16836 }() 16837 } 16838 for { 16839 next, err := page.fn(ctx, page.vmlr) 16840 if err != nil { 16841 return err 16842 } 16843 page.vmlr = next 16844 if !next.hasNextLink() || !next.IsEmpty() { 16845 break 16846 } 16847 } 16848 return nil 16849} 16850 16851// Next advances to the next page of values. If there was an error making 16852// the request the page does not advance and the error is returned. 16853// Deprecated: Use NextWithContext() instead. 16854func (page *VirtualMachineListResultPage) Next() error { 16855 return page.NextWithContext(context.Background()) 16856} 16857 16858// NotDone returns true if the page enumeration should be started or is not yet complete. 16859func (page VirtualMachineListResultPage) NotDone() bool { 16860 return !page.vmlr.IsEmpty() 16861} 16862 16863// Response returns the raw server response from the last page request. 16864func (page VirtualMachineListResultPage) Response() VirtualMachineListResult { 16865 return page.vmlr 16866} 16867 16868// Values returns the slice of values for the current page or nil if there are no values. 16869func (page VirtualMachineListResultPage) Values() []VirtualMachine { 16870 if page.vmlr.IsEmpty() { 16871 return nil 16872 } 16873 return *page.vmlr.Value 16874} 16875 16876// Creates a new instance of the VirtualMachineListResultPage type. 16877func NewVirtualMachineListResultPage(cur VirtualMachineListResult, getNextPage func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error)) VirtualMachineListResultPage { 16878 return VirtualMachineListResultPage{ 16879 fn: getNextPage, 16880 vmlr: cur, 16881 } 16882} 16883 16884// VirtualMachineNetworkInterfaceConfiguration describes a virtual machine network interface 16885// configurations. 16886type VirtualMachineNetworkInterfaceConfiguration struct { 16887 // Name - The network interface configuration name. 16888 Name *string `json:"name,omitempty"` 16889 *VirtualMachineNetworkInterfaceConfigurationProperties `json:"properties,omitempty"` 16890} 16891 16892// MarshalJSON is the custom marshaler for VirtualMachineNetworkInterfaceConfiguration. 16893func (vmnic VirtualMachineNetworkInterfaceConfiguration) MarshalJSON() ([]byte, error) { 16894 objectMap := make(map[string]interface{}) 16895 if vmnic.Name != nil { 16896 objectMap["name"] = vmnic.Name 16897 } 16898 if vmnic.VirtualMachineNetworkInterfaceConfigurationProperties != nil { 16899 objectMap["properties"] = vmnic.VirtualMachineNetworkInterfaceConfigurationProperties 16900 } 16901 return json.Marshal(objectMap) 16902} 16903 16904// UnmarshalJSON is the custom unmarshaler for VirtualMachineNetworkInterfaceConfiguration struct. 16905func (vmnic *VirtualMachineNetworkInterfaceConfiguration) UnmarshalJSON(body []byte) error { 16906 var m map[string]*json.RawMessage 16907 err := json.Unmarshal(body, &m) 16908 if err != nil { 16909 return err 16910 } 16911 for k, v := range m { 16912 switch k { 16913 case "name": 16914 if v != nil { 16915 var name string 16916 err = json.Unmarshal(*v, &name) 16917 if err != nil { 16918 return err 16919 } 16920 vmnic.Name = &name 16921 } 16922 case "properties": 16923 if v != nil { 16924 var virtualMachineNetworkInterfaceConfigurationProperties VirtualMachineNetworkInterfaceConfigurationProperties 16925 err = json.Unmarshal(*v, &virtualMachineNetworkInterfaceConfigurationProperties) 16926 if err != nil { 16927 return err 16928 } 16929 vmnic.VirtualMachineNetworkInterfaceConfigurationProperties = &virtualMachineNetworkInterfaceConfigurationProperties 16930 } 16931 } 16932 } 16933 16934 return nil 16935} 16936 16937// VirtualMachineNetworkInterfaceConfigurationProperties describes a virtual machine network profile's IP 16938// configuration. 16939type VirtualMachineNetworkInterfaceConfigurationProperties struct { 16940 // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. 16941 Primary *bool `json:"primary,omitempty"` 16942 // DeleteOption - Specify what happens to the network interface when the VM is deleted. Possible values include: 'DeleteOptionsDelete', 'DeleteOptionsDetach' 16943 DeleteOption DeleteOptions `json:"deleteOption,omitempty"` 16944 // EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled. 16945 EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` 16946 // EnableFpga - Specifies whether the network interface is FPGA networking-enabled. 16947 EnableFpga *bool `json:"enableFpga,omitempty"` 16948 // EnableIPForwarding - Whether IP forwarding enabled on this NIC. 16949 EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` 16950 // NetworkSecurityGroup - The network security group. 16951 NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` 16952 // DNSSettings - The dns settings to be applied on the network interfaces. 16953 DNSSettings *VirtualMachineNetworkInterfaceDNSSettingsConfiguration `json:"dnsSettings,omitempty"` 16954 // IPConfigurations - Specifies the IP configurations of the network interface. 16955 IPConfigurations *[]VirtualMachineNetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` 16956 DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` 16957} 16958 16959// VirtualMachineNetworkInterfaceDNSSettingsConfiguration describes a virtual machines network 16960// configuration's DNS settings. 16961type VirtualMachineNetworkInterfaceDNSSettingsConfiguration struct { 16962 // DNSServers - List of DNS servers IP addresses 16963 DNSServers *[]string `json:"dnsServers,omitempty"` 16964} 16965 16966// VirtualMachineNetworkInterfaceIPConfiguration describes a virtual machine network profile's IP 16967// configuration. 16968type VirtualMachineNetworkInterfaceIPConfiguration struct { 16969 // Name - The IP configuration name. 16970 Name *string `json:"name,omitempty"` 16971 *VirtualMachineNetworkInterfaceIPConfigurationProperties `json:"properties,omitempty"` 16972} 16973 16974// MarshalJSON is the custom marshaler for VirtualMachineNetworkInterfaceIPConfiguration. 16975func (vmniic VirtualMachineNetworkInterfaceIPConfiguration) MarshalJSON() ([]byte, error) { 16976 objectMap := make(map[string]interface{}) 16977 if vmniic.Name != nil { 16978 objectMap["name"] = vmniic.Name 16979 } 16980 if vmniic.VirtualMachineNetworkInterfaceIPConfigurationProperties != nil { 16981 objectMap["properties"] = vmniic.VirtualMachineNetworkInterfaceIPConfigurationProperties 16982 } 16983 return json.Marshal(objectMap) 16984} 16985 16986// UnmarshalJSON is the custom unmarshaler for VirtualMachineNetworkInterfaceIPConfiguration struct. 16987func (vmniic *VirtualMachineNetworkInterfaceIPConfiguration) UnmarshalJSON(body []byte) error { 16988 var m map[string]*json.RawMessage 16989 err := json.Unmarshal(body, &m) 16990 if err != nil { 16991 return err 16992 } 16993 for k, v := range m { 16994 switch k { 16995 case "name": 16996 if v != nil { 16997 var name string 16998 err = json.Unmarshal(*v, &name) 16999 if err != nil { 17000 return err 17001 } 17002 vmniic.Name = &name 17003 } 17004 case "properties": 17005 if v != nil { 17006 var virtualMachineNetworkInterfaceIPConfigurationProperties VirtualMachineNetworkInterfaceIPConfigurationProperties 17007 err = json.Unmarshal(*v, &virtualMachineNetworkInterfaceIPConfigurationProperties) 17008 if err != nil { 17009 return err 17010 } 17011 vmniic.VirtualMachineNetworkInterfaceIPConfigurationProperties = &virtualMachineNetworkInterfaceIPConfigurationProperties 17012 } 17013 } 17014 } 17015 17016 return nil 17017} 17018 17019// VirtualMachineNetworkInterfaceIPConfigurationProperties describes a virtual machine network interface IP 17020// configuration properties. 17021type VirtualMachineNetworkInterfaceIPConfigurationProperties struct { 17022 // Subnet - Specifies the identifier of the subnet. 17023 Subnet *SubResource `json:"subnet,omitempty"` 17024 // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. 17025 Primary *bool `json:"primary,omitempty"` 17026 // PublicIPAddressConfiguration - The publicIPAddressConfiguration. 17027 PublicIPAddressConfiguration *VirtualMachinePublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` 17028 // 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' 17029 PrivateIPAddressVersion IPVersions `json:"privateIPAddressVersion,omitempty"` 17030 // ApplicationSecurityGroups - Specifies an array of references to application security group. 17031 ApplicationSecurityGroups *[]SubResource `json:"applicationSecurityGroups,omitempty"` 17032 // 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. 17033 ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` 17034 // 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]. 17035 LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` 17036} 17037 17038// VirtualMachinePatchStatus the status of virtual machine patch operations. 17039type VirtualMachinePatchStatus struct { 17040 // AvailablePatchSummary - The available patch summary of the latest assessment operation for the virtual machine. 17041 AvailablePatchSummary *AvailablePatchSummary `json:"availablePatchSummary,omitempty"` 17042 // LastPatchInstallationSummary - The installation summary of the latest installation operation for the virtual machine. 17043 LastPatchInstallationSummary *LastPatchInstallationSummary `json:"lastPatchInstallationSummary,omitempty"` 17044 // ConfigurationStatuses - READ-ONLY; The enablement status of the specified patchMode 17045 ConfigurationStatuses *[]InstanceViewStatus `json:"configurationStatuses,omitempty"` 17046} 17047 17048// MarshalJSON is the custom marshaler for VirtualMachinePatchStatus. 17049func (vmps VirtualMachinePatchStatus) MarshalJSON() ([]byte, error) { 17050 objectMap := make(map[string]interface{}) 17051 if vmps.AvailablePatchSummary != nil { 17052 objectMap["availablePatchSummary"] = vmps.AvailablePatchSummary 17053 } 17054 if vmps.LastPatchInstallationSummary != nil { 17055 objectMap["lastPatchInstallationSummary"] = vmps.LastPatchInstallationSummary 17056 } 17057 return json.Marshal(objectMap) 17058} 17059 17060// VirtualMachineProperties describes the properties of a Virtual Machine. 17061type VirtualMachineProperties struct { 17062 // HardwareProfile - Specifies the hardware settings for the virtual machine. 17063 HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` 17064 // StorageProfile - Specifies the storage settings for the virtual machine disks. 17065 StorageProfile *StorageProfile `json:"storageProfile,omitempty"` 17066 // AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the virtual machine. 17067 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 17068 // OsProfile - Specifies the operating system settings used while creating the virtual machine. Some of the settings cannot be changed once VM is provisioned. 17069 OsProfile *OSProfile `json:"osProfile,omitempty"` 17070 // NetworkProfile - Specifies the network interfaces of the virtual machine. 17071 NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` 17072 // SecurityProfile - Specifies the Security related profile settings for the virtual machine. 17073 SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` 17074 // DiagnosticsProfile - Specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. 17075 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 17076 // 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. 17077 AvailabilitySet *SubResource `json:"availabilitySet,omitempty"` 17078 // 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 17079 VirtualMachineScaleSet *SubResource `json:"virtualMachineScaleSet,omitempty"` 17080 // ProximityPlacementGroup - Specifies information about the proximity placement group that the virtual machine should be assigned to. <br><br>Minimum api-version: 2018-04-01. 17081 ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` 17082 // Priority - Specifies the priority for the virtual machine. <br><br>Minimum api-version: 2019-03-01. Possible values include: 'VirtualMachinePriorityTypesRegular', 'VirtualMachinePriorityTypesLow', 'VirtualMachinePriorityTypesSpot' 17083 Priority VirtualMachinePriorityTypes `json:"priority,omitempty"` 17084 // 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' 17085 EvictionPolicy VirtualMachineEvictionPolicyTypes `json:"evictionPolicy,omitempty"` 17086 // BillingProfile - Specifies the billing related details of a Azure Spot virtual machine. <br><br>Minimum api-version: 2019-03-01. 17087 BillingProfile *BillingProfile `json:"billingProfile,omitempty"` 17088 // Host - Specifies information about the dedicated host that the virtual machine resides in. <br><br>Minimum api-version: 2018-10-01. 17089 Host *SubResource `json:"host,omitempty"` 17090 // 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. 17091 HostGroup *SubResource `json:"hostGroup,omitempty"` 17092 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 17093 ProvisioningState *string `json:"provisioningState,omitempty"` 17094 // InstanceView - READ-ONLY; The virtual machine instance view. 17095 InstanceView *VirtualMachineInstanceView `json:"instanceView,omitempty"` 17096 // 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 17097 LicenseType *string `json:"licenseType,omitempty"` 17098 // 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. 17099 VMID *string `json:"vmId,omitempty"` 17100 // 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 17101 ExtensionsTimeBudget *string `json:"extensionsTimeBudget,omitempty"` 17102 // 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 17103 PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` 17104 // ScheduledEventsProfile - Specifies Scheduled Event related configurations. 17105 ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` 17106 // 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 17107 UserData *string `json:"userData,omitempty"` 17108 // CapacityReservation - Specifies information about the capacity reservation that is used to allocate virtual machine. <br><br>Minimum api-version: 2021-04-01. 17109 CapacityReservation *CapacityReservationProfile `json:"capacityReservation,omitempty"` 17110 // ApplicationProfile - Specifies the gallery applications that should be made available to the VM/VMSS 17111 ApplicationProfile *ApplicationProfile `json:"applicationProfile,omitempty"` 17112} 17113 17114// MarshalJSON is the custom marshaler for VirtualMachineProperties. 17115func (vmp VirtualMachineProperties) MarshalJSON() ([]byte, error) { 17116 objectMap := make(map[string]interface{}) 17117 if vmp.HardwareProfile != nil { 17118 objectMap["hardwareProfile"] = vmp.HardwareProfile 17119 } 17120 if vmp.StorageProfile != nil { 17121 objectMap["storageProfile"] = vmp.StorageProfile 17122 } 17123 if vmp.AdditionalCapabilities != nil { 17124 objectMap["additionalCapabilities"] = vmp.AdditionalCapabilities 17125 } 17126 if vmp.OsProfile != nil { 17127 objectMap["osProfile"] = vmp.OsProfile 17128 } 17129 if vmp.NetworkProfile != nil { 17130 objectMap["networkProfile"] = vmp.NetworkProfile 17131 } 17132 if vmp.SecurityProfile != nil { 17133 objectMap["securityProfile"] = vmp.SecurityProfile 17134 } 17135 if vmp.DiagnosticsProfile != nil { 17136 objectMap["diagnosticsProfile"] = vmp.DiagnosticsProfile 17137 } 17138 if vmp.AvailabilitySet != nil { 17139 objectMap["availabilitySet"] = vmp.AvailabilitySet 17140 } 17141 if vmp.VirtualMachineScaleSet != nil { 17142 objectMap["virtualMachineScaleSet"] = vmp.VirtualMachineScaleSet 17143 } 17144 if vmp.ProximityPlacementGroup != nil { 17145 objectMap["proximityPlacementGroup"] = vmp.ProximityPlacementGroup 17146 } 17147 if vmp.Priority != "" { 17148 objectMap["priority"] = vmp.Priority 17149 } 17150 if vmp.EvictionPolicy != "" { 17151 objectMap["evictionPolicy"] = vmp.EvictionPolicy 17152 } 17153 if vmp.BillingProfile != nil { 17154 objectMap["billingProfile"] = vmp.BillingProfile 17155 } 17156 if vmp.Host != nil { 17157 objectMap["host"] = vmp.Host 17158 } 17159 if vmp.HostGroup != nil { 17160 objectMap["hostGroup"] = vmp.HostGroup 17161 } 17162 if vmp.LicenseType != nil { 17163 objectMap["licenseType"] = vmp.LicenseType 17164 } 17165 if vmp.ExtensionsTimeBudget != nil { 17166 objectMap["extensionsTimeBudget"] = vmp.ExtensionsTimeBudget 17167 } 17168 if vmp.PlatformFaultDomain != nil { 17169 objectMap["platformFaultDomain"] = vmp.PlatformFaultDomain 17170 } 17171 if vmp.ScheduledEventsProfile != nil { 17172 objectMap["scheduledEventsProfile"] = vmp.ScheduledEventsProfile 17173 } 17174 if vmp.UserData != nil { 17175 objectMap["userData"] = vmp.UserData 17176 } 17177 if vmp.CapacityReservation != nil { 17178 objectMap["capacityReservation"] = vmp.CapacityReservation 17179 } 17180 if vmp.ApplicationProfile != nil { 17181 objectMap["applicationProfile"] = vmp.ApplicationProfile 17182 } 17183 return json.Marshal(objectMap) 17184} 17185 17186// VirtualMachinePublicIPAddressConfiguration describes a virtual machines IP Configuration's 17187// PublicIPAddress configuration 17188type VirtualMachinePublicIPAddressConfiguration struct { 17189 // Name - The publicIP address configuration name. 17190 Name *string `json:"name,omitempty"` 17191 *VirtualMachinePublicIPAddressConfigurationProperties `json:"properties,omitempty"` 17192 Sku *PublicIPAddressSku `json:"sku,omitempty"` 17193} 17194 17195// MarshalJSON is the custom marshaler for VirtualMachinePublicIPAddressConfiguration. 17196func (vmpiac VirtualMachinePublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { 17197 objectMap := make(map[string]interface{}) 17198 if vmpiac.Name != nil { 17199 objectMap["name"] = vmpiac.Name 17200 } 17201 if vmpiac.VirtualMachinePublicIPAddressConfigurationProperties != nil { 17202 objectMap["properties"] = vmpiac.VirtualMachinePublicIPAddressConfigurationProperties 17203 } 17204 if vmpiac.Sku != nil { 17205 objectMap["sku"] = vmpiac.Sku 17206 } 17207 return json.Marshal(objectMap) 17208} 17209 17210// UnmarshalJSON is the custom unmarshaler for VirtualMachinePublicIPAddressConfiguration struct. 17211func (vmpiac *VirtualMachinePublicIPAddressConfiguration) UnmarshalJSON(body []byte) error { 17212 var m map[string]*json.RawMessage 17213 err := json.Unmarshal(body, &m) 17214 if err != nil { 17215 return err 17216 } 17217 for k, v := range m { 17218 switch k { 17219 case "name": 17220 if v != nil { 17221 var name string 17222 err = json.Unmarshal(*v, &name) 17223 if err != nil { 17224 return err 17225 } 17226 vmpiac.Name = &name 17227 } 17228 case "properties": 17229 if v != nil { 17230 var virtualMachinePublicIPAddressConfigurationProperties VirtualMachinePublicIPAddressConfigurationProperties 17231 err = json.Unmarshal(*v, &virtualMachinePublicIPAddressConfigurationProperties) 17232 if err != nil { 17233 return err 17234 } 17235 vmpiac.VirtualMachinePublicIPAddressConfigurationProperties = &virtualMachinePublicIPAddressConfigurationProperties 17236 } 17237 case "sku": 17238 if v != nil { 17239 var sku PublicIPAddressSku 17240 err = json.Unmarshal(*v, &sku) 17241 if err != nil { 17242 return err 17243 } 17244 vmpiac.Sku = &sku 17245 } 17246 } 17247 } 17248 17249 return nil 17250} 17251 17252// VirtualMachinePublicIPAddressConfigurationProperties describes a virtual machines IP Configuration's 17253// PublicIPAddress configuration 17254type VirtualMachinePublicIPAddressConfigurationProperties struct { 17255 // IdleTimeoutInMinutes - The idle timeout of the public IP address. 17256 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` 17257 // DeleteOption - Specify what happens to the public IP address when the VM is deleted. Possible values include: 'DeleteOptionsDelete', 'DeleteOptionsDetach' 17258 DeleteOption DeleteOptions `json:"deleteOption,omitempty"` 17259 // DNSSettings - The dns settings to be applied on the publicIP addresses . 17260 DNSSettings *VirtualMachinePublicIPAddressDNSSettingsConfiguration `json:"dnsSettings,omitempty"` 17261 // IPTags - The list of IP tags associated with the public IP address. 17262 IPTags *[]VirtualMachineIPTag `json:"ipTags,omitempty"` 17263 // PublicIPPrefix - The PublicIPPrefix from which to allocate publicIP addresses. 17264 PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` 17265 // 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' 17266 PublicIPAddressVersion IPVersions `json:"publicIPAddressVersion,omitempty"` 17267 // PublicIPAllocationMethod - Specify the public IP allocation type. Possible values include: 'PublicIPAllocationMethodDynamic', 'PublicIPAllocationMethodStatic' 17268 PublicIPAllocationMethod PublicIPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` 17269} 17270 17271// VirtualMachinePublicIPAddressDNSSettingsConfiguration describes a virtual machines network 17272// configuration's DNS settings. 17273type VirtualMachinePublicIPAddressDNSSettingsConfiguration struct { 17274 // 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. 17275 DomainNameLabel *string `json:"domainNameLabel,omitempty"` 17276} 17277 17278// VirtualMachineReimageParameters parameters for Reimaging Virtual Machine. NOTE: Virtual Machine OS disk 17279// will always be reimaged 17280type VirtualMachineReimageParameters struct { 17281 // 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. 17282 TempDisk *bool `json:"tempDisk,omitempty"` 17283} 17284 17285// VirtualMachineRunCommand describes a Virtual Machine run command. 17286type VirtualMachineRunCommand struct { 17287 autorest.Response `json:"-"` 17288 *VirtualMachineRunCommandProperties `json:"properties,omitempty"` 17289 // ID - READ-ONLY; Resource Id 17290 ID *string `json:"id,omitempty"` 17291 // Name - READ-ONLY; Resource name 17292 Name *string `json:"name,omitempty"` 17293 // Type - READ-ONLY; Resource type 17294 Type *string `json:"type,omitempty"` 17295 // Location - Resource location 17296 Location *string `json:"location,omitempty"` 17297 // Tags - Resource tags 17298 Tags map[string]*string `json:"tags"` 17299} 17300 17301// MarshalJSON is the custom marshaler for VirtualMachineRunCommand. 17302func (vmrc VirtualMachineRunCommand) MarshalJSON() ([]byte, error) { 17303 objectMap := make(map[string]interface{}) 17304 if vmrc.VirtualMachineRunCommandProperties != nil { 17305 objectMap["properties"] = vmrc.VirtualMachineRunCommandProperties 17306 } 17307 if vmrc.Location != nil { 17308 objectMap["location"] = vmrc.Location 17309 } 17310 if vmrc.Tags != nil { 17311 objectMap["tags"] = vmrc.Tags 17312 } 17313 return json.Marshal(objectMap) 17314} 17315 17316// UnmarshalJSON is the custom unmarshaler for VirtualMachineRunCommand struct. 17317func (vmrc *VirtualMachineRunCommand) UnmarshalJSON(body []byte) error { 17318 var m map[string]*json.RawMessage 17319 err := json.Unmarshal(body, &m) 17320 if err != nil { 17321 return err 17322 } 17323 for k, v := range m { 17324 switch k { 17325 case "properties": 17326 if v != nil { 17327 var virtualMachineRunCommandProperties VirtualMachineRunCommandProperties 17328 err = json.Unmarshal(*v, &virtualMachineRunCommandProperties) 17329 if err != nil { 17330 return err 17331 } 17332 vmrc.VirtualMachineRunCommandProperties = &virtualMachineRunCommandProperties 17333 } 17334 case "id": 17335 if v != nil { 17336 var ID string 17337 err = json.Unmarshal(*v, &ID) 17338 if err != nil { 17339 return err 17340 } 17341 vmrc.ID = &ID 17342 } 17343 case "name": 17344 if v != nil { 17345 var name string 17346 err = json.Unmarshal(*v, &name) 17347 if err != nil { 17348 return err 17349 } 17350 vmrc.Name = &name 17351 } 17352 case "type": 17353 if v != nil { 17354 var typeVar string 17355 err = json.Unmarshal(*v, &typeVar) 17356 if err != nil { 17357 return err 17358 } 17359 vmrc.Type = &typeVar 17360 } 17361 case "location": 17362 if v != nil { 17363 var location string 17364 err = json.Unmarshal(*v, &location) 17365 if err != nil { 17366 return err 17367 } 17368 vmrc.Location = &location 17369 } 17370 case "tags": 17371 if v != nil { 17372 var tags map[string]*string 17373 err = json.Unmarshal(*v, &tags) 17374 if err != nil { 17375 return err 17376 } 17377 vmrc.Tags = tags 17378 } 17379 } 17380 } 17381 17382 return nil 17383} 17384 17385// VirtualMachineRunCommandInstanceView the instance view of a virtual machine run command. 17386type VirtualMachineRunCommandInstanceView struct { 17387 // ExecutionState - Script execution status. Possible values include: 'ExecutionStateUnknown', 'ExecutionStatePending', 'ExecutionStateRunning', 'ExecutionStateFailed', 'ExecutionStateSucceeded', 'ExecutionStateTimedOut', 'ExecutionStateCanceled' 17388 ExecutionState ExecutionState `json:"executionState,omitempty"` 17389 // ExecutionMessage - Communicate script configuration errors or execution messages. 17390 ExecutionMessage *string `json:"executionMessage,omitempty"` 17391 // ExitCode - Exit code returned from script execution. 17392 ExitCode *int32 `json:"exitCode,omitempty"` 17393 // Output - Script output stream. 17394 Output *string `json:"output,omitempty"` 17395 // Error - Script error stream. 17396 Error *string `json:"error,omitempty"` 17397 // StartTime - Script start time. 17398 StartTime *date.Time `json:"startTime,omitempty"` 17399 // EndTime - Script end time. 17400 EndTime *date.Time `json:"endTime,omitempty"` 17401 // Statuses - The resource status information. 17402 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 17403} 17404 17405// VirtualMachineRunCommandProperties describes the properties of a Virtual Machine run command. 17406type VirtualMachineRunCommandProperties struct { 17407 // Source - The source of the run command script. 17408 Source *VirtualMachineRunCommandScriptSource `json:"source,omitempty"` 17409 // Parameters - The parameters used by the script. 17410 Parameters *[]RunCommandInputParameter `json:"parameters,omitempty"` 17411 // ProtectedParameters - The parameters used by the script. 17412 ProtectedParameters *[]RunCommandInputParameter `json:"protectedParameters,omitempty"` 17413 // AsyncExecution - Optional. If set to true, provisioning will complete as soon as the script starts and will not wait for script to complete. 17414 AsyncExecution *bool `json:"asyncExecution,omitempty"` 17415 // RunAsUser - Specifies the user account on the VM when executing the run command. 17416 RunAsUser *string `json:"runAsUser,omitempty"` 17417 // RunAsPassword - Specifies the user account password on the VM when executing the run command. 17418 RunAsPassword *string `json:"runAsPassword,omitempty"` 17419 // TimeoutInSeconds - The timeout in seconds to execute the run command. 17420 TimeoutInSeconds *int32 `json:"timeoutInSeconds,omitempty"` 17421 // OutputBlobURI - Specifies the Azure storage blob where script output stream will be uploaded. 17422 OutputBlobURI *string `json:"outputBlobUri,omitempty"` 17423 // ErrorBlobURI - Specifies the Azure storage blob where script error stream will be uploaded. 17424 ErrorBlobURI *string `json:"errorBlobUri,omitempty"` 17425 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 17426 ProvisioningState *string `json:"provisioningState,omitempty"` 17427 // InstanceView - READ-ONLY; The virtual machine run command instance view. 17428 InstanceView *VirtualMachineRunCommandInstanceView `json:"instanceView,omitempty"` 17429} 17430 17431// MarshalJSON is the custom marshaler for VirtualMachineRunCommandProperties. 17432func (vmrcp VirtualMachineRunCommandProperties) MarshalJSON() ([]byte, error) { 17433 objectMap := make(map[string]interface{}) 17434 if vmrcp.Source != nil { 17435 objectMap["source"] = vmrcp.Source 17436 } 17437 if vmrcp.Parameters != nil { 17438 objectMap["parameters"] = vmrcp.Parameters 17439 } 17440 if vmrcp.ProtectedParameters != nil { 17441 objectMap["protectedParameters"] = vmrcp.ProtectedParameters 17442 } 17443 if vmrcp.AsyncExecution != nil { 17444 objectMap["asyncExecution"] = vmrcp.AsyncExecution 17445 } 17446 if vmrcp.RunAsUser != nil { 17447 objectMap["runAsUser"] = vmrcp.RunAsUser 17448 } 17449 if vmrcp.RunAsPassword != nil { 17450 objectMap["runAsPassword"] = vmrcp.RunAsPassword 17451 } 17452 if vmrcp.TimeoutInSeconds != nil { 17453 objectMap["timeoutInSeconds"] = vmrcp.TimeoutInSeconds 17454 } 17455 if vmrcp.OutputBlobURI != nil { 17456 objectMap["outputBlobUri"] = vmrcp.OutputBlobURI 17457 } 17458 if vmrcp.ErrorBlobURI != nil { 17459 objectMap["errorBlobUri"] = vmrcp.ErrorBlobURI 17460 } 17461 return json.Marshal(objectMap) 17462} 17463 17464// VirtualMachineRunCommandsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results 17465// of a long-running operation. 17466type VirtualMachineRunCommandsCreateOrUpdateFuture struct { 17467 azure.FutureAPI 17468 // Result returns the result of the asynchronous operation. 17469 // If the operation has not completed it will return an error. 17470 Result func(VirtualMachineRunCommandsClient) (VirtualMachineRunCommand, error) 17471} 17472 17473// UnmarshalJSON is the custom unmarshaller for CreateFuture. 17474func (future *VirtualMachineRunCommandsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 17475 var azFuture azure.Future 17476 if err := json.Unmarshal(body, &azFuture); err != nil { 17477 return err 17478 } 17479 future.FutureAPI = &azFuture 17480 future.Result = future.result 17481 return nil 17482} 17483 17484// result is the default implementation for VirtualMachineRunCommandsCreateOrUpdateFuture.Result. 17485func (future *VirtualMachineRunCommandsCreateOrUpdateFuture) result(client VirtualMachineRunCommandsClient) (vmrc VirtualMachineRunCommand, err error) { 17486 var done bool 17487 done, err = future.DoneWithContext(context.Background(), client) 17488 if err != nil { 17489 err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 17490 return 17491 } 17492 if !done { 17493 vmrc.Response.Response = future.Response() 17494 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineRunCommandsCreateOrUpdateFuture") 17495 return 17496 } 17497 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 17498 if vmrc.Response.Response, err = future.GetResult(sender); err == nil && vmrc.Response.Response.StatusCode != http.StatusNoContent { 17499 vmrc, err = client.CreateOrUpdateResponder(vmrc.Response.Response) 17500 if err != nil { 17501 err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsCreateOrUpdateFuture", "Result", vmrc.Response.Response, "Failure responding to request") 17502 } 17503 } 17504 return 17505} 17506 17507// VirtualMachineRunCommandScriptSource describes the script sources for run command. 17508type VirtualMachineRunCommandScriptSource struct { 17509 // Script - Specifies the script content to be executed on the VM. 17510 Script *string `json:"script,omitempty"` 17511 // ScriptURI - Specifies the script download location. 17512 ScriptURI *string `json:"scriptUri,omitempty"` 17513 // CommandID - Specifies a commandId of predefined built-in script. 17514 CommandID *string `json:"commandId,omitempty"` 17515} 17516 17517// VirtualMachineRunCommandsDeleteFuture an abstraction for monitoring and retrieving the results of a 17518// long-running operation. 17519type VirtualMachineRunCommandsDeleteFuture struct { 17520 azure.FutureAPI 17521 // Result returns the result of the asynchronous operation. 17522 // If the operation has not completed it will return an error. 17523 Result func(VirtualMachineRunCommandsClient) (autorest.Response, error) 17524} 17525 17526// UnmarshalJSON is the custom unmarshaller for CreateFuture. 17527func (future *VirtualMachineRunCommandsDeleteFuture) UnmarshalJSON(body []byte) error { 17528 var azFuture azure.Future 17529 if err := json.Unmarshal(body, &azFuture); err != nil { 17530 return err 17531 } 17532 future.FutureAPI = &azFuture 17533 future.Result = future.result 17534 return nil 17535} 17536 17537// result is the default implementation for VirtualMachineRunCommandsDeleteFuture.Result. 17538func (future *VirtualMachineRunCommandsDeleteFuture) result(client VirtualMachineRunCommandsClient) (ar autorest.Response, err error) { 17539 var done bool 17540 done, err = future.DoneWithContext(context.Background(), client) 17541 if err != nil { 17542 err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsDeleteFuture", "Result", future.Response(), "Polling failure") 17543 return 17544 } 17545 if !done { 17546 ar.Response = future.Response() 17547 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineRunCommandsDeleteFuture") 17548 return 17549 } 17550 ar.Response = future.Response() 17551 return 17552} 17553 17554// VirtualMachineRunCommandsListResult the List run command operation response 17555type VirtualMachineRunCommandsListResult struct { 17556 autorest.Response `json:"-"` 17557 // Value - The list of run commands 17558 Value *[]VirtualMachineRunCommand `json:"value,omitempty"` 17559 // NextLink - The uri to fetch the next page of run commands. 17560 NextLink *string `json:"nextLink,omitempty"` 17561} 17562 17563// VirtualMachineRunCommandsListResultIterator provides access to a complete listing of 17564// VirtualMachineRunCommand values. 17565type VirtualMachineRunCommandsListResultIterator struct { 17566 i int 17567 page VirtualMachineRunCommandsListResultPage 17568} 17569 17570// NextWithContext advances to the next value. If there was an error making 17571// the request the iterator does not advance and the error is returned. 17572func (iter *VirtualMachineRunCommandsListResultIterator) NextWithContext(ctx context.Context) (err error) { 17573 if tracing.IsEnabled() { 17574 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsListResultIterator.NextWithContext") 17575 defer func() { 17576 sc := -1 17577 if iter.Response().Response.Response != nil { 17578 sc = iter.Response().Response.Response.StatusCode 17579 } 17580 tracing.EndSpan(ctx, sc, err) 17581 }() 17582 } 17583 iter.i++ 17584 if iter.i < len(iter.page.Values()) { 17585 return nil 17586 } 17587 err = iter.page.NextWithContext(ctx) 17588 if err != nil { 17589 iter.i-- 17590 return err 17591 } 17592 iter.i = 0 17593 return nil 17594} 17595 17596// Next advances to the next value. If there was an error making 17597// the request the iterator does not advance and the error is returned. 17598// Deprecated: Use NextWithContext() instead. 17599func (iter *VirtualMachineRunCommandsListResultIterator) Next() error { 17600 return iter.NextWithContext(context.Background()) 17601} 17602 17603// NotDone returns true if the enumeration should be started or is not yet complete. 17604func (iter VirtualMachineRunCommandsListResultIterator) NotDone() bool { 17605 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 17606} 17607 17608// Response returns the raw server response from the last page request. 17609func (iter VirtualMachineRunCommandsListResultIterator) Response() VirtualMachineRunCommandsListResult { 17610 return iter.page.Response() 17611} 17612 17613// Value returns the current value or a zero-initialized value if the 17614// iterator has advanced beyond the end of the collection. 17615func (iter VirtualMachineRunCommandsListResultIterator) Value() VirtualMachineRunCommand { 17616 if !iter.page.NotDone() { 17617 return VirtualMachineRunCommand{} 17618 } 17619 return iter.page.Values()[iter.i] 17620} 17621 17622// Creates a new instance of the VirtualMachineRunCommandsListResultIterator type. 17623func NewVirtualMachineRunCommandsListResultIterator(page VirtualMachineRunCommandsListResultPage) VirtualMachineRunCommandsListResultIterator { 17624 return VirtualMachineRunCommandsListResultIterator{page: page} 17625} 17626 17627// IsEmpty returns true if the ListResult contains no values. 17628func (vmrclr VirtualMachineRunCommandsListResult) IsEmpty() bool { 17629 return vmrclr.Value == nil || len(*vmrclr.Value) == 0 17630} 17631 17632// hasNextLink returns true if the NextLink is not empty. 17633func (vmrclr VirtualMachineRunCommandsListResult) hasNextLink() bool { 17634 return vmrclr.NextLink != nil && len(*vmrclr.NextLink) != 0 17635} 17636 17637// virtualMachineRunCommandsListResultPreparer prepares a request to retrieve the next set of results. 17638// It returns nil if no more results exist. 17639func (vmrclr VirtualMachineRunCommandsListResult) virtualMachineRunCommandsListResultPreparer(ctx context.Context) (*http.Request, error) { 17640 if !vmrclr.hasNextLink() { 17641 return nil, nil 17642 } 17643 return autorest.Prepare((&http.Request{}).WithContext(ctx), 17644 autorest.AsJSON(), 17645 autorest.AsGet(), 17646 autorest.WithBaseURL(to.String(vmrclr.NextLink))) 17647} 17648 17649// VirtualMachineRunCommandsListResultPage contains a page of VirtualMachineRunCommand values. 17650type VirtualMachineRunCommandsListResultPage struct { 17651 fn func(context.Context, VirtualMachineRunCommandsListResult) (VirtualMachineRunCommandsListResult, error) 17652 vmrclr VirtualMachineRunCommandsListResult 17653} 17654 17655// NextWithContext advances to the next page of values. If there was an error making 17656// the request the page does not advance and the error is returned. 17657func (page *VirtualMachineRunCommandsListResultPage) NextWithContext(ctx context.Context) (err error) { 17658 if tracing.IsEnabled() { 17659 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsListResultPage.NextWithContext") 17660 defer func() { 17661 sc := -1 17662 if page.Response().Response.Response != nil { 17663 sc = page.Response().Response.Response.StatusCode 17664 } 17665 tracing.EndSpan(ctx, sc, err) 17666 }() 17667 } 17668 for { 17669 next, err := page.fn(ctx, page.vmrclr) 17670 if err != nil { 17671 return err 17672 } 17673 page.vmrclr = next 17674 if !next.hasNextLink() || !next.IsEmpty() { 17675 break 17676 } 17677 } 17678 return nil 17679} 17680 17681// Next 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. 17683// Deprecated: Use NextWithContext() instead. 17684func (page *VirtualMachineRunCommandsListResultPage) Next() error { 17685 return page.NextWithContext(context.Background()) 17686} 17687 17688// NotDone returns true if the page enumeration should be started or is not yet complete. 17689func (page VirtualMachineRunCommandsListResultPage) NotDone() bool { 17690 return !page.vmrclr.IsEmpty() 17691} 17692 17693// Response returns the raw server response from the last page request. 17694func (page VirtualMachineRunCommandsListResultPage) Response() VirtualMachineRunCommandsListResult { 17695 return page.vmrclr 17696} 17697 17698// Values returns the slice of values for the current page or nil if there are no values. 17699func (page VirtualMachineRunCommandsListResultPage) Values() []VirtualMachineRunCommand { 17700 if page.vmrclr.IsEmpty() { 17701 return nil 17702 } 17703 return *page.vmrclr.Value 17704} 17705 17706// Creates a new instance of the VirtualMachineRunCommandsListResultPage type. 17707func NewVirtualMachineRunCommandsListResultPage(cur VirtualMachineRunCommandsListResult, getNextPage func(context.Context, VirtualMachineRunCommandsListResult) (VirtualMachineRunCommandsListResult, error)) VirtualMachineRunCommandsListResultPage { 17708 return VirtualMachineRunCommandsListResultPage{ 17709 fn: getNextPage, 17710 vmrclr: cur, 17711 } 17712} 17713 17714// VirtualMachineRunCommandsUpdateFuture an abstraction for monitoring and retrieving the results of a 17715// long-running operation. 17716type VirtualMachineRunCommandsUpdateFuture struct { 17717 azure.FutureAPI 17718 // Result returns the result of the asynchronous operation. 17719 // If the operation has not completed it will return an error. 17720 Result func(VirtualMachineRunCommandsClient) (VirtualMachineRunCommand, error) 17721} 17722 17723// UnmarshalJSON is the custom unmarshaller for CreateFuture. 17724func (future *VirtualMachineRunCommandsUpdateFuture) UnmarshalJSON(body []byte) error { 17725 var azFuture azure.Future 17726 if err := json.Unmarshal(body, &azFuture); err != nil { 17727 return err 17728 } 17729 future.FutureAPI = &azFuture 17730 future.Result = future.result 17731 return nil 17732} 17733 17734// result is the default implementation for VirtualMachineRunCommandsUpdateFuture.Result. 17735func (future *VirtualMachineRunCommandsUpdateFuture) result(client VirtualMachineRunCommandsClient) (vmrc VirtualMachineRunCommand, err error) { 17736 var done bool 17737 done, err = future.DoneWithContext(context.Background(), client) 17738 if err != nil { 17739 err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsUpdateFuture", "Result", future.Response(), "Polling failure") 17740 return 17741 } 17742 if !done { 17743 vmrc.Response.Response = future.Response() 17744 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineRunCommandsUpdateFuture") 17745 return 17746 } 17747 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 17748 if vmrc.Response.Response, err = future.GetResult(sender); err == nil && vmrc.Response.Response.StatusCode != http.StatusNoContent { 17749 vmrc, err = client.UpdateResponder(vmrc.Response.Response) 17750 if err != nil { 17751 err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsUpdateFuture", "Result", vmrc.Response.Response, "Failure responding to request") 17752 } 17753 } 17754 return 17755} 17756 17757// VirtualMachineRunCommandUpdate describes a Virtual Machine run command. 17758type VirtualMachineRunCommandUpdate struct { 17759 *VirtualMachineRunCommandProperties `json:"properties,omitempty"` 17760 // Tags - Resource tags 17761 Tags map[string]*string `json:"tags"` 17762} 17763 17764// MarshalJSON is the custom marshaler for VirtualMachineRunCommandUpdate. 17765func (vmrcu VirtualMachineRunCommandUpdate) MarshalJSON() ([]byte, error) { 17766 objectMap := make(map[string]interface{}) 17767 if vmrcu.VirtualMachineRunCommandProperties != nil { 17768 objectMap["properties"] = vmrcu.VirtualMachineRunCommandProperties 17769 } 17770 if vmrcu.Tags != nil { 17771 objectMap["tags"] = vmrcu.Tags 17772 } 17773 return json.Marshal(objectMap) 17774} 17775 17776// UnmarshalJSON is the custom unmarshaler for VirtualMachineRunCommandUpdate struct. 17777func (vmrcu *VirtualMachineRunCommandUpdate) UnmarshalJSON(body []byte) error { 17778 var m map[string]*json.RawMessage 17779 err := json.Unmarshal(body, &m) 17780 if err != nil { 17781 return err 17782 } 17783 for k, v := range m { 17784 switch k { 17785 case "properties": 17786 if v != nil { 17787 var virtualMachineRunCommandProperties VirtualMachineRunCommandProperties 17788 err = json.Unmarshal(*v, &virtualMachineRunCommandProperties) 17789 if err != nil { 17790 return err 17791 } 17792 vmrcu.VirtualMachineRunCommandProperties = &virtualMachineRunCommandProperties 17793 } 17794 case "tags": 17795 if v != nil { 17796 var tags map[string]*string 17797 err = json.Unmarshal(*v, &tags) 17798 if err != nil { 17799 return err 17800 } 17801 vmrcu.Tags = tags 17802 } 17803 } 17804 } 17805 17806 return nil 17807} 17808 17809// VirtualMachinesAssessPatchesFuture an abstraction for monitoring and retrieving the results of a 17810// long-running operation. 17811type VirtualMachinesAssessPatchesFuture struct { 17812 azure.FutureAPI 17813 // Result returns the result of the asynchronous operation. 17814 // If the operation has not completed it will return an error. 17815 Result func(VirtualMachinesClient) (VirtualMachineAssessPatchesResult, error) 17816} 17817 17818// UnmarshalJSON is the custom unmarshaller for CreateFuture. 17819func (future *VirtualMachinesAssessPatchesFuture) UnmarshalJSON(body []byte) error { 17820 var azFuture azure.Future 17821 if err := json.Unmarshal(body, &azFuture); err != nil { 17822 return err 17823 } 17824 future.FutureAPI = &azFuture 17825 future.Result = future.result 17826 return nil 17827} 17828 17829// result is the default implementation for VirtualMachinesAssessPatchesFuture.Result. 17830func (future *VirtualMachinesAssessPatchesFuture) result(client VirtualMachinesClient) (vmapr VirtualMachineAssessPatchesResult, err error) { 17831 var done bool 17832 done, err = future.DoneWithContext(context.Background(), client) 17833 if err != nil { 17834 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesAssessPatchesFuture", "Result", future.Response(), "Polling failure") 17835 return 17836 } 17837 if !done { 17838 vmapr.Response.Response = future.Response() 17839 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesAssessPatchesFuture") 17840 return 17841 } 17842 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 17843 if vmapr.Response.Response, err = future.GetResult(sender); err == nil && vmapr.Response.Response.StatusCode != http.StatusNoContent { 17844 vmapr, err = client.AssessPatchesResponder(vmapr.Response.Response) 17845 if err != nil { 17846 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesAssessPatchesFuture", "Result", vmapr.Response.Response, "Failure responding to request") 17847 } 17848 } 17849 return 17850} 17851 17852// VirtualMachineScaleSet describes a Virtual Machine Scale Set. 17853type VirtualMachineScaleSet struct { 17854 autorest.Response `json:"-"` 17855 // Sku - The virtual machine scale set sku. 17856 Sku *Sku `json:"sku,omitempty"` 17857 // 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**. 17858 Plan *Plan `json:"plan,omitempty"` 17859 *VirtualMachineScaleSetProperties `json:"properties,omitempty"` 17860 // Identity - The identity of the virtual machine scale set, if configured. 17861 Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"` 17862 // Zones - The virtual machine scale set zones. NOTE: Availability zones can only be set when you create the scale set 17863 Zones *[]string `json:"zones,omitempty"` 17864 // ExtendedLocation - The extended location of the Virtual Machine Scale Set. 17865 ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` 17866 // ID - READ-ONLY; Resource Id 17867 ID *string `json:"id,omitempty"` 17868 // Name - READ-ONLY; Resource name 17869 Name *string `json:"name,omitempty"` 17870 // Type - READ-ONLY; Resource type 17871 Type *string `json:"type,omitempty"` 17872 // Location - Resource location 17873 Location *string `json:"location,omitempty"` 17874 // Tags - Resource tags 17875 Tags map[string]*string `json:"tags"` 17876} 17877 17878// MarshalJSON is the custom marshaler for VirtualMachineScaleSet. 17879func (vmss VirtualMachineScaleSet) MarshalJSON() ([]byte, error) { 17880 objectMap := make(map[string]interface{}) 17881 if vmss.Sku != nil { 17882 objectMap["sku"] = vmss.Sku 17883 } 17884 if vmss.Plan != nil { 17885 objectMap["plan"] = vmss.Plan 17886 } 17887 if vmss.VirtualMachineScaleSetProperties != nil { 17888 objectMap["properties"] = vmss.VirtualMachineScaleSetProperties 17889 } 17890 if vmss.Identity != nil { 17891 objectMap["identity"] = vmss.Identity 17892 } 17893 if vmss.Zones != nil { 17894 objectMap["zones"] = vmss.Zones 17895 } 17896 if vmss.ExtendedLocation != nil { 17897 objectMap["extendedLocation"] = vmss.ExtendedLocation 17898 } 17899 if vmss.Location != nil { 17900 objectMap["location"] = vmss.Location 17901 } 17902 if vmss.Tags != nil { 17903 objectMap["tags"] = vmss.Tags 17904 } 17905 return json.Marshal(objectMap) 17906} 17907 17908// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSet struct. 17909func (vmss *VirtualMachineScaleSet) UnmarshalJSON(body []byte) error { 17910 var m map[string]*json.RawMessage 17911 err := json.Unmarshal(body, &m) 17912 if err != nil { 17913 return err 17914 } 17915 for k, v := range m { 17916 switch k { 17917 case "sku": 17918 if v != nil { 17919 var sku Sku 17920 err = json.Unmarshal(*v, &sku) 17921 if err != nil { 17922 return err 17923 } 17924 vmss.Sku = &sku 17925 } 17926 case "plan": 17927 if v != nil { 17928 var plan Plan 17929 err = json.Unmarshal(*v, &plan) 17930 if err != nil { 17931 return err 17932 } 17933 vmss.Plan = &plan 17934 } 17935 case "properties": 17936 if v != nil { 17937 var virtualMachineScaleSetProperties VirtualMachineScaleSetProperties 17938 err = json.Unmarshal(*v, &virtualMachineScaleSetProperties) 17939 if err != nil { 17940 return err 17941 } 17942 vmss.VirtualMachineScaleSetProperties = &virtualMachineScaleSetProperties 17943 } 17944 case "identity": 17945 if v != nil { 17946 var identity VirtualMachineScaleSetIdentity 17947 err = json.Unmarshal(*v, &identity) 17948 if err != nil { 17949 return err 17950 } 17951 vmss.Identity = &identity 17952 } 17953 case "zones": 17954 if v != nil { 17955 var zones []string 17956 err = json.Unmarshal(*v, &zones) 17957 if err != nil { 17958 return err 17959 } 17960 vmss.Zones = &zones 17961 } 17962 case "extendedLocation": 17963 if v != nil { 17964 var extendedLocation ExtendedLocation 17965 err = json.Unmarshal(*v, &extendedLocation) 17966 if err != nil { 17967 return err 17968 } 17969 vmss.ExtendedLocation = &extendedLocation 17970 } 17971 case "id": 17972 if v != nil { 17973 var ID string 17974 err = json.Unmarshal(*v, &ID) 17975 if err != nil { 17976 return err 17977 } 17978 vmss.ID = &ID 17979 } 17980 case "name": 17981 if v != nil { 17982 var name string 17983 err = json.Unmarshal(*v, &name) 17984 if err != nil { 17985 return err 17986 } 17987 vmss.Name = &name 17988 } 17989 case "type": 17990 if v != nil { 17991 var typeVar string 17992 err = json.Unmarshal(*v, &typeVar) 17993 if err != nil { 17994 return err 17995 } 17996 vmss.Type = &typeVar 17997 } 17998 case "location": 17999 if v != nil { 18000 var location string 18001 err = json.Unmarshal(*v, &location) 18002 if err != nil { 18003 return err 18004 } 18005 vmss.Location = &location 18006 } 18007 case "tags": 18008 if v != nil { 18009 var tags map[string]*string 18010 err = json.Unmarshal(*v, &tags) 18011 if err != nil { 18012 return err 18013 } 18014 vmss.Tags = tags 18015 } 18016 } 18017 } 18018 18019 return nil 18020} 18021 18022// VirtualMachineScaleSetDataDisk describes a virtual machine scale set data disk. 18023type VirtualMachineScaleSetDataDisk struct { 18024 // Name - The disk name. 18025 Name *string `json:"name,omitempty"` 18026 // 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. 18027 Lun *int32 `json:"lun,omitempty"` 18028 // 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' 18029 Caching CachingTypes `json:"caching,omitempty"` 18030 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 18031 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 18032 // CreateOption - The create option. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' 18033 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 18034 // 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 18035 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 18036 // ManagedDisk - The managed disk parameters. 18037 ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` 18038 // 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. 18039 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 18040 // 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. 18041 DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` 18042} 18043 18044// VirtualMachineScaleSetExtension describes a Virtual Machine Scale Set Extension. 18045type VirtualMachineScaleSetExtension struct { 18046 autorest.Response `json:"-"` 18047 // Name - The name of the extension. 18048 Name *string `json:"name,omitempty"` 18049 // Type - READ-ONLY; Resource type 18050 Type *string `json:"type,omitempty"` 18051 *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"` 18052 // ID - READ-ONLY; Resource Id 18053 ID *string `json:"id,omitempty"` 18054} 18055 18056// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtension. 18057func (vmsse VirtualMachineScaleSetExtension) MarshalJSON() ([]byte, error) { 18058 objectMap := make(map[string]interface{}) 18059 if vmsse.Name != nil { 18060 objectMap["name"] = vmsse.Name 18061 } 18062 if vmsse.VirtualMachineScaleSetExtensionProperties != nil { 18063 objectMap["properties"] = vmsse.VirtualMachineScaleSetExtensionProperties 18064 } 18065 return json.Marshal(objectMap) 18066} 18067 18068// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetExtension struct. 18069func (vmsse *VirtualMachineScaleSetExtension) UnmarshalJSON(body []byte) error { 18070 var m map[string]*json.RawMessage 18071 err := json.Unmarshal(body, &m) 18072 if err != nil { 18073 return err 18074 } 18075 for k, v := range m { 18076 switch k { 18077 case "name": 18078 if v != nil { 18079 var name string 18080 err = json.Unmarshal(*v, &name) 18081 if err != nil { 18082 return err 18083 } 18084 vmsse.Name = &name 18085 } 18086 case "type": 18087 if v != nil { 18088 var typeVar string 18089 err = json.Unmarshal(*v, &typeVar) 18090 if err != nil { 18091 return err 18092 } 18093 vmsse.Type = &typeVar 18094 } 18095 case "properties": 18096 if v != nil { 18097 var virtualMachineScaleSetExtensionProperties VirtualMachineScaleSetExtensionProperties 18098 err = json.Unmarshal(*v, &virtualMachineScaleSetExtensionProperties) 18099 if err != nil { 18100 return err 18101 } 18102 vmsse.VirtualMachineScaleSetExtensionProperties = &virtualMachineScaleSetExtensionProperties 18103 } 18104 case "id": 18105 if v != nil { 18106 var ID string 18107 err = json.Unmarshal(*v, &ID) 18108 if err != nil { 18109 return err 18110 } 18111 vmsse.ID = &ID 18112 } 18113 } 18114 } 18115 18116 return nil 18117} 18118 18119// VirtualMachineScaleSetExtensionListResult the List VM scale set extension operation response. 18120type VirtualMachineScaleSetExtensionListResult struct { 18121 autorest.Response `json:"-"` 18122 // Value - The list of VM scale set extensions. 18123 Value *[]VirtualMachineScaleSetExtension `json:"value,omitempty"` 18124 // 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. 18125 NextLink *string `json:"nextLink,omitempty"` 18126} 18127 18128// VirtualMachineScaleSetExtensionListResultIterator provides access to a complete listing of 18129// VirtualMachineScaleSetExtension values. 18130type VirtualMachineScaleSetExtensionListResultIterator struct { 18131 i int 18132 page VirtualMachineScaleSetExtensionListResultPage 18133} 18134 18135// NextWithContext advances to the next value. If there was an error making 18136// the request the iterator does not advance and the error is returned. 18137func (iter *VirtualMachineScaleSetExtensionListResultIterator) NextWithContext(ctx context.Context) (err error) { 18138 if tracing.IsEnabled() { 18139 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionListResultIterator.NextWithContext") 18140 defer func() { 18141 sc := -1 18142 if iter.Response().Response.Response != nil { 18143 sc = iter.Response().Response.Response.StatusCode 18144 } 18145 tracing.EndSpan(ctx, sc, err) 18146 }() 18147 } 18148 iter.i++ 18149 if iter.i < len(iter.page.Values()) { 18150 return nil 18151 } 18152 err = iter.page.NextWithContext(ctx) 18153 if err != nil { 18154 iter.i-- 18155 return err 18156 } 18157 iter.i = 0 18158 return nil 18159} 18160 18161// Next advances to the next value. If there was an error making 18162// the request the iterator does not advance and the error is returned. 18163// Deprecated: Use NextWithContext() instead. 18164func (iter *VirtualMachineScaleSetExtensionListResultIterator) Next() error { 18165 return iter.NextWithContext(context.Background()) 18166} 18167 18168// NotDone returns true if the enumeration should be started or is not yet complete. 18169func (iter VirtualMachineScaleSetExtensionListResultIterator) NotDone() bool { 18170 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 18171} 18172 18173// Response returns the raw server response from the last page request. 18174func (iter VirtualMachineScaleSetExtensionListResultIterator) Response() VirtualMachineScaleSetExtensionListResult { 18175 return iter.page.Response() 18176} 18177 18178// Value returns the current value or a zero-initialized value if the 18179// iterator has advanced beyond the end of the collection. 18180func (iter VirtualMachineScaleSetExtensionListResultIterator) Value() VirtualMachineScaleSetExtension { 18181 if !iter.page.NotDone() { 18182 return VirtualMachineScaleSetExtension{} 18183 } 18184 return iter.page.Values()[iter.i] 18185} 18186 18187// Creates a new instance of the VirtualMachineScaleSetExtensionListResultIterator type. 18188func NewVirtualMachineScaleSetExtensionListResultIterator(page VirtualMachineScaleSetExtensionListResultPage) VirtualMachineScaleSetExtensionListResultIterator { 18189 return VirtualMachineScaleSetExtensionListResultIterator{page: page} 18190} 18191 18192// IsEmpty returns true if the ListResult contains no values. 18193func (vmsselr VirtualMachineScaleSetExtensionListResult) IsEmpty() bool { 18194 return vmsselr.Value == nil || len(*vmsselr.Value) == 0 18195} 18196 18197// hasNextLink returns true if the NextLink is not empty. 18198func (vmsselr VirtualMachineScaleSetExtensionListResult) hasNextLink() bool { 18199 return vmsselr.NextLink != nil && len(*vmsselr.NextLink) != 0 18200} 18201 18202// virtualMachineScaleSetExtensionListResultPreparer prepares a request to retrieve the next set of results. 18203// It returns nil if no more results exist. 18204func (vmsselr VirtualMachineScaleSetExtensionListResult) virtualMachineScaleSetExtensionListResultPreparer(ctx context.Context) (*http.Request, error) { 18205 if !vmsselr.hasNextLink() { 18206 return nil, nil 18207 } 18208 return autorest.Prepare((&http.Request{}).WithContext(ctx), 18209 autorest.AsJSON(), 18210 autorest.AsGet(), 18211 autorest.WithBaseURL(to.String(vmsselr.NextLink))) 18212} 18213 18214// VirtualMachineScaleSetExtensionListResultPage contains a page of VirtualMachineScaleSetExtension values. 18215type VirtualMachineScaleSetExtensionListResultPage struct { 18216 fn func(context.Context, VirtualMachineScaleSetExtensionListResult) (VirtualMachineScaleSetExtensionListResult, error) 18217 vmsselr VirtualMachineScaleSetExtensionListResult 18218} 18219 18220// NextWithContext advances to the next page of values. If there was an error making 18221// the request the page does not advance and the error is returned. 18222func (page *VirtualMachineScaleSetExtensionListResultPage) NextWithContext(ctx context.Context) (err error) { 18223 if tracing.IsEnabled() { 18224 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionListResultPage.NextWithContext") 18225 defer func() { 18226 sc := -1 18227 if page.Response().Response.Response != nil { 18228 sc = page.Response().Response.Response.StatusCode 18229 } 18230 tracing.EndSpan(ctx, sc, err) 18231 }() 18232 } 18233 for { 18234 next, err := page.fn(ctx, page.vmsselr) 18235 if err != nil { 18236 return err 18237 } 18238 page.vmsselr = next 18239 if !next.hasNextLink() || !next.IsEmpty() { 18240 break 18241 } 18242 } 18243 return nil 18244} 18245 18246// Next advances to the next page of values. If there was an error making 18247// the request the page does not advance and the error is returned. 18248// Deprecated: Use NextWithContext() instead. 18249func (page *VirtualMachineScaleSetExtensionListResultPage) Next() error { 18250 return page.NextWithContext(context.Background()) 18251} 18252 18253// NotDone returns true if the page enumeration should be started or is not yet complete. 18254func (page VirtualMachineScaleSetExtensionListResultPage) NotDone() bool { 18255 return !page.vmsselr.IsEmpty() 18256} 18257 18258// Response returns the raw server response from the last page request. 18259func (page VirtualMachineScaleSetExtensionListResultPage) Response() VirtualMachineScaleSetExtensionListResult { 18260 return page.vmsselr 18261} 18262 18263// Values returns the slice of values for the current page or nil if there are no values. 18264func (page VirtualMachineScaleSetExtensionListResultPage) Values() []VirtualMachineScaleSetExtension { 18265 if page.vmsselr.IsEmpty() { 18266 return nil 18267 } 18268 return *page.vmsselr.Value 18269} 18270 18271// Creates a new instance of the VirtualMachineScaleSetExtensionListResultPage type. 18272func NewVirtualMachineScaleSetExtensionListResultPage(cur VirtualMachineScaleSetExtensionListResult, getNextPage func(context.Context, VirtualMachineScaleSetExtensionListResult) (VirtualMachineScaleSetExtensionListResult, error)) VirtualMachineScaleSetExtensionListResultPage { 18273 return VirtualMachineScaleSetExtensionListResultPage{ 18274 fn: getNextPage, 18275 vmsselr: cur, 18276 } 18277} 18278 18279// VirtualMachineScaleSetExtensionProfile describes a virtual machine scale set extension profile. 18280type VirtualMachineScaleSetExtensionProfile struct { 18281 // Extensions - The virtual machine scale set child extension resources. 18282 Extensions *[]VirtualMachineScaleSetExtension `json:"extensions,omitempty"` 18283 // 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 18284 ExtensionsTimeBudget *string `json:"extensionsTimeBudget,omitempty"` 18285} 18286 18287// VirtualMachineScaleSetExtensionProperties describes the properties of a Virtual Machine Scale Set 18288// Extension. 18289type VirtualMachineScaleSetExtensionProperties struct { 18290 // 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. 18291 ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` 18292 // Publisher - The name of the extension handler publisher. 18293 Publisher *string `json:"publisher,omitempty"` 18294 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 18295 Type *string `json:"type,omitempty"` 18296 // TypeHandlerVersion - Specifies the version of the script handler. 18297 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 18298 // 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. 18299 AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` 18300 // EnableAutomaticUpgrade - Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. 18301 EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` 18302 // Settings - Json formatted public settings for the extension. 18303 Settings interface{} `json:"settings,omitempty"` 18304 // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. 18305 ProtectedSettings interface{} `json:"protectedSettings,omitempty"` 18306 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 18307 ProvisioningState *string `json:"provisioningState,omitempty"` 18308 // ProvisionAfterExtensions - Collection of extension names after which this extension needs to be provisioned. 18309 ProvisionAfterExtensions *[]string `json:"provisionAfterExtensions,omitempty"` 18310 // SuppressFailures - Indicates whether failures stemming from the extension will be suppressed (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The default is false. 18311 SuppressFailures *bool `json:"suppressFailures,omitempty"` 18312} 18313 18314// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtensionProperties. 18315func (vmssep VirtualMachineScaleSetExtensionProperties) MarshalJSON() ([]byte, error) { 18316 objectMap := make(map[string]interface{}) 18317 if vmssep.ForceUpdateTag != nil { 18318 objectMap["forceUpdateTag"] = vmssep.ForceUpdateTag 18319 } 18320 if vmssep.Publisher != nil { 18321 objectMap["publisher"] = vmssep.Publisher 18322 } 18323 if vmssep.Type != nil { 18324 objectMap["type"] = vmssep.Type 18325 } 18326 if vmssep.TypeHandlerVersion != nil { 18327 objectMap["typeHandlerVersion"] = vmssep.TypeHandlerVersion 18328 } 18329 if vmssep.AutoUpgradeMinorVersion != nil { 18330 objectMap["autoUpgradeMinorVersion"] = vmssep.AutoUpgradeMinorVersion 18331 } 18332 if vmssep.EnableAutomaticUpgrade != nil { 18333 objectMap["enableAutomaticUpgrade"] = vmssep.EnableAutomaticUpgrade 18334 } 18335 if vmssep.Settings != nil { 18336 objectMap["settings"] = vmssep.Settings 18337 } 18338 if vmssep.ProtectedSettings != nil { 18339 objectMap["protectedSettings"] = vmssep.ProtectedSettings 18340 } 18341 if vmssep.ProvisionAfterExtensions != nil { 18342 objectMap["provisionAfterExtensions"] = vmssep.ProvisionAfterExtensions 18343 } 18344 if vmssep.SuppressFailures != nil { 18345 objectMap["suppressFailures"] = vmssep.SuppressFailures 18346 } 18347 return json.Marshal(objectMap) 18348} 18349 18350// VirtualMachineScaleSetExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the 18351// results of a long-running operation. 18352type VirtualMachineScaleSetExtensionsCreateOrUpdateFuture struct { 18353 azure.FutureAPI 18354 // Result returns the result of the asynchronous operation. 18355 // If the operation has not completed it will return an error. 18356 Result func(VirtualMachineScaleSetExtensionsClient) (VirtualMachineScaleSetExtension, error) 18357} 18358 18359// UnmarshalJSON is the custom unmarshaller for CreateFuture. 18360func (future *VirtualMachineScaleSetExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 18361 var azFuture azure.Future 18362 if err := json.Unmarshal(body, &azFuture); err != nil { 18363 return err 18364 } 18365 future.FutureAPI = &azFuture 18366 future.Result = future.result 18367 return nil 18368} 18369 18370// result is the default implementation for VirtualMachineScaleSetExtensionsCreateOrUpdateFuture.Result. 18371func (future *VirtualMachineScaleSetExtensionsCreateOrUpdateFuture) result(client VirtualMachineScaleSetExtensionsClient) (vmsse VirtualMachineScaleSetExtension, err error) { 18372 var done bool 18373 done, err = future.DoneWithContext(context.Background(), client) 18374 if err != nil { 18375 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 18376 return 18377 } 18378 if !done { 18379 vmsse.Response.Response = future.Response() 18380 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture") 18381 return 18382 } 18383 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 18384 if vmsse.Response.Response, err = future.GetResult(sender); err == nil && vmsse.Response.Response.StatusCode != http.StatusNoContent { 18385 vmsse, err = client.CreateOrUpdateResponder(vmsse.Response.Response) 18386 if err != nil { 18387 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture", "Result", vmsse.Response.Response, "Failure responding to request") 18388 } 18389 } 18390 return 18391} 18392 18393// VirtualMachineScaleSetExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of 18394// a long-running operation. 18395type VirtualMachineScaleSetExtensionsDeleteFuture struct { 18396 azure.FutureAPI 18397 // Result returns the result of the asynchronous operation. 18398 // If the operation has not completed it will return an error. 18399 Result func(VirtualMachineScaleSetExtensionsClient) (autorest.Response, error) 18400} 18401 18402// UnmarshalJSON is the custom unmarshaller for CreateFuture. 18403func (future *VirtualMachineScaleSetExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { 18404 var azFuture azure.Future 18405 if err := json.Unmarshal(body, &azFuture); err != nil { 18406 return err 18407 } 18408 future.FutureAPI = &azFuture 18409 future.Result = future.result 18410 return nil 18411} 18412 18413// result is the default implementation for VirtualMachineScaleSetExtensionsDeleteFuture.Result. 18414func (future *VirtualMachineScaleSetExtensionsDeleteFuture) result(client VirtualMachineScaleSetExtensionsClient) (ar autorest.Response, err error) { 18415 var done bool 18416 done, err = future.DoneWithContext(context.Background(), client) 18417 if err != nil { 18418 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") 18419 return 18420 } 18421 if !done { 18422 ar.Response = future.Response() 18423 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsDeleteFuture") 18424 return 18425 } 18426 ar.Response = future.Response() 18427 return 18428} 18429 18430// VirtualMachineScaleSetExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of 18431// a long-running operation. 18432type VirtualMachineScaleSetExtensionsUpdateFuture struct { 18433 azure.FutureAPI 18434 // Result returns the result of the asynchronous operation. 18435 // If the operation has not completed it will return an error. 18436 Result func(VirtualMachineScaleSetExtensionsClient) (VirtualMachineScaleSetExtension, error) 18437} 18438 18439// UnmarshalJSON is the custom unmarshaller for CreateFuture. 18440func (future *VirtualMachineScaleSetExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { 18441 var azFuture azure.Future 18442 if err := json.Unmarshal(body, &azFuture); err != nil { 18443 return err 18444 } 18445 future.FutureAPI = &azFuture 18446 future.Result = future.result 18447 return nil 18448} 18449 18450// result is the default implementation for VirtualMachineScaleSetExtensionsUpdateFuture.Result. 18451func (future *VirtualMachineScaleSetExtensionsUpdateFuture) result(client VirtualMachineScaleSetExtensionsClient) (vmsse VirtualMachineScaleSetExtension, err error) { 18452 var done bool 18453 done, err = future.DoneWithContext(context.Background(), client) 18454 if err != nil { 18455 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsUpdateFuture", "Result", future.Response(), "Polling failure") 18456 return 18457 } 18458 if !done { 18459 vmsse.Response.Response = future.Response() 18460 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsUpdateFuture") 18461 return 18462 } 18463 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 18464 if vmsse.Response.Response, err = future.GetResult(sender); err == nil && vmsse.Response.Response.StatusCode != http.StatusNoContent { 18465 vmsse, err = client.UpdateResponder(vmsse.Response.Response) 18466 if err != nil { 18467 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsUpdateFuture", "Result", vmsse.Response.Response, "Failure responding to request") 18468 } 18469 } 18470 return 18471} 18472 18473// VirtualMachineScaleSetExtensionUpdate describes a Virtual Machine Scale Set Extension. 18474type VirtualMachineScaleSetExtensionUpdate struct { 18475 // Name - READ-ONLY; The name of the extension. 18476 Name *string `json:"name,omitempty"` 18477 // Type - READ-ONLY; Resource type 18478 Type *string `json:"type,omitempty"` 18479 *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"` 18480 // ID - READ-ONLY; Resource Id 18481 ID *string `json:"id,omitempty"` 18482} 18483 18484// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtensionUpdate. 18485func (vmsseu VirtualMachineScaleSetExtensionUpdate) MarshalJSON() ([]byte, error) { 18486 objectMap := make(map[string]interface{}) 18487 if vmsseu.VirtualMachineScaleSetExtensionProperties != nil { 18488 objectMap["properties"] = vmsseu.VirtualMachineScaleSetExtensionProperties 18489 } 18490 return json.Marshal(objectMap) 18491} 18492 18493// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetExtensionUpdate struct. 18494func (vmsseu *VirtualMachineScaleSetExtensionUpdate) UnmarshalJSON(body []byte) error { 18495 var m map[string]*json.RawMessage 18496 err := json.Unmarshal(body, &m) 18497 if err != nil { 18498 return err 18499 } 18500 for k, v := range m { 18501 switch k { 18502 case "name": 18503 if v != nil { 18504 var name string 18505 err = json.Unmarshal(*v, &name) 18506 if err != nil { 18507 return err 18508 } 18509 vmsseu.Name = &name 18510 } 18511 case "type": 18512 if v != nil { 18513 var typeVar string 18514 err = json.Unmarshal(*v, &typeVar) 18515 if err != nil { 18516 return err 18517 } 18518 vmsseu.Type = &typeVar 18519 } 18520 case "properties": 18521 if v != nil { 18522 var virtualMachineScaleSetExtensionProperties VirtualMachineScaleSetExtensionProperties 18523 err = json.Unmarshal(*v, &virtualMachineScaleSetExtensionProperties) 18524 if err != nil { 18525 return err 18526 } 18527 vmsseu.VirtualMachineScaleSetExtensionProperties = &virtualMachineScaleSetExtensionProperties 18528 } 18529 case "id": 18530 if v != nil { 18531 var ID string 18532 err = json.Unmarshal(*v, &ID) 18533 if err != nil { 18534 return err 18535 } 18536 vmsseu.ID = &ID 18537 } 18538 } 18539 } 18540 18541 return nil 18542} 18543 18544// VirtualMachineScaleSetIdentity identity for the virtual machine scale set. 18545type VirtualMachineScaleSetIdentity struct { 18546 // PrincipalID - READ-ONLY; The principal id of virtual machine scale set identity. This property will only be provided for a system assigned identity. 18547 PrincipalID *string `json:"principalId,omitempty"` 18548 // TenantID - READ-ONLY; The tenant id associated with the virtual machine scale set. This property will only be provided for a system assigned identity. 18549 TenantID *string `json:"tenantId,omitempty"` 18550 // 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' 18551 Type ResourceIdentityType `json:"type,omitempty"` 18552 // 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}'. 18553 UserAssignedIdentities map[string]*VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` 18554} 18555 18556// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIdentity. 18557func (vmssi VirtualMachineScaleSetIdentity) MarshalJSON() ([]byte, error) { 18558 objectMap := make(map[string]interface{}) 18559 if vmssi.Type != "" { 18560 objectMap["type"] = vmssi.Type 18561 } 18562 if vmssi.UserAssignedIdentities != nil { 18563 objectMap["userAssignedIdentities"] = vmssi.UserAssignedIdentities 18564 } 18565 return json.Marshal(objectMap) 18566} 18567 18568// VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue ... 18569type VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue struct { 18570 // PrincipalID - READ-ONLY; The principal id of user assigned identity. 18571 PrincipalID *string `json:"principalId,omitempty"` 18572 // ClientID - READ-ONLY; The client id of user assigned identity. 18573 ClientID *string `json:"clientId,omitempty"` 18574} 18575 18576// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue. 18577func (vmssiAiv VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) { 18578 objectMap := make(map[string]interface{}) 18579 return json.Marshal(objectMap) 18580} 18581 18582// VirtualMachineScaleSetInstanceView the instance view of a virtual machine scale set. 18583type VirtualMachineScaleSetInstanceView struct { 18584 autorest.Response `json:"-"` 18585 // VirtualMachine - READ-ONLY; The instance view status summary for the virtual machine scale set. 18586 VirtualMachine *VirtualMachineScaleSetInstanceViewStatusesSummary `json:"virtualMachine,omitempty"` 18587 // Extensions - READ-ONLY; The extensions information. 18588 Extensions *[]VirtualMachineScaleSetVMExtensionsSummary `json:"extensions,omitempty"` 18589 // Statuses - The resource status information. 18590 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 18591 // OrchestrationServices - READ-ONLY; The orchestration services information. 18592 OrchestrationServices *[]OrchestrationServiceSummary `json:"orchestrationServices,omitempty"` 18593} 18594 18595// MarshalJSON is the custom marshaler for VirtualMachineScaleSetInstanceView. 18596func (vmssiv VirtualMachineScaleSetInstanceView) MarshalJSON() ([]byte, error) { 18597 objectMap := make(map[string]interface{}) 18598 if vmssiv.Statuses != nil { 18599 objectMap["statuses"] = vmssiv.Statuses 18600 } 18601 return json.Marshal(objectMap) 18602} 18603 18604// VirtualMachineScaleSetInstanceViewStatusesSummary instance view statuses summary for virtual machines of 18605// a virtual machine scale set. 18606type VirtualMachineScaleSetInstanceViewStatusesSummary struct { 18607 // StatusesSummary - READ-ONLY; The extensions information. 18608 StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` 18609} 18610 18611// MarshalJSON is the custom marshaler for VirtualMachineScaleSetInstanceViewStatusesSummary. 18612func (vmssivss VirtualMachineScaleSetInstanceViewStatusesSummary) MarshalJSON() ([]byte, error) { 18613 objectMap := make(map[string]interface{}) 18614 return json.Marshal(objectMap) 18615} 18616 18617// VirtualMachineScaleSetIPConfiguration describes a virtual machine scale set network profile's IP 18618// configuration. 18619type VirtualMachineScaleSetIPConfiguration struct { 18620 // Name - The IP configuration name. 18621 Name *string `json:"name,omitempty"` 18622 *VirtualMachineScaleSetIPConfigurationProperties `json:"properties,omitempty"` 18623 // ID - Resource Id 18624 ID *string `json:"id,omitempty"` 18625} 18626 18627// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIPConfiguration. 18628func (vmssic VirtualMachineScaleSetIPConfiguration) MarshalJSON() ([]byte, error) { 18629 objectMap := make(map[string]interface{}) 18630 if vmssic.Name != nil { 18631 objectMap["name"] = vmssic.Name 18632 } 18633 if vmssic.VirtualMachineScaleSetIPConfigurationProperties != nil { 18634 objectMap["properties"] = vmssic.VirtualMachineScaleSetIPConfigurationProperties 18635 } 18636 if vmssic.ID != nil { 18637 objectMap["id"] = vmssic.ID 18638 } 18639 return json.Marshal(objectMap) 18640} 18641 18642// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetIPConfiguration struct. 18643func (vmssic *VirtualMachineScaleSetIPConfiguration) UnmarshalJSON(body []byte) error { 18644 var m map[string]*json.RawMessage 18645 err := json.Unmarshal(body, &m) 18646 if err != nil { 18647 return err 18648 } 18649 for k, v := range m { 18650 switch k { 18651 case "name": 18652 if v != nil { 18653 var name string 18654 err = json.Unmarshal(*v, &name) 18655 if err != nil { 18656 return err 18657 } 18658 vmssic.Name = &name 18659 } 18660 case "properties": 18661 if v != nil { 18662 var virtualMachineScaleSetIPConfigurationProperties VirtualMachineScaleSetIPConfigurationProperties 18663 err = json.Unmarshal(*v, &virtualMachineScaleSetIPConfigurationProperties) 18664 if err != nil { 18665 return err 18666 } 18667 vmssic.VirtualMachineScaleSetIPConfigurationProperties = &virtualMachineScaleSetIPConfigurationProperties 18668 } 18669 case "id": 18670 if v != nil { 18671 var ID string 18672 err = json.Unmarshal(*v, &ID) 18673 if err != nil { 18674 return err 18675 } 18676 vmssic.ID = &ID 18677 } 18678 } 18679 } 18680 18681 return nil 18682} 18683 18684// VirtualMachineScaleSetIPConfigurationProperties describes a virtual machine scale set network profile's 18685// IP configuration properties. 18686type VirtualMachineScaleSetIPConfigurationProperties struct { 18687 // Subnet - Specifies the identifier of the subnet. 18688 Subnet *APIEntityReference `json:"subnet,omitempty"` 18689 // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. 18690 Primary *bool `json:"primary,omitempty"` 18691 // PublicIPAddressConfiguration - The publicIPAddressConfiguration. 18692 PublicIPAddressConfiguration *VirtualMachineScaleSetPublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` 18693 // 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' 18694 PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` 18695 // 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. 18696 ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` 18697 // ApplicationSecurityGroups - Specifies an array of references to application security group. 18698 ApplicationSecurityGroups *[]SubResource `json:"applicationSecurityGroups,omitempty"` 18699 // 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. 18700 LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` 18701 // 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. 18702 LoadBalancerInboundNatPools *[]SubResource `json:"loadBalancerInboundNatPools,omitempty"` 18703} 18704 18705// VirtualMachineScaleSetIPTag contains the IP tag associated with the public IP address. 18706type VirtualMachineScaleSetIPTag struct { 18707 // IPTagType - IP tag type. Example: FirstPartyUsage. 18708 IPTagType *string `json:"ipTagType,omitempty"` 18709 // Tag - IP tag associated with the public IP. Example: SQL, Storage etc. 18710 Tag *string `json:"tag,omitempty"` 18711} 18712 18713// VirtualMachineScaleSetListOSUpgradeHistory list of Virtual Machine Scale Set OS Upgrade History 18714// operation response. 18715type VirtualMachineScaleSetListOSUpgradeHistory struct { 18716 autorest.Response `json:"-"` 18717 // Value - The list of OS upgrades performed on the virtual machine scale set. 18718 Value *[]UpgradeOperationHistoricalStatusInfo `json:"value,omitempty"` 18719 // 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. 18720 NextLink *string `json:"nextLink,omitempty"` 18721} 18722 18723// VirtualMachineScaleSetListOSUpgradeHistoryIterator provides access to a complete listing of 18724// UpgradeOperationHistoricalStatusInfo values. 18725type VirtualMachineScaleSetListOSUpgradeHistoryIterator struct { 18726 i int 18727 page VirtualMachineScaleSetListOSUpgradeHistoryPage 18728} 18729 18730// NextWithContext advances to the next value. If there was an error making 18731// the request the iterator does not advance and the error is returned. 18732func (iter *VirtualMachineScaleSetListOSUpgradeHistoryIterator) NextWithContext(ctx context.Context) (err error) { 18733 if tracing.IsEnabled() { 18734 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListOSUpgradeHistoryIterator.NextWithContext") 18735 defer func() { 18736 sc := -1 18737 if iter.Response().Response.Response != nil { 18738 sc = iter.Response().Response.Response.StatusCode 18739 } 18740 tracing.EndSpan(ctx, sc, err) 18741 }() 18742 } 18743 iter.i++ 18744 if iter.i < len(iter.page.Values()) { 18745 return nil 18746 } 18747 err = iter.page.NextWithContext(ctx) 18748 if err != nil { 18749 iter.i-- 18750 return err 18751 } 18752 iter.i = 0 18753 return nil 18754} 18755 18756// Next advances to the next value. If there was an error making 18757// the request the iterator does not advance and the error is returned. 18758// Deprecated: Use NextWithContext() instead. 18759func (iter *VirtualMachineScaleSetListOSUpgradeHistoryIterator) Next() error { 18760 return iter.NextWithContext(context.Background()) 18761} 18762 18763// NotDone returns true if the enumeration should be started or is not yet complete. 18764func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) NotDone() bool { 18765 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 18766} 18767 18768// Response returns the raw server response from the last page request. 18769func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) Response() VirtualMachineScaleSetListOSUpgradeHistory { 18770 return iter.page.Response() 18771} 18772 18773// Value returns the current value or a zero-initialized value if the 18774// iterator has advanced beyond the end of the collection. 18775func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) Value() UpgradeOperationHistoricalStatusInfo { 18776 if !iter.page.NotDone() { 18777 return UpgradeOperationHistoricalStatusInfo{} 18778 } 18779 return iter.page.Values()[iter.i] 18780} 18781 18782// Creates a new instance of the VirtualMachineScaleSetListOSUpgradeHistoryIterator type. 18783func NewVirtualMachineScaleSetListOSUpgradeHistoryIterator(page VirtualMachineScaleSetListOSUpgradeHistoryPage) VirtualMachineScaleSetListOSUpgradeHistoryIterator { 18784 return VirtualMachineScaleSetListOSUpgradeHistoryIterator{page: page} 18785} 18786 18787// IsEmpty returns true if the ListResult contains no values. 18788func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) IsEmpty() bool { 18789 return vmsslouh.Value == nil || len(*vmsslouh.Value) == 0 18790} 18791 18792// hasNextLink returns true if the NextLink is not empty. 18793func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) hasNextLink() bool { 18794 return vmsslouh.NextLink != nil && len(*vmsslouh.NextLink) != 0 18795} 18796 18797// virtualMachineScaleSetListOSUpgradeHistoryPreparer prepares a request to retrieve the next set of results. 18798// It returns nil if no more results exist. 18799func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) virtualMachineScaleSetListOSUpgradeHistoryPreparer(ctx context.Context) (*http.Request, error) { 18800 if !vmsslouh.hasNextLink() { 18801 return nil, nil 18802 } 18803 return autorest.Prepare((&http.Request{}).WithContext(ctx), 18804 autorest.AsJSON(), 18805 autorest.AsGet(), 18806 autorest.WithBaseURL(to.String(vmsslouh.NextLink))) 18807} 18808 18809// VirtualMachineScaleSetListOSUpgradeHistoryPage contains a page of UpgradeOperationHistoricalStatusInfo 18810// values. 18811type VirtualMachineScaleSetListOSUpgradeHistoryPage struct { 18812 fn func(context.Context, VirtualMachineScaleSetListOSUpgradeHistory) (VirtualMachineScaleSetListOSUpgradeHistory, error) 18813 vmsslouh VirtualMachineScaleSetListOSUpgradeHistory 18814} 18815 18816// NextWithContext advances to the next page of values. If there was an error making 18817// the request the page does not advance and the error is returned. 18818func (page *VirtualMachineScaleSetListOSUpgradeHistoryPage) NextWithContext(ctx context.Context) (err error) { 18819 if tracing.IsEnabled() { 18820 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListOSUpgradeHistoryPage.NextWithContext") 18821 defer func() { 18822 sc := -1 18823 if page.Response().Response.Response != nil { 18824 sc = page.Response().Response.Response.StatusCode 18825 } 18826 tracing.EndSpan(ctx, sc, err) 18827 }() 18828 } 18829 for { 18830 next, err := page.fn(ctx, page.vmsslouh) 18831 if err != nil { 18832 return err 18833 } 18834 page.vmsslouh = next 18835 if !next.hasNextLink() || !next.IsEmpty() { 18836 break 18837 } 18838 } 18839 return nil 18840} 18841 18842// Next advances to the next page of values. If there was an error making 18843// the request the page does not advance and the error is returned. 18844// Deprecated: Use NextWithContext() instead. 18845func (page *VirtualMachineScaleSetListOSUpgradeHistoryPage) Next() error { 18846 return page.NextWithContext(context.Background()) 18847} 18848 18849// NotDone returns true if the page enumeration should be started or is not yet complete. 18850func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) NotDone() bool { 18851 return !page.vmsslouh.IsEmpty() 18852} 18853 18854// Response returns the raw server response from the last page request. 18855func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) Response() VirtualMachineScaleSetListOSUpgradeHistory { 18856 return page.vmsslouh 18857} 18858 18859// Values returns the slice of values for the current page or nil if there are no values. 18860func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) Values() []UpgradeOperationHistoricalStatusInfo { 18861 if page.vmsslouh.IsEmpty() { 18862 return nil 18863 } 18864 return *page.vmsslouh.Value 18865} 18866 18867// Creates a new instance of the VirtualMachineScaleSetListOSUpgradeHistoryPage type. 18868func NewVirtualMachineScaleSetListOSUpgradeHistoryPage(cur VirtualMachineScaleSetListOSUpgradeHistory, getNextPage func(context.Context, VirtualMachineScaleSetListOSUpgradeHistory) (VirtualMachineScaleSetListOSUpgradeHistory, error)) VirtualMachineScaleSetListOSUpgradeHistoryPage { 18869 return VirtualMachineScaleSetListOSUpgradeHistoryPage{ 18870 fn: getNextPage, 18871 vmsslouh: cur, 18872 } 18873} 18874 18875// VirtualMachineScaleSetListResult the List Virtual Machine operation response. 18876type VirtualMachineScaleSetListResult struct { 18877 autorest.Response `json:"-"` 18878 // Value - The list of virtual machine scale sets. 18879 Value *[]VirtualMachineScaleSet `json:"value,omitempty"` 18880 // NextLink - The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with this to fetch the next page of VMSS. 18881 NextLink *string `json:"nextLink,omitempty"` 18882} 18883 18884// VirtualMachineScaleSetListResultIterator provides access to a complete listing of VirtualMachineScaleSet 18885// values. 18886type VirtualMachineScaleSetListResultIterator struct { 18887 i int 18888 page VirtualMachineScaleSetListResultPage 18889} 18890 18891// NextWithContext advances to the next value. If there was an error making 18892// the request the iterator does not advance and the error is returned. 18893func (iter *VirtualMachineScaleSetListResultIterator) NextWithContext(ctx context.Context) (err error) { 18894 if tracing.IsEnabled() { 18895 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListResultIterator.NextWithContext") 18896 defer func() { 18897 sc := -1 18898 if iter.Response().Response.Response != nil { 18899 sc = iter.Response().Response.Response.StatusCode 18900 } 18901 tracing.EndSpan(ctx, sc, err) 18902 }() 18903 } 18904 iter.i++ 18905 if iter.i < len(iter.page.Values()) { 18906 return nil 18907 } 18908 err = iter.page.NextWithContext(ctx) 18909 if err != nil { 18910 iter.i-- 18911 return err 18912 } 18913 iter.i = 0 18914 return nil 18915} 18916 18917// Next advances to the next value. If there was an error making 18918// the request the iterator does not advance and the error is returned. 18919// Deprecated: Use NextWithContext() instead. 18920func (iter *VirtualMachineScaleSetListResultIterator) Next() error { 18921 return iter.NextWithContext(context.Background()) 18922} 18923 18924// NotDone returns true if the enumeration should be started or is not yet complete. 18925func (iter VirtualMachineScaleSetListResultIterator) NotDone() bool { 18926 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 18927} 18928 18929// Response returns the raw server response from the last page request. 18930func (iter VirtualMachineScaleSetListResultIterator) Response() VirtualMachineScaleSetListResult { 18931 return iter.page.Response() 18932} 18933 18934// Value returns the current value or a zero-initialized value if the 18935// iterator has advanced beyond the end of the collection. 18936func (iter VirtualMachineScaleSetListResultIterator) Value() VirtualMachineScaleSet { 18937 if !iter.page.NotDone() { 18938 return VirtualMachineScaleSet{} 18939 } 18940 return iter.page.Values()[iter.i] 18941} 18942 18943// Creates a new instance of the VirtualMachineScaleSetListResultIterator type. 18944func NewVirtualMachineScaleSetListResultIterator(page VirtualMachineScaleSetListResultPage) VirtualMachineScaleSetListResultIterator { 18945 return VirtualMachineScaleSetListResultIterator{page: page} 18946} 18947 18948// IsEmpty returns true if the ListResult contains no values. 18949func (vmsslr VirtualMachineScaleSetListResult) IsEmpty() bool { 18950 return vmsslr.Value == nil || len(*vmsslr.Value) == 0 18951} 18952 18953// hasNextLink returns true if the NextLink is not empty. 18954func (vmsslr VirtualMachineScaleSetListResult) hasNextLink() bool { 18955 return vmsslr.NextLink != nil && len(*vmsslr.NextLink) != 0 18956} 18957 18958// virtualMachineScaleSetListResultPreparer prepares a request to retrieve the next set of results. 18959// It returns nil if no more results exist. 18960func (vmsslr VirtualMachineScaleSetListResult) virtualMachineScaleSetListResultPreparer(ctx context.Context) (*http.Request, error) { 18961 if !vmsslr.hasNextLink() { 18962 return nil, nil 18963 } 18964 return autorest.Prepare((&http.Request{}).WithContext(ctx), 18965 autorest.AsJSON(), 18966 autorest.AsGet(), 18967 autorest.WithBaseURL(to.String(vmsslr.NextLink))) 18968} 18969 18970// VirtualMachineScaleSetListResultPage contains a page of VirtualMachineScaleSet values. 18971type VirtualMachineScaleSetListResultPage struct { 18972 fn func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error) 18973 vmsslr VirtualMachineScaleSetListResult 18974} 18975 18976// NextWithContext advances to the next page of values. If there was an error making 18977// the request the page does not advance and the error is returned. 18978func (page *VirtualMachineScaleSetListResultPage) NextWithContext(ctx context.Context) (err error) { 18979 if tracing.IsEnabled() { 18980 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListResultPage.NextWithContext") 18981 defer func() { 18982 sc := -1 18983 if page.Response().Response.Response != nil { 18984 sc = page.Response().Response.Response.StatusCode 18985 } 18986 tracing.EndSpan(ctx, sc, err) 18987 }() 18988 } 18989 for { 18990 next, err := page.fn(ctx, page.vmsslr) 18991 if err != nil { 18992 return err 18993 } 18994 page.vmsslr = next 18995 if !next.hasNextLink() || !next.IsEmpty() { 18996 break 18997 } 18998 } 18999 return nil 19000} 19001 19002// Next advances to the next page of values. If there was an error making 19003// the request the page does not advance and the error is returned. 19004// Deprecated: Use NextWithContext() instead. 19005func (page *VirtualMachineScaleSetListResultPage) Next() error { 19006 return page.NextWithContext(context.Background()) 19007} 19008 19009// NotDone returns true if the page enumeration should be started or is not yet complete. 19010func (page VirtualMachineScaleSetListResultPage) NotDone() bool { 19011 return !page.vmsslr.IsEmpty() 19012} 19013 19014// Response returns the raw server response from the last page request. 19015func (page VirtualMachineScaleSetListResultPage) Response() VirtualMachineScaleSetListResult { 19016 return page.vmsslr 19017} 19018 19019// Values returns the slice of values for the current page or nil if there are no values. 19020func (page VirtualMachineScaleSetListResultPage) Values() []VirtualMachineScaleSet { 19021 if page.vmsslr.IsEmpty() { 19022 return nil 19023 } 19024 return *page.vmsslr.Value 19025} 19026 19027// Creates a new instance of the VirtualMachineScaleSetListResultPage type. 19028func NewVirtualMachineScaleSetListResultPage(cur VirtualMachineScaleSetListResult, getNextPage func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error)) VirtualMachineScaleSetListResultPage { 19029 return VirtualMachineScaleSetListResultPage{ 19030 fn: getNextPage, 19031 vmsslr: cur, 19032 } 19033} 19034 19035// VirtualMachineScaleSetListSkusResult the Virtual Machine Scale Set List Skus operation response. 19036type VirtualMachineScaleSetListSkusResult struct { 19037 autorest.Response `json:"-"` 19038 // Value - The list of skus available for the virtual machine scale set. 19039 Value *[]VirtualMachineScaleSetSku `json:"value,omitempty"` 19040 // 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. 19041 NextLink *string `json:"nextLink,omitempty"` 19042} 19043 19044// VirtualMachineScaleSetListSkusResultIterator provides access to a complete listing of 19045// VirtualMachineScaleSetSku values. 19046type VirtualMachineScaleSetListSkusResultIterator struct { 19047 i int 19048 page VirtualMachineScaleSetListSkusResultPage 19049} 19050 19051// NextWithContext advances to the next value. If there was an error making 19052// the request the iterator does not advance and the error is returned. 19053func (iter *VirtualMachineScaleSetListSkusResultIterator) NextWithContext(ctx context.Context) (err error) { 19054 if tracing.IsEnabled() { 19055 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListSkusResultIterator.NextWithContext") 19056 defer func() { 19057 sc := -1 19058 if iter.Response().Response.Response != nil { 19059 sc = iter.Response().Response.Response.StatusCode 19060 } 19061 tracing.EndSpan(ctx, sc, err) 19062 }() 19063 } 19064 iter.i++ 19065 if iter.i < len(iter.page.Values()) { 19066 return nil 19067 } 19068 err = iter.page.NextWithContext(ctx) 19069 if err != nil { 19070 iter.i-- 19071 return err 19072 } 19073 iter.i = 0 19074 return nil 19075} 19076 19077// Next advances to the next value. If there was an error making 19078// the request the iterator does not advance and the error is returned. 19079// Deprecated: Use NextWithContext() instead. 19080func (iter *VirtualMachineScaleSetListSkusResultIterator) Next() error { 19081 return iter.NextWithContext(context.Background()) 19082} 19083 19084// NotDone returns true if the enumeration should be started or is not yet complete. 19085func (iter VirtualMachineScaleSetListSkusResultIterator) NotDone() bool { 19086 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 19087} 19088 19089// Response returns the raw server response from the last page request. 19090func (iter VirtualMachineScaleSetListSkusResultIterator) Response() VirtualMachineScaleSetListSkusResult { 19091 return iter.page.Response() 19092} 19093 19094// Value returns the current value or a zero-initialized value if the 19095// iterator has advanced beyond the end of the collection. 19096func (iter VirtualMachineScaleSetListSkusResultIterator) Value() VirtualMachineScaleSetSku { 19097 if !iter.page.NotDone() { 19098 return VirtualMachineScaleSetSku{} 19099 } 19100 return iter.page.Values()[iter.i] 19101} 19102 19103// Creates a new instance of the VirtualMachineScaleSetListSkusResultIterator type. 19104func NewVirtualMachineScaleSetListSkusResultIterator(page VirtualMachineScaleSetListSkusResultPage) VirtualMachineScaleSetListSkusResultIterator { 19105 return VirtualMachineScaleSetListSkusResultIterator{page: page} 19106} 19107 19108// IsEmpty returns true if the ListResult contains no values. 19109func (vmsslsr VirtualMachineScaleSetListSkusResult) IsEmpty() bool { 19110 return vmsslsr.Value == nil || len(*vmsslsr.Value) == 0 19111} 19112 19113// hasNextLink returns true if the NextLink is not empty. 19114func (vmsslsr VirtualMachineScaleSetListSkusResult) hasNextLink() bool { 19115 return vmsslsr.NextLink != nil && len(*vmsslsr.NextLink) != 0 19116} 19117 19118// virtualMachineScaleSetListSkusResultPreparer prepares a request to retrieve the next set of results. 19119// It returns nil if no more results exist. 19120func (vmsslsr VirtualMachineScaleSetListSkusResult) virtualMachineScaleSetListSkusResultPreparer(ctx context.Context) (*http.Request, error) { 19121 if !vmsslsr.hasNextLink() { 19122 return nil, nil 19123 } 19124 return autorest.Prepare((&http.Request{}).WithContext(ctx), 19125 autorest.AsJSON(), 19126 autorest.AsGet(), 19127 autorest.WithBaseURL(to.String(vmsslsr.NextLink))) 19128} 19129 19130// VirtualMachineScaleSetListSkusResultPage contains a page of VirtualMachineScaleSetSku values. 19131type VirtualMachineScaleSetListSkusResultPage struct { 19132 fn func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error) 19133 vmsslsr VirtualMachineScaleSetListSkusResult 19134} 19135 19136// NextWithContext advances to the next page of values. If there was an error making 19137// the request the page does not advance and the error is returned. 19138func (page *VirtualMachineScaleSetListSkusResultPage) NextWithContext(ctx context.Context) (err error) { 19139 if tracing.IsEnabled() { 19140 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListSkusResultPage.NextWithContext") 19141 defer func() { 19142 sc := -1 19143 if page.Response().Response.Response != nil { 19144 sc = page.Response().Response.Response.StatusCode 19145 } 19146 tracing.EndSpan(ctx, sc, err) 19147 }() 19148 } 19149 for { 19150 next, err := page.fn(ctx, page.vmsslsr) 19151 if err != nil { 19152 return err 19153 } 19154 page.vmsslsr = next 19155 if !next.hasNextLink() || !next.IsEmpty() { 19156 break 19157 } 19158 } 19159 return nil 19160} 19161 19162// Next advances to the next page of values. If there was an error making 19163// the request the page does not advance and the error is returned. 19164// Deprecated: Use NextWithContext() instead. 19165func (page *VirtualMachineScaleSetListSkusResultPage) Next() error { 19166 return page.NextWithContext(context.Background()) 19167} 19168 19169// NotDone returns true if the page enumeration should be started or is not yet complete. 19170func (page VirtualMachineScaleSetListSkusResultPage) NotDone() bool { 19171 return !page.vmsslsr.IsEmpty() 19172} 19173 19174// Response returns the raw server response from the last page request. 19175func (page VirtualMachineScaleSetListSkusResultPage) Response() VirtualMachineScaleSetListSkusResult { 19176 return page.vmsslsr 19177} 19178 19179// Values returns the slice of values for the current page or nil if there are no values. 19180func (page VirtualMachineScaleSetListSkusResultPage) Values() []VirtualMachineScaleSetSku { 19181 if page.vmsslsr.IsEmpty() { 19182 return nil 19183 } 19184 return *page.vmsslsr.Value 19185} 19186 19187// Creates a new instance of the VirtualMachineScaleSetListSkusResultPage type. 19188func NewVirtualMachineScaleSetListSkusResultPage(cur VirtualMachineScaleSetListSkusResult, getNextPage func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error)) VirtualMachineScaleSetListSkusResultPage { 19189 return VirtualMachineScaleSetListSkusResultPage{ 19190 fn: getNextPage, 19191 vmsslsr: cur, 19192 } 19193} 19194 19195// VirtualMachineScaleSetListWithLinkResult the List Virtual Machine operation response. 19196type VirtualMachineScaleSetListWithLinkResult struct { 19197 autorest.Response `json:"-"` 19198 // Value - The list of virtual machine scale sets. 19199 Value *[]VirtualMachineScaleSet `json:"value,omitempty"` 19200 // 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. 19201 NextLink *string `json:"nextLink,omitempty"` 19202} 19203 19204// VirtualMachineScaleSetListWithLinkResultIterator provides access to a complete listing of 19205// VirtualMachineScaleSet values. 19206type VirtualMachineScaleSetListWithLinkResultIterator struct { 19207 i int 19208 page VirtualMachineScaleSetListWithLinkResultPage 19209} 19210 19211// NextWithContext advances to the next value. If there was an error making 19212// the request the iterator does not advance and the error is returned. 19213func (iter *VirtualMachineScaleSetListWithLinkResultIterator) NextWithContext(ctx context.Context) (err error) { 19214 if tracing.IsEnabled() { 19215 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListWithLinkResultIterator.NextWithContext") 19216 defer func() { 19217 sc := -1 19218 if iter.Response().Response.Response != nil { 19219 sc = iter.Response().Response.Response.StatusCode 19220 } 19221 tracing.EndSpan(ctx, sc, err) 19222 }() 19223 } 19224 iter.i++ 19225 if iter.i < len(iter.page.Values()) { 19226 return nil 19227 } 19228 err = iter.page.NextWithContext(ctx) 19229 if err != nil { 19230 iter.i-- 19231 return err 19232 } 19233 iter.i = 0 19234 return nil 19235} 19236 19237// Next advances to the next value. If there was an error making 19238// the request the iterator does not advance and the error is returned. 19239// Deprecated: Use NextWithContext() instead. 19240func (iter *VirtualMachineScaleSetListWithLinkResultIterator) Next() error { 19241 return iter.NextWithContext(context.Background()) 19242} 19243 19244// NotDone returns true if the enumeration should be started or is not yet complete. 19245func (iter VirtualMachineScaleSetListWithLinkResultIterator) NotDone() bool { 19246 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 19247} 19248 19249// Response returns the raw server response from the last page request. 19250func (iter VirtualMachineScaleSetListWithLinkResultIterator) Response() VirtualMachineScaleSetListWithLinkResult { 19251 return iter.page.Response() 19252} 19253 19254// Value returns the current value or a zero-initialized value if the 19255// iterator has advanced beyond the end of the collection. 19256func (iter VirtualMachineScaleSetListWithLinkResultIterator) Value() VirtualMachineScaleSet { 19257 if !iter.page.NotDone() { 19258 return VirtualMachineScaleSet{} 19259 } 19260 return iter.page.Values()[iter.i] 19261} 19262 19263// Creates a new instance of the VirtualMachineScaleSetListWithLinkResultIterator type. 19264func NewVirtualMachineScaleSetListWithLinkResultIterator(page VirtualMachineScaleSetListWithLinkResultPage) VirtualMachineScaleSetListWithLinkResultIterator { 19265 return VirtualMachineScaleSetListWithLinkResultIterator{page: page} 19266} 19267 19268// IsEmpty returns true if the ListResult contains no values. 19269func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) IsEmpty() bool { 19270 return vmsslwlr.Value == nil || len(*vmsslwlr.Value) == 0 19271} 19272 19273// hasNextLink returns true if the NextLink is not empty. 19274func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) hasNextLink() bool { 19275 return vmsslwlr.NextLink != nil && len(*vmsslwlr.NextLink) != 0 19276} 19277 19278// virtualMachineScaleSetListWithLinkResultPreparer prepares a request to retrieve the next set of results. 19279// It returns nil if no more results exist. 19280func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) virtualMachineScaleSetListWithLinkResultPreparer(ctx context.Context) (*http.Request, error) { 19281 if !vmsslwlr.hasNextLink() { 19282 return nil, nil 19283 } 19284 return autorest.Prepare((&http.Request{}).WithContext(ctx), 19285 autorest.AsJSON(), 19286 autorest.AsGet(), 19287 autorest.WithBaseURL(to.String(vmsslwlr.NextLink))) 19288} 19289 19290// VirtualMachineScaleSetListWithLinkResultPage contains a page of VirtualMachineScaleSet values. 19291type VirtualMachineScaleSetListWithLinkResultPage struct { 19292 fn func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error) 19293 vmsslwlr VirtualMachineScaleSetListWithLinkResult 19294} 19295 19296// NextWithContext advances to the next page of values. If there was an error making 19297// the request the page does not advance and the error is returned. 19298func (page *VirtualMachineScaleSetListWithLinkResultPage) NextWithContext(ctx context.Context) (err error) { 19299 if tracing.IsEnabled() { 19300 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListWithLinkResultPage.NextWithContext") 19301 defer func() { 19302 sc := -1 19303 if page.Response().Response.Response != nil { 19304 sc = page.Response().Response.Response.StatusCode 19305 } 19306 tracing.EndSpan(ctx, sc, err) 19307 }() 19308 } 19309 for { 19310 next, err := page.fn(ctx, page.vmsslwlr) 19311 if err != nil { 19312 return err 19313 } 19314 page.vmsslwlr = next 19315 if !next.hasNextLink() || !next.IsEmpty() { 19316 break 19317 } 19318 } 19319 return nil 19320} 19321 19322// Next advances to the next page of values. If there was an error making 19323// the request the page does not advance and the error is returned. 19324// Deprecated: Use NextWithContext() instead. 19325func (page *VirtualMachineScaleSetListWithLinkResultPage) Next() error { 19326 return page.NextWithContext(context.Background()) 19327} 19328 19329// NotDone returns true if the page enumeration should be started or is not yet complete. 19330func (page VirtualMachineScaleSetListWithLinkResultPage) NotDone() bool { 19331 return !page.vmsslwlr.IsEmpty() 19332} 19333 19334// Response returns the raw server response from the last page request. 19335func (page VirtualMachineScaleSetListWithLinkResultPage) Response() VirtualMachineScaleSetListWithLinkResult { 19336 return page.vmsslwlr 19337} 19338 19339// Values returns the slice of values for the current page or nil if there are no values. 19340func (page VirtualMachineScaleSetListWithLinkResultPage) Values() []VirtualMachineScaleSet { 19341 if page.vmsslwlr.IsEmpty() { 19342 return nil 19343 } 19344 return *page.vmsslwlr.Value 19345} 19346 19347// Creates a new instance of the VirtualMachineScaleSetListWithLinkResultPage type. 19348func NewVirtualMachineScaleSetListWithLinkResultPage(cur VirtualMachineScaleSetListWithLinkResult, getNextPage func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error)) VirtualMachineScaleSetListWithLinkResultPage { 19349 return VirtualMachineScaleSetListWithLinkResultPage{ 19350 fn: getNextPage, 19351 vmsslwlr: cur, 19352 } 19353} 19354 19355// VirtualMachineScaleSetManagedDiskParameters describes the parameters of a ScaleSet managed disk. 19356type VirtualMachineScaleSetManagedDiskParameters struct { 19357 // 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' 19358 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 19359 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed disk. 19360 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 19361} 19362 19363// VirtualMachineScaleSetNetworkConfiguration describes a virtual machine scale set network profile's 19364// network configurations. 19365type VirtualMachineScaleSetNetworkConfiguration struct { 19366 // Name - The network configuration name. 19367 Name *string `json:"name,omitempty"` 19368 *VirtualMachineScaleSetNetworkConfigurationProperties `json:"properties,omitempty"` 19369 // ID - Resource Id 19370 ID *string `json:"id,omitempty"` 19371} 19372 19373// MarshalJSON is the custom marshaler for VirtualMachineScaleSetNetworkConfiguration. 19374func (vmssnc VirtualMachineScaleSetNetworkConfiguration) MarshalJSON() ([]byte, error) { 19375 objectMap := make(map[string]interface{}) 19376 if vmssnc.Name != nil { 19377 objectMap["name"] = vmssnc.Name 19378 } 19379 if vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties != nil { 19380 objectMap["properties"] = vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties 19381 } 19382 if vmssnc.ID != nil { 19383 objectMap["id"] = vmssnc.ID 19384 } 19385 return json.Marshal(objectMap) 19386} 19387 19388// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetNetworkConfiguration struct. 19389func (vmssnc *VirtualMachineScaleSetNetworkConfiguration) UnmarshalJSON(body []byte) error { 19390 var m map[string]*json.RawMessage 19391 err := json.Unmarshal(body, &m) 19392 if err != nil { 19393 return err 19394 } 19395 for k, v := range m { 19396 switch k { 19397 case "name": 19398 if v != nil { 19399 var name string 19400 err = json.Unmarshal(*v, &name) 19401 if err != nil { 19402 return err 19403 } 19404 vmssnc.Name = &name 19405 } 19406 case "properties": 19407 if v != nil { 19408 var virtualMachineScaleSetNetworkConfigurationProperties VirtualMachineScaleSetNetworkConfigurationProperties 19409 err = json.Unmarshal(*v, &virtualMachineScaleSetNetworkConfigurationProperties) 19410 if err != nil { 19411 return err 19412 } 19413 vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties = &virtualMachineScaleSetNetworkConfigurationProperties 19414 } 19415 case "id": 19416 if v != nil { 19417 var ID string 19418 err = json.Unmarshal(*v, &ID) 19419 if err != nil { 19420 return err 19421 } 19422 vmssnc.ID = &ID 19423 } 19424 } 19425 } 19426 19427 return nil 19428} 19429 19430// VirtualMachineScaleSetNetworkConfigurationDNSSettings describes a virtual machines scale sets network 19431// configuration's DNS settings. 19432type VirtualMachineScaleSetNetworkConfigurationDNSSettings struct { 19433 // DNSServers - List of DNS servers IP addresses 19434 DNSServers *[]string `json:"dnsServers,omitempty"` 19435} 19436 19437// VirtualMachineScaleSetNetworkConfigurationProperties describes a virtual machine scale set network 19438// profile's IP configuration. 19439type VirtualMachineScaleSetNetworkConfigurationProperties struct { 19440 // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. 19441 Primary *bool `json:"primary,omitempty"` 19442 // EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled. 19443 EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` 19444 // EnableFpga - Specifies whether the network interface is FPGA networking-enabled. 19445 EnableFpga *bool `json:"enableFpga,omitempty"` 19446 // NetworkSecurityGroup - The network security group. 19447 NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` 19448 // DNSSettings - The dns settings to be applied on the network interfaces. 19449 DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings `json:"dnsSettings,omitempty"` 19450 // IPConfigurations - Specifies the IP configurations of the network interface. 19451 IPConfigurations *[]VirtualMachineScaleSetIPConfiguration `json:"ipConfigurations,omitempty"` 19452 // EnableIPForwarding - Whether IP forwarding enabled on this NIC. 19453 EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` 19454 // DeleteOption - Specify what happens to the network interface when the VM is deleted. Possible values include: 'DeleteOptionsDelete', 'DeleteOptionsDetach' 19455 DeleteOption DeleteOptions `json:"deleteOption,omitempty"` 19456} 19457 19458// VirtualMachineScaleSetNetworkProfile describes a virtual machine scale set network profile. 19459type VirtualMachineScaleSetNetworkProfile struct { 19460 // 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}'. 19461 HealthProbe *APIEntityReference `json:"healthProbe,omitempty"` 19462 // NetworkInterfaceConfigurations - The list of network configurations. 19463 NetworkInterfaceConfigurations *[]VirtualMachineScaleSetNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` 19464 // 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' 19465 NetworkAPIVersion NetworkAPIVersion `json:"networkApiVersion,omitempty"` 19466} 19467 19468// VirtualMachineScaleSetOSDisk describes a virtual machine scale set operating system disk. 19469type VirtualMachineScaleSetOSDisk struct { 19470 // Name - The disk name. 19471 Name *string `json:"name,omitempty"` 19472 // 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' 19473 Caching CachingTypes `json:"caching,omitempty"` 19474 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 19475 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 19476 // 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' 19477 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 19478 // DiffDiskSettings - Specifies the ephemeral disk Settings for the operating system disk used by the virtual machine scale set. 19479 DiffDiskSettings *DiffDiskSettings `json:"diffDiskSettings,omitempty"` 19480 // 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 19481 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 19482 // 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' 19483 OsType OperatingSystemTypes `json:"osType,omitempty"` 19484 // Image - Specifies information about the unmanaged user image to base the scale set on. 19485 Image *VirtualHardDisk `json:"image,omitempty"` 19486 // VhdContainers - Specifies the container urls that are used to store operating system disks for the scale set. 19487 VhdContainers *[]string `json:"vhdContainers,omitempty"` 19488 // ManagedDisk - The managed disk parameters. 19489 ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` 19490} 19491 19492// VirtualMachineScaleSetOSProfile describes a virtual machine scale set OS profile. 19493type VirtualMachineScaleSetOSProfile struct { 19494 // 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. 19495 ComputerNamePrefix *string `json:"computerNamePrefix,omitempty"` 19496 // 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 19497 AdminUsername *string `json:"adminUsername,omitempty"` 19498 // 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) 19499 AdminPassword *string `json:"adminPassword,omitempty"` 19500 // 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) 19501 CustomData *string `json:"customData,omitempty"` 19502 // WindowsConfiguration - Specifies Windows operating system settings on the virtual machine. 19503 WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` 19504 // 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). 19505 LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` 19506 // Secrets - Specifies set of certificates that should be installed onto the virtual machines in the scale set. To install certificates on a virtual machine it is recommended to use the [Azure Key Vault virtual machine extension for Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) or the [Azure Key Vault virtual machine extension for Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). 19507 Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` 19508} 19509 19510// VirtualMachineScaleSetProperties describes the properties of a Virtual Machine Scale Set. 19511type VirtualMachineScaleSetProperties struct { 19512 // UpgradePolicy - The upgrade policy. 19513 UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` 19514 // AutomaticRepairsPolicy - Policy for automatic repairs. 19515 AutomaticRepairsPolicy *AutomaticRepairsPolicy `json:"automaticRepairsPolicy,omitempty"` 19516 // VirtualMachineProfile - The virtual machine profile. 19517 VirtualMachineProfile *VirtualMachineScaleSetVMProfile `json:"virtualMachineProfile,omitempty"` 19518 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 19519 ProvisioningState *string `json:"provisioningState,omitempty"` 19520 // Overprovision - Specifies whether the Virtual Machine Scale Set should be overprovisioned. 19521 Overprovision *bool `json:"overprovision,omitempty"` 19522 // 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. 19523 DoNotRunExtensionsOnOverprovisionedVMs *bool `json:"doNotRunExtensionsOnOverprovisionedVMs,omitempty"` 19524 // UniqueID - READ-ONLY; Specifies the ID which uniquely identifies a Virtual Machine Scale Set. 19525 UniqueID *string `json:"uniqueId,omitempty"` 19526 // 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. 19527 SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"` 19528 // ZoneBalance - Whether to force strictly even Virtual Machine distribution cross x-zones in case there is zone outage. zoneBalance property can only be set if the zones property of the scale set contains more than one zone. If there are no zones or only one zone specified, then zoneBalance property should not be set. 19529 ZoneBalance *bool `json:"zoneBalance,omitempty"` 19530 // PlatformFaultDomainCount - Fault Domain count for each placement group. 19531 PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` 19532 // 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. 19533 ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` 19534 // HostGroup - Specifies information about the dedicated host group that the virtual machine scale set resides in. <br><br>Minimum api-version: 2020-06-01. 19535 HostGroup *SubResource `json:"hostGroup,omitempty"` 19536 // 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. 19537 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 19538 // ScaleInPolicy - Specifies the policies applied when scaling in Virtual Machines in the Virtual Machine Scale Set. 19539 ScaleInPolicy *ScaleInPolicy `json:"scaleInPolicy,omitempty"` 19540 // OrchestrationMode - Specifies the orchestration mode for the virtual machine scale set. Possible values include: 'OrchestrationModeUniform', 'OrchestrationModeFlexible' 19541 OrchestrationMode OrchestrationMode `json:"orchestrationMode,omitempty"` 19542 // SpotRestorePolicy - Specifies the Spot Restore properties for the virtual machine scale set. 19543 SpotRestorePolicy *SpotRestorePolicy `json:"spotRestorePolicy,omitempty"` 19544} 19545 19546// MarshalJSON is the custom marshaler for VirtualMachineScaleSetProperties. 19547func (vmssp VirtualMachineScaleSetProperties) MarshalJSON() ([]byte, error) { 19548 objectMap := make(map[string]interface{}) 19549 if vmssp.UpgradePolicy != nil { 19550 objectMap["upgradePolicy"] = vmssp.UpgradePolicy 19551 } 19552 if vmssp.AutomaticRepairsPolicy != nil { 19553 objectMap["automaticRepairsPolicy"] = vmssp.AutomaticRepairsPolicy 19554 } 19555 if vmssp.VirtualMachineProfile != nil { 19556 objectMap["virtualMachineProfile"] = vmssp.VirtualMachineProfile 19557 } 19558 if vmssp.Overprovision != nil { 19559 objectMap["overprovision"] = vmssp.Overprovision 19560 } 19561 if vmssp.DoNotRunExtensionsOnOverprovisionedVMs != nil { 19562 objectMap["doNotRunExtensionsOnOverprovisionedVMs"] = vmssp.DoNotRunExtensionsOnOverprovisionedVMs 19563 } 19564 if vmssp.SinglePlacementGroup != nil { 19565 objectMap["singlePlacementGroup"] = vmssp.SinglePlacementGroup 19566 } 19567 if vmssp.ZoneBalance != nil { 19568 objectMap["zoneBalance"] = vmssp.ZoneBalance 19569 } 19570 if vmssp.PlatformFaultDomainCount != nil { 19571 objectMap["platformFaultDomainCount"] = vmssp.PlatformFaultDomainCount 19572 } 19573 if vmssp.ProximityPlacementGroup != nil { 19574 objectMap["proximityPlacementGroup"] = vmssp.ProximityPlacementGroup 19575 } 19576 if vmssp.HostGroup != nil { 19577 objectMap["hostGroup"] = vmssp.HostGroup 19578 } 19579 if vmssp.AdditionalCapabilities != nil { 19580 objectMap["additionalCapabilities"] = vmssp.AdditionalCapabilities 19581 } 19582 if vmssp.ScaleInPolicy != nil { 19583 objectMap["scaleInPolicy"] = vmssp.ScaleInPolicy 19584 } 19585 if vmssp.OrchestrationMode != "" { 19586 objectMap["orchestrationMode"] = vmssp.OrchestrationMode 19587 } 19588 if vmssp.SpotRestorePolicy != nil { 19589 objectMap["spotRestorePolicy"] = vmssp.SpotRestorePolicy 19590 } 19591 return json.Marshal(objectMap) 19592} 19593 19594// VirtualMachineScaleSetPublicIPAddressConfiguration describes a virtual machines scale set IP 19595// Configuration's PublicIPAddress configuration 19596type VirtualMachineScaleSetPublicIPAddressConfiguration struct { 19597 // Name - The publicIP address configuration name. 19598 Name *string `json:"name,omitempty"` 19599 *VirtualMachineScaleSetPublicIPAddressConfigurationProperties `json:"properties,omitempty"` 19600 Sku *PublicIPAddressSku `json:"sku,omitempty"` 19601} 19602 19603// MarshalJSON is the custom marshaler for VirtualMachineScaleSetPublicIPAddressConfiguration. 19604func (vmsspiac VirtualMachineScaleSetPublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { 19605 objectMap := make(map[string]interface{}) 19606 if vmsspiac.Name != nil { 19607 objectMap["name"] = vmsspiac.Name 19608 } 19609 if vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties != nil { 19610 objectMap["properties"] = vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties 19611 } 19612 if vmsspiac.Sku != nil { 19613 objectMap["sku"] = vmsspiac.Sku 19614 } 19615 return json.Marshal(objectMap) 19616} 19617 19618// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetPublicIPAddressConfiguration struct. 19619func (vmsspiac *VirtualMachineScaleSetPublicIPAddressConfiguration) UnmarshalJSON(body []byte) error { 19620 var m map[string]*json.RawMessage 19621 err := json.Unmarshal(body, &m) 19622 if err != nil { 19623 return err 19624 } 19625 for k, v := range m { 19626 switch k { 19627 case "name": 19628 if v != nil { 19629 var name string 19630 err = json.Unmarshal(*v, &name) 19631 if err != nil { 19632 return err 19633 } 19634 vmsspiac.Name = &name 19635 } 19636 case "properties": 19637 if v != nil { 19638 var virtualMachineScaleSetPublicIPAddressConfigurationProperties VirtualMachineScaleSetPublicIPAddressConfigurationProperties 19639 err = json.Unmarshal(*v, &virtualMachineScaleSetPublicIPAddressConfigurationProperties) 19640 if err != nil { 19641 return err 19642 } 19643 vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties = &virtualMachineScaleSetPublicIPAddressConfigurationProperties 19644 } 19645 case "sku": 19646 if v != nil { 19647 var sku PublicIPAddressSku 19648 err = json.Unmarshal(*v, &sku) 19649 if err != nil { 19650 return err 19651 } 19652 vmsspiac.Sku = &sku 19653 } 19654 } 19655 } 19656 19657 return nil 19658} 19659 19660// VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings describes a virtual machines scale sets 19661// network configuration's DNS settings. 19662type VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings struct { 19663 // 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 19664 DomainNameLabel *string `json:"domainNameLabel,omitempty"` 19665} 19666 19667// VirtualMachineScaleSetPublicIPAddressConfigurationProperties describes a virtual machines scale set IP 19668// Configuration's PublicIPAddress configuration 19669type VirtualMachineScaleSetPublicIPAddressConfigurationProperties struct { 19670 // IdleTimeoutInMinutes - The idle timeout of the public IP address. 19671 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` 19672 // DNSSettings - The dns settings to be applied on the publicIP addresses . 19673 DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings `json:"dnsSettings,omitempty"` 19674 // IPTags - The list of IP tags associated with the public IP address. 19675 IPTags *[]VirtualMachineScaleSetIPTag `json:"ipTags,omitempty"` 19676 // PublicIPPrefix - The PublicIPPrefix from which to allocate publicIP addresses. 19677 PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` 19678 // 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' 19679 PublicIPAddressVersion IPVersion `json:"publicIPAddressVersion,omitempty"` 19680 // DeleteOption - Specify what happens to the public IP when the VM is deleted. Possible values include: 'DeleteOptionsDelete', 'DeleteOptionsDetach' 19681 DeleteOption DeleteOptions `json:"deleteOption,omitempty"` 19682} 19683 19684// VirtualMachineScaleSetReimageParameters describes a Virtual Machine Scale Set VM Reimage Parameters. 19685type VirtualMachineScaleSetReimageParameters struct { 19686 // 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. 19687 InstanceIds *[]string `json:"instanceIds,omitempty"` 19688 // 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. 19689 TempDisk *bool `json:"tempDisk,omitempty"` 19690} 19691 19692// VirtualMachineScaleSetRollingUpgradesCancelFuture an abstraction for monitoring and retrieving the 19693// results of a long-running operation. 19694type VirtualMachineScaleSetRollingUpgradesCancelFuture struct { 19695 azure.FutureAPI 19696 // Result returns the result of the asynchronous operation. 19697 // If the operation has not completed it will return an error. 19698 Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) 19699} 19700 19701// UnmarshalJSON is the custom unmarshaller for CreateFuture. 19702func (future *VirtualMachineScaleSetRollingUpgradesCancelFuture) UnmarshalJSON(body []byte) error { 19703 var azFuture azure.Future 19704 if err := json.Unmarshal(body, &azFuture); err != nil { 19705 return err 19706 } 19707 future.FutureAPI = &azFuture 19708 future.Result = future.result 19709 return nil 19710} 19711 19712// result is the default implementation for VirtualMachineScaleSetRollingUpgradesCancelFuture.Result. 19713func (future *VirtualMachineScaleSetRollingUpgradesCancelFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { 19714 var done bool 19715 done, err = future.DoneWithContext(context.Background(), client) 19716 if err != nil { 19717 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesCancelFuture", "Result", future.Response(), "Polling failure") 19718 return 19719 } 19720 if !done { 19721 ar.Response = future.Response() 19722 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesCancelFuture") 19723 return 19724 } 19725 ar.Response = future.Response() 19726 return 19727} 19728 19729// VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture an abstraction for monitoring and 19730// retrieving the results of a long-running operation. 19731type VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture struct { 19732 azure.FutureAPI 19733 // Result returns the result of the asynchronous operation. 19734 // If the operation has not completed it will return an error. 19735 Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) 19736} 19737 19738// UnmarshalJSON is the custom unmarshaller for CreateFuture. 19739func (future *VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture) UnmarshalJSON(body []byte) error { 19740 var azFuture azure.Future 19741 if err := json.Unmarshal(body, &azFuture); err != nil { 19742 return err 19743 } 19744 future.FutureAPI = &azFuture 19745 future.Result = future.result 19746 return nil 19747} 19748 19749// result is the default implementation for VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture.Result. 19750func (future *VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { 19751 var done bool 19752 done, err = future.DoneWithContext(context.Background(), client) 19753 if err != nil { 19754 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture", "Result", future.Response(), "Polling failure") 19755 return 19756 } 19757 if !done { 19758 ar.Response = future.Response() 19759 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture") 19760 return 19761 } 19762 ar.Response = future.Response() 19763 return 19764} 19765 19766// VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture an abstraction for monitoring and retrieving 19767// the results of a long-running operation. 19768type VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture struct { 19769 azure.FutureAPI 19770 // Result returns the result of the asynchronous operation. 19771 // If the operation has not completed it will return an error. 19772 Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) 19773} 19774 19775// UnmarshalJSON is the custom unmarshaller for CreateFuture. 19776func (future *VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture) UnmarshalJSON(body []byte) error { 19777 var azFuture azure.Future 19778 if err := json.Unmarshal(body, &azFuture); err != nil { 19779 return err 19780 } 19781 future.FutureAPI = &azFuture 19782 future.Result = future.result 19783 return nil 19784} 19785 19786// result is the default implementation for VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture.Result. 19787func (future *VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { 19788 var done bool 19789 done, err = future.DoneWithContext(context.Background(), client) 19790 if err != nil { 19791 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture", "Result", future.Response(), "Polling failure") 19792 return 19793 } 19794 if !done { 19795 ar.Response = future.Response() 19796 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture") 19797 return 19798 } 19799 ar.Response = future.Response() 19800 return 19801} 19802 19803// VirtualMachineScaleSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of 19804// a long-running operation. 19805type VirtualMachineScaleSetsCreateOrUpdateFuture struct { 19806 azure.FutureAPI 19807 // Result returns the result of the asynchronous operation. 19808 // If the operation has not completed it will return an error. 19809 Result func(VirtualMachineScaleSetsClient) (VirtualMachineScaleSet, error) 19810} 19811 19812// UnmarshalJSON is the custom unmarshaller for CreateFuture. 19813func (future *VirtualMachineScaleSetsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 19814 var azFuture azure.Future 19815 if err := json.Unmarshal(body, &azFuture); err != nil { 19816 return err 19817 } 19818 future.FutureAPI = &azFuture 19819 future.Result = future.result 19820 return nil 19821} 19822 19823// result is the default implementation for VirtualMachineScaleSetsCreateOrUpdateFuture.Result. 19824func (future *VirtualMachineScaleSetsCreateOrUpdateFuture) result(client VirtualMachineScaleSetsClient) (vmss VirtualMachineScaleSet, err error) { 19825 var done bool 19826 done, err = future.DoneWithContext(context.Background(), client) 19827 if err != nil { 19828 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 19829 return 19830 } 19831 if !done { 19832 vmss.Response.Response = future.Response() 19833 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsCreateOrUpdateFuture") 19834 return 19835 } 19836 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 19837 if vmss.Response.Response, err = future.GetResult(sender); err == nil && vmss.Response.Response.StatusCode != http.StatusNoContent { 19838 vmss, err = client.CreateOrUpdateResponder(vmss.Response.Response) 19839 if err != nil { 19840 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsCreateOrUpdateFuture", "Result", vmss.Response.Response, "Failure responding to request") 19841 } 19842 } 19843 return 19844} 19845 19846// VirtualMachineScaleSetsDeallocateFuture an abstraction for monitoring and retrieving the results of a 19847// long-running operation. 19848type VirtualMachineScaleSetsDeallocateFuture struct { 19849 azure.FutureAPI 19850 // Result returns the result of the asynchronous operation. 19851 // If the operation has not completed it will return an error. 19852 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 19853} 19854 19855// UnmarshalJSON is the custom unmarshaller for CreateFuture. 19856func (future *VirtualMachineScaleSetsDeallocateFuture) UnmarshalJSON(body []byte) error { 19857 var azFuture azure.Future 19858 if err := json.Unmarshal(body, &azFuture); err != nil { 19859 return err 19860 } 19861 future.FutureAPI = &azFuture 19862 future.Result = future.result 19863 return nil 19864} 19865 19866// result is the default implementation for VirtualMachineScaleSetsDeallocateFuture.Result. 19867func (future *VirtualMachineScaleSetsDeallocateFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 19868 var done bool 19869 done, err = future.DoneWithContext(context.Background(), client) 19870 if err != nil { 19871 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeallocateFuture", "Result", future.Response(), "Polling failure") 19872 return 19873 } 19874 if !done { 19875 ar.Response = future.Response() 19876 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeallocateFuture") 19877 return 19878 } 19879 ar.Response = future.Response() 19880 return 19881} 19882 19883// VirtualMachineScaleSetsDeleteFuture an abstraction for monitoring and retrieving the results of a 19884// long-running operation. 19885type VirtualMachineScaleSetsDeleteFuture struct { 19886 azure.FutureAPI 19887 // Result returns the result of the asynchronous operation. 19888 // If the operation has not completed it will return an error. 19889 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 19890} 19891 19892// UnmarshalJSON is the custom unmarshaller for CreateFuture. 19893func (future *VirtualMachineScaleSetsDeleteFuture) UnmarshalJSON(body []byte) error { 19894 var azFuture azure.Future 19895 if err := json.Unmarshal(body, &azFuture); err != nil { 19896 return err 19897 } 19898 future.FutureAPI = &azFuture 19899 future.Result = future.result 19900 return nil 19901} 19902 19903// result is the default implementation for VirtualMachineScaleSetsDeleteFuture.Result. 19904func (future *VirtualMachineScaleSetsDeleteFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 19905 var done bool 19906 done, err = future.DoneWithContext(context.Background(), client) 19907 if err != nil { 19908 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeleteFuture", "Result", future.Response(), "Polling failure") 19909 return 19910 } 19911 if !done { 19912 ar.Response = future.Response() 19913 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeleteFuture") 19914 return 19915 } 19916 ar.Response = future.Response() 19917 return 19918} 19919 19920// VirtualMachineScaleSetsDeleteInstancesFuture an abstraction for monitoring and retrieving the results of 19921// a long-running operation. 19922type VirtualMachineScaleSetsDeleteInstancesFuture struct { 19923 azure.FutureAPI 19924 // Result returns the result of the asynchronous operation. 19925 // If the operation has not completed it will return an error. 19926 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 19927} 19928 19929// UnmarshalJSON is the custom unmarshaller for CreateFuture. 19930func (future *VirtualMachineScaleSetsDeleteInstancesFuture) UnmarshalJSON(body []byte) error { 19931 var azFuture azure.Future 19932 if err := json.Unmarshal(body, &azFuture); err != nil { 19933 return err 19934 } 19935 future.FutureAPI = &azFuture 19936 future.Result = future.result 19937 return nil 19938} 19939 19940// result is the default implementation for VirtualMachineScaleSetsDeleteInstancesFuture.Result. 19941func (future *VirtualMachineScaleSetsDeleteInstancesFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 19942 var done bool 19943 done, err = future.DoneWithContext(context.Background(), client) 19944 if err != nil { 19945 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeleteInstancesFuture", "Result", future.Response(), "Polling failure") 19946 return 19947 } 19948 if !done { 19949 ar.Response = future.Response() 19950 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeleteInstancesFuture") 19951 return 19952 } 19953 ar.Response = future.Response() 19954 return 19955} 19956 19957// VirtualMachineScaleSetSku describes an available virtual machine scale set sku. 19958type VirtualMachineScaleSetSku struct { 19959 // ResourceType - READ-ONLY; The type of resource the sku applies to. 19960 ResourceType *string `json:"resourceType,omitempty"` 19961 // Sku - READ-ONLY; The Sku. 19962 Sku *Sku `json:"sku,omitempty"` 19963 // Capacity - READ-ONLY; Specifies the number of virtual machines in the scale set. 19964 Capacity *VirtualMachineScaleSetSkuCapacity `json:"capacity,omitempty"` 19965} 19966 19967// MarshalJSON is the custom marshaler for VirtualMachineScaleSetSku. 19968func (vmsss VirtualMachineScaleSetSku) MarshalJSON() ([]byte, error) { 19969 objectMap := make(map[string]interface{}) 19970 return json.Marshal(objectMap) 19971} 19972 19973// VirtualMachineScaleSetSkuCapacity describes scaling information of a sku. 19974type VirtualMachineScaleSetSkuCapacity struct { 19975 // Minimum - READ-ONLY; The minimum capacity. 19976 Minimum *int64 `json:"minimum,omitempty"` 19977 // Maximum - READ-ONLY; The maximum capacity that can be set. 19978 Maximum *int64 `json:"maximum,omitempty"` 19979 // DefaultCapacity - READ-ONLY; The default capacity. 19980 DefaultCapacity *int64 `json:"defaultCapacity,omitempty"` 19981 // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'VirtualMachineScaleSetSkuScaleTypeAutomatic', 'VirtualMachineScaleSetSkuScaleTypeNone' 19982 ScaleType VirtualMachineScaleSetSkuScaleType `json:"scaleType,omitempty"` 19983} 19984 19985// MarshalJSON is the custom marshaler for VirtualMachineScaleSetSkuCapacity. 19986func (vmsssc VirtualMachineScaleSetSkuCapacity) MarshalJSON() ([]byte, error) { 19987 objectMap := make(map[string]interface{}) 19988 return json.Marshal(objectMap) 19989} 19990 19991// VirtualMachineScaleSetsPerformMaintenanceFuture an abstraction for monitoring and retrieving the results 19992// of a long-running operation. 19993type VirtualMachineScaleSetsPerformMaintenanceFuture struct { 19994 azure.FutureAPI 19995 // Result returns the result of the asynchronous operation. 19996 // If the operation has not completed it will return an error. 19997 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 19998} 19999 20000// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20001func (future *VirtualMachineScaleSetsPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { 20002 var azFuture azure.Future 20003 if err := json.Unmarshal(body, &azFuture); err != nil { 20004 return err 20005 } 20006 future.FutureAPI = &azFuture 20007 future.Result = future.result 20008 return nil 20009} 20010 20011// result is the default implementation for VirtualMachineScaleSetsPerformMaintenanceFuture.Result. 20012func (future *VirtualMachineScaleSetsPerformMaintenanceFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 20013 var done bool 20014 done, err = future.DoneWithContext(context.Background(), client) 20015 if err != nil { 20016 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsPerformMaintenanceFuture", "Result", future.Response(), "Polling failure") 20017 return 20018 } 20019 if !done { 20020 ar.Response = future.Response() 20021 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsPerformMaintenanceFuture") 20022 return 20023 } 20024 ar.Response = future.Response() 20025 return 20026} 20027 20028// VirtualMachineScaleSetsPowerOffFuture an abstraction for monitoring and retrieving the results of a 20029// long-running operation. 20030type VirtualMachineScaleSetsPowerOffFuture struct { 20031 azure.FutureAPI 20032 // Result returns the result of the asynchronous operation. 20033 // If the operation has not completed it will return an error. 20034 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 20035} 20036 20037// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20038func (future *VirtualMachineScaleSetsPowerOffFuture) UnmarshalJSON(body []byte) error { 20039 var azFuture azure.Future 20040 if err := json.Unmarshal(body, &azFuture); err != nil { 20041 return err 20042 } 20043 future.FutureAPI = &azFuture 20044 future.Result = future.result 20045 return nil 20046} 20047 20048// result is the default implementation for VirtualMachineScaleSetsPowerOffFuture.Result. 20049func (future *VirtualMachineScaleSetsPowerOffFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 20050 var done bool 20051 done, err = future.DoneWithContext(context.Background(), client) 20052 if err != nil { 20053 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsPowerOffFuture", "Result", future.Response(), "Polling failure") 20054 return 20055 } 20056 if !done { 20057 ar.Response = future.Response() 20058 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsPowerOffFuture") 20059 return 20060 } 20061 ar.Response = future.Response() 20062 return 20063} 20064 20065// VirtualMachineScaleSetsRedeployFuture an abstraction for monitoring and retrieving the results of a 20066// long-running operation. 20067type VirtualMachineScaleSetsRedeployFuture struct { 20068 azure.FutureAPI 20069 // Result returns the result of the asynchronous operation. 20070 // If the operation has not completed it will return an error. 20071 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 20072} 20073 20074// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20075func (future *VirtualMachineScaleSetsRedeployFuture) UnmarshalJSON(body []byte) error { 20076 var azFuture azure.Future 20077 if err := json.Unmarshal(body, &azFuture); err != nil { 20078 return err 20079 } 20080 future.FutureAPI = &azFuture 20081 future.Result = future.result 20082 return nil 20083} 20084 20085// result is the default implementation for VirtualMachineScaleSetsRedeployFuture.Result. 20086func (future *VirtualMachineScaleSetsRedeployFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 20087 var done bool 20088 done, err = future.DoneWithContext(context.Background(), client) 20089 if err != nil { 20090 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsRedeployFuture", "Result", future.Response(), "Polling failure") 20091 return 20092 } 20093 if !done { 20094 ar.Response = future.Response() 20095 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsRedeployFuture") 20096 return 20097 } 20098 ar.Response = future.Response() 20099 return 20100} 20101 20102// VirtualMachineScaleSetsReimageAllFuture an abstraction for monitoring and retrieving the results of a 20103// long-running operation. 20104type VirtualMachineScaleSetsReimageAllFuture struct { 20105 azure.FutureAPI 20106 // Result returns the result of the asynchronous operation. 20107 // If the operation has not completed it will return an error. 20108 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 20109} 20110 20111// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20112func (future *VirtualMachineScaleSetsReimageAllFuture) UnmarshalJSON(body []byte) error { 20113 var azFuture azure.Future 20114 if err := json.Unmarshal(body, &azFuture); err != nil { 20115 return err 20116 } 20117 future.FutureAPI = &azFuture 20118 future.Result = future.result 20119 return nil 20120} 20121 20122// result is the default implementation for VirtualMachineScaleSetsReimageAllFuture.Result. 20123func (future *VirtualMachineScaleSetsReimageAllFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 20124 var done bool 20125 done, err = future.DoneWithContext(context.Background(), client) 20126 if err != nil { 20127 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsReimageAllFuture", "Result", future.Response(), "Polling failure") 20128 return 20129 } 20130 if !done { 20131 ar.Response = future.Response() 20132 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsReimageAllFuture") 20133 return 20134 } 20135 ar.Response = future.Response() 20136 return 20137} 20138 20139// VirtualMachineScaleSetsReimageFuture an abstraction for monitoring and retrieving the results of a 20140// long-running operation. 20141type VirtualMachineScaleSetsReimageFuture struct { 20142 azure.FutureAPI 20143 // Result returns the result of the asynchronous operation. 20144 // If the operation has not completed it will return an error. 20145 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 20146} 20147 20148// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20149func (future *VirtualMachineScaleSetsReimageFuture) UnmarshalJSON(body []byte) error { 20150 var azFuture azure.Future 20151 if err := json.Unmarshal(body, &azFuture); err != nil { 20152 return err 20153 } 20154 future.FutureAPI = &azFuture 20155 future.Result = future.result 20156 return nil 20157} 20158 20159// result is the default implementation for VirtualMachineScaleSetsReimageFuture.Result. 20160func (future *VirtualMachineScaleSetsReimageFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 20161 var done bool 20162 done, err = future.DoneWithContext(context.Background(), client) 20163 if err != nil { 20164 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsReimageFuture", "Result", future.Response(), "Polling failure") 20165 return 20166 } 20167 if !done { 20168 ar.Response = future.Response() 20169 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsReimageFuture") 20170 return 20171 } 20172 ar.Response = future.Response() 20173 return 20174} 20175 20176// VirtualMachineScaleSetsRestartFuture an abstraction for monitoring and retrieving the results of a 20177// long-running operation. 20178type VirtualMachineScaleSetsRestartFuture struct { 20179 azure.FutureAPI 20180 // Result returns the result of the asynchronous operation. 20181 // If the operation has not completed it will return an error. 20182 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 20183} 20184 20185// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20186func (future *VirtualMachineScaleSetsRestartFuture) UnmarshalJSON(body []byte) error { 20187 var azFuture azure.Future 20188 if err := json.Unmarshal(body, &azFuture); err != nil { 20189 return err 20190 } 20191 future.FutureAPI = &azFuture 20192 future.Result = future.result 20193 return nil 20194} 20195 20196// result is the default implementation for VirtualMachineScaleSetsRestartFuture.Result. 20197func (future *VirtualMachineScaleSetsRestartFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 20198 var done bool 20199 done, err = future.DoneWithContext(context.Background(), client) 20200 if err != nil { 20201 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsRestartFuture", "Result", future.Response(), "Polling failure") 20202 return 20203 } 20204 if !done { 20205 ar.Response = future.Response() 20206 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsRestartFuture") 20207 return 20208 } 20209 ar.Response = future.Response() 20210 return 20211} 20212 20213// VirtualMachineScaleSetsSetOrchestrationServiceStateFuture an abstraction for monitoring and retrieving 20214// the results of a long-running operation. 20215type VirtualMachineScaleSetsSetOrchestrationServiceStateFuture struct { 20216 azure.FutureAPI 20217 // Result returns the result of the asynchronous operation. 20218 // If the operation has not completed it will return an error. 20219 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 20220} 20221 20222// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20223func (future *VirtualMachineScaleSetsSetOrchestrationServiceStateFuture) UnmarshalJSON(body []byte) error { 20224 var azFuture azure.Future 20225 if err := json.Unmarshal(body, &azFuture); err != nil { 20226 return err 20227 } 20228 future.FutureAPI = &azFuture 20229 future.Result = future.result 20230 return nil 20231} 20232 20233// result is the default implementation for VirtualMachineScaleSetsSetOrchestrationServiceStateFuture.Result. 20234func (future *VirtualMachineScaleSetsSetOrchestrationServiceStateFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 20235 var done bool 20236 done, err = future.DoneWithContext(context.Background(), client) 20237 if err != nil { 20238 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsSetOrchestrationServiceStateFuture", "Result", future.Response(), "Polling failure") 20239 return 20240 } 20241 if !done { 20242 ar.Response = future.Response() 20243 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsSetOrchestrationServiceStateFuture") 20244 return 20245 } 20246 ar.Response = future.Response() 20247 return 20248} 20249 20250// VirtualMachineScaleSetsStartFuture an abstraction for monitoring and retrieving the results of a 20251// long-running operation. 20252type VirtualMachineScaleSetsStartFuture struct { 20253 azure.FutureAPI 20254 // Result returns the result of the asynchronous operation. 20255 // If the operation has not completed it will return an error. 20256 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 20257} 20258 20259// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20260func (future *VirtualMachineScaleSetsStartFuture) UnmarshalJSON(body []byte) error { 20261 var azFuture azure.Future 20262 if err := json.Unmarshal(body, &azFuture); err != nil { 20263 return err 20264 } 20265 future.FutureAPI = &azFuture 20266 future.Result = future.result 20267 return nil 20268} 20269 20270// result is the default implementation for VirtualMachineScaleSetsStartFuture.Result. 20271func (future *VirtualMachineScaleSetsStartFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 20272 var done bool 20273 done, err = future.DoneWithContext(context.Background(), client) 20274 if err != nil { 20275 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsStartFuture", "Result", future.Response(), "Polling failure") 20276 return 20277 } 20278 if !done { 20279 ar.Response = future.Response() 20280 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsStartFuture") 20281 return 20282 } 20283 ar.Response = future.Response() 20284 return 20285} 20286 20287// VirtualMachineScaleSetStorageProfile describes a virtual machine scale set storage profile. 20288type VirtualMachineScaleSetStorageProfile struct { 20289 // 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. 20290 ImageReference *ImageReference `json:"imageReference,omitempty"` 20291 // 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). 20292 OsDisk *VirtualMachineScaleSetOSDisk `json:"osDisk,omitempty"` 20293 // 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). 20294 DataDisks *[]VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"` 20295} 20296 20297// VirtualMachineScaleSetsUpdateFuture an abstraction for monitoring and retrieving the results of a 20298// long-running operation. 20299type VirtualMachineScaleSetsUpdateFuture struct { 20300 azure.FutureAPI 20301 // Result returns the result of the asynchronous operation. 20302 // If the operation has not completed it will return an error. 20303 Result func(VirtualMachineScaleSetsClient) (VirtualMachineScaleSet, error) 20304} 20305 20306// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20307func (future *VirtualMachineScaleSetsUpdateFuture) UnmarshalJSON(body []byte) error { 20308 var azFuture azure.Future 20309 if err := json.Unmarshal(body, &azFuture); err != nil { 20310 return err 20311 } 20312 future.FutureAPI = &azFuture 20313 future.Result = future.result 20314 return nil 20315} 20316 20317// result is the default implementation for VirtualMachineScaleSetsUpdateFuture.Result. 20318func (future *VirtualMachineScaleSetsUpdateFuture) result(client VirtualMachineScaleSetsClient) (vmss VirtualMachineScaleSet, err error) { 20319 var done bool 20320 done, err = future.DoneWithContext(context.Background(), client) 20321 if err != nil { 20322 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateFuture", "Result", future.Response(), "Polling failure") 20323 return 20324 } 20325 if !done { 20326 vmss.Response.Response = future.Response() 20327 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsUpdateFuture") 20328 return 20329 } 20330 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 20331 if vmss.Response.Response, err = future.GetResult(sender); err == nil && vmss.Response.Response.StatusCode != http.StatusNoContent { 20332 vmss, err = client.UpdateResponder(vmss.Response.Response) 20333 if err != nil { 20334 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateFuture", "Result", vmss.Response.Response, "Failure responding to request") 20335 } 20336 } 20337 return 20338} 20339 20340// VirtualMachineScaleSetsUpdateInstancesFuture an abstraction for monitoring and retrieving the results of 20341// a long-running operation. 20342type VirtualMachineScaleSetsUpdateInstancesFuture struct { 20343 azure.FutureAPI 20344 // Result returns the result of the asynchronous operation. 20345 // If the operation has not completed it will return an error. 20346 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 20347} 20348 20349// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20350func (future *VirtualMachineScaleSetsUpdateInstancesFuture) UnmarshalJSON(body []byte) error { 20351 var azFuture azure.Future 20352 if err := json.Unmarshal(body, &azFuture); err != nil { 20353 return err 20354 } 20355 future.FutureAPI = &azFuture 20356 future.Result = future.result 20357 return nil 20358} 20359 20360// result is the default implementation for VirtualMachineScaleSetsUpdateInstancesFuture.Result. 20361func (future *VirtualMachineScaleSetsUpdateInstancesFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 20362 var done bool 20363 done, err = future.DoneWithContext(context.Background(), client) 20364 if err != nil { 20365 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateInstancesFuture", "Result", future.Response(), "Polling failure") 20366 return 20367 } 20368 if !done { 20369 ar.Response = future.Response() 20370 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsUpdateInstancesFuture") 20371 return 20372 } 20373 ar.Response = future.Response() 20374 return 20375} 20376 20377// VirtualMachineScaleSetUpdate describes a Virtual Machine Scale Set. 20378type VirtualMachineScaleSetUpdate struct { 20379 // Sku - The virtual machine scale set sku. 20380 Sku *Sku `json:"sku,omitempty"` 20381 // Plan - The purchase plan when deploying a virtual machine scale set from VM Marketplace images. 20382 Plan *Plan `json:"plan,omitempty"` 20383 *VirtualMachineScaleSetUpdateProperties `json:"properties,omitempty"` 20384 // Identity - The identity of the virtual machine scale set, if configured. 20385 Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"` 20386 // Tags - Resource tags 20387 Tags map[string]*string `json:"tags"` 20388} 20389 20390// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdate. 20391func (vmssu VirtualMachineScaleSetUpdate) MarshalJSON() ([]byte, error) { 20392 objectMap := make(map[string]interface{}) 20393 if vmssu.Sku != nil { 20394 objectMap["sku"] = vmssu.Sku 20395 } 20396 if vmssu.Plan != nil { 20397 objectMap["plan"] = vmssu.Plan 20398 } 20399 if vmssu.VirtualMachineScaleSetUpdateProperties != nil { 20400 objectMap["properties"] = vmssu.VirtualMachineScaleSetUpdateProperties 20401 } 20402 if vmssu.Identity != nil { 20403 objectMap["identity"] = vmssu.Identity 20404 } 20405 if vmssu.Tags != nil { 20406 objectMap["tags"] = vmssu.Tags 20407 } 20408 return json.Marshal(objectMap) 20409} 20410 20411// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdate struct. 20412func (vmssu *VirtualMachineScaleSetUpdate) UnmarshalJSON(body []byte) error { 20413 var m map[string]*json.RawMessage 20414 err := json.Unmarshal(body, &m) 20415 if err != nil { 20416 return err 20417 } 20418 for k, v := range m { 20419 switch k { 20420 case "sku": 20421 if v != nil { 20422 var sku Sku 20423 err = json.Unmarshal(*v, &sku) 20424 if err != nil { 20425 return err 20426 } 20427 vmssu.Sku = &sku 20428 } 20429 case "plan": 20430 if v != nil { 20431 var plan Plan 20432 err = json.Unmarshal(*v, &plan) 20433 if err != nil { 20434 return err 20435 } 20436 vmssu.Plan = &plan 20437 } 20438 case "properties": 20439 if v != nil { 20440 var virtualMachineScaleSetUpdateProperties VirtualMachineScaleSetUpdateProperties 20441 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateProperties) 20442 if err != nil { 20443 return err 20444 } 20445 vmssu.VirtualMachineScaleSetUpdateProperties = &virtualMachineScaleSetUpdateProperties 20446 } 20447 case "identity": 20448 if v != nil { 20449 var identity VirtualMachineScaleSetIdentity 20450 err = json.Unmarshal(*v, &identity) 20451 if err != nil { 20452 return err 20453 } 20454 vmssu.Identity = &identity 20455 } 20456 case "tags": 20457 if v != nil { 20458 var tags map[string]*string 20459 err = json.Unmarshal(*v, &tags) 20460 if err != nil { 20461 return err 20462 } 20463 vmssu.Tags = tags 20464 } 20465 } 20466 } 20467 20468 return nil 20469} 20470 20471// VirtualMachineScaleSetUpdateIPConfiguration describes a virtual machine scale set network profile's IP 20472// configuration. NOTE: The subnet of a scale set may be modified as long as the original subnet and the 20473// new subnet are in the same virtual network 20474type VirtualMachineScaleSetUpdateIPConfiguration struct { 20475 // Name - The IP configuration name. 20476 Name *string `json:"name,omitempty"` 20477 *VirtualMachineScaleSetUpdateIPConfigurationProperties `json:"properties,omitempty"` 20478 // ID - Resource Id 20479 ID *string `json:"id,omitempty"` 20480} 20481 20482// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdateIPConfiguration. 20483func (vmssuic VirtualMachineScaleSetUpdateIPConfiguration) MarshalJSON() ([]byte, error) { 20484 objectMap := make(map[string]interface{}) 20485 if vmssuic.Name != nil { 20486 objectMap["name"] = vmssuic.Name 20487 } 20488 if vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties != nil { 20489 objectMap["properties"] = vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties 20490 } 20491 if vmssuic.ID != nil { 20492 objectMap["id"] = vmssuic.ID 20493 } 20494 return json.Marshal(objectMap) 20495} 20496 20497// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdateIPConfiguration struct. 20498func (vmssuic *VirtualMachineScaleSetUpdateIPConfiguration) UnmarshalJSON(body []byte) error { 20499 var m map[string]*json.RawMessage 20500 err := json.Unmarshal(body, &m) 20501 if err != nil { 20502 return err 20503 } 20504 for k, v := range m { 20505 switch k { 20506 case "name": 20507 if v != nil { 20508 var name string 20509 err = json.Unmarshal(*v, &name) 20510 if err != nil { 20511 return err 20512 } 20513 vmssuic.Name = &name 20514 } 20515 case "properties": 20516 if v != nil { 20517 var virtualMachineScaleSetUpdateIPConfigurationProperties VirtualMachineScaleSetUpdateIPConfigurationProperties 20518 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateIPConfigurationProperties) 20519 if err != nil { 20520 return err 20521 } 20522 vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties = &virtualMachineScaleSetUpdateIPConfigurationProperties 20523 } 20524 case "id": 20525 if v != nil { 20526 var ID string 20527 err = json.Unmarshal(*v, &ID) 20528 if err != nil { 20529 return err 20530 } 20531 vmssuic.ID = &ID 20532 } 20533 } 20534 } 20535 20536 return nil 20537} 20538 20539// VirtualMachineScaleSetUpdateIPConfigurationProperties describes a virtual machine scale set network 20540// profile's IP configuration properties. 20541type VirtualMachineScaleSetUpdateIPConfigurationProperties struct { 20542 // Subnet - The subnet. 20543 Subnet *APIEntityReference `json:"subnet,omitempty"` 20544 // Primary - Specifies the primary IP Configuration in case the network interface has more than one IP Configuration. 20545 Primary *bool `json:"primary,omitempty"` 20546 // PublicIPAddressConfiguration - The publicIPAddressConfiguration. 20547 PublicIPAddressConfiguration *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` 20548 // 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' 20549 PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` 20550 // ApplicationGatewayBackendAddressPools - The application gateway backend address pools. 20551 ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` 20552 // ApplicationSecurityGroups - Specifies an array of references to application security group. 20553 ApplicationSecurityGroups *[]SubResource `json:"applicationSecurityGroups,omitempty"` 20554 // LoadBalancerBackendAddressPools - The load balancer backend address pools. 20555 LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` 20556 // LoadBalancerInboundNatPools - The load balancer inbound nat pools. 20557 LoadBalancerInboundNatPools *[]SubResource `json:"loadBalancerInboundNatPools,omitempty"` 20558} 20559 20560// VirtualMachineScaleSetUpdateNetworkConfiguration describes a virtual machine scale set network profile's 20561// network configurations. 20562type VirtualMachineScaleSetUpdateNetworkConfiguration struct { 20563 // Name - The network configuration name. 20564 Name *string `json:"name,omitempty"` 20565 *VirtualMachineScaleSetUpdateNetworkConfigurationProperties `json:"properties,omitempty"` 20566 // ID - Resource Id 20567 ID *string `json:"id,omitempty"` 20568} 20569 20570// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdateNetworkConfiguration. 20571func (vmssunc VirtualMachineScaleSetUpdateNetworkConfiguration) MarshalJSON() ([]byte, error) { 20572 objectMap := make(map[string]interface{}) 20573 if vmssunc.Name != nil { 20574 objectMap["name"] = vmssunc.Name 20575 } 20576 if vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties != nil { 20577 objectMap["properties"] = vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties 20578 } 20579 if vmssunc.ID != nil { 20580 objectMap["id"] = vmssunc.ID 20581 } 20582 return json.Marshal(objectMap) 20583} 20584 20585// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdateNetworkConfiguration struct. 20586func (vmssunc *VirtualMachineScaleSetUpdateNetworkConfiguration) UnmarshalJSON(body []byte) error { 20587 var m map[string]*json.RawMessage 20588 err := json.Unmarshal(body, &m) 20589 if err != nil { 20590 return err 20591 } 20592 for k, v := range m { 20593 switch k { 20594 case "name": 20595 if v != nil { 20596 var name string 20597 err = json.Unmarshal(*v, &name) 20598 if err != nil { 20599 return err 20600 } 20601 vmssunc.Name = &name 20602 } 20603 case "properties": 20604 if v != nil { 20605 var virtualMachineScaleSetUpdateNetworkConfigurationProperties VirtualMachineScaleSetUpdateNetworkConfigurationProperties 20606 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateNetworkConfigurationProperties) 20607 if err != nil { 20608 return err 20609 } 20610 vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties = &virtualMachineScaleSetUpdateNetworkConfigurationProperties 20611 } 20612 case "id": 20613 if v != nil { 20614 var ID string 20615 err = json.Unmarshal(*v, &ID) 20616 if err != nil { 20617 return err 20618 } 20619 vmssunc.ID = &ID 20620 } 20621 } 20622 } 20623 20624 return nil 20625} 20626 20627// VirtualMachineScaleSetUpdateNetworkConfigurationProperties describes a virtual machine scale set 20628// updatable network profile's IP configuration.Use this object for updating network profile's IP 20629// Configuration. 20630type VirtualMachineScaleSetUpdateNetworkConfigurationProperties struct { 20631 // Primary - Whether this is a primary NIC on a virtual machine. 20632 Primary *bool `json:"primary,omitempty"` 20633 // EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled. 20634 EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` 20635 // EnableFpga - Specifies whether the network interface is FPGA networking-enabled. 20636 EnableFpga *bool `json:"enableFpga,omitempty"` 20637 // NetworkSecurityGroup - The network security group. 20638 NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` 20639 // DNSSettings - The dns settings to be applied on the network interfaces. 20640 DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings `json:"dnsSettings,omitempty"` 20641 // IPConfigurations - The virtual machine scale set IP Configuration. 20642 IPConfigurations *[]VirtualMachineScaleSetUpdateIPConfiguration `json:"ipConfigurations,omitempty"` 20643 // EnableIPForwarding - Whether IP forwarding enabled on this NIC. 20644 EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` 20645 // DeleteOption - Specify what happens to the network interface when the VM is deleted. Possible values include: 'DeleteOptionsDelete', 'DeleteOptionsDetach' 20646 DeleteOption DeleteOptions `json:"deleteOption,omitempty"` 20647} 20648 20649// VirtualMachineScaleSetUpdateNetworkProfile describes a virtual machine scale set network profile. 20650type VirtualMachineScaleSetUpdateNetworkProfile struct { 20651 // 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}'. 20652 HealthProbe *APIEntityReference `json:"healthProbe,omitempty"` 20653 // NetworkInterfaceConfigurations - The list of network configurations. 20654 NetworkInterfaceConfigurations *[]VirtualMachineScaleSetUpdateNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` 20655 // 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' 20656 NetworkAPIVersion NetworkAPIVersion `json:"networkApiVersion,omitempty"` 20657} 20658 20659// VirtualMachineScaleSetUpdateOSDisk describes virtual machine scale set operating system disk Update 20660// Object. This should be used for Updating VMSS OS Disk. 20661type VirtualMachineScaleSetUpdateOSDisk struct { 20662 // Caching - The caching type. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' 20663 Caching CachingTypes `json:"caching,omitempty"` 20664 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 20665 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 20666 // 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 20667 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 20668 // 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. 20669 Image *VirtualHardDisk `json:"image,omitempty"` 20670 // VhdContainers - The list of virtual hard disk container uris. 20671 VhdContainers *[]string `json:"vhdContainers,omitempty"` 20672 // ManagedDisk - The managed disk parameters. 20673 ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` 20674} 20675 20676// VirtualMachineScaleSetUpdateOSProfile describes a virtual machine scale set OS profile. 20677type VirtualMachineScaleSetUpdateOSProfile struct { 20678 // CustomData - A base-64 encoded string of custom data. 20679 CustomData *string `json:"customData,omitempty"` 20680 // WindowsConfiguration - The Windows Configuration of the OS profile. 20681 WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` 20682 // LinuxConfiguration - The Linux Configuration of the OS profile. 20683 LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` 20684 // Secrets - The List of certificates for addition to the VM. 20685 Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` 20686} 20687 20688// VirtualMachineScaleSetUpdateProperties describes the properties of a Virtual Machine Scale Set. 20689type VirtualMachineScaleSetUpdateProperties struct { 20690 // UpgradePolicy - The upgrade policy. 20691 UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` 20692 // AutomaticRepairsPolicy - Policy for automatic repairs. 20693 AutomaticRepairsPolicy *AutomaticRepairsPolicy `json:"automaticRepairsPolicy,omitempty"` 20694 // VirtualMachineProfile - The virtual machine profile. 20695 VirtualMachineProfile *VirtualMachineScaleSetUpdateVMProfile `json:"virtualMachineProfile,omitempty"` 20696 // Overprovision - Specifies whether the Virtual Machine Scale Set should be overprovisioned. 20697 Overprovision *bool `json:"overprovision,omitempty"` 20698 // 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. 20699 DoNotRunExtensionsOnOverprovisionedVMs *bool `json:"doNotRunExtensionsOnOverprovisionedVMs,omitempty"` 20700 // 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. 20701 SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"` 20702 // 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. 20703 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 20704 // ScaleInPolicy - Specifies the policies applied when scaling in Virtual Machines in the Virtual Machine Scale Set. 20705 ScaleInPolicy *ScaleInPolicy `json:"scaleInPolicy,omitempty"` 20706 // 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. 20707 ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` 20708} 20709 20710// VirtualMachineScaleSetUpdatePublicIPAddressConfiguration describes a virtual machines scale set IP 20711// Configuration's PublicIPAddress configuration 20712type VirtualMachineScaleSetUpdatePublicIPAddressConfiguration struct { 20713 // Name - The publicIP address configuration name. 20714 Name *string `json:"name,omitempty"` 20715 *VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties `json:"properties,omitempty"` 20716} 20717 20718// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdatePublicIPAddressConfiguration. 20719func (vmssupiac VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { 20720 objectMap := make(map[string]interface{}) 20721 if vmssupiac.Name != nil { 20722 objectMap["name"] = vmssupiac.Name 20723 } 20724 if vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties != nil { 20725 objectMap["properties"] = vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties 20726 } 20727 return json.Marshal(objectMap) 20728} 20729 20730// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdatePublicIPAddressConfiguration struct. 20731func (vmssupiac *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) UnmarshalJSON(body []byte) error { 20732 var m map[string]*json.RawMessage 20733 err := json.Unmarshal(body, &m) 20734 if err != nil { 20735 return err 20736 } 20737 for k, v := range m { 20738 switch k { 20739 case "name": 20740 if v != nil { 20741 var name string 20742 err = json.Unmarshal(*v, &name) 20743 if err != nil { 20744 return err 20745 } 20746 vmssupiac.Name = &name 20747 } 20748 case "properties": 20749 if v != nil { 20750 var virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties 20751 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties) 20752 if err != nil { 20753 return err 20754 } 20755 vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties = &virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties 20756 } 20757 } 20758 } 20759 20760 return nil 20761} 20762 20763// VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties describes a virtual machines scale 20764// set IP Configuration's PublicIPAddress configuration 20765type VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties struct { 20766 // IdleTimeoutInMinutes - The idle timeout of the public IP address. 20767 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` 20768 // DNSSettings - The dns settings to be applied on the publicIP addresses . 20769 DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings `json:"dnsSettings,omitempty"` 20770 // DeleteOption - Specify what happens to the public IP when the VM is deleted. Possible values include: 'DeleteOptionsDelete', 'DeleteOptionsDetach' 20771 DeleteOption DeleteOptions `json:"deleteOption,omitempty"` 20772} 20773 20774// VirtualMachineScaleSetUpdateStorageProfile describes a virtual machine scale set storage profile. 20775type VirtualMachineScaleSetUpdateStorageProfile struct { 20776 // ImageReference - The image reference. 20777 ImageReference *ImageReference `json:"imageReference,omitempty"` 20778 // OsDisk - The OS disk. 20779 OsDisk *VirtualMachineScaleSetUpdateOSDisk `json:"osDisk,omitempty"` 20780 // DataDisks - The data disks. 20781 DataDisks *[]VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"` 20782} 20783 20784// VirtualMachineScaleSetUpdateVMProfile describes a virtual machine scale set virtual machine profile. 20785type VirtualMachineScaleSetUpdateVMProfile struct { 20786 // OsProfile - The virtual machine scale set OS profile. 20787 OsProfile *VirtualMachineScaleSetUpdateOSProfile `json:"osProfile,omitempty"` 20788 // StorageProfile - The virtual machine scale set storage profile. 20789 StorageProfile *VirtualMachineScaleSetUpdateStorageProfile `json:"storageProfile,omitempty"` 20790 // NetworkProfile - The virtual machine scale set network profile. 20791 NetworkProfile *VirtualMachineScaleSetUpdateNetworkProfile `json:"networkProfile,omitempty"` 20792 // SecurityProfile - The virtual machine scale set Security profile 20793 SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` 20794 // DiagnosticsProfile - The virtual machine scale set diagnostics profile. 20795 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 20796 // ExtensionProfile - The virtual machine scale set extension profile. 20797 ExtensionProfile *VirtualMachineScaleSetExtensionProfile `json:"extensionProfile,omitempty"` 20798 // LicenseType - The license type, which is for bring your own license scenario. 20799 LicenseType *string `json:"licenseType,omitempty"` 20800 // BillingProfile - Specifies the billing related details of a Azure Spot VMSS. <br><br>Minimum api-version: 2019-03-01. 20801 BillingProfile *BillingProfile `json:"billingProfile,omitempty"` 20802 // ScheduledEventsProfile - Specifies Scheduled Event related configurations. 20803 ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` 20804 // 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 20805 UserData *string `json:"userData,omitempty"` 20806} 20807 20808// VirtualMachineScaleSetVM describes a virtual machine scale set virtual machine. 20809type VirtualMachineScaleSetVM struct { 20810 autorest.Response `json:"-"` 20811 // InstanceID - READ-ONLY; The virtual machine instance ID. 20812 InstanceID *string `json:"instanceId,omitempty"` 20813 // Sku - READ-ONLY; The virtual machine SKU. 20814 Sku *Sku `json:"sku,omitempty"` 20815 *VirtualMachineScaleSetVMProperties `json:"properties,omitempty"` 20816 // 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**. 20817 Plan *Plan `json:"plan,omitempty"` 20818 // Resources - READ-ONLY; The virtual machine child extension resources. 20819 Resources *[]VirtualMachineExtension `json:"resources,omitempty"` 20820 // Zones - READ-ONLY; The virtual machine zones. 20821 Zones *[]string `json:"zones,omitempty"` 20822 // ID - READ-ONLY; Resource Id 20823 ID *string `json:"id,omitempty"` 20824 // Name - READ-ONLY; Resource name 20825 Name *string `json:"name,omitempty"` 20826 // Type - READ-ONLY; Resource type 20827 Type *string `json:"type,omitempty"` 20828 // Location - Resource location 20829 Location *string `json:"location,omitempty"` 20830 // Tags - Resource tags 20831 Tags map[string]*string `json:"tags"` 20832} 20833 20834// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVM. 20835func (vmssv VirtualMachineScaleSetVM) MarshalJSON() ([]byte, error) { 20836 objectMap := make(map[string]interface{}) 20837 if vmssv.VirtualMachineScaleSetVMProperties != nil { 20838 objectMap["properties"] = vmssv.VirtualMachineScaleSetVMProperties 20839 } 20840 if vmssv.Plan != nil { 20841 objectMap["plan"] = vmssv.Plan 20842 } 20843 if vmssv.Location != nil { 20844 objectMap["location"] = vmssv.Location 20845 } 20846 if vmssv.Tags != nil { 20847 objectMap["tags"] = vmssv.Tags 20848 } 20849 return json.Marshal(objectMap) 20850} 20851 20852// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetVM struct. 20853func (vmssv *VirtualMachineScaleSetVM) UnmarshalJSON(body []byte) error { 20854 var m map[string]*json.RawMessage 20855 err := json.Unmarshal(body, &m) 20856 if err != nil { 20857 return err 20858 } 20859 for k, v := range m { 20860 switch k { 20861 case "instanceId": 20862 if v != nil { 20863 var instanceID string 20864 err = json.Unmarshal(*v, &instanceID) 20865 if err != nil { 20866 return err 20867 } 20868 vmssv.InstanceID = &instanceID 20869 } 20870 case "sku": 20871 if v != nil { 20872 var sku Sku 20873 err = json.Unmarshal(*v, &sku) 20874 if err != nil { 20875 return err 20876 } 20877 vmssv.Sku = &sku 20878 } 20879 case "properties": 20880 if v != nil { 20881 var virtualMachineScaleSetVMProperties VirtualMachineScaleSetVMProperties 20882 err = json.Unmarshal(*v, &virtualMachineScaleSetVMProperties) 20883 if err != nil { 20884 return err 20885 } 20886 vmssv.VirtualMachineScaleSetVMProperties = &virtualMachineScaleSetVMProperties 20887 } 20888 case "plan": 20889 if v != nil { 20890 var plan Plan 20891 err = json.Unmarshal(*v, &plan) 20892 if err != nil { 20893 return err 20894 } 20895 vmssv.Plan = &plan 20896 } 20897 case "resources": 20898 if v != nil { 20899 var resources []VirtualMachineExtension 20900 err = json.Unmarshal(*v, &resources) 20901 if err != nil { 20902 return err 20903 } 20904 vmssv.Resources = &resources 20905 } 20906 case "zones": 20907 if v != nil { 20908 var zones []string 20909 err = json.Unmarshal(*v, &zones) 20910 if err != nil { 20911 return err 20912 } 20913 vmssv.Zones = &zones 20914 } 20915 case "id": 20916 if v != nil { 20917 var ID string 20918 err = json.Unmarshal(*v, &ID) 20919 if err != nil { 20920 return err 20921 } 20922 vmssv.ID = &ID 20923 } 20924 case "name": 20925 if v != nil { 20926 var name string 20927 err = json.Unmarshal(*v, &name) 20928 if err != nil { 20929 return err 20930 } 20931 vmssv.Name = &name 20932 } 20933 case "type": 20934 if v != nil { 20935 var typeVar string 20936 err = json.Unmarshal(*v, &typeVar) 20937 if err != nil { 20938 return err 20939 } 20940 vmssv.Type = &typeVar 20941 } 20942 case "location": 20943 if v != nil { 20944 var location string 20945 err = json.Unmarshal(*v, &location) 20946 if err != nil { 20947 return err 20948 } 20949 vmssv.Location = &location 20950 } 20951 case "tags": 20952 if v != nil { 20953 var tags map[string]*string 20954 err = json.Unmarshal(*v, &tags) 20955 if err != nil { 20956 return err 20957 } 20958 vmssv.Tags = tags 20959 } 20960 } 20961 } 20962 20963 return nil 20964} 20965 20966// VirtualMachineScaleSetVMExtension describes a VMSS VM Extension. 20967type VirtualMachineScaleSetVMExtension struct { 20968 autorest.Response `json:"-"` 20969 // Name - READ-ONLY; The name of the extension. 20970 Name *string `json:"name,omitempty"` 20971 // Type - READ-ONLY; Resource type 20972 Type *string `json:"type,omitempty"` 20973 *VirtualMachineExtensionProperties `json:"properties,omitempty"` 20974 // ID - READ-ONLY; Resource Id 20975 ID *string `json:"id,omitempty"` 20976} 20977 20978// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMExtension. 20979func (vmssve VirtualMachineScaleSetVMExtension) MarshalJSON() ([]byte, error) { 20980 objectMap := make(map[string]interface{}) 20981 if vmssve.VirtualMachineExtensionProperties != nil { 20982 objectMap["properties"] = vmssve.VirtualMachineExtensionProperties 20983 } 20984 return json.Marshal(objectMap) 20985} 20986 20987// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetVMExtension struct. 20988func (vmssve *VirtualMachineScaleSetVMExtension) UnmarshalJSON(body []byte) error { 20989 var m map[string]*json.RawMessage 20990 err := json.Unmarshal(body, &m) 20991 if err != nil { 20992 return err 20993 } 20994 for k, v := range m { 20995 switch k { 20996 case "name": 20997 if v != nil { 20998 var name string 20999 err = json.Unmarshal(*v, &name) 21000 if err != nil { 21001 return err 21002 } 21003 vmssve.Name = &name 21004 } 21005 case "type": 21006 if v != nil { 21007 var typeVar string 21008 err = json.Unmarshal(*v, &typeVar) 21009 if err != nil { 21010 return err 21011 } 21012 vmssve.Type = &typeVar 21013 } 21014 case "properties": 21015 if v != nil { 21016 var virtualMachineExtensionProperties VirtualMachineExtensionProperties 21017 err = json.Unmarshal(*v, &virtualMachineExtensionProperties) 21018 if err != nil { 21019 return err 21020 } 21021 vmssve.VirtualMachineExtensionProperties = &virtualMachineExtensionProperties 21022 } 21023 case "id": 21024 if v != nil { 21025 var ID string 21026 err = json.Unmarshal(*v, &ID) 21027 if err != nil { 21028 return err 21029 } 21030 vmssve.ID = &ID 21031 } 21032 } 21033 } 21034 21035 return nil 21036} 21037 21038// VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the 21039// results of a long-running operation. 21040type VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture struct { 21041 azure.FutureAPI 21042 // Result returns the result of the asynchronous operation. 21043 // If the operation has not completed it will return an error. 21044 Result func(VirtualMachineScaleSetVMExtensionsClient) (VirtualMachineScaleSetVMExtension, error) 21045} 21046 21047// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21048func (future *VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 21049 var azFuture azure.Future 21050 if err := json.Unmarshal(body, &azFuture); err != nil { 21051 return err 21052 } 21053 future.FutureAPI = &azFuture 21054 future.Result = future.result 21055 return nil 21056} 21057 21058// result is the default implementation for VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture.Result. 21059func (future *VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture) result(client VirtualMachineScaleSetVMExtensionsClient) (vmssve VirtualMachineScaleSetVMExtension, err error) { 21060 var done bool 21061 done, err = future.DoneWithContext(context.Background(), client) 21062 if err != nil { 21063 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 21064 return 21065 } 21066 if !done { 21067 vmssve.Response.Response = future.Response() 21068 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture") 21069 return 21070 } 21071 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 21072 if vmssve.Response.Response, err = future.GetResult(sender); err == nil && vmssve.Response.Response.StatusCode != http.StatusNoContent { 21073 vmssve, err = client.CreateOrUpdateResponder(vmssve.Response.Response) 21074 if err != nil { 21075 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture", "Result", vmssve.Response.Response, "Failure responding to request") 21076 } 21077 } 21078 return 21079} 21080 21081// VirtualMachineScaleSetVMExtensionsDeleteFuture an abstraction for monitoring and retrieving the results 21082// of a long-running operation. 21083type VirtualMachineScaleSetVMExtensionsDeleteFuture struct { 21084 azure.FutureAPI 21085 // Result returns the result of the asynchronous operation. 21086 // If the operation has not completed it will return an error. 21087 Result func(VirtualMachineScaleSetVMExtensionsClient) (autorest.Response, error) 21088} 21089 21090// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21091func (future *VirtualMachineScaleSetVMExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { 21092 var azFuture azure.Future 21093 if err := json.Unmarshal(body, &azFuture); err != nil { 21094 return err 21095 } 21096 future.FutureAPI = &azFuture 21097 future.Result = future.result 21098 return nil 21099} 21100 21101// result is the default implementation for VirtualMachineScaleSetVMExtensionsDeleteFuture.Result. 21102func (future *VirtualMachineScaleSetVMExtensionsDeleteFuture) result(client VirtualMachineScaleSetVMExtensionsClient) (ar autorest.Response, err error) { 21103 var done bool 21104 done, err = future.DoneWithContext(context.Background(), client) 21105 if err != nil { 21106 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") 21107 return 21108 } 21109 if !done { 21110 ar.Response = future.Response() 21111 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsDeleteFuture") 21112 return 21113 } 21114 ar.Response = future.Response() 21115 return 21116} 21117 21118// VirtualMachineScaleSetVMExtensionsListResult the List VMSS VM Extension operation response 21119type VirtualMachineScaleSetVMExtensionsListResult struct { 21120 autorest.Response `json:"-"` 21121 // Value - The list of VMSS VM extensions 21122 Value *[]VirtualMachineScaleSetVMExtension `json:"value,omitempty"` 21123} 21124 21125// VirtualMachineScaleSetVMExtensionsSummary extensions summary for virtual machines of a virtual machine 21126// scale set. 21127type VirtualMachineScaleSetVMExtensionsSummary struct { 21128 // Name - READ-ONLY; The extension name. 21129 Name *string `json:"name,omitempty"` 21130 // StatusesSummary - READ-ONLY; The extensions information. 21131 StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` 21132} 21133 21134// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMExtensionsSummary. 21135func (vmssves VirtualMachineScaleSetVMExtensionsSummary) MarshalJSON() ([]byte, error) { 21136 objectMap := make(map[string]interface{}) 21137 return json.Marshal(objectMap) 21138} 21139 21140// VirtualMachineScaleSetVMExtensionsUpdateFuture an abstraction for monitoring and retrieving the results 21141// of a long-running operation. 21142type VirtualMachineScaleSetVMExtensionsUpdateFuture struct { 21143 azure.FutureAPI 21144 // Result returns the result of the asynchronous operation. 21145 // If the operation has not completed it will return an error. 21146 Result func(VirtualMachineScaleSetVMExtensionsClient) (VirtualMachineScaleSetVMExtension, error) 21147} 21148 21149// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21150func (future *VirtualMachineScaleSetVMExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { 21151 var azFuture azure.Future 21152 if err := json.Unmarshal(body, &azFuture); err != nil { 21153 return err 21154 } 21155 future.FutureAPI = &azFuture 21156 future.Result = future.result 21157 return nil 21158} 21159 21160// result is the default implementation for VirtualMachineScaleSetVMExtensionsUpdateFuture.Result. 21161func (future *VirtualMachineScaleSetVMExtensionsUpdateFuture) result(client VirtualMachineScaleSetVMExtensionsClient) (vmssve VirtualMachineScaleSetVMExtension, err error) { 21162 var done bool 21163 done, err = future.DoneWithContext(context.Background(), client) 21164 if err != nil { 21165 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsUpdateFuture", "Result", future.Response(), "Polling failure") 21166 return 21167 } 21168 if !done { 21169 vmssve.Response.Response = future.Response() 21170 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsUpdateFuture") 21171 return 21172 } 21173 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 21174 if vmssve.Response.Response, err = future.GetResult(sender); err == nil && vmssve.Response.Response.StatusCode != http.StatusNoContent { 21175 vmssve, err = client.UpdateResponder(vmssve.Response.Response) 21176 if err != nil { 21177 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsUpdateFuture", "Result", vmssve.Response.Response, "Failure responding to request") 21178 } 21179 } 21180 return 21181} 21182 21183// VirtualMachineScaleSetVMExtensionUpdate describes a VMSS VM Extension. 21184type VirtualMachineScaleSetVMExtensionUpdate struct { 21185 // Name - READ-ONLY; The name of the extension. 21186 Name *string `json:"name,omitempty"` 21187 // Type - READ-ONLY; Resource type 21188 Type *string `json:"type,omitempty"` 21189 *VirtualMachineExtensionUpdateProperties `json:"properties,omitempty"` 21190 // ID - READ-ONLY; Resource Id 21191 ID *string `json:"id,omitempty"` 21192} 21193 21194// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMExtensionUpdate. 21195func (vmssveu VirtualMachineScaleSetVMExtensionUpdate) MarshalJSON() ([]byte, error) { 21196 objectMap := make(map[string]interface{}) 21197 if vmssveu.VirtualMachineExtensionUpdateProperties != nil { 21198 objectMap["properties"] = vmssveu.VirtualMachineExtensionUpdateProperties 21199 } 21200 return json.Marshal(objectMap) 21201} 21202 21203// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetVMExtensionUpdate struct. 21204func (vmssveu *VirtualMachineScaleSetVMExtensionUpdate) UnmarshalJSON(body []byte) error { 21205 var m map[string]*json.RawMessage 21206 err := json.Unmarshal(body, &m) 21207 if err != nil { 21208 return err 21209 } 21210 for k, v := range m { 21211 switch k { 21212 case "name": 21213 if v != nil { 21214 var name string 21215 err = json.Unmarshal(*v, &name) 21216 if err != nil { 21217 return err 21218 } 21219 vmssveu.Name = &name 21220 } 21221 case "type": 21222 if v != nil { 21223 var typeVar string 21224 err = json.Unmarshal(*v, &typeVar) 21225 if err != nil { 21226 return err 21227 } 21228 vmssveu.Type = &typeVar 21229 } 21230 case "properties": 21231 if v != nil { 21232 var virtualMachineExtensionUpdateProperties VirtualMachineExtensionUpdateProperties 21233 err = json.Unmarshal(*v, &virtualMachineExtensionUpdateProperties) 21234 if err != nil { 21235 return err 21236 } 21237 vmssveu.VirtualMachineExtensionUpdateProperties = &virtualMachineExtensionUpdateProperties 21238 } 21239 case "id": 21240 if v != nil { 21241 var ID string 21242 err = json.Unmarshal(*v, &ID) 21243 if err != nil { 21244 return err 21245 } 21246 vmssveu.ID = &ID 21247 } 21248 } 21249 } 21250 21251 return nil 21252} 21253 21254// VirtualMachineScaleSetVMInstanceIDs specifies a list of virtual machine instance IDs from the VM scale 21255// set. 21256type VirtualMachineScaleSetVMInstanceIDs struct { 21257 // 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. 21258 InstanceIds *[]string `json:"instanceIds,omitempty"` 21259} 21260 21261// VirtualMachineScaleSetVMInstanceRequiredIDs specifies a list of virtual machine instance IDs from the VM 21262// scale set. 21263type VirtualMachineScaleSetVMInstanceRequiredIDs struct { 21264 // InstanceIds - The virtual machine scale set instance ids. 21265 InstanceIds *[]string `json:"instanceIds,omitempty"` 21266} 21267 21268// VirtualMachineScaleSetVMInstanceView the instance view of a virtual machine scale set VM. 21269type VirtualMachineScaleSetVMInstanceView struct { 21270 autorest.Response `json:"-"` 21271 // PlatformUpdateDomain - The Update Domain count. 21272 PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` 21273 // PlatformFaultDomain - The Fault Domain count. 21274 PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` 21275 // RdpThumbPrint - The Remote desktop certificate thumbprint. 21276 RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"` 21277 // VMAgent - The VM Agent running on the virtual machine. 21278 VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"` 21279 // MaintenanceRedeployStatus - The Maintenance Operation status on the virtual machine. 21280 MaintenanceRedeployStatus *MaintenanceRedeployStatus `json:"maintenanceRedeployStatus,omitempty"` 21281 // Disks - The disks information. 21282 Disks *[]DiskInstanceView `json:"disks,omitempty"` 21283 // Extensions - The extensions information. 21284 Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` 21285 // VMHealth - READ-ONLY; The health status for the VM. 21286 VMHealth *VirtualMachineHealthStatus `json:"vmHealth,omitempty"` 21287 // 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. 21288 BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` 21289 // Statuses - The resource status information. 21290 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 21291 // 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. 21292 AssignedHost *string `json:"assignedHost,omitempty"` 21293 // PlacementGroupID - The placement group in which the VM is running. If the VM is deallocated it will not have a placementGroupId. 21294 PlacementGroupID *string `json:"placementGroupId,omitempty"` 21295} 21296 21297// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMInstanceView. 21298func (vmssviv VirtualMachineScaleSetVMInstanceView) MarshalJSON() ([]byte, error) { 21299 objectMap := make(map[string]interface{}) 21300 if vmssviv.PlatformUpdateDomain != nil { 21301 objectMap["platformUpdateDomain"] = vmssviv.PlatformUpdateDomain 21302 } 21303 if vmssviv.PlatformFaultDomain != nil { 21304 objectMap["platformFaultDomain"] = vmssviv.PlatformFaultDomain 21305 } 21306 if vmssviv.RdpThumbPrint != nil { 21307 objectMap["rdpThumbPrint"] = vmssviv.RdpThumbPrint 21308 } 21309 if vmssviv.VMAgent != nil { 21310 objectMap["vmAgent"] = vmssviv.VMAgent 21311 } 21312 if vmssviv.MaintenanceRedeployStatus != nil { 21313 objectMap["maintenanceRedeployStatus"] = vmssviv.MaintenanceRedeployStatus 21314 } 21315 if vmssviv.Disks != nil { 21316 objectMap["disks"] = vmssviv.Disks 21317 } 21318 if vmssviv.Extensions != nil { 21319 objectMap["extensions"] = vmssviv.Extensions 21320 } 21321 if vmssviv.BootDiagnostics != nil { 21322 objectMap["bootDiagnostics"] = vmssviv.BootDiagnostics 21323 } 21324 if vmssviv.Statuses != nil { 21325 objectMap["statuses"] = vmssviv.Statuses 21326 } 21327 if vmssviv.PlacementGroupID != nil { 21328 objectMap["placementGroupId"] = vmssviv.PlacementGroupID 21329 } 21330 return json.Marshal(objectMap) 21331} 21332 21333// VirtualMachineScaleSetVMListResult the List Virtual Machine Scale Set VMs operation response. 21334type VirtualMachineScaleSetVMListResult struct { 21335 autorest.Response `json:"-"` 21336 // Value - The list of virtual machine scale sets VMs. 21337 Value *[]VirtualMachineScaleSetVM `json:"value,omitempty"` 21338 // 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 21339 NextLink *string `json:"nextLink,omitempty"` 21340} 21341 21342// VirtualMachineScaleSetVMListResultIterator provides access to a complete listing of 21343// VirtualMachineScaleSetVM values. 21344type VirtualMachineScaleSetVMListResultIterator struct { 21345 i int 21346 page VirtualMachineScaleSetVMListResultPage 21347} 21348 21349// NextWithContext advances to the next value. If there was an error making 21350// the request the iterator does not advance and the error is returned. 21351func (iter *VirtualMachineScaleSetVMListResultIterator) NextWithContext(ctx context.Context) (err error) { 21352 if tracing.IsEnabled() { 21353 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMListResultIterator.NextWithContext") 21354 defer func() { 21355 sc := -1 21356 if iter.Response().Response.Response != nil { 21357 sc = iter.Response().Response.Response.StatusCode 21358 } 21359 tracing.EndSpan(ctx, sc, err) 21360 }() 21361 } 21362 iter.i++ 21363 if iter.i < len(iter.page.Values()) { 21364 return nil 21365 } 21366 err = iter.page.NextWithContext(ctx) 21367 if err != nil { 21368 iter.i-- 21369 return err 21370 } 21371 iter.i = 0 21372 return nil 21373} 21374 21375// Next advances to the next value. If there was an error making 21376// the request the iterator does not advance and the error is returned. 21377// Deprecated: Use NextWithContext() instead. 21378func (iter *VirtualMachineScaleSetVMListResultIterator) Next() error { 21379 return iter.NextWithContext(context.Background()) 21380} 21381 21382// NotDone returns true if the enumeration should be started or is not yet complete. 21383func (iter VirtualMachineScaleSetVMListResultIterator) NotDone() bool { 21384 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 21385} 21386 21387// Response returns the raw server response from the last page request. 21388func (iter VirtualMachineScaleSetVMListResultIterator) Response() VirtualMachineScaleSetVMListResult { 21389 return iter.page.Response() 21390} 21391 21392// Value returns the current value or a zero-initialized value if the 21393// iterator has advanced beyond the end of the collection. 21394func (iter VirtualMachineScaleSetVMListResultIterator) Value() VirtualMachineScaleSetVM { 21395 if !iter.page.NotDone() { 21396 return VirtualMachineScaleSetVM{} 21397 } 21398 return iter.page.Values()[iter.i] 21399} 21400 21401// Creates a new instance of the VirtualMachineScaleSetVMListResultIterator type. 21402func NewVirtualMachineScaleSetVMListResultIterator(page VirtualMachineScaleSetVMListResultPage) VirtualMachineScaleSetVMListResultIterator { 21403 return VirtualMachineScaleSetVMListResultIterator{page: page} 21404} 21405 21406// IsEmpty returns true if the ListResult contains no values. 21407func (vmssvlr VirtualMachineScaleSetVMListResult) IsEmpty() bool { 21408 return vmssvlr.Value == nil || len(*vmssvlr.Value) == 0 21409} 21410 21411// hasNextLink returns true if the NextLink is not empty. 21412func (vmssvlr VirtualMachineScaleSetVMListResult) hasNextLink() bool { 21413 return vmssvlr.NextLink != nil && len(*vmssvlr.NextLink) != 0 21414} 21415 21416// virtualMachineScaleSetVMListResultPreparer prepares a request to retrieve the next set of results. 21417// It returns nil if no more results exist. 21418func (vmssvlr VirtualMachineScaleSetVMListResult) virtualMachineScaleSetVMListResultPreparer(ctx context.Context) (*http.Request, error) { 21419 if !vmssvlr.hasNextLink() { 21420 return nil, nil 21421 } 21422 return autorest.Prepare((&http.Request{}).WithContext(ctx), 21423 autorest.AsJSON(), 21424 autorest.AsGet(), 21425 autorest.WithBaseURL(to.String(vmssvlr.NextLink))) 21426} 21427 21428// VirtualMachineScaleSetVMListResultPage contains a page of VirtualMachineScaleSetVM values. 21429type VirtualMachineScaleSetVMListResultPage struct { 21430 fn func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error) 21431 vmssvlr VirtualMachineScaleSetVMListResult 21432} 21433 21434// NextWithContext advances to the next page of values. If there was an error making 21435// the request the page does not advance and the error is returned. 21436func (page *VirtualMachineScaleSetVMListResultPage) NextWithContext(ctx context.Context) (err error) { 21437 if tracing.IsEnabled() { 21438 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMListResultPage.NextWithContext") 21439 defer func() { 21440 sc := -1 21441 if page.Response().Response.Response != nil { 21442 sc = page.Response().Response.Response.StatusCode 21443 } 21444 tracing.EndSpan(ctx, sc, err) 21445 }() 21446 } 21447 for { 21448 next, err := page.fn(ctx, page.vmssvlr) 21449 if err != nil { 21450 return err 21451 } 21452 page.vmssvlr = next 21453 if !next.hasNextLink() || !next.IsEmpty() { 21454 break 21455 } 21456 } 21457 return nil 21458} 21459 21460// Next advances to the next page of values. If there was an error making 21461// the request the page does not advance and the error is returned. 21462// Deprecated: Use NextWithContext() instead. 21463func (page *VirtualMachineScaleSetVMListResultPage) Next() error { 21464 return page.NextWithContext(context.Background()) 21465} 21466 21467// NotDone returns true if the page enumeration should be started or is not yet complete. 21468func (page VirtualMachineScaleSetVMListResultPage) NotDone() bool { 21469 return !page.vmssvlr.IsEmpty() 21470} 21471 21472// Response returns the raw server response from the last page request. 21473func (page VirtualMachineScaleSetVMListResultPage) Response() VirtualMachineScaleSetVMListResult { 21474 return page.vmssvlr 21475} 21476 21477// Values returns the slice of values for the current page or nil if there are no values. 21478func (page VirtualMachineScaleSetVMListResultPage) Values() []VirtualMachineScaleSetVM { 21479 if page.vmssvlr.IsEmpty() { 21480 return nil 21481 } 21482 return *page.vmssvlr.Value 21483} 21484 21485// Creates a new instance of the VirtualMachineScaleSetVMListResultPage type. 21486func NewVirtualMachineScaleSetVMListResultPage(cur VirtualMachineScaleSetVMListResult, getNextPage func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error)) VirtualMachineScaleSetVMListResultPage { 21487 return VirtualMachineScaleSetVMListResultPage{ 21488 fn: getNextPage, 21489 vmssvlr: cur, 21490 } 21491} 21492 21493// VirtualMachineScaleSetVMNetworkProfileConfiguration describes a virtual machine scale set VM network 21494// profile. 21495type VirtualMachineScaleSetVMNetworkProfileConfiguration struct { 21496 // NetworkInterfaceConfigurations - The list of network configurations. 21497 NetworkInterfaceConfigurations *[]VirtualMachineScaleSetNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` 21498} 21499 21500// VirtualMachineScaleSetVMProfile describes a virtual machine scale set virtual machine profile. 21501type VirtualMachineScaleSetVMProfile struct { 21502 // OsProfile - Specifies the operating system settings for the virtual machines in the scale set. 21503 OsProfile *VirtualMachineScaleSetOSProfile `json:"osProfile,omitempty"` 21504 // StorageProfile - Specifies the storage settings for the virtual machine disks. 21505 StorageProfile *VirtualMachineScaleSetStorageProfile `json:"storageProfile,omitempty"` 21506 // NetworkProfile - Specifies properties of the network interfaces of the virtual machines in the scale set. 21507 NetworkProfile *VirtualMachineScaleSetNetworkProfile `json:"networkProfile,omitempty"` 21508 // SecurityProfile - Specifies the Security related profile settings for the virtual machines in the scale set. 21509 SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` 21510 // DiagnosticsProfile - Specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. 21511 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 21512 // ExtensionProfile - Specifies a collection of settings for extensions installed on virtual machines in the scale set. 21513 ExtensionProfile *VirtualMachineScaleSetExtensionProfile `json:"extensionProfile,omitempty"` 21514 // 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 21515 LicenseType *string `json:"licenseType,omitempty"` 21516 // 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' 21517 Priority VirtualMachinePriorityTypes `json:"priority,omitempty"` 21518 // 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' 21519 EvictionPolicy VirtualMachineEvictionPolicyTypes `json:"evictionPolicy,omitempty"` 21520 // BillingProfile - Specifies the billing related details of a Azure Spot VMSS. <br><br>Minimum api-version: 2019-03-01. 21521 BillingProfile *BillingProfile `json:"billingProfile,omitempty"` 21522 // ScheduledEventsProfile - Specifies Scheduled Event related configurations. 21523 ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` 21524 // 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 21525 UserData *string `json:"userData,omitempty"` 21526 // CapacityReservation - Specifies the capacity reservation related details of a scale set. <br><br>Minimum api-version: 2021-04-01. 21527 CapacityReservation *CapacityReservationProfile `json:"capacityReservation,omitempty"` 21528 // ApplicationProfile - Specifies the gallery applications that should be made available to the VM/VMSS 21529 ApplicationProfile *ApplicationProfile `json:"applicationProfile,omitempty"` 21530} 21531 21532// VirtualMachineScaleSetVMProperties describes the properties of a virtual machine scale set virtual 21533// machine. 21534type VirtualMachineScaleSetVMProperties struct { 21535 // LatestModelApplied - READ-ONLY; Specifies whether the latest model has been applied to the virtual machine. 21536 LatestModelApplied *bool `json:"latestModelApplied,omitempty"` 21537 // VMID - READ-ONLY; Azure VM unique ID. 21538 VMID *string `json:"vmId,omitempty"` 21539 // InstanceView - READ-ONLY; The virtual machine instance view. 21540 InstanceView *VirtualMachineScaleSetVMInstanceView `json:"instanceView,omitempty"` 21541 // HardwareProfile - Specifies the hardware settings for the virtual machine. 21542 HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` 21543 // StorageProfile - Specifies the storage settings for the virtual machine disks. 21544 StorageProfile *StorageProfile `json:"storageProfile,omitempty"` 21545 // 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. 21546 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 21547 // OsProfile - Specifies the operating system settings for the virtual machine. 21548 OsProfile *OSProfile `json:"osProfile,omitempty"` 21549 // SecurityProfile - Specifies the Security related profile settings for the virtual machine. 21550 SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` 21551 // NetworkProfile - Specifies the network interfaces of the virtual machine. 21552 NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` 21553 // NetworkProfileConfiguration - Specifies the network profile configuration of the virtual machine. 21554 NetworkProfileConfiguration *VirtualMachineScaleSetVMNetworkProfileConfiguration `json:"networkProfileConfiguration,omitempty"` 21555 // DiagnosticsProfile - Specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. 21556 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 21557 // 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. 21558 AvailabilitySet *SubResource `json:"availabilitySet,omitempty"` 21559 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 21560 ProvisioningState *string `json:"provisioningState,omitempty"` 21561 // 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 21562 LicenseType *string `json:"licenseType,omitempty"` 21563 // 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. 21564 ModelDefinitionApplied *string `json:"modelDefinitionApplied,omitempty"` 21565 // ProtectionPolicy - Specifies the protection policy of the virtual machine. 21566 ProtectionPolicy *VirtualMachineScaleSetVMProtectionPolicy `json:"protectionPolicy,omitempty"` 21567 // 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 21568 UserData *string `json:"userData,omitempty"` 21569} 21570 21571// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMProperties. 21572func (vmssvp VirtualMachineScaleSetVMProperties) MarshalJSON() ([]byte, error) { 21573 objectMap := make(map[string]interface{}) 21574 if vmssvp.HardwareProfile != nil { 21575 objectMap["hardwareProfile"] = vmssvp.HardwareProfile 21576 } 21577 if vmssvp.StorageProfile != nil { 21578 objectMap["storageProfile"] = vmssvp.StorageProfile 21579 } 21580 if vmssvp.AdditionalCapabilities != nil { 21581 objectMap["additionalCapabilities"] = vmssvp.AdditionalCapabilities 21582 } 21583 if vmssvp.OsProfile != nil { 21584 objectMap["osProfile"] = vmssvp.OsProfile 21585 } 21586 if vmssvp.SecurityProfile != nil { 21587 objectMap["securityProfile"] = vmssvp.SecurityProfile 21588 } 21589 if vmssvp.NetworkProfile != nil { 21590 objectMap["networkProfile"] = vmssvp.NetworkProfile 21591 } 21592 if vmssvp.NetworkProfileConfiguration != nil { 21593 objectMap["networkProfileConfiguration"] = vmssvp.NetworkProfileConfiguration 21594 } 21595 if vmssvp.DiagnosticsProfile != nil { 21596 objectMap["diagnosticsProfile"] = vmssvp.DiagnosticsProfile 21597 } 21598 if vmssvp.AvailabilitySet != nil { 21599 objectMap["availabilitySet"] = vmssvp.AvailabilitySet 21600 } 21601 if vmssvp.LicenseType != nil { 21602 objectMap["licenseType"] = vmssvp.LicenseType 21603 } 21604 if vmssvp.ProtectionPolicy != nil { 21605 objectMap["protectionPolicy"] = vmssvp.ProtectionPolicy 21606 } 21607 if vmssvp.UserData != nil { 21608 objectMap["userData"] = vmssvp.UserData 21609 } 21610 return json.Marshal(objectMap) 21611} 21612 21613// VirtualMachineScaleSetVMProtectionPolicy the protection policy of a virtual machine scale set VM. 21614type VirtualMachineScaleSetVMProtectionPolicy struct { 21615 // ProtectFromScaleIn - Indicates that the virtual machine scale set VM shouldn't be considered for deletion during a scale-in operation. 21616 ProtectFromScaleIn *bool `json:"protectFromScaleIn,omitempty"` 21617 // 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. 21618 ProtectFromScaleSetActions *bool `json:"protectFromScaleSetActions,omitempty"` 21619} 21620 21621// VirtualMachineScaleSetVMReimageParameters describes a Virtual Machine Scale Set VM Reimage Parameters. 21622type VirtualMachineScaleSetVMReimageParameters struct { 21623 // 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. 21624 TempDisk *bool `json:"tempDisk,omitempty"` 21625} 21626 21627// VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture an abstraction for monitoring and retrieving the 21628// results of a long-running operation. 21629type VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture struct { 21630 azure.FutureAPI 21631 // Result returns the result of the asynchronous operation. 21632 // If the operation has not completed it will return an error. 21633 Result func(VirtualMachineScaleSetVMRunCommandsClient) (VirtualMachineRunCommand, error) 21634} 21635 21636// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21637func (future *VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 21638 var azFuture azure.Future 21639 if err := json.Unmarshal(body, &azFuture); err != nil { 21640 return err 21641 } 21642 future.FutureAPI = &azFuture 21643 future.Result = future.result 21644 return nil 21645} 21646 21647// result is the default implementation for VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture.Result. 21648func (future *VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture) result(client VirtualMachineScaleSetVMRunCommandsClient) (vmrc VirtualMachineRunCommand, err error) { 21649 var done bool 21650 done, err = future.DoneWithContext(context.Background(), client) 21651 if err != nil { 21652 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 21653 return 21654 } 21655 if !done { 21656 vmrc.Response.Response = future.Response() 21657 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture") 21658 return 21659 } 21660 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 21661 if vmrc.Response.Response, err = future.GetResult(sender); err == nil && vmrc.Response.Response.StatusCode != http.StatusNoContent { 21662 vmrc, err = client.CreateOrUpdateResponder(vmrc.Response.Response) 21663 if err != nil { 21664 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture", "Result", vmrc.Response.Response, "Failure responding to request") 21665 } 21666 } 21667 return 21668} 21669 21670// VirtualMachineScaleSetVMRunCommandsDeleteFuture an abstraction for monitoring and retrieving the results 21671// of a long-running operation. 21672type VirtualMachineScaleSetVMRunCommandsDeleteFuture struct { 21673 azure.FutureAPI 21674 // Result returns the result of the asynchronous operation. 21675 // If the operation has not completed it will return an error. 21676 Result func(VirtualMachineScaleSetVMRunCommandsClient) (autorest.Response, error) 21677} 21678 21679// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21680func (future *VirtualMachineScaleSetVMRunCommandsDeleteFuture) UnmarshalJSON(body []byte) error { 21681 var azFuture azure.Future 21682 if err := json.Unmarshal(body, &azFuture); err != nil { 21683 return err 21684 } 21685 future.FutureAPI = &azFuture 21686 future.Result = future.result 21687 return nil 21688} 21689 21690// result is the default implementation for VirtualMachineScaleSetVMRunCommandsDeleteFuture.Result. 21691func (future *VirtualMachineScaleSetVMRunCommandsDeleteFuture) result(client VirtualMachineScaleSetVMRunCommandsClient) (ar autorest.Response, err error) { 21692 var done bool 21693 done, err = future.DoneWithContext(context.Background(), client) 21694 if err != nil { 21695 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsDeleteFuture", "Result", future.Response(), "Polling failure") 21696 return 21697 } 21698 if !done { 21699 ar.Response = future.Response() 21700 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMRunCommandsDeleteFuture") 21701 return 21702 } 21703 ar.Response = future.Response() 21704 return 21705} 21706 21707// VirtualMachineScaleSetVMRunCommandsUpdateFuture an abstraction for monitoring and retrieving the results 21708// of a long-running operation. 21709type VirtualMachineScaleSetVMRunCommandsUpdateFuture struct { 21710 azure.FutureAPI 21711 // Result returns the result of the asynchronous operation. 21712 // If the operation has not completed it will return an error. 21713 Result func(VirtualMachineScaleSetVMRunCommandsClient) (VirtualMachineRunCommand, error) 21714} 21715 21716// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21717func (future *VirtualMachineScaleSetVMRunCommandsUpdateFuture) UnmarshalJSON(body []byte) error { 21718 var azFuture azure.Future 21719 if err := json.Unmarshal(body, &azFuture); err != nil { 21720 return err 21721 } 21722 future.FutureAPI = &azFuture 21723 future.Result = future.result 21724 return nil 21725} 21726 21727// result is the default implementation for VirtualMachineScaleSetVMRunCommandsUpdateFuture.Result. 21728func (future *VirtualMachineScaleSetVMRunCommandsUpdateFuture) result(client VirtualMachineScaleSetVMRunCommandsClient) (vmrc VirtualMachineRunCommand, err error) { 21729 var done bool 21730 done, err = future.DoneWithContext(context.Background(), client) 21731 if err != nil { 21732 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsUpdateFuture", "Result", future.Response(), "Polling failure") 21733 return 21734 } 21735 if !done { 21736 vmrc.Response.Response = future.Response() 21737 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMRunCommandsUpdateFuture") 21738 return 21739 } 21740 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 21741 if vmrc.Response.Response, err = future.GetResult(sender); err == nil && vmrc.Response.Response.StatusCode != http.StatusNoContent { 21742 vmrc, err = client.UpdateResponder(vmrc.Response.Response) 21743 if err != nil { 21744 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsUpdateFuture", "Result", vmrc.Response.Response, "Failure responding to request") 21745 } 21746 } 21747 return 21748} 21749 21750// VirtualMachineScaleSetVMsDeallocateFuture an abstraction for monitoring and retrieving the results of a 21751// long-running operation. 21752type VirtualMachineScaleSetVMsDeallocateFuture struct { 21753 azure.FutureAPI 21754 // Result returns the result of the asynchronous operation. 21755 // If the operation has not completed it will return an error. 21756 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 21757} 21758 21759// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21760func (future *VirtualMachineScaleSetVMsDeallocateFuture) UnmarshalJSON(body []byte) error { 21761 var azFuture azure.Future 21762 if err := json.Unmarshal(body, &azFuture); err != nil { 21763 return err 21764 } 21765 future.FutureAPI = &azFuture 21766 future.Result = future.result 21767 return nil 21768} 21769 21770// result is the default implementation for VirtualMachineScaleSetVMsDeallocateFuture.Result. 21771func (future *VirtualMachineScaleSetVMsDeallocateFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 21772 var done bool 21773 done, err = future.DoneWithContext(context.Background(), client) 21774 if err != nil { 21775 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsDeallocateFuture", "Result", future.Response(), "Polling failure") 21776 return 21777 } 21778 if !done { 21779 ar.Response = future.Response() 21780 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsDeallocateFuture") 21781 return 21782 } 21783 ar.Response = future.Response() 21784 return 21785} 21786 21787// VirtualMachineScaleSetVMsDeleteFuture an abstraction for monitoring and retrieving the results of a 21788// long-running operation. 21789type VirtualMachineScaleSetVMsDeleteFuture struct { 21790 azure.FutureAPI 21791 // Result returns the result of the asynchronous operation. 21792 // If the operation has not completed it will return an error. 21793 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 21794} 21795 21796// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21797func (future *VirtualMachineScaleSetVMsDeleteFuture) UnmarshalJSON(body []byte) error { 21798 var azFuture azure.Future 21799 if err := json.Unmarshal(body, &azFuture); err != nil { 21800 return err 21801 } 21802 future.FutureAPI = &azFuture 21803 future.Result = future.result 21804 return nil 21805} 21806 21807// result is the default implementation for VirtualMachineScaleSetVMsDeleteFuture.Result. 21808func (future *VirtualMachineScaleSetVMsDeleteFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 21809 var done bool 21810 done, err = future.DoneWithContext(context.Background(), client) 21811 if err != nil { 21812 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsDeleteFuture", "Result", future.Response(), "Polling failure") 21813 return 21814 } 21815 if !done { 21816 ar.Response = future.Response() 21817 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsDeleteFuture") 21818 return 21819 } 21820 ar.Response = future.Response() 21821 return 21822} 21823 21824// VirtualMachineScaleSetVMsPerformMaintenanceFuture an abstraction for monitoring and retrieving the 21825// results of a long-running operation. 21826type VirtualMachineScaleSetVMsPerformMaintenanceFuture struct { 21827 azure.FutureAPI 21828 // Result returns the result of the asynchronous operation. 21829 // If the operation has not completed it will return an error. 21830 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 21831} 21832 21833// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21834func (future *VirtualMachineScaleSetVMsPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { 21835 var azFuture azure.Future 21836 if err := json.Unmarshal(body, &azFuture); err != nil { 21837 return err 21838 } 21839 future.FutureAPI = &azFuture 21840 future.Result = future.result 21841 return nil 21842} 21843 21844// result is the default implementation for VirtualMachineScaleSetVMsPerformMaintenanceFuture.Result. 21845func (future *VirtualMachineScaleSetVMsPerformMaintenanceFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 21846 var done bool 21847 done, err = future.DoneWithContext(context.Background(), client) 21848 if err != nil { 21849 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsPerformMaintenanceFuture", "Result", future.Response(), "Polling failure") 21850 return 21851 } 21852 if !done { 21853 ar.Response = future.Response() 21854 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsPerformMaintenanceFuture") 21855 return 21856 } 21857 ar.Response = future.Response() 21858 return 21859} 21860 21861// VirtualMachineScaleSetVMsPowerOffFuture an abstraction for monitoring and retrieving the results of a 21862// long-running operation. 21863type VirtualMachineScaleSetVMsPowerOffFuture struct { 21864 azure.FutureAPI 21865 // Result returns the result of the asynchronous operation. 21866 // If the operation has not completed it will return an error. 21867 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 21868} 21869 21870// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21871func (future *VirtualMachineScaleSetVMsPowerOffFuture) UnmarshalJSON(body []byte) error { 21872 var azFuture azure.Future 21873 if err := json.Unmarshal(body, &azFuture); err != nil { 21874 return err 21875 } 21876 future.FutureAPI = &azFuture 21877 future.Result = future.result 21878 return nil 21879} 21880 21881// result is the default implementation for VirtualMachineScaleSetVMsPowerOffFuture.Result. 21882func (future *VirtualMachineScaleSetVMsPowerOffFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 21883 var done bool 21884 done, err = future.DoneWithContext(context.Background(), client) 21885 if err != nil { 21886 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsPowerOffFuture", "Result", future.Response(), "Polling failure") 21887 return 21888 } 21889 if !done { 21890 ar.Response = future.Response() 21891 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsPowerOffFuture") 21892 return 21893 } 21894 ar.Response = future.Response() 21895 return 21896} 21897 21898// VirtualMachineScaleSetVMsRedeployFuture an abstraction for monitoring and retrieving the results of a 21899// long-running operation. 21900type VirtualMachineScaleSetVMsRedeployFuture struct { 21901 azure.FutureAPI 21902 // Result returns the result of the asynchronous operation. 21903 // If the operation has not completed it will return an error. 21904 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 21905} 21906 21907// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21908func (future *VirtualMachineScaleSetVMsRedeployFuture) UnmarshalJSON(body []byte) error { 21909 var azFuture azure.Future 21910 if err := json.Unmarshal(body, &azFuture); err != nil { 21911 return err 21912 } 21913 future.FutureAPI = &azFuture 21914 future.Result = future.result 21915 return nil 21916} 21917 21918// result is the default implementation for VirtualMachineScaleSetVMsRedeployFuture.Result. 21919func (future *VirtualMachineScaleSetVMsRedeployFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 21920 var done bool 21921 done, err = future.DoneWithContext(context.Background(), client) 21922 if err != nil { 21923 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRedeployFuture", "Result", future.Response(), "Polling failure") 21924 return 21925 } 21926 if !done { 21927 ar.Response = future.Response() 21928 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRedeployFuture") 21929 return 21930 } 21931 ar.Response = future.Response() 21932 return 21933} 21934 21935// VirtualMachineScaleSetVMsReimageAllFuture an abstraction for monitoring and retrieving the results of a 21936// long-running operation. 21937type VirtualMachineScaleSetVMsReimageAllFuture struct { 21938 azure.FutureAPI 21939 // Result returns the result of the asynchronous operation. 21940 // If the operation has not completed it will return an error. 21941 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 21942} 21943 21944// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21945func (future *VirtualMachineScaleSetVMsReimageAllFuture) UnmarshalJSON(body []byte) error { 21946 var azFuture azure.Future 21947 if err := json.Unmarshal(body, &azFuture); err != nil { 21948 return err 21949 } 21950 future.FutureAPI = &azFuture 21951 future.Result = future.result 21952 return nil 21953} 21954 21955// result is the default implementation for VirtualMachineScaleSetVMsReimageAllFuture.Result. 21956func (future *VirtualMachineScaleSetVMsReimageAllFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 21957 var done bool 21958 done, err = future.DoneWithContext(context.Background(), client) 21959 if err != nil { 21960 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsReimageAllFuture", "Result", future.Response(), "Polling failure") 21961 return 21962 } 21963 if !done { 21964 ar.Response = future.Response() 21965 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsReimageAllFuture") 21966 return 21967 } 21968 ar.Response = future.Response() 21969 return 21970} 21971 21972// VirtualMachineScaleSetVMsReimageFuture an abstraction for monitoring and retrieving the results of a 21973// long-running operation. 21974type VirtualMachineScaleSetVMsReimageFuture struct { 21975 azure.FutureAPI 21976 // Result returns the result of the asynchronous operation. 21977 // If the operation has not completed it will return an error. 21978 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 21979} 21980 21981// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21982func (future *VirtualMachineScaleSetVMsReimageFuture) UnmarshalJSON(body []byte) error { 21983 var azFuture azure.Future 21984 if err := json.Unmarshal(body, &azFuture); err != nil { 21985 return err 21986 } 21987 future.FutureAPI = &azFuture 21988 future.Result = future.result 21989 return nil 21990} 21991 21992// result is the default implementation for VirtualMachineScaleSetVMsReimageFuture.Result. 21993func (future *VirtualMachineScaleSetVMsReimageFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 21994 var done bool 21995 done, err = future.DoneWithContext(context.Background(), client) 21996 if err != nil { 21997 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsReimageFuture", "Result", future.Response(), "Polling failure") 21998 return 21999 } 22000 if !done { 22001 ar.Response = future.Response() 22002 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsReimageFuture") 22003 return 22004 } 22005 ar.Response = future.Response() 22006 return 22007} 22008 22009// VirtualMachineScaleSetVMsRestartFuture an abstraction for monitoring and retrieving the results of a 22010// long-running operation. 22011type VirtualMachineScaleSetVMsRestartFuture struct { 22012 azure.FutureAPI 22013 // Result returns the result of the asynchronous operation. 22014 // If the operation has not completed it will return an error. 22015 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 22016} 22017 22018// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22019func (future *VirtualMachineScaleSetVMsRestartFuture) UnmarshalJSON(body []byte) error { 22020 var azFuture azure.Future 22021 if err := json.Unmarshal(body, &azFuture); err != nil { 22022 return err 22023 } 22024 future.FutureAPI = &azFuture 22025 future.Result = future.result 22026 return nil 22027} 22028 22029// result is the default implementation for VirtualMachineScaleSetVMsRestartFuture.Result. 22030func (future *VirtualMachineScaleSetVMsRestartFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 22031 var done bool 22032 done, err = future.DoneWithContext(context.Background(), client) 22033 if err != nil { 22034 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRestartFuture", "Result", future.Response(), "Polling failure") 22035 return 22036 } 22037 if !done { 22038 ar.Response = future.Response() 22039 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRestartFuture") 22040 return 22041 } 22042 ar.Response = future.Response() 22043 return 22044} 22045 22046// VirtualMachineScaleSetVMsRunCommandFuture an abstraction for monitoring and retrieving the results of a 22047// long-running operation. 22048type VirtualMachineScaleSetVMsRunCommandFuture struct { 22049 azure.FutureAPI 22050 // Result returns the result of the asynchronous operation. 22051 // If the operation has not completed it will return an error. 22052 Result func(VirtualMachineScaleSetVMsClient) (RunCommandResult, error) 22053} 22054 22055// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22056func (future *VirtualMachineScaleSetVMsRunCommandFuture) UnmarshalJSON(body []byte) error { 22057 var azFuture azure.Future 22058 if err := json.Unmarshal(body, &azFuture); err != nil { 22059 return err 22060 } 22061 future.FutureAPI = &azFuture 22062 future.Result = future.result 22063 return nil 22064} 22065 22066// result is the default implementation for VirtualMachineScaleSetVMsRunCommandFuture.Result. 22067func (future *VirtualMachineScaleSetVMsRunCommandFuture) result(client VirtualMachineScaleSetVMsClient) (rcr RunCommandResult, err error) { 22068 var done bool 22069 done, err = future.DoneWithContext(context.Background(), client) 22070 if err != nil { 22071 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRunCommandFuture", "Result", future.Response(), "Polling failure") 22072 return 22073 } 22074 if !done { 22075 rcr.Response.Response = future.Response() 22076 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRunCommandFuture") 22077 return 22078 } 22079 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 22080 if rcr.Response.Response, err = future.GetResult(sender); err == nil && rcr.Response.Response.StatusCode != http.StatusNoContent { 22081 rcr, err = client.RunCommandResponder(rcr.Response.Response) 22082 if err != nil { 22083 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRunCommandFuture", "Result", rcr.Response.Response, "Failure responding to request") 22084 } 22085 } 22086 return 22087} 22088 22089// VirtualMachineScaleSetVMsStartFuture an abstraction for monitoring and retrieving the results of a 22090// long-running operation. 22091type VirtualMachineScaleSetVMsStartFuture struct { 22092 azure.FutureAPI 22093 // Result returns the result of the asynchronous operation. 22094 // If the operation has not completed it will return an error. 22095 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 22096} 22097 22098// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22099func (future *VirtualMachineScaleSetVMsStartFuture) UnmarshalJSON(body []byte) error { 22100 var azFuture azure.Future 22101 if err := json.Unmarshal(body, &azFuture); err != nil { 22102 return err 22103 } 22104 future.FutureAPI = &azFuture 22105 future.Result = future.result 22106 return nil 22107} 22108 22109// result is the default implementation for VirtualMachineScaleSetVMsStartFuture.Result. 22110func (future *VirtualMachineScaleSetVMsStartFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 22111 var done bool 22112 done, err = future.DoneWithContext(context.Background(), client) 22113 if err != nil { 22114 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsStartFuture", "Result", future.Response(), "Polling failure") 22115 return 22116 } 22117 if !done { 22118 ar.Response = future.Response() 22119 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsStartFuture") 22120 return 22121 } 22122 ar.Response = future.Response() 22123 return 22124} 22125 22126// VirtualMachineScaleSetVMsUpdateFuture an abstraction for monitoring and retrieving the results of a 22127// long-running operation. 22128type VirtualMachineScaleSetVMsUpdateFuture struct { 22129 azure.FutureAPI 22130 // Result returns the result of the asynchronous operation. 22131 // If the operation has not completed it will return an error. 22132 Result func(VirtualMachineScaleSetVMsClient) (VirtualMachineScaleSetVM, error) 22133} 22134 22135// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22136func (future *VirtualMachineScaleSetVMsUpdateFuture) UnmarshalJSON(body []byte) error { 22137 var azFuture azure.Future 22138 if err := json.Unmarshal(body, &azFuture); err != nil { 22139 return err 22140 } 22141 future.FutureAPI = &azFuture 22142 future.Result = future.result 22143 return nil 22144} 22145 22146// result is the default implementation for VirtualMachineScaleSetVMsUpdateFuture.Result. 22147func (future *VirtualMachineScaleSetVMsUpdateFuture) result(client VirtualMachineScaleSetVMsClient) (vmssv VirtualMachineScaleSetVM, err error) { 22148 var done bool 22149 done, err = future.DoneWithContext(context.Background(), client) 22150 if err != nil { 22151 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsUpdateFuture", "Result", future.Response(), "Polling failure") 22152 return 22153 } 22154 if !done { 22155 vmssv.Response.Response = future.Response() 22156 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsUpdateFuture") 22157 return 22158 } 22159 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 22160 if vmssv.Response.Response, err = future.GetResult(sender); err == nil && vmssv.Response.Response.StatusCode != http.StatusNoContent { 22161 vmssv, err = client.UpdateResponder(vmssv.Response.Response) 22162 if err != nil { 22163 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsUpdateFuture", "Result", vmssv.Response.Response, "Failure responding to request") 22164 } 22165 } 22166 return 22167} 22168 22169// VirtualMachinesCaptureFuture an abstraction for monitoring and retrieving the results of a long-running 22170// operation. 22171type VirtualMachinesCaptureFuture struct { 22172 azure.FutureAPI 22173 // Result returns the result of the asynchronous operation. 22174 // If the operation has not completed it will return an error. 22175 Result func(VirtualMachinesClient) (VirtualMachineCaptureResult, error) 22176} 22177 22178// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22179func (future *VirtualMachinesCaptureFuture) UnmarshalJSON(body []byte) error { 22180 var azFuture azure.Future 22181 if err := json.Unmarshal(body, &azFuture); err != nil { 22182 return err 22183 } 22184 future.FutureAPI = &azFuture 22185 future.Result = future.result 22186 return nil 22187} 22188 22189// result is the default implementation for VirtualMachinesCaptureFuture.Result. 22190func (future *VirtualMachinesCaptureFuture) result(client VirtualMachinesClient) (vmcr VirtualMachineCaptureResult, err error) { 22191 var done bool 22192 done, err = future.DoneWithContext(context.Background(), client) 22193 if err != nil { 22194 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCaptureFuture", "Result", future.Response(), "Polling failure") 22195 return 22196 } 22197 if !done { 22198 vmcr.Response.Response = future.Response() 22199 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesCaptureFuture") 22200 return 22201 } 22202 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 22203 if vmcr.Response.Response, err = future.GetResult(sender); err == nil && vmcr.Response.Response.StatusCode != http.StatusNoContent { 22204 vmcr, err = client.CaptureResponder(vmcr.Response.Response) 22205 if err != nil { 22206 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCaptureFuture", "Result", vmcr.Response.Response, "Failure responding to request") 22207 } 22208 } 22209 return 22210} 22211 22212// VirtualMachinesConvertToManagedDisksFuture an abstraction for monitoring and retrieving the results of a 22213// long-running operation. 22214type VirtualMachinesConvertToManagedDisksFuture struct { 22215 azure.FutureAPI 22216 // Result returns the result of the asynchronous operation. 22217 // If the operation has not completed it will return an error. 22218 Result func(VirtualMachinesClient) (autorest.Response, error) 22219} 22220 22221// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22222func (future *VirtualMachinesConvertToManagedDisksFuture) UnmarshalJSON(body []byte) error { 22223 var azFuture azure.Future 22224 if err := json.Unmarshal(body, &azFuture); err != nil { 22225 return err 22226 } 22227 future.FutureAPI = &azFuture 22228 future.Result = future.result 22229 return nil 22230} 22231 22232// result is the default implementation for VirtualMachinesConvertToManagedDisksFuture.Result. 22233func (future *VirtualMachinesConvertToManagedDisksFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 22234 var done bool 22235 done, err = future.DoneWithContext(context.Background(), client) 22236 if err != nil { 22237 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesConvertToManagedDisksFuture", "Result", future.Response(), "Polling failure") 22238 return 22239 } 22240 if !done { 22241 ar.Response = future.Response() 22242 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesConvertToManagedDisksFuture") 22243 return 22244 } 22245 ar.Response = future.Response() 22246 return 22247} 22248 22249// VirtualMachinesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 22250// long-running operation. 22251type VirtualMachinesCreateOrUpdateFuture struct { 22252 azure.FutureAPI 22253 // Result returns the result of the asynchronous operation. 22254 // If the operation has not completed it will return an error. 22255 Result func(VirtualMachinesClient) (VirtualMachine, error) 22256} 22257 22258// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22259func (future *VirtualMachinesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 22260 var azFuture azure.Future 22261 if err := json.Unmarshal(body, &azFuture); err != nil { 22262 return err 22263 } 22264 future.FutureAPI = &azFuture 22265 future.Result = future.result 22266 return nil 22267} 22268 22269// result is the default implementation for VirtualMachinesCreateOrUpdateFuture.Result. 22270func (future *VirtualMachinesCreateOrUpdateFuture) result(client VirtualMachinesClient) (VM VirtualMachine, err error) { 22271 var done bool 22272 done, err = future.DoneWithContext(context.Background(), client) 22273 if err != nil { 22274 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 22275 return 22276 } 22277 if !done { 22278 VM.Response.Response = future.Response() 22279 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesCreateOrUpdateFuture") 22280 return 22281 } 22282 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 22283 if VM.Response.Response, err = future.GetResult(sender); err == nil && VM.Response.Response.StatusCode != http.StatusNoContent { 22284 VM, err = client.CreateOrUpdateResponder(VM.Response.Response) 22285 if err != nil { 22286 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCreateOrUpdateFuture", "Result", VM.Response.Response, "Failure responding to request") 22287 } 22288 } 22289 return 22290} 22291 22292// VirtualMachinesDeallocateFuture an abstraction for monitoring and retrieving the results of a 22293// long-running operation. 22294type VirtualMachinesDeallocateFuture struct { 22295 azure.FutureAPI 22296 // Result returns the result of the asynchronous operation. 22297 // If the operation has not completed it will return an error. 22298 Result func(VirtualMachinesClient) (autorest.Response, error) 22299} 22300 22301// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22302func (future *VirtualMachinesDeallocateFuture) UnmarshalJSON(body []byte) error { 22303 var azFuture azure.Future 22304 if err := json.Unmarshal(body, &azFuture); err != nil { 22305 return err 22306 } 22307 future.FutureAPI = &azFuture 22308 future.Result = future.result 22309 return nil 22310} 22311 22312// result is the default implementation for VirtualMachinesDeallocateFuture.Result. 22313func (future *VirtualMachinesDeallocateFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 22314 var done bool 22315 done, err = future.DoneWithContext(context.Background(), client) 22316 if err != nil { 22317 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesDeallocateFuture", "Result", future.Response(), "Polling failure") 22318 return 22319 } 22320 if !done { 22321 ar.Response = future.Response() 22322 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesDeallocateFuture") 22323 return 22324 } 22325 ar.Response = future.Response() 22326 return 22327} 22328 22329// VirtualMachinesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 22330// operation. 22331type VirtualMachinesDeleteFuture struct { 22332 azure.FutureAPI 22333 // Result returns the result of the asynchronous operation. 22334 // If the operation has not completed it will return an error. 22335 Result func(VirtualMachinesClient) (autorest.Response, error) 22336} 22337 22338// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22339func (future *VirtualMachinesDeleteFuture) UnmarshalJSON(body []byte) error { 22340 var azFuture azure.Future 22341 if err := json.Unmarshal(body, &azFuture); err != nil { 22342 return err 22343 } 22344 future.FutureAPI = &azFuture 22345 future.Result = future.result 22346 return nil 22347} 22348 22349// result is the default implementation for VirtualMachinesDeleteFuture.Result. 22350func (future *VirtualMachinesDeleteFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 22351 var done bool 22352 done, err = future.DoneWithContext(context.Background(), client) 22353 if err != nil { 22354 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesDeleteFuture", "Result", future.Response(), "Polling failure") 22355 return 22356 } 22357 if !done { 22358 ar.Response = future.Response() 22359 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesDeleteFuture") 22360 return 22361 } 22362 ar.Response = future.Response() 22363 return 22364} 22365 22366// VirtualMachinesInstallPatchesFuture an abstraction for monitoring and retrieving the results of a 22367// long-running operation. 22368type VirtualMachinesInstallPatchesFuture struct { 22369 azure.FutureAPI 22370 // Result returns the result of the asynchronous operation. 22371 // If the operation has not completed it will return an error. 22372 Result func(VirtualMachinesClient) (VirtualMachineInstallPatchesResult, error) 22373} 22374 22375// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22376func (future *VirtualMachinesInstallPatchesFuture) UnmarshalJSON(body []byte) error { 22377 var azFuture azure.Future 22378 if err := json.Unmarshal(body, &azFuture); err != nil { 22379 return err 22380 } 22381 future.FutureAPI = &azFuture 22382 future.Result = future.result 22383 return nil 22384} 22385 22386// result is the default implementation for VirtualMachinesInstallPatchesFuture.Result. 22387func (future *VirtualMachinesInstallPatchesFuture) result(client VirtualMachinesClient) (vmipr VirtualMachineInstallPatchesResult, err error) { 22388 var done bool 22389 done, err = future.DoneWithContext(context.Background(), client) 22390 if err != nil { 22391 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesInstallPatchesFuture", "Result", future.Response(), "Polling failure") 22392 return 22393 } 22394 if !done { 22395 vmipr.Response.Response = future.Response() 22396 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesInstallPatchesFuture") 22397 return 22398 } 22399 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 22400 if vmipr.Response.Response, err = future.GetResult(sender); err == nil && vmipr.Response.Response.StatusCode != http.StatusNoContent { 22401 vmipr, err = client.InstallPatchesResponder(vmipr.Response.Response) 22402 if err != nil { 22403 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesInstallPatchesFuture", "Result", vmipr.Response.Response, "Failure responding to request") 22404 } 22405 } 22406 return 22407} 22408 22409// VirtualMachineSize describes the properties of a VM size. 22410type VirtualMachineSize struct { 22411 // Name - The name of the virtual machine size. 22412 Name *string `json:"name,omitempty"` 22413 // 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 22414 NumberOfCores *int32 `json:"numberOfCores,omitempty"` 22415 // OsDiskSizeInMB - The OS disk size, in MB, allowed by the virtual machine size. 22416 OsDiskSizeInMB *int32 `json:"osDiskSizeInMB,omitempty"` 22417 // ResourceDiskSizeInMB - The resource disk size, in MB, allowed by the virtual machine size. 22418 ResourceDiskSizeInMB *int32 `json:"resourceDiskSizeInMB,omitempty"` 22419 // MemoryInMB - The amount of memory, in MB, supported by the virtual machine size. 22420 MemoryInMB *int32 `json:"memoryInMB,omitempty"` 22421 // MaxDataDiskCount - The maximum number of data disks that can be attached to the virtual machine size. 22422 MaxDataDiskCount *int32 `json:"maxDataDiskCount,omitempty"` 22423} 22424 22425// VirtualMachineSizeListResult the List Virtual Machine operation response. 22426type VirtualMachineSizeListResult struct { 22427 autorest.Response `json:"-"` 22428 // Value - The list of virtual machine sizes. 22429 Value *[]VirtualMachineSize `json:"value,omitempty"` 22430} 22431 22432// VirtualMachineSoftwarePatchProperties describes the properties of a Virtual Machine software patch. 22433type VirtualMachineSoftwarePatchProperties struct { 22434 // PatchID - READ-ONLY; A unique identifier for the patch. 22435 PatchID *string `json:"patchId,omitempty"` 22436 // Name - READ-ONLY; The friendly name of the patch. 22437 Name *string `json:"name,omitempty"` 22438 // Version - READ-ONLY; The version number of the patch. This property applies only to Linux patches. 22439 Version *string `json:"version,omitempty"` 22440 // KbID - READ-ONLY; The KBID of the patch. Only applies to Windows patches. 22441 KbID *string `json:"kbId,omitempty"` 22442 // Classifications - READ-ONLY; The classification(s) of the patch as provided by the patch publisher. 22443 Classifications *[]string `json:"classifications,omitempty"` 22444 // RebootBehavior - READ-ONLY; Describes the reboot requirements of the patch. Possible values include: 'VMGuestPatchRebootBehaviorUnknown', 'VMGuestPatchRebootBehaviorNeverReboots', 'VMGuestPatchRebootBehaviorAlwaysRequiresReboot', 'VMGuestPatchRebootBehaviorCanRequestReboot' 22445 RebootBehavior VMGuestPatchRebootBehavior `json:"rebootBehavior,omitempty"` 22446 // ActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. 22447 ActivityID *string `json:"activityId,omitempty"` 22448 // PublishedDate - READ-ONLY; The UTC timestamp when the repository published this patch. 22449 PublishedDate *date.Time `json:"publishedDate,omitempty"` 22450 // LastModifiedDateTime - READ-ONLY; The UTC timestamp of the last update to this patch record. 22451 LastModifiedDateTime *date.Time `json:"lastModifiedDateTime,omitempty"` 22452 // AssessmentState - READ-ONLY; Describes the availability of a given patch. Possible values include: 'PatchAssessmentStateUnknown', 'PatchAssessmentStateAvailable' 22453 AssessmentState PatchAssessmentState `json:"assessmentState,omitempty"` 22454} 22455 22456// MarshalJSON is the custom marshaler for VirtualMachineSoftwarePatchProperties. 22457func (vmspp VirtualMachineSoftwarePatchProperties) MarshalJSON() ([]byte, error) { 22458 objectMap := make(map[string]interface{}) 22459 return json.Marshal(objectMap) 22460} 22461 22462// VirtualMachinesPerformMaintenanceFuture an abstraction for monitoring and retrieving the results of a 22463// long-running operation. 22464type VirtualMachinesPerformMaintenanceFuture struct { 22465 azure.FutureAPI 22466 // Result returns the result of the asynchronous operation. 22467 // If the operation has not completed it will return an error. 22468 Result func(VirtualMachinesClient) (autorest.Response, error) 22469} 22470 22471// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22472func (future *VirtualMachinesPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { 22473 var azFuture azure.Future 22474 if err := json.Unmarshal(body, &azFuture); err != nil { 22475 return err 22476 } 22477 future.FutureAPI = &azFuture 22478 future.Result = future.result 22479 return nil 22480} 22481 22482// result is the default implementation for VirtualMachinesPerformMaintenanceFuture.Result. 22483func (future *VirtualMachinesPerformMaintenanceFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 22484 var done bool 22485 done, err = future.DoneWithContext(context.Background(), client) 22486 if err != nil { 22487 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesPerformMaintenanceFuture", "Result", future.Response(), "Polling failure") 22488 return 22489 } 22490 if !done { 22491 ar.Response = future.Response() 22492 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesPerformMaintenanceFuture") 22493 return 22494 } 22495 ar.Response = future.Response() 22496 return 22497} 22498 22499// VirtualMachinesPowerOffFuture an abstraction for monitoring and retrieving the results of a long-running 22500// operation. 22501type VirtualMachinesPowerOffFuture struct { 22502 azure.FutureAPI 22503 // Result returns the result of the asynchronous operation. 22504 // If the operation has not completed it will return an error. 22505 Result func(VirtualMachinesClient) (autorest.Response, error) 22506} 22507 22508// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22509func (future *VirtualMachinesPowerOffFuture) UnmarshalJSON(body []byte) error { 22510 var azFuture azure.Future 22511 if err := json.Unmarshal(body, &azFuture); err != nil { 22512 return err 22513 } 22514 future.FutureAPI = &azFuture 22515 future.Result = future.result 22516 return nil 22517} 22518 22519// result is the default implementation for VirtualMachinesPowerOffFuture.Result. 22520func (future *VirtualMachinesPowerOffFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 22521 var done bool 22522 done, err = future.DoneWithContext(context.Background(), client) 22523 if err != nil { 22524 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesPowerOffFuture", "Result", future.Response(), "Polling failure") 22525 return 22526 } 22527 if !done { 22528 ar.Response = future.Response() 22529 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesPowerOffFuture") 22530 return 22531 } 22532 ar.Response = future.Response() 22533 return 22534} 22535 22536// VirtualMachinesReapplyFuture an abstraction for monitoring and retrieving the results of a long-running 22537// operation. 22538type VirtualMachinesReapplyFuture struct { 22539 azure.FutureAPI 22540 // Result returns the result of the asynchronous operation. 22541 // If the operation has not completed it will return an error. 22542 Result func(VirtualMachinesClient) (autorest.Response, error) 22543} 22544 22545// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22546func (future *VirtualMachinesReapplyFuture) UnmarshalJSON(body []byte) error { 22547 var azFuture azure.Future 22548 if err := json.Unmarshal(body, &azFuture); err != nil { 22549 return err 22550 } 22551 future.FutureAPI = &azFuture 22552 future.Result = future.result 22553 return nil 22554} 22555 22556// result is the default implementation for VirtualMachinesReapplyFuture.Result. 22557func (future *VirtualMachinesReapplyFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 22558 var done bool 22559 done, err = future.DoneWithContext(context.Background(), client) 22560 if err != nil { 22561 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesReapplyFuture", "Result", future.Response(), "Polling failure") 22562 return 22563 } 22564 if !done { 22565 ar.Response = future.Response() 22566 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesReapplyFuture") 22567 return 22568 } 22569 ar.Response = future.Response() 22570 return 22571} 22572 22573// VirtualMachinesRedeployFuture an abstraction for monitoring and retrieving the results of a long-running 22574// operation. 22575type VirtualMachinesRedeployFuture struct { 22576 azure.FutureAPI 22577 // Result returns the result of the asynchronous operation. 22578 // If the operation has not completed it will return an error. 22579 Result func(VirtualMachinesClient) (autorest.Response, error) 22580} 22581 22582// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22583func (future *VirtualMachinesRedeployFuture) UnmarshalJSON(body []byte) error { 22584 var azFuture azure.Future 22585 if err := json.Unmarshal(body, &azFuture); err != nil { 22586 return err 22587 } 22588 future.FutureAPI = &azFuture 22589 future.Result = future.result 22590 return nil 22591} 22592 22593// result is the default implementation for VirtualMachinesRedeployFuture.Result. 22594func (future *VirtualMachinesRedeployFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 22595 var done bool 22596 done, err = future.DoneWithContext(context.Background(), client) 22597 if err != nil { 22598 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRedeployFuture", "Result", future.Response(), "Polling failure") 22599 return 22600 } 22601 if !done { 22602 ar.Response = future.Response() 22603 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRedeployFuture") 22604 return 22605 } 22606 ar.Response = future.Response() 22607 return 22608} 22609 22610// VirtualMachinesReimageFuture an abstraction for monitoring and retrieving the results of a long-running 22611// operation. 22612type VirtualMachinesReimageFuture struct { 22613 azure.FutureAPI 22614 // Result returns the result of the asynchronous operation. 22615 // If the operation has not completed it will return an error. 22616 Result func(VirtualMachinesClient) (autorest.Response, error) 22617} 22618 22619// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22620func (future *VirtualMachinesReimageFuture) UnmarshalJSON(body []byte) error { 22621 var azFuture azure.Future 22622 if err := json.Unmarshal(body, &azFuture); err != nil { 22623 return err 22624 } 22625 future.FutureAPI = &azFuture 22626 future.Result = future.result 22627 return nil 22628} 22629 22630// result is the default implementation for VirtualMachinesReimageFuture.Result. 22631func (future *VirtualMachinesReimageFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 22632 var done bool 22633 done, err = future.DoneWithContext(context.Background(), client) 22634 if err != nil { 22635 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesReimageFuture", "Result", future.Response(), "Polling failure") 22636 return 22637 } 22638 if !done { 22639 ar.Response = future.Response() 22640 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesReimageFuture") 22641 return 22642 } 22643 ar.Response = future.Response() 22644 return 22645} 22646 22647// VirtualMachinesRestartFuture an abstraction for monitoring and retrieving the results of a long-running 22648// operation. 22649type VirtualMachinesRestartFuture struct { 22650 azure.FutureAPI 22651 // Result returns the result of the asynchronous operation. 22652 // If the operation has not completed it will return an error. 22653 Result func(VirtualMachinesClient) (autorest.Response, error) 22654} 22655 22656// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22657func (future *VirtualMachinesRestartFuture) UnmarshalJSON(body []byte) error { 22658 var azFuture azure.Future 22659 if err := json.Unmarshal(body, &azFuture); err != nil { 22660 return err 22661 } 22662 future.FutureAPI = &azFuture 22663 future.Result = future.result 22664 return nil 22665} 22666 22667// result is the default implementation for VirtualMachinesRestartFuture.Result. 22668func (future *VirtualMachinesRestartFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 22669 var done bool 22670 done, err = future.DoneWithContext(context.Background(), client) 22671 if err != nil { 22672 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRestartFuture", "Result", future.Response(), "Polling failure") 22673 return 22674 } 22675 if !done { 22676 ar.Response = future.Response() 22677 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRestartFuture") 22678 return 22679 } 22680 ar.Response = future.Response() 22681 return 22682} 22683 22684// VirtualMachinesRunCommandFuture an abstraction for monitoring and retrieving the results of a 22685// long-running operation. 22686type VirtualMachinesRunCommandFuture struct { 22687 azure.FutureAPI 22688 // Result returns the result of the asynchronous operation. 22689 // If the operation has not completed it will return an error. 22690 Result func(VirtualMachinesClient) (RunCommandResult, error) 22691} 22692 22693// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22694func (future *VirtualMachinesRunCommandFuture) UnmarshalJSON(body []byte) error { 22695 var azFuture azure.Future 22696 if err := json.Unmarshal(body, &azFuture); err != nil { 22697 return err 22698 } 22699 future.FutureAPI = &azFuture 22700 future.Result = future.result 22701 return nil 22702} 22703 22704// result is the default implementation for VirtualMachinesRunCommandFuture.Result. 22705func (future *VirtualMachinesRunCommandFuture) result(client VirtualMachinesClient) (rcr RunCommandResult, err error) { 22706 var done bool 22707 done, err = future.DoneWithContext(context.Background(), client) 22708 if err != nil { 22709 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRunCommandFuture", "Result", future.Response(), "Polling failure") 22710 return 22711 } 22712 if !done { 22713 rcr.Response.Response = future.Response() 22714 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRunCommandFuture") 22715 return 22716 } 22717 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 22718 if rcr.Response.Response, err = future.GetResult(sender); err == nil && rcr.Response.Response.StatusCode != http.StatusNoContent { 22719 rcr, err = client.RunCommandResponder(rcr.Response.Response) 22720 if err != nil { 22721 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRunCommandFuture", "Result", rcr.Response.Response, "Failure responding to request") 22722 } 22723 } 22724 return 22725} 22726 22727// VirtualMachinesStartFuture an abstraction for monitoring and retrieving the results of a long-running 22728// operation. 22729type VirtualMachinesStartFuture struct { 22730 azure.FutureAPI 22731 // Result returns the result of the asynchronous operation. 22732 // If the operation has not completed it will return an error. 22733 Result func(VirtualMachinesClient) (autorest.Response, error) 22734} 22735 22736// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22737func (future *VirtualMachinesStartFuture) UnmarshalJSON(body []byte) error { 22738 var azFuture azure.Future 22739 if err := json.Unmarshal(body, &azFuture); err != nil { 22740 return err 22741 } 22742 future.FutureAPI = &azFuture 22743 future.Result = future.result 22744 return nil 22745} 22746 22747// result is the default implementation for VirtualMachinesStartFuture.Result. 22748func (future *VirtualMachinesStartFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 22749 var done bool 22750 done, err = future.DoneWithContext(context.Background(), client) 22751 if err != nil { 22752 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesStartFuture", "Result", future.Response(), "Polling failure") 22753 return 22754 } 22755 if !done { 22756 ar.Response = future.Response() 22757 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesStartFuture") 22758 return 22759 } 22760 ar.Response = future.Response() 22761 return 22762} 22763 22764// VirtualMachineStatusCodeCount the status code and count of the virtual machine scale set instance view 22765// status summary. 22766type VirtualMachineStatusCodeCount struct { 22767 // Code - READ-ONLY; The instance view status code. 22768 Code *string `json:"code,omitempty"` 22769 // Count - READ-ONLY; The number of instances having a particular status code. 22770 Count *int32 `json:"count,omitempty"` 22771} 22772 22773// MarshalJSON is the custom marshaler for VirtualMachineStatusCodeCount. 22774func (vmscc VirtualMachineStatusCodeCount) MarshalJSON() ([]byte, error) { 22775 objectMap := make(map[string]interface{}) 22776 return json.Marshal(objectMap) 22777} 22778 22779// VirtualMachinesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 22780// operation. 22781type VirtualMachinesUpdateFuture struct { 22782 azure.FutureAPI 22783 // Result returns the result of the asynchronous operation. 22784 // If the operation has not completed it will return an error. 22785 Result func(VirtualMachinesClient) (VirtualMachine, error) 22786} 22787 22788// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22789func (future *VirtualMachinesUpdateFuture) UnmarshalJSON(body []byte) error { 22790 var azFuture azure.Future 22791 if err := json.Unmarshal(body, &azFuture); err != nil { 22792 return err 22793 } 22794 future.FutureAPI = &azFuture 22795 future.Result = future.result 22796 return nil 22797} 22798 22799// result is the default implementation for VirtualMachinesUpdateFuture.Result. 22800func (future *VirtualMachinesUpdateFuture) result(client VirtualMachinesClient) (VM VirtualMachine, err error) { 22801 var done bool 22802 done, err = future.DoneWithContext(context.Background(), client) 22803 if err != nil { 22804 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesUpdateFuture", "Result", future.Response(), "Polling failure") 22805 return 22806 } 22807 if !done { 22808 VM.Response.Response = future.Response() 22809 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesUpdateFuture") 22810 return 22811 } 22812 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 22813 if VM.Response.Response, err = future.GetResult(sender); err == nil && VM.Response.Response.StatusCode != http.StatusNoContent { 22814 VM, err = client.UpdateResponder(VM.Response.Response) 22815 if err != nil { 22816 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesUpdateFuture", "Result", VM.Response.Response, "Failure responding to request") 22817 } 22818 } 22819 return 22820} 22821 22822// VirtualMachineUpdate describes a Virtual Machine Update. 22823type VirtualMachineUpdate struct { 22824 // 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**. 22825 Plan *Plan `json:"plan,omitempty"` 22826 *VirtualMachineProperties `json:"properties,omitempty"` 22827 // Identity - The identity of the virtual machine, if configured. 22828 Identity *VirtualMachineIdentity `json:"identity,omitempty"` 22829 // Zones - The virtual machine zones. 22830 Zones *[]string `json:"zones,omitempty"` 22831 // Tags - Resource tags 22832 Tags map[string]*string `json:"tags"` 22833} 22834 22835// MarshalJSON is the custom marshaler for VirtualMachineUpdate. 22836func (vmu VirtualMachineUpdate) MarshalJSON() ([]byte, error) { 22837 objectMap := make(map[string]interface{}) 22838 if vmu.Plan != nil { 22839 objectMap["plan"] = vmu.Plan 22840 } 22841 if vmu.VirtualMachineProperties != nil { 22842 objectMap["properties"] = vmu.VirtualMachineProperties 22843 } 22844 if vmu.Identity != nil { 22845 objectMap["identity"] = vmu.Identity 22846 } 22847 if vmu.Zones != nil { 22848 objectMap["zones"] = vmu.Zones 22849 } 22850 if vmu.Tags != nil { 22851 objectMap["tags"] = vmu.Tags 22852 } 22853 return json.Marshal(objectMap) 22854} 22855 22856// UnmarshalJSON is the custom unmarshaler for VirtualMachineUpdate struct. 22857func (vmu *VirtualMachineUpdate) UnmarshalJSON(body []byte) error { 22858 var m map[string]*json.RawMessage 22859 err := json.Unmarshal(body, &m) 22860 if err != nil { 22861 return err 22862 } 22863 for k, v := range m { 22864 switch k { 22865 case "plan": 22866 if v != nil { 22867 var plan Plan 22868 err = json.Unmarshal(*v, &plan) 22869 if err != nil { 22870 return err 22871 } 22872 vmu.Plan = &plan 22873 } 22874 case "properties": 22875 if v != nil { 22876 var virtualMachineProperties VirtualMachineProperties 22877 err = json.Unmarshal(*v, &virtualMachineProperties) 22878 if err != nil { 22879 return err 22880 } 22881 vmu.VirtualMachineProperties = &virtualMachineProperties 22882 } 22883 case "identity": 22884 if v != nil { 22885 var identity VirtualMachineIdentity 22886 err = json.Unmarshal(*v, &identity) 22887 if err != nil { 22888 return err 22889 } 22890 vmu.Identity = &identity 22891 } 22892 case "zones": 22893 if v != nil { 22894 var zones []string 22895 err = json.Unmarshal(*v, &zones) 22896 if err != nil { 22897 return err 22898 } 22899 vmu.Zones = &zones 22900 } 22901 case "tags": 22902 if v != nil { 22903 var tags map[string]*string 22904 err = json.Unmarshal(*v, &tags) 22905 if err != nil { 22906 return err 22907 } 22908 vmu.Tags = tags 22909 } 22910 } 22911 } 22912 22913 return nil 22914} 22915 22916// VMGalleryApplication specifies the required information to reference a compute gallery application 22917// version 22918type VMGalleryApplication struct { 22919 // Tags - Optional, Specifies a passthrough value for more generic context. 22920 Tags *string `json:"tags,omitempty"` 22921 // Order - Optional, Specifies the order in which the packages have to be installed 22922 Order *int32 `json:"order,omitempty"` 22923 // PackageReferenceID - Specifies the GalleryApplicationVersion resource id on the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{application}/versions/{version} 22924 PackageReferenceID *string `json:"packageReferenceId,omitempty"` 22925 // ConfigurationReference - Optional, Specifies the uri to an azure blob that will replace the default configuration for the package if provided 22926 ConfigurationReference *string `json:"configurationReference,omitempty"` 22927} 22928 22929// VMScaleSetConvertToSinglePlacementGroupInput ... 22930type VMScaleSetConvertToSinglePlacementGroupInput struct { 22931 // 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. 22932 ActivePlacementGroupID *string `json:"activePlacementGroupId,omitempty"` 22933} 22934 22935// VMSizeProperties specifies VM Size Property settings on the virtual machine. 22936type VMSizeProperties struct { 22937 // VCPUsAvailable - Specifies the number of vCPUs available for the VM. <br><br> When this property is not specified in the request body the default behavior is to set it to the value of vCPUs available for that VM size exposed in api response of [List all available virtual machine sizes in a region](https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list) . 22938 VCPUsAvailable *int32 `json:"vCPUsAvailable,omitempty"` 22939 // VCPUsPerCore - Specifies the vCPU to physical core ratio. <br><br> When this property is not specified in the request body the default behavior is set to the value of vCPUsPerCore for the VM Size exposed in api response of [List all available virtual machine sizes in a region](https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list) <br><br> Setting this property to 1 also means that hyper-threading is disabled. 22940 VCPUsPerCore *int32 `json:"vCPUsPerCore,omitempty"` 22941} 22942 22943// WindowsConfiguration specifies Windows operating system settings on the virtual machine. 22944type WindowsConfiguration struct { 22945 // 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. 22946 ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` 22947 // 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. 22948 EnableAutomaticUpdates *bool `json:"enableAutomaticUpdates,omitempty"` 22949 // 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). 22950 TimeZone *string `json:"timeZone,omitempty"` 22951 // AdditionalUnattendContent - Specifies additional base-64 encoded XML formatted information that can be included in the Unattend.xml file, which is used by Windows Setup. 22952 AdditionalUnattendContent *[]AdditionalUnattendContent `json:"additionalUnattendContent,omitempty"` 22953 // PatchSettings - [Preview Feature] Specifies settings related to VM Guest Patching on Windows. 22954 PatchSettings *PatchSettings `json:"patchSettings,omitempty"` 22955 // WinRM - Specifies the Windows Remote Management listeners. This enables remote Windows PowerShell. 22956 WinRM *WinRMConfiguration `json:"winRM,omitempty"` 22957} 22958 22959// WindowsParameters input for InstallPatches on a Windows VM, as directly received by the API 22960type WindowsParameters struct { 22961 // ClassificationsToInclude - The update classifications to select when installing patches for Windows. 22962 ClassificationsToInclude *[]VMGuestPatchClassificationWindows `json:"classificationsToInclude,omitempty"` 22963 // KbNumbersToInclude - Kbs to include in the patch operation 22964 KbNumbersToInclude *[]string `json:"kbNumbersToInclude,omitempty"` 22965 // KbNumbersToExclude - Kbs to exclude in the patch operation 22966 KbNumbersToExclude *[]string `json:"kbNumbersToExclude,omitempty"` 22967 // ExcludeKbsRequiringReboot - Filters out Kbs that don't have an InstallationRebootBehavior of 'NeverReboots' when this is set to true. 22968 ExcludeKbsRequiringReboot *bool `json:"excludeKbsRequiringReboot,omitempty"` 22969 // MaxPatchPublishDate - This is used to install patches that were published on or before this given max published date. 22970 MaxPatchPublishDate *date.Time `json:"maxPatchPublishDate,omitempty"` 22971} 22972 22973// WinRMConfiguration describes Windows Remote Management configuration of the VM 22974type WinRMConfiguration struct { 22975 // Listeners - The list of Windows Remote Management listeners 22976 Listeners *[]WinRMListener `json:"listeners,omitempty"` 22977} 22978 22979// WinRMListener describes Protocol and thumbprint of Windows Remote Management listener 22980type WinRMListener struct { 22981 // Protocol - Specifies the protocol of WinRM listener. <br><br> Possible values are: <br>**http** <br><br> **https**. Possible values include: 'ProtocolTypesHTTP', 'ProtocolTypesHTTPS' 22982 Protocol ProtocolTypes `json:"protocol,omitempty"` 22983 // 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>} <br> To install certificates on a virtual machine it is recommended to use the [Azure Key Vault virtual machine extension for Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) or the [Azure Key Vault virtual machine extension for Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). 22984 CertificateURL *string `json:"certificateUrl,omitempty"` 22985} 22986