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-04-01/compute" 23 24// AccessURI a disk access SAS uri. 25type AccessURI struct { 26 autorest.Response `json:"-"` 27 // AccessSAS - READ-ONLY; A SAS uri for accessing a disk. 28 AccessSAS *string `json:"accessSAS,omitempty"` 29} 30 31// MarshalJSON is the custom marshaler for AccessURI. 32func (au AccessURI) MarshalJSON() ([]byte, error) { 33 objectMap := make(map[string]interface{}) 34 return json.Marshal(objectMap) 35} 36 37// AdditionalCapabilities enables or disables a capability on the virtual machine or virtual machine scale 38// set. 39type AdditionalCapabilities struct { 40 // UltraSSDEnabled - The flag that enables or disables a capability to have one or more managed data disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed disks with storage account type UltraSSD_LRS can be added to a virtual machine or virtual machine scale set only if this property is enabled. 41 UltraSSDEnabled *bool `json:"ultraSSDEnabled,omitempty"` 42} 43 44// AdditionalUnattendContent specifies additional XML formatted information that can be included in the 45// Unattend.xml file, which is used by Windows Setup. Contents are defined by setting name, component name, 46// and the pass in which the content is applied. 47type AdditionalUnattendContent struct { 48 // PassName - The pass name. Currently, the only allowable value is OobeSystem. Possible values include: 'PassNamesOobeSystem' 49 PassName PassNames `json:"passName,omitempty"` 50 // ComponentName - The component name. Currently, the only allowable value is Microsoft-Windows-Shell-Setup. Possible values include: 'ComponentNamesMicrosoftWindowsShellSetup' 51 ComponentName ComponentNames `json:"componentName,omitempty"` 52 // SettingName - Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon. Possible values include: 'SettingNamesAutoLogon', 'SettingNamesFirstLogonCommands' 53 SettingName SettingNames `json:"settingName,omitempty"` 54 // Content - Specifies the XML formatted content that is added to the unattend.xml file for the specified path and component. The XML must be less than 4KB and must include the root element for the setting or feature that is being inserted. 55 Content *string `json:"content,omitempty"` 56} 57 58// APIEntityReference the API entity reference. 59type APIEntityReference struct { 60 // ID - The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... 61 ID *string `json:"id,omitempty"` 62} 63 64// APIError api error. 65type APIError struct { 66 // Details - The Api error details 67 Details *[]APIErrorBase `json:"details,omitempty"` 68 // Innererror - The Api inner error 69 Innererror *InnerError `json:"innererror,omitempty"` 70 // Code - The error code. 71 Code *string `json:"code,omitempty"` 72 // Target - The target of the particular error. 73 Target *string `json:"target,omitempty"` 74 // Message - The error message. 75 Message *string `json:"message,omitempty"` 76} 77 78// APIErrorBase api error base. 79type APIErrorBase struct { 80 // Code - The error code. 81 Code *string `json:"code,omitempty"` 82 // Target - The target of the particular error. 83 Target *string `json:"target,omitempty"` 84 // Message - The error message. 85 Message *string `json:"message,omitempty"` 86} 87 88// AutomaticOSUpgradePolicy the configuration parameters used for performing automatic OS upgrade. 89type AutomaticOSUpgradePolicy struct { 90 // EnableAutomaticOSUpgrade - Indicates whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer version of the OS image becomes available. Default value is false. <br><br> If this is set to true for Windows based scale sets, [enableAutomaticUpdates](https://docs.microsoft.com/dotnet/api/microsoft.azure.management.compute.models.windowsconfiguration.enableautomaticupdates?view=azure-dotnet) is automatically set to false and cannot be set to true. 91 EnableAutomaticOSUpgrade *bool `json:"enableAutomaticOSUpgrade,omitempty"` 92 // DisableAutomaticRollback - Whether OS image rollback feature should be disabled. Default value is false. 93 DisableAutomaticRollback *bool `json:"disableAutomaticRollback,omitempty"` 94} 95 96// AutomaticOSUpgradeProperties describes automatic OS upgrade properties on the image. 97type AutomaticOSUpgradeProperties struct { 98 // AutomaticOSUpgradeSupported - Specifies whether automatic OS upgrade is supported on the image. 99 AutomaticOSUpgradeSupported *bool `json:"automaticOSUpgradeSupported,omitempty"` 100} 101 102// AutomaticRepairsPolicy specifies the configuration parameters for automatic repairs on the virtual 103// machine scale set. 104type AutomaticRepairsPolicy struct { 105 // Enabled - Specifies whether automatic repairs should be enabled on the virtual machine scale set. The default value is false. 106 Enabled *bool `json:"enabled,omitempty"` 107 // GracePeriod - The amount of time for which automatic repairs are suspended due to a state change on VM. The grace time starts after the state change has completed. This helps avoid premature or accidental repairs. The time duration should be specified in ISO 8601 format. The minimum allowed grace period is 30 minutes (PT30M), which is also the default value. The maximum allowed grace period is 90 minutes (PT90M). 108 GracePeriod *string `json:"gracePeriod,omitempty"` 109} 110 111// AvailabilitySet specifies information about the availability set that the virtual machine should be 112// assigned to. Virtual machines specified in the same availability set are allocated to different nodes to 113// maximize availability. For more information about availability sets, see [Availability sets 114// overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). <br><br> For 115// more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in 116// Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates) <br><br> Currently, a 117// VM can only be added to availability set at creation time. An existing VM cannot be added to an 118// availability set. 119type AvailabilitySet struct { 120 autorest.Response `json:"-"` 121 *AvailabilitySetProperties `json:"properties,omitempty"` 122 // Sku - Sku of the availability set, only name is required to be set. See AvailabilitySetSkuTypes for possible set of values. Use 'Aligned' for virtual machines with managed disks and 'Classic' for virtual machines with unmanaged disks. Default value is 'Classic'. 123 Sku *Sku `json:"sku,omitempty"` 124 // ID - READ-ONLY; Resource Id 125 ID *string `json:"id,omitempty"` 126 // Name - READ-ONLY; Resource name 127 Name *string `json:"name,omitempty"` 128 // Type - READ-ONLY; Resource type 129 Type *string `json:"type,omitempty"` 130 // Location - Resource location 131 Location *string `json:"location,omitempty"` 132 // Tags - Resource tags 133 Tags map[string]*string `json:"tags"` 134} 135 136// MarshalJSON is the custom marshaler for AvailabilitySet. 137func (as AvailabilitySet) MarshalJSON() ([]byte, error) { 138 objectMap := make(map[string]interface{}) 139 if as.AvailabilitySetProperties != nil { 140 objectMap["properties"] = as.AvailabilitySetProperties 141 } 142 if as.Sku != nil { 143 objectMap["sku"] = as.Sku 144 } 145 if as.Location != nil { 146 objectMap["location"] = as.Location 147 } 148 if as.Tags != nil { 149 objectMap["tags"] = as.Tags 150 } 151 return json.Marshal(objectMap) 152} 153 154// UnmarshalJSON is the custom unmarshaler for AvailabilitySet struct. 155func (as *AvailabilitySet) UnmarshalJSON(body []byte) error { 156 var m map[string]*json.RawMessage 157 err := json.Unmarshal(body, &m) 158 if err != nil { 159 return err 160 } 161 for k, v := range m { 162 switch k { 163 case "properties": 164 if v != nil { 165 var availabilitySetProperties AvailabilitySetProperties 166 err = json.Unmarshal(*v, &availabilitySetProperties) 167 if err != nil { 168 return err 169 } 170 as.AvailabilitySetProperties = &availabilitySetProperties 171 } 172 case "sku": 173 if v != nil { 174 var sku Sku 175 err = json.Unmarshal(*v, &sku) 176 if err != nil { 177 return err 178 } 179 as.Sku = &sku 180 } 181 case "id": 182 if v != nil { 183 var ID string 184 err = json.Unmarshal(*v, &ID) 185 if err != nil { 186 return err 187 } 188 as.ID = &ID 189 } 190 case "name": 191 if v != nil { 192 var name string 193 err = json.Unmarshal(*v, &name) 194 if err != nil { 195 return err 196 } 197 as.Name = &name 198 } 199 case "type": 200 if v != nil { 201 var typeVar string 202 err = json.Unmarshal(*v, &typeVar) 203 if err != nil { 204 return err 205 } 206 as.Type = &typeVar 207 } 208 case "location": 209 if v != nil { 210 var location string 211 err = json.Unmarshal(*v, &location) 212 if err != nil { 213 return err 214 } 215 as.Location = &location 216 } 217 case "tags": 218 if v != nil { 219 var tags map[string]*string 220 err = json.Unmarshal(*v, &tags) 221 if err != nil { 222 return err 223 } 224 as.Tags = tags 225 } 226 } 227 } 228 229 return nil 230} 231 232// AvailabilitySetListResult the List Availability Set operation response. 233type AvailabilitySetListResult struct { 234 autorest.Response `json:"-"` 235 // Value - The list of availability sets 236 Value *[]AvailabilitySet `json:"value,omitempty"` 237 // NextLink - The URI to fetch the next page of AvailabilitySets. Call ListNext() with this URI to fetch the next page of AvailabilitySets. 238 NextLink *string `json:"nextLink,omitempty"` 239} 240 241// AvailabilitySetListResultIterator provides access to a complete listing of AvailabilitySet values. 242type AvailabilitySetListResultIterator struct { 243 i int 244 page AvailabilitySetListResultPage 245} 246 247// NextWithContext advances to the next value. If there was an error making 248// the request the iterator does not advance and the error is returned. 249func (iter *AvailabilitySetListResultIterator) NextWithContext(ctx context.Context) (err error) { 250 if tracing.IsEnabled() { 251 ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetListResultIterator.NextWithContext") 252 defer func() { 253 sc := -1 254 if iter.Response().Response.Response != nil { 255 sc = iter.Response().Response.Response.StatusCode 256 } 257 tracing.EndSpan(ctx, sc, err) 258 }() 259 } 260 iter.i++ 261 if iter.i < len(iter.page.Values()) { 262 return nil 263 } 264 err = iter.page.NextWithContext(ctx) 265 if err != nil { 266 iter.i-- 267 return err 268 } 269 iter.i = 0 270 return nil 271} 272 273// Next advances to the next value. If there was an error making 274// the request the iterator does not advance and the error is returned. 275// Deprecated: Use NextWithContext() instead. 276func (iter *AvailabilitySetListResultIterator) Next() error { 277 return iter.NextWithContext(context.Background()) 278} 279 280// NotDone returns true if the enumeration should be started or is not yet complete. 281func (iter AvailabilitySetListResultIterator) NotDone() bool { 282 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 283} 284 285// Response returns the raw server response from the last page request. 286func (iter AvailabilitySetListResultIterator) Response() AvailabilitySetListResult { 287 return iter.page.Response() 288} 289 290// Value returns the current value or a zero-initialized value if the 291// iterator has advanced beyond the end of the collection. 292func (iter AvailabilitySetListResultIterator) Value() AvailabilitySet { 293 if !iter.page.NotDone() { 294 return AvailabilitySet{} 295 } 296 return iter.page.Values()[iter.i] 297} 298 299// Creates a new instance of the AvailabilitySetListResultIterator type. 300func NewAvailabilitySetListResultIterator(page AvailabilitySetListResultPage) AvailabilitySetListResultIterator { 301 return AvailabilitySetListResultIterator{page: page} 302} 303 304// IsEmpty returns true if the ListResult contains no values. 305func (aslr AvailabilitySetListResult) IsEmpty() bool { 306 return aslr.Value == nil || len(*aslr.Value) == 0 307} 308 309// hasNextLink returns true if the NextLink is not empty. 310func (aslr AvailabilitySetListResult) hasNextLink() bool { 311 return aslr.NextLink != nil && len(*aslr.NextLink) != 0 312} 313 314// availabilitySetListResultPreparer prepares a request to retrieve the next set of results. 315// It returns nil if no more results exist. 316func (aslr AvailabilitySetListResult) availabilitySetListResultPreparer(ctx context.Context) (*http.Request, error) { 317 if !aslr.hasNextLink() { 318 return nil, nil 319 } 320 return autorest.Prepare((&http.Request{}).WithContext(ctx), 321 autorest.AsJSON(), 322 autorest.AsGet(), 323 autorest.WithBaseURL(to.String(aslr.NextLink))) 324} 325 326// AvailabilitySetListResultPage contains a page of AvailabilitySet values. 327type AvailabilitySetListResultPage struct { 328 fn func(context.Context, AvailabilitySetListResult) (AvailabilitySetListResult, error) 329 aslr AvailabilitySetListResult 330} 331 332// NextWithContext advances to the next page of values. If there was an error making 333// the request the page does not advance and the error is returned. 334func (page *AvailabilitySetListResultPage) NextWithContext(ctx context.Context) (err error) { 335 if tracing.IsEnabled() { 336 ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetListResultPage.NextWithContext") 337 defer func() { 338 sc := -1 339 if page.Response().Response.Response != nil { 340 sc = page.Response().Response.Response.StatusCode 341 } 342 tracing.EndSpan(ctx, sc, err) 343 }() 344 } 345 for { 346 next, err := page.fn(ctx, page.aslr) 347 if err != nil { 348 return err 349 } 350 page.aslr = next 351 if !next.hasNextLink() || !next.IsEmpty() { 352 break 353 } 354 } 355 return nil 356} 357 358// Next advances to the next page of values. If there was an error making 359// the request the page does not advance and the error is returned. 360// Deprecated: Use NextWithContext() instead. 361func (page *AvailabilitySetListResultPage) Next() error { 362 return page.NextWithContext(context.Background()) 363} 364 365// NotDone returns true if the page enumeration should be started or is not yet complete. 366func (page AvailabilitySetListResultPage) NotDone() bool { 367 return !page.aslr.IsEmpty() 368} 369 370// Response returns the raw server response from the last page request. 371func (page AvailabilitySetListResultPage) Response() AvailabilitySetListResult { 372 return page.aslr 373} 374 375// Values returns the slice of values for the current page or nil if there are no values. 376func (page AvailabilitySetListResultPage) Values() []AvailabilitySet { 377 if page.aslr.IsEmpty() { 378 return nil 379 } 380 return *page.aslr.Value 381} 382 383// Creates a new instance of the AvailabilitySetListResultPage type. 384func NewAvailabilitySetListResultPage(cur AvailabilitySetListResult, getNextPage func(context.Context, AvailabilitySetListResult) (AvailabilitySetListResult, error)) AvailabilitySetListResultPage { 385 return AvailabilitySetListResultPage{ 386 fn: getNextPage, 387 aslr: cur, 388 } 389} 390 391// AvailabilitySetProperties the instance view of a resource. 392type AvailabilitySetProperties struct { 393 // PlatformUpdateDomainCount - Update Domain count. 394 PlatformUpdateDomainCount *int32 `json:"platformUpdateDomainCount,omitempty"` 395 // PlatformFaultDomainCount - Fault Domain count. 396 PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` 397 // VirtualMachines - A list of references to all virtual machines in the availability set. 398 VirtualMachines *[]SubResource `json:"virtualMachines,omitempty"` 399 // ProximityPlacementGroup - Specifies information about the proximity placement group that the availability set should be assigned to. <br><br>Minimum api-version: 2018-04-01. 400 ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` 401 // Statuses - READ-ONLY; The resource status information. 402 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 403} 404 405// MarshalJSON is the custom marshaler for AvailabilitySetProperties. 406func (asp AvailabilitySetProperties) MarshalJSON() ([]byte, error) { 407 objectMap := make(map[string]interface{}) 408 if asp.PlatformUpdateDomainCount != nil { 409 objectMap["platformUpdateDomainCount"] = asp.PlatformUpdateDomainCount 410 } 411 if asp.PlatformFaultDomainCount != nil { 412 objectMap["platformFaultDomainCount"] = asp.PlatformFaultDomainCount 413 } 414 if asp.VirtualMachines != nil { 415 objectMap["virtualMachines"] = asp.VirtualMachines 416 } 417 if asp.ProximityPlacementGroup != nil { 418 objectMap["proximityPlacementGroup"] = asp.ProximityPlacementGroup 419 } 420 return json.Marshal(objectMap) 421} 422 423// AvailabilitySetUpdate specifies information about the availability set that the virtual machine should 424// be assigned to. Only tags may be updated. 425type AvailabilitySetUpdate struct { 426 *AvailabilitySetProperties `json:"properties,omitempty"` 427 // Sku - Sku of the availability set 428 Sku *Sku `json:"sku,omitempty"` 429 // Tags - Resource tags 430 Tags map[string]*string `json:"tags"` 431} 432 433// MarshalJSON is the custom marshaler for AvailabilitySetUpdate. 434func (asu AvailabilitySetUpdate) MarshalJSON() ([]byte, error) { 435 objectMap := make(map[string]interface{}) 436 if asu.AvailabilitySetProperties != nil { 437 objectMap["properties"] = asu.AvailabilitySetProperties 438 } 439 if asu.Sku != nil { 440 objectMap["sku"] = asu.Sku 441 } 442 if asu.Tags != nil { 443 objectMap["tags"] = asu.Tags 444 } 445 return json.Marshal(objectMap) 446} 447 448// UnmarshalJSON is the custom unmarshaler for AvailabilitySetUpdate struct. 449func (asu *AvailabilitySetUpdate) UnmarshalJSON(body []byte) error { 450 var m map[string]*json.RawMessage 451 err := json.Unmarshal(body, &m) 452 if err != nil { 453 return err 454 } 455 for k, v := range m { 456 switch k { 457 case "properties": 458 if v != nil { 459 var availabilitySetProperties AvailabilitySetProperties 460 err = json.Unmarshal(*v, &availabilitySetProperties) 461 if err != nil { 462 return err 463 } 464 asu.AvailabilitySetProperties = &availabilitySetProperties 465 } 466 case "sku": 467 if v != nil { 468 var sku Sku 469 err = json.Unmarshal(*v, &sku) 470 if err != nil { 471 return err 472 } 473 asu.Sku = &sku 474 } 475 case "tags": 476 if v != nil { 477 var tags map[string]*string 478 err = json.Unmarshal(*v, &tags) 479 if err != nil { 480 return err 481 } 482 asu.Tags = tags 483 } 484 } 485 } 486 487 return nil 488} 489 490// AvailablePatchSummary describes the properties of an virtual machine instance view for available patch 491// summary. 492type AvailablePatchSummary struct { 493 // Status - READ-ONLY; The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings.". Possible values include: 'PatchOperationStatusUnknown', 'PatchOperationStatusInProgress', 'PatchOperationStatusFailed', 'PatchOperationStatusSucceeded', 'PatchOperationStatusCompletedWithWarnings' 494 Status PatchOperationStatus `json:"status,omitempty"` 495 // AssessmentActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. 496 AssessmentActivityID *string `json:"assessmentActivityId,omitempty"` 497 // RebootPending - READ-ONLY; The overall reboot status of the VM. It will be true when partially installed patches require a reboot to complete installation but the reboot has not yet occurred. 498 RebootPending *bool `json:"rebootPending,omitempty"` 499 // CriticalAndSecurityPatchCount - READ-ONLY; The number of critical or security patches that have been detected as available and not yet installed. 500 CriticalAndSecurityPatchCount *int32 `json:"criticalAndSecurityPatchCount,omitempty"` 501 // OtherPatchCount - READ-ONLY; The number of all available patches excluding critical and security. 502 OtherPatchCount *int32 `json:"otherPatchCount,omitempty"` 503 // StartTime - READ-ONLY; The UTC timestamp when the operation began. 504 StartTime *date.Time `json:"startTime,omitempty"` 505 // LastModifiedTime - READ-ONLY; The UTC timestamp when the operation began. 506 LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` 507 // Error - READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. 508 Error *APIError `json:"error,omitempty"` 509} 510 511// MarshalJSON is the custom marshaler for AvailablePatchSummary. 512func (aps AvailablePatchSummary) MarshalJSON() ([]byte, error) { 513 objectMap := make(map[string]interface{}) 514 return json.Marshal(objectMap) 515} 516 517// BillingProfile specifies the billing related details of a Azure Spot VM or VMSS. <br><br>Minimum 518// api-version: 2019-03-01. 519type BillingProfile struct { 520 // MaxPrice - Specifies the maximum price you are willing to pay for a Azure Spot VM/VMSS. This price is in US Dollars. <br><br> This price will be compared with the current Azure Spot price for the VM size. Also, the prices are compared at the time of create/update of Azure Spot VM/VMSS and the operation will only succeed if the maxPrice is greater than the current Azure Spot price. <br><br> The maxPrice will also be used for evicting a Azure Spot VM/VMSS if the current Azure Spot price goes beyond the maxPrice after creation of VM/VMSS. <br><br> Possible values are: <br><br> - Any decimal value greater than zero. Example: 0.01538 <br><br> -1 – indicates default price to be up-to on-demand. <br><br> You can set the maxPrice to -1 to indicate that the Azure Spot VM/VMSS should not be evicted for price reasons. Also, the default max price is -1 if it is not provided by you. <br><br>Minimum api-version: 2019-03-01. 521 MaxPrice *float64 `json:"maxPrice,omitempty"` 522} 523 524// BootDiagnostics boot Diagnostics is a debugging feature which allows you to view Console Output and 525// Screenshot to diagnose VM status. <br><br> You can easily view the output of your console log. <br><br> 526// Azure also enables you to see a screenshot of the VM from the hypervisor. 527type BootDiagnostics struct { 528 // Enabled - Whether boot diagnostics should be enabled on the Virtual Machine. 529 Enabled *bool `json:"enabled,omitempty"` 530 // StorageURI - Uri of the storage account to use for placing the console output and screenshot. <br><br>If storageUri is not specified while enabling boot diagnostics, managed storage will be used. 531 StorageURI *string `json:"storageUri,omitempty"` 532} 533 534// BootDiagnosticsInstanceView the instance view of a virtual machine boot diagnostics. 535type BootDiagnosticsInstanceView struct { 536 // ConsoleScreenshotBlobURI - READ-ONLY; The console screenshot blob URI. <br><br>NOTE: This will **not** be set if boot diagnostics is currently enabled with managed storage. 537 ConsoleScreenshotBlobURI *string `json:"consoleScreenshotBlobUri,omitempty"` 538 // SerialConsoleLogBlobURI - READ-ONLY; The serial console log blob Uri. <br><br>NOTE: This will **not** be set if boot diagnostics is currently enabled with managed storage. 539 SerialConsoleLogBlobURI *string `json:"serialConsoleLogBlobUri,omitempty"` 540 // Status - READ-ONLY; The boot diagnostics status information for the VM. <br><br> NOTE: It will be set only if there are errors encountered in enabling boot diagnostics. 541 Status *InstanceViewStatus `json:"status,omitempty"` 542} 543 544// MarshalJSON is the custom marshaler for BootDiagnosticsInstanceView. 545func (bdiv BootDiagnosticsInstanceView) MarshalJSON() ([]byte, error) { 546 objectMap := make(map[string]interface{}) 547 return json.Marshal(objectMap) 548} 549 550// CapacityReservation specifies information about the capacity reservation. 551type CapacityReservation struct { 552 autorest.Response `json:"-"` 553 *CapacityReservationProperties `json:"properties,omitempty"` 554 // 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. 555 Sku *Sku `json:"sku,omitempty"` 556 // 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. 557 Zones *[]string `json:"zones,omitempty"` 558 // ID - READ-ONLY; Resource Id 559 ID *string `json:"id,omitempty"` 560 // Name - READ-ONLY; Resource name 561 Name *string `json:"name,omitempty"` 562 // Type - READ-ONLY; Resource type 563 Type *string `json:"type,omitempty"` 564 // Location - Resource location 565 Location *string `json:"location,omitempty"` 566 // Tags - Resource tags 567 Tags map[string]*string `json:"tags"` 568} 569 570// MarshalJSON is the custom marshaler for CapacityReservation. 571func (cr CapacityReservation) MarshalJSON() ([]byte, error) { 572 objectMap := make(map[string]interface{}) 573 if cr.CapacityReservationProperties != nil { 574 objectMap["properties"] = cr.CapacityReservationProperties 575 } 576 if cr.Sku != nil { 577 objectMap["sku"] = cr.Sku 578 } 579 if cr.Zones != nil { 580 objectMap["zones"] = cr.Zones 581 } 582 if cr.Location != nil { 583 objectMap["location"] = cr.Location 584 } 585 if cr.Tags != nil { 586 objectMap["tags"] = cr.Tags 587 } 588 return json.Marshal(objectMap) 589} 590 591// UnmarshalJSON is the custom unmarshaler for CapacityReservation struct. 592func (cr *CapacityReservation) UnmarshalJSON(body []byte) error { 593 var m map[string]*json.RawMessage 594 err := json.Unmarshal(body, &m) 595 if err != nil { 596 return err 597 } 598 for k, v := range m { 599 switch k { 600 case "properties": 601 if v != nil { 602 var capacityReservationProperties CapacityReservationProperties 603 err = json.Unmarshal(*v, &capacityReservationProperties) 604 if err != nil { 605 return err 606 } 607 cr.CapacityReservationProperties = &capacityReservationProperties 608 } 609 case "sku": 610 if v != nil { 611 var sku Sku 612 err = json.Unmarshal(*v, &sku) 613 if err != nil { 614 return err 615 } 616 cr.Sku = &sku 617 } 618 case "zones": 619 if v != nil { 620 var zones []string 621 err = json.Unmarshal(*v, &zones) 622 if err != nil { 623 return err 624 } 625 cr.Zones = &zones 626 } 627 case "id": 628 if v != nil { 629 var ID string 630 err = json.Unmarshal(*v, &ID) 631 if err != nil { 632 return err 633 } 634 cr.ID = &ID 635 } 636 case "name": 637 if v != nil { 638 var name string 639 err = json.Unmarshal(*v, &name) 640 if err != nil { 641 return err 642 } 643 cr.Name = &name 644 } 645 case "type": 646 if v != nil { 647 var typeVar string 648 err = json.Unmarshal(*v, &typeVar) 649 if err != nil { 650 return err 651 } 652 cr.Type = &typeVar 653 } 654 case "location": 655 if v != nil { 656 var location string 657 err = json.Unmarshal(*v, &location) 658 if err != nil { 659 return err 660 } 661 cr.Location = &location 662 } 663 case "tags": 664 if v != nil { 665 var tags map[string]*string 666 err = json.Unmarshal(*v, &tags) 667 if err != nil { 668 return err 669 } 670 cr.Tags = tags 671 } 672 } 673 } 674 675 return nil 676} 677 678// CapacityReservationGroup specifies information about the capacity reservation group that the capacity 679// reservations should be assigned to. <br><br> Currently, a capacity reservation can only be added to a 680// capacity reservation group at creation time. An existing capacity reservation cannot be added or moved 681// to another capacity reservation group. 682type CapacityReservationGroup struct { 683 autorest.Response `json:"-"` 684 *CapacityReservationGroupProperties `json:"properties,omitempty"` 685 // 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. 686 Zones *[]string `json:"zones,omitempty"` 687 // ID - READ-ONLY; Resource Id 688 ID *string `json:"id,omitempty"` 689 // Name - READ-ONLY; Resource name 690 Name *string `json:"name,omitempty"` 691 // Type - READ-ONLY; Resource type 692 Type *string `json:"type,omitempty"` 693 // Location - Resource location 694 Location *string `json:"location,omitempty"` 695 // Tags - Resource tags 696 Tags map[string]*string `json:"tags"` 697} 698 699// MarshalJSON is the custom marshaler for CapacityReservationGroup. 700func (crg CapacityReservationGroup) MarshalJSON() ([]byte, error) { 701 objectMap := make(map[string]interface{}) 702 if crg.CapacityReservationGroupProperties != nil { 703 objectMap["properties"] = crg.CapacityReservationGroupProperties 704 } 705 if crg.Zones != nil { 706 objectMap["zones"] = crg.Zones 707 } 708 if crg.Location != nil { 709 objectMap["location"] = crg.Location 710 } 711 if crg.Tags != nil { 712 objectMap["tags"] = crg.Tags 713 } 714 return json.Marshal(objectMap) 715} 716 717// UnmarshalJSON is the custom unmarshaler for CapacityReservationGroup struct. 718func (crg *CapacityReservationGroup) UnmarshalJSON(body []byte) error { 719 var m map[string]*json.RawMessage 720 err := json.Unmarshal(body, &m) 721 if err != nil { 722 return err 723 } 724 for k, v := range m { 725 switch k { 726 case "properties": 727 if v != nil { 728 var capacityReservationGroupProperties CapacityReservationGroupProperties 729 err = json.Unmarshal(*v, &capacityReservationGroupProperties) 730 if err != nil { 731 return err 732 } 733 crg.CapacityReservationGroupProperties = &capacityReservationGroupProperties 734 } 735 case "zones": 736 if v != nil { 737 var zones []string 738 err = json.Unmarshal(*v, &zones) 739 if err != nil { 740 return err 741 } 742 crg.Zones = &zones 743 } 744 case "id": 745 if v != nil { 746 var ID string 747 err = json.Unmarshal(*v, &ID) 748 if err != nil { 749 return err 750 } 751 crg.ID = &ID 752 } 753 case "name": 754 if v != nil { 755 var name string 756 err = json.Unmarshal(*v, &name) 757 if err != nil { 758 return err 759 } 760 crg.Name = &name 761 } 762 case "type": 763 if v != nil { 764 var typeVar string 765 err = json.Unmarshal(*v, &typeVar) 766 if err != nil { 767 return err 768 } 769 crg.Type = &typeVar 770 } 771 case "location": 772 if v != nil { 773 var location string 774 err = json.Unmarshal(*v, &location) 775 if err != nil { 776 return err 777 } 778 crg.Location = &location 779 } 780 case "tags": 781 if v != nil { 782 var tags map[string]*string 783 err = json.Unmarshal(*v, &tags) 784 if err != nil { 785 return err 786 } 787 crg.Tags = tags 788 } 789 } 790 } 791 792 return nil 793} 794 795// CapacityReservationGroupInstanceView ... 796type CapacityReservationGroupInstanceView struct { 797 // CapacityReservations - READ-ONLY; List of instance view of the capacity reservations under the capacity reservation group. 798 CapacityReservations *[]CapacityReservationInstanceViewWithName `json:"capacityReservations,omitempty"` 799} 800 801// MarshalJSON is the custom marshaler for CapacityReservationGroupInstanceView. 802func (crgiv CapacityReservationGroupInstanceView) MarshalJSON() ([]byte, error) { 803 objectMap := make(map[string]interface{}) 804 return json.Marshal(objectMap) 805} 806 807// CapacityReservationGroupListResult the List capacity reservation group with resource group response. 808type CapacityReservationGroupListResult struct { 809 autorest.Response `json:"-"` 810 // Value - The list of capacity reservation groups 811 Value *[]CapacityReservationGroup `json:"value,omitempty"` 812 // 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. 813 NextLink *string `json:"nextLink,omitempty"` 814} 815 816// CapacityReservationGroupListResultIterator provides access to a complete listing of 817// CapacityReservationGroup values. 818type CapacityReservationGroupListResultIterator struct { 819 i int 820 page CapacityReservationGroupListResultPage 821} 822 823// NextWithContext advances to the next value. If there was an error making 824// the request the iterator does not advance and the error is returned. 825func (iter *CapacityReservationGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { 826 if tracing.IsEnabled() { 827 ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationGroupListResultIterator.NextWithContext") 828 defer func() { 829 sc := -1 830 if iter.Response().Response.Response != nil { 831 sc = iter.Response().Response.Response.StatusCode 832 } 833 tracing.EndSpan(ctx, sc, err) 834 }() 835 } 836 iter.i++ 837 if iter.i < len(iter.page.Values()) { 838 return nil 839 } 840 err = iter.page.NextWithContext(ctx) 841 if err != nil { 842 iter.i-- 843 return err 844 } 845 iter.i = 0 846 return nil 847} 848 849// Next advances to the next value. If there was an error making 850// the request the iterator does not advance and the error is returned. 851// Deprecated: Use NextWithContext() instead. 852func (iter *CapacityReservationGroupListResultIterator) Next() error { 853 return iter.NextWithContext(context.Background()) 854} 855 856// NotDone returns true if the enumeration should be started or is not yet complete. 857func (iter CapacityReservationGroupListResultIterator) NotDone() bool { 858 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 859} 860 861// Response returns the raw server response from the last page request. 862func (iter CapacityReservationGroupListResultIterator) Response() CapacityReservationGroupListResult { 863 return iter.page.Response() 864} 865 866// Value returns the current value or a zero-initialized value if the 867// iterator has advanced beyond the end of the collection. 868func (iter CapacityReservationGroupListResultIterator) Value() CapacityReservationGroup { 869 if !iter.page.NotDone() { 870 return CapacityReservationGroup{} 871 } 872 return iter.page.Values()[iter.i] 873} 874 875// Creates a new instance of the CapacityReservationGroupListResultIterator type. 876func NewCapacityReservationGroupListResultIterator(page CapacityReservationGroupListResultPage) CapacityReservationGroupListResultIterator { 877 return CapacityReservationGroupListResultIterator{page: page} 878} 879 880// IsEmpty returns true if the ListResult contains no values. 881func (crglr CapacityReservationGroupListResult) IsEmpty() bool { 882 return crglr.Value == nil || len(*crglr.Value) == 0 883} 884 885// hasNextLink returns true if the NextLink is not empty. 886func (crglr CapacityReservationGroupListResult) hasNextLink() bool { 887 return crglr.NextLink != nil && len(*crglr.NextLink) != 0 888} 889 890// capacityReservationGroupListResultPreparer prepares a request to retrieve the next set of results. 891// It returns nil if no more results exist. 892func (crglr CapacityReservationGroupListResult) capacityReservationGroupListResultPreparer(ctx context.Context) (*http.Request, error) { 893 if !crglr.hasNextLink() { 894 return nil, nil 895 } 896 return autorest.Prepare((&http.Request{}).WithContext(ctx), 897 autorest.AsJSON(), 898 autorest.AsGet(), 899 autorest.WithBaseURL(to.String(crglr.NextLink))) 900} 901 902// CapacityReservationGroupListResultPage contains a page of CapacityReservationGroup values. 903type CapacityReservationGroupListResultPage struct { 904 fn func(context.Context, CapacityReservationGroupListResult) (CapacityReservationGroupListResult, error) 905 crglr CapacityReservationGroupListResult 906} 907 908// NextWithContext advances to the next page of values. If there was an error making 909// the request the page does not advance and the error is returned. 910func (page *CapacityReservationGroupListResultPage) NextWithContext(ctx context.Context) (err error) { 911 if tracing.IsEnabled() { 912 ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationGroupListResultPage.NextWithContext") 913 defer func() { 914 sc := -1 915 if page.Response().Response.Response != nil { 916 sc = page.Response().Response.Response.StatusCode 917 } 918 tracing.EndSpan(ctx, sc, err) 919 }() 920 } 921 for { 922 next, err := page.fn(ctx, page.crglr) 923 if err != nil { 924 return err 925 } 926 page.crglr = next 927 if !next.hasNextLink() || !next.IsEmpty() { 928 break 929 } 930 } 931 return nil 932} 933 934// Next advances to the next page of values. If there was an error making 935// the request the page does not advance and the error is returned. 936// Deprecated: Use NextWithContext() instead. 937func (page *CapacityReservationGroupListResultPage) Next() error { 938 return page.NextWithContext(context.Background()) 939} 940 941// NotDone returns true if the page enumeration should be started or is not yet complete. 942func (page CapacityReservationGroupListResultPage) NotDone() bool { 943 return !page.crglr.IsEmpty() 944} 945 946// Response returns the raw server response from the last page request. 947func (page CapacityReservationGroupListResultPage) Response() CapacityReservationGroupListResult { 948 return page.crglr 949} 950 951// Values returns the slice of values for the current page or nil if there are no values. 952func (page CapacityReservationGroupListResultPage) Values() []CapacityReservationGroup { 953 if page.crglr.IsEmpty() { 954 return nil 955 } 956 return *page.crglr.Value 957} 958 959// Creates a new instance of the CapacityReservationGroupListResultPage type. 960func NewCapacityReservationGroupListResultPage(cur CapacityReservationGroupListResult, getNextPage func(context.Context, CapacityReservationGroupListResult) (CapacityReservationGroupListResult, error)) CapacityReservationGroupListResultPage { 961 return CapacityReservationGroupListResultPage{ 962 fn: getNextPage, 963 crglr: cur, 964 } 965} 966 967// CapacityReservationGroupProperties capacity reservation group Properties. 968type CapacityReservationGroupProperties struct { 969 // CapacityReservations - READ-ONLY; A list of all capacity reservation resource ids that belong to capacity reservation group. 970 CapacityReservations *[]SubResourceReadOnly `json:"capacityReservations,omitempty"` 971 // VirtualMachinesAssociated - READ-ONLY; A list of references to all virtual machines associated to the capacity reservation group. 972 VirtualMachinesAssociated *[]SubResourceReadOnly `json:"virtualMachinesAssociated,omitempty"` 973 // 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. 974 InstanceView *CapacityReservationGroupInstanceView `json:"instanceView,omitempty"` 975} 976 977// MarshalJSON is the custom marshaler for CapacityReservationGroupProperties. 978func (crgp CapacityReservationGroupProperties) MarshalJSON() ([]byte, error) { 979 objectMap := make(map[string]interface{}) 980 return json.Marshal(objectMap) 981} 982 983// CapacityReservationGroupUpdate specifies information about the capacity reservation group. Only tags can 984// be updated. 985type CapacityReservationGroupUpdate struct { 986 *CapacityReservationGroupProperties `json:"properties,omitempty"` 987 // Tags - Resource tags 988 Tags map[string]*string `json:"tags"` 989} 990 991// MarshalJSON is the custom marshaler for CapacityReservationGroupUpdate. 992func (crgu CapacityReservationGroupUpdate) MarshalJSON() ([]byte, error) { 993 objectMap := make(map[string]interface{}) 994 if crgu.CapacityReservationGroupProperties != nil { 995 objectMap["properties"] = crgu.CapacityReservationGroupProperties 996 } 997 if crgu.Tags != nil { 998 objectMap["tags"] = crgu.Tags 999 } 1000 return json.Marshal(objectMap) 1001} 1002 1003// UnmarshalJSON is the custom unmarshaler for CapacityReservationGroupUpdate struct. 1004func (crgu *CapacityReservationGroupUpdate) UnmarshalJSON(body []byte) error { 1005 var m map[string]*json.RawMessage 1006 err := json.Unmarshal(body, &m) 1007 if err != nil { 1008 return err 1009 } 1010 for k, v := range m { 1011 switch k { 1012 case "properties": 1013 if v != nil { 1014 var capacityReservationGroupProperties CapacityReservationGroupProperties 1015 err = json.Unmarshal(*v, &capacityReservationGroupProperties) 1016 if err != nil { 1017 return err 1018 } 1019 crgu.CapacityReservationGroupProperties = &capacityReservationGroupProperties 1020 } 1021 case "tags": 1022 if v != nil { 1023 var tags map[string]*string 1024 err = json.Unmarshal(*v, &tags) 1025 if err != nil { 1026 return err 1027 } 1028 crgu.Tags = tags 1029 } 1030 } 1031 } 1032 1033 return nil 1034} 1035 1036// CapacityReservationInstanceView the instance view of a capacity reservation that provides as snapshot of 1037// the runtime properties of the capacity reservation that is managed by the platform and can change 1038// outside of control plane operations. 1039type CapacityReservationInstanceView struct { 1040 // UtilizationInfo - Unutilized capacity of the capacity reservation. 1041 UtilizationInfo *CapacityReservationUtilization `json:"utilizationInfo,omitempty"` 1042 // Statuses - The resource status information. 1043 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 1044} 1045 1046// CapacityReservationInstanceViewWithName the instance view of a capacity reservation that includes the 1047// name of the capacity reservation. It is used for the response to the instance view of a capacity 1048// reservation group. 1049type CapacityReservationInstanceViewWithName struct { 1050 // Name - READ-ONLY; The name of the capacity reservation. 1051 Name *string `json:"name,omitempty"` 1052 // UtilizationInfo - Unutilized capacity of the capacity reservation. 1053 UtilizationInfo *CapacityReservationUtilization `json:"utilizationInfo,omitempty"` 1054 // Statuses - The resource status information. 1055 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 1056} 1057 1058// MarshalJSON is the custom marshaler for CapacityReservationInstanceViewWithName. 1059func (crivwn CapacityReservationInstanceViewWithName) MarshalJSON() ([]byte, error) { 1060 objectMap := make(map[string]interface{}) 1061 if crivwn.UtilizationInfo != nil { 1062 objectMap["utilizationInfo"] = crivwn.UtilizationInfo 1063 } 1064 if crivwn.Statuses != nil { 1065 objectMap["statuses"] = crivwn.Statuses 1066 } 1067 return json.Marshal(objectMap) 1068} 1069 1070// CapacityReservationListResult the list capacity reservation operation response. 1071type CapacityReservationListResult struct { 1072 autorest.Response `json:"-"` 1073 // Value - The list of capacity reservations 1074 Value *[]CapacityReservation `json:"value,omitempty"` 1075 // NextLink - The URI to fetch the next page of capacity reservations. Call ListNext() with this URI to fetch the next page of capacity reservations. 1076 NextLink *string `json:"nextLink,omitempty"` 1077} 1078 1079// CapacityReservationListResultIterator provides access to a complete listing of CapacityReservation 1080// values. 1081type CapacityReservationListResultIterator struct { 1082 i int 1083 page CapacityReservationListResultPage 1084} 1085 1086// NextWithContext advances to the next value. If there was an error making 1087// the request the iterator does not advance and the error is returned. 1088func (iter *CapacityReservationListResultIterator) NextWithContext(ctx context.Context) (err error) { 1089 if tracing.IsEnabled() { 1090 ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationListResultIterator.NextWithContext") 1091 defer func() { 1092 sc := -1 1093 if iter.Response().Response.Response != nil { 1094 sc = iter.Response().Response.Response.StatusCode 1095 } 1096 tracing.EndSpan(ctx, sc, err) 1097 }() 1098 } 1099 iter.i++ 1100 if iter.i < len(iter.page.Values()) { 1101 return nil 1102 } 1103 err = iter.page.NextWithContext(ctx) 1104 if err != nil { 1105 iter.i-- 1106 return err 1107 } 1108 iter.i = 0 1109 return nil 1110} 1111 1112// Next advances to the next value. If there was an error making 1113// the request the iterator does not advance and the error is returned. 1114// Deprecated: Use NextWithContext() instead. 1115func (iter *CapacityReservationListResultIterator) Next() error { 1116 return iter.NextWithContext(context.Background()) 1117} 1118 1119// NotDone returns true if the enumeration should be started or is not yet complete. 1120func (iter CapacityReservationListResultIterator) NotDone() bool { 1121 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1122} 1123 1124// Response returns the raw server response from the last page request. 1125func (iter CapacityReservationListResultIterator) Response() CapacityReservationListResult { 1126 return iter.page.Response() 1127} 1128 1129// Value returns the current value or a zero-initialized value if the 1130// iterator has advanced beyond the end of the collection. 1131func (iter CapacityReservationListResultIterator) Value() CapacityReservation { 1132 if !iter.page.NotDone() { 1133 return CapacityReservation{} 1134 } 1135 return iter.page.Values()[iter.i] 1136} 1137 1138// Creates a new instance of the CapacityReservationListResultIterator type. 1139func NewCapacityReservationListResultIterator(page CapacityReservationListResultPage) CapacityReservationListResultIterator { 1140 return CapacityReservationListResultIterator{page: page} 1141} 1142 1143// IsEmpty returns true if the ListResult contains no values. 1144func (crlr CapacityReservationListResult) IsEmpty() bool { 1145 return crlr.Value == nil || len(*crlr.Value) == 0 1146} 1147 1148// hasNextLink returns true if the NextLink is not empty. 1149func (crlr CapacityReservationListResult) hasNextLink() bool { 1150 return crlr.NextLink != nil && len(*crlr.NextLink) != 0 1151} 1152 1153// capacityReservationListResultPreparer prepares a request to retrieve the next set of results. 1154// It returns nil if no more results exist. 1155func (crlr CapacityReservationListResult) capacityReservationListResultPreparer(ctx context.Context) (*http.Request, error) { 1156 if !crlr.hasNextLink() { 1157 return nil, nil 1158 } 1159 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1160 autorest.AsJSON(), 1161 autorest.AsGet(), 1162 autorest.WithBaseURL(to.String(crlr.NextLink))) 1163} 1164 1165// CapacityReservationListResultPage contains a page of CapacityReservation values. 1166type CapacityReservationListResultPage struct { 1167 fn func(context.Context, CapacityReservationListResult) (CapacityReservationListResult, error) 1168 crlr CapacityReservationListResult 1169} 1170 1171// NextWithContext advances to the next page of values. If there was an error making 1172// the request the page does not advance and the error is returned. 1173func (page *CapacityReservationListResultPage) NextWithContext(ctx context.Context) (err error) { 1174 if tracing.IsEnabled() { 1175 ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationListResultPage.NextWithContext") 1176 defer func() { 1177 sc := -1 1178 if page.Response().Response.Response != nil { 1179 sc = page.Response().Response.Response.StatusCode 1180 } 1181 tracing.EndSpan(ctx, sc, err) 1182 }() 1183 } 1184 for { 1185 next, err := page.fn(ctx, page.crlr) 1186 if err != nil { 1187 return err 1188 } 1189 page.crlr = next 1190 if !next.hasNextLink() || !next.IsEmpty() { 1191 break 1192 } 1193 } 1194 return nil 1195} 1196 1197// Next advances to the next page of values. If there was an error making 1198// the request the page does not advance and the error is returned. 1199// Deprecated: Use NextWithContext() instead. 1200func (page *CapacityReservationListResultPage) Next() error { 1201 return page.NextWithContext(context.Background()) 1202} 1203 1204// NotDone returns true if the page enumeration should be started or is not yet complete. 1205func (page CapacityReservationListResultPage) NotDone() bool { 1206 return !page.crlr.IsEmpty() 1207} 1208 1209// Response returns the raw server response from the last page request. 1210func (page CapacityReservationListResultPage) Response() CapacityReservationListResult { 1211 return page.crlr 1212} 1213 1214// Values returns the slice of values for the current page or nil if there are no values. 1215func (page CapacityReservationListResultPage) Values() []CapacityReservation { 1216 if page.crlr.IsEmpty() { 1217 return nil 1218 } 1219 return *page.crlr.Value 1220} 1221 1222// Creates a new instance of the CapacityReservationListResultPage type. 1223func NewCapacityReservationListResultPage(cur CapacityReservationListResult, getNextPage func(context.Context, CapacityReservationListResult) (CapacityReservationListResult, error)) CapacityReservationListResultPage { 1224 return CapacityReservationListResultPage{ 1225 fn: getNextPage, 1226 crlr: cur, 1227 } 1228} 1229 1230// CapacityReservationProfile the parameters of a capacity reservation Profile. 1231type CapacityReservationProfile struct { 1232 // 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. 1233 CapacityReservationGroup *SubResource `json:"capacityReservationGroup,omitempty"` 1234} 1235 1236// CapacityReservationProperties properties of the Capacity reservation. 1237type CapacityReservationProperties struct { 1238 // 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. 1239 ReservationID *string `json:"reservationId,omitempty"` 1240 // VirtualMachinesAssociated - READ-ONLY; A list of all virtual machine resource ids that are associated with the capacity reservation. 1241 VirtualMachinesAssociated *[]SubResourceReadOnly `json:"virtualMachinesAssociated,omitempty"` 1242 // ProvisioningTime - READ-ONLY; The date time when the capacity reservation was last updated. 1243 ProvisioningTime *date.Time `json:"provisioningTime,omitempty"` 1244 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 1245 ProvisioningState *string `json:"provisioningState,omitempty"` 1246 // InstanceView - READ-ONLY; The Capacity reservation instance view. 1247 InstanceView *CapacityReservationInstanceView `json:"instanceView,omitempty"` 1248} 1249 1250// MarshalJSON is the custom marshaler for CapacityReservationProperties. 1251func (crp CapacityReservationProperties) MarshalJSON() ([]byte, error) { 1252 objectMap := make(map[string]interface{}) 1253 return json.Marshal(objectMap) 1254} 1255 1256// CapacityReservationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 1257// long-running operation. 1258type CapacityReservationsCreateOrUpdateFuture struct { 1259 azure.FutureAPI 1260 // Result returns the result of the asynchronous operation. 1261 // If the operation has not completed it will return an error. 1262 Result func(CapacityReservationsClient) (CapacityReservation, error) 1263} 1264 1265// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1266func (future *CapacityReservationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 1267 var azFuture azure.Future 1268 if err := json.Unmarshal(body, &azFuture); err != nil { 1269 return err 1270 } 1271 future.FutureAPI = &azFuture 1272 future.Result = future.result 1273 return nil 1274} 1275 1276// result is the default implementation for CapacityReservationsCreateOrUpdateFuture.Result. 1277func (future *CapacityReservationsCreateOrUpdateFuture) result(client CapacityReservationsClient) (cr CapacityReservation, err error) { 1278 var done bool 1279 done, err = future.DoneWithContext(context.Background(), client) 1280 if err != nil { 1281 err = autorest.NewErrorWithError(err, "compute.CapacityReservationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 1282 return 1283 } 1284 if !done { 1285 cr.Response.Response = future.Response() 1286 err = azure.NewAsyncOpIncompleteError("compute.CapacityReservationsCreateOrUpdateFuture") 1287 return 1288 } 1289 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1290 if cr.Response.Response, err = future.GetResult(sender); err == nil && cr.Response.Response.StatusCode != http.StatusNoContent { 1291 cr, err = client.CreateOrUpdateResponder(cr.Response.Response) 1292 if err != nil { 1293 err = autorest.NewErrorWithError(err, "compute.CapacityReservationsCreateOrUpdateFuture", "Result", cr.Response.Response, "Failure responding to request") 1294 } 1295 } 1296 return 1297} 1298 1299// CapacityReservationsDeleteFuture an abstraction for monitoring and retrieving the results of a 1300// long-running operation. 1301type CapacityReservationsDeleteFuture struct { 1302 azure.FutureAPI 1303 // Result returns the result of the asynchronous operation. 1304 // If the operation has not completed it will return an error. 1305 Result func(CapacityReservationsClient) (autorest.Response, error) 1306} 1307 1308// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1309func (future *CapacityReservationsDeleteFuture) UnmarshalJSON(body []byte) error { 1310 var azFuture azure.Future 1311 if err := json.Unmarshal(body, &azFuture); err != nil { 1312 return err 1313 } 1314 future.FutureAPI = &azFuture 1315 future.Result = future.result 1316 return nil 1317} 1318 1319// result is the default implementation for CapacityReservationsDeleteFuture.Result. 1320func (future *CapacityReservationsDeleteFuture) result(client CapacityReservationsClient) (ar autorest.Response, err error) { 1321 var done bool 1322 done, err = future.DoneWithContext(context.Background(), client) 1323 if err != nil { 1324 err = autorest.NewErrorWithError(err, "compute.CapacityReservationsDeleteFuture", "Result", future.Response(), "Polling failure") 1325 return 1326 } 1327 if !done { 1328 ar.Response = future.Response() 1329 err = azure.NewAsyncOpIncompleteError("compute.CapacityReservationsDeleteFuture") 1330 return 1331 } 1332 ar.Response = future.Response() 1333 return 1334} 1335 1336// CapacityReservationsUpdateFuture an abstraction for monitoring and retrieving the results of a 1337// long-running operation. 1338type CapacityReservationsUpdateFuture struct { 1339 azure.FutureAPI 1340 // Result returns the result of the asynchronous operation. 1341 // If the operation has not completed it will return an error. 1342 Result func(CapacityReservationsClient) (CapacityReservation, error) 1343} 1344 1345// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1346func (future *CapacityReservationsUpdateFuture) UnmarshalJSON(body []byte) error { 1347 var azFuture azure.Future 1348 if err := json.Unmarshal(body, &azFuture); err != nil { 1349 return err 1350 } 1351 future.FutureAPI = &azFuture 1352 future.Result = future.result 1353 return nil 1354} 1355 1356// result is the default implementation for CapacityReservationsUpdateFuture.Result. 1357func (future *CapacityReservationsUpdateFuture) result(client CapacityReservationsClient) (cr CapacityReservation, err error) { 1358 var done bool 1359 done, err = future.DoneWithContext(context.Background(), client) 1360 if err != nil { 1361 err = autorest.NewErrorWithError(err, "compute.CapacityReservationsUpdateFuture", "Result", future.Response(), "Polling failure") 1362 return 1363 } 1364 if !done { 1365 cr.Response.Response = future.Response() 1366 err = azure.NewAsyncOpIncompleteError("compute.CapacityReservationsUpdateFuture") 1367 return 1368 } 1369 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1370 if cr.Response.Response, err = future.GetResult(sender); err == nil && cr.Response.Response.StatusCode != http.StatusNoContent { 1371 cr, err = client.UpdateResponder(cr.Response.Response) 1372 if err != nil { 1373 err = autorest.NewErrorWithError(err, "compute.CapacityReservationsUpdateFuture", "Result", cr.Response.Response, "Failure responding to request") 1374 } 1375 } 1376 return 1377} 1378 1379// CapacityReservationUpdate specifies information about the capacity reservation. Only tags and 1380// sku.capacity can be updated. 1381type CapacityReservationUpdate struct { 1382 *CapacityReservationProperties `json:"properties,omitempty"` 1383 // 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. 1384 Sku *Sku `json:"sku,omitempty"` 1385 // Tags - Resource tags 1386 Tags map[string]*string `json:"tags"` 1387} 1388 1389// MarshalJSON is the custom marshaler for CapacityReservationUpdate. 1390func (cru CapacityReservationUpdate) MarshalJSON() ([]byte, error) { 1391 objectMap := make(map[string]interface{}) 1392 if cru.CapacityReservationProperties != nil { 1393 objectMap["properties"] = cru.CapacityReservationProperties 1394 } 1395 if cru.Sku != nil { 1396 objectMap["sku"] = cru.Sku 1397 } 1398 if cru.Tags != nil { 1399 objectMap["tags"] = cru.Tags 1400 } 1401 return json.Marshal(objectMap) 1402} 1403 1404// UnmarshalJSON is the custom unmarshaler for CapacityReservationUpdate struct. 1405func (cru *CapacityReservationUpdate) UnmarshalJSON(body []byte) error { 1406 var m map[string]*json.RawMessage 1407 err := json.Unmarshal(body, &m) 1408 if err != nil { 1409 return err 1410 } 1411 for k, v := range m { 1412 switch k { 1413 case "properties": 1414 if v != nil { 1415 var capacityReservationProperties CapacityReservationProperties 1416 err = json.Unmarshal(*v, &capacityReservationProperties) 1417 if err != nil { 1418 return err 1419 } 1420 cru.CapacityReservationProperties = &capacityReservationProperties 1421 } 1422 case "sku": 1423 if v != nil { 1424 var sku Sku 1425 err = json.Unmarshal(*v, &sku) 1426 if err != nil { 1427 return err 1428 } 1429 cru.Sku = &sku 1430 } 1431 case "tags": 1432 if v != nil { 1433 var tags map[string]*string 1434 err = json.Unmarshal(*v, &tags) 1435 if err != nil { 1436 return err 1437 } 1438 cru.Tags = tags 1439 } 1440 } 1441 } 1442 1443 return nil 1444} 1445 1446// CapacityReservationUtilization represents the capacity reservation utilization in terms of resources 1447// allocated. 1448type CapacityReservationUtilization struct { 1449 // VirtualMachinesAllocated - READ-ONLY; A list of all virtual machines resource ids allocated against the capacity reservation. 1450 VirtualMachinesAllocated *[]SubResourceReadOnly `json:"virtualMachinesAllocated,omitempty"` 1451} 1452 1453// MarshalJSON is the custom marshaler for CapacityReservationUtilization. 1454func (cru CapacityReservationUtilization) MarshalJSON() ([]byte, error) { 1455 objectMap := make(map[string]interface{}) 1456 return json.Marshal(objectMap) 1457} 1458 1459// CloudError an error response from the Compute service. 1460type CloudError struct { 1461 Error *APIError `json:"error,omitempty"` 1462} 1463 1464// CloudService describes the cloud service. 1465type CloudService struct { 1466 autorest.Response `json:"-"` 1467 // ID - READ-ONLY; Resource Id. 1468 ID *string `json:"id,omitempty"` 1469 // Name - READ-ONLY; Resource name. 1470 Name *string `json:"name,omitempty"` 1471 // Type - READ-ONLY; Resource type. 1472 Type *string `json:"type,omitempty"` 1473 // Location - Resource location. 1474 Location *string `json:"location,omitempty"` 1475 // Tags - Resource tags. 1476 Tags map[string]*string `json:"tags"` 1477 Properties *CloudServiceProperties `json:"properties,omitempty"` 1478} 1479 1480// MarshalJSON is the custom marshaler for CloudService. 1481func (cs CloudService) MarshalJSON() ([]byte, error) { 1482 objectMap := make(map[string]interface{}) 1483 if cs.Location != nil { 1484 objectMap["location"] = cs.Location 1485 } 1486 if cs.Tags != nil { 1487 objectMap["tags"] = cs.Tags 1488 } 1489 if cs.Properties != nil { 1490 objectMap["properties"] = cs.Properties 1491 } 1492 return json.Marshal(objectMap) 1493} 1494 1495// CloudServiceExtensionProfile describes a cloud service extension profile. 1496type CloudServiceExtensionProfile struct { 1497 // Extensions - List of extensions for the cloud service. 1498 Extensions *[]Extension `json:"extensions,omitempty"` 1499} 1500 1501// CloudServiceExtensionProperties extension Properties. 1502type CloudServiceExtensionProperties struct { 1503 // Publisher - The name of the extension handler publisher. 1504 Publisher *string `json:"publisher,omitempty"` 1505 // Type - Specifies the type of the extension. 1506 Type *string `json:"type,omitempty"` 1507 // 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. 1508 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 1509 // AutoUpgradeMinorVersion - Explicitly specify whether platform can automatically upgrade typeHandlerVersion to higher minor versions when they become available. 1510 AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` 1511 // 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. 1512 Settings *string `json:"settings,omitempty"` 1513 // ProtectedSettings - Protected settings for the extension which are encrypted before sent to the role instance. 1514 ProtectedSettings *string `json:"protectedSettings,omitempty"` 1515 ProtectedSettingsFromKeyVault *CloudServiceVaultAndSecretReference `json:"protectedSettingsFromKeyVault,omitempty"` 1516 // ForceUpdateTag - Tag to force apply the provided public and protected settings. 1517 // Changing the tag value allows for re-running the extension without changing any of the public or protected settings. 1518 // If forceUpdateTag is not changed, updates to public or protected settings would still be applied by the handler. 1519 // If neither forceUpdateTag nor any of public or protected settings change, extension would flow to the role instance with the same sequence-number, and 1520 // it is up to handler implementation whether to re-run it or not 1521 ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` 1522 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 1523 ProvisioningState *string `json:"provisioningState,omitempty"` 1524 // 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. 1525 RolesAppliedTo *[]string `json:"rolesAppliedTo,omitempty"` 1526} 1527 1528// MarshalJSON is the custom marshaler for CloudServiceExtensionProperties. 1529func (csep CloudServiceExtensionProperties) MarshalJSON() ([]byte, error) { 1530 objectMap := make(map[string]interface{}) 1531 if csep.Publisher != nil { 1532 objectMap["publisher"] = csep.Publisher 1533 } 1534 if csep.Type != nil { 1535 objectMap["type"] = csep.Type 1536 } 1537 if csep.TypeHandlerVersion != nil { 1538 objectMap["typeHandlerVersion"] = csep.TypeHandlerVersion 1539 } 1540 if csep.AutoUpgradeMinorVersion != nil { 1541 objectMap["autoUpgradeMinorVersion"] = csep.AutoUpgradeMinorVersion 1542 } 1543 if csep.Settings != nil { 1544 objectMap["settings"] = csep.Settings 1545 } 1546 if csep.ProtectedSettings != nil { 1547 objectMap["protectedSettings"] = csep.ProtectedSettings 1548 } 1549 if csep.ProtectedSettingsFromKeyVault != nil { 1550 objectMap["protectedSettingsFromKeyVault"] = csep.ProtectedSettingsFromKeyVault 1551 } 1552 if csep.ForceUpdateTag != nil { 1553 objectMap["forceUpdateTag"] = csep.ForceUpdateTag 1554 } 1555 if csep.RolesAppliedTo != nil { 1556 objectMap["rolesAppliedTo"] = csep.RolesAppliedTo 1557 } 1558 return json.Marshal(objectMap) 1559} 1560 1561// CloudServiceInstanceView instanceView of CloudService as a whole 1562type CloudServiceInstanceView struct { 1563 autorest.Response `json:"-"` 1564 RoleInstance *InstanceViewStatusesSummary `json:"roleInstance,omitempty"` 1565 // SdkVersion - READ-ONLY; The version of the SDK that was used to generate the package for the cloud service. 1566 SdkVersion *string `json:"sdkVersion,omitempty"` 1567 // 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. 1568 PrivateIds *[]string `json:"privateIds,omitempty"` 1569 // Statuses - READ-ONLY 1570 Statuses *[]ResourceInstanceViewStatus `json:"statuses,omitempty"` 1571} 1572 1573// MarshalJSON is the custom marshaler for CloudServiceInstanceView. 1574func (csiv CloudServiceInstanceView) MarshalJSON() ([]byte, error) { 1575 objectMap := make(map[string]interface{}) 1576 if csiv.RoleInstance != nil { 1577 objectMap["roleInstance"] = csiv.RoleInstance 1578 } 1579 return json.Marshal(objectMap) 1580} 1581 1582// CloudServiceListResult ... 1583type CloudServiceListResult struct { 1584 autorest.Response `json:"-"` 1585 Value *[]CloudService `json:"value,omitempty"` 1586 NextLink *string `json:"nextLink,omitempty"` 1587} 1588 1589// CloudServiceListResultIterator provides access to a complete listing of CloudService values. 1590type CloudServiceListResultIterator struct { 1591 i int 1592 page CloudServiceListResultPage 1593} 1594 1595// NextWithContext advances to the next value. If there was an error making 1596// the request the iterator does not advance and the error is returned. 1597func (iter *CloudServiceListResultIterator) NextWithContext(ctx context.Context) (err error) { 1598 if tracing.IsEnabled() { 1599 ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceListResultIterator.NextWithContext") 1600 defer func() { 1601 sc := -1 1602 if iter.Response().Response.Response != nil { 1603 sc = iter.Response().Response.Response.StatusCode 1604 } 1605 tracing.EndSpan(ctx, sc, err) 1606 }() 1607 } 1608 iter.i++ 1609 if iter.i < len(iter.page.Values()) { 1610 return nil 1611 } 1612 err = iter.page.NextWithContext(ctx) 1613 if err != nil { 1614 iter.i-- 1615 return err 1616 } 1617 iter.i = 0 1618 return nil 1619} 1620 1621// Next advances to the next value. If there was an error making 1622// the request the iterator does not advance and the error is returned. 1623// Deprecated: Use NextWithContext() instead. 1624func (iter *CloudServiceListResultIterator) Next() error { 1625 return iter.NextWithContext(context.Background()) 1626} 1627 1628// NotDone returns true if the enumeration should be started or is not yet complete. 1629func (iter CloudServiceListResultIterator) NotDone() bool { 1630 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1631} 1632 1633// Response returns the raw server response from the last page request. 1634func (iter CloudServiceListResultIterator) Response() CloudServiceListResult { 1635 return iter.page.Response() 1636} 1637 1638// Value returns the current value or a zero-initialized value if the 1639// iterator has advanced beyond the end of the collection. 1640func (iter CloudServiceListResultIterator) Value() CloudService { 1641 if !iter.page.NotDone() { 1642 return CloudService{} 1643 } 1644 return iter.page.Values()[iter.i] 1645} 1646 1647// Creates a new instance of the CloudServiceListResultIterator type. 1648func NewCloudServiceListResultIterator(page CloudServiceListResultPage) CloudServiceListResultIterator { 1649 return CloudServiceListResultIterator{page: page} 1650} 1651 1652// IsEmpty returns true if the ListResult contains no values. 1653func (cslr CloudServiceListResult) IsEmpty() bool { 1654 return cslr.Value == nil || len(*cslr.Value) == 0 1655} 1656 1657// hasNextLink returns true if the NextLink is not empty. 1658func (cslr CloudServiceListResult) hasNextLink() bool { 1659 return cslr.NextLink != nil && len(*cslr.NextLink) != 0 1660} 1661 1662// cloudServiceListResultPreparer prepares a request to retrieve the next set of results. 1663// It returns nil if no more results exist. 1664func (cslr CloudServiceListResult) cloudServiceListResultPreparer(ctx context.Context) (*http.Request, error) { 1665 if !cslr.hasNextLink() { 1666 return nil, nil 1667 } 1668 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1669 autorest.AsJSON(), 1670 autorest.AsGet(), 1671 autorest.WithBaseURL(to.String(cslr.NextLink))) 1672} 1673 1674// CloudServiceListResultPage contains a page of CloudService values. 1675type CloudServiceListResultPage struct { 1676 fn func(context.Context, CloudServiceListResult) (CloudServiceListResult, error) 1677 cslr CloudServiceListResult 1678} 1679 1680// NextWithContext advances to the next page of values. If there was an error making 1681// the request the page does not advance and the error is returned. 1682func (page *CloudServiceListResultPage) NextWithContext(ctx context.Context) (err error) { 1683 if tracing.IsEnabled() { 1684 ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceListResultPage.NextWithContext") 1685 defer func() { 1686 sc := -1 1687 if page.Response().Response.Response != nil { 1688 sc = page.Response().Response.Response.StatusCode 1689 } 1690 tracing.EndSpan(ctx, sc, err) 1691 }() 1692 } 1693 for { 1694 next, err := page.fn(ctx, page.cslr) 1695 if err != nil { 1696 return err 1697 } 1698 page.cslr = next 1699 if !next.hasNextLink() || !next.IsEmpty() { 1700 break 1701 } 1702 } 1703 return nil 1704} 1705 1706// Next advances to the next page of values. If there was an error making 1707// the request the page does not advance and the error is returned. 1708// Deprecated: Use NextWithContext() instead. 1709func (page *CloudServiceListResultPage) Next() error { 1710 return page.NextWithContext(context.Background()) 1711} 1712 1713// NotDone returns true if the page enumeration should be started or is not yet complete. 1714func (page CloudServiceListResultPage) NotDone() bool { 1715 return !page.cslr.IsEmpty() 1716} 1717 1718// Response returns the raw server response from the last page request. 1719func (page CloudServiceListResultPage) Response() CloudServiceListResult { 1720 return page.cslr 1721} 1722 1723// Values returns the slice of values for the current page or nil if there are no values. 1724func (page CloudServiceListResultPage) Values() []CloudService { 1725 if page.cslr.IsEmpty() { 1726 return nil 1727 } 1728 return *page.cslr.Value 1729} 1730 1731// Creates a new instance of the CloudServiceListResultPage type. 1732func NewCloudServiceListResultPage(cur CloudServiceListResult, getNextPage func(context.Context, CloudServiceListResult) (CloudServiceListResult, error)) CloudServiceListResultPage { 1733 return CloudServiceListResultPage{ 1734 fn: getNextPage, 1735 cslr: cur, 1736 } 1737} 1738 1739// CloudServiceNetworkProfile network Profile for the cloud service. 1740type CloudServiceNetworkProfile struct { 1741 // 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. 1742 LoadBalancerConfigurations *[]LoadBalancerConfiguration `json:"loadBalancerConfigurations,omitempty"` 1743 // 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. 1744 SwappableCloudService *SubResource `json:"swappableCloudService,omitempty"` 1745} 1746 1747// CloudServiceOsProfile describes the OS profile for the cloud service. 1748type CloudServiceOsProfile struct { 1749 // Secrets - Specifies set of certificates that should be installed onto the role instances. 1750 Secrets *[]CloudServiceVaultSecretGroup `json:"secrets,omitempty"` 1751} 1752 1753// CloudServiceProperties cloud service properties 1754type CloudServiceProperties struct { 1755 // 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. 1756 // This is a write-only property and is not returned in GET calls. 1757 PackageURL *string `json:"packageUrl,omitempty"` 1758 // Configuration - Specifies the XML service configuration (.cscfg) for the cloud service. 1759 Configuration *string `json:"configuration,omitempty"` 1760 // 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. 1761 // This is a write-only property and is not returned in GET calls. 1762 ConfigurationURL *string `json:"configurationUrl,omitempty"` 1763 // StartCloudService - (Optional) Indicates whether to start the cloud service immediately after it is created. The default value is `true`. 1764 // 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. 1765 StartCloudService *bool `json:"startCloudService,omitempty"` 1766 // 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. 1767 // The default value is `false`. 1768 AllowModelOverride *bool `json:"allowModelOverride,omitempty"` 1769 // UpgradeMode - Possible values include: 'CloudServiceUpgradeModeAuto', 'CloudServiceUpgradeModeManual', 'CloudServiceUpgradeModeSimultaneous' 1770 UpgradeMode CloudServiceUpgradeMode `json:"upgradeMode,omitempty"` 1771 RoleProfile *CloudServiceRoleProfile `json:"roleProfile,omitempty"` 1772 OsProfile *CloudServiceOsProfile `json:"osProfile,omitempty"` 1773 NetworkProfile *CloudServiceNetworkProfile `json:"networkProfile,omitempty"` 1774 ExtensionProfile *CloudServiceExtensionProfile `json:"extensionProfile,omitempty"` 1775 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 1776 ProvisioningState *string `json:"provisioningState,omitempty"` 1777 // UniqueID - READ-ONLY; The unique identifier for the cloud service. 1778 UniqueID *string `json:"uniqueId,omitempty"` 1779} 1780 1781// MarshalJSON is the custom marshaler for CloudServiceProperties. 1782func (csp CloudServiceProperties) MarshalJSON() ([]byte, error) { 1783 objectMap := make(map[string]interface{}) 1784 if csp.PackageURL != nil { 1785 objectMap["packageUrl"] = csp.PackageURL 1786 } 1787 if csp.Configuration != nil { 1788 objectMap["configuration"] = csp.Configuration 1789 } 1790 if csp.ConfigurationURL != nil { 1791 objectMap["configurationUrl"] = csp.ConfigurationURL 1792 } 1793 if csp.StartCloudService != nil { 1794 objectMap["startCloudService"] = csp.StartCloudService 1795 } 1796 if csp.AllowModelOverride != nil { 1797 objectMap["allowModelOverride"] = csp.AllowModelOverride 1798 } 1799 if csp.UpgradeMode != "" { 1800 objectMap["upgradeMode"] = csp.UpgradeMode 1801 } 1802 if csp.RoleProfile != nil { 1803 objectMap["roleProfile"] = csp.RoleProfile 1804 } 1805 if csp.OsProfile != nil { 1806 objectMap["osProfile"] = csp.OsProfile 1807 } 1808 if csp.NetworkProfile != nil { 1809 objectMap["networkProfile"] = csp.NetworkProfile 1810 } 1811 if csp.ExtensionProfile != nil { 1812 objectMap["extensionProfile"] = csp.ExtensionProfile 1813 } 1814 return json.Marshal(objectMap) 1815} 1816 1817// CloudServiceRole describes a role of the cloud service. 1818type CloudServiceRole struct { 1819 autorest.Response `json:"-"` 1820 // ID - READ-ONLY; Resource id 1821 ID *string `json:"id,omitempty"` 1822 // Name - READ-ONLY; Resource name 1823 Name *string `json:"name,omitempty"` 1824 // Type - READ-ONLY; Resource type 1825 Type *string `json:"type,omitempty"` 1826 // Location - READ-ONLY; Resource location 1827 Location *string `json:"location,omitempty"` 1828 Sku *CloudServiceRoleSku `json:"sku,omitempty"` 1829 Properties *CloudServiceRoleProperties `json:"properties,omitempty"` 1830} 1831 1832// MarshalJSON is the custom marshaler for CloudServiceRole. 1833func (csr CloudServiceRole) MarshalJSON() ([]byte, error) { 1834 objectMap := make(map[string]interface{}) 1835 if csr.Sku != nil { 1836 objectMap["sku"] = csr.Sku 1837 } 1838 if csr.Properties != nil { 1839 objectMap["properties"] = csr.Properties 1840 } 1841 return json.Marshal(objectMap) 1842} 1843 1844// CloudServiceRoleInstancesDeleteFuture an abstraction for monitoring and retrieving the results of a 1845// long-running operation. 1846type CloudServiceRoleInstancesDeleteFuture struct { 1847 azure.FutureAPI 1848 // Result returns the result of the asynchronous operation. 1849 // If the operation has not completed it will return an error. 1850 Result func(CloudServiceRoleInstancesClient) (autorest.Response, error) 1851} 1852 1853// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1854func (future *CloudServiceRoleInstancesDeleteFuture) UnmarshalJSON(body []byte) error { 1855 var azFuture azure.Future 1856 if err := json.Unmarshal(body, &azFuture); err != nil { 1857 return err 1858 } 1859 future.FutureAPI = &azFuture 1860 future.Result = future.result 1861 return nil 1862} 1863 1864// result is the default implementation for CloudServiceRoleInstancesDeleteFuture.Result. 1865func (future *CloudServiceRoleInstancesDeleteFuture) result(client CloudServiceRoleInstancesClient) (ar autorest.Response, err error) { 1866 var done bool 1867 done, err = future.DoneWithContext(context.Background(), client) 1868 if err != nil { 1869 err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesDeleteFuture", "Result", future.Response(), "Polling failure") 1870 return 1871 } 1872 if !done { 1873 ar.Response = future.Response() 1874 err = azure.NewAsyncOpIncompleteError("compute.CloudServiceRoleInstancesDeleteFuture") 1875 return 1876 } 1877 ar.Response = future.Response() 1878 return 1879} 1880 1881// CloudServiceRoleInstancesRebuildFuture an abstraction for monitoring and retrieving the results of a 1882// long-running operation. 1883type CloudServiceRoleInstancesRebuildFuture struct { 1884 azure.FutureAPI 1885 // Result returns the result of the asynchronous operation. 1886 // If the operation has not completed it will return an error. 1887 Result func(CloudServiceRoleInstancesClient) (autorest.Response, error) 1888} 1889 1890// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1891func (future *CloudServiceRoleInstancesRebuildFuture) UnmarshalJSON(body []byte) error { 1892 var azFuture azure.Future 1893 if err := json.Unmarshal(body, &azFuture); err != nil { 1894 return err 1895 } 1896 future.FutureAPI = &azFuture 1897 future.Result = future.result 1898 return nil 1899} 1900 1901// result is the default implementation for CloudServiceRoleInstancesRebuildFuture.Result. 1902func (future *CloudServiceRoleInstancesRebuildFuture) result(client CloudServiceRoleInstancesClient) (ar autorest.Response, err error) { 1903 var done bool 1904 done, err = future.DoneWithContext(context.Background(), client) 1905 if err != nil { 1906 err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesRebuildFuture", "Result", future.Response(), "Polling failure") 1907 return 1908 } 1909 if !done { 1910 ar.Response = future.Response() 1911 err = azure.NewAsyncOpIncompleteError("compute.CloudServiceRoleInstancesRebuildFuture") 1912 return 1913 } 1914 ar.Response = future.Response() 1915 return 1916} 1917 1918// CloudServiceRoleInstancesReimageFuture an abstraction for monitoring and retrieving the results of a 1919// long-running operation. 1920type CloudServiceRoleInstancesReimageFuture struct { 1921 azure.FutureAPI 1922 // Result returns the result of the asynchronous operation. 1923 // If the operation has not completed it will return an error. 1924 Result func(CloudServiceRoleInstancesClient) (autorest.Response, error) 1925} 1926 1927// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1928func (future *CloudServiceRoleInstancesReimageFuture) UnmarshalJSON(body []byte) error { 1929 var azFuture azure.Future 1930 if err := json.Unmarshal(body, &azFuture); err != nil { 1931 return err 1932 } 1933 future.FutureAPI = &azFuture 1934 future.Result = future.result 1935 return nil 1936} 1937 1938// result is the default implementation for CloudServiceRoleInstancesReimageFuture.Result. 1939func (future *CloudServiceRoleInstancesReimageFuture) result(client CloudServiceRoleInstancesClient) (ar autorest.Response, err error) { 1940 var done bool 1941 done, err = future.DoneWithContext(context.Background(), client) 1942 if err != nil { 1943 err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesReimageFuture", "Result", future.Response(), "Polling failure") 1944 return 1945 } 1946 if !done { 1947 ar.Response = future.Response() 1948 err = azure.NewAsyncOpIncompleteError("compute.CloudServiceRoleInstancesReimageFuture") 1949 return 1950 } 1951 ar.Response = future.Response() 1952 return 1953} 1954 1955// CloudServiceRoleInstancesRestartFuture an abstraction for monitoring and retrieving the results of a 1956// long-running operation. 1957type CloudServiceRoleInstancesRestartFuture struct { 1958 azure.FutureAPI 1959 // Result returns the result of the asynchronous operation. 1960 // If the operation has not completed it will return an error. 1961 Result func(CloudServiceRoleInstancesClient) (autorest.Response, error) 1962} 1963 1964// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1965func (future *CloudServiceRoleInstancesRestartFuture) UnmarshalJSON(body []byte) error { 1966 var azFuture azure.Future 1967 if err := json.Unmarshal(body, &azFuture); err != nil { 1968 return err 1969 } 1970 future.FutureAPI = &azFuture 1971 future.Result = future.result 1972 return nil 1973} 1974 1975// result is the default implementation for CloudServiceRoleInstancesRestartFuture.Result. 1976func (future *CloudServiceRoleInstancesRestartFuture) result(client CloudServiceRoleInstancesClient) (ar autorest.Response, err error) { 1977 var done bool 1978 done, err = future.DoneWithContext(context.Background(), client) 1979 if err != nil { 1980 err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesRestartFuture", "Result", future.Response(), "Polling failure") 1981 return 1982 } 1983 if !done { 1984 ar.Response = future.Response() 1985 err = azure.NewAsyncOpIncompleteError("compute.CloudServiceRoleInstancesRestartFuture") 1986 return 1987 } 1988 ar.Response = future.Response() 1989 return 1990} 1991 1992// CloudServiceRoleListResult ... 1993type CloudServiceRoleListResult struct { 1994 autorest.Response `json:"-"` 1995 Value *[]CloudServiceRole `json:"value,omitempty"` 1996 NextLink *string `json:"nextLink,omitempty"` 1997} 1998 1999// CloudServiceRoleListResultIterator provides access to a complete listing of CloudServiceRole values. 2000type CloudServiceRoleListResultIterator struct { 2001 i int 2002 page CloudServiceRoleListResultPage 2003} 2004 2005// NextWithContext advances to the next value. If there was an error making 2006// the request the iterator does not advance and the error is returned. 2007func (iter *CloudServiceRoleListResultIterator) NextWithContext(ctx context.Context) (err error) { 2008 if tracing.IsEnabled() { 2009 ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleListResultIterator.NextWithContext") 2010 defer func() { 2011 sc := -1 2012 if iter.Response().Response.Response != nil { 2013 sc = iter.Response().Response.Response.StatusCode 2014 } 2015 tracing.EndSpan(ctx, sc, err) 2016 }() 2017 } 2018 iter.i++ 2019 if iter.i < len(iter.page.Values()) { 2020 return nil 2021 } 2022 err = iter.page.NextWithContext(ctx) 2023 if err != nil { 2024 iter.i-- 2025 return err 2026 } 2027 iter.i = 0 2028 return nil 2029} 2030 2031// Next advances to the next value. If there was an error making 2032// the request the iterator does not advance and the error is returned. 2033// Deprecated: Use NextWithContext() instead. 2034func (iter *CloudServiceRoleListResultIterator) Next() error { 2035 return iter.NextWithContext(context.Background()) 2036} 2037 2038// NotDone returns true if the enumeration should be started or is not yet complete. 2039func (iter CloudServiceRoleListResultIterator) NotDone() bool { 2040 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2041} 2042 2043// Response returns the raw server response from the last page request. 2044func (iter CloudServiceRoleListResultIterator) Response() CloudServiceRoleListResult { 2045 return iter.page.Response() 2046} 2047 2048// Value returns the current value or a zero-initialized value if the 2049// iterator has advanced beyond the end of the collection. 2050func (iter CloudServiceRoleListResultIterator) Value() CloudServiceRole { 2051 if !iter.page.NotDone() { 2052 return CloudServiceRole{} 2053 } 2054 return iter.page.Values()[iter.i] 2055} 2056 2057// Creates a new instance of the CloudServiceRoleListResultIterator type. 2058func NewCloudServiceRoleListResultIterator(page CloudServiceRoleListResultPage) CloudServiceRoleListResultIterator { 2059 return CloudServiceRoleListResultIterator{page: page} 2060} 2061 2062// IsEmpty returns true if the ListResult contains no values. 2063func (csrlr CloudServiceRoleListResult) IsEmpty() bool { 2064 return csrlr.Value == nil || len(*csrlr.Value) == 0 2065} 2066 2067// hasNextLink returns true if the NextLink is not empty. 2068func (csrlr CloudServiceRoleListResult) hasNextLink() bool { 2069 return csrlr.NextLink != nil && len(*csrlr.NextLink) != 0 2070} 2071 2072// cloudServiceRoleListResultPreparer prepares a request to retrieve the next set of results. 2073// It returns nil if no more results exist. 2074func (csrlr CloudServiceRoleListResult) cloudServiceRoleListResultPreparer(ctx context.Context) (*http.Request, error) { 2075 if !csrlr.hasNextLink() { 2076 return nil, nil 2077 } 2078 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2079 autorest.AsJSON(), 2080 autorest.AsGet(), 2081 autorest.WithBaseURL(to.String(csrlr.NextLink))) 2082} 2083 2084// CloudServiceRoleListResultPage contains a page of CloudServiceRole values. 2085type CloudServiceRoleListResultPage struct { 2086 fn func(context.Context, CloudServiceRoleListResult) (CloudServiceRoleListResult, error) 2087 csrlr CloudServiceRoleListResult 2088} 2089 2090// NextWithContext advances to the next page of values. If there was an error making 2091// the request the page does not advance and the error is returned. 2092func (page *CloudServiceRoleListResultPage) NextWithContext(ctx context.Context) (err error) { 2093 if tracing.IsEnabled() { 2094 ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleListResultPage.NextWithContext") 2095 defer func() { 2096 sc := -1 2097 if page.Response().Response.Response != nil { 2098 sc = page.Response().Response.Response.StatusCode 2099 } 2100 tracing.EndSpan(ctx, sc, err) 2101 }() 2102 } 2103 for { 2104 next, err := page.fn(ctx, page.csrlr) 2105 if err != nil { 2106 return err 2107 } 2108 page.csrlr = next 2109 if !next.hasNextLink() || !next.IsEmpty() { 2110 break 2111 } 2112 } 2113 return nil 2114} 2115 2116// Next advances to the next page of values. If there was an error making 2117// the request the page does not advance and the error is returned. 2118// Deprecated: Use NextWithContext() instead. 2119func (page *CloudServiceRoleListResultPage) Next() error { 2120 return page.NextWithContext(context.Background()) 2121} 2122 2123// NotDone returns true if the page enumeration should be started or is not yet complete. 2124func (page CloudServiceRoleListResultPage) NotDone() bool { 2125 return !page.csrlr.IsEmpty() 2126} 2127 2128// Response returns the raw server response from the last page request. 2129func (page CloudServiceRoleListResultPage) Response() CloudServiceRoleListResult { 2130 return page.csrlr 2131} 2132 2133// Values returns the slice of values for the current page or nil if there are no values. 2134func (page CloudServiceRoleListResultPage) Values() []CloudServiceRole { 2135 if page.csrlr.IsEmpty() { 2136 return nil 2137 } 2138 return *page.csrlr.Value 2139} 2140 2141// Creates a new instance of the CloudServiceRoleListResultPage type. 2142func NewCloudServiceRoleListResultPage(cur CloudServiceRoleListResult, getNextPage func(context.Context, CloudServiceRoleListResult) (CloudServiceRoleListResult, error)) CloudServiceRoleListResultPage { 2143 return CloudServiceRoleListResultPage{ 2144 fn: getNextPage, 2145 csrlr: cur, 2146 } 2147} 2148 2149// CloudServiceRoleProfile describes the role profile for the cloud service. 2150type CloudServiceRoleProfile struct { 2151 // Roles - List of roles for the cloud service. 2152 Roles *[]CloudServiceRoleProfileProperties `json:"roles,omitempty"` 2153} 2154 2155// CloudServiceRoleProfileProperties describes the role properties. 2156type CloudServiceRoleProfileProperties struct { 2157 // Name - Resource name. 2158 Name *string `json:"name,omitempty"` 2159 Sku *CloudServiceRoleSku `json:"sku,omitempty"` 2160} 2161 2162// CloudServiceRoleProperties ... 2163type CloudServiceRoleProperties struct { 2164 // UniqueID - READ-ONLY; Specifies the ID which uniquely identifies a cloud service role. 2165 UniqueID *string `json:"uniqueId,omitempty"` 2166} 2167 2168// MarshalJSON is the custom marshaler for CloudServiceRoleProperties. 2169func (csrp CloudServiceRoleProperties) MarshalJSON() ([]byte, error) { 2170 objectMap := make(map[string]interface{}) 2171 return json.Marshal(objectMap) 2172} 2173 2174// CloudServiceRoleSku describes the cloud service role sku. 2175type CloudServiceRoleSku struct { 2176 // 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. 2177 Name *string `json:"name,omitempty"` 2178 // Tier - Specifies the tier of the cloud service. Possible Values are <br /><br /> **Standard** <br /><br /> **Basic** 2179 Tier *string `json:"tier,omitempty"` 2180 // Capacity - Specifies the number of role instances in the cloud service. 2181 Capacity *int64 `json:"capacity,omitempty"` 2182} 2183 2184// CloudServicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 2185// long-running operation. 2186type CloudServicesCreateOrUpdateFuture struct { 2187 azure.FutureAPI 2188 // Result returns the result of the asynchronous operation. 2189 // If the operation has not completed it will return an error. 2190 Result func(CloudServicesClient) (CloudService, error) 2191} 2192 2193// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2194func (future *CloudServicesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 2195 var azFuture azure.Future 2196 if err := json.Unmarshal(body, &azFuture); err != nil { 2197 return err 2198 } 2199 future.FutureAPI = &azFuture 2200 future.Result = future.result 2201 return nil 2202} 2203 2204// result is the default implementation for CloudServicesCreateOrUpdateFuture.Result. 2205func (future *CloudServicesCreateOrUpdateFuture) result(client CloudServicesClient) (cs CloudService, err error) { 2206 var done bool 2207 done, err = future.DoneWithContext(context.Background(), client) 2208 if err != nil { 2209 err = autorest.NewErrorWithError(err, "compute.CloudServicesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 2210 return 2211 } 2212 if !done { 2213 cs.Response.Response = future.Response() 2214 err = azure.NewAsyncOpIncompleteError("compute.CloudServicesCreateOrUpdateFuture") 2215 return 2216 } 2217 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2218 if cs.Response.Response, err = future.GetResult(sender); err == nil && cs.Response.Response.StatusCode != http.StatusNoContent { 2219 cs, err = client.CreateOrUpdateResponder(cs.Response.Response) 2220 if err != nil { 2221 err = autorest.NewErrorWithError(err, "compute.CloudServicesCreateOrUpdateFuture", "Result", cs.Response.Response, "Failure responding to request") 2222 } 2223 } 2224 return 2225} 2226 2227// CloudServicesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 2228// operation. 2229type CloudServicesDeleteFuture struct { 2230 azure.FutureAPI 2231 // Result returns the result of the asynchronous operation. 2232 // If the operation has not completed it will return an error. 2233 Result func(CloudServicesClient) (autorest.Response, error) 2234} 2235 2236// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2237func (future *CloudServicesDeleteFuture) UnmarshalJSON(body []byte) error { 2238 var azFuture azure.Future 2239 if err := json.Unmarshal(body, &azFuture); err != nil { 2240 return err 2241 } 2242 future.FutureAPI = &azFuture 2243 future.Result = future.result 2244 return nil 2245} 2246 2247// result is the default implementation for CloudServicesDeleteFuture.Result. 2248func (future *CloudServicesDeleteFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { 2249 var done bool 2250 done, err = future.DoneWithContext(context.Background(), client) 2251 if err != nil { 2252 err = autorest.NewErrorWithError(err, "compute.CloudServicesDeleteFuture", "Result", future.Response(), "Polling failure") 2253 return 2254 } 2255 if !done { 2256 ar.Response = future.Response() 2257 err = azure.NewAsyncOpIncompleteError("compute.CloudServicesDeleteFuture") 2258 return 2259 } 2260 ar.Response = future.Response() 2261 return 2262} 2263 2264// CloudServicesDeleteInstancesFuture an abstraction for monitoring and retrieving the results of a 2265// long-running operation. 2266type CloudServicesDeleteInstancesFuture struct { 2267 azure.FutureAPI 2268 // Result returns the result of the asynchronous operation. 2269 // If the operation has not completed it will return an error. 2270 Result func(CloudServicesClient) (autorest.Response, error) 2271} 2272 2273// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2274func (future *CloudServicesDeleteInstancesFuture) UnmarshalJSON(body []byte) error { 2275 var azFuture azure.Future 2276 if err := json.Unmarshal(body, &azFuture); err != nil { 2277 return err 2278 } 2279 future.FutureAPI = &azFuture 2280 future.Result = future.result 2281 return nil 2282} 2283 2284// result is the default implementation for CloudServicesDeleteInstancesFuture.Result. 2285func (future *CloudServicesDeleteInstancesFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { 2286 var done bool 2287 done, err = future.DoneWithContext(context.Background(), client) 2288 if err != nil { 2289 err = autorest.NewErrorWithError(err, "compute.CloudServicesDeleteInstancesFuture", "Result", future.Response(), "Polling failure") 2290 return 2291 } 2292 if !done { 2293 ar.Response = future.Response() 2294 err = azure.NewAsyncOpIncompleteError("compute.CloudServicesDeleteInstancesFuture") 2295 return 2296 } 2297 ar.Response = future.Response() 2298 return 2299} 2300 2301// CloudServicesPowerOffFuture an abstraction for monitoring and retrieving the results of a long-running 2302// operation. 2303type CloudServicesPowerOffFuture struct { 2304 azure.FutureAPI 2305 // Result returns the result of the asynchronous operation. 2306 // If the operation has not completed it will return an error. 2307 Result func(CloudServicesClient) (autorest.Response, error) 2308} 2309 2310// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2311func (future *CloudServicesPowerOffFuture) UnmarshalJSON(body []byte) error { 2312 var azFuture azure.Future 2313 if err := json.Unmarshal(body, &azFuture); err != nil { 2314 return err 2315 } 2316 future.FutureAPI = &azFuture 2317 future.Result = future.result 2318 return nil 2319} 2320 2321// result is the default implementation for CloudServicesPowerOffFuture.Result. 2322func (future *CloudServicesPowerOffFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { 2323 var done bool 2324 done, err = future.DoneWithContext(context.Background(), client) 2325 if err != nil { 2326 err = autorest.NewErrorWithError(err, "compute.CloudServicesPowerOffFuture", "Result", future.Response(), "Polling failure") 2327 return 2328 } 2329 if !done { 2330 ar.Response = future.Response() 2331 err = azure.NewAsyncOpIncompleteError("compute.CloudServicesPowerOffFuture") 2332 return 2333 } 2334 ar.Response = future.Response() 2335 return 2336} 2337 2338// CloudServicesRebuildFuture an abstraction for monitoring and retrieving the results of a long-running 2339// operation. 2340type CloudServicesRebuildFuture struct { 2341 azure.FutureAPI 2342 // Result returns the result of the asynchronous operation. 2343 // If the operation has not completed it will return an error. 2344 Result func(CloudServicesClient) (autorest.Response, error) 2345} 2346 2347// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2348func (future *CloudServicesRebuildFuture) UnmarshalJSON(body []byte) error { 2349 var azFuture azure.Future 2350 if err := json.Unmarshal(body, &azFuture); err != nil { 2351 return err 2352 } 2353 future.FutureAPI = &azFuture 2354 future.Result = future.result 2355 return nil 2356} 2357 2358// result is the default implementation for CloudServicesRebuildFuture.Result. 2359func (future *CloudServicesRebuildFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { 2360 var done bool 2361 done, err = future.DoneWithContext(context.Background(), client) 2362 if err != nil { 2363 err = autorest.NewErrorWithError(err, "compute.CloudServicesRebuildFuture", "Result", future.Response(), "Polling failure") 2364 return 2365 } 2366 if !done { 2367 ar.Response = future.Response() 2368 err = azure.NewAsyncOpIncompleteError("compute.CloudServicesRebuildFuture") 2369 return 2370 } 2371 ar.Response = future.Response() 2372 return 2373} 2374 2375// CloudServicesReimageFuture an abstraction for monitoring and retrieving the results of a long-running 2376// operation. 2377type CloudServicesReimageFuture struct { 2378 azure.FutureAPI 2379 // Result returns the result of the asynchronous operation. 2380 // If the operation has not completed it will return an error. 2381 Result func(CloudServicesClient) (autorest.Response, error) 2382} 2383 2384// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2385func (future *CloudServicesReimageFuture) UnmarshalJSON(body []byte) error { 2386 var azFuture azure.Future 2387 if err := json.Unmarshal(body, &azFuture); err != nil { 2388 return err 2389 } 2390 future.FutureAPI = &azFuture 2391 future.Result = future.result 2392 return nil 2393} 2394 2395// result is the default implementation for CloudServicesReimageFuture.Result. 2396func (future *CloudServicesReimageFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { 2397 var done bool 2398 done, err = future.DoneWithContext(context.Background(), client) 2399 if err != nil { 2400 err = autorest.NewErrorWithError(err, "compute.CloudServicesReimageFuture", "Result", future.Response(), "Polling failure") 2401 return 2402 } 2403 if !done { 2404 ar.Response = future.Response() 2405 err = azure.NewAsyncOpIncompleteError("compute.CloudServicesReimageFuture") 2406 return 2407 } 2408 ar.Response = future.Response() 2409 return 2410} 2411 2412// CloudServicesRestartFuture an abstraction for monitoring and retrieving the results of a long-running 2413// operation. 2414type CloudServicesRestartFuture struct { 2415 azure.FutureAPI 2416 // Result returns the result of the asynchronous operation. 2417 // If the operation has not completed it will return an error. 2418 Result func(CloudServicesClient) (autorest.Response, error) 2419} 2420 2421// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2422func (future *CloudServicesRestartFuture) UnmarshalJSON(body []byte) error { 2423 var azFuture azure.Future 2424 if err := json.Unmarshal(body, &azFuture); err != nil { 2425 return err 2426 } 2427 future.FutureAPI = &azFuture 2428 future.Result = future.result 2429 return nil 2430} 2431 2432// result is the default implementation for CloudServicesRestartFuture.Result. 2433func (future *CloudServicesRestartFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { 2434 var done bool 2435 done, err = future.DoneWithContext(context.Background(), client) 2436 if err != nil { 2437 err = autorest.NewErrorWithError(err, "compute.CloudServicesRestartFuture", "Result", future.Response(), "Polling failure") 2438 return 2439 } 2440 if !done { 2441 ar.Response = future.Response() 2442 err = azure.NewAsyncOpIncompleteError("compute.CloudServicesRestartFuture") 2443 return 2444 } 2445 ar.Response = future.Response() 2446 return 2447} 2448 2449// CloudServicesStartFuture an abstraction for monitoring and retrieving the results of a long-running 2450// operation. 2451type CloudServicesStartFuture struct { 2452 azure.FutureAPI 2453 // Result returns the result of the asynchronous operation. 2454 // If the operation has not completed it will return an error. 2455 Result func(CloudServicesClient) (autorest.Response, error) 2456} 2457 2458// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2459func (future *CloudServicesStartFuture) UnmarshalJSON(body []byte) error { 2460 var azFuture azure.Future 2461 if err := json.Unmarshal(body, &azFuture); err != nil { 2462 return err 2463 } 2464 future.FutureAPI = &azFuture 2465 future.Result = future.result 2466 return nil 2467} 2468 2469// result is the default implementation for CloudServicesStartFuture.Result. 2470func (future *CloudServicesStartFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { 2471 var done bool 2472 done, err = future.DoneWithContext(context.Background(), client) 2473 if err != nil { 2474 err = autorest.NewErrorWithError(err, "compute.CloudServicesStartFuture", "Result", future.Response(), "Polling failure") 2475 return 2476 } 2477 if !done { 2478 ar.Response = future.Response() 2479 err = azure.NewAsyncOpIncompleteError("compute.CloudServicesStartFuture") 2480 return 2481 } 2482 ar.Response = future.Response() 2483 return 2484} 2485 2486// CloudServicesUpdateDomainWalkUpdateDomainFuture an abstraction for monitoring and retrieving the results 2487// of a long-running operation. 2488type CloudServicesUpdateDomainWalkUpdateDomainFuture struct { 2489 azure.FutureAPI 2490 // Result returns the result of the asynchronous operation. 2491 // If the operation has not completed it will return an error. 2492 Result func(CloudServicesUpdateDomainClient) (autorest.Response, error) 2493} 2494 2495// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2496func (future *CloudServicesUpdateDomainWalkUpdateDomainFuture) UnmarshalJSON(body []byte) error { 2497 var azFuture azure.Future 2498 if err := json.Unmarshal(body, &azFuture); err != nil { 2499 return err 2500 } 2501 future.FutureAPI = &azFuture 2502 future.Result = future.result 2503 return nil 2504} 2505 2506// result is the default implementation for CloudServicesUpdateDomainWalkUpdateDomainFuture.Result. 2507func (future *CloudServicesUpdateDomainWalkUpdateDomainFuture) result(client CloudServicesUpdateDomainClient) (ar autorest.Response, err error) { 2508 var done bool 2509 done, err = future.DoneWithContext(context.Background(), client) 2510 if err != nil { 2511 err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateDomainWalkUpdateDomainFuture", "Result", future.Response(), "Polling failure") 2512 return 2513 } 2514 if !done { 2515 ar.Response = future.Response() 2516 err = azure.NewAsyncOpIncompleteError("compute.CloudServicesUpdateDomainWalkUpdateDomainFuture") 2517 return 2518 } 2519 ar.Response = future.Response() 2520 return 2521} 2522 2523// CloudServicesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 2524// operation. 2525type CloudServicesUpdateFuture struct { 2526 azure.FutureAPI 2527 // Result returns the result of the asynchronous operation. 2528 // If the operation has not completed it will return an error. 2529 Result func(CloudServicesClient) (CloudService, error) 2530} 2531 2532// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2533func (future *CloudServicesUpdateFuture) UnmarshalJSON(body []byte) error { 2534 var azFuture azure.Future 2535 if err := json.Unmarshal(body, &azFuture); err != nil { 2536 return err 2537 } 2538 future.FutureAPI = &azFuture 2539 future.Result = future.result 2540 return nil 2541} 2542 2543// result is the default implementation for CloudServicesUpdateFuture.Result. 2544func (future *CloudServicesUpdateFuture) result(client CloudServicesClient) (cs CloudService, err error) { 2545 var done bool 2546 done, err = future.DoneWithContext(context.Background(), client) 2547 if err != nil { 2548 err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateFuture", "Result", future.Response(), "Polling failure") 2549 return 2550 } 2551 if !done { 2552 cs.Response.Response = future.Response() 2553 err = azure.NewAsyncOpIncompleteError("compute.CloudServicesUpdateFuture") 2554 return 2555 } 2556 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2557 if cs.Response.Response, err = future.GetResult(sender); err == nil && cs.Response.Response.StatusCode != http.StatusNoContent { 2558 cs, err = client.UpdateResponder(cs.Response.Response) 2559 if err != nil { 2560 err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateFuture", "Result", cs.Response.Response, "Failure responding to request") 2561 } 2562 } 2563 return 2564} 2565 2566// CloudServiceUpdate ... 2567type CloudServiceUpdate struct { 2568 // Tags - Resource tags 2569 Tags map[string]*string `json:"tags"` 2570} 2571 2572// MarshalJSON is the custom marshaler for CloudServiceUpdate. 2573func (csu CloudServiceUpdate) MarshalJSON() ([]byte, error) { 2574 objectMap := make(map[string]interface{}) 2575 if csu.Tags != nil { 2576 objectMap["tags"] = csu.Tags 2577 } 2578 return json.Marshal(objectMap) 2579} 2580 2581// CloudServiceVaultAndSecretReference ... 2582type CloudServiceVaultAndSecretReference struct { 2583 SourceVault *SubResource `json:"sourceVault,omitempty"` 2584 SecretURL *string `json:"secretUrl,omitempty"` 2585} 2586 2587// CloudServiceVaultCertificate describes a single certificate reference in a Key Vault, and where the 2588// certificate should reside on the role instance. 2589type CloudServiceVaultCertificate struct { 2590 // CertificateURL - This is the URL of a certificate that has been uploaded to Key Vault as a secret. 2591 CertificateURL *string `json:"certificateUrl,omitempty"` 2592} 2593 2594// CloudServiceVaultSecretGroup describes a set of certificates which are all in the same Key Vault. 2595type CloudServiceVaultSecretGroup struct { 2596 // SourceVault - The relative URL of the Key Vault containing all of the certificates in VaultCertificates. 2597 SourceVault *SubResource `json:"sourceVault,omitempty"` 2598 // VaultCertificates - The list of key vault references in SourceVault which contain certificates. 2599 VaultCertificates *[]CloudServiceVaultCertificate `json:"vaultCertificates,omitempty"` 2600} 2601 2602// CreationData data used when creating a disk. 2603type CreationData struct { 2604 // CreateOption - This enumerates the possible sources of a disk's creation. Possible values include: 'DiskCreateOptionEmpty', 'DiskCreateOptionAttach', 'DiskCreateOptionFromImage', 'DiskCreateOptionImport', 'DiskCreateOptionCopy', 'DiskCreateOptionRestore', 'DiskCreateOptionUpload' 2605 CreateOption DiskCreateOption `json:"createOption,omitempty"` 2606 // StorageAccountID - Required if createOption is Import. The Azure Resource Manager identifier of the storage account containing the blob to import as a disk. 2607 StorageAccountID *string `json:"storageAccountId,omitempty"` 2608 // ImageReference - Disk source information. 2609 ImageReference *ImageDiskReference `json:"imageReference,omitempty"` 2610 // 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. 2611 GalleryImageReference *ImageDiskReference `json:"galleryImageReference,omitempty"` 2612 // SourceURI - If createOption is Import, this is the URI of a blob to be imported into a managed disk. 2613 SourceURI *string `json:"sourceUri,omitempty"` 2614 // SourceResourceID - If createOption is Copy, this is the ARM id of the source snapshot or disk. 2615 SourceResourceID *string `json:"sourceResourceId,omitempty"` 2616 // SourceUniqueID - READ-ONLY; If this field is set, this is the unique id identifying the source of this resource. 2617 SourceUniqueID *string `json:"sourceUniqueId,omitempty"` 2618 // 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). 2619 UploadSizeBytes *int64 `json:"uploadSizeBytes,omitempty"` 2620 // LogicalSectorSize - Logical sector size in bytes for Ultra disks. Supported values are 512 ad 4096. 4096 is the default. 2621 LogicalSectorSize *int32 `json:"logicalSectorSize,omitempty"` 2622} 2623 2624// MarshalJSON is the custom marshaler for CreationData. 2625func (cd CreationData) MarshalJSON() ([]byte, error) { 2626 objectMap := make(map[string]interface{}) 2627 if cd.CreateOption != "" { 2628 objectMap["createOption"] = cd.CreateOption 2629 } 2630 if cd.StorageAccountID != nil { 2631 objectMap["storageAccountId"] = cd.StorageAccountID 2632 } 2633 if cd.ImageReference != nil { 2634 objectMap["imageReference"] = cd.ImageReference 2635 } 2636 if cd.GalleryImageReference != nil { 2637 objectMap["galleryImageReference"] = cd.GalleryImageReference 2638 } 2639 if cd.SourceURI != nil { 2640 objectMap["sourceUri"] = cd.SourceURI 2641 } 2642 if cd.SourceResourceID != nil { 2643 objectMap["sourceResourceId"] = cd.SourceResourceID 2644 } 2645 if cd.UploadSizeBytes != nil { 2646 objectMap["uploadSizeBytes"] = cd.UploadSizeBytes 2647 } 2648 if cd.LogicalSectorSize != nil { 2649 objectMap["logicalSectorSize"] = cd.LogicalSectorSize 2650 } 2651 return json.Marshal(objectMap) 2652} 2653 2654// DataDisk describes a data disk. 2655type DataDisk struct { 2656 // 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. 2657 Lun *int32 `json:"lun,omitempty"` 2658 // Name - The disk name. 2659 Name *string `json:"name,omitempty"` 2660 // Vhd - The virtual hard disk. 2661 Vhd *VirtualHardDisk `json:"vhd,omitempty"` 2662 // 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. 2663 Image *VirtualHardDisk `json:"image,omitempty"` 2664 // 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' 2665 Caching CachingTypes `json:"caching,omitempty"` 2666 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 2667 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 2668 // 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' 2669 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 2670 // 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 2671 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 2672 // ManagedDisk - The managed disk parameters. 2673 ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` 2674 // ToBeDetached - Specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset 2675 ToBeDetached *bool `json:"toBeDetached,omitempty"` 2676 // 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. 2677 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 2678 // 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. 2679 DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` 2680 // 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' 2681 DetachOption DiskDetachOptionTypes `json:"detachOption,omitempty"` 2682 // 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' 2683 DeleteOption DiskDeleteOptionTypes `json:"deleteOption,omitempty"` 2684} 2685 2686// MarshalJSON is the custom marshaler for DataDisk. 2687func (dd DataDisk) MarshalJSON() ([]byte, error) { 2688 objectMap := make(map[string]interface{}) 2689 if dd.Lun != nil { 2690 objectMap["lun"] = dd.Lun 2691 } 2692 if dd.Name != nil { 2693 objectMap["name"] = dd.Name 2694 } 2695 if dd.Vhd != nil { 2696 objectMap["vhd"] = dd.Vhd 2697 } 2698 if dd.Image != nil { 2699 objectMap["image"] = dd.Image 2700 } 2701 if dd.Caching != "" { 2702 objectMap["caching"] = dd.Caching 2703 } 2704 if dd.WriteAcceleratorEnabled != nil { 2705 objectMap["writeAcceleratorEnabled"] = dd.WriteAcceleratorEnabled 2706 } 2707 if dd.CreateOption != "" { 2708 objectMap["createOption"] = dd.CreateOption 2709 } 2710 if dd.DiskSizeGB != nil { 2711 objectMap["diskSizeGB"] = dd.DiskSizeGB 2712 } 2713 if dd.ManagedDisk != nil { 2714 objectMap["managedDisk"] = dd.ManagedDisk 2715 } 2716 if dd.ToBeDetached != nil { 2717 objectMap["toBeDetached"] = dd.ToBeDetached 2718 } 2719 if dd.DetachOption != "" { 2720 objectMap["detachOption"] = dd.DetachOption 2721 } 2722 if dd.DeleteOption != "" { 2723 objectMap["deleteOption"] = dd.DeleteOption 2724 } 2725 return json.Marshal(objectMap) 2726} 2727 2728// DataDiskImage contains the data disk images information. 2729type DataDiskImage struct { 2730 // 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. 2731 Lun *int32 `json:"lun,omitempty"` 2732} 2733 2734// MarshalJSON is the custom marshaler for DataDiskImage. 2735func (ddi DataDiskImage) MarshalJSON() ([]byte, error) { 2736 objectMap := make(map[string]interface{}) 2737 return json.Marshal(objectMap) 2738} 2739 2740// DataDiskImageEncryption contains encryption settings for a data disk image. 2741type DataDiskImageEncryption struct { 2742 // 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. 2743 Lun *int32 `json:"lun,omitempty"` 2744 // DiskEncryptionSetID - A relative URI containing the resource ID of the disk encryption set. 2745 DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` 2746} 2747 2748// DedicatedHost specifies information about the Dedicated host. 2749type DedicatedHost struct { 2750 autorest.Response `json:"-"` 2751 *DedicatedHostProperties `json:"properties,omitempty"` 2752 // 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. 2753 Sku *Sku `json:"sku,omitempty"` 2754 // ID - READ-ONLY; Resource Id 2755 ID *string `json:"id,omitempty"` 2756 // Name - READ-ONLY; Resource name 2757 Name *string `json:"name,omitempty"` 2758 // Type - READ-ONLY; Resource type 2759 Type *string `json:"type,omitempty"` 2760 // Location - Resource location 2761 Location *string `json:"location,omitempty"` 2762 // Tags - Resource tags 2763 Tags map[string]*string `json:"tags"` 2764} 2765 2766// MarshalJSON is the custom marshaler for DedicatedHost. 2767func (dh DedicatedHost) MarshalJSON() ([]byte, error) { 2768 objectMap := make(map[string]interface{}) 2769 if dh.DedicatedHostProperties != nil { 2770 objectMap["properties"] = dh.DedicatedHostProperties 2771 } 2772 if dh.Sku != nil { 2773 objectMap["sku"] = dh.Sku 2774 } 2775 if dh.Location != nil { 2776 objectMap["location"] = dh.Location 2777 } 2778 if dh.Tags != nil { 2779 objectMap["tags"] = dh.Tags 2780 } 2781 return json.Marshal(objectMap) 2782} 2783 2784// UnmarshalJSON is the custom unmarshaler for DedicatedHost struct. 2785func (dh *DedicatedHost) UnmarshalJSON(body []byte) error { 2786 var m map[string]*json.RawMessage 2787 err := json.Unmarshal(body, &m) 2788 if err != nil { 2789 return err 2790 } 2791 for k, v := range m { 2792 switch k { 2793 case "properties": 2794 if v != nil { 2795 var dedicatedHostProperties DedicatedHostProperties 2796 err = json.Unmarshal(*v, &dedicatedHostProperties) 2797 if err != nil { 2798 return err 2799 } 2800 dh.DedicatedHostProperties = &dedicatedHostProperties 2801 } 2802 case "sku": 2803 if v != nil { 2804 var sku Sku 2805 err = json.Unmarshal(*v, &sku) 2806 if err != nil { 2807 return err 2808 } 2809 dh.Sku = &sku 2810 } 2811 case "id": 2812 if v != nil { 2813 var ID string 2814 err = json.Unmarshal(*v, &ID) 2815 if err != nil { 2816 return err 2817 } 2818 dh.ID = &ID 2819 } 2820 case "name": 2821 if v != nil { 2822 var name string 2823 err = json.Unmarshal(*v, &name) 2824 if err != nil { 2825 return err 2826 } 2827 dh.Name = &name 2828 } 2829 case "type": 2830 if v != nil { 2831 var typeVar string 2832 err = json.Unmarshal(*v, &typeVar) 2833 if err != nil { 2834 return err 2835 } 2836 dh.Type = &typeVar 2837 } 2838 case "location": 2839 if v != nil { 2840 var location string 2841 err = json.Unmarshal(*v, &location) 2842 if err != nil { 2843 return err 2844 } 2845 dh.Location = &location 2846 } 2847 case "tags": 2848 if v != nil { 2849 var tags map[string]*string 2850 err = json.Unmarshal(*v, &tags) 2851 if err != nil { 2852 return err 2853 } 2854 dh.Tags = tags 2855 } 2856 } 2857 } 2858 2859 return nil 2860} 2861 2862// DedicatedHostAllocatableVM represents the dedicated host unutilized capacity in terms of a specific VM 2863// size. 2864type DedicatedHostAllocatableVM struct { 2865 // VMSize - VM size in terms of which the unutilized capacity is represented. 2866 VMSize *string `json:"vmSize,omitempty"` 2867 // Count - Maximum number of VMs of size vmSize that can fit in the dedicated host's remaining capacity. 2868 Count *float64 `json:"count,omitempty"` 2869} 2870 2871// DedicatedHostAvailableCapacity dedicated host unutilized capacity. 2872type DedicatedHostAvailableCapacity struct { 2873 // 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. 2874 AllocatableVMs *[]DedicatedHostAllocatableVM `json:"allocatableVMs,omitempty"` 2875} 2876 2877// DedicatedHostGroup specifies information about the dedicated host group that the dedicated hosts should 2878// be assigned to. <br><br> Currently, a dedicated host can only be added to a dedicated host group at 2879// creation time. An existing dedicated host cannot be added to another dedicated host group. 2880type DedicatedHostGroup struct { 2881 autorest.Response `json:"-"` 2882 *DedicatedHostGroupProperties `json:"properties,omitempty"` 2883 // 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. 2884 Zones *[]string `json:"zones,omitempty"` 2885 // ID - READ-ONLY; Resource Id 2886 ID *string `json:"id,omitempty"` 2887 // Name - READ-ONLY; Resource name 2888 Name *string `json:"name,omitempty"` 2889 // Type - READ-ONLY; Resource type 2890 Type *string `json:"type,omitempty"` 2891 // Location - Resource location 2892 Location *string `json:"location,omitempty"` 2893 // Tags - Resource tags 2894 Tags map[string]*string `json:"tags"` 2895} 2896 2897// MarshalJSON is the custom marshaler for DedicatedHostGroup. 2898func (dhg DedicatedHostGroup) MarshalJSON() ([]byte, error) { 2899 objectMap := make(map[string]interface{}) 2900 if dhg.DedicatedHostGroupProperties != nil { 2901 objectMap["properties"] = dhg.DedicatedHostGroupProperties 2902 } 2903 if dhg.Zones != nil { 2904 objectMap["zones"] = dhg.Zones 2905 } 2906 if dhg.Location != nil { 2907 objectMap["location"] = dhg.Location 2908 } 2909 if dhg.Tags != nil { 2910 objectMap["tags"] = dhg.Tags 2911 } 2912 return json.Marshal(objectMap) 2913} 2914 2915// UnmarshalJSON is the custom unmarshaler for DedicatedHostGroup struct. 2916func (dhg *DedicatedHostGroup) UnmarshalJSON(body []byte) error { 2917 var m map[string]*json.RawMessage 2918 err := json.Unmarshal(body, &m) 2919 if err != nil { 2920 return err 2921 } 2922 for k, v := range m { 2923 switch k { 2924 case "properties": 2925 if v != nil { 2926 var dedicatedHostGroupProperties DedicatedHostGroupProperties 2927 err = json.Unmarshal(*v, &dedicatedHostGroupProperties) 2928 if err != nil { 2929 return err 2930 } 2931 dhg.DedicatedHostGroupProperties = &dedicatedHostGroupProperties 2932 } 2933 case "zones": 2934 if v != nil { 2935 var zones []string 2936 err = json.Unmarshal(*v, &zones) 2937 if err != nil { 2938 return err 2939 } 2940 dhg.Zones = &zones 2941 } 2942 case "id": 2943 if v != nil { 2944 var ID string 2945 err = json.Unmarshal(*v, &ID) 2946 if err != nil { 2947 return err 2948 } 2949 dhg.ID = &ID 2950 } 2951 case "name": 2952 if v != nil { 2953 var name string 2954 err = json.Unmarshal(*v, &name) 2955 if err != nil { 2956 return err 2957 } 2958 dhg.Name = &name 2959 } 2960 case "type": 2961 if v != nil { 2962 var typeVar string 2963 err = json.Unmarshal(*v, &typeVar) 2964 if err != nil { 2965 return err 2966 } 2967 dhg.Type = &typeVar 2968 } 2969 case "location": 2970 if v != nil { 2971 var location string 2972 err = json.Unmarshal(*v, &location) 2973 if err != nil { 2974 return err 2975 } 2976 dhg.Location = &location 2977 } 2978 case "tags": 2979 if v != nil { 2980 var tags map[string]*string 2981 err = json.Unmarshal(*v, &tags) 2982 if err != nil { 2983 return err 2984 } 2985 dhg.Tags = tags 2986 } 2987 } 2988 } 2989 2990 return nil 2991} 2992 2993// DedicatedHostGroupInstanceView ... 2994type DedicatedHostGroupInstanceView struct { 2995 // Hosts - List of instance view of the dedicated hosts under the dedicated host group. 2996 Hosts *[]DedicatedHostInstanceViewWithName `json:"hosts,omitempty"` 2997} 2998 2999// DedicatedHostGroupListResult the List Dedicated Host Group with resource group response. 3000type DedicatedHostGroupListResult struct { 3001 autorest.Response `json:"-"` 3002 // Value - The list of dedicated host groups 3003 Value *[]DedicatedHostGroup `json:"value,omitempty"` 3004 // 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. 3005 NextLink *string `json:"nextLink,omitempty"` 3006} 3007 3008// DedicatedHostGroupListResultIterator provides access to a complete listing of DedicatedHostGroup values. 3009type DedicatedHostGroupListResultIterator struct { 3010 i int 3011 page DedicatedHostGroupListResultPage 3012} 3013 3014// NextWithContext advances to the next value. If there was an error making 3015// the request the iterator does not advance and the error is returned. 3016func (iter *DedicatedHostGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { 3017 if tracing.IsEnabled() { 3018 ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupListResultIterator.NextWithContext") 3019 defer func() { 3020 sc := -1 3021 if iter.Response().Response.Response != nil { 3022 sc = iter.Response().Response.Response.StatusCode 3023 } 3024 tracing.EndSpan(ctx, sc, err) 3025 }() 3026 } 3027 iter.i++ 3028 if iter.i < len(iter.page.Values()) { 3029 return nil 3030 } 3031 err = iter.page.NextWithContext(ctx) 3032 if err != nil { 3033 iter.i-- 3034 return err 3035 } 3036 iter.i = 0 3037 return nil 3038} 3039 3040// Next advances to the next value. If there was an error making 3041// the request the iterator does not advance and the error is returned. 3042// Deprecated: Use NextWithContext() instead. 3043func (iter *DedicatedHostGroupListResultIterator) Next() error { 3044 return iter.NextWithContext(context.Background()) 3045} 3046 3047// NotDone returns true if the enumeration should be started or is not yet complete. 3048func (iter DedicatedHostGroupListResultIterator) NotDone() bool { 3049 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3050} 3051 3052// Response returns the raw server response from the last page request. 3053func (iter DedicatedHostGroupListResultIterator) Response() DedicatedHostGroupListResult { 3054 return iter.page.Response() 3055} 3056 3057// Value returns the current value or a zero-initialized value if the 3058// iterator has advanced beyond the end of the collection. 3059func (iter DedicatedHostGroupListResultIterator) Value() DedicatedHostGroup { 3060 if !iter.page.NotDone() { 3061 return DedicatedHostGroup{} 3062 } 3063 return iter.page.Values()[iter.i] 3064} 3065 3066// Creates a new instance of the DedicatedHostGroupListResultIterator type. 3067func NewDedicatedHostGroupListResultIterator(page DedicatedHostGroupListResultPage) DedicatedHostGroupListResultIterator { 3068 return DedicatedHostGroupListResultIterator{page: page} 3069} 3070 3071// IsEmpty returns true if the ListResult contains no values. 3072func (dhglr DedicatedHostGroupListResult) IsEmpty() bool { 3073 return dhglr.Value == nil || len(*dhglr.Value) == 0 3074} 3075 3076// hasNextLink returns true if the NextLink is not empty. 3077func (dhglr DedicatedHostGroupListResult) hasNextLink() bool { 3078 return dhglr.NextLink != nil && len(*dhglr.NextLink) != 0 3079} 3080 3081// dedicatedHostGroupListResultPreparer prepares a request to retrieve the next set of results. 3082// It returns nil if no more results exist. 3083func (dhglr DedicatedHostGroupListResult) dedicatedHostGroupListResultPreparer(ctx context.Context) (*http.Request, error) { 3084 if !dhglr.hasNextLink() { 3085 return nil, nil 3086 } 3087 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3088 autorest.AsJSON(), 3089 autorest.AsGet(), 3090 autorest.WithBaseURL(to.String(dhglr.NextLink))) 3091} 3092 3093// DedicatedHostGroupListResultPage contains a page of DedicatedHostGroup values. 3094type DedicatedHostGroupListResultPage struct { 3095 fn func(context.Context, DedicatedHostGroupListResult) (DedicatedHostGroupListResult, error) 3096 dhglr DedicatedHostGroupListResult 3097} 3098 3099// NextWithContext advances to the next page of values. If there was an error making 3100// the request the page does not advance and the error is returned. 3101func (page *DedicatedHostGroupListResultPage) NextWithContext(ctx context.Context) (err error) { 3102 if tracing.IsEnabled() { 3103 ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupListResultPage.NextWithContext") 3104 defer func() { 3105 sc := -1 3106 if page.Response().Response.Response != nil { 3107 sc = page.Response().Response.Response.StatusCode 3108 } 3109 tracing.EndSpan(ctx, sc, err) 3110 }() 3111 } 3112 for { 3113 next, err := page.fn(ctx, page.dhglr) 3114 if err != nil { 3115 return err 3116 } 3117 page.dhglr = next 3118 if !next.hasNextLink() || !next.IsEmpty() { 3119 break 3120 } 3121 } 3122 return nil 3123} 3124 3125// Next advances to the next page of values. If there was an error making 3126// the request the page does not advance and the error is returned. 3127// Deprecated: Use NextWithContext() instead. 3128func (page *DedicatedHostGroupListResultPage) Next() error { 3129 return page.NextWithContext(context.Background()) 3130} 3131 3132// NotDone returns true if the page enumeration should be started or is not yet complete. 3133func (page DedicatedHostGroupListResultPage) NotDone() bool { 3134 return !page.dhglr.IsEmpty() 3135} 3136 3137// Response returns the raw server response from the last page request. 3138func (page DedicatedHostGroupListResultPage) Response() DedicatedHostGroupListResult { 3139 return page.dhglr 3140} 3141 3142// Values returns the slice of values for the current page or nil if there are no values. 3143func (page DedicatedHostGroupListResultPage) Values() []DedicatedHostGroup { 3144 if page.dhglr.IsEmpty() { 3145 return nil 3146 } 3147 return *page.dhglr.Value 3148} 3149 3150// Creates a new instance of the DedicatedHostGroupListResultPage type. 3151func NewDedicatedHostGroupListResultPage(cur DedicatedHostGroupListResult, getNextPage func(context.Context, DedicatedHostGroupListResult) (DedicatedHostGroupListResult, error)) DedicatedHostGroupListResultPage { 3152 return DedicatedHostGroupListResultPage{ 3153 fn: getNextPage, 3154 dhglr: cur, 3155 } 3156} 3157 3158// DedicatedHostGroupProperties dedicated Host Group Properties. 3159type DedicatedHostGroupProperties struct { 3160 // PlatformFaultDomainCount - Number of fault domains that the host group can span. 3161 PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` 3162 // Hosts - READ-ONLY; A list of references to all dedicated hosts in the dedicated host group. 3163 Hosts *[]SubResourceReadOnly `json:"hosts,omitempty"` 3164 // 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. 3165 InstanceView *DedicatedHostGroupInstanceView `json:"instanceView,omitempty"` 3166 // 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. 3167 SupportAutomaticPlacement *bool `json:"supportAutomaticPlacement,omitempty"` 3168} 3169 3170// MarshalJSON is the custom marshaler for DedicatedHostGroupProperties. 3171func (dhgp DedicatedHostGroupProperties) MarshalJSON() ([]byte, error) { 3172 objectMap := make(map[string]interface{}) 3173 if dhgp.PlatformFaultDomainCount != nil { 3174 objectMap["platformFaultDomainCount"] = dhgp.PlatformFaultDomainCount 3175 } 3176 if dhgp.SupportAutomaticPlacement != nil { 3177 objectMap["supportAutomaticPlacement"] = dhgp.SupportAutomaticPlacement 3178 } 3179 return json.Marshal(objectMap) 3180} 3181 3182// DedicatedHostGroupUpdate specifies information about the dedicated host group that the dedicated host 3183// should be assigned to. Only tags may be updated. 3184type DedicatedHostGroupUpdate struct { 3185 *DedicatedHostGroupProperties `json:"properties,omitempty"` 3186 // 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. 3187 Zones *[]string `json:"zones,omitempty"` 3188 // Tags - Resource tags 3189 Tags map[string]*string `json:"tags"` 3190} 3191 3192// MarshalJSON is the custom marshaler for DedicatedHostGroupUpdate. 3193func (dhgu DedicatedHostGroupUpdate) MarshalJSON() ([]byte, error) { 3194 objectMap := make(map[string]interface{}) 3195 if dhgu.DedicatedHostGroupProperties != nil { 3196 objectMap["properties"] = dhgu.DedicatedHostGroupProperties 3197 } 3198 if dhgu.Zones != nil { 3199 objectMap["zones"] = dhgu.Zones 3200 } 3201 if dhgu.Tags != nil { 3202 objectMap["tags"] = dhgu.Tags 3203 } 3204 return json.Marshal(objectMap) 3205} 3206 3207// UnmarshalJSON is the custom unmarshaler for DedicatedHostGroupUpdate struct. 3208func (dhgu *DedicatedHostGroupUpdate) UnmarshalJSON(body []byte) error { 3209 var m map[string]*json.RawMessage 3210 err := json.Unmarshal(body, &m) 3211 if err != nil { 3212 return err 3213 } 3214 for k, v := range m { 3215 switch k { 3216 case "properties": 3217 if v != nil { 3218 var dedicatedHostGroupProperties DedicatedHostGroupProperties 3219 err = json.Unmarshal(*v, &dedicatedHostGroupProperties) 3220 if err != nil { 3221 return err 3222 } 3223 dhgu.DedicatedHostGroupProperties = &dedicatedHostGroupProperties 3224 } 3225 case "zones": 3226 if v != nil { 3227 var zones []string 3228 err = json.Unmarshal(*v, &zones) 3229 if err != nil { 3230 return err 3231 } 3232 dhgu.Zones = &zones 3233 } 3234 case "tags": 3235 if v != nil { 3236 var tags map[string]*string 3237 err = json.Unmarshal(*v, &tags) 3238 if err != nil { 3239 return err 3240 } 3241 dhgu.Tags = tags 3242 } 3243 } 3244 } 3245 3246 return nil 3247} 3248 3249// DedicatedHostInstanceView the instance view of a dedicated host. 3250type DedicatedHostInstanceView struct { 3251 // AssetID - READ-ONLY; Specifies the unique id of the dedicated physical machine on which the dedicated host resides. 3252 AssetID *string `json:"assetId,omitempty"` 3253 // AvailableCapacity - Unutilized capacity of the dedicated host. 3254 AvailableCapacity *DedicatedHostAvailableCapacity `json:"availableCapacity,omitempty"` 3255 // Statuses - The resource status information. 3256 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 3257} 3258 3259// MarshalJSON is the custom marshaler for DedicatedHostInstanceView. 3260func (dhiv DedicatedHostInstanceView) MarshalJSON() ([]byte, error) { 3261 objectMap := make(map[string]interface{}) 3262 if dhiv.AvailableCapacity != nil { 3263 objectMap["availableCapacity"] = dhiv.AvailableCapacity 3264 } 3265 if dhiv.Statuses != nil { 3266 objectMap["statuses"] = dhiv.Statuses 3267 } 3268 return json.Marshal(objectMap) 3269} 3270 3271// DedicatedHostInstanceViewWithName the instance view of a dedicated host that includes the name of the 3272// dedicated host. It is used for the response to the instance view of a dedicated host group. 3273type DedicatedHostInstanceViewWithName struct { 3274 // Name - READ-ONLY; The name of the dedicated host. 3275 Name *string `json:"name,omitempty"` 3276 // AssetID - READ-ONLY; Specifies the unique id of the dedicated physical machine on which the dedicated host resides. 3277 AssetID *string `json:"assetId,omitempty"` 3278 // AvailableCapacity - Unutilized capacity of the dedicated host. 3279 AvailableCapacity *DedicatedHostAvailableCapacity `json:"availableCapacity,omitempty"` 3280 // Statuses - The resource status information. 3281 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 3282} 3283 3284// MarshalJSON is the custom marshaler for DedicatedHostInstanceViewWithName. 3285func (dhivwn DedicatedHostInstanceViewWithName) MarshalJSON() ([]byte, error) { 3286 objectMap := make(map[string]interface{}) 3287 if dhivwn.AvailableCapacity != nil { 3288 objectMap["availableCapacity"] = dhivwn.AvailableCapacity 3289 } 3290 if dhivwn.Statuses != nil { 3291 objectMap["statuses"] = dhivwn.Statuses 3292 } 3293 return json.Marshal(objectMap) 3294} 3295 3296// DedicatedHostListResult the list dedicated host operation response. 3297type DedicatedHostListResult struct { 3298 autorest.Response `json:"-"` 3299 // Value - The list of dedicated hosts 3300 Value *[]DedicatedHost `json:"value,omitempty"` 3301 // NextLink - The URI to fetch the next page of dedicated hosts. Call ListNext() with this URI to fetch the next page of dedicated hosts. 3302 NextLink *string `json:"nextLink,omitempty"` 3303} 3304 3305// DedicatedHostListResultIterator provides access to a complete listing of DedicatedHost values. 3306type DedicatedHostListResultIterator struct { 3307 i int 3308 page DedicatedHostListResultPage 3309} 3310 3311// NextWithContext advances to the next value. If there was an error making 3312// the request the iterator does not advance and the error is returned. 3313func (iter *DedicatedHostListResultIterator) NextWithContext(ctx context.Context) (err error) { 3314 if tracing.IsEnabled() { 3315 ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostListResultIterator.NextWithContext") 3316 defer func() { 3317 sc := -1 3318 if iter.Response().Response.Response != nil { 3319 sc = iter.Response().Response.Response.StatusCode 3320 } 3321 tracing.EndSpan(ctx, sc, err) 3322 }() 3323 } 3324 iter.i++ 3325 if iter.i < len(iter.page.Values()) { 3326 return nil 3327 } 3328 err = iter.page.NextWithContext(ctx) 3329 if err != nil { 3330 iter.i-- 3331 return err 3332 } 3333 iter.i = 0 3334 return nil 3335} 3336 3337// Next advances to the next value. If there was an error making 3338// the request the iterator does not advance and the error is returned. 3339// Deprecated: Use NextWithContext() instead. 3340func (iter *DedicatedHostListResultIterator) Next() error { 3341 return iter.NextWithContext(context.Background()) 3342} 3343 3344// NotDone returns true if the enumeration should be started or is not yet complete. 3345func (iter DedicatedHostListResultIterator) NotDone() bool { 3346 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3347} 3348 3349// Response returns the raw server response from the last page request. 3350func (iter DedicatedHostListResultIterator) Response() DedicatedHostListResult { 3351 return iter.page.Response() 3352} 3353 3354// Value returns the current value or a zero-initialized value if the 3355// iterator has advanced beyond the end of the collection. 3356func (iter DedicatedHostListResultIterator) Value() DedicatedHost { 3357 if !iter.page.NotDone() { 3358 return DedicatedHost{} 3359 } 3360 return iter.page.Values()[iter.i] 3361} 3362 3363// Creates a new instance of the DedicatedHostListResultIterator type. 3364func NewDedicatedHostListResultIterator(page DedicatedHostListResultPage) DedicatedHostListResultIterator { 3365 return DedicatedHostListResultIterator{page: page} 3366} 3367 3368// IsEmpty returns true if the ListResult contains no values. 3369func (dhlr DedicatedHostListResult) IsEmpty() bool { 3370 return dhlr.Value == nil || len(*dhlr.Value) == 0 3371} 3372 3373// hasNextLink returns true if the NextLink is not empty. 3374func (dhlr DedicatedHostListResult) hasNextLink() bool { 3375 return dhlr.NextLink != nil && len(*dhlr.NextLink) != 0 3376} 3377 3378// dedicatedHostListResultPreparer prepares a request to retrieve the next set of results. 3379// It returns nil if no more results exist. 3380func (dhlr DedicatedHostListResult) dedicatedHostListResultPreparer(ctx context.Context) (*http.Request, error) { 3381 if !dhlr.hasNextLink() { 3382 return nil, nil 3383 } 3384 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3385 autorest.AsJSON(), 3386 autorest.AsGet(), 3387 autorest.WithBaseURL(to.String(dhlr.NextLink))) 3388} 3389 3390// DedicatedHostListResultPage contains a page of DedicatedHost values. 3391type DedicatedHostListResultPage struct { 3392 fn func(context.Context, DedicatedHostListResult) (DedicatedHostListResult, error) 3393 dhlr DedicatedHostListResult 3394} 3395 3396// NextWithContext advances to the next page of values. If there was an error making 3397// the request the page does not advance and the error is returned. 3398func (page *DedicatedHostListResultPage) NextWithContext(ctx context.Context) (err error) { 3399 if tracing.IsEnabled() { 3400 ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostListResultPage.NextWithContext") 3401 defer func() { 3402 sc := -1 3403 if page.Response().Response.Response != nil { 3404 sc = page.Response().Response.Response.StatusCode 3405 } 3406 tracing.EndSpan(ctx, sc, err) 3407 }() 3408 } 3409 for { 3410 next, err := page.fn(ctx, page.dhlr) 3411 if err != nil { 3412 return err 3413 } 3414 page.dhlr = next 3415 if !next.hasNextLink() || !next.IsEmpty() { 3416 break 3417 } 3418 } 3419 return nil 3420} 3421 3422// Next advances to the next page of values. If there was an error making 3423// the request the page does not advance and the error is returned. 3424// Deprecated: Use NextWithContext() instead. 3425func (page *DedicatedHostListResultPage) Next() error { 3426 return page.NextWithContext(context.Background()) 3427} 3428 3429// NotDone returns true if the page enumeration should be started or is not yet complete. 3430func (page DedicatedHostListResultPage) NotDone() bool { 3431 return !page.dhlr.IsEmpty() 3432} 3433 3434// Response returns the raw server response from the last page request. 3435func (page DedicatedHostListResultPage) Response() DedicatedHostListResult { 3436 return page.dhlr 3437} 3438 3439// Values returns the slice of values for the current page or nil if there are no values. 3440func (page DedicatedHostListResultPage) Values() []DedicatedHost { 3441 if page.dhlr.IsEmpty() { 3442 return nil 3443 } 3444 return *page.dhlr.Value 3445} 3446 3447// Creates a new instance of the DedicatedHostListResultPage type. 3448func NewDedicatedHostListResultPage(cur DedicatedHostListResult, getNextPage func(context.Context, DedicatedHostListResult) (DedicatedHostListResult, error)) DedicatedHostListResultPage { 3449 return DedicatedHostListResultPage{ 3450 fn: getNextPage, 3451 dhlr: cur, 3452 } 3453} 3454 3455// DedicatedHostProperties properties of the dedicated host. 3456type DedicatedHostProperties struct { 3457 // PlatformFaultDomain - Fault domain of the dedicated host within a dedicated host group. 3458 PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` 3459 // AutoReplaceOnFailure - Specifies whether the dedicated host should be replaced automatically in case of a failure. The value is defaulted to 'true' when not provided. 3460 AutoReplaceOnFailure *bool `json:"autoReplaceOnFailure,omitempty"` 3461 // 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. 3462 HostID *string `json:"hostId,omitempty"` 3463 // VirtualMachines - READ-ONLY; A list of references to all virtual machines in the Dedicated Host. 3464 VirtualMachines *[]SubResourceReadOnly `json:"virtualMachines,omitempty"` 3465 // 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' 3466 LicenseType DedicatedHostLicenseTypes `json:"licenseType,omitempty"` 3467 // ProvisioningTime - READ-ONLY; The date when the host was first provisioned. 3468 ProvisioningTime *date.Time `json:"provisioningTime,omitempty"` 3469 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 3470 ProvisioningState *string `json:"provisioningState,omitempty"` 3471 // InstanceView - READ-ONLY; The dedicated host instance view. 3472 InstanceView *DedicatedHostInstanceView `json:"instanceView,omitempty"` 3473} 3474 3475// MarshalJSON is the custom marshaler for DedicatedHostProperties. 3476func (dhp DedicatedHostProperties) MarshalJSON() ([]byte, error) { 3477 objectMap := make(map[string]interface{}) 3478 if dhp.PlatformFaultDomain != nil { 3479 objectMap["platformFaultDomain"] = dhp.PlatformFaultDomain 3480 } 3481 if dhp.AutoReplaceOnFailure != nil { 3482 objectMap["autoReplaceOnFailure"] = dhp.AutoReplaceOnFailure 3483 } 3484 if dhp.LicenseType != "" { 3485 objectMap["licenseType"] = dhp.LicenseType 3486 } 3487 return json.Marshal(objectMap) 3488} 3489 3490// DedicatedHostsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 3491// long-running operation. 3492type DedicatedHostsCreateOrUpdateFuture struct { 3493 azure.FutureAPI 3494 // Result returns the result of the asynchronous operation. 3495 // If the operation has not completed it will return an error. 3496 Result func(DedicatedHostsClient) (DedicatedHost, error) 3497} 3498 3499// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3500func (future *DedicatedHostsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 3501 var azFuture azure.Future 3502 if err := json.Unmarshal(body, &azFuture); err != nil { 3503 return err 3504 } 3505 future.FutureAPI = &azFuture 3506 future.Result = future.result 3507 return nil 3508} 3509 3510// result is the default implementation for DedicatedHostsCreateOrUpdateFuture.Result. 3511func (future *DedicatedHostsCreateOrUpdateFuture) result(client DedicatedHostsClient) (dh DedicatedHost, err error) { 3512 var done bool 3513 done, err = future.DoneWithContext(context.Background(), client) 3514 if err != nil { 3515 err = autorest.NewErrorWithError(err, "compute.DedicatedHostsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 3516 return 3517 } 3518 if !done { 3519 dh.Response.Response = future.Response() 3520 err = azure.NewAsyncOpIncompleteError("compute.DedicatedHostsCreateOrUpdateFuture") 3521 return 3522 } 3523 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3524 if dh.Response.Response, err = future.GetResult(sender); err == nil && dh.Response.Response.StatusCode != http.StatusNoContent { 3525 dh, err = client.CreateOrUpdateResponder(dh.Response.Response) 3526 if err != nil { 3527 err = autorest.NewErrorWithError(err, "compute.DedicatedHostsCreateOrUpdateFuture", "Result", dh.Response.Response, "Failure responding to request") 3528 } 3529 } 3530 return 3531} 3532 3533// DedicatedHostsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 3534// operation. 3535type DedicatedHostsDeleteFuture struct { 3536 azure.FutureAPI 3537 // Result returns the result of the asynchronous operation. 3538 // If the operation has not completed it will return an error. 3539 Result func(DedicatedHostsClient) (autorest.Response, error) 3540} 3541 3542// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3543func (future *DedicatedHostsDeleteFuture) UnmarshalJSON(body []byte) error { 3544 var azFuture azure.Future 3545 if err := json.Unmarshal(body, &azFuture); err != nil { 3546 return err 3547 } 3548 future.FutureAPI = &azFuture 3549 future.Result = future.result 3550 return nil 3551} 3552 3553// result is the default implementation for DedicatedHostsDeleteFuture.Result. 3554func (future *DedicatedHostsDeleteFuture) result(client DedicatedHostsClient) (ar autorest.Response, err error) { 3555 var done bool 3556 done, err = future.DoneWithContext(context.Background(), client) 3557 if err != nil { 3558 err = autorest.NewErrorWithError(err, "compute.DedicatedHostsDeleteFuture", "Result", future.Response(), "Polling failure") 3559 return 3560 } 3561 if !done { 3562 ar.Response = future.Response() 3563 err = azure.NewAsyncOpIncompleteError("compute.DedicatedHostsDeleteFuture") 3564 return 3565 } 3566 ar.Response = future.Response() 3567 return 3568} 3569 3570// DedicatedHostsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 3571// operation. 3572type DedicatedHostsUpdateFuture struct { 3573 azure.FutureAPI 3574 // Result returns the result of the asynchronous operation. 3575 // If the operation has not completed it will return an error. 3576 Result func(DedicatedHostsClient) (DedicatedHost, error) 3577} 3578 3579// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3580func (future *DedicatedHostsUpdateFuture) UnmarshalJSON(body []byte) error { 3581 var azFuture azure.Future 3582 if err := json.Unmarshal(body, &azFuture); err != nil { 3583 return err 3584 } 3585 future.FutureAPI = &azFuture 3586 future.Result = future.result 3587 return nil 3588} 3589 3590// result is the default implementation for DedicatedHostsUpdateFuture.Result. 3591func (future *DedicatedHostsUpdateFuture) result(client DedicatedHostsClient) (dh DedicatedHost, err error) { 3592 var done bool 3593 done, err = future.DoneWithContext(context.Background(), client) 3594 if err != nil { 3595 err = autorest.NewErrorWithError(err, "compute.DedicatedHostsUpdateFuture", "Result", future.Response(), "Polling failure") 3596 return 3597 } 3598 if !done { 3599 dh.Response.Response = future.Response() 3600 err = azure.NewAsyncOpIncompleteError("compute.DedicatedHostsUpdateFuture") 3601 return 3602 } 3603 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3604 if dh.Response.Response, err = future.GetResult(sender); err == nil && dh.Response.Response.StatusCode != http.StatusNoContent { 3605 dh, err = client.UpdateResponder(dh.Response.Response) 3606 if err != nil { 3607 err = autorest.NewErrorWithError(err, "compute.DedicatedHostsUpdateFuture", "Result", dh.Response.Response, "Failure responding to request") 3608 } 3609 } 3610 return 3611} 3612 3613// DedicatedHostUpdate specifies information about the dedicated host. Only tags, autoReplaceOnFailure and 3614// licenseType may be updated. 3615type DedicatedHostUpdate struct { 3616 *DedicatedHostProperties `json:"properties,omitempty"` 3617 // Tags - Resource tags 3618 Tags map[string]*string `json:"tags"` 3619} 3620 3621// MarshalJSON is the custom marshaler for DedicatedHostUpdate. 3622func (dhu DedicatedHostUpdate) MarshalJSON() ([]byte, error) { 3623 objectMap := make(map[string]interface{}) 3624 if dhu.DedicatedHostProperties != nil { 3625 objectMap["properties"] = dhu.DedicatedHostProperties 3626 } 3627 if dhu.Tags != nil { 3628 objectMap["tags"] = dhu.Tags 3629 } 3630 return json.Marshal(objectMap) 3631} 3632 3633// UnmarshalJSON is the custom unmarshaler for DedicatedHostUpdate struct. 3634func (dhu *DedicatedHostUpdate) UnmarshalJSON(body []byte) error { 3635 var m map[string]*json.RawMessage 3636 err := json.Unmarshal(body, &m) 3637 if err != nil { 3638 return err 3639 } 3640 for k, v := range m { 3641 switch k { 3642 case "properties": 3643 if v != nil { 3644 var dedicatedHostProperties DedicatedHostProperties 3645 err = json.Unmarshal(*v, &dedicatedHostProperties) 3646 if err != nil { 3647 return err 3648 } 3649 dhu.DedicatedHostProperties = &dedicatedHostProperties 3650 } 3651 case "tags": 3652 if v != nil { 3653 var tags map[string]*string 3654 err = json.Unmarshal(*v, &tags) 3655 if err != nil { 3656 return err 3657 } 3658 dhu.Tags = tags 3659 } 3660 } 3661 } 3662 3663 return nil 3664} 3665 3666// DiagnosticsProfile specifies the boot diagnostic settings state. <br><br>Minimum api-version: 3667// 2015-06-15. 3668type DiagnosticsProfile struct { 3669 // 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. 3670 BootDiagnostics *BootDiagnostics `json:"bootDiagnostics,omitempty"` 3671} 3672 3673// DiffDiskSettings describes the parameters of ephemeral disk settings that can be specified for operating 3674// system disk. <br><br> NOTE: The ephemeral disk settings can only be specified for managed disk. 3675type DiffDiskSettings struct { 3676 // Option - Specifies the ephemeral disk settings for operating system disk. Possible values include: 'DiffDiskOptionsLocal' 3677 Option DiffDiskOptions `json:"option,omitempty"` 3678 // 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' 3679 Placement DiffDiskPlacement `json:"placement,omitempty"` 3680} 3681 3682// Disallowed describes the disallowed disk types. 3683type Disallowed struct { 3684 // DiskTypes - A list of disk types. 3685 DiskTypes *[]string `json:"diskTypes,omitempty"` 3686} 3687 3688// DisallowedConfiguration specifies the disallowed configuration for a virtual machine image. 3689type DisallowedConfiguration struct { 3690 // VMDiskType - VM disk types which are disallowed. Possible values include: 'VMDiskTypesNone', 'VMDiskTypesUnmanaged' 3691 VMDiskType VMDiskTypes `json:"vmDiskType,omitempty"` 3692} 3693 3694// Disk disk resource. 3695type Disk struct { 3696 autorest.Response `json:"-"` 3697 // ManagedBy - READ-ONLY; A relative URI containing the ID of the VM that has the disk attached. 3698 ManagedBy *string `json:"managedBy,omitempty"` 3699 // 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. 3700 ManagedByExtended *[]string `json:"managedByExtended,omitempty"` 3701 Sku *DiskSku `json:"sku,omitempty"` 3702 // Zones - The Logical zone list for Disk. 3703 Zones *[]string `json:"zones,omitempty"` 3704 // ExtendedLocation - The extended location where the disk will be created. Extended location cannot be changed. 3705 ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` 3706 *DiskProperties `json:"properties,omitempty"` 3707 // ID - READ-ONLY; Resource Id 3708 ID *string `json:"id,omitempty"` 3709 // Name - READ-ONLY; Resource name 3710 Name *string `json:"name,omitempty"` 3711 // Type - READ-ONLY; Resource type 3712 Type *string `json:"type,omitempty"` 3713 // Location - Resource location 3714 Location *string `json:"location,omitempty"` 3715 // Tags - Resource tags 3716 Tags map[string]*string `json:"tags"` 3717} 3718 3719// MarshalJSON is the custom marshaler for Disk. 3720func (d Disk) MarshalJSON() ([]byte, error) { 3721 objectMap := make(map[string]interface{}) 3722 if d.Sku != nil { 3723 objectMap["sku"] = d.Sku 3724 } 3725 if d.Zones != nil { 3726 objectMap["zones"] = d.Zones 3727 } 3728 if d.ExtendedLocation != nil { 3729 objectMap["extendedLocation"] = d.ExtendedLocation 3730 } 3731 if d.DiskProperties != nil { 3732 objectMap["properties"] = d.DiskProperties 3733 } 3734 if d.Location != nil { 3735 objectMap["location"] = d.Location 3736 } 3737 if d.Tags != nil { 3738 objectMap["tags"] = d.Tags 3739 } 3740 return json.Marshal(objectMap) 3741} 3742 3743// UnmarshalJSON is the custom unmarshaler for Disk struct. 3744func (d *Disk) UnmarshalJSON(body []byte) error { 3745 var m map[string]*json.RawMessage 3746 err := json.Unmarshal(body, &m) 3747 if err != nil { 3748 return err 3749 } 3750 for k, v := range m { 3751 switch k { 3752 case "managedBy": 3753 if v != nil { 3754 var managedBy string 3755 err = json.Unmarshal(*v, &managedBy) 3756 if err != nil { 3757 return err 3758 } 3759 d.ManagedBy = &managedBy 3760 } 3761 case "managedByExtended": 3762 if v != nil { 3763 var managedByExtended []string 3764 err = json.Unmarshal(*v, &managedByExtended) 3765 if err != nil { 3766 return err 3767 } 3768 d.ManagedByExtended = &managedByExtended 3769 } 3770 case "sku": 3771 if v != nil { 3772 var sku DiskSku 3773 err = json.Unmarshal(*v, &sku) 3774 if err != nil { 3775 return err 3776 } 3777 d.Sku = &sku 3778 } 3779 case "zones": 3780 if v != nil { 3781 var zones []string 3782 err = json.Unmarshal(*v, &zones) 3783 if err != nil { 3784 return err 3785 } 3786 d.Zones = &zones 3787 } 3788 case "extendedLocation": 3789 if v != nil { 3790 var extendedLocation ExtendedLocation 3791 err = json.Unmarshal(*v, &extendedLocation) 3792 if err != nil { 3793 return err 3794 } 3795 d.ExtendedLocation = &extendedLocation 3796 } 3797 case "properties": 3798 if v != nil { 3799 var diskProperties DiskProperties 3800 err = json.Unmarshal(*v, &diskProperties) 3801 if err != nil { 3802 return err 3803 } 3804 d.DiskProperties = &diskProperties 3805 } 3806 case "id": 3807 if v != nil { 3808 var ID string 3809 err = json.Unmarshal(*v, &ID) 3810 if err != nil { 3811 return err 3812 } 3813 d.ID = &ID 3814 } 3815 case "name": 3816 if v != nil { 3817 var name string 3818 err = json.Unmarshal(*v, &name) 3819 if err != nil { 3820 return err 3821 } 3822 d.Name = &name 3823 } 3824 case "type": 3825 if v != nil { 3826 var typeVar string 3827 err = json.Unmarshal(*v, &typeVar) 3828 if err != nil { 3829 return err 3830 } 3831 d.Type = &typeVar 3832 } 3833 case "location": 3834 if v != nil { 3835 var location string 3836 err = json.Unmarshal(*v, &location) 3837 if err != nil { 3838 return err 3839 } 3840 d.Location = &location 3841 } 3842 case "tags": 3843 if v != nil { 3844 var tags map[string]*string 3845 err = json.Unmarshal(*v, &tags) 3846 if err != nil { 3847 return err 3848 } 3849 d.Tags = tags 3850 } 3851 } 3852 } 3853 3854 return nil 3855} 3856 3857// DiskAccess disk access resource. 3858type DiskAccess struct { 3859 autorest.Response `json:"-"` 3860 *DiskAccessProperties `json:"properties,omitempty"` 3861 // ID - READ-ONLY; Resource Id 3862 ID *string `json:"id,omitempty"` 3863 // Name - READ-ONLY; Resource name 3864 Name *string `json:"name,omitempty"` 3865 // Type - READ-ONLY; Resource type 3866 Type *string `json:"type,omitempty"` 3867 // Location - Resource location 3868 Location *string `json:"location,omitempty"` 3869 // Tags - Resource tags 3870 Tags map[string]*string `json:"tags"` 3871} 3872 3873// MarshalJSON is the custom marshaler for DiskAccess. 3874func (da DiskAccess) MarshalJSON() ([]byte, error) { 3875 objectMap := make(map[string]interface{}) 3876 if da.DiskAccessProperties != nil { 3877 objectMap["properties"] = da.DiskAccessProperties 3878 } 3879 if da.Location != nil { 3880 objectMap["location"] = da.Location 3881 } 3882 if da.Tags != nil { 3883 objectMap["tags"] = da.Tags 3884 } 3885 return json.Marshal(objectMap) 3886} 3887 3888// UnmarshalJSON is the custom unmarshaler for DiskAccess struct. 3889func (da *DiskAccess) UnmarshalJSON(body []byte) error { 3890 var m map[string]*json.RawMessage 3891 err := json.Unmarshal(body, &m) 3892 if err != nil { 3893 return err 3894 } 3895 for k, v := range m { 3896 switch k { 3897 case "properties": 3898 if v != nil { 3899 var diskAccessProperties DiskAccessProperties 3900 err = json.Unmarshal(*v, &diskAccessProperties) 3901 if err != nil { 3902 return err 3903 } 3904 da.DiskAccessProperties = &diskAccessProperties 3905 } 3906 case "id": 3907 if v != nil { 3908 var ID string 3909 err = json.Unmarshal(*v, &ID) 3910 if err != nil { 3911 return err 3912 } 3913 da.ID = &ID 3914 } 3915 case "name": 3916 if v != nil { 3917 var name string 3918 err = json.Unmarshal(*v, &name) 3919 if err != nil { 3920 return err 3921 } 3922 da.Name = &name 3923 } 3924 case "type": 3925 if v != nil { 3926 var typeVar string 3927 err = json.Unmarshal(*v, &typeVar) 3928 if err != nil { 3929 return err 3930 } 3931 da.Type = &typeVar 3932 } 3933 case "location": 3934 if v != nil { 3935 var location string 3936 err = json.Unmarshal(*v, &location) 3937 if err != nil { 3938 return err 3939 } 3940 da.Location = &location 3941 } 3942 case "tags": 3943 if v != nil { 3944 var tags map[string]*string 3945 err = json.Unmarshal(*v, &tags) 3946 if err != nil { 3947 return err 3948 } 3949 da.Tags = tags 3950 } 3951 } 3952 } 3953 3954 return nil 3955} 3956 3957// DiskAccessesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 3958// long-running operation. 3959type DiskAccessesCreateOrUpdateFuture struct { 3960 azure.FutureAPI 3961 // Result returns the result of the asynchronous operation. 3962 // If the operation has not completed it will return an error. 3963 Result func(DiskAccessesClient) (DiskAccess, error) 3964} 3965 3966// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3967func (future *DiskAccessesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 3968 var azFuture azure.Future 3969 if err := json.Unmarshal(body, &azFuture); err != nil { 3970 return err 3971 } 3972 future.FutureAPI = &azFuture 3973 future.Result = future.result 3974 return nil 3975} 3976 3977// result is the default implementation for DiskAccessesCreateOrUpdateFuture.Result. 3978func (future *DiskAccessesCreateOrUpdateFuture) result(client DiskAccessesClient) (da DiskAccess, err error) { 3979 var done bool 3980 done, err = future.DoneWithContext(context.Background(), client) 3981 if err != nil { 3982 err = autorest.NewErrorWithError(err, "compute.DiskAccessesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 3983 return 3984 } 3985 if !done { 3986 da.Response.Response = future.Response() 3987 err = azure.NewAsyncOpIncompleteError("compute.DiskAccessesCreateOrUpdateFuture") 3988 return 3989 } 3990 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3991 if da.Response.Response, err = future.GetResult(sender); err == nil && da.Response.Response.StatusCode != http.StatusNoContent { 3992 da, err = client.CreateOrUpdateResponder(da.Response.Response) 3993 if err != nil { 3994 err = autorest.NewErrorWithError(err, "compute.DiskAccessesCreateOrUpdateFuture", "Result", da.Response.Response, "Failure responding to request") 3995 } 3996 } 3997 return 3998} 3999 4000// DiskAccessesDeleteAPrivateEndpointConnectionFuture an abstraction for monitoring and retrieving the 4001// results of a long-running operation. 4002type DiskAccessesDeleteAPrivateEndpointConnectionFuture struct { 4003 azure.FutureAPI 4004 // Result returns the result of the asynchronous operation. 4005 // If the operation has not completed it will return an error. 4006 Result func(DiskAccessesClient) (autorest.Response, error) 4007} 4008 4009// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4010func (future *DiskAccessesDeleteAPrivateEndpointConnectionFuture) UnmarshalJSON(body []byte) error { 4011 var azFuture azure.Future 4012 if err := json.Unmarshal(body, &azFuture); err != nil { 4013 return err 4014 } 4015 future.FutureAPI = &azFuture 4016 future.Result = future.result 4017 return nil 4018} 4019 4020// result is the default implementation for DiskAccessesDeleteAPrivateEndpointConnectionFuture.Result. 4021func (future *DiskAccessesDeleteAPrivateEndpointConnectionFuture) result(client DiskAccessesClient) (ar autorest.Response, err error) { 4022 var done bool 4023 done, err = future.DoneWithContext(context.Background(), client) 4024 if err != nil { 4025 err = autorest.NewErrorWithError(err, "compute.DiskAccessesDeleteAPrivateEndpointConnectionFuture", "Result", future.Response(), "Polling failure") 4026 return 4027 } 4028 if !done { 4029 ar.Response = future.Response() 4030 err = azure.NewAsyncOpIncompleteError("compute.DiskAccessesDeleteAPrivateEndpointConnectionFuture") 4031 return 4032 } 4033 ar.Response = future.Response() 4034 return 4035} 4036 4037// DiskAccessesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 4038// operation. 4039type DiskAccessesDeleteFuture struct { 4040 azure.FutureAPI 4041 // Result returns the result of the asynchronous operation. 4042 // If the operation has not completed it will return an error. 4043 Result func(DiskAccessesClient) (autorest.Response, error) 4044} 4045 4046// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4047func (future *DiskAccessesDeleteFuture) UnmarshalJSON(body []byte) error { 4048 var azFuture azure.Future 4049 if err := json.Unmarshal(body, &azFuture); err != nil { 4050 return err 4051 } 4052 future.FutureAPI = &azFuture 4053 future.Result = future.result 4054 return nil 4055} 4056 4057// result is the default implementation for DiskAccessesDeleteFuture.Result. 4058func (future *DiskAccessesDeleteFuture) result(client DiskAccessesClient) (ar autorest.Response, err error) { 4059 var done bool 4060 done, err = future.DoneWithContext(context.Background(), client) 4061 if err != nil { 4062 err = autorest.NewErrorWithError(err, "compute.DiskAccessesDeleteFuture", "Result", future.Response(), "Polling failure") 4063 return 4064 } 4065 if !done { 4066 ar.Response = future.Response() 4067 err = azure.NewAsyncOpIncompleteError("compute.DiskAccessesDeleteFuture") 4068 return 4069 } 4070 ar.Response = future.Response() 4071 return 4072} 4073 4074// DiskAccessesUpdateAPrivateEndpointConnectionFuture an abstraction for monitoring and retrieving the 4075// results of a long-running operation. 4076type DiskAccessesUpdateAPrivateEndpointConnectionFuture struct { 4077 azure.FutureAPI 4078 // Result returns the result of the asynchronous operation. 4079 // If the operation has not completed it will return an error. 4080 Result func(DiskAccessesClient) (PrivateEndpointConnection, error) 4081} 4082 4083// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4084func (future *DiskAccessesUpdateAPrivateEndpointConnectionFuture) UnmarshalJSON(body []byte) error { 4085 var azFuture azure.Future 4086 if err := json.Unmarshal(body, &azFuture); err != nil { 4087 return err 4088 } 4089 future.FutureAPI = &azFuture 4090 future.Result = future.result 4091 return nil 4092} 4093 4094// result is the default implementation for DiskAccessesUpdateAPrivateEndpointConnectionFuture.Result. 4095func (future *DiskAccessesUpdateAPrivateEndpointConnectionFuture) result(client DiskAccessesClient) (pec PrivateEndpointConnection, err error) { 4096 var done bool 4097 done, err = future.DoneWithContext(context.Background(), client) 4098 if err != nil { 4099 err = autorest.NewErrorWithError(err, "compute.DiskAccessesUpdateAPrivateEndpointConnectionFuture", "Result", future.Response(), "Polling failure") 4100 return 4101 } 4102 if !done { 4103 pec.Response.Response = future.Response() 4104 err = azure.NewAsyncOpIncompleteError("compute.DiskAccessesUpdateAPrivateEndpointConnectionFuture") 4105 return 4106 } 4107 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4108 if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent { 4109 pec, err = client.UpdateAPrivateEndpointConnectionResponder(pec.Response.Response) 4110 if err != nil { 4111 err = autorest.NewErrorWithError(err, "compute.DiskAccessesUpdateAPrivateEndpointConnectionFuture", "Result", pec.Response.Response, "Failure responding to request") 4112 } 4113 } 4114 return 4115} 4116 4117// DiskAccessesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 4118// operation. 4119type DiskAccessesUpdateFuture struct { 4120 azure.FutureAPI 4121 // Result returns the result of the asynchronous operation. 4122 // If the operation has not completed it will return an error. 4123 Result func(DiskAccessesClient) (DiskAccess, error) 4124} 4125 4126// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4127func (future *DiskAccessesUpdateFuture) UnmarshalJSON(body []byte) error { 4128 var azFuture azure.Future 4129 if err := json.Unmarshal(body, &azFuture); err != nil { 4130 return err 4131 } 4132 future.FutureAPI = &azFuture 4133 future.Result = future.result 4134 return nil 4135} 4136 4137// result is the default implementation for DiskAccessesUpdateFuture.Result. 4138func (future *DiskAccessesUpdateFuture) result(client DiskAccessesClient) (da DiskAccess, err error) { 4139 var done bool 4140 done, err = future.DoneWithContext(context.Background(), client) 4141 if err != nil { 4142 err = autorest.NewErrorWithError(err, "compute.DiskAccessesUpdateFuture", "Result", future.Response(), "Polling failure") 4143 return 4144 } 4145 if !done { 4146 da.Response.Response = future.Response() 4147 err = azure.NewAsyncOpIncompleteError("compute.DiskAccessesUpdateFuture") 4148 return 4149 } 4150 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4151 if da.Response.Response, err = future.GetResult(sender); err == nil && da.Response.Response.StatusCode != http.StatusNoContent { 4152 da, err = client.UpdateResponder(da.Response.Response) 4153 if err != nil { 4154 err = autorest.NewErrorWithError(err, "compute.DiskAccessesUpdateFuture", "Result", da.Response.Response, "Failure responding to request") 4155 } 4156 } 4157 return 4158} 4159 4160// DiskAccessList the List disk access operation response. 4161type DiskAccessList struct { 4162 autorest.Response `json:"-"` 4163 // Value - A list of disk access resources. 4164 Value *[]DiskAccess `json:"value,omitempty"` 4165 // 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. 4166 NextLink *string `json:"nextLink,omitempty"` 4167} 4168 4169// DiskAccessListIterator provides access to a complete listing of DiskAccess values. 4170type DiskAccessListIterator struct { 4171 i int 4172 page DiskAccessListPage 4173} 4174 4175// NextWithContext advances to the next value. If there was an error making 4176// the request the iterator does not advance and the error is returned. 4177func (iter *DiskAccessListIterator) NextWithContext(ctx context.Context) (err error) { 4178 if tracing.IsEnabled() { 4179 ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessListIterator.NextWithContext") 4180 defer func() { 4181 sc := -1 4182 if iter.Response().Response.Response != nil { 4183 sc = iter.Response().Response.Response.StatusCode 4184 } 4185 tracing.EndSpan(ctx, sc, err) 4186 }() 4187 } 4188 iter.i++ 4189 if iter.i < len(iter.page.Values()) { 4190 return nil 4191 } 4192 err = iter.page.NextWithContext(ctx) 4193 if err != nil { 4194 iter.i-- 4195 return err 4196 } 4197 iter.i = 0 4198 return nil 4199} 4200 4201// Next advances to the next value. If there was an error making 4202// the request the iterator does not advance and the error is returned. 4203// Deprecated: Use NextWithContext() instead. 4204func (iter *DiskAccessListIterator) Next() error { 4205 return iter.NextWithContext(context.Background()) 4206} 4207 4208// NotDone returns true if the enumeration should be started or is not yet complete. 4209func (iter DiskAccessListIterator) NotDone() bool { 4210 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4211} 4212 4213// Response returns the raw server response from the last page request. 4214func (iter DiskAccessListIterator) Response() DiskAccessList { 4215 return iter.page.Response() 4216} 4217 4218// Value returns the current value or a zero-initialized value if the 4219// iterator has advanced beyond the end of the collection. 4220func (iter DiskAccessListIterator) Value() DiskAccess { 4221 if !iter.page.NotDone() { 4222 return DiskAccess{} 4223 } 4224 return iter.page.Values()[iter.i] 4225} 4226 4227// Creates a new instance of the DiskAccessListIterator type. 4228func NewDiskAccessListIterator(page DiskAccessListPage) DiskAccessListIterator { 4229 return DiskAccessListIterator{page: page} 4230} 4231 4232// IsEmpty returns true if the ListResult contains no values. 4233func (dal DiskAccessList) IsEmpty() bool { 4234 return dal.Value == nil || len(*dal.Value) == 0 4235} 4236 4237// hasNextLink returns true if the NextLink is not empty. 4238func (dal DiskAccessList) hasNextLink() bool { 4239 return dal.NextLink != nil && len(*dal.NextLink) != 0 4240} 4241 4242// diskAccessListPreparer prepares a request to retrieve the next set of results. 4243// It returns nil if no more results exist. 4244func (dal DiskAccessList) diskAccessListPreparer(ctx context.Context) (*http.Request, error) { 4245 if !dal.hasNextLink() { 4246 return nil, nil 4247 } 4248 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4249 autorest.AsJSON(), 4250 autorest.AsGet(), 4251 autorest.WithBaseURL(to.String(dal.NextLink))) 4252} 4253 4254// DiskAccessListPage contains a page of DiskAccess values. 4255type DiskAccessListPage struct { 4256 fn func(context.Context, DiskAccessList) (DiskAccessList, error) 4257 dal DiskAccessList 4258} 4259 4260// NextWithContext advances to the next page of values. If there was an error making 4261// the request the page does not advance and the error is returned. 4262func (page *DiskAccessListPage) NextWithContext(ctx context.Context) (err error) { 4263 if tracing.IsEnabled() { 4264 ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessListPage.NextWithContext") 4265 defer func() { 4266 sc := -1 4267 if page.Response().Response.Response != nil { 4268 sc = page.Response().Response.Response.StatusCode 4269 } 4270 tracing.EndSpan(ctx, sc, err) 4271 }() 4272 } 4273 for { 4274 next, err := page.fn(ctx, page.dal) 4275 if err != nil { 4276 return err 4277 } 4278 page.dal = next 4279 if !next.hasNextLink() || !next.IsEmpty() { 4280 break 4281 } 4282 } 4283 return nil 4284} 4285 4286// Next advances to the next page of values. If there was an error making 4287// the request the page does not advance and the error is returned. 4288// Deprecated: Use NextWithContext() instead. 4289func (page *DiskAccessListPage) Next() error { 4290 return page.NextWithContext(context.Background()) 4291} 4292 4293// NotDone returns true if the page enumeration should be started or is not yet complete. 4294func (page DiskAccessListPage) NotDone() bool { 4295 return !page.dal.IsEmpty() 4296} 4297 4298// Response returns the raw server response from the last page request. 4299func (page DiskAccessListPage) Response() DiskAccessList { 4300 return page.dal 4301} 4302 4303// Values returns the slice of values for the current page or nil if there are no values. 4304func (page DiskAccessListPage) Values() []DiskAccess { 4305 if page.dal.IsEmpty() { 4306 return nil 4307 } 4308 return *page.dal.Value 4309} 4310 4311// Creates a new instance of the DiskAccessListPage type. 4312func NewDiskAccessListPage(cur DiskAccessList, getNextPage func(context.Context, DiskAccessList) (DiskAccessList, error)) DiskAccessListPage { 4313 return DiskAccessListPage{ 4314 fn: getNextPage, 4315 dal: cur, 4316 } 4317} 4318 4319// DiskAccessProperties ... 4320type DiskAccessProperties struct { 4321 // PrivateEndpointConnections - READ-ONLY; A readonly collection of private endpoint connections created on the disk. Currently only one endpoint connection is supported. 4322 PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` 4323 // ProvisioningState - READ-ONLY; The disk access resource provisioning state. 4324 ProvisioningState *string `json:"provisioningState,omitempty"` 4325 // TimeCreated - READ-ONLY; The time when the disk access was created. 4326 TimeCreated *date.Time `json:"timeCreated,omitempty"` 4327} 4328 4329// MarshalJSON is the custom marshaler for DiskAccessProperties. 4330func (dap DiskAccessProperties) MarshalJSON() ([]byte, error) { 4331 objectMap := make(map[string]interface{}) 4332 return json.Marshal(objectMap) 4333} 4334 4335// DiskAccessUpdate used for updating a disk access resource. 4336type DiskAccessUpdate struct { 4337 // Tags - Resource tags 4338 Tags map[string]*string `json:"tags"` 4339} 4340 4341// MarshalJSON is the custom marshaler for DiskAccessUpdate. 4342func (dau DiskAccessUpdate) MarshalJSON() ([]byte, error) { 4343 objectMap := make(map[string]interface{}) 4344 if dau.Tags != nil { 4345 objectMap["tags"] = dau.Tags 4346 } 4347 return json.Marshal(objectMap) 4348} 4349 4350// DiskEncryptionSet disk encryption set resource. 4351type DiskEncryptionSet struct { 4352 autorest.Response `json:"-"` 4353 Identity *EncryptionSetIdentity `json:"identity,omitempty"` 4354 *EncryptionSetProperties `json:"properties,omitempty"` 4355 // ID - READ-ONLY; Resource Id 4356 ID *string `json:"id,omitempty"` 4357 // Name - READ-ONLY; Resource name 4358 Name *string `json:"name,omitempty"` 4359 // Type - READ-ONLY; Resource type 4360 Type *string `json:"type,omitempty"` 4361 // Location - Resource location 4362 Location *string `json:"location,omitempty"` 4363 // Tags - Resource tags 4364 Tags map[string]*string `json:"tags"` 4365} 4366 4367// MarshalJSON is the custom marshaler for DiskEncryptionSet. 4368func (desVar DiskEncryptionSet) MarshalJSON() ([]byte, error) { 4369 objectMap := make(map[string]interface{}) 4370 if desVar.Identity != nil { 4371 objectMap["identity"] = desVar.Identity 4372 } 4373 if desVar.EncryptionSetProperties != nil { 4374 objectMap["properties"] = desVar.EncryptionSetProperties 4375 } 4376 if desVar.Location != nil { 4377 objectMap["location"] = desVar.Location 4378 } 4379 if desVar.Tags != nil { 4380 objectMap["tags"] = desVar.Tags 4381 } 4382 return json.Marshal(objectMap) 4383} 4384 4385// UnmarshalJSON is the custom unmarshaler for DiskEncryptionSet struct. 4386func (desVar *DiskEncryptionSet) UnmarshalJSON(body []byte) error { 4387 var m map[string]*json.RawMessage 4388 err := json.Unmarshal(body, &m) 4389 if err != nil { 4390 return err 4391 } 4392 for k, v := range m { 4393 switch k { 4394 case "identity": 4395 if v != nil { 4396 var identity EncryptionSetIdentity 4397 err = json.Unmarshal(*v, &identity) 4398 if err != nil { 4399 return err 4400 } 4401 desVar.Identity = &identity 4402 } 4403 case "properties": 4404 if v != nil { 4405 var encryptionSetProperties EncryptionSetProperties 4406 err = json.Unmarshal(*v, &encryptionSetProperties) 4407 if err != nil { 4408 return err 4409 } 4410 desVar.EncryptionSetProperties = &encryptionSetProperties 4411 } 4412 case "id": 4413 if v != nil { 4414 var ID string 4415 err = json.Unmarshal(*v, &ID) 4416 if err != nil { 4417 return err 4418 } 4419 desVar.ID = &ID 4420 } 4421 case "name": 4422 if v != nil { 4423 var name string 4424 err = json.Unmarshal(*v, &name) 4425 if err != nil { 4426 return err 4427 } 4428 desVar.Name = &name 4429 } 4430 case "type": 4431 if v != nil { 4432 var typeVar string 4433 err = json.Unmarshal(*v, &typeVar) 4434 if err != nil { 4435 return err 4436 } 4437 desVar.Type = &typeVar 4438 } 4439 case "location": 4440 if v != nil { 4441 var location string 4442 err = json.Unmarshal(*v, &location) 4443 if err != nil { 4444 return err 4445 } 4446 desVar.Location = &location 4447 } 4448 case "tags": 4449 if v != nil { 4450 var tags map[string]*string 4451 err = json.Unmarshal(*v, &tags) 4452 if err != nil { 4453 return err 4454 } 4455 desVar.Tags = tags 4456 } 4457 } 4458 } 4459 4460 return nil 4461} 4462 4463// DiskEncryptionSetList the List disk encryption set operation response. 4464type DiskEncryptionSetList struct { 4465 autorest.Response `json:"-"` 4466 // Value - A list of disk encryption sets. 4467 Value *[]DiskEncryptionSet `json:"value,omitempty"` 4468 // 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. 4469 NextLink *string `json:"nextLink,omitempty"` 4470} 4471 4472// DiskEncryptionSetListIterator provides access to a complete listing of DiskEncryptionSet values. 4473type DiskEncryptionSetListIterator struct { 4474 i int 4475 page DiskEncryptionSetListPage 4476} 4477 4478// NextWithContext advances to the next value. If there was an error making 4479// the request the iterator does not advance and the error is returned. 4480func (iter *DiskEncryptionSetListIterator) NextWithContext(ctx context.Context) (err error) { 4481 if tracing.IsEnabled() { 4482 ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetListIterator.NextWithContext") 4483 defer func() { 4484 sc := -1 4485 if iter.Response().Response.Response != nil { 4486 sc = iter.Response().Response.Response.StatusCode 4487 } 4488 tracing.EndSpan(ctx, sc, err) 4489 }() 4490 } 4491 iter.i++ 4492 if iter.i < len(iter.page.Values()) { 4493 return nil 4494 } 4495 err = iter.page.NextWithContext(ctx) 4496 if err != nil { 4497 iter.i-- 4498 return err 4499 } 4500 iter.i = 0 4501 return nil 4502} 4503 4504// Next advances to the next value. If there was an error making 4505// the request the iterator does not advance and the error is returned. 4506// Deprecated: Use NextWithContext() instead. 4507func (iter *DiskEncryptionSetListIterator) Next() error { 4508 return iter.NextWithContext(context.Background()) 4509} 4510 4511// NotDone returns true if the enumeration should be started or is not yet complete. 4512func (iter DiskEncryptionSetListIterator) NotDone() bool { 4513 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4514} 4515 4516// Response returns the raw server response from the last page request. 4517func (iter DiskEncryptionSetListIterator) Response() DiskEncryptionSetList { 4518 return iter.page.Response() 4519} 4520 4521// Value returns the current value or a zero-initialized value if the 4522// iterator has advanced beyond the end of the collection. 4523func (iter DiskEncryptionSetListIterator) Value() DiskEncryptionSet { 4524 if !iter.page.NotDone() { 4525 return DiskEncryptionSet{} 4526 } 4527 return iter.page.Values()[iter.i] 4528} 4529 4530// Creates a new instance of the DiskEncryptionSetListIterator type. 4531func NewDiskEncryptionSetListIterator(page DiskEncryptionSetListPage) DiskEncryptionSetListIterator { 4532 return DiskEncryptionSetListIterator{page: page} 4533} 4534 4535// IsEmpty returns true if the ListResult contains no values. 4536func (desl DiskEncryptionSetList) IsEmpty() bool { 4537 return desl.Value == nil || len(*desl.Value) == 0 4538} 4539 4540// hasNextLink returns true if the NextLink is not empty. 4541func (desl DiskEncryptionSetList) hasNextLink() bool { 4542 return desl.NextLink != nil && len(*desl.NextLink) != 0 4543} 4544 4545// diskEncryptionSetListPreparer prepares a request to retrieve the next set of results. 4546// It returns nil if no more results exist. 4547func (desl DiskEncryptionSetList) diskEncryptionSetListPreparer(ctx context.Context) (*http.Request, error) { 4548 if !desl.hasNextLink() { 4549 return nil, nil 4550 } 4551 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4552 autorest.AsJSON(), 4553 autorest.AsGet(), 4554 autorest.WithBaseURL(to.String(desl.NextLink))) 4555} 4556 4557// DiskEncryptionSetListPage contains a page of DiskEncryptionSet values. 4558type DiskEncryptionSetListPage struct { 4559 fn func(context.Context, DiskEncryptionSetList) (DiskEncryptionSetList, error) 4560 desl DiskEncryptionSetList 4561} 4562 4563// NextWithContext advances to the next page of values. If there was an error making 4564// the request the page does not advance and the error is returned. 4565func (page *DiskEncryptionSetListPage) NextWithContext(ctx context.Context) (err error) { 4566 if tracing.IsEnabled() { 4567 ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetListPage.NextWithContext") 4568 defer func() { 4569 sc := -1 4570 if page.Response().Response.Response != nil { 4571 sc = page.Response().Response.Response.StatusCode 4572 } 4573 tracing.EndSpan(ctx, sc, err) 4574 }() 4575 } 4576 for { 4577 next, err := page.fn(ctx, page.desl) 4578 if err != nil { 4579 return err 4580 } 4581 page.desl = next 4582 if !next.hasNextLink() || !next.IsEmpty() { 4583 break 4584 } 4585 } 4586 return nil 4587} 4588 4589// Next advances to the next page of values. If there was an error making 4590// the request the page does not advance and the error is returned. 4591// Deprecated: Use NextWithContext() instead. 4592func (page *DiskEncryptionSetListPage) Next() error { 4593 return page.NextWithContext(context.Background()) 4594} 4595 4596// NotDone returns true if the page enumeration should be started or is not yet complete. 4597func (page DiskEncryptionSetListPage) NotDone() bool { 4598 return !page.desl.IsEmpty() 4599} 4600 4601// Response returns the raw server response from the last page request. 4602func (page DiskEncryptionSetListPage) Response() DiskEncryptionSetList { 4603 return page.desl 4604} 4605 4606// Values returns the slice of values for the current page or nil if there are no values. 4607func (page DiskEncryptionSetListPage) Values() []DiskEncryptionSet { 4608 if page.desl.IsEmpty() { 4609 return nil 4610 } 4611 return *page.desl.Value 4612} 4613 4614// Creates a new instance of the DiskEncryptionSetListPage type. 4615func NewDiskEncryptionSetListPage(cur DiskEncryptionSetList, getNextPage func(context.Context, DiskEncryptionSetList) (DiskEncryptionSetList, error)) DiskEncryptionSetListPage { 4616 return DiskEncryptionSetListPage{ 4617 fn: getNextPage, 4618 desl: cur, 4619 } 4620} 4621 4622// DiskEncryptionSetParameters describes the parameter of customer managed disk encryption set resource id 4623// that can be specified for disk. <br><br> NOTE: The disk encryption set resource id can only be specified 4624// for managed disk. Please refer https://aka.ms/mdssewithcmkoverview for more details. 4625type DiskEncryptionSetParameters struct { 4626 // ID - Resource Id 4627 ID *string `json:"id,omitempty"` 4628} 4629 4630// DiskEncryptionSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 4631// long-running operation. 4632type DiskEncryptionSetsCreateOrUpdateFuture struct { 4633 azure.FutureAPI 4634 // Result returns the result of the asynchronous operation. 4635 // If the operation has not completed it will return an error. 4636 Result func(DiskEncryptionSetsClient) (DiskEncryptionSet, error) 4637} 4638 4639// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4640func (future *DiskEncryptionSetsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 4641 var azFuture azure.Future 4642 if err := json.Unmarshal(body, &azFuture); err != nil { 4643 return err 4644 } 4645 future.FutureAPI = &azFuture 4646 future.Result = future.result 4647 return nil 4648} 4649 4650// result is the default implementation for DiskEncryptionSetsCreateOrUpdateFuture.Result. 4651func (future *DiskEncryptionSetsCreateOrUpdateFuture) result(client DiskEncryptionSetsClient) (desVar DiskEncryptionSet, err error) { 4652 var done bool 4653 done, err = future.DoneWithContext(context.Background(), client) 4654 if err != nil { 4655 err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 4656 return 4657 } 4658 if !done { 4659 desVar.Response.Response = future.Response() 4660 err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsCreateOrUpdateFuture") 4661 return 4662 } 4663 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4664 if desVar.Response.Response, err = future.GetResult(sender); err == nil && desVar.Response.Response.StatusCode != http.StatusNoContent { 4665 desVar, err = client.CreateOrUpdateResponder(desVar.Response.Response) 4666 if err != nil { 4667 err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsCreateOrUpdateFuture", "Result", desVar.Response.Response, "Failure responding to request") 4668 } 4669 } 4670 return 4671} 4672 4673// DiskEncryptionSetsDeleteFuture an abstraction for monitoring and retrieving the results of a 4674// long-running operation. 4675type DiskEncryptionSetsDeleteFuture struct { 4676 azure.FutureAPI 4677 // Result returns the result of the asynchronous operation. 4678 // If the operation has not completed it will return an error. 4679 Result func(DiskEncryptionSetsClient) (autorest.Response, error) 4680} 4681 4682// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4683func (future *DiskEncryptionSetsDeleteFuture) UnmarshalJSON(body []byte) error { 4684 var azFuture azure.Future 4685 if err := json.Unmarshal(body, &azFuture); err != nil { 4686 return err 4687 } 4688 future.FutureAPI = &azFuture 4689 future.Result = future.result 4690 return nil 4691} 4692 4693// result is the default implementation for DiskEncryptionSetsDeleteFuture.Result. 4694func (future *DiskEncryptionSetsDeleteFuture) result(client DiskEncryptionSetsClient) (ar autorest.Response, err error) { 4695 var done bool 4696 done, err = future.DoneWithContext(context.Background(), client) 4697 if err != nil { 4698 err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsDeleteFuture", "Result", future.Response(), "Polling failure") 4699 return 4700 } 4701 if !done { 4702 ar.Response = future.Response() 4703 err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsDeleteFuture") 4704 return 4705 } 4706 ar.Response = future.Response() 4707 return 4708} 4709 4710// DiskEncryptionSetsUpdateFuture an abstraction for monitoring and retrieving the results of a 4711// long-running operation. 4712type DiskEncryptionSetsUpdateFuture struct { 4713 azure.FutureAPI 4714 // Result returns the result of the asynchronous operation. 4715 // If the operation has not completed it will return an error. 4716 Result func(DiskEncryptionSetsClient) (DiskEncryptionSet, error) 4717} 4718 4719// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4720func (future *DiskEncryptionSetsUpdateFuture) UnmarshalJSON(body []byte) error { 4721 var azFuture azure.Future 4722 if err := json.Unmarshal(body, &azFuture); err != nil { 4723 return err 4724 } 4725 future.FutureAPI = &azFuture 4726 future.Result = future.result 4727 return nil 4728} 4729 4730// result is the default implementation for DiskEncryptionSetsUpdateFuture.Result. 4731func (future *DiskEncryptionSetsUpdateFuture) result(client DiskEncryptionSetsClient) (desVar DiskEncryptionSet, err error) { 4732 var done bool 4733 done, err = future.DoneWithContext(context.Background(), client) 4734 if err != nil { 4735 err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsUpdateFuture", "Result", future.Response(), "Polling failure") 4736 return 4737 } 4738 if !done { 4739 desVar.Response.Response = future.Response() 4740 err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsUpdateFuture") 4741 return 4742 } 4743 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4744 if desVar.Response.Response, err = future.GetResult(sender); err == nil && desVar.Response.Response.StatusCode != http.StatusNoContent { 4745 desVar, err = client.UpdateResponder(desVar.Response.Response) 4746 if err != nil { 4747 err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsUpdateFuture", "Result", desVar.Response.Response, "Failure responding to request") 4748 } 4749 } 4750 return 4751} 4752 4753// DiskEncryptionSettings describes a Encryption Settings for a Disk 4754type DiskEncryptionSettings struct { 4755 // DiskEncryptionKey - Specifies the location of the disk encryption key, which is a Key Vault Secret. 4756 DiskEncryptionKey *KeyVaultSecretReference `json:"diskEncryptionKey,omitempty"` 4757 // KeyEncryptionKey - Specifies the location of the key encryption key in Key Vault. 4758 KeyEncryptionKey *KeyVaultKeyReference `json:"keyEncryptionKey,omitempty"` 4759 // Enabled - Specifies whether disk encryption should be enabled on the virtual machine. 4760 Enabled *bool `json:"enabled,omitempty"` 4761} 4762 4763// DiskEncryptionSetUpdate disk encryption set update resource. 4764type DiskEncryptionSetUpdate struct { 4765 *DiskEncryptionSetUpdateProperties `json:"properties,omitempty"` 4766 // Tags - Resource tags 4767 Tags map[string]*string `json:"tags"` 4768 Identity *EncryptionSetIdentity `json:"identity,omitempty"` 4769} 4770 4771// MarshalJSON is the custom marshaler for DiskEncryptionSetUpdate. 4772func (desu DiskEncryptionSetUpdate) MarshalJSON() ([]byte, error) { 4773 objectMap := make(map[string]interface{}) 4774 if desu.DiskEncryptionSetUpdateProperties != nil { 4775 objectMap["properties"] = desu.DiskEncryptionSetUpdateProperties 4776 } 4777 if desu.Tags != nil { 4778 objectMap["tags"] = desu.Tags 4779 } 4780 if desu.Identity != nil { 4781 objectMap["identity"] = desu.Identity 4782 } 4783 return json.Marshal(objectMap) 4784} 4785 4786// UnmarshalJSON is the custom unmarshaler for DiskEncryptionSetUpdate struct. 4787func (desu *DiskEncryptionSetUpdate) UnmarshalJSON(body []byte) error { 4788 var m map[string]*json.RawMessage 4789 err := json.Unmarshal(body, &m) 4790 if err != nil { 4791 return err 4792 } 4793 for k, v := range m { 4794 switch k { 4795 case "properties": 4796 if v != nil { 4797 var diskEncryptionSetUpdateProperties DiskEncryptionSetUpdateProperties 4798 err = json.Unmarshal(*v, &diskEncryptionSetUpdateProperties) 4799 if err != nil { 4800 return err 4801 } 4802 desu.DiskEncryptionSetUpdateProperties = &diskEncryptionSetUpdateProperties 4803 } 4804 case "tags": 4805 if v != nil { 4806 var tags map[string]*string 4807 err = json.Unmarshal(*v, &tags) 4808 if err != nil { 4809 return err 4810 } 4811 desu.Tags = tags 4812 } 4813 case "identity": 4814 if v != nil { 4815 var identity EncryptionSetIdentity 4816 err = json.Unmarshal(*v, &identity) 4817 if err != nil { 4818 return err 4819 } 4820 desu.Identity = &identity 4821 } 4822 } 4823 } 4824 4825 return nil 4826} 4827 4828// DiskEncryptionSetUpdateProperties disk encryption set resource update properties. 4829type DiskEncryptionSetUpdateProperties struct { 4830 // EncryptionType - Possible values include: 'DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey', 'DiskEncryptionSetTypeEncryptionAtRestWithPlatformAndCustomerKeys' 4831 EncryptionType DiskEncryptionSetType `json:"encryptionType,omitempty"` 4832 ActiveKey *KeyForDiskEncryptionSet `json:"activeKey,omitempty"` 4833 // RotationToLatestKeyVersionEnabled - Set this flag to true to enable auto-updating of this disk encryption set to the latest key version. 4834 RotationToLatestKeyVersionEnabled *bool `json:"rotationToLatestKeyVersionEnabled,omitempty"` 4835} 4836 4837// DiskImageEncryption this is the disk image encryption base class. 4838type DiskImageEncryption struct { 4839 // DiskEncryptionSetID - A relative URI containing the resource ID of the disk encryption set. 4840 DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` 4841} 4842 4843// DiskInstanceView the instance view of the disk. 4844type DiskInstanceView struct { 4845 // Name - The disk name. 4846 Name *string `json:"name,omitempty"` 4847 // EncryptionSettings - Specifies the encryption settings for the OS Disk. <br><br> Minimum api-version: 2015-06-15 4848 EncryptionSettings *[]DiskEncryptionSettings `json:"encryptionSettings,omitempty"` 4849 // Statuses - The resource status information. 4850 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 4851} 4852 4853// DiskList the List Disks operation response. 4854type DiskList struct { 4855 autorest.Response `json:"-"` 4856 // Value - A list of disks. 4857 Value *[]Disk `json:"value,omitempty"` 4858 // NextLink - The uri to fetch the next page of disks. Call ListNext() with this to fetch the next page of disks. 4859 NextLink *string `json:"nextLink,omitempty"` 4860} 4861 4862// DiskListIterator provides access to a complete listing of Disk values. 4863type DiskListIterator struct { 4864 i int 4865 page DiskListPage 4866} 4867 4868// NextWithContext advances to the next value. If there was an error making 4869// the request the iterator does not advance and the error is returned. 4870func (iter *DiskListIterator) NextWithContext(ctx context.Context) (err error) { 4871 if tracing.IsEnabled() { 4872 ctx = tracing.StartSpan(ctx, fqdn+"/DiskListIterator.NextWithContext") 4873 defer func() { 4874 sc := -1 4875 if iter.Response().Response.Response != nil { 4876 sc = iter.Response().Response.Response.StatusCode 4877 } 4878 tracing.EndSpan(ctx, sc, err) 4879 }() 4880 } 4881 iter.i++ 4882 if iter.i < len(iter.page.Values()) { 4883 return nil 4884 } 4885 err = iter.page.NextWithContext(ctx) 4886 if err != nil { 4887 iter.i-- 4888 return err 4889 } 4890 iter.i = 0 4891 return nil 4892} 4893 4894// Next advances to the next value. If there was an error making 4895// the request the iterator does not advance and the error is returned. 4896// Deprecated: Use NextWithContext() instead. 4897func (iter *DiskListIterator) Next() error { 4898 return iter.NextWithContext(context.Background()) 4899} 4900 4901// NotDone returns true if the enumeration should be started or is not yet complete. 4902func (iter DiskListIterator) NotDone() bool { 4903 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4904} 4905 4906// Response returns the raw server response from the last page request. 4907func (iter DiskListIterator) Response() DiskList { 4908 return iter.page.Response() 4909} 4910 4911// Value returns the current value or a zero-initialized value if the 4912// iterator has advanced beyond the end of the collection. 4913func (iter DiskListIterator) Value() Disk { 4914 if !iter.page.NotDone() { 4915 return Disk{} 4916 } 4917 return iter.page.Values()[iter.i] 4918} 4919 4920// Creates a new instance of the DiskListIterator type. 4921func NewDiskListIterator(page DiskListPage) DiskListIterator { 4922 return DiskListIterator{page: page} 4923} 4924 4925// IsEmpty returns true if the ListResult contains no values. 4926func (dl DiskList) IsEmpty() bool { 4927 return dl.Value == nil || len(*dl.Value) == 0 4928} 4929 4930// hasNextLink returns true if the NextLink is not empty. 4931func (dl DiskList) hasNextLink() bool { 4932 return dl.NextLink != nil && len(*dl.NextLink) != 0 4933} 4934 4935// diskListPreparer prepares a request to retrieve the next set of results. 4936// It returns nil if no more results exist. 4937func (dl DiskList) diskListPreparer(ctx context.Context) (*http.Request, error) { 4938 if !dl.hasNextLink() { 4939 return nil, nil 4940 } 4941 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4942 autorest.AsJSON(), 4943 autorest.AsGet(), 4944 autorest.WithBaseURL(to.String(dl.NextLink))) 4945} 4946 4947// DiskListPage contains a page of Disk values. 4948type DiskListPage struct { 4949 fn func(context.Context, DiskList) (DiskList, error) 4950 dl DiskList 4951} 4952 4953// NextWithContext advances to the next page of values. If there was an error making 4954// the request the page does not advance and the error is returned. 4955func (page *DiskListPage) NextWithContext(ctx context.Context) (err error) { 4956 if tracing.IsEnabled() { 4957 ctx = tracing.StartSpan(ctx, fqdn+"/DiskListPage.NextWithContext") 4958 defer func() { 4959 sc := -1 4960 if page.Response().Response.Response != nil { 4961 sc = page.Response().Response.Response.StatusCode 4962 } 4963 tracing.EndSpan(ctx, sc, err) 4964 }() 4965 } 4966 for { 4967 next, err := page.fn(ctx, page.dl) 4968 if err != nil { 4969 return err 4970 } 4971 page.dl = next 4972 if !next.hasNextLink() || !next.IsEmpty() { 4973 break 4974 } 4975 } 4976 return nil 4977} 4978 4979// Next advances to the next page of values. If there was an error making 4980// the request the page does not advance and the error is returned. 4981// Deprecated: Use NextWithContext() instead. 4982func (page *DiskListPage) Next() error { 4983 return page.NextWithContext(context.Background()) 4984} 4985 4986// NotDone returns true if the page enumeration should be started or is not yet complete. 4987func (page DiskListPage) NotDone() bool { 4988 return !page.dl.IsEmpty() 4989} 4990 4991// Response returns the raw server response from the last page request. 4992func (page DiskListPage) Response() DiskList { 4993 return page.dl 4994} 4995 4996// Values returns the slice of values for the current page or nil if there are no values. 4997func (page DiskListPage) Values() []Disk { 4998 if page.dl.IsEmpty() { 4999 return nil 5000 } 5001 return *page.dl.Value 5002} 5003 5004// Creates a new instance of the DiskListPage type. 5005func NewDiskListPage(cur DiskList, getNextPage func(context.Context, DiskList) (DiskList, error)) DiskListPage { 5006 return DiskListPage{ 5007 fn: getNextPage, 5008 dl: cur, 5009 } 5010} 5011 5012// DiskProperties disk resource properties. 5013type DiskProperties struct { 5014 // TimeCreated - READ-ONLY; The time when the disk was created. 5015 TimeCreated *date.Time `json:"timeCreated,omitempty"` 5016 // OsType - The Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' 5017 OsType OperatingSystemTypes `json:"osType,omitempty"` 5018 // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'HyperVGenerationV1', 'HyperVGenerationV2' 5019 HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` 5020 // PurchasePlan - Purchase plan information for the the image from which the OS disk was created. E.g. - {name: 2019-Datacenter, publisher: MicrosoftWindowsServer, product: WindowsServer} 5021 PurchasePlan *PurchasePlan `json:"purchasePlan,omitempty"` 5022 // CreationData - Disk source information. CreationData information cannot be changed after the disk has been created. 5023 CreationData *CreationData `json:"creationData,omitempty"` 5024 // 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. 5025 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 5026 // DiskSizeBytes - READ-ONLY; The size of the disk in bytes. This field is read only. 5027 DiskSizeBytes *int64 `json:"diskSizeBytes,omitempty"` 5028 // UniqueID - READ-ONLY; Unique Guid identifying the resource. 5029 UniqueID *string `json:"uniqueId,omitempty"` 5030 // EncryptionSettingsCollection - Encryption settings collection used for Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. 5031 EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` 5032 // ProvisioningState - READ-ONLY; The disk provisioning state. 5033 ProvisioningState *string `json:"provisioningState,omitempty"` 5034 // DiskIOPSReadWrite - The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. 5035 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 5036 // 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. 5037 DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` 5038 // 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. 5039 DiskIOPSReadOnly *int64 `json:"diskIOPSReadOnly,omitempty"` 5040 // 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. 5041 DiskMBpsReadOnly *int64 `json:"diskMBpsReadOnly,omitempty"` 5042 // DiskState - The state of the disk. Possible values include: 'DiskStateUnattached', 'DiskStateAttached', 'DiskStateReserved', 'DiskStateActiveSAS', 'DiskStateReadyToUpload', 'DiskStateActiveUpload' 5043 DiskState DiskState `json:"diskState,omitempty"` 5044 // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 5045 Encryption *Encryption `json:"encryption,omitempty"` 5046 // 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. 5047 MaxShares *int32 `json:"maxShares,omitempty"` 5048 // 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. 5049 ShareInfo *[]ShareInfoElement `json:"shareInfo,omitempty"` 5050 // NetworkAccessPolicy - Possible values include: 'NetworkAccessPolicyAllowAll', 'NetworkAccessPolicyAllowPrivate', 'NetworkAccessPolicyDenyAll' 5051 NetworkAccessPolicy NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` 5052 // DiskAccessID - ARM id of the DiskAccess resource for using private endpoints on disks. 5053 DiskAccessID *string `json:"diskAccessId,omitempty"` 5054 // 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. 5055 Tier *string `json:"tier,omitempty"` 5056 // 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. 5057 BurstingEnabled *bool `json:"burstingEnabled,omitempty"` 5058 // PropertyUpdatesInProgress - READ-ONLY; Properties of the disk for which update is pending. 5059 PropertyUpdatesInProgress *PropertyUpdatesInProgress `json:"propertyUpdatesInProgress,omitempty"` 5060 // SupportsHibernation - Indicates the OS on a disk supports hibernation. 5061 SupportsHibernation *bool `json:"supportsHibernation,omitempty"` 5062 // SecurityProfile - Contains the security related information for the resource. 5063 SecurityProfile *DiskSecurityProfile `json:"securityProfile,omitempty"` 5064} 5065 5066// MarshalJSON is the custom marshaler for DiskProperties. 5067func (dp DiskProperties) MarshalJSON() ([]byte, error) { 5068 objectMap := make(map[string]interface{}) 5069 if dp.OsType != "" { 5070 objectMap["osType"] = dp.OsType 5071 } 5072 if dp.HyperVGeneration != "" { 5073 objectMap["hyperVGeneration"] = dp.HyperVGeneration 5074 } 5075 if dp.PurchasePlan != nil { 5076 objectMap["purchasePlan"] = dp.PurchasePlan 5077 } 5078 if dp.CreationData != nil { 5079 objectMap["creationData"] = dp.CreationData 5080 } 5081 if dp.DiskSizeGB != nil { 5082 objectMap["diskSizeGB"] = dp.DiskSizeGB 5083 } 5084 if dp.EncryptionSettingsCollection != nil { 5085 objectMap["encryptionSettingsCollection"] = dp.EncryptionSettingsCollection 5086 } 5087 if dp.DiskIOPSReadWrite != nil { 5088 objectMap["diskIOPSReadWrite"] = dp.DiskIOPSReadWrite 5089 } 5090 if dp.DiskMBpsReadWrite != nil { 5091 objectMap["diskMBpsReadWrite"] = dp.DiskMBpsReadWrite 5092 } 5093 if dp.DiskIOPSReadOnly != nil { 5094 objectMap["diskIOPSReadOnly"] = dp.DiskIOPSReadOnly 5095 } 5096 if dp.DiskMBpsReadOnly != nil { 5097 objectMap["diskMBpsReadOnly"] = dp.DiskMBpsReadOnly 5098 } 5099 if dp.DiskState != "" { 5100 objectMap["diskState"] = dp.DiskState 5101 } 5102 if dp.Encryption != nil { 5103 objectMap["encryption"] = dp.Encryption 5104 } 5105 if dp.MaxShares != nil { 5106 objectMap["maxShares"] = dp.MaxShares 5107 } 5108 if dp.NetworkAccessPolicy != "" { 5109 objectMap["networkAccessPolicy"] = dp.NetworkAccessPolicy 5110 } 5111 if dp.DiskAccessID != nil { 5112 objectMap["diskAccessId"] = dp.DiskAccessID 5113 } 5114 if dp.Tier != nil { 5115 objectMap["tier"] = dp.Tier 5116 } 5117 if dp.BurstingEnabled != nil { 5118 objectMap["burstingEnabled"] = dp.BurstingEnabled 5119 } 5120 if dp.SupportsHibernation != nil { 5121 objectMap["supportsHibernation"] = dp.SupportsHibernation 5122 } 5123 if dp.SecurityProfile != nil { 5124 objectMap["securityProfile"] = dp.SecurityProfile 5125 } 5126 return json.Marshal(objectMap) 5127} 5128 5129// DiskRestorePoint properties of disk restore point 5130type DiskRestorePoint struct { 5131 autorest.Response `json:"-"` 5132 *DiskRestorePointProperties `json:"properties,omitempty"` 5133 // ID - READ-ONLY; Resource Id 5134 ID *string `json:"id,omitempty"` 5135 // Name - READ-ONLY; Resource name 5136 Name *string `json:"name,omitempty"` 5137 // Type - READ-ONLY; Resource type 5138 Type *string `json:"type,omitempty"` 5139} 5140 5141// MarshalJSON is the custom marshaler for DiskRestorePoint. 5142func (drp DiskRestorePoint) MarshalJSON() ([]byte, error) { 5143 objectMap := make(map[string]interface{}) 5144 if drp.DiskRestorePointProperties != nil { 5145 objectMap["properties"] = drp.DiskRestorePointProperties 5146 } 5147 return json.Marshal(objectMap) 5148} 5149 5150// UnmarshalJSON is the custom unmarshaler for DiskRestorePoint struct. 5151func (drp *DiskRestorePoint) UnmarshalJSON(body []byte) error { 5152 var m map[string]*json.RawMessage 5153 err := json.Unmarshal(body, &m) 5154 if err != nil { 5155 return err 5156 } 5157 for k, v := range m { 5158 switch k { 5159 case "properties": 5160 if v != nil { 5161 var diskRestorePointProperties DiskRestorePointProperties 5162 err = json.Unmarshal(*v, &diskRestorePointProperties) 5163 if err != nil { 5164 return err 5165 } 5166 drp.DiskRestorePointProperties = &diskRestorePointProperties 5167 } 5168 case "id": 5169 if v != nil { 5170 var ID string 5171 err = json.Unmarshal(*v, &ID) 5172 if err != nil { 5173 return err 5174 } 5175 drp.ID = &ID 5176 } 5177 case "name": 5178 if v != nil { 5179 var name string 5180 err = json.Unmarshal(*v, &name) 5181 if err != nil { 5182 return err 5183 } 5184 drp.Name = &name 5185 } 5186 case "type": 5187 if v != nil { 5188 var typeVar string 5189 err = json.Unmarshal(*v, &typeVar) 5190 if err != nil { 5191 return err 5192 } 5193 drp.Type = &typeVar 5194 } 5195 } 5196 } 5197 5198 return nil 5199} 5200 5201// DiskRestorePointGrantAccessFuture an abstraction for monitoring and retrieving the results of a 5202// long-running operation. 5203type DiskRestorePointGrantAccessFuture struct { 5204 azure.FutureAPI 5205 // Result returns the result of the asynchronous operation. 5206 // If the operation has not completed it will return an error. 5207 Result func(DiskRestorePointClient) (AccessURI, error) 5208} 5209 5210// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5211func (future *DiskRestorePointGrantAccessFuture) UnmarshalJSON(body []byte) error { 5212 var azFuture azure.Future 5213 if err := json.Unmarshal(body, &azFuture); err != nil { 5214 return err 5215 } 5216 future.FutureAPI = &azFuture 5217 future.Result = future.result 5218 return nil 5219} 5220 5221// result is the default implementation for DiskRestorePointGrantAccessFuture.Result. 5222func (future *DiskRestorePointGrantAccessFuture) result(client DiskRestorePointClient) (au AccessURI, err error) { 5223 var done bool 5224 done, err = future.DoneWithContext(context.Background(), client) 5225 if err != nil { 5226 err = autorest.NewErrorWithError(err, "compute.DiskRestorePointGrantAccessFuture", "Result", future.Response(), "Polling failure") 5227 return 5228 } 5229 if !done { 5230 au.Response.Response = future.Response() 5231 err = azure.NewAsyncOpIncompleteError("compute.DiskRestorePointGrantAccessFuture") 5232 return 5233 } 5234 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5235 if au.Response.Response, err = future.GetResult(sender); err == nil && au.Response.Response.StatusCode != http.StatusNoContent { 5236 au, err = client.GrantAccessResponder(au.Response.Response) 5237 if err != nil { 5238 err = autorest.NewErrorWithError(err, "compute.DiskRestorePointGrantAccessFuture", "Result", au.Response.Response, "Failure responding to request") 5239 } 5240 } 5241 return 5242} 5243 5244// DiskRestorePointList the List Disk Restore Points operation response. 5245type DiskRestorePointList struct { 5246 autorest.Response `json:"-"` 5247 // Value - A list of disk restore points. 5248 Value *[]DiskRestorePoint `json:"value,omitempty"` 5249 // 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. 5250 NextLink *string `json:"nextLink,omitempty"` 5251} 5252 5253// DiskRestorePointListIterator provides access to a complete listing of DiskRestorePoint values. 5254type DiskRestorePointListIterator struct { 5255 i int 5256 page DiskRestorePointListPage 5257} 5258 5259// NextWithContext advances to the next value. If there was an error making 5260// the request the iterator does not advance and the error is returned. 5261func (iter *DiskRestorePointListIterator) NextWithContext(ctx context.Context) (err error) { 5262 if tracing.IsEnabled() { 5263 ctx = tracing.StartSpan(ctx, fqdn+"/DiskRestorePointListIterator.NextWithContext") 5264 defer func() { 5265 sc := -1 5266 if iter.Response().Response.Response != nil { 5267 sc = iter.Response().Response.Response.StatusCode 5268 } 5269 tracing.EndSpan(ctx, sc, err) 5270 }() 5271 } 5272 iter.i++ 5273 if iter.i < len(iter.page.Values()) { 5274 return nil 5275 } 5276 err = iter.page.NextWithContext(ctx) 5277 if err != nil { 5278 iter.i-- 5279 return err 5280 } 5281 iter.i = 0 5282 return nil 5283} 5284 5285// Next advances to the next value. If there was an error making 5286// the request the iterator does not advance and the error is returned. 5287// Deprecated: Use NextWithContext() instead. 5288func (iter *DiskRestorePointListIterator) Next() error { 5289 return iter.NextWithContext(context.Background()) 5290} 5291 5292// NotDone returns true if the enumeration should be started or is not yet complete. 5293func (iter DiskRestorePointListIterator) NotDone() bool { 5294 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5295} 5296 5297// Response returns the raw server response from the last page request. 5298func (iter DiskRestorePointListIterator) Response() DiskRestorePointList { 5299 return iter.page.Response() 5300} 5301 5302// Value returns the current value or a zero-initialized value if the 5303// iterator has advanced beyond the end of the collection. 5304func (iter DiskRestorePointListIterator) Value() DiskRestorePoint { 5305 if !iter.page.NotDone() { 5306 return DiskRestorePoint{} 5307 } 5308 return iter.page.Values()[iter.i] 5309} 5310 5311// Creates a new instance of the DiskRestorePointListIterator type. 5312func NewDiskRestorePointListIterator(page DiskRestorePointListPage) DiskRestorePointListIterator { 5313 return DiskRestorePointListIterator{page: page} 5314} 5315 5316// IsEmpty returns true if the ListResult contains no values. 5317func (drpl DiskRestorePointList) IsEmpty() bool { 5318 return drpl.Value == nil || len(*drpl.Value) == 0 5319} 5320 5321// hasNextLink returns true if the NextLink is not empty. 5322func (drpl DiskRestorePointList) hasNextLink() bool { 5323 return drpl.NextLink != nil && len(*drpl.NextLink) != 0 5324} 5325 5326// diskRestorePointListPreparer prepares a request to retrieve the next set of results. 5327// It returns nil if no more results exist. 5328func (drpl DiskRestorePointList) diskRestorePointListPreparer(ctx context.Context) (*http.Request, error) { 5329 if !drpl.hasNextLink() { 5330 return nil, nil 5331 } 5332 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5333 autorest.AsJSON(), 5334 autorest.AsGet(), 5335 autorest.WithBaseURL(to.String(drpl.NextLink))) 5336} 5337 5338// DiskRestorePointListPage contains a page of DiskRestorePoint values. 5339type DiskRestorePointListPage struct { 5340 fn func(context.Context, DiskRestorePointList) (DiskRestorePointList, error) 5341 drpl DiskRestorePointList 5342} 5343 5344// NextWithContext advances to the next page of values. If there was an error making 5345// the request the page does not advance and the error is returned. 5346func (page *DiskRestorePointListPage) NextWithContext(ctx context.Context) (err error) { 5347 if tracing.IsEnabled() { 5348 ctx = tracing.StartSpan(ctx, fqdn+"/DiskRestorePointListPage.NextWithContext") 5349 defer func() { 5350 sc := -1 5351 if page.Response().Response.Response != nil { 5352 sc = page.Response().Response.Response.StatusCode 5353 } 5354 tracing.EndSpan(ctx, sc, err) 5355 }() 5356 } 5357 for { 5358 next, err := page.fn(ctx, page.drpl) 5359 if err != nil { 5360 return err 5361 } 5362 page.drpl = next 5363 if !next.hasNextLink() || !next.IsEmpty() { 5364 break 5365 } 5366 } 5367 return nil 5368} 5369 5370// Next advances to the next page of values. If there was an error making 5371// the request the page does not advance and the error is returned. 5372// Deprecated: Use NextWithContext() instead. 5373func (page *DiskRestorePointListPage) Next() error { 5374 return page.NextWithContext(context.Background()) 5375} 5376 5377// NotDone returns true if the page enumeration should be started or is not yet complete. 5378func (page DiskRestorePointListPage) NotDone() bool { 5379 return !page.drpl.IsEmpty() 5380} 5381 5382// Response returns the raw server response from the last page request. 5383func (page DiskRestorePointListPage) Response() DiskRestorePointList { 5384 return page.drpl 5385} 5386 5387// Values returns the slice of values for the current page or nil if there are no values. 5388func (page DiskRestorePointListPage) Values() []DiskRestorePoint { 5389 if page.drpl.IsEmpty() { 5390 return nil 5391 } 5392 return *page.drpl.Value 5393} 5394 5395// Creates a new instance of the DiskRestorePointListPage type. 5396func NewDiskRestorePointListPage(cur DiskRestorePointList, getNextPage func(context.Context, DiskRestorePointList) (DiskRestorePointList, error)) DiskRestorePointListPage { 5397 return DiskRestorePointListPage{ 5398 fn: getNextPage, 5399 drpl: cur, 5400 } 5401} 5402 5403// DiskRestorePointProperties properties of an incremental disk restore point 5404type DiskRestorePointProperties struct { 5405 // TimeCreated - READ-ONLY; The timestamp of restorePoint creation 5406 TimeCreated *date.Time `json:"timeCreated,omitempty"` 5407 // SourceResourceID - READ-ONLY; arm id of source disk 5408 SourceResourceID *string `json:"sourceResourceId,omitempty"` 5409 // OsType - READ-ONLY; The Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' 5410 OsType OperatingSystemTypes `json:"osType,omitempty"` 5411 // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'HyperVGenerationV1', 'HyperVGenerationV2' 5412 HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` 5413 // PurchasePlan - Purchase plan information for the the image from which the OS disk was created. 5414 PurchasePlan *PurchasePlan `json:"purchasePlan,omitempty"` 5415 // FamilyID - READ-ONLY; id of the backing snapshot's MIS family 5416 FamilyID *string `json:"familyId,omitempty"` 5417 // SourceUniqueID - READ-ONLY; unique incarnation id of the source disk 5418 SourceUniqueID *string `json:"sourceUniqueId,omitempty"` 5419 // Encryption - READ-ONLY; Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 5420 Encryption *Encryption `json:"encryption,omitempty"` 5421 // SupportsHibernation - Indicates the OS on a disk supports hibernation. 5422 SupportsHibernation *bool `json:"supportsHibernation,omitempty"` 5423} 5424 5425// MarshalJSON is the custom marshaler for DiskRestorePointProperties. 5426func (drpp DiskRestorePointProperties) MarshalJSON() ([]byte, error) { 5427 objectMap := make(map[string]interface{}) 5428 if drpp.HyperVGeneration != "" { 5429 objectMap["hyperVGeneration"] = drpp.HyperVGeneration 5430 } 5431 if drpp.PurchasePlan != nil { 5432 objectMap["purchasePlan"] = drpp.PurchasePlan 5433 } 5434 if drpp.SupportsHibernation != nil { 5435 objectMap["supportsHibernation"] = drpp.SupportsHibernation 5436 } 5437 return json.Marshal(objectMap) 5438} 5439 5440// DiskRestorePointRevokeAccessFuture an abstraction for monitoring and retrieving the results of a 5441// long-running operation. 5442type DiskRestorePointRevokeAccessFuture struct { 5443 azure.FutureAPI 5444 // Result returns the result of the asynchronous operation. 5445 // If the operation has not completed it will return an error. 5446 Result func(DiskRestorePointClient) (autorest.Response, error) 5447} 5448 5449// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5450func (future *DiskRestorePointRevokeAccessFuture) UnmarshalJSON(body []byte) error { 5451 var azFuture azure.Future 5452 if err := json.Unmarshal(body, &azFuture); err != nil { 5453 return err 5454 } 5455 future.FutureAPI = &azFuture 5456 future.Result = future.result 5457 return nil 5458} 5459 5460// result is the default implementation for DiskRestorePointRevokeAccessFuture.Result. 5461func (future *DiskRestorePointRevokeAccessFuture) result(client DiskRestorePointClient) (ar autorest.Response, err error) { 5462 var done bool 5463 done, err = future.DoneWithContext(context.Background(), client) 5464 if err != nil { 5465 err = autorest.NewErrorWithError(err, "compute.DiskRestorePointRevokeAccessFuture", "Result", future.Response(), "Polling failure") 5466 return 5467 } 5468 if !done { 5469 ar.Response = future.Response() 5470 err = azure.NewAsyncOpIncompleteError("compute.DiskRestorePointRevokeAccessFuture") 5471 return 5472 } 5473 ar.Response = future.Response() 5474 return 5475} 5476 5477// DisksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 5478// operation. 5479type DisksCreateOrUpdateFuture struct { 5480 azure.FutureAPI 5481 // Result returns the result of the asynchronous operation. 5482 // If the operation has not completed it will return an error. 5483 Result func(DisksClient) (Disk, error) 5484} 5485 5486// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5487func (future *DisksCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 5488 var azFuture azure.Future 5489 if err := json.Unmarshal(body, &azFuture); err != nil { 5490 return err 5491 } 5492 future.FutureAPI = &azFuture 5493 future.Result = future.result 5494 return nil 5495} 5496 5497// result is the default implementation for DisksCreateOrUpdateFuture.Result. 5498func (future *DisksCreateOrUpdateFuture) result(client DisksClient) (d Disk, err error) { 5499 var done bool 5500 done, err = future.DoneWithContext(context.Background(), client) 5501 if err != nil { 5502 err = autorest.NewErrorWithError(err, "compute.DisksCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 5503 return 5504 } 5505 if !done { 5506 d.Response.Response = future.Response() 5507 err = azure.NewAsyncOpIncompleteError("compute.DisksCreateOrUpdateFuture") 5508 return 5509 } 5510 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5511 if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent { 5512 d, err = client.CreateOrUpdateResponder(d.Response.Response) 5513 if err != nil { 5514 err = autorest.NewErrorWithError(err, "compute.DisksCreateOrUpdateFuture", "Result", d.Response.Response, "Failure responding to request") 5515 } 5516 } 5517 return 5518} 5519 5520// DisksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 5521type DisksDeleteFuture struct { 5522 azure.FutureAPI 5523 // Result returns the result of the asynchronous operation. 5524 // If the operation has not completed it will return an error. 5525 Result func(DisksClient) (autorest.Response, error) 5526} 5527 5528// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5529func (future *DisksDeleteFuture) UnmarshalJSON(body []byte) error { 5530 var azFuture azure.Future 5531 if err := json.Unmarshal(body, &azFuture); err != nil { 5532 return err 5533 } 5534 future.FutureAPI = &azFuture 5535 future.Result = future.result 5536 return nil 5537} 5538 5539// result is the default implementation for DisksDeleteFuture.Result. 5540func (future *DisksDeleteFuture) result(client DisksClient) (ar autorest.Response, err error) { 5541 var done bool 5542 done, err = future.DoneWithContext(context.Background(), client) 5543 if err != nil { 5544 err = autorest.NewErrorWithError(err, "compute.DisksDeleteFuture", "Result", future.Response(), "Polling failure") 5545 return 5546 } 5547 if !done { 5548 ar.Response = future.Response() 5549 err = azure.NewAsyncOpIncompleteError("compute.DisksDeleteFuture") 5550 return 5551 } 5552 ar.Response = future.Response() 5553 return 5554} 5555 5556// DiskSecurityProfile contains the security related information for the resource. 5557type DiskSecurityProfile struct { 5558 // SecurityType - Possible values include: 'DiskSecurityTypesTrustedLaunch' 5559 SecurityType DiskSecurityTypes `json:"securityType,omitempty"` 5560} 5561 5562// DisksGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running 5563// operation. 5564type DisksGrantAccessFuture struct { 5565 azure.FutureAPI 5566 // Result returns the result of the asynchronous operation. 5567 // If the operation has not completed it will return an error. 5568 Result func(DisksClient) (AccessURI, error) 5569} 5570 5571// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5572func (future *DisksGrantAccessFuture) UnmarshalJSON(body []byte) error { 5573 var azFuture azure.Future 5574 if err := json.Unmarshal(body, &azFuture); err != nil { 5575 return err 5576 } 5577 future.FutureAPI = &azFuture 5578 future.Result = future.result 5579 return nil 5580} 5581 5582// result is the default implementation for DisksGrantAccessFuture.Result. 5583func (future *DisksGrantAccessFuture) result(client DisksClient) (au AccessURI, err error) { 5584 var done bool 5585 done, err = future.DoneWithContext(context.Background(), client) 5586 if err != nil { 5587 err = autorest.NewErrorWithError(err, "compute.DisksGrantAccessFuture", "Result", future.Response(), "Polling failure") 5588 return 5589 } 5590 if !done { 5591 au.Response.Response = future.Response() 5592 err = azure.NewAsyncOpIncompleteError("compute.DisksGrantAccessFuture") 5593 return 5594 } 5595 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5596 if au.Response.Response, err = future.GetResult(sender); err == nil && au.Response.Response.StatusCode != http.StatusNoContent { 5597 au, err = client.GrantAccessResponder(au.Response.Response) 5598 if err != nil { 5599 err = autorest.NewErrorWithError(err, "compute.DisksGrantAccessFuture", "Result", au.Response.Response, "Failure responding to request") 5600 } 5601 } 5602 return 5603} 5604 5605// DiskSku the disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, 5606// Premium_ZRS, or StandardSSD_ZRS. 5607type DiskSku struct { 5608 // Name - The sku name. Possible values include: 'DiskStorageAccountTypesStandardLRS', 'DiskStorageAccountTypesPremiumLRS', 'DiskStorageAccountTypesStandardSSDLRS', 'DiskStorageAccountTypesUltraSSDLRS', 'DiskStorageAccountTypesPremiumZRS', 'DiskStorageAccountTypesStandardSSDZRS' 5609 Name DiskStorageAccountTypes `json:"name,omitempty"` 5610 // Tier - READ-ONLY; The sku tier. 5611 Tier *string `json:"tier,omitempty"` 5612} 5613 5614// MarshalJSON is the custom marshaler for DiskSku. 5615func (ds DiskSku) MarshalJSON() ([]byte, error) { 5616 objectMap := make(map[string]interface{}) 5617 if ds.Name != "" { 5618 objectMap["name"] = ds.Name 5619 } 5620 return json.Marshal(objectMap) 5621} 5622 5623// DisksRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running 5624// operation. 5625type DisksRevokeAccessFuture struct { 5626 azure.FutureAPI 5627 // Result returns the result of the asynchronous operation. 5628 // If the operation has not completed it will return an error. 5629 Result func(DisksClient) (autorest.Response, error) 5630} 5631 5632// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5633func (future *DisksRevokeAccessFuture) UnmarshalJSON(body []byte) error { 5634 var azFuture azure.Future 5635 if err := json.Unmarshal(body, &azFuture); err != nil { 5636 return err 5637 } 5638 future.FutureAPI = &azFuture 5639 future.Result = future.result 5640 return nil 5641} 5642 5643// result is the default implementation for DisksRevokeAccessFuture.Result. 5644func (future *DisksRevokeAccessFuture) result(client DisksClient) (ar autorest.Response, err error) { 5645 var done bool 5646 done, err = future.DoneWithContext(context.Background(), client) 5647 if err != nil { 5648 err = autorest.NewErrorWithError(err, "compute.DisksRevokeAccessFuture", "Result", future.Response(), "Polling failure") 5649 return 5650 } 5651 if !done { 5652 ar.Response = future.Response() 5653 err = azure.NewAsyncOpIncompleteError("compute.DisksRevokeAccessFuture") 5654 return 5655 } 5656 ar.Response = future.Response() 5657 return 5658} 5659 5660// DisksUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. 5661type DisksUpdateFuture struct { 5662 azure.FutureAPI 5663 // Result returns the result of the asynchronous operation. 5664 // If the operation has not completed it will return an error. 5665 Result func(DisksClient) (Disk, error) 5666} 5667 5668// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5669func (future *DisksUpdateFuture) UnmarshalJSON(body []byte) error { 5670 var azFuture azure.Future 5671 if err := json.Unmarshal(body, &azFuture); err != nil { 5672 return err 5673 } 5674 future.FutureAPI = &azFuture 5675 future.Result = future.result 5676 return nil 5677} 5678 5679// result is the default implementation for DisksUpdateFuture.Result. 5680func (future *DisksUpdateFuture) result(client DisksClient) (d Disk, err error) { 5681 var done bool 5682 done, err = future.DoneWithContext(context.Background(), client) 5683 if err != nil { 5684 err = autorest.NewErrorWithError(err, "compute.DisksUpdateFuture", "Result", future.Response(), "Polling failure") 5685 return 5686 } 5687 if !done { 5688 d.Response.Response = future.Response() 5689 err = azure.NewAsyncOpIncompleteError("compute.DisksUpdateFuture") 5690 return 5691 } 5692 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5693 if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent { 5694 d, err = client.UpdateResponder(d.Response.Response) 5695 if err != nil { 5696 err = autorest.NewErrorWithError(err, "compute.DisksUpdateFuture", "Result", d.Response.Response, "Failure responding to request") 5697 } 5698 } 5699 return 5700} 5701 5702// DiskUpdate disk update resource. 5703type DiskUpdate struct { 5704 *DiskUpdateProperties `json:"properties,omitempty"` 5705 // Tags - Resource tags 5706 Tags map[string]*string `json:"tags"` 5707 Sku *DiskSku `json:"sku,omitempty"` 5708} 5709 5710// MarshalJSON is the custom marshaler for DiskUpdate. 5711func (du DiskUpdate) MarshalJSON() ([]byte, error) { 5712 objectMap := make(map[string]interface{}) 5713 if du.DiskUpdateProperties != nil { 5714 objectMap["properties"] = du.DiskUpdateProperties 5715 } 5716 if du.Tags != nil { 5717 objectMap["tags"] = du.Tags 5718 } 5719 if du.Sku != nil { 5720 objectMap["sku"] = du.Sku 5721 } 5722 return json.Marshal(objectMap) 5723} 5724 5725// UnmarshalJSON is the custom unmarshaler for DiskUpdate struct. 5726func (du *DiskUpdate) UnmarshalJSON(body []byte) error { 5727 var m map[string]*json.RawMessage 5728 err := json.Unmarshal(body, &m) 5729 if err != nil { 5730 return err 5731 } 5732 for k, v := range m { 5733 switch k { 5734 case "properties": 5735 if v != nil { 5736 var diskUpdateProperties DiskUpdateProperties 5737 err = json.Unmarshal(*v, &diskUpdateProperties) 5738 if err != nil { 5739 return err 5740 } 5741 du.DiskUpdateProperties = &diskUpdateProperties 5742 } 5743 case "tags": 5744 if v != nil { 5745 var tags map[string]*string 5746 err = json.Unmarshal(*v, &tags) 5747 if err != nil { 5748 return err 5749 } 5750 du.Tags = tags 5751 } 5752 case "sku": 5753 if v != nil { 5754 var sku DiskSku 5755 err = json.Unmarshal(*v, &sku) 5756 if err != nil { 5757 return err 5758 } 5759 du.Sku = &sku 5760 } 5761 } 5762 } 5763 5764 return nil 5765} 5766 5767// DiskUpdateProperties disk resource update properties. 5768type DiskUpdateProperties struct { 5769 // OsType - the Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' 5770 OsType OperatingSystemTypes `json:"osType,omitempty"` 5771 // 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. 5772 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 5773 // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. 5774 EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` 5775 // DiskIOPSReadWrite - The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. 5776 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 5777 // 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. 5778 DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` 5779 // 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. 5780 DiskIOPSReadOnly *int64 `json:"diskIOPSReadOnly,omitempty"` 5781 // 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. 5782 DiskMBpsReadOnly *int64 `json:"diskMBpsReadOnly,omitempty"` 5783 // 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. 5784 MaxShares *int32 `json:"maxShares,omitempty"` 5785 // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 5786 Encryption *Encryption `json:"encryption,omitempty"` 5787 // NetworkAccessPolicy - Possible values include: 'NetworkAccessPolicyAllowAll', 'NetworkAccessPolicyAllowPrivate', 'NetworkAccessPolicyDenyAll' 5788 NetworkAccessPolicy NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` 5789 // DiskAccessID - ARM id of the DiskAccess resource for using private endpoints on disks. 5790 DiskAccessID *string `json:"diskAccessId,omitempty"` 5791 // 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. 5792 Tier *string `json:"tier,omitempty"` 5793 // 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. 5794 BurstingEnabled *bool `json:"burstingEnabled,omitempty"` 5795 // PurchasePlan - Purchase plan information to be added on the OS disk 5796 PurchasePlan *PurchasePlan `json:"purchasePlan,omitempty"` 5797 // PropertyUpdatesInProgress - READ-ONLY; Properties of the disk for which update is pending. 5798 PropertyUpdatesInProgress *PropertyUpdatesInProgress `json:"propertyUpdatesInProgress,omitempty"` 5799 // SupportsHibernation - Indicates the OS on a disk supports hibernation. 5800 SupportsHibernation *bool `json:"supportsHibernation,omitempty"` 5801} 5802 5803// MarshalJSON is the custom marshaler for DiskUpdateProperties. 5804func (dup DiskUpdateProperties) MarshalJSON() ([]byte, error) { 5805 objectMap := make(map[string]interface{}) 5806 if dup.OsType != "" { 5807 objectMap["osType"] = dup.OsType 5808 } 5809 if dup.DiskSizeGB != nil { 5810 objectMap["diskSizeGB"] = dup.DiskSizeGB 5811 } 5812 if dup.EncryptionSettingsCollection != nil { 5813 objectMap["encryptionSettingsCollection"] = dup.EncryptionSettingsCollection 5814 } 5815 if dup.DiskIOPSReadWrite != nil { 5816 objectMap["diskIOPSReadWrite"] = dup.DiskIOPSReadWrite 5817 } 5818 if dup.DiskMBpsReadWrite != nil { 5819 objectMap["diskMBpsReadWrite"] = dup.DiskMBpsReadWrite 5820 } 5821 if dup.DiskIOPSReadOnly != nil { 5822 objectMap["diskIOPSReadOnly"] = dup.DiskIOPSReadOnly 5823 } 5824 if dup.DiskMBpsReadOnly != nil { 5825 objectMap["diskMBpsReadOnly"] = dup.DiskMBpsReadOnly 5826 } 5827 if dup.MaxShares != nil { 5828 objectMap["maxShares"] = dup.MaxShares 5829 } 5830 if dup.Encryption != nil { 5831 objectMap["encryption"] = dup.Encryption 5832 } 5833 if dup.NetworkAccessPolicy != "" { 5834 objectMap["networkAccessPolicy"] = dup.NetworkAccessPolicy 5835 } 5836 if dup.DiskAccessID != nil { 5837 objectMap["diskAccessId"] = dup.DiskAccessID 5838 } 5839 if dup.Tier != nil { 5840 objectMap["tier"] = dup.Tier 5841 } 5842 if dup.BurstingEnabled != nil { 5843 objectMap["burstingEnabled"] = dup.BurstingEnabled 5844 } 5845 if dup.PurchasePlan != nil { 5846 objectMap["purchasePlan"] = dup.PurchasePlan 5847 } 5848 if dup.SupportsHibernation != nil { 5849 objectMap["supportsHibernation"] = dup.SupportsHibernation 5850 } 5851 return json.Marshal(objectMap) 5852} 5853 5854// Encryption encryption at rest settings for disk or snapshot 5855type Encryption struct { 5856 // DiskEncryptionSetID - ResourceId of the disk encryption set to use for enabling encryption at rest. 5857 DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` 5858 // Type - Possible values include: 'EncryptionTypeEncryptionAtRestWithPlatformKey', 'EncryptionTypeEncryptionAtRestWithCustomerKey', 'EncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys' 5859 Type EncryptionType `json:"type,omitempty"` 5860} 5861 5862// EncryptionImages optional. Allows users to provide customer managed keys for encrypting the OS and data 5863// disks in the gallery artifact. 5864type EncryptionImages struct { 5865 OsDiskImage *OSDiskImageEncryption `json:"osDiskImage,omitempty"` 5866 // DataDiskImages - A list of encryption specifications for data disk images. 5867 DataDiskImages *[]DataDiskImageEncryption `json:"dataDiskImages,omitempty"` 5868} 5869 5870// EncryptionSetIdentity the managed identity for the disk encryption set. It should be given permission on 5871// the key vault before it can be used to encrypt disks. 5872type EncryptionSetIdentity struct { 5873 // 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' 5874 Type DiskEncryptionSetIdentityType `json:"type,omitempty"` 5875 // 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 5876 PrincipalID *string `json:"principalId,omitempty"` 5877 // 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 5878 TenantID *string `json:"tenantId,omitempty"` 5879} 5880 5881// MarshalJSON is the custom marshaler for EncryptionSetIdentity. 5882func (esi EncryptionSetIdentity) MarshalJSON() ([]byte, error) { 5883 objectMap := make(map[string]interface{}) 5884 if esi.Type != "" { 5885 objectMap["type"] = esi.Type 5886 } 5887 return json.Marshal(objectMap) 5888} 5889 5890// EncryptionSetProperties ... 5891type EncryptionSetProperties struct { 5892 // EncryptionType - Possible values include: 'DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey', 'DiskEncryptionSetTypeEncryptionAtRestWithPlatformAndCustomerKeys' 5893 EncryptionType DiskEncryptionSetType `json:"encryptionType,omitempty"` 5894 // ActiveKey - The key vault key which is currently used by this disk encryption set. 5895 ActiveKey *KeyForDiskEncryptionSet `json:"activeKey,omitempty"` 5896 // 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. 5897 PreviousKeys *[]KeyForDiskEncryptionSet `json:"previousKeys,omitempty"` 5898 // ProvisioningState - READ-ONLY; The disk encryption set provisioning state. 5899 ProvisioningState *string `json:"provisioningState,omitempty"` 5900 // RotationToLatestKeyVersionEnabled - Set this flag to true to enable auto-updating of this disk encryption set to the latest key version. 5901 RotationToLatestKeyVersionEnabled *bool `json:"rotationToLatestKeyVersionEnabled,omitempty"` 5902 // LastKeyRotationTimestamp - READ-ONLY; The time when the active key of this disk encryption set was updated. 5903 LastKeyRotationTimestamp *date.Time `json:"lastKeyRotationTimestamp,omitempty"` 5904} 5905 5906// MarshalJSON is the custom marshaler for EncryptionSetProperties. 5907func (esp EncryptionSetProperties) MarshalJSON() ([]byte, error) { 5908 objectMap := make(map[string]interface{}) 5909 if esp.EncryptionType != "" { 5910 objectMap["encryptionType"] = esp.EncryptionType 5911 } 5912 if esp.ActiveKey != nil { 5913 objectMap["activeKey"] = esp.ActiveKey 5914 } 5915 if esp.RotationToLatestKeyVersionEnabled != nil { 5916 objectMap["rotationToLatestKeyVersionEnabled"] = esp.RotationToLatestKeyVersionEnabled 5917 } 5918 return json.Marshal(objectMap) 5919} 5920 5921// EncryptionSettingsCollection encryption settings for disk or snapshot 5922type EncryptionSettingsCollection struct { 5923 // 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. 5924 Enabled *bool `json:"enabled,omitempty"` 5925 // EncryptionSettings - A collection of encryption settings, one for each disk volume. 5926 EncryptionSettings *[]EncryptionSettingsElement `json:"encryptionSettings,omitempty"` 5927 // 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. 5928 EncryptionSettingsVersion *string `json:"encryptionSettingsVersion,omitempty"` 5929} 5930 5931// EncryptionSettingsElement encryption settings for one disk volume. 5932type EncryptionSettingsElement struct { 5933 // DiskEncryptionKey - Key Vault Secret Url and vault id of the disk encryption key 5934 DiskEncryptionKey *KeyVaultAndSecretReference `json:"diskEncryptionKey,omitempty"` 5935 // 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. 5936 KeyEncryptionKey *KeyVaultAndKeyReference `json:"keyEncryptionKey,omitempty"` 5937} 5938 5939// ExtendedLocation the complex type of the extended location. 5940type ExtendedLocation struct { 5941 // Name - The name of the extended location. 5942 Name *string `json:"name,omitempty"` 5943 // Type - The type of the extended location. Possible values include: 'ExtendedLocationTypesEdgeZone' 5944 Type ExtendedLocationTypes `json:"type,omitempty"` 5945} 5946 5947// Extension describes a cloud service Extension. 5948type Extension struct { 5949 // Name - The name of the extension. 5950 Name *string `json:"name,omitempty"` 5951 Properties *CloudServiceExtensionProperties `json:"properties,omitempty"` 5952} 5953 5954// GalleriesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 5955// operation. 5956type GalleriesCreateOrUpdateFuture struct { 5957 azure.FutureAPI 5958 // Result returns the result of the asynchronous operation. 5959 // If the operation has not completed it will return an error. 5960 Result func(GalleriesClient) (Gallery, error) 5961} 5962 5963// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5964func (future *GalleriesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 5965 var azFuture azure.Future 5966 if err := json.Unmarshal(body, &azFuture); err != nil { 5967 return err 5968 } 5969 future.FutureAPI = &azFuture 5970 future.Result = future.result 5971 return nil 5972} 5973 5974// result is the default implementation for GalleriesCreateOrUpdateFuture.Result. 5975func (future *GalleriesCreateOrUpdateFuture) result(client GalleriesClient) (g Gallery, err error) { 5976 var done bool 5977 done, err = future.DoneWithContext(context.Background(), client) 5978 if err != nil { 5979 err = autorest.NewErrorWithError(err, "compute.GalleriesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 5980 return 5981 } 5982 if !done { 5983 g.Response.Response = future.Response() 5984 err = azure.NewAsyncOpIncompleteError("compute.GalleriesCreateOrUpdateFuture") 5985 return 5986 } 5987 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5988 if g.Response.Response, err = future.GetResult(sender); err == nil && g.Response.Response.StatusCode != http.StatusNoContent { 5989 g, err = client.CreateOrUpdateResponder(g.Response.Response) 5990 if err != nil { 5991 err = autorest.NewErrorWithError(err, "compute.GalleriesCreateOrUpdateFuture", "Result", g.Response.Response, "Failure responding to request") 5992 } 5993 } 5994 return 5995} 5996 5997// GalleriesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 5998// operation. 5999type GalleriesDeleteFuture struct { 6000 azure.FutureAPI 6001 // Result returns the result of the asynchronous operation. 6002 // If the operation has not completed it will return an error. 6003 Result func(GalleriesClient) (autorest.Response, error) 6004} 6005 6006// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6007func (future *GalleriesDeleteFuture) UnmarshalJSON(body []byte) error { 6008 var azFuture azure.Future 6009 if err := json.Unmarshal(body, &azFuture); err != nil { 6010 return err 6011 } 6012 future.FutureAPI = &azFuture 6013 future.Result = future.result 6014 return nil 6015} 6016 6017// result is the default implementation for GalleriesDeleteFuture.Result. 6018func (future *GalleriesDeleteFuture) result(client GalleriesClient) (ar autorest.Response, err error) { 6019 var done bool 6020 done, err = future.DoneWithContext(context.Background(), client) 6021 if err != nil { 6022 err = autorest.NewErrorWithError(err, "compute.GalleriesDeleteFuture", "Result", future.Response(), "Polling failure") 6023 return 6024 } 6025 if !done { 6026 ar.Response = future.Response() 6027 err = azure.NewAsyncOpIncompleteError("compute.GalleriesDeleteFuture") 6028 return 6029 } 6030 ar.Response = future.Response() 6031 return 6032} 6033 6034// GalleriesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 6035// operation. 6036type GalleriesUpdateFuture struct { 6037 azure.FutureAPI 6038 // Result returns the result of the asynchronous operation. 6039 // If the operation has not completed it will return an error. 6040 Result func(GalleriesClient) (Gallery, error) 6041} 6042 6043// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6044func (future *GalleriesUpdateFuture) UnmarshalJSON(body []byte) error { 6045 var azFuture azure.Future 6046 if err := json.Unmarshal(body, &azFuture); err != nil { 6047 return err 6048 } 6049 future.FutureAPI = &azFuture 6050 future.Result = future.result 6051 return nil 6052} 6053 6054// result is the default implementation for GalleriesUpdateFuture.Result. 6055func (future *GalleriesUpdateFuture) result(client GalleriesClient) (g Gallery, err error) { 6056 var done bool 6057 done, err = future.DoneWithContext(context.Background(), client) 6058 if err != nil { 6059 err = autorest.NewErrorWithError(err, "compute.GalleriesUpdateFuture", "Result", future.Response(), "Polling failure") 6060 return 6061 } 6062 if !done { 6063 g.Response.Response = future.Response() 6064 err = azure.NewAsyncOpIncompleteError("compute.GalleriesUpdateFuture") 6065 return 6066 } 6067 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6068 if g.Response.Response, err = future.GetResult(sender); err == nil && g.Response.Response.StatusCode != http.StatusNoContent { 6069 g, err = client.UpdateResponder(g.Response.Response) 6070 if err != nil { 6071 err = autorest.NewErrorWithError(err, "compute.GalleriesUpdateFuture", "Result", g.Response.Response, "Failure responding to request") 6072 } 6073 } 6074 return 6075} 6076 6077// Gallery specifies information about the Shared Image Gallery that you want to create or update. 6078type Gallery struct { 6079 autorest.Response `json:"-"` 6080 *GalleryProperties `json:"properties,omitempty"` 6081 // ID - READ-ONLY; Resource Id 6082 ID *string `json:"id,omitempty"` 6083 // Name - READ-ONLY; Resource name 6084 Name *string `json:"name,omitempty"` 6085 // Type - READ-ONLY; Resource type 6086 Type *string `json:"type,omitempty"` 6087 // Location - Resource location 6088 Location *string `json:"location,omitempty"` 6089 // Tags - Resource tags 6090 Tags map[string]*string `json:"tags"` 6091} 6092 6093// MarshalJSON is the custom marshaler for Gallery. 6094func (g Gallery) MarshalJSON() ([]byte, error) { 6095 objectMap := make(map[string]interface{}) 6096 if g.GalleryProperties != nil { 6097 objectMap["properties"] = g.GalleryProperties 6098 } 6099 if g.Location != nil { 6100 objectMap["location"] = g.Location 6101 } 6102 if g.Tags != nil { 6103 objectMap["tags"] = g.Tags 6104 } 6105 return json.Marshal(objectMap) 6106} 6107 6108// UnmarshalJSON is the custom unmarshaler for Gallery struct. 6109func (g *Gallery) UnmarshalJSON(body []byte) error { 6110 var m map[string]*json.RawMessage 6111 err := json.Unmarshal(body, &m) 6112 if err != nil { 6113 return err 6114 } 6115 for k, v := range m { 6116 switch k { 6117 case "properties": 6118 if v != nil { 6119 var galleryProperties GalleryProperties 6120 err = json.Unmarshal(*v, &galleryProperties) 6121 if err != nil { 6122 return err 6123 } 6124 g.GalleryProperties = &galleryProperties 6125 } 6126 case "id": 6127 if v != nil { 6128 var ID string 6129 err = json.Unmarshal(*v, &ID) 6130 if err != nil { 6131 return err 6132 } 6133 g.ID = &ID 6134 } 6135 case "name": 6136 if v != nil { 6137 var name string 6138 err = json.Unmarshal(*v, &name) 6139 if err != nil { 6140 return err 6141 } 6142 g.Name = &name 6143 } 6144 case "type": 6145 if v != nil { 6146 var typeVar string 6147 err = json.Unmarshal(*v, &typeVar) 6148 if err != nil { 6149 return err 6150 } 6151 g.Type = &typeVar 6152 } 6153 case "location": 6154 if v != nil { 6155 var location string 6156 err = json.Unmarshal(*v, &location) 6157 if err != nil { 6158 return err 6159 } 6160 g.Location = &location 6161 } 6162 case "tags": 6163 if v != nil { 6164 var tags map[string]*string 6165 err = json.Unmarshal(*v, &tags) 6166 if err != nil { 6167 return err 6168 } 6169 g.Tags = tags 6170 } 6171 } 6172 } 6173 6174 return nil 6175} 6176 6177// GalleryApplication specifies information about the gallery Application Definition that you want to 6178// create or update. 6179type GalleryApplication struct { 6180 autorest.Response `json:"-"` 6181 *GalleryApplicationProperties `json:"properties,omitempty"` 6182 // ID - READ-ONLY; Resource Id 6183 ID *string `json:"id,omitempty"` 6184 // Name - READ-ONLY; Resource name 6185 Name *string `json:"name,omitempty"` 6186 // Type - READ-ONLY; Resource type 6187 Type *string `json:"type,omitempty"` 6188 // Location - Resource location 6189 Location *string `json:"location,omitempty"` 6190 // Tags - Resource tags 6191 Tags map[string]*string `json:"tags"` 6192} 6193 6194// MarshalJSON is the custom marshaler for GalleryApplication. 6195func (ga GalleryApplication) MarshalJSON() ([]byte, error) { 6196 objectMap := make(map[string]interface{}) 6197 if ga.GalleryApplicationProperties != nil { 6198 objectMap["properties"] = ga.GalleryApplicationProperties 6199 } 6200 if ga.Location != nil { 6201 objectMap["location"] = ga.Location 6202 } 6203 if ga.Tags != nil { 6204 objectMap["tags"] = ga.Tags 6205 } 6206 return json.Marshal(objectMap) 6207} 6208 6209// UnmarshalJSON is the custom unmarshaler for GalleryApplication struct. 6210func (ga *GalleryApplication) UnmarshalJSON(body []byte) error { 6211 var m map[string]*json.RawMessage 6212 err := json.Unmarshal(body, &m) 6213 if err != nil { 6214 return err 6215 } 6216 for k, v := range m { 6217 switch k { 6218 case "properties": 6219 if v != nil { 6220 var galleryApplicationProperties GalleryApplicationProperties 6221 err = json.Unmarshal(*v, &galleryApplicationProperties) 6222 if err != nil { 6223 return err 6224 } 6225 ga.GalleryApplicationProperties = &galleryApplicationProperties 6226 } 6227 case "id": 6228 if v != nil { 6229 var ID string 6230 err = json.Unmarshal(*v, &ID) 6231 if err != nil { 6232 return err 6233 } 6234 ga.ID = &ID 6235 } 6236 case "name": 6237 if v != nil { 6238 var name string 6239 err = json.Unmarshal(*v, &name) 6240 if err != nil { 6241 return err 6242 } 6243 ga.Name = &name 6244 } 6245 case "type": 6246 if v != nil { 6247 var typeVar string 6248 err = json.Unmarshal(*v, &typeVar) 6249 if err != nil { 6250 return err 6251 } 6252 ga.Type = &typeVar 6253 } 6254 case "location": 6255 if v != nil { 6256 var location string 6257 err = json.Unmarshal(*v, &location) 6258 if err != nil { 6259 return err 6260 } 6261 ga.Location = &location 6262 } 6263 case "tags": 6264 if v != nil { 6265 var tags map[string]*string 6266 err = json.Unmarshal(*v, &tags) 6267 if err != nil { 6268 return err 6269 } 6270 ga.Tags = tags 6271 } 6272 } 6273 } 6274 6275 return nil 6276} 6277 6278// GalleryApplicationList the List Gallery Applications operation response. 6279type GalleryApplicationList struct { 6280 autorest.Response `json:"-"` 6281 // Value - A list of Gallery Applications. 6282 Value *[]GalleryApplication `json:"value,omitempty"` 6283 // 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. 6284 NextLink *string `json:"nextLink,omitempty"` 6285} 6286 6287// GalleryApplicationListIterator provides access to a complete listing of GalleryApplication values. 6288type GalleryApplicationListIterator struct { 6289 i int 6290 page GalleryApplicationListPage 6291} 6292 6293// NextWithContext advances to the next value. If there was an error making 6294// the request the iterator does not advance and the error is returned. 6295func (iter *GalleryApplicationListIterator) NextWithContext(ctx context.Context) (err error) { 6296 if tracing.IsEnabled() { 6297 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationListIterator.NextWithContext") 6298 defer func() { 6299 sc := -1 6300 if iter.Response().Response.Response != nil { 6301 sc = iter.Response().Response.Response.StatusCode 6302 } 6303 tracing.EndSpan(ctx, sc, err) 6304 }() 6305 } 6306 iter.i++ 6307 if iter.i < len(iter.page.Values()) { 6308 return nil 6309 } 6310 err = iter.page.NextWithContext(ctx) 6311 if err != nil { 6312 iter.i-- 6313 return err 6314 } 6315 iter.i = 0 6316 return nil 6317} 6318 6319// Next advances to the next value. If there was an error making 6320// the request the iterator does not advance and the error is returned. 6321// Deprecated: Use NextWithContext() instead. 6322func (iter *GalleryApplicationListIterator) Next() error { 6323 return iter.NextWithContext(context.Background()) 6324} 6325 6326// NotDone returns true if the enumeration should be started or is not yet complete. 6327func (iter GalleryApplicationListIterator) NotDone() bool { 6328 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6329} 6330 6331// Response returns the raw server response from the last page request. 6332func (iter GalleryApplicationListIterator) Response() GalleryApplicationList { 6333 return iter.page.Response() 6334} 6335 6336// Value returns the current value or a zero-initialized value if the 6337// iterator has advanced beyond the end of the collection. 6338func (iter GalleryApplicationListIterator) Value() GalleryApplication { 6339 if !iter.page.NotDone() { 6340 return GalleryApplication{} 6341 } 6342 return iter.page.Values()[iter.i] 6343} 6344 6345// Creates a new instance of the GalleryApplicationListIterator type. 6346func NewGalleryApplicationListIterator(page GalleryApplicationListPage) GalleryApplicationListIterator { 6347 return GalleryApplicationListIterator{page: page} 6348} 6349 6350// IsEmpty returns true if the ListResult contains no values. 6351func (gal GalleryApplicationList) IsEmpty() bool { 6352 return gal.Value == nil || len(*gal.Value) == 0 6353} 6354 6355// hasNextLink returns true if the NextLink is not empty. 6356func (gal GalleryApplicationList) hasNextLink() bool { 6357 return gal.NextLink != nil && len(*gal.NextLink) != 0 6358} 6359 6360// galleryApplicationListPreparer prepares a request to retrieve the next set of results. 6361// It returns nil if no more results exist. 6362func (gal GalleryApplicationList) galleryApplicationListPreparer(ctx context.Context) (*http.Request, error) { 6363 if !gal.hasNextLink() { 6364 return nil, nil 6365 } 6366 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6367 autorest.AsJSON(), 6368 autorest.AsGet(), 6369 autorest.WithBaseURL(to.String(gal.NextLink))) 6370} 6371 6372// GalleryApplicationListPage contains a page of GalleryApplication values. 6373type GalleryApplicationListPage struct { 6374 fn func(context.Context, GalleryApplicationList) (GalleryApplicationList, error) 6375 gal GalleryApplicationList 6376} 6377 6378// NextWithContext advances to the next page of values. If there was an error making 6379// the request the page does not advance and the error is returned. 6380func (page *GalleryApplicationListPage) NextWithContext(ctx context.Context) (err error) { 6381 if tracing.IsEnabled() { 6382 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationListPage.NextWithContext") 6383 defer func() { 6384 sc := -1 6385 if page.Response().Response.Response != nil { 6386 sc = page.Response().Response.Response.StatusCode 6387 } 6388 tracing.EndSpan(ctx, sc, err) 6389 }() 6390 } 6391 for { 6392 next, err := page.fn(ctx, page.gal) 6393 if err != nil { 6394 return err 6395 } 6396 page.gal = next 6397 if !next.hasNextLink() || !next.IsEmpty() { 6398 break 6399 } 6400 } 6401 return nil 6402} 6403 6404// Next advances to the next page of values. If there was an error making 6405// the request the page does not advance and the error is returned. 6406// Deprecated: Use NextWithContext() instead. 6407func (page *GalleryApplicationListPage) Next() error { 6408 return page.NextWithContext(context.Background()) 6409} 6410 6411// NotDone returns true if the page enumeration should be started or is not yet complete. 6412func (page GalleryApplicationListPage) NotDone() bool { 6413 return !page.gal.IsEmpty() 6414} 6415 6416// Response returns the raw server response from the last page request. 6417func (page GalleryApplicationListPage) Response() GalleryApplicationList { 6418 return page.gal 6419} 6420 6421// Values returns the slice of values for the current page or nil if there are no values. 6422func (page GalleryApplicationListPage) Values() []GalleryApplication { 6423 if page.gal.IsEmpty() { 6424 return nil 6425 } 6426 return *page.gal.Value 6427} 6428 6429// Creates a new instance of the GalleryApplicationListPage type. 6430func NewGalleryApplicationListPage(cur GalleryApplicationList, getNextPage func(context.Context, GalleryApplicationList) (GalleryApplicationList, error)) GalleryApplicationListPage { 6431 return GalleryApplicationListPage{ 6432 fn: getNextPage, 6433 gal: cur, 6434 } 6435} 6436 6437// GalleryApplicationProperties describes the properties of a gallery Application Definition. 6438type GalleryApplicationProperties struct { 6439 // Description - The description of this gallery Application Definition resource. This property is updatable. 6440 Description *string `json:"description,omitempty"` 6441 // Eula - The Eula agreement for the gallery Application Definition. 6442 Eula *string `json:"eula,omitempty"` 6443 // PrivacyStatementURI - The privacy statement uri. 6444 PrivacyStatementURI *string `json:"privacyStatementUri,omitempty"` 6445 // ReleaseNoteURI - The release note uri. 6446 ReleaseNoteURI *string `json:"releaseNoteUri,omitempty"` 6447 // EndOfLifeDate - The end of life date of the gallery Application Definition. This property can be used for decommissioning purposes. This property is updatable. 6448 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 6449 // 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' 6450 SupportedOSType OperatingSystemTypes `json:"supportedOSType,omitempty"` 6451} 6452 6453// GalleryApplicationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 6454// long-running operation. 6455type GalleryApplicationsCreateOrUpdateFuture struct { 6456 azure.FutureAPI 6457 // Result returns the result of the asynchronous operation. 6458 // If the operation has not completed it will return an error. 6459 Result func(GalleryApplicationsClient) (GalleryApplication, error) 6460} 6461 6462// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6463func (future *GalleryApplicationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 6464 var azFuture azure.Future 6465 if err := json.Unmarshal(body, &azFuture); err != nil { 6466 return err 6467 } 6468 future.FutureAPI = &azFuture 6469 future.Result = future.result 6470 return nil 6471} 6472 6473// result is the default implementation for GalleryApplicationsCreateOrUpdateFuture.Result. 6474func (future *GalleryApplicationsCreateOrUpdateFuture) result(client GalleryApplicationsClient) (ga GalleryApplication, err error) { 6475 var done bool 6476 done, err = future.DoneWithContext(context.Background(), client) 6477 if err != nil { 6478 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 6479 return 6480 } 6481 if !done { 6482 ga.Response.Response = future.Response() 6483 err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationsCreateOrUpdateFuture") 6484 return 6485 } 6486 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6487 if ga.Response.Response, err = future.GetResult(sender); err == nil && ga.Response.Response.StatusCode != http.StatusNoContent { 6488 ga, err = client.CreateOrUpdateResponder(ga.Response.Response) 6489 if err != nil { 6490 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsCreateOrUpdateFuture", "Result", ga.Response.Response, "Failure responding to request") 6491 } 6492 } 6493 return 6494} 6495 6496// GalleryApplicationsDeleteFuture an abstraction for monitoring and retrieving the results of a 6497// long-running operation. 6498type GalleryApplicationsDeleteFuture struct { 6499 azure.FutureAPI 6500 // Result returns the result of the asynchronous operation. 6501 // If the operation has not completed it will return an error. 6502 Result func(GalleryApplicationsClient) (autorest.Response, error) 6503} 6504 6505// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6506func (future *GalleryApplicationsDeleteFuture) UnmarshalJSON(body []byte) error { 6507 var azFuture azure.Future 6508 if err := json.Unmarshal(body, &azFuture); err != nil { 6509 return err 6510 } 6511 future.FutureAPI = &azFuture 6512 future.Result = future.result 6513 return nil 6514} 6515 6516// result is the default implementation for GalleryApplicationsDeleteFuture.Result. 6517func (future *GalleryApplicationsDeleteFuture) result(client GalleryApplicationsClient) (ar autorest.Response, err error) { 6518 var done bool 6519 done, err = future.DoneWithContext(context.Background(), client) 6520 if err != nil { 6521 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsDeleteFuture", "Result", future.Response(), "Polling failure") 6522 return 6523 } 6524 if !done { 6525 ar.Response = future.Response() 6526 err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationsDeleteFuture") 6527 return 6528 } 6529 ar.Response = future.Response() 6530 return 6531} 6532 6533// GalleryApplicationsUpdateFuture an abstraction for monitoring and retrieving the results of a 6534// long-running operation. 6535type GalleryApplicationsUpdateFuture struct { 6536 azure.FutureAPI 6537 // Result returns the result of the asynchronous operation. 6538 // If the operation has not completed it will return an error. 6539 Result func(GalleryApplicationsClient) (GalleryApplication, error) 6540} 6541 6542// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6543func (future *GalleryApplicationsUpdateFuture) UnmarshalJSON(body []byte) error { 6544 var azFuture azure.Future 6545 if err := json.Unmarshal(body, &azFuture); err != nil { 6546 return err 6547 } 6548 future.FutureAPI = &azFuture 6549 future.Result = future.result 6550 return nil 6551} 6552 6553// result is the default implementation for GalleryApplicationsUpdateFuture.Result. 6554func (future *GalleryApplicationsUpdateFuture) result(client GalleryApplicationsClient) (ga GalleryApplication, err error) { 6555 var done bool 6556 done, err = future.DoneWithContext(context.Background(), client) 6557 if err != nil { 6558 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsUpdateFuture", "Result", future.Response(), "Polling failure") 6559 return 6560 } 6561 if !done { 6562 ga.Response.Response = future.Response() 6563 err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationsUpdateFuture") 6564 return 6565 } 6566 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6567 if ga.Response.Response, err = future.GetResult(sender); err == nil && ga.Response.Response.StatusCode != http.StatusNoContent { 6568 ga, err = client.UpdateResponder(ga.Response.Response) 6569 if err != nil { 6570 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsUpdateFuture", "Result", ga.Response.Response, "Failure responding to request") 6571 } 6572 } 6573 return 6574} 6575 6576// GalleryApplicationUpdate specifies information about the gallery Application Definition that you want to 6577// update. 6578type GalleryApplicationUpdate struct { 6579 *GalleryApplicationProperties `json:"properties,omitempty"` 6580 // ID - READ-ONLY; Resource Id 6581 ID *string `json:"id,omitempty"` 6582 // Name - READ-ONLY; Resource name 6583 Name *string `json:"name,omitempty"` 6584 // Type - READ-ONLY; Resource type 6585 Type *string `json:"type,omitempty"` 6586 // Tags - Resource tags 6587 Tags map[string]*string `json:"tags"` 6588} 6589 6590// MarshalJSON is the custom marshaler for GalleryApplicationUpdate. 6591func (gau GalleryApplicationUpdate) MarshalJSON() ([]byte, error) { 6592 objectMap := make(map[string]interface{}) 6593 if gau.GalleryApplicationProperties != nil { 6594 objectMap["properties"] = gau.GalleryApplicationProperties 6595 } 6596 if gau.Tags != nil { 6597 objectMap["tags"] = gau.Tags 6598 } 6599 return json.Marshal(objectMap) 6600} 6601 6602// UnmarshalJSON is the custom unmarshaler for GalleryApplicationUpdate struct. 6603func (gau *GalleryApplicationUpdate) UnmarshalJSON(body []byte) error { 6604 var m map[string]*json.RawMessage 6605 err := json.Unmarshal(body, &m) 6606 if err != nil { 6607 return err 6608 } 6609 for k, v := range m { 6610 switch k { 6611 case "properties": 6612 if v != nil { 6613 var galleryApplicationProperties GalleryApplicationProperties 6614 err = json.Unmarshal(*v, &galleryApplicationProperties) 6615 if err != nil { 6616 return err 6617 } 6618 gau.GalleryApplicationProperties = &galleryApplicationProperties 6619 } 6620 case "id": 6621 if v != nil { 6622 var ID string 6623 err = json.Unmarshal(*v, &ID) 6624 if err != nil { 6625 return err 6626 } 6627 gau.ID = &ID 6628 } 6629 case "name": 6630 if v != nil { 6631 var name string 6632 err = json.Unmarshal(*v, &name) 6633 if err != nil { 6634 return err 6635 } 6636 gau.Name = &name 6637 } 6638 case "type": 6639 if v != nil { 6640 var typeVar string 6641 err = json.Unmarshal(*v, &typeVar) 6642 if err != nil { 6643 return err 6644 } 6645 gau.Type = &typeVar 6646 } 6647 case "tags": 6648 if v != nil { 6649 var tags map[string]*string 6650 err = json.Unmarshal(*v, &tags) 6651 if err != nil { 6652 return err 6653 } 6654 gau.Tags = tags 6655 } 6656 } 6657 } 6658 6659 return nil 6660} 6661 6662// GalleryApplicationVersion specifies information about the gallery Application Version that you want to 6663// create or update. 6664type GalleryApplicationVersion struct { 6665 autorest.Response `json:"-"` 6666 *GalleryApplicationVersionProperties `json:"properties,omitempty"` 6667 // ID - READ-ONLY; Resource Id 6668 ID *string `json:"id,omitempty"` 6669 // Name - READ-ONLY; Resource name 6670 Name *string `json:"name,omitempty"` 6671 // Type - READ-ONLY; Resource type 6672 Type *string `json:"type,omitempty"` 6673 // Location - Resource location 6674 Location *string `json:"location,omitempty"` 6675 // Tags - Resource tags 6676 Tags map[string]*string `json:"tags"` 6677} 6678 6679// MarshalJSON is the custom marshaler for GalleryApplicationVersion. 6680func (gav GalleryApplicationVersion) MarshalJSON() ([]byte, error) { 6681 objectMap := make(map[string]interface{}) 6682 if gav.GalleryApplicationVersionProperties != nil { 6683 objectMap["properties"] = gav.GalleryApplicationVersionProperties 6684 } 6685 if gav.Location != nil { 6686 objectMap["location"] = gav.Location 6687 } 6688 if gav.Tags != nil { 6689 objectMap["tags"] = gav.Tags 6690 } 6691 return json.Marshal(objectMap) 6692} 6693 6694// UnmarshalJSON is the custom unmarshaler for GalleryApplicationVersion struct. 6695func (gav *GalleryApplicationVersion) UnmarshalJSON(body []byte) error { 6696 var m map[string]*json.RawMessage 6697 err := json.Unmarshal(body, &m) 6698 if err != nil { 6699 return err 6700 } 6701 for k, v := range m { 6702 switch k { 6703 case "properties": 6704 if v != nil { 6705 var galleryApplicationVersionProperties GalleryApplicationVersionProperties 6706 err = json.Unmarshal(*v, &galleryApplicationVersionProperties) 6707 if err != nil { 6708 return err 6709 } 6710 gav.GalleryApplicationVersionProperties = &galleryApplicationVersionProperties 6711 } 6712 case "id": 6713 if v != nil { 6714 var ID string 6715 err = json.Unmarshal(*v, &ID) 6716 if err != nil { 6717 return err 6718 } 6719 gav.ID = &ID 6720 } 6721 case "name": 6722 if v != nil { 6723 var name string 6724 err = json.Unmarshal(*v, &name) 6725 if err != nil { 6726 return err 6727 } 6728 gav.Name = &name 6729 } 6730 case "type": 6731 if v != nil { 6732 var typeVar string 6733 err = json.Unmarshal(*v, &typeVar) 6734 if err != nil { 6735 return err 6736 } 6737 gav.Type = &typeVar 6738 } 6739 case "location": 6740 if v != nil { 6741 var location string 6742 err = json.Unmarshal(*v, &location) 6743 if err != nil { 6744 return err 6745 } 6746 gav.Location = &location 6747 } 6748 case "tags": 6749 if v != nil { 6750 var tags map[string]*string 6751 err = json.Unmarshal(*v, &tags) 6752 if err != nil { 6753 return err 6754 } 6755 gav.Tags = tags 6756 } 6757 } 6758 } 6759 6760 return nil 6761} 6762 6763// GalleryApplicationVersionList the List Gallery Application version operation response. 6764type GalleryApplicationVersionList struct { 6765 autorest.Response `json:"-"` 6766 // Value - A list of gallery Application Versions. 6767 Value *[]GalleryApplicationVersion `json:"value,omitempty"` 6768 // 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. 6769 NextLink *string `json:"nextLink,omitempty"` 6770} 6771 6772// GalleryApplicationVersionListIterator provides access to a complete listing of GalleryApplicationVersion 6773// values. 6774type GalleryApplicationVersionListIterator struct { 6775 i int 6776 page GalleryApplicationVersionListPage 6777} 6778 6779// NextWithContext advances to the next value. If there was an error making 6780// the request the iterator does not advance and the error is returned. 6781func (iter *GalleryApplicationVersionListIterator) NextWithContext(ctx context.Context) (err error) { 6782 if tracing.IsEnabled() { 6783 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionListIterator.NextWithContext") 6784 defer func() { 6785 sc := -1 6786 if iter.Response().Response.Response != nil { 6787 sc = iter.Response().Response.Response.StatusCode 6788 } 6789 tracing.EndSpan(ctx, sc, err) 6790 }() 6791 } 6792 iter.i++ 6793 if iter.i < len(iter.page.Values()) { 6794 return nil 6795 } 6796 err = iter.page.NextWithContext(ctx) 6797 if err != nil { 6798 iter.i-- 6799 return err 6800 } 6801 iter.i = 0 6802 return nil 6803} 6804 6805// Next advances to the next value. If there was an error making 6806// the request the iterator does not advance and the error is returned. 6807// Deprecated: Use NextWithContext() instead. 6808func (iter *GalleryApplicationVersionListIterator) Next() error { 6809 return iter.NextWithContext(context.Background()) 6810} 6811 6812// NotDone returns true if the enumeration should be started or is not yet complete. 6813func (iter GalleryApplicationVersionListIterator) NotDone() bool { 6814 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6815} 6816 6817// Response returns the raw server response from the last page request. 6818func (iter GalleryApplicationVersionListIterator) Response() GalleryApplicationVersionList { 6819 return iter.page.Response() 6820} 6821 6822// Value returns the current value or a zero-initialized value if the 6823// iterator has advanced beyond the end of the collection. 6824func (iter GalleryApplicationVersionListIterator) Value() GalleryApplicationVersion { 6825 if !iter.page.NotDone() { 6826 return GalleryApplicationVersion{} 6827 } 6828 return iter.page.Values()[iter.i] 6829} 6830 6831// Creates a new instance of the GalleryApplicationVersionListIterator type. 6832func NewGalleryApplicationVersionListIterator(page GalleryApplicationVersionListPage) GalleryApplicationVersionListIterator { 6833 return GalleryApplicationVersionListIterator{page: page} 6834} 6835 6836// IsEmpty returns true if the ListResult contains no values. 6837func (gavl GalleryApplicationVersionList) IsEmpty() bool { 6838 return gavl.Value == nil || len(*gavl.Value) == 0 6839} 6840 6841// hasNextLink returns true if the NextLink is not empty. 6842func (gavl GalleryApplicationVersionList) hasNextLink() bool { 6843 return gavl.NextLink != nil && len(*gavl.NextLink) != 0 6844} 6845 6846// galleryApplicationVersionListPreparer prepares a request to retrieve the next set of results. 6847// It returns nil if no more results exist. 6848func (gavl GalleryApplicationVersionList) galleryApplicationVersionListPreparer(ctx context.Context) (*http.Request, error) { 6849 if !gavl.hasNextLink() { 6850 return nil, nil 6851 } 6852 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6853 autorest.AsJSON(), 6854 autorest.AsGet(), 6855 autorest.WithBaseURL(to.String(gavl.NextLink))) 6856} 6857 6858// GalleryApplicationVersionListPage contains a page of GalleryApplicationVersion values. 6859type GalleryApplicationVersionListPage struct { 6860 fn func(context.Context, GalleryApplicationVersionList) (GalleryApplicationVersionList, error) 6861 gavl GalleryApplicationVersionList 6862} 6863 6864// NextWithContext advances to the next page of values. If there was an error making 6865// the request the page does not advance and the error is returned. 6866func (page *GalleryApplicationVersionListPage) NextWithContext(ctx context.Context) (err error) { 6867 if tracing.IsEnabled() { 6868 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionListPage.NextWithContext") 6869 defer func() { 6870 sc := -1 6871 if page.Response().Response.Response != nil { 6872 sc = page.Response().Response.Response.StatusCode 6873 } 6874 tracing.EndSpan(ctx, sc, err) 6875 }() 6876 } 6877 for { 6878 next, err := page.fn(ctx, page.gavl) 6879 if err != nil { 6880 return err 6881 } 6882 page.gavl = next 6883 if !next.hasNextLink() || !next.IsEmpty() { 6884 break 6885 } 6886 } 6887 return nil 6888} 6889 6890// Next advances to the next page of values. If there was an error making 6891// the request the page does not advance and the error is returned. 6892// Deprecated: Use NextWithContext() instead. 6893func (page *GalleryApplicationVersionListPage) Next() error { 6894 return page.NextWithContext(context.Background()) 6895} 6896 6897// NotDone returns true if the page enumeration should be started or is not yet complete. 6898func (page GalleryApplicationVersionListPage) NotDone() bool { 6899 return !page.gavl.IsEmpty() 6900} 6901 6902// Response returns the raw server response from the last page request. 6903func (page GalleryApplicationVersionListPage) Response() GalleryApplicationVersionList { 6904 return page.gavl 6905} 6906 6907// Values returns the slice of values for the current page or nil if there are no values. 6908func (page GalleryApplicationVersionListPage) Values() []GalleryApplicationVersion { 6909 if page.gavl.IsEmpty() { 6910 return nil 6911 } 6912 return *page.gavl.Value 6913} 6914 6915// Creates a new instance of the GalleryApplicationVersionListPage type. 6916func NewGalleryApplicationVersionListPage(cur GalleryApplicationVersionList, getNextPage func(context.Context, GalleryApplicationVersionList) (GalleryApplicationVersionList, error)) GalleryApplicationVersionListPage { 6917 return GalleryApplicationVersionListPage{ 6918 fn: getNextPage, 6919 gavl: cur, 6920 } 6921} 6922 6923// GalleryApplicationVersionProperties describes the properties of a gallery image version. 6924type GalleryApplicationVersionProperties struct { 6925 PublishingProfile *GalleryApplicationVersionPublishingProfile `json:"publishingProfile,omitempty"` 6926 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningState1Creating', 'ProvisioningState1Updating', 'ProvisioningState1Failed', 'ProvisioningState1Succeeded', 'ProvisioningState1Deleting', 'ProvisioningState1Migrating' 6927 ProvisioningState ProvisioningState1 `json:"provisioningState,omitempty"` 6928 // ReplicationStatus - READ-ONLY 6929 ReplicationStatus *ReplicationStatus `json:"replicationStatus,omitempty"` 6930} 6931 6932// MarshalJSON is the custom marshaler for GalleryApplicationVersionProperties. 6933func (gavp GalleryApplicationVersionProperties) MarshalJSON() ([]byte, error) { 6934 objectMap := make(map[string]interface{}) 6935 if gavp.PublishingProfile != nil { 6936 objectMap["publishingProfile"] = gavp.PublishingProfile 6937 } 6938 return json.Marshal(objectMap) 6939} 6940 6941// GalleryApplicationVersionPublishingProfile the publishing profile of a gallery image version. 6942type GalleryApplicationVersionPublishingProfile struct { 6943 Source *UserArtifactSource `json:"source,omitempty"` 6944 ManageActions *UserArtifactManage `json:"manageActions,omitempty"` 6945 // EnableHealthCheck - Optional. Whether or not this application reports health. 6946 EnableHealthCheck *bool `json:"enableHealthCheck,omitempty"` 6947 // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. 6948 TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` 6949 // 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. 6950 ReplicaCount *int32 `json:"replicaCount,omitempty"` 6951 // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. 6952 ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` 6953 // PublishedDate - READ-ONLY; The timestamp for when the gallery image version is published. 6954 PublishedDate *date.Time `json:"publishedDate,omitempty"` 6955 // EndOfLifeDate - The end of life date of the gallery image version. This property can be used for decommissioning purposes. This property is updatable. 6956 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 6957 // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' 6958 StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` 6959} 6960 6961// MarshalJSON is the custom marshaler for GalleryApplicationVersionPublishingProfile. 6962func (gavpp GalleryApplicationVersionPublishingProfile) MarshalJSON() ([]byte, error) { 6963 objectMap := make(map[string]interface{}) 6964 if gavpp.Source != nil { 6965 objectMap["source"] = gavpp.Source 6966 } 6967 if gavpp.ManageActions != nil { 6968 objectMap["manageActions"] = gavpp.ManageActions 6969 } 6970 if gavpp.EnableHealthCheck != nil { 6971 objectMap["enableHealthCheck"] = gavpp.EnableHealthCheck 6972 } 6973 if gavpp.TargetRegions != nil { 6974 objectMap["targetRegions"] = gavpp.TargetRegions 6975 } 6976 if gavpp.ReplicaCount != nil { 6977 objectMap["replicaCount"] = gavpp.ReplicaCount 6978 } 6979 if gavpp.ExcludeFromLatest != nil { 6980 objectMap["excludeFromLatest"] = gavpp.ExcludeFromLatest 6981 } 6982 if gavpp.EndOfLifeDate != nil { 6983 objectMap["endOfLifeDate"] = gavpp.EndOfLifeDate 6984 } 6985 if gavpp.StorageAccountType != "" { 6986 objectMap["storageAccountType"] = gavpp.StorageAccountType 6987 } 6988 return json.Marshal(objectMap) 6989} 6990 6991// GalleryApplicationVersionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results 6992// of a long-running operation. 6993type GalleryApplicationVersionsCreateOrUpdateFuture struct { 6994 azure.FutureAPI 6995 // Result returns the result of the asynchronous operation. 6996 // If the operation has not completed it will return an error. 6997 Result func(GalleryApplicationVersionsClient) (GalleryApplicationVersion, error) 6998} 6999 7000// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7001func (future *GalleryApplicationVersionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 7002 var azFuture azure.Future 7003 if err := json.Unmarshal(body, &azFuture); err != nil { 7004 return err 7005 } 7006 future.FutureAPI = &azFuture 7007 future.Result = future.result 7008 return nil 7009} 7010 7011// result is the default implementation for GalleryApplicationVersionsCreateOrUpdateFuture.Result. 7012func (future *GalleryApplicationVersionsCreateOrUpdateFuture) result(client GalleryApplicationVersionsClient) (gav GalleryApplicationVersion, err error) { 7013 var done bool 7014 done, err = future.DoneWithContext(context.Background(), client) 7015 if err != nil { 7016 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 7017 return 7018 } 7019 if !done { 7020 gav.Response.Response = future.Response() 7021 err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationVersionsCreateOrUpdateFuture") 7022 return 7023 } 7024 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7025 if gav.Response.Response, err = future.GetResult(sender); err == nil && gav.Response.Response.StatusCode != http.StatusNoContent { 7026 gav, err = client.CreateOrUpdateResponder(gav.Response.Response) 7027 if err != nil { 7028 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsCreateOrUpdateFuture", "Result", gav.Response.Response, "Failure responding to request") 7029 } 7030 } 7031 return 7032} 7033 7034// GalleryApplicationVersionsDeleteFuture an abstraction for monitoring and retrieving the results of a 7035// long-running operation. 7036type GalleryApplicationVersionsDeleteFuture struct { 7037 azure.FutureAPI 7038 // Result returns the result of the asynchronous operation. 7039 // If the operation has not completed it will return an error. 7040 Result func(GalleryApplicationVersionsClient) (autorest.Response, error) 7041} 7042 7043// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7044func (future *GalleryApplicationVersionsDeleteFuture) UnmarshalJSON(body []byte) error { 7045 var azFuture azure.Future 7046 if err := json.Unmarshal(body, &azFuture); err != nil { 7047 return err 7048 } 7049 future.FutureAPI = &azFuture 7050 future.Result = future.result 7051 return nil 7052} 7053 7054// result is the default implementation for GalleryApplicationVersionsDeleteFuture.Result. 7055func (future *GalleryApplicationVersionsDeleteFuture) result(client GalleryApplicationVersionsClient) (ar autorest.Response, err error) { 7056 var done bool 7057 done, err = future.DoneWithContext(context.Background(), client) 7058 if err != nil { 7059 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsDeleteFuture", "Result", future.Response(), "Polling failure") 7060 return 7061 } 7062 if !done { 7063 ar.Response = future.Response() 7064 err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationVersionsDeleteFuture") 7065 return 7066 } 7067 ar.Response = future.Response() 7068 return 7069} 7070 7071// GalleryApplicationVersionsUpdateFuture an abstraction for monitoring and retrieving the results of a 7072// long-running operation. 7073type GalleryApplicationVersionsUpdateFuture struct { 7074 azure.FutureAPI 7075 // Result returns the result of the asynchronous operation. 7076 // If the operation has not completed it will return an error. 7077 Result func(GalleryApplicationVersionsClient) (GalleryApplicationVersion, error) 7078} 7079 7080// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7081func (future *GalleryApplicationVersionsUpdateFuture) UnmarshalJSON(body []byte) error { 7082 var azFuture azure.Future 7083 if err := json.Unmarshal(body, &azFuture); err != nil { 7084 return err 7085 } 7086 future.FutureAPI = &azFuture 7087 future.Result = future.result 7088 return nil 7089} 7090 7091// result is the default implementation for GalleryApplicationVersionsUpdateFuture.Result. 7092func (future *GalleryApplicationVersionsUpdateFuture) result(client GalleryApplicationVersionsClient) (gav GalleryApplicationVersion, err error) { 7093 var done bool 7094 done, err = future.DoneWithContext(context.Background(), client) 7095 if err != nil { 7096 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsUpdateFuture", "Result", future.Response(), "Polling failure") 7097 return 7098 } 7099 if !done { 7100 gav.Response.Response = future.Response() 7101 err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationVersionsUpdateFuture") 7102 return 7103 } 7104 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7105 if gav.Response.Response, err = future.GetResult(sender); err == nil && gav.Response.Response.StatusCode != http.StatusNoContent { 7106 gav, err = client.UpdateResponder(gav.Response.Response) 7107 if err != nil { 7108 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsUpdateFuture", "Result", gav.Response.Response, "Failure responding to request") 7109 } 7110 } 7111 return 7112} 7113 7114// GalleryApplicationVersionUpdate specifies information about the gallery Application Version that you 7115// want to update. 7116type GalleryApplicationVersionUpdate struct { 7117 *GalleryApplicationVersionProperties `json:"properties,omitempty"` 7118 // ID - READ-ONLY; Resource Id 7119 ID *string `json:"id,omitempty"` 7120 // Name - READ-ONLY; Resource name 7121 Name *string `json:"name,omitempty"` 7122 // Type - READ-ONLY; Resource type 7123 Type *string `json:"type,omitempty"` 7124 // Tags - Resource tags 7125 Tags map[string]*string `json:"tags"` 7126} 7127 7128// MarshalJSON is the custom marshaler for GalleryApplicationVersionUpdate. 7129func (gavu GalleryApplicationVersionUpdate) MarshalJSON() ([]byte, error) { 7130 objectMap := make(map[string]interface{}) 7131 if gavu.GalleryApplicationVersionProperties != nil { 7132 objectMap["properties"] = gavu.GalleryApplicationVersionProperties 7133 } 7134 if gavu.Tags != nil { 7135 objectMap["tags"] = gavu.Tags 7136 } 7137 return json.Marshal(objectMap) 7138} 7139 7140// UnmarshalJSON is the custom unmarshaler for GalleryApplicationVersionUpdate struct. 7141func (gavu *GalleryApplicationVersionUpdate) UnmarshalJSON(body []byte) error { 7142 var m map[string]*json.RawMessage 7143 err := json.Unmarshal(body, &m) 7144 if err != nil { 7145 return err 7146 } 7147 for k, v := range m { 7148 switch k { 7149 case "properties": 7150 if v != nil { 7151 var galleryApplicationVersionProperties GalleryApplicationVersionProperties 7152 err = json.Unmarshal(*v, &galleryApplicationVersionProperties) 7153 if err != nil { 7154 return err 7155 } 7156 gavu.GalleryApplicationVersionProperties = &galleryApplicationVersionProperties 7157 } 7158 case "id": 7159 if v != nil { 7160 var ID string 7161 err = json.Unmarshal(*v, &ID) 7162 if err != nil { 7163 return err 7164 } 7165 gavu.ID = &ID 7166 } 7167 case "name": 7168 if v != nil { 7169 var name string 7170 err = json.Unmarshal(*v, &name) 7171 if err != nil { 7172 return err 7173 } 7174 gavu.Name = &name 7175 } 7176 case "type": 7177 if v != nil { 7178 var typeVar string 7179 err = json.Unmarshal(*v, &typeVar) 7180 if err != nil { 7181 return err 7182 } 7183 gavu.Type = &typeVar 7184 } 7185 case "tags": 7186 if v != nil { 7187 var tags map[string]*string 7188 err = json.Unmarshal(*v, &tags) 7189 if err != nil { 7190 return err 7191 } 7192 gavu.Tags = tags 7193 } 7194 } 7195 } 7196 7197 return nil 7198} 7199 7200// GalleryArtifactPublishingProfileBase describes the basic gallery artifact publishing profile. 7201type GalleryArtifactPublishingProfileBase struct { 7202 // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. 7203 TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` 7204 // 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. 7205 ReplicaCount *int32 `json:"replicaCount,omitempty"` 7206 // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. 7207 ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` 7208 // PublishedDate - READ-ONLY; The timestamp for when the gallery image version is published. 7209 PublishedDate *date.Time `json:"publishedDate,omitempty"` 7210 // EndOfLifeDate - The end of life date of the gallery image version. This property can be used for decommissioning purposes. This property is updatable. 7211 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 7212 // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' 7213 StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` 7214} 7215 7216// MarshalJSON is the custom marshaler for GalleryArtifactPublishingProfileBase. 7217func (gappb GalleryArtifactPublishingProfileBase) MarshalJSON() ([]byte, error) { 7218 objectMap := make(map[string]interface{}) 7219 if gappb.TargetRegions != nil { 7220 objectMap["targetRegions"] = gappb.TargetRegions 7221 } 7222 if gappb.ReplicaCount != nil { 7223 objectMap["replicaCount"] = gappb.ReplicaCount 7224 } 7225 if gappb.ExcludeFromLatest != nil { 7226 objectMap["excludeFromLatest"] = gappb.ExcludeFromLatest 7227 } 7228 if gappb.EndOfLifeDate != nil { 7229 objectMap["endOfLifeDate"] = gappb.EndOfLifeDate 7230 } 7231 if gappb.StorageAccountType != "" { 7232 objectMap["storageAccountType"] = gappb.StorageAccountType 7233 } 7234 return json.Marshal(objectMap) 7235} 7236 7237// GalleryArtifactSource the source image from which the Image Version is going to be created. 7238type GalleryArtifactSource struct { 7239 ManagedImage *ManagedArtifact `json:"managedImage,omitempty"` 7240} 7241 7242// GalleryArtifactVersionSource the gallery artifact version source. 7243type GalleryArtifactVersionSource struct { 7244 // ID - The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, user image or storage account resource. 7245 ID *string `json:"id,omitempty"` 7246 // URI - The uri of the gallery artifact version source. Currently used to specify vhd/blob source. 7247 URI *string `json:"uri,omitempty"` 7248} 7249 7250// GalleryDataDiskImage this is the data disk image. 7251type GalleryDataDiskImage struct { 7252 // 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. 7253 Lun *int32 `json:"lun,omitempty"` 7254 // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. 7255 SizeInGB *int32 `json:"sizeInGB,omitempty"` 7256 // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' 7257 HostCaching HostCaching `json:"hostCaching,omitempty"` 7258 Source *GalleryArtifactVersionSource `json:"source,omitempty"` 7259} 7260 7261// MarshalJSON is the custom marshaler for GalleryDataDiskImage. 7262func (gddi GalleryDataDiskImage) MarshalJSON() ([]byte, error) { 7263 objectMap := make(map[string]interface{}) 7264 if gddi.Lun != nil { 7265 objectMap["lun"] = gddi.Lun 7266 } 7267 if gddi.HostCaching != "" { 7268 objectMap["hostCaching"] = gddi.HostCaching 7269 } 7270 if gddi.Source != nil { 7271 objectMap["source"] = gddi.Source 7272 } 7273 return json.Marshal(objectMap) 7274} 7275 7276// GalleryDiskImage this is the disk image base class. 7277type GalleryDiskImage struct { 7278 // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. 7279 SizeInGB *int32 `json:"sizeInGB,omitempty"` 7280 // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' 7281 HostCaching HostCaching `json:"hostCaching,omitempty"` 7282 Source *GalleryArtifactVersionSource `json:"source,omitempty"` 7283} 7284 7285// MarshalJSON is the custom marshaler for GalleryDiskImage. 7286func (gdi GalleryDiskImage) MarshalJSON() ([]byte, error) { 7287 objectMap := make(map[string]interface{}) 7288 if gdi.HostCaching != "" { 7289 objectMap["hostCaching"] = gdi.HostCaching 7290 } 7291 if gdi.Source != nil { 7292 objectMap["source"] = gdi.Source 7293 } 7294 return json.Marshal(objectMap) 7295} 7296 7297// GalleryIdentifier describes the gallery unique name. 7298type GalleryIdentifier struct { 7299 // UniqueName - READ-ONLY; The unique name of the Shared Image Gallery. This name is generated automatically by Azure. 7300 UniqueName *string `json:"uniqueName,omitempty"` 7301} 7302 7303// MarshalJSON is the custom marshaler for GalleryIdentifier. 7304func (gi GalleryIdentifier) MarshalJSON() ([]byte, error) { 7305 objectMap := make(map[string]interface{}) 7306 return json.Marshal(objectMap) 7307} 7308 7309// GalleryImage specifies information about the gallery image definition that you want to create or update. 7310type GalleryImage struct { 7311 autorest.Response `json:"-"` 7312 *GalleryImageProperties `json:"properties,omitempty"` 7313 // ID - READ-ONLY; Resource Id 7314 ID *string `json:"id,omitempty"` 7315 // Name - READ-ONLY; Resource name 7316 Name *string `json:"name,omitempty"` 7317 // Type - READ-ONLY; Resource type 7318 Type *string `json:"type,omitempty"` 7319 // Location - Resource location 7320 Location *string `json:"location,omitempty"` 7321 // Tags - Resource tags 7322 Tags map[string]*string `json:"tags"` 7323} 7324 7325// MarshalJSON is the custom marshaler for GalleryImage. 7326func (gi GalleryImage) MarshalJSON() ([]byte, error) { 7327 objectMap := make(map[string]interface{}) 7328 if gi.GalleryImageProperties != nil { 7329 objectMap["properties"] = gi.GalleryImageProperties 7330 } 7331 if gi.Location != nil { 7332 objectMap["location"] = gi.Location 7333 } 7334 if gi.Tags != nil { 7335 objectMap["tags"] = gi.Tags 7336 } 7337 return json.Marshal(objectMap) 7338} 7339 7340// UnmarshalJSON is the custom unmarshaler for GalleryImage struct. 7341func (gi *GalleryImage) UnmarshalJSON(body []byte) error { 7342 var m map[string]*json.RawMessage 7343 err := json.Unmarshal(body, &m) 7344 if err != nil { 7345 return err 7346 } 7347 for k, v := range m { 7348 switch k { 7349 case "properties": 7350 if v != nil { 7351 var galleryImageProperties GalleryImageProperties 7352 err = json.Unmarshal(*v, &galleryImageProperties) 7353 if err != nil { 7354 return err 7355 } 7356 gi.GalleryImageProperties = &galleryImageProperties 7357 } 7358 case "id": 7359 if v != nil { 7360 var ID string 7361 err = json.Unmarshal(*v, &ID) 7362 if err != nil { 7363 return err 7364 } 7365 gi.ID = &ID 7366 } 7367 case "name": 7368 if v != nil { 7369 var name string 7370 err = json.Unmarshal(*v, &name) 7371 if err != nil { 7372 return err 7373 } 7374 gi.Name = &name 7375 } 7376 case "type": 7377 if v != nil { 7378 var typeVar string 7379 err = json.Unmarshal(*v, &typeVar) 7380 if err != nil { 7381 return err 7382 } 7383 gi.Type = &typeVar 7384 } 7385 case "location": 7386 if v != nil { 7387 var location string 7388 err = json.Unmarshal(*v, &location) 7389 if err != nil { 7390 return err 7391 } 7392 gi.Location = &location 7393 } 7394 case "tags": 7395 if v != nil { 7396 var tags map[string]*string 7397 err = json.Unmarshal(*v, &tags) 7398 if err != nil { 7399 return err 7400 } 7401 gi.Tags = tags 7402 } 7403 } 7404 } 7405 7406 return nil 7407} 7408 7409// GalleryImageFeature a feature for gallery image. 7410type GalleryImageFeature struct { 7411 // Name - The name of the gallery image feature. 7412 Name *string `json:"name,omitempty"` 7413 // Value - The value of the gallery image feature. 7414 Value *string `json:"value,omitempty"` 7415} 7416 7417// GalleryImageIdentifier this is the gallery image definition identifier. 7418type GalleryImageIdentifier struct { 7419 // Publisher - The name of the gallery image definition publisher. 7420 Publisher *string `json:"publisher,omitempty"` 7421 // Offer - The name of the gallery image definition offer. 7422 Offer *string `json:"offer,omitempty"` 7423 // Sku - The name of the gallery image definition SKU. 7424 Sku *string `json:"sku,omitempty"` 7425} 7426 7427// GalleryImageList the List Gallery Images operation response. 7428type GalleryImageList struct { 7429 autorest.Response `json:"-"` 7430 // Value - A list of Shared Image Gallery images. 7431 Value *[]GalleryImage `json:"value,omitempty"` 7432 // 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. 7433 NextLink *string `json:"nextLink,omitempty"` 7434} 7435 7436// GalleryImageListIterator provides access to a complete listing of GalleryImage values. 7437type GalleryImageListIterator struct { 7438 i int 7439 page GalleryImageListPage 7440} 7441 7442// NextWithContext advances to the next value. If there was an error making 7443// the request the iterator does not advance and the error is returned. 7444func (iter *GalleryImageListIterator) NextWithContext(ctx context.Context) (err error) { 7445 if tracing.IsEnabled() { 7446 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageListIterator.NextWithContext") 7447 defer func() { 7448 sc := -1 7449 if iter.Response().Response.Response != nil { 7450 sc = iter.Response().Response.Response.StatusCode 7451 } 7452 tracing.EndSpan(ctx, sc, err) 7453 }() 7454 } 7455 iter.i++ 7456 if iter.i < len(iter.page.Values()) { 7457 return nil 7458 } 7459 err = iter.page.NextWithContext(ctx) 7460 if err != nil { 7461 iter.i-- 7462 return err 7463 } 7464 iter.i = 0 7465 return nil 7466} 7467 7468// Next advances to the next value. If there was an error making 7469// the request the iterator does not advance and the error is returned. 7470// Deprecated: Use NextWithContext() instead. 7471func (iter *GalleryImageListIterator) Next() error { 7472 return iter.NextWithContext(context.Background()) 7473} 7474 7475// NotDone returns true if the enumeration should be started or is not yet complete. 7476func (iter GalleryImageListIterator) NotDone() bool { 7477 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7478} 7479 7480// Response returns the raw server response from the last page request. 7481func (iter GalleryImageListIterator) Response() GalleryImageList { 7482 return iter.page.Response() 7483} 7484 7485// Value returns the current value or a zero-initialized value if the 7486// iterator has advanced beyond the end of the collection. 7487func (iter GalleryImageListIterator) Value() GalleryImage { 7488 if !iter.page.NotDone() { 7489 return GalleryImage{} 7490 } 7491 return iter.page.Values()[iter.i] 7492} 7493 7494// Creates a new instance of the GalleryImageListIterator type. 7495func NewGalleryImageListIterator(page GalleryImageListPage) GalleryImageListIterator { 7496 return GalleryImageListIterator{page: page} 7497} 7498 7499// IsEmpty returns true if the ListResult contains no values. 7500func (gil GalleryImageList) IsEmpty() bool { 7501 return gil.Value == nil || len(*gil.Value) == 0 7502} 7503 7504// hasNextLink returns true if the NextLink is not empty. 7505func (gil GalleryImageList) hasNextLink() bool { 7506 return gil.NextLink != nil && len(*gil.NextLink) != 0 7507} 7508 7509// galleryImageListPreparer prepares a request to retrieve the next set of results. 7510// It returns nil if no more results exist. 7511func (gil GalleryImageList) galleryImageListPreparer(ctx context.Context) (*http.Request, error) { 7512 if !gil.hasNextLink() { 7513 return nil, nil 7514 } 7515 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7516 autorest.AsJSON(), 7517 autorest.AsGet(), 7518 autorest.WithBaseURL(to.String(gil.NextLink))) 7519} 7520 7521// GalleryImageListPage contains a page of GalleryImage values. 7522type GalleryImageListPage struct { 7523 fn func(context.Context, GalleryImageList) (GalleryImageList, error) 7524 gil GalleryImageList 7525} 7526 7527// NextWithContext advances to the next page of values. If there was an error making 7528// the request the page does not advance and the error is returned. 7529func (page *GalleryImageListPage) NextWithContext(ctx context.Context) (err error) { 7530 if tracing.IsEnabled() { 7531 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageListPage.NextWithContext") 7532 defer func() { 7533 sc := -1 7534 if page.Response().Response.Response != nil { 7535 sc = page.Response().Response.Response.StatusCode 7536 } 7537 tracing.EndSpan(ctx, sc, err) 7538 }() 7539 } 7540 for { 7541 next, err := page.fn(ctx, page.gil) 7542 if err != nil { 7543 return err 7544 } 7545 page.gil = next 7546 if !next.hasNextLink() || !next.IsEmpty() { 7547 break 7548 } 7549 } 7550 return nil 7551} 7552 7553// Next advances to the next page of values. If there was an error making 7554// the request the page does not advance and the error is returned. 7555// Deprecated: Use NextWithContext() instead. 7556func (page *GalleryImageListPage) Next() error { 7557 return page.NextWithContext(context.Background()) 7558} 7559 7560// NotDone returns true if the page enumeration should be started or is not yet complete. 7561func (page GalleryImageListPage) NotDone() bool { 7562 return !page.gil.IsEmpty() 7563} 7564 7565// Response returns the raw server response from the last page request. 7566func (page GalleryImageListPage) Response() GalleryImageList { 7567 return page.gil 7568} 7569 7570// Values returns the slice of values for the current page or nil if there are no values. 7571func (page GalleryImageListPage) Values() []GalleryImage { 7572 if page.gil.IsEmpty() { 7573 return nil 7574 } 7575 return *page.gil.Value 7576} 7577 7578// Creates a new instance of the GalleryImageListPage type. 7579func NewGalleryImageListPage(cur GalleryImageList, getNextPage func(context.Context, GalleryImageList) (GalleryImageList, error)) GalleryImageListPage { 7580 return GalleryImageListPage{ 7581 fn: getNextPage, 7582 gil: cur, 7583 } 7584} 7585 7586// GalleryImageProperties describes the properties of a gallery image definition. 7587type GalleryImageProperties struct { 7588 // Description - The description of this gallery image definition resource. This property is updatable. 7589 Description *string `json:"description,omitempty"` 7590 // Eula - The Eula agreement for the gallery image definition. 7591 Eula *string `json:"eula,omitempty"` 7592 // PrivacyStatementURI - The privacy statement uri. 7593 PrivacyStatementURI *string `json:"privacyStatementUri,omitempty"` 7594 // ReleaseNoteURI - The release note uri. 7595 ReleaseNoteURI *string `json:"releaseNoteUri,omitempty"` 7596 // 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' 7597 OsType OperatingSystemTypes `json:"osType,omitempty"` 7598 // 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' 7599 OsState OperatingSystemStateTypes `json:"osState,omitempty"` 7600 // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'HyperVGenerationV1', 'HyperVGenerationV2' 7601 HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` 7602 // EndOfLifeDate - The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property is updatable. 7603 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 7604 Identifier *GalleryImageIdentifier `json:"identifier,omitempty"` 7605 Recommended *RecommendedMachineConfiguration `json:"recommended,omitempty"` 7606 Disallowed *Disallowed `json:"disallowed,omitempty"` 7607 PurchasePlan *ImagePurchasePlan `json:"purchasePlan,omitempty"` 7608 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningState2Creating', 'ProvisioningState2Updating', 'ProvisioningState2Failed', 'ProvisioningState2Succeeded', 'ProvisioningState2Deleting', 'ProvisioningState2Migrating' 7609 ProvisioningState ProvisioningState2 `json:"provisioningState,omitempty"` 7610 // Features - A list of gallery image features. 7611 Features *[]GalleryImageFeature `json:"features,omitempty"` 7612} 7613 7614// MarshalJSON is the custom marshaler for GalleryImageProperties. 7615func (gip GalleryImageProperties) MarshalJSON() ([]byte, error) { 7616 objectMap := make(map[string]interface{}) 7617 if gip.Description != nil { 7618 objectMap["description"] = gip.Description 7619 } 7620 if gip.Eula != nil { 7621 objectMap["eula"] = gip.Eula 7622 } 7623 if gip.PrivacyStatementURI != nil { 7624 objectMap["privacyStatementUri"] = gip.PrivacyStatementURI 7625 } 7626 if gip.ReleaseNoteURI != nil { 7627 objectMap["releaseNoteUri"] = gip.ReleaseNoteURI 7628 } 7629 if gip.OsType != "" { 7630 objectMap["osType"] = gip.OsType 7631 } 7632 if gip.OsState != "" { 7633 objectMap["osState"] = gip.OsState 7634 } 7635 if gip.HyperVGeneration != "" { 7636 objectMap["hyperVGeneration"] = gip.HyperVGeneration 7637 } 7638 if gip.EndOfLifeDate != nil { 7639 objectMap["endOfLifeDate"] = gip.EndOfLifeDate 7640 } 7641 if gip.Identifier != nil { 7642 objectMap["identifier"] = gip.Identifier 7643 } 7644 if gip.Recommended != nil { 7645 objectMap["recommended"] = gip.Recommended 7646 } 7647 if gip.Disallowed != nil { 7648 objectMap["disallowed"] = gip.Disallowed 7649 } 7650 if gip.PurchasePlan != nil { 7651 objectMap["purchasePlan"] = gip.PurchasePlan 7652 } 7653 if gip.Features != nil { 7654 objectMap["features"] = gip.Features 7655 } 7656 return json.Marshal(objectMap) 7657} 7658 7659// GalleryImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 7660// long-running operation. 7661type GalleryImagesCreateOrUpdateFuture struct { 7662 azure.FutureAPI 7663 // Result returns the result of the asynchronous operation. 7664 // If the operation has not completed it will return an error. 7665 Result func(GalleryImagesClient) (GalleryImage, error) 7666} 7667 7668// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7669func (future *GalleryImagesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 7670 var azFuture azure.Future 7671 if err := json.Unmarshal(body, &azFuture); err != nil { 7672 return err 7673 } 7674 future.FutureAPI = &azFuture 7675 future.Result = future.result 7676 return nil 7677} 7678 7679// result is the default implementation for GalleryImagesCreateOrUpdateFuture.Result. 7680func (future *GalleryImagesCreateOrUpdateFuture) result(client GalleryImagesClient) (gi GalleryImage, err error) { 7681 var done bool 7682 done, err = future.DoneWithContext(context.Background(), client) 7683 if err != nil { 7684 err = autorest.NewErrorWithError(err, "compute.GalleryImagesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 7685 return 7686 } 7687 if !done { 7688 gi.Response.Response = future.Response() 7689 err = azure.NewAsyncOpIncompleteError("compute.GalleryImagesCreateOrUpdateFuture") 7690 return 7691 } 7692 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7693 if gi.Response.Response, err = future.GetResult(sender); err == nil && gi.Response.Response.StatusCode != http.StatusNoContent { 7694 gi, err = client.CreateOrUpdateResponder(gi.Response.Response) 7695 if err != nil { 7696 err = autorest.NewErrorWithError(err, "compute.GalleryImagesCreateOrUpdateFuture", "Result", gi.Response.Response, "Failure responding to request") 7697 } 7698 } 7699 return 7700} 7701 7702// GalleryImagesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 7703// operation. 7704type GalleryImagesDeleteFuture struct { 7705 azure.FutureAPI 7706 // Result returns the result of the asynchronous operation. 7707 // If the operation has not completed it will return an error. 7708 Result func(GalleryImagesClient) (autorest.Response, error) 7709} 7710 7711// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7712func (future *GalleryImagesDeleteFuture) UnmarshalJSON(body []byte) error { 7713 var azFuture azure.Future 7714 if err := json.Unmarshal(body, &azFuture); err != nil { 7715 return err 7716 } 7717 future.FutureAPI = &azFuture 7718 future.Result = future.result 7719 return nil 7720} 7721 7722// result is the default implementation for GalleryImagesDeleteFuture.Result. 7723func (future *GalleryImagesDeleteFuture) result(client GalleryImagesClient) (ar autorest.Response, err error) { 7724 var done bool 7725 done, err = future.DoneWithContext(context.Background(), client) 7726 if err != nil { 7727 err = autorest.NewErrorWithError(err, "compute.GalleryImagesDeleteFuture", "Result", future.Response(), "Polling failure") 7728 return 7729 } 7730 if !done { 7731 ar.Response = future.Response() 7732 err = azure.NewAsyncOpIncompleteError("compute.GalleryImagesDeleteFuture") 7733 return 7734 } 7735 ar.Response = future.Response() 7736 return 7737} 7738 7739// GalleryImagesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 7740// operation. 7741type GalleryImagesUpdateFuture struct { 7742 azure.FutureAPI 7743 // Result returns the result of the asynchronous operation. 7744 // If the operation has not completed it will return an error. 7745 Result func(GalleryImagesClient) (GalleryImage, error) 7746} 7747 7748// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7749func (future *GalleryImagesUpdateFuture) UnmarshalJSON(body []byte) error { 7750 var azFuture azure.Future 7751 if err := json.Unmarshal(body, &azFuture); err != nil { 7752 return err 7753 } 7754 future.FutureAPI = &azFuture 7755 future.Result = future.result 7756 return nil 7757} 7758 7759// result is the default implementation for GalleryImagesUpdateFuture.Result. 7760func (future *GalleryImagesUpdateFuture) result(client GalleryImagesClient) (gi GalleryImage, err error) { 7761 var done bool 7762 done, err = future.DoneWithContext(context.Background(), client) 7763 if err != nil { 7764 err = autorest.NewErrorWithError(err, "compute.GalleryImagesUpdateFuture", "Result", future.Response(), "Polling failure") 7765 return 7766 } 7767 if !done { 7768 gi.Response.Response = future.Response() 7769 err = azure.NewAsyncOpIncompleteError("compute.GalleryImagesUpdateFuture") 7770 return 7771 } 7772 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7773 if gi.Response.Response, err = future.GetResult(sender); err == nil && gi.Response.Response.StatusCode != http.StatusNoContent { 7774 gi, err = client.UpdateResponder(gi.Response.Response) 7775 if err != nil { 7776 err = autorest.NewErrorWithError(err, "compute.GalleryImagesUpdateFuture", "Result", gi.Response.Response, "Failure responding to request") 7777 } 7778 } 7779 return 7780} 7781 7782// GalleryImageUpdate specifies information about the gallery image definition that you want to update. 7783type GalleryImageUpdate struct { 7784 *GalleryImageProperties `json:"properties,omitempty"` 7785 // ID - READ-ONLY; Resource Id 7786 ID *string `json:"id,omitempty"` 7787 // Name - READ-ONLY; Resource name 7788 Name *string `json:"name,omitempty"` 7789 // Type - READ-ONLY; Resource type 7790 Type *string `json:"type,omitempty"` 7791 // Tags - Resource tags 7792 Tags map[string]*string `json:"tags"` 7793} 7794 7795// MarshalJSON is the custom marshaler for GalleryImageUpdate. 7796func (giu GalleryImageUpdate) MarshalJSON() ([]byte, error) { 7797 objectMap := make(map[string]interface{}) 7798 if giu.GalleryImageProperties != nil { 7799 objectMap["properties"] = giu.GalleryImageProperties 7800 } 7801 if giu.Tags != nil { 7802 objectMap["tags"] = giu.Tags 7803 } 7804 return json.Marshal(objectMap) 7805} 7806 7807// UnmarshalJSON is the custom unmarshaler for GalleryImageUpdate struct. 7808func (giu *GalleryImageUpdate) UnmarshalJSON(body []byte) error { 7809 var m map[string]*json.RawMessage 7810 err := json.Unmarshal(body, &m) 7811 if err != nil { 7812 return err 7813 } 7814 for k, v := range m { 7815 switch k { 7816 case "properties": 7817 if v != nil { 7818 var galleryImageProperties GalleryImageProperties 7819 err = json.Unmarshal(*v, &galleryImageProperties) 7820 if err != nil { 7821 return err 7822 } 7823 giu.GalleryImageProperties = &galleryImageProperties 7824 } 7825 case "id": 7826 if v != nil { 7827 var ID string 7828 err = json.Unmarshal(*v, &ID) 7829 if err != nil { 7830 return err 7831 } 7832 giu.ID = &ID 7833 } 7834 case "name": 7835 if v != nil { 7836 var name string 7837 err = json.Unmarshal(*v, &name) 7838 if err != nil { 7839 return err 7840 } 7841 giu.Name = &name 7842 } 7843 case "type": 7844 if v != nil { 7845 var typeVar string 7846 err = json.Unmarshal(*v, &typeVar) 7847 if err != nil { 7848 return err 7849 } 7850 giu.Type = &typeVar 7851 } 7852 case "tags": 7853 if v != nil { 7854 var tags map[string]*string 7855 err = json.Unmarshal(*v, &tags) 7856 if err != nil { 7857 return err 7858 } 7859 giu.Tags = tags 7860 } 7861 } 7862 } 7863 7864 return nil 7865} 7866 7867// GalleryImageVersion specifies information about the gallery image version that you want to create or 7868// update. 7869type GalleryImageVersion struct { 7870 autorest.Response `json:"-"` 7871 *GalleryImageVersionProperties `json:"properties,omitempty"` 7872 // ID - READ-ONLY; Resource Id 7873 ID *string `json:"id,omitempty"` 7874 // Name - READ-ONLY; Resource name 7875 Name *string `json:"name,omitempty"` 7876 // Type - READ-ONLY; Resource type 7877 Type *string `json:"type,omitempty"` 7878 // Location - Resource location 7879 Location *string `json:"location,omitempty"` 7880 // Tags - Resource tags 7881 Tags map[string]*string `json:"tags"` 7882} 7883 7884// MarshalJSON is the custom marshaler for GalleryImageVersion. 7885func (giv GalleryImageVersion) MarshalJSON() ([]byte, error) { 7886 objectMap := make(map[string]interface{}) 7887 if giv.GalleryImageVersionProperties != nil { 7888 objectMap["properties"] = giv.GalleryImageVersionProperties 7889 } 7890 if giv.Location != nil { 7891 objectMap["location"] = giv.Location 7892 } 7893 if giv.Tags != nil { 7894 objectMap["tags"] = giv.Tags 7895 } 7896 return json.Marshal(objectMap) 7897} 7898 7899// UnmarshalJSON is the custom unmarshaler for GalleryImageVersion struct. 7900func (giv *GalleryImageVersion) UnmarshalJSON(body []byte) error { 7901 var m map[string]*json.RawMessage 7902 err := json.Unmarshal(body, &m) 7903 if err != nil { 7904 return err 7905 } 7906 for k, v := range m { 7907 switch k { 7908 case "properties": 7909 if v != nil { 7910 var galleryImageVersionProperties GalleryImageVersionProperties 7911 err = json.Unmarshal(*v, &galleryImageVersionProperties) 7912 if err != nil { 7913 return err 7914 } 7915 giv.GalleryImageVersionProperties = &galleryImageVersionProperties 7916 } 7917 case "id": 7918 if v != nil { 7919 var ID string 7920 err = json.Unmarshal(*v, &ID) 7921 if err != nil { 7922 return err 7923 } 7924 giv.ID = &ID 7925 } 7926 case "name": 7927 if v != nil { 7928 var name string 7929 err = json.Unmarshal(*v, &name) 7930 if err != nil { 7931 return err 7932 } 7933 giv.Name = &name 7934 } 7935 case "type": 7936 if v != nil { 7937 var typeVar string 7938 err = json.Unmarshal(*v, &typeVar) 7939 if err != nil { 7940 return err 7941 } 7942 giv.Type = &typeVar 7943 } 7944 case "location": 7945 if v != nil { 7946 var location string 7947 err = json.Unmarshal(*v, &location) 7948 if err != nil { 7949 return err 7950 } 7951 giv.Location = &location 7952 } 7953 case "tags": 7954 if v != nil { 7955 var tags map[string]*string 7956 err = json.Unmarshal(*v, &tags) 7957 if err != nil { 7958 return err 7959 } 7960 giv.Tags = tags 7961 } 7962 } 7963 } 7964 7965 return nil 7966} 7967 7968// GalleryImageVersionList the List Gallery Image version operation response. 7969type GalleryImageVersionList struct { 7970 autorest.Response `json:"-"` 7971 // Value - A list of gallery image versions. 7972 Value *[]GalleryImageVersion `json:"value,omitempty"` 7973 // 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. 7974 NextLink *string `json:"nextLink,omitempty"` 7975} 7976 7977// GalleryImageVersionListIterator provides access to a complete listing of GalleryImageVersion values. 7978type GalleryImageVersionListIterator struct { 7979 i int 7980 page GalleryImageVersionListPage 7981} 7982 7983// NextWithContext advances to the next value. If there was an error making 7984// the request the iterator does not advance and the error is returned. 7985func (iter *GalleryImageVersionListIterator) NextWithContext(ctx context.Context) (err error) { 7986 if tracing.IsEnabled() { 7987 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionListIterator.NextWithContext") 7988 defer func() { 7989 sc := -1 7990 if iter.Response().Response.Response != nil { 7991 sc = iter.Response().Response.Response.StatusCode 7992 } 7993 tracing.EndSpan(ctx, sc, err) 7994 }() 7995 } 7996 iter.i++ 7997 if iter.i < len(iter.page.Values()) { 7998 return nil 7999 } 8000 err = iter.page.NextWithContext(ctx) 8001 if err != nil { 8002 iter.i-- 8003 return err 8004 } 8005 iter.i = 0 8006 return nil 8007} 8008 8009// Next advances to the next value. If there was an error making 8010// the request the iterator does not advance and the error is returned. 8011// Deprecated: Use NextWithContext() instead. 8012func (iter *GalleryImageVersionListIterator) Next() error { 8013 return iter.NextWithContext(context.Background()) 8014} 8015 8016// NotDone returns true if the enumeration should be started or is not yet complete. 8017func (iter GalleryImageVersionListIterator) NotDone() bool { 8018 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8019} 8020 8021// Response returns the raw server response from the last page request. 8022func (iter GalleryImageVersionListIterator) Response() GalleryImageVersionList { 8023 return iter.page.Response() 8024} 8025 8026// Value returns the current value or a zero-initialized value if the 8027// iterator has advanced beyond the end of the collection. 8028func (iter GalleryImageVersionListIterator) Value() GalleryImageVersion { 8029 if !iter.page.NotDone() { 8030 return GalleryImageVersion{} 8031 } 8032 return iter.page.Values()[iter.i] 8033} 8034 8035// Creates a new instance of the GalleryImageVersionListIterator type. 8036func NewGalleryImageVersionListIterator(page GalleryImageVersionListPage) GalleryImageVersionListIterator { 8037 return GalleryImageVersionListIterator{page: page} 8038} 8039 8040// IsEmpty returns true if the ListResult contains no values. 8041func (givl GalleryImageVersionList) IsEmpty() bool { 8042 return givl.Value == nil || len(*givl.Value) == 0 8043} 8044 8045// hasNextLink returns true if the NextLink is not empty. 8046func (givl GalleryImageVersionList) hasNextLink() bool { 8047 return givl.NextLink != nil && len(*givl.NextLink) != 0 8048} 8049 8050// galleryImageVersionListPreparer prepares a request to retrieve the next set of results. 8051// It returns nil if no more results exist. 8052func (givl GalleryImageVersionList) galleryImageVersionListPreparer(ctx context.Context) (*http.Request, error) { 8053 if !givl.hasNextLink() { 8054 return nil, nil 8055 } 8056 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8057 autorest.AsJSON(), 8058 autorest.AsGet(), 8059 autorest.WithBaseURL(to.String(givl.NextLink))) 8060} 8061 8062// GalleryImageVersionListPage contains a page of GalleryImageVersion values. 8063type GalleryImageVersionListPage struct { 8064 fn func(context.Context, GalleryImageVersionList) (GalleryImageVersionList, error) 8065 givl GalleryImageVersionList 8066} 8067 8068// NextWithContext advances to the next page of values. If there was an error making 8069// the request the page does not advance and the error is returned. 8070func (page *GalleryImageVersionListPage) NextWithContext(ctx context.Context) (err error) { 8071 if tracing.IsEnabled() { 8072 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionListPage.NextWithContext") 8073 defer func() { 8074 sc := -1 8075 if page.Response().Response.Response != nil { 8076 sc = page.Response().Response.Response.StatusCode 8077 } 8078 tracing.EndSpan(ctx, sc, err) 8079 }() 8080 } 8081 for { 8082 next, err := page.fn(ctx, page.givl) 8083 if err != nil { 8084 return err 8085 } 8086 page.givl = next 8087 if !next.hasNextLink() || !next.IsEmpty() { 8088 break 8089 } 8090 } 8091 return nil 8092} 8093 8094// Next advances to the next page of values. If there was an error making 8095// the request the page does not advance and the error is returned. 8096// Deprecated: Use NextWithContext() instead. 8097func (page *GalleryImageVersionListPage) Next() error { 8098 return page.NextWithContext(context.Background()) 8099} 8100 8101// NotDone returns true if the page enumeration should be started or is not yet complete. 8102func (page GalleryImageVersionListPage) NotDone() bool { 8103 return !page.givl.IsEmpty() 8104} 8105 8106// Response returns the raw server response from the last page request. 8107func (page GalleryImageVersionListPage) Response() GalleryImageVersionList { 8108 return page.givl 8109} 8110 8111// Values returns the slice of values for the current page or nil if there are no values. 8112func (page GalleryImageVersionListPage) Values() []GalleryImageVersion { 8113 if page.givl.IsEmpty() { 8114 return nil 8115 } 8116 return *page.givl.Value 8117} 8118 8119// Creates a new instance of the GalleryImageVersionListPage type. 8120func NewGalleryImageVersionListPage(cur GalleryImageVersionList, getNextPage func(context.Context, GalleryImageVersionList) (GalleryImageVersionList, error)) GalleryImageVersionListPage { 8121 return GalleryImageVersionListPage{ 8122 fn: getNextPage, 8123 givl: cur, 8124 } 8125} 8126 8127// GalleryImageVersionProperties describes the properties of a gallery image version. 8128type GalleryImageVersionProperties struct { 8129 PublishingProfile *GalleryImageVersionPublishingProfile `json:"publishingProfile,omitempty"` 8130 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningState3Creating', 'ProvisioningState3Updating', 'ProvisioningState3Failed', 'ProvisioningState3Succeeded', 'ProvisioningState3Deleting', 'ProvisioningState3Migrating' 8131 ProvisioningState ProvisioningState3 `json:"provisioningState,omitempty"` 8132 StorageProfile *GalleryImageVersionStorageProfile `json:"storageProfile,omitempty"` 8133 // ReplicationStatus - READ-ONLY 8134 ReplicationStatus *ReplicationStatus `json:"replicationStatus,omitempty"` 8135} 8136 8137// MarshalJSON is the custom marshaler for GalleryImageVersionProperties. 8138func (givp GalleryImageVersionProperties) MarshalJSON() ([]byte, error) { 8139 objectMap := make(map[string]interface{}) 8140 if givp.PublishingProfile != nil { 8141 objectMap["publishingProfile"] = givp.PublishingProfile 8142 } 8143 if givp.StorageProfile != nil { 8144 objectMap["storageProfile"] = givp.StorageProfile 8145 } 8146 return json.Marshal(objectMap) 8147} 8148 8149// GalleryImageVersionPublishingProfile the publishing profile of a gallery image Version. 8150type GalleryImageVersionPublishingProfile struct { 8151 // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. 8152 TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` 8153 // 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. 8154 ReplicaCount *int32 `json:"replicaCount,omitempty"` 8155 // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. 8156 ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` 8157 // PublishedDate - READ-ONLY; The timestamp for when the gallery image version is published. 8158 PublishedDate *date.Time `json:"publishedDate,omitempty"` 8159 // EndOfLifeDate - The end of life date of the gallery image version. This property can be used for decommissioning purposes. This property is updatable. 8160 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 8161 // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' 8162 StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` 8163} 8164 8165// MarshalJSON is the custom marshaler for GalleryImageVersionPublishingProfile. 8166func (givpp GalleryImageVersionPublishingProfile) MarshalJSON() ([]byte, error) { 8167 objectMap := make(map[string]interface{}) 8168 if givpp.TargetRegions != nil { 8169 objectMap["targetRegions"] = givpp.TargetRegions 8170 } 8171 if givpp.ReplicaCount != nil { 8172 objectMap["replicaCount"] = givpp.ReplicaCount 8173 } 8174 if givpp.ExcludeFromLatest != nil { 8175 objectMap["excludeFromLatest"] = givpp.ExcludeFromLatest 8176 } 8177 if givpp.EndOfLifeDate != nil { 8178 objectMap["endOfLifeDate"] = givpp.EndOfLifeDate 8179 } 8180 if givpp.StorageAccountType != "" { 8181 objectMap["storageAccountType"] = givpp.StorageAccountType 8182 } 8183 return json.Marshal(objectMap) 8184} 8185 8186// GalleryImageVersionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 8187// long-running operation. 8188type GalleryImageVersionsCreateOrUpdateFuture struct { 8189 azure.FutureAPI 8190 // Result returns the result of the asynchronous operation. 8191 // If the operation has not completed it will return an error. 8192 Result func(GalleryImageVersionsClient) (GalleryImageVersion, error) 8193} 8194 8195// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8196func (future *GalleryImageVersionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 8197 var azFuture azure.Future 8198 if err := json.Unmarshal(body, &azFuture); err != nil { 8199 return err 8200 } 8201 future.FutureAPI = &azFuture 8202 future.Result = future.result 8203 return nil 8204} 8205 8206// result is the default implementation for GalleryImageVersionsCreateOrUpdateFuture.Result. 8207func (future *GalleryImageVersionsCreateOrUpdateFuture) result(client GalleryImageVersionsClient) (giv GalleryImageVersion, err error) { 8208 var done bool 8209 done, err = future.DoneWithContext(context.Background(), client) 8210 if err != nil { 8211 err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 8212 return 8213 } 8214 if !done { 8215 giv.Response.Response = future.Response() 8216 err = azure.NewAsyncOpIncompleteError("compute.GalleryImageVersionsCreateOrUpdateFuture") 8217 return 8218 } 8219 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8220 if giv.Response.Response, err = future.GetResult(sender); err == nil && giv.Response.Response.StatusCode != http.StatusNoContent { 8221 giv, err = client.CreateOrUpdateResponder(giv.Response.Response) 8222 if err != nil { 8223 err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsCreateOrUpdateFuture", "Result", giv.Response.Response, "Failure responding to request") 8224 } 8225 } 8226 return 8227} 8228 8229// GalleryImageVersionsDeleteFuture an abstraction for monitoring and retrieving the results of a 8230// long-running operation. 8231type GalleryImageVersionsDeleteFuture struct { 8232 azure.FutureAPI 8233 // Result returns the result of the asynchronous operation. 8234 // If the operation has not completed it will return an error. 8235 Result func(GalleryImageVersionsClient) (autorest.Response, error) 8236} 8237 8238// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8239func (future *GalleryImageVersionsDeleteFuture) UnmarshalJSON(body []byte) error { 8240 var azFuture azure.Future 8241 if err := json.Unmarshal(body, &azFuture); err != nil { 8242 return err 8243 } 8244 future.FutureAPI = &azFuture 8245 future.Result = future.result 8246 return nil 8247} 8248 8249// result is the default implementation for GalleryImageVersionsDeleteFuture.Result. 8250func (future *GalleryImageVersionsDeleteFuture) result(client GalleryImageVersionsClient) (ar autorest.Response, err error) { 8251 var done bool 8252 done, err = future.DoneWithContext(context.Background(), client) 8253 if err != nil { 8254 err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsDeleteFuture", "Result", future.Response(), "Polling failure") 8255 return 8256 } 8257 if !done { 8258 ar.Response = future.Response() 8259 err = azure.NewAsyncOpIncompleteError("compute.GalleryImageVersionsDeleteFuture") 8260 return 8261 } 8262 ar.Response = future.Response() 8263 return 8264} 8265 8266// GalleryImageVersionStorageProfile this is the storage profile of a Gallery Image Version. 8267type GalleryImageVersionStorageProfile struct { 8268 Source *GalleryArtifactVersionSource `json:"source,omitempty"` 8269 OsDiskImage *GalleryOSDiskImage `json:"osDiskImage,omitempty"` 8270 // DataDiskImages - A list of data disk images. 8271 DataDiskImages *[]GalleryDataDiskImage `json:"dataDiskImages,omitempty"` 8272} 8273 8274// GalleryImageVersionsUpdateFuture an abstraction for monitoring and retrieving the results of a 8275// long-running operation. 8276type GalleryImageVersionsUpdateFuture struct { 8277 azure.FutureAPI 8278 // Result returns the result of the asynchronous operation. 8279 // If the operation has not completed it will return an error. 8280 Result func(GalleryImageVersionsClient) (GalleryImageVersion, error) 8281} 8282 8283// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8284func (future *GalleryImageVersionsUpdateFuture) UnmarshalJSON(body []byte) error { 8285 var azFuture azure.Future 8286 if err := json.Unmarshal(body, &azFuture); err != nil { 8287 return err 8288 } 8289 future.FutureAPI = &azFuture 8290 future.Result = future.result 8291 return nil 8292} 8293 8294// result is the default implementation for GalleryImageVersionsUpdateFuture.Result. 8295func (future *GalleryImageVersionsUpdateFuture) result(client GalleryImageVersionsClient) (giv GalleryImageVersion, err error) { 8296 var done bool 8297 done, err = future.DoneWithContext(context.Background(), client) 8298 if err != nil { 8299 err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsUpdateFuture", "Result", future.Response(), "Polling failure") 8300 return 8301 } 8302 if !done { 8303 giv.Response.Response = future.Response() 8304 err = azure.NewAsyncOpIncompleteError("compute.GalleryImageVersionsUpdateFuture") 8305 return 8306 } 8307 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8308 if giv.Response.Response, err = future.GetResult(sender); err == nil && giv.Response.Response.StatusCode != http.StatusNoContent { 8309 giv, err = client.UpdateResponder(giv.Response.Response) 8310 if err != nil { 8311 err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsUpdateFuture", "Result", giv.Response.Response, "Failure responding to request") 8312 } 8313 } 8314 return 8315} 8316 8317// GalleryImageVersionUpdate specifies information about the gallery image version that you want to update. 8318type GalleryImageVersionUpdate struct { 8319 *GalleryImageVersionProperties `json:"properties,omitempty"` 8320 // ID - READ-ONLY; Resource Id 8321 ID *string `json:"id,omitempty"` 8322 // Name - READ-ONLY; Resource name 8323 Name *string `json:"name,omitempty"` 8324 // Type - READ-ONLY; Resource type 8325 Type *string `json:"type,omitempty"` 8326 // Tags - Resource tags 8327 Tags map[string]*string `json:"tags"` 8328} 8329 8330// MarshalJSON is the custom marshaler for GalleryImageVersionUpdate. 8331func (givu GalleryImageVersionUpdate) MarshalJSON() ([]byte, error) { 8332 objectMap := make(map[string]interface{}) 8333 if givu.GalleryImageVersionProperties != nil { 8334 objectMap["properties"] = givu.GalleryImageVersionProperties 8335 } 8336 if givu.Tags != nil { 8337 objectMap["tags"] = givu.Tags 8338 } 8339 return json.Marshal(objectMap) 8340} 8341 8342// UnmarshalJSON is the custom unmarshaler for GalleryImageVersionUpdate struct. 8343func (givu *GalleryImageVersionUpdate) UnmarshalJSON(body []byte) error { 8344 var m map[string]*json.RawMessage 8345 err := json.Unmarshal(body, &m) 8346 if err != nil { 8347 return err 8348 } 8349 for k, v := range m { 8350 switch k { 8351 case "properties": 8352 if v != nil { 8353 var galleryImageVersionProperties GalleryImageVersionProperties 8354 err = json.Unmarshal(*v, &galleryImageVersionProperties) 8355 if err != nil { 8356 return err 8357 } 8358 givu.GalleryImageVersionProperties = &galleryImageVersionProperties 8359 } 8360 case "id": 8361 if v != nil { 8362 var ID string 8363 err = json.Unmarshal(*v, &ID) 8364 if err != nil { 8365 return err 8366 } 8367 givu.ID = &ID 8368 } 8369 case "name": 8370 if v != nil { 8371 var name string 8372 err = json.Unmarshal(*v, &name) 8373 if err != nil { 8374 return err 8375 } 8376 givu.Name = &name 8377 } 8378 case "type": 8379 if v != nil { 8380 var typeVar string 8381 err = json.Unmarshal(*v, &typeVar) 8382 if err != nil { 8383 return err 8384 } 8385 givu.Type = &typeVar 8386 } 8387 case "tags": 8388 if v != nil { 8389 var tags map[string]*string 8390 err = json.Unmarshal(*v, &tags) 8391 if err != nil { 8392 return err 8393 } 8394 givu.Tags = tags 8395 } 8396 } 8397 } 8398 8399 return nil 8400} 8401 8402// GalleryList the List Galleries operation response. 8403type GalleryList struct { 8404 autorest.Response `json:"-"` 8405 // Value - A list of galleries. 8406 Value *[]Gallery `json:"value,omitempty"` 8407 // NextLink - The uri to fetch the next page of galleries. Call ListNext() with this to fetch the next page of galleries. 8408 NextLink *string `json:"nextLink,omitempty"` 8409} 8410 8411// GalleryListIterator provides access to a complete listing of Gallery values. 8412type GalleryListIterator struct { 8413 i int 8414 page GalleryListPage 8415} 8416 8417// NextWithContext advances to the next value. If there was an error making 8418// the request the iterator does not advance and the error is returned. 8419func (iter *GalleryListIterator) NextWithContext(ctx context.Context) (err error) { 8420 if tracing.IsEnabled() { 8421 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryListIterator.NextWithContext") 8422 defer func() { 8423 sc := -1 8424 if iter.Response().Response.Response != nil { 8425 sc = iter.Response().Response.Response.StatusCode 8426 } 8427 tracing.EndSpan(ctx, sc, err) 8428 }() 8429 } 8430 iter.i++ 8431 if iter.i < len(iter.page.Values()) { 8432 return nil 8433 } 8434 err = iter.page.NextWithContext(ctx) 8435 if err != nil { 8436 iter.i-- 8437 return err 8438 } 8439 iter.i = 0 8440 return nil 8441} 8442 8443// Next advances to the next value. If there was an error making 8444// the request the iterator does not advance and the error is returned. 8445// Deprecated: Use NextWithContext() instead. 8446func (iter *GalleryListIterator) Next() error { 8447 return iter.NextWithContext(context.Background()) 8448} 8449 8450// NotDone returns true if the enumeration should be started or is not yet complete. 8451func (iter GalleryListIterator) NotDone() bool { 8452 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8453} 8454 8455// Response returns the raw server response from the last page request. 8456func (iter GalleryListIterator) Response() GalleryList { 8457 return iter.page.Response() 8458} 8459 8460// Value returns the current value or a zero-initialized value if the 8461// iterator has advanced beyond the end of the collection. 8462func (iter GalleryListIterator) Value() Gallery { 8463 if !iter.page.NotDone() { 8464 return Gallery{} 8465 } 8466 return iter.page.Values()[iter.i] 8467} 8468 8469// Creates a new instance of the GalleryListIterator type. 8470func NewGalleryListIterator(page GalleryListPage) GalleryListIterator { 8471 return GalleryListIterator{page: page} 8472} 8473 8474// IsEmpty returns true if the ListResult contains no values. 8475func (gl GalleryList) IsEmpty() bool { 8476 return gl.Value == nil || len(*gl.Value) == 0 8477} 8478 8479// hasNextLink returns true if the NextLink is not empty. 8480func (gl GalleryList) hasNextLink() bool { 8481 return gl.NextLink != nil && len(*gl.NextLink) != 0 8482} 8483 8484// galleryListPreparer prepares a request to retrieve the next set of results. 8485// It returns nil if no more results exist. 8486func (gl GalleryList) galleryListPreparer(ctx context.Context) (*http.Request, error) { 8487 if !gl.hasNextLink() { 8488 return nil, nil 8489 } 8490 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8491 autorest.AsJSON(), 8492 autorest.AsGet(), 8493 autorest.WithBaseURL(to.String(gl.NextLink))) 8494} 8495 8496// GalleryListPage contains a page of Gallery values. 8497type GalleryListPage struct { 8498 fn func(context.Context, GalleryList) (GalleryList, error) 8499 gl GalleryList 8500} 8501 8502// NextWithContext advances to the next page of values. If there was an error making 8503// the request the page does not advance and the error is returned. 8504func (page *GalleryListPage) NextWithContext(ctx context.Context) (err error) { 8505 if tracing.IsEnabled() { 8506 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryListPage.NextWithContext") 8507 defer func() { 8508 sc := -1 8509 if page.Response().Response.Response != nil { 8510 sc = page.Response().Response.Response.StatusCode 8511 } 8512 tracing.EndSpan(ctx, sc, err) 8513 }() 8514 } 8515 for { 8516 next, err := page.fn(ctx, page.gl) 8517 if err != nil { 8518 return err 8519 } 8520 page.gl = next 8521 if !next.hasNextLink() || !next.IsEmpty() { 8522 break 8523 } 8524 } 8525 return nil 8526} 8527 8528// Next advances to the next page of values. If there was an error making 8529// the request the page does not advance and the error is returned. 8530// Deprecated: Use NextWithContext() instead. 8531func (page *GalleryListPage) Next() error { 8532 return page.NextWithContext(context.Background()) 8533} 8534 8535// NotDone returns true if the page enumeration should be started or is not yet complete. 8536func (page GalleryListPage) NotDone() bool { 8537 return !page.gl.IsEmpty() 8538} 8539 8540// Response returns the raw server response from the last page request. 8541func (page GalleryListPage) Response() GalleryList { 8542 return page.gl 8543} 8544 8545// Values returns the slice of values for the current page or nil if there are no values. 8546func (page GalleryListPage) Values() []Gallery { 8547 if page.gl.IsEmpty() { 8548 return nil 8549 } 8550 return *page.gl.Value 8551} 8552 8553// Creates a new instance of the GalleryListPage type. 8554func NewGalleryListPage(cur GalleryList, getNextPage func(context.Context, GalleryList) (GalleryList, error)) GalleryListPage { 8555 return GalleryListPage{ 8556 fn: getNextPage, 8557 gl: cur, 8558 } 8559} 8560 8561// GalleryOSDiskImage this is the OS disk image. 8562type GalleryOSDiskImage struct { 8563 // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. 8564 SizeInGB *int32 `json:"sizeInGB,omitempty"` 8565 // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' 8566 HostCaching HostCaching `json:"hostCaching,omitempty"` 8567 Source *GalleryArtifactVersionSource `json:"source,omitempty"` 8568} 8569 8570// MarshalJSON is the custom marshaler for GalleryOSDiskImage. 8571func (godi GalleryOSDiskImage) MarshalJSON() ([]byte, error) { 8572 objectMap := make(map[string]interface{}) 8573 if godi.HostCaching != "" { 8574 objectMap["hostCaching"] = godi.HostCaching 8575 } 8576 if godi.Source != nil { 8577 objectMap["source"] = godi.Source 8578 } 8579 return json.Marshal(objectMap) 8580} 8581 8582// GalleryProperties describes the properties of a Shared Image Gallery. 8583type GalleryProperties struct { 8584 // Description - The description of this Shared Image Gallery resource. This property is updatable. 8585 Description *string `json:"description,omitempty"` 8586 Identifier *GalleryIdentifier `json:"identifier,omitempty"` 8587 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningStateCreating', 'ProvisioningStateUpdating', 'ProvisioningStateFailed', 'ProvisioningStateSucceeded', 'ProvisioningStateDeleting', 'ProvisioningStateMigrating' 8588 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 8589 SharingProfile *SharingProfile `json:"sharingProfile,omitempty"` 8590} 8591 8592// MarshalJSON is the custom marshaler for GalleryProperties. 8593func (gp GalleryProperties) MarshalJSON() ([]byte, error) { 8594 objectMap := make(map[string]interface{}) 8595 if gp.Description != nil { 8596 objectMap["description"] = gp.Description 8597 } 8598 if gp.Identifier != nil { 8599 objectMap["identifier"] = gp.Identifier 8600 } 8601 if gp.SharingProfile != nil { 8602 objectMap["sharingProfile"] = gp.SharingProfile 8603 } 8604 return json.Marshal(objectMap) 8605} 8606 8607// GallerySharingProfileUpdateFuture an abstraction for monitoring and retrieving the results of a 8608// long-running operation. 8609type GallerySharingProfileUpdateFuture struct { 8610 azure.FutureAPI 8611 // Result returns the result of the asynchronous operation. 8612 // If the operation has not completed it will return an error. 8613 Result func(GallerySharingProfileClient) (SharingUpdate, error) 8614} 8615 8616// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8617func (future *GallerySharingProfileUpdateFuture) UnmarshalJSON(body []byte) error { 8618 var azFuture azure.Future 8619 if err := json.Unmarshal(body, &azFuture); err != nil { 8620 return err 8621 } 8622 future.FutureAPI = &azFuture 8623 future.Result = future.result 8624 return nil 8625} 8626 8627// result is the default implementation for GallerySharingProfileUpdateFuture.Result. 8628func (future *GallerySharingProfileUpdateFuture) result(client GallerySharingProfileClient) (su SharingUpdate, err error) { 8629 var done bool 8630 done, err = future.DoneWithContext(context.Background(), client) 8631 if err != nil { 8632 err = autorest.NewErrorWithError(err, "compute.GallerySharingProfileUpdateFuture", "Result", future.Response(), "Polling failure") 8633 return 8634 } 8635 if !done { 8636 su.Response.Response = future.Response() 8637 err = azure.NewAsyncOpIncompleteError("compute.GallerySharingProfileUpdateFuture") 8638 return 8639 } 8640 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8641 if su.Response.Response, err = future.GetResult(sender); err == nil && su.Response.Response.StatusCode != http.StatusNoContent { 8642 su, err = client.UpdateResponder(su.Response.Response) 8643 if err != nil { 8644 err = autorest.NewErrorWithError(err, "compute.GallerySharingProfileUpdateFuture", "Result", su.Response.Response, "Failure responding to request") 8645 } 8646 } 8647 return 8648} 8649 8650// GalleryUpdate specifies information about the Shared Image Gallery that you want to update. 8651type GalleryUpdate struct { 8652 *GalleryProperties `json:"properties,omitempty"` 8653 // ID - READ-ONLY; Resource Id 8654 ID *string `json:"id,omitempty"` 8655 // Name - READ-ONLY; Resource name 8656 Name *string `json:"name,omitempty"` 8657 // Type - READ-ONLY; Resource type 8658 Type *string `json:"type,omitempty"` 8659 // Tags - Resource tags 8660 Tags map[string]*string `json:"tags"` 8661} 8662 8663// MarshalJSON is the custom marshaler for GalleryUpdate. 8664func (gu GalleryUpdate) MarshalJSON() ([]byte, error) { 8665 objectMap := make(map[string]interface{}) 8666 if gu.GalleryProperties != nil { 8667 objectMap["properties"] = gu.GalleryProperties 8668 } 8669 if gu.Tags != nil { 8670 objectMap["tags"] = gu.Tags 8671 } 8672 return json.Marshal(objectMap) 8673} 8674 8675// UnmarshalJSON is the custom unmarshaler for GalleryUpdate struct. 8676func (gu *GalleryUpdate) UnmarshalJSON(body []byte) error { 8677 var m map[string]*json.RawMessage 8678 err := json.Unmarshal(body, &m) 8679 if err != nil { 8680 return err 8681 } 8682 for k, v := range m { 8683 switch k { 8684 case "properties": 8685 if v != nil { 8686 var galleryProperties GalleryProperties 8687 err = json.Unmarshal(*v, &galleryProperties) 8688 if err != nil { 8689 return err 8690 } 8691 gu.GalleryProperties = &galleryProperties 8692 } 8693 case "id": 8694 if v != nil { 8695 var ID string 8696 err = json.Unmarshal(*v, &ID) 8697 if err != nil { 8698 return err 8699 } 8700 gu.ID = &ID 8701 } 8702 case "name": 8703 if v != nil { 8704 var name string 8705 err = json.Unmarshal(*v, &name) 8706 if err != nil { 8707 return err 8708 } 8709 gu.Name = &name 8710 } 8711 case "type": 8712 if v != nil { 8713 var typeVar string 8714 err = json.Unmarshal(*v, &typeVar) 8715 if err != nil { 8716 return err 8717 } 8718 gu.Type = &typeVar 8719 } 8720 case "tags": 8721 if v != nil { 8722 var tags map[string]*string 8723 err = json.Unmarshal(*v, &tags) 8724 if err != nil { 8725 return err 8726 } 8727 gu.Tags = tags 8728 } 8729 } 8730 } 8731 8732 return nil 8733} 8734 8735// GrantAccessData data used for requesting a SAS. 8736type GrantAccessData struct { 8737 // Access - Possible values include: 'AccessLevelNone', 'AccessLevelRead', 'AccessLevelWrite' 8738 Access AccessLevel `json:"access,omitempty"` 8739 // DurationInSeconds - Time duration in seconds until the SAS access expires. 8740 DurationInSeconds *int32 `json:"durationInSeconds,omitempty"` 8741} 8742 8743// HardwareProfile specifies the hardware settings for the virtual machine. 8744type HardwareProfile struct { 8745 // 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' 8746 VMSize VirtualMachineSizeTypes `json:"vmSize,omitempty"` 8747} 8748 8749// Image the source user image virtual hard disk. The virtual hard disk will be copied before being 8750// attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not 8751// exist. 8752type Image struct { 8753 autorest.Response `json:"-"` 8754 *ImageProperties `json:"properties,omitempty"` 8755 // ExtendedLocation - The extended location of the Image. 8756 ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` 8757 // ID - READ-ONLY; Resource Id 8758 ID *string `json:"id,omitempty"` 8759 // Name - READ-ONLY; Resource name 8760 Name *string `json:"name,omitempty"` 8761 // Type - READ-ONLY; Resource type 8762 Type *string `json:"type,omitempty"` 8763 // Location - Resource location 8764 Location *string `json:"location,omitempty"` 8765 // Tags - Resource tags 8766 Tags map[string]*string `json:"tags"` 8767} 8768 8769// MarshalJSON is the custom marshaler for Image. 8770func (i Image) MarshalJSON() ([]byte, error) { 8771 objectMap := make(map[string]interface{}) 8772 if i.ImageProperties != nil { 8773 objectMap["properties"] = i.ImageProperties 8774 } 8775 if i.ExtendedLocation != nil { 8776 objectMap["extendedLocation"] = i.ExtendedLocation 8777 } 8778 if i.Location != nil { 8779 objectMap["location"] = i.Location 8780 } 8781 if i.Tags != nil { 8782 objectMap["tags"] = i.Tags 8783 } 8784 return json.Marshal(objectMap) 8785} 8786 8787// UnmarshalJSON is the custom unmarshaler for Image struct. 8788func (i *Image) UnmarshalJSON(body []byte) error { 8789 var m map[string]*json.RawMessage 8790 err := json.Unmarshal(body, &m) 8791 if err != nil { 8792 return err 8793 } 8794 for k, v := range m { 8795 switch k { 8796 case "properties": 8797 if v != nil { 8798 var imageProperties ImageProperties 8799 err = json.Unmarshal(*v, &imageProperties) 8800 if err != nil { 8801 return err 8802 } 8803 i.ImageProperties = &imageProperties 8804 } 8805 case "extendedLocation": 8806 if v != nil { 8807 var extendedLocation ExtendedLocation 8808 err = json.Unmarshal(*v, &extendedLocation) 8809 if err != nil { 8810 return err 8811 } 8812 i.ExtendedLocation = &extendedLocation 8813 } 8814 case "id": 8815 if v != nil { 8816 var ID string 8817 err = json.Unmarshal(*v, &ID) 8818 if err != nil { 8819 return err 8820 } 8821 i.ID = &ID 8822 } 8823 case "name": 8824 if v != nil { 8825 var name string 8826 err = json.Unmarshal(*v, &name) 8827 if err != nil { 8828 return err 8829 } 8830 i.Name = &name 8831 } 8832 case "type": 8833 if v != nil { 8834 var typeVar string 8835 err = json.Unmarshal(*v, &typeVar) 8836 if err != nil { 8837 return err 8838 } 8839 i.Type = &typeVar 8840 } 8841 case "location": 8842 if v != nil { 8843 var location string 8844 err = json.Unmarshal(*v, &location) 8845 if err != nil { 8846 return err 8847 } 8848 i.Location = &location 8849 } 8850 case "tags": 8851 if v != nil { 8852 var tags map[string]*string 8853 err = json.Unmarshal(*v, &tags) 8854 if err != nil { 8855 return err 8856 } 8857 i.Tags = tags 8858 } 8859 } 8860 } 8861 8862 return nil 8863} 8864 8865// ImageDataDisk describes a data disk. 8866type ImageDataDisk struct { 8867 // 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. 8868 Lun *int32 `json:"lun,omitempty"` 8869 // Snapshot - The snapshot. 8870 Snapshot *SubResource `json:"snapshot,omitempty"` 8871 // ManagedDisk - The managedDisk. 8872 ManagedDisk *SubResource `json:"managedDisk,omitempty"` 8873 // BlobURI - The Virtual Hard Disk. 8874 BlobURI *string `json:"blobUri,omitempty"` 8875 // 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' 8876 Caching CachingTypes `json:"caching,omitempty"` 8877 // 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 8878 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 8879 // 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' 8880 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 8881 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. 8882 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 8883} 8884 8885// ImageDisk describes a image disk. 8886type ImageDisk struct { 8887 // Snapshot - The snapshot. 8888 Snapshot *SubResource `json:"snapshot,omitempty"` 8889 // ManagedDisk - The managedDisk. 8890 ManagedDisk *SubResource `json:"managedDisk,omitempty"` 8891 // BlobURI - The Virtual Hard Disk. 8892 BlobURI *string `json:"blobUri,omitempty"` 8893 // 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' 8894 Caching CachingTypes `json:"caching,omitempty"` 8895 // 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 8896 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 8897 // 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' 8898 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 8899 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. 8900 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 8901} 8902 8903// ImageDiskReference the source image used for creating the disk. 8904type ImageDiskReference struct { 8905 // ID - A relative uri containing either a Platform Image Repository or user image reference. 8906 ID *string `json:"id,omitempty"` 8907 // 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. 8908 Lun *int32 `json:"lun,omitempty"` 8909} 8910 8911// ImageListResult the List Image operation response. 8912type ImageListResult struct { 8913 autorest.Response `json:"-"` 8914 // Value - The list of Images. 8915 Value *[]Image `json:"value,omitempty"` 8916 // NextLink - The uri to fetch the next page of Images. Call ListNext() with this to fetch the next page of Images. 8917 NextLink *string `json:"nextLink,omitempty"` 8918} 8919 8920// ImageListResultIterator provides access to a complete listing of Image values. 8921type ImageListResultIterator struct { 8922 i int 8923 page ImageListResultPage 8924} 8925 8926// NextWithContext advances to the next value. If there was an error making 8927// the request the iterator does not advance and the error is returned. 8928func (iter *ImageListResultIterator) NextWithContext(ctx context.Context) (err error) { 8929 if tracing.IsEnabled() { 8930 ctx = tracing.StartSpan(ctx, fqdn+"/ImageListResultIterator.NextWithContext") 8931 defer func() { 8932 sc := -1 8933 if iter.Response().Response.Response != nil { 8934 sc = iter.Response().Response.Response.StatusCode 8935 } 8936 tracing.EndSpan(ctx, sc, err) 8937 }() 8938 } 8939 iter.i++ 8940 if iter.i < len(iter.page.Values()) { 8941 return nil 8942 } 8943 err = iter.page.NextWithContext(ctx) 8944 if err != nil { 8945 iter.i-- 8946 return err 8947 } 8948 iter.i = 0 8949 return nil 8950} 8951 8952// Next advances to the next value. If there was an error making 8953// the request the iterator does not advance and the error is returned. 8954// Deprecated: Use NextWithContext() instead. 8955func (iter *ImageListResultIterator) Next() error { 8956 return iter.NextWithContext(context.Background()) 8957} 8958 8959// NotDone returns true if the enumeration should be started or is not yet complete. 8960func (iter ImageListResultIterator) NotDone() bool { 8961 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8962} 8963 8964// Response returns the raw server response from the last page request. 8965func (iter ImageListResultIterator) Response() ImageListResult { 8966 return iter.page.Response() 8967} 8968 8969// Value returns the current value or a zero-initialized value if the 8970// iterator has advanced beyond the end of the collection. 8971func (iter ImageListResultIterator) Value() Image { 8972 if !iter.page.NotDone() { 8973 return Image{} 8974 } 8975 return iter.page.Values()[iter.i] 8976} 8977 8978// Creates a new instance of the ImageListResultIterator type. 8979func NewImageListResultIterator(page ImageListResultPage) ImageListResultIterator { 8980 return ImageListResultIterator{page: page} 8981} 8982 8983// IsEmpty returns true if the ListResult contains no values. 8984func (ilr ImageListResult) IsEmpty() bool { 8985 return ilr.Value == nil || len(*ilr.Value) == 0 8986} 8987 8988// hasNextLink returns true if the NextLink is not empty. 8989func (ilr ImageListResult) hasNextLink() bool { 8990 return ilr.NextLink != nil && len(*ilr.NextLink) != 0 8991} 8992 8993// imageListResultPreparer prepares a request to retrieve the next set of results. 8994// It returns nil if no more results exist. 8995func (ilr ImageListResult) imageListResultPreparer(ctx context.Context) (*http.Request, error) { 8996 if !ilr.hasNextLink() { 8997 return nil, nil 8998 } 8999 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9000 autorest.AsJSON(), 9001 autorest.AsGet(), 9002 autorest.WithBaseURL(to.String(ilr.NextLink))) 9003} 9004 9005// ImageListResultPage contains a page of Image values. 9006type ImageListResultPage struct { 9007 fn func(context.Context, ImageListResult) (ImageListResult, error) 9008 ilr ImageListResult 9009} 9010 9011// NextWithContext advances to the next page of values. If there was an error making 9012// the request the page does not advance and the error is returned. 9013func (page *ImageListResultPage) NextWithContext(ctx context.Context) (err error) { 9014 if tracing.IsEnabled() { 9015 ctx = tracing.StartSpan(ctx, fqdn+"/ImageListResultPage.NextWithContext") 9016 defer func() { 9017 sc := -1 9018 if page.Response().Response.Response != nil { 9019 sc = page.Response().Response.Response.StatusCode 9020 } 9021 tracing.EndSpan(ctx, sc, err) 9022 }() 9023 } 9024 for { 9025 next, err := page.fn(ctx, page.ilr) 9026 if err != nil { 9027 return err 9028 } 9029 page.ilr = next 9030 if !next.hasNextLink() || !next.IsEmpty() { 9031 break 9032 } 9033 } 9034 return nil 9035} 9036 9037// Next advances to the next page of values. If there was an error making 9038// the request the page does not advance and the error is returned. 9039// Deprecated: Use NextWithContext() instead. 9040func (page *ImageListResultPage) Next() error { 9041 return page.NextWithContext(context.Background()) 9042} 9043 9044// NotDone returns true if the page enumeration should be started or is not yet complete. 9045func (page ImageListResultPage) NotDone() bool { 9046 return !page.ilr.IsEmpty() 9047} 9048 9049// Response returns the raw server response from the last page request. 9050func (page ImageListResultPage) Response() ImageListResult { 9051 return page.ilr 9052} 9053 9054// Values returns the slice of values for the current page or nil if there are no values. 9055func (page ImageListResultPage) Values() []Image { 9056 if page.ilr.IsEmpty() { 9057 return nil 9058 } 9059 return *page.ilr.Value 9060} 9061 9062// Creates a new instance of the ImageListResultPage type. 9063func NewImageListResultPage(cur ImageListResult, getNextPage func(context.Context, ImageListResult) (ImageListResult, error)) ImageListResultPage { 9064 return ImageListResultPage{ 9065 fn: getNextPage, 9066 ilr: cur, 9067 } 9068} 9069 9070// ImageOSDisk describes an Operating System disk. 9071type ImageOSDisk struct { 9072 // 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' 9073 OsType OperatingSystemTypes `json:"osType,omitempty"` 9074 // OsState - The OS State. Possible values include: 'OperatingSystemStateTypesGeneralized', 'OperatingSystemStateTypesSpecialized' 9075 OsState OperatingSystemStateTypes `json:"osState,omitempty"` 9076 // Snapshot - The snapshot. 9077 Snapshot *SubResource `json:"snapshot,omitempty"` 9078 // ManagedDisk - The managedDisk. 9079 ManagedDisk *SubResource `json:"managedDisk,omitempty"` 9080 // BlobURI - The Virtual Hard Disk. 9081 BlobURI *string `json:"blobUri,omitempty"` 9082 // 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' 9083 Caching CachingTypes `json:"caching,omitempty"` 9084 // 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 9085 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 9086 // 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' 9087 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 9088 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. 9089 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 9090} 9091 9092// ImageProperties describes the properties of an Image. 9093type ImageProperties struct { 9094 // SourceVirtualMachine - The source virtual machine from which Image is created. 9095 SourceVirtualMachine *SubResource `json:"sourceVirtualMachine,omitempty"` 9096 // StorageProfile - Specifies the storage settings for the virtual machine disks. 9097 StorageProfile *ImageStorageProfile `json:"storageProfile,omitempty"` 9098 // ProvisioningState - READ-ONLY; The provisioning state. 9099 ProvisioningState *string `json:"provisioningState,omitempty"` 9100 // 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' 9101 HyperVGeneration HyperVGenerationTypes `json:"hyperVGeneration,omitempty"` 9102} 9103 9104// MarshalJSON is the custom marshaler for ImageProperties. 9105func (IP ImageProperties) MarshalJSON() ([]byte, error) { 9106 objectMap := make(map[string]interface{}) 9107 if IP.SourceVirtualMachine != nil { 9108 objectMap["sourceVirtualMachine"] = IP.SourceVirtualMachine 9109 } 9110 if IP.StorageProfile != nil { 9111 objectMap["storageProfile"] = IP.StorageProfile 9112 } 9113 if IP.HyperVGeneration != "" { 9114 objectMap["hyperVGeneration"] = IP.HyperVGeneration 9115 } 9116 return json.Marshal(objectMap) 9117} 9118 9119// ImagePurchasePlan describes the gallery image definition purchase plan. This is used by marketplace 9120// images. 9121type ImagePurchasePlan struct { 9122 // Name - The plan ID. 9123 Name *string `json:"name,omitempty"` 9124 // Publisher - The publisher ID. 9125 Publisher *string `json:"publisher,omitempty"` 9126 // Product - The product ID. 9127 Product *string `json:"product,omitempty"` 9128} 9129 9130// ImageReference specifies information about the image to use. You can specify information about platform 9131// images, marketplace images, or virtual machine images. This element is required when you want to use a 9132// platform image, marketplace image, or virtual machine image, but is not used in other creation 9133// operations. NOTE: Image reference publisher and offer can only be set when you create the scale set. 9134type ImageReference struct { 9135 // Publisher - The image publisher. 9136 Publisher *string `json:"publisher,omitempty"` 9137 // Offer - Specifies the offer of the platform image or marketplace image used to create the virtual machine. 9138 Offer *string `json:"offer,omitempty"` 9139 // Sku - The image SKU. 9140 Sku *string `json:"sku,omitempty"` 9141 // 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. 9142 Version *string `json:"version,omitempty"` 9143 // 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'. 9144 ExactVersion *string `json:"exactVersion,omitempty"` 9145 // ID - Resource Id 9146 ID *string `json:"id,omitempty"` 9147} 9148 9149// MarshalJSON is the custom marshaler for ImageReference. 9150func (ir ImageReference) MarshalJSON() ([]byte, error) { 9151 objectMap := make(map[string]interface{}) 9152 if ir.Publisher != nil { 9153 objectMap["publisher"] = ir.Publisher 9154 } 9155 if ir.Offer != nil { 9156 objectMap["offer"] = ir.Offer 9157 } 9158 if ir.Sku != nil { 9159 objectMap["sku"] = ir.Sku 9160 } 9161 if ir.Version != nil { 9162 objectMap["version"] = ir.Version 9163 } 9164 if ir.ID != nil { 9165 objectMap["id"] = ir.ID 9166 } 9167 return json.Marshal(objectMap) 9168} 9169 9170// ImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 9171// operation. 9172type ImagesCreateOrUpdateFuture struct { 9173 azure.FutureAPI 9174 // Result returns the result of the asynchronous operation. 9175 // If the operation has not completed it will return an error. 9176 Result func(ImagesClient) (Image, error) 9177} 9178 9179// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9180func (future *ImagesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 9181 var azFuture azure.Future 9182 if err := json.Unmarshal(body, &azFuture); err != nil { 9183 return err 9184 } 9185 future.FutureAPI = &azFuture 9186 future.Result = future.result 9187 return nil 9188} 9189 9190// result is the default implementation for ImagesCreateOrUpdateFuture.Result. 9191func (future *ImagesCreateOrUpdateFuture) result(client ImagesClient) (i Image, err error) { 9192 var done bool 9193 done, err = future.DoneWithContext(context.Background(), client) 9194 if err != nil { 9195 err = autorest.NewErrorWithError(err, "compute.ImagesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 9196 return 9197 } 9198 if !done { 9199 i.Response.Response = future.Response() 9200 err = azure.NewAsyncOpIncompleteError("compute.ImagesCreateOrUpdateFuture") 9201 return 9202 } 9203 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9204 if i.Response.Response, err = future.GetResult(sender); err == nil && i.Response.Response.StatusCode != http.StatusNoContent { 9205 i, err = client.CreateOrUpdateResponder(i.Response.Response) 9206 if err != nil { 9207 err = autorest.NewErrorWithError(err, "compute.ImagesCreateOrUpdateFuture", "Result", i.Response.Response, "Failure responding to request") 9208 } 9209 } 9210 return 9211} 9212 9213// ImagesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 9214type ImagesDeleteFuture struct { 9215 azure.FutureAPI 9216 // Result returns the result of the asynchronous operation. 9217 // If the operation has not completed it will return an error. 9218 Result func(ImagesClient) (autorest.Response, error) 9219} 9220 9221// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9222func (future *ImagesDeleteFuture) UnmarshalJSON(body []byte) error { 9223 var azFuture azure.Future 9224 if err := json.Unmarshal(body, &azFuture); err != nil { 9225 return err 9226 } 9227 future.FutureAPI = &azFuture 9228 future.Result = future.result 9229 return nil 9230} 9231 9232// result is the default implementation for ImagesDeleteFuture.Result. 9233func (future *ImagesDeleteFuture) result(client ImagesClient) (ar autorest.Response, err error) { 9234 var done bool 9235 done, err = future.DoneWithContext(context.Background(), client) 9236 if err != nil { 9237 err = autorest.NewErrorWithError(err, "compute.ImagesDeleteFuture", "Result", future.Response(), "Polling failure") 9238 return 9239 } 9240 if !done { 9241 ar.Response = future.Response() 9242 err = azure.NewAsyncOpIncompleteError("compute.ImagesDeleteFuture") 9243 return 9244 } 9245 ar.Response = future.Response() 9246 return 9247} 9248 9249// ImageStorageProfile describes a storage profile. 9250type ImageStorageProfile struct { 9251 // 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). 9252 OsDisk *ImageOSDisk `json:"osDisk,omitempty"` 9253 // 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). 9254 DataDisks *[]ImageDataDisk `json:"dataDisks,omitempty"` 9255 // 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). 9256 ZoneResilient *bool `json:"zoneResilient,omitempty"` 9257} 9258 9259// ImagesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. 9260type ImagesUpdateFuture struct { 9261 azure.FutureAPI 9262 // Result returns the result of the asynchronous operation. 9263 // If the operation has not completed it will return an error. 9264 Result func(ImagesClient) (Image, error) 9265} 9266 9267// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9268func (future *ImagesUpdateFuture) UnmarshalJSON(body []byte) error { 9269 var azFuture azure.Future 9270 if err := json.Unmarshal(body, &azFuture); err != nil { 9271 return err 9272 } 9273 future.FutureAPI = &azFuture 9274 future.Result = future.result 9275 return nil 9276} 9277 9278// result is the default implementation for ImagesUpdateFuture.Result. 9279func (future *ImagesUpdateFuture) result(client ImagesClient) (i Image, err error) { 9280 var done bool 9281 done, err = future.DoneWithContext(context.Background(), client) 9282 if err != nil { 9283 err = autorest.NewErrorWithError(err, "compute.ImagesUpdateFuture", "Result", future.Response(), "Polling failure") 9284 return 9285 } 9286 if !done { 9287 i.Response.Response = future.Response() 9288 err = azure.NewAsyncOpIncompleteError("compute.ImagesUpdateFuture") 9289 return 9290 } 9291 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9292 if i.Response.Response, err = future.GetResult(sender); err == nil && i.Response.Response.StatusCode != http.StatusNoContent { 9293 i, err = client.UpdateResponder(i.Response.Response) 9294 if err != nil { 9295 err = autorest.NewErrorWithError(err, "compute.ImagesUpdateFuture", "Result", i.Response.Response, "Failure responding to request") 9296 } 9297 } 9298 return 9299} 9300 9301// ImageUpdate the source user image virtual hard disk. Only tags may be updated. 9302type ImageUpdate struct { 9303 *ImageProperties `json:"properties,omitempty"` 9304 // Tags - Resource tags 9305 Tags map[string]*string `json:"tags"` 9306} 9307 9308// MarshalJSON is the custom marshaler for ImageUpdate. 9309func (iu ImageUpdate) MarshalJSON() ([]byte, error) { 9310 objectMap := make(map[string]interface{}) 9311 if iu.ImageProperties != nil { 9312 objectMap["properties"] = iu.ImageProperties 9313 } 9314 if iu.Tags != nil { 9315 objectMap["tags"] = iu.Tags 9316 } 9317 return json.Marshal(objectMap) 9318} 9319 9320// UnmarshalJSON is the custom unmarshaler for ImageUpdate struct. 9321func (iu *ImageUpdate) UnmarshalJSON(body []byte) error { 9322 var m map[string]*json.RawMessage 9323 err := json.Unmarshal(body, &m) 9324 if err != nil { 9325 return err 9326 } 9327 for k, v := range m { 9328 switch k { 9329 case "properties": 9330 if v != nil { 9331 var imageProperties ImageProperties 9332 err = json.Unmarshal(*v, &imageProperties) 9333 if err != nil { 9334 return err 9335 } 9336 iu.ImageProperties = &imageProperties 9337 } 9338 case "tags": 9339 if v != nil { 9340 var tags map[string]*string 9341 err = json.Unmarshal(*v, &tags) 9342 if err != nil { 9343 return err 9344 } 9345 iu.Tags = tags 9346 } 9347 } 9348 } 9349 9350 return nil 9351} 9352 9353// InnerError inner error details. 9354type InnerError struct { 9355 // Exceptiontype - The exception type. 9356 Exceptiontype *string `json:"exceptiontype,omitempty"` 9357 // Errordetail - The internal error message or exception dump. 9358 Errordetail *string `json:"errordetail,omitempty"` 9359} 9360 9361// InstanceSku ... 9362type InstanceSku struct { 9363 // Name - READ-ONLY; The sku name. 9364 Name *string `json:"name,omitempty"` 9365 // Tier - READ-ONLY; The tier of the cloud service role instance. 9366 Tier *string `json:"tier,omitempty"` 9367} 9368 9369// MarshalJSON is the custom marshaler for InstanceSku. 9370func (is InstanceSku) MarshalJSON() ([]byte, error) { 9371 objectMap := make(map[string]interface{}) 9372 return json.Marshal(objectMap) 9373} 9374 9375// InstanceViewStatus instance view status. 9376type InstanceViewStatus struct { 9377 // Code - The status code. 9378 Code *string `json:"code,omitempty"` 9379 // Level - The level code. Possible values include: 'StatusLevelTypesInfo', 'StatusLevelTypesWarning', 'StatusLevelTypesError' 9380 Level StatusLevelTypes `json:"level,omitempty"` 9381 // DisplayStatus - The short localizable label for the status. 9382 DisplayStatus *string `json:"displayStatus,omitempty"` 9383 // Message - The detailed status message, including for alerts and error messages. 9384 Message *string `json:"message,omitempty"` 9385 // Time - The time of the status. 9386 Time *date.Time `json:"time,omitempty"` 9387} 9388 9389// InstanceViewStatusesSummary instance view statuses. 9390type InstanceViewStatusesSummary struct { 9391 // StatusesSummary - READ-ONLY 9392 StatusesSummary *[]StatusCodeCount `json:"statusesSummary,omitempty"` 9393} 9394 9395// MarshalJSON is the custom marshaler for InstanceViewStatusesSummary. 9396func (ivss InstanceViewStatusesSummary) MarshalJSON() ([]byte, error) { 9397 objectMap := make(map[string]interface{}) 9398 return json.Marshal(objectMap) 9399} 9400 9401// KeyForDiskEncryptionSet key Vault Key Url to be used for server side encryption of Managed Disks and 9402// Snapshots 9403type KeyForDiskEncryptionSet struct { 9404 // 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. 9405 SourceVault *SourceVault `json:"sourceVault,omitempty"` 9406 // KeyURL - Fully versioned Key Url pointing to a key in KeyVault. Version segment of the Url is required regardless of rotationToLatestKeyVersionEnabled value. 9407 KeyURL *string `json:"keyUrl,omitempty"` 9408} 9409 9410// KeyVaultAndKeyReference key Vault Key Url and vault id of KeK, KeK is optional and when provided is used 9411// to unwrap the encryptionKey 9412type KeyVaultAndKeyReference struct { 9413 // SourceVault - Resource id of the KeyVault containing the key or secret 9414 SourceVault *SourceVault `json:"sourceVault,omitempty"` 9415 // KeyURL - Url pointing to a key or secret in KeyVault 9416 KeyURL *string `json:"keyUrl,omitempty"` 9417} 9418 9419// KeyVaultAndSecretReference key Vault Secret Url and vault id of the encryption key 9420type KeyVaultAndSecretReference struct { 9421 // SourceVault - Resource id of the KeyVault containing the key or secret 9422 SourceVault *SourceVault `json:"sourceVault,omitempty"` 9423 // SecretURL - Url pointing to a key or secret in KeyVault 9424 SecretURL *string `json:"secretUrl,omitempty"` 9425} 9426 9427// KeyVaultKeyReference describes a reference to Key Vault Key 9428type KeyVaultKeyReference struct { 9429 // KeyURL - The URL referencing a key encryption key in Key Vault. 9430 KeyURL *string `json:"keyUrl,omitempty"` 9431 // SourceVault - The relative URL of the Key Vault containing the key. 9432 SourceVault *SubResource `json:"sourceVault,omitempty"` 9433} 9434 9435// KeyVaultSecretReference describes a reference to Key Vault Secret 9436type KeyVaultSecretReference struct { 9437 // SecretURL - The URL referencing a secret in a Key Vault. 9438 SecretURL *string `json:"secretUrl,omitempty"` 9439 // SourceVault - The relative URL of the Key Vault containing the secret. 9440 SourceVault *SubResource `json:"sourceVault,omitempty"` 9441} 9442 9443// LastPatchInstallationSummary describes the properties of the last installed patch summary. 9444type LastPatchInstallationSummary struct { 9445 // 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' 9446 Status PatchOperationStatus `json:"status,omitempty"` 9447 // InstallationActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. 9448 InstallationActivityID *string `json:"installationActivityId,omitempty"` 9449 // MaintenanceWindowExceeded - READ-ONLY; Describes whether the operation ran out of time before it completed all its intended actions 9450 MaintenanceWindowExceeded *bool `json:"maintenanceWindowExceeded,omitempty"` 9451 // 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. 9452 NotSelectedPatchCount *int32 `json:"notSelectedPatchCount,omitempty"` 9453 // ExcludedPatchCount - READ-ONLY; The number of all available patches but excluded explicitly by a customer-specified exclusion list match. 9454 ExcludedPatchCount *int32 `json:"excludedPatchCount,omitempty"` 9455 // PendingPatchCount - READ-ONLY; The number of all available patches expected to be installed over the course of the patch installation operation. 9456 PendingPatchCount *int32 `json:"pendingPatchCount,omitempty"` 9457 // InstalledPatchCount - READ-ONLY; The count of patches that successfully installed. 9458 InstalledPatchCount *int32 `json:"installedPatchCount,omitempty"` 9459 // FailedPatchCount - READ-ONLY; The count of patches that failed installation. 9460 FailedPatchCount *int32 `json:"failedPatchCount,omitempty"` 9461 // StartTime - READ-ONLY; The UTC timestamp when the operation began. 9462 StartTime *date.Time `json:"startTime,omitempty"` 9463 // LastModifiedTime - READ-ONLY; The UTC timestamp when the operation began. 9464 LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` 9465 // Error - READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. 9466 Error *APIError `json:"error,omitempty"` 9467} 9468 9469// MarshalJSON is the custom marshaler for LastPatchInstallationSummary. 9470func (lpis LastPatchInstallationSummary) MarshalJSON() ([]byte, error) { 9471 objectMap := make(map[string]interface{}) 9472 return json.Marshal(objectMap) 9473} 9474 9475// LinuxConfiguration specifies the Linux operating system settings on the virtual machine. <br><br>For a 9476// list of supported Linux distributions, see [Linux on Azure-Endorsed 9477// Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). 9478type LinuxConfiguration struct { 9479 // DisablePasswordAuthentication - Specifies whether password authentication should be disabled. 9480 DisablePasswordAuthentication *bool `json:"disablePasswordAuthentication,omitempty"` 9481 // SSH - Specifies the ssh key configuration for a Linux OS. 9482 SSH *SSHConfiguration `json:"ssh,omitempty"` 9483 // 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. 9484 ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` 9485 // PatchSettings - [Preview Feature] Specifies settings related to VM Guest Patching on Linux. 9486 PatchSettings *LinuxPatchSettings `json:"patchSettings,omitempty"` 9487} 9488 9489// LinuxParameters input for InstallPatches on a Linux VM, as directly received by the API 9490type LinuxParameters struct { 9491 // ClassificationsToInclude - The update classifications to select when installing patches for Linux. 9492 ClassificationsToInclude *[]VMGuestPatchClassificationLinux `json:"classificationsToInclude,omitempty"` 9493 // PackageNameMasksToInclude - packages to include in the patch operation. Format: packageName_packageVersion 9494 PackageNameMasksToInclude *[]string `json:"packageNameMasksToInclude,omitempty"` 9495 // PackageNameMasksToExclude - packages to exclude in the patch operation. Format: packageName_packageVersion 9496 PackageNameMasksToExclude *[]string `json:"packageNameMasksToExclude,omitempty"` 9497 // MaintenanceRunID - This is used as a maintenance run identifier for Auto VM Guest Patching in Linux. 9498 MaintenanceRunID *string `json:"maintenanceRunId,omitempty"` 9499} 9500 9501// LinuxPatchSettings specifies settings related to VM Guest Patching on Linux. 9502type LinuxPatchSettings struct { 9503 // 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' 9504 PatchMode LinuxVMGuestPatchMode `json:"patchMode,omitempty"` 9505 // 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' 9506 AssessmentMode LinuxPatchAssessmentMode `json:"assessmentMode,omitempty"` 9507} 9508 9509// ListUsagesResult the List Usages operation response. 9510type ListUsagesResult struct { 9511 autorest.Response `json:"-"` 9512 // Value - The list of compute resource usages. 9513 Value *[]Usage `json:"value,omitempty"` 9514 // 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. 9515 NextLink *string `json:"nextLink,omitempty"` 9516} 9517 9518// ListUsagesResultIterator provides access to a complete listing of Usage values. 9519type ListUsagesResultIterator struct { 9520 i int 9521 page ListUsagesResultPage 9522} 9523 9524// NextWithContext advances to the next value. If there was an error making 9525// the request the iterator does not advance and the error is returned. 9526func (iter *ListUsagesResultIterator) NextWithContext(ctx context.Context) (err error) { 9527 if tracing.IsEnabled() { 9528 ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultIterator.NextWithContext") 9529 defer func() { 9530 sc := -1 9531 if iter.Response().Response.Response != nil { 9532 sc = iter.Response().Response.Response.StatusCode 9533 } 9534 tracing.EndSpan(ctx, sc, err) 9535 }() 9536 } 9537 iter.i++ 9538 if iter.i < len(iter.page.Values()) { 9539 return nil 9540 } 9541 err = iter.page.NextWithContext(ctx) 9542 if err != nil { 9543 iter.i-- 9544 return err 9545 } 9546 iter.i = 0 9547 return nil 9548} 9549 9550// Next advances to the next value. If there was an error making 9551// the request the iterator does not advance and the error is returned. 9552// Deprecated: Use NextWithContext() instead. 9553func (iter *ListUsagesResultIterator) Next() error { 9554 return iter.NextWithContext(context.Background()) 9555} 9556 9557// NotDone returns true if the enumeration should be started or is not yet complete. 9558func (iter ListUsagesResultIterator) NotDone() bool { 9559 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9560} 9561 9562// Response returns the raw server response from the last page request. 9563func (iter ListUsagesResultIterator) Response() ListUsagesResult { 9564 return iter.page.Response() 9565} 9566 9567// Value returns the current value or a zero-initialized value if the 9568// iterator has advanced beyond the end of the collection. 9569func (iter ListUsagesResultIterator) Value() Usage { 9570 if !iter.page.NotDone() { 9571 return Usage{} 9572 } 9573 return iter.page.Values()[iter.i] 9574} 9575 9576// Creates a new instance of the ListUsagesResultIterator type. 9577func NewListUsagesResultIterator(page ListUsagesResultPage) ListUsagesResultIterator { 9578 return ListUsagesResultIterator{page: page} 9579} 9580 9581// IsEmpty returns true if the ListResult contains no values. 9582func (lur ListUsagesResult) IsEmpty() bool { 9583 return lur.Value == nil || len(*lur.Value) == 0 9584} 9585 9586// hasNextLink returns true if the NextLink is not empty. 9587func (lur ListUsagesResult) hasNextLink() bool { 9588 return lur.NextLink != nil && len(*lur.NextLink) != 0 9589} 9590 9591// listUsagesResultPreparer prepares a request to retrieve the next set of results. 9592// It returns nil if no more results exist. 9593func (lur ListUsagesResult) listUsagesResultPreparer(ctx context.Context) (*http.Request, error) { 9594 if !lur.hasNextLink() { 9595 return nil, nil 9596 } 9597 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9598 autorest.AsJSON(), 9599 autorest.AsGet(), 9600 autorest.WithBaseURL(to.String(lur.NextLink))) 9601} 9602 9603// ListUsagesResultPage contains a page of Usage values. 9604type ListUsagesResultPage struct { 9605 fn func(context.Context, ListUsagesResult) (ListUsagesResult, error) 9606 lur ListUsagesResult 9607} 9608 9609// NextWithContext advances to the next page of values. If there was an error making 9610// the request the page does not advance and the error is returned. 9611func (page *ListUsagesResultPage) NextWithContext(ctx context.Context) (err error) { 9612 if tracing.IsEnabled() { 9613 ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultPage.NextWithContext") 9614 defer func() { 9615 sc := -1 9616 if page.Response().Response.Response != nil { 9617 sc = page.Response().Response.Response.StatusCode 9618 } 9619 tracing.EndSpan(ctx, sc, err) 9620 }() 9621 } 9622 for { 9623 next, err := page.fn(ctx, page.lur) 9624 if err != nil { 9625 return err 9626 } 9627 page.lur = next 9628 if !next.hasNextLink() || !next.IsEmpty() { 9629 break 9630 } 9631 } 9632 return nil 9633} 9634 9635// Next advances to the next page of values. If there was an error making 9636// the request the page does not advance and the error is returned. 9637// Deprecated: Use NextWithContext() instead. 9638func (page *ListUsagesResultPage) Next() error { 9639 return page.NextWithContext(context.Background()) 9640} 9641 9642// NotDone returns true if the page enumeration should be started or is not yet complete. 9643func (page ListUsagesResultPage) NotDone() bool { 9644 return !page.lur.IsEmpty() 9645} 9646 9647// Response returns the raw server response from the last page request. 9648func (page ListUsagesResultPage) Response() ListUsagesResult { 9649 return page.lur 9650} 9651 9652// Values returns the slice of values for the current page or nil if there are no values. 9653func (page ListUsagesResultPage) Values() []Usage { 9654 if page.lur.IsEmpty() { 9655 return nil 9656 } 9657 return *page.lur.Value 9658} 9659 9660// Creates a new instance of the ListUsagesResultPage type. 9661func NewListUsagesResultPage(cur ListUsagesResult, getNextPage func(context.Context, ListUsagesResult) (ListUsagesResult, error)) ListUsagesResultPage { 9662 return ListUsagesResultPage{ 9663 fn: getNextPage, 9664 lur: cur, 9665 } 9666} 9667 9668// ListVirtualMachineExtensionImage ... 9669type ListVirtualMachineExtensionImage struct { 9670 autorest.Response `json:"-"` 9671 Value *[]VirtualMachineExtensionImage `json:"value,omitempty"` 9672} 9673 9674// ListVirtualMachineImageResource ... 9675type ListVirtualMachineImageResource struct { 9676 autorest.Response `json:"-"` 9677 Value *[]VirtualMachineImageResource `json:"value,omitempty"` 9678} 9679 9680// LoadBalancerConfiguration describes the load balancer configuration. 9681type LoadBalancerConfiguration struct { 9682 // ID - Resource Id 9683 ID *string `json:"id,omitempty"` 9684 // Name - The name of the Load balancer 9685 Name *string `json:"name,omitempty"` 9686 // Properties - Properties of the load balancer configuration. 9687 Properties *LoadBalancerConfigurationProperties `json:"properties,omitempty"` 9688} 9689 9690// LoadBalancerConfigurationProperties ... 9691type LoadBalancerConfigurationProperties struct { 9692 // 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. 9693 FrontendIPConfigurations *[]LoadBalancerFrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` 9694} 9695 9696// LoadBalancerFrontendIPConfiguration ... 9697type LoadBalancerFrontendIPConfiguration struct { 9698 // 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. 9699 Name *string `json:"name,omitempty"` 9700 // Properties - Properties of load balancer frontend ip configuration. 9701 Properties *LoadBalancerFrontendIPConfigurationProperties `json:"properties,omitempty"` 9702} 9703 9704// LoadBalancerFrontendIPConfigurationProperties describes a cloud service IP Configuration 9705type LoadBalancerFrontendIPConfigurationProperties struct { 9706 // PublicIPAddress - The reference to the public ip address resource. 9707 PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` 9708 // Subnet - The reference to the virtual network subnet resource. 9709 Subnet *SubResource `json:"subnet,omitempty"` 9710 // PrivateIPAddress - The virtual network private IP address of the IP configuration. 9711 PrivateIPAddress *string `json:"privateIPAddress,omitempty"` 9712} 9713 9714// LogAnalyticsExportRequestRateByIntervalFuture an abstraction for monitoring and retrieving the results 9715// of a long-running operation. 9716type LogAnalyticsExportRequestRateByIntervalFuture struct { 9717 azure.FutureAPI 9718 // Result returns the result of the asynchronous operation. 9719 // If the operation has not completed it will return an error. 9720 Result func(LogAnalyticsClient) (LogAnalyticsOperationResult, error) 9721} 9722 9723// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9724func (future *LogAnalyticsExportRequestRateByIntervalFuture) UnmarshalJSON(body []byte) error { 9725 var azFuture azure.Future 9726 if err := json.Unmarshal(body, &azFuture); err != nil { 9727 return err 9728 } 9729 future.FutureAPI = &azFuture 9730 future.Result = future.result 9731 return nil 9732} 9733 9734// result is the default implementation for LogAnalyticsExportRequestRateByIntervalFuture.Result. 9735func (future *LogAnalyticsExportRequestRateByIntervalFuture) result(client LogAnalyticsClient) (laor LogAnalyticsOperationResult, err error) { 9736 var done bool 9737 done, err = future.DoneWithContext(context.Background(), client) 9738 if err != nil { 9739 err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportRequestRateByIntervalFuture", "Result", future.Response(), "Polling failure") 9740 return 9741 } 9742 if !done { 9743 laor.Response.Response = future.Response() 9744 err = azure.NewAsyncOpIncompleteError("compute.LogAnalyticsExportRequestRateByIntervalFuture") 9745 return 9746 } 9747 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9748 if laor.Response.Response, err = future.GetResult(sender); err == nil && laor.Response.Response.StatusCode != http.StatusNoContent { 9749 laor, err = client.ExportRequestRateByIntervalResponder(laor.Response.Response) 9750 if err != nil { 9751 err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportRequestRateByIntervalFuture", "Result", laor.Response.Response, "Failure responding to request") 9752 } 9753 } 9754 return 9755} 9756 9757// LogAnalyticsExportThrottledRequestsFuture an abstraction for monitoring and retrieving the results of a 9758// long-running operation. 9759type LogAnalyticsExportThrottledRequestsFuture struct { 9760 azure.FutureAPI 9761 // Result returns the result of the asynchronous operation. 9762 // If the operation has not completed it will return an error. 9763 Result func(LogAnalyticsClient) (LogAnalyticsOperationResult, error) 9764} 9765 9766// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9767func (future *LogAnalyticsExportThrottledRequestsFuture) UnmarshalJSON(body []byte) error { 9768 var azFuture azure.Future 9769 if err := json.Unmarshal(body, &azFuture); err != nil { 9770 return err 9771 } 9772 future.FutureAPI = &azFuture 9773 future.Result = future.result 9774 return nil 9775} 9776 9777// result is the default implementation for LogAnalyticsExportThrottledRequestsFuture.Result. 9778func (future *LogAnalyticsExportThrottledRequestsFuture) result(client LogAnalyticsClient) (laor LogAnalyticsOperationResult, err error) { 9779 var done bool 9780 done, err = future.DoneWithContext(context.Background(), client) 9781 if err != nil { 9782 err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportThrottledRequestsFuture", "Result", future.Response(), "Polling failure") 9783 return 9784 } 9785 if !done { 9786 laor.Response.Response = future.Response() 9787 err = azure.NewAsyncOpIncompleteError("compute.LogAnalyticsExportThrottledRequestsFuture") 9788 return 9789 } 9790 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9791 if laor.Response.Response, err = future.GetResult(sender); err == nil && laor.Response.Response.StatusCode != http.StatusNoContent { 9792 laor, err = client.ExportThrottledRequestsResponder(laor.Response.Response) 9793 if err != nil { 9794 err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportThrottledRequestsFuture", "Result", laor.Response.Response, "Failure responding to request") 9795 } 9796 } 9797 return 9798} 9799 9800// LogAnalyticsInputBase api input base class for LogAnalytics Api. 9801type LogAnalyticsInputBase struct { 9802 // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. 9803 BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` 9804 // FromTime - From time of the query 9805 FromTime *date.Time `json:"fromTime,omitempty"` 9806 // ToTime - To time of the query 9807 ToTime *date.Time `json:"toTime,omitempty"` 9808 // GroupByThrottlePolicy - Group query result by Throttle Policy applied. 9809 GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` 9810 // GroupByOperationName - Group query result by Operation Name. 9811 GroupByOperationName *bool `json:"groupByOperationName,omitempty"` 9812 // GroupByResourceName - Group query result by Resource Name. 9813 GroupByResourceName *bool `json:"groupByResourceName,omitempty"` 9814 // GroupByClientApplicationID - Group query result by Client Application ID. 9815 GroupByClientApplicationID *bool `json:"groupByClientApplicationId,omitempty"` 9816 // GroupByUserAgent - Group query result by User Agent. 9817 GroupByUserAgent *bool `json:"groupByUserAgent,omitempty"` 9818} 9819 9820// LogAnalyticsOperationResult logAnalytics operation status response 9821type LogAnalyticsOperationResult struct { 9822 autorest.Response `json:"-"` 9823 // Properties - READ-ONLY; LogAnalyticsOutput 9824 Properties *LogAnalyticsOutput `json:"properties,omitempty"` 9825} 9826 9827// MarshalJSON is the custom marshaler for LogAnalyticsOperationResult. 9828func (laor LogAnalyticsOperationResult) MarshalJSON() ([]byte, error) { 9829 objectMap := make(map[string]interface{}) 9830 return json.Marshal(objectMap) 9831} 9832 9833// LogAnalyticsOutput logAnalytics output properties 9834type LogAnalyticsOutput struct { 9835 // Output - READ-ONLY; Output file Uri path to blob container. 9836 Output *string `json:"output,omitempty"` 9837} 9838 9839// MarshalJSON is the custom marshaler for LogAnalyticsOutput. 9840func (lao LogAnalyticsOutput) MarshalJSON() ([]byte, error) { 9841 objectMap := make(map[string]interface{}) 9842 return json.Marshal(objectMap) 9843} 9844 9845// MaintenanceRedeployStatus maintenance Operation Status. 9846type MaintenanceRedeployStatus struct { 9847 // IsCustomerInitiatedMaintenanceAllowed - True, if customer is allowed to perform Maintenance. 9848 IsCustomerInitiatedMaintenanceAllowed *bool `json:"isCustomerInitiatedMaintenanceAllowed,omitempty"` 9849 // PreMaintenanceWindowStartTime - Start Time for the Pre Maintenance Window. 9850 PreMaintenanceWindowStartTime *date.Time `json:"preMaintenanceWindowStartTime,omitempty"` 9851 // PreMaintenanceWindowEndTime - End Time for the Pre Maintenance Window. 9852 PreMaintenanceWindowEndTime *date.Time `json:"preMaintenanceWindowEndTime,omitempty"` 9853 // MaintenanceWindowStartTime - Start Time for the Maintenance Window. 9854 MaintenanceWindowStartTime *date.Time `json:"maintenanceWindowStartTime,omitempty"` 9855 // MaintenanceWindowEndTime - End Time for the Maintenance Window. 9856 MaintenanceWindowEndTime *date.Time `json:"maintenanceWindowEndTime,omitempty"` 9857 // LastOperationResultCode - The Last Maintenance Operation Result Code. Possible values include: 'MaintenanceOperationResultCodeTypesNone', 'MaintenanceOperationResultCodeTypesRetryLater', 'MaintenanceOperationResultCodeTypesMaintenanceAborted', 'MaintenanceOperationResultCodeTypesMaintenanceCompleted' 9858 LastOperationResultCode MaintenanceOperationResultCodeTypes `json:"lastOperationResultCode,omitempty"` 9859 // LastOperationMessage - Message returned for the last Maintenance Operation. 9860 LastOperationMessage *string `json:"lastOperationMessage,omitempty"` 9861} 9862 9863// ManagedArtifact the managed artifact. 9864type ManagedArtifact struct { 9865 // ID - The managed artifact id. 9866 ID *string `json:"id,omitempty"` 9867} 9868 9869// ManagedDiskParameters the parameters of a managed disk. 9870type ManagedDiskParameters struct { 9871 // 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' 9872 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 9873 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed disk. 9874 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 9875 // ID - Resource Id 9876 ID *string `json:"id,omitempty"` 9877} 9878 9879// NetworkInterfaceReference describes a network interface reference. 9880type NetworkInterfaceReference struct { 9881 *NetworkInterfaceReferenceProperties `json:"properties,omitempty"` 9882 // ID - Resource Id 9883 ID *string `json:"id,omitempty"` 9884} 9885 9886// MarshalJSON is the custom marshaler for NetworkInterfaceReference. 9887func (nir NetworkInterfaceReference) MarshalJSON() ([]byte, error) { 9888 objectMap := make(map[string]interface{}) 9889 if nir.NetworkInterfaceReferenceProperties != nil { 9890 objectMap["properties"] = nir.NetworkInterfaceReferenceProperties 9891 } 9892 if nir.ID != nil { 9893 objectMap["id"] = nir.ID 9894 } 9895 return json.Marshal(objectMap) 9896} 9897 9898// UnmarshalJSON is the custom unmarshaler for NetworkInterfaceReference struct. 9899func (nir *NetworkInterfaceReference) UnmarshalJSON(body []byte) error { 9900 var m map[string]*json.RawMessage 9901 err := json.Unmarshal(body, &m) 9902 if err != nil { 9903 return err 9904 } 9905 for k, v := range m { 9906 switch k { 9907 case "properties": 9908 if v != nil { 9909 var networkInterfaceReferenceProperties NetworkInterfaceReferenceProperties 9910 err = json.Unmarshal(*v, &networkInterfaceReferenceProperties) 9911 if err != nil { 9912 return err 9913 } 9914 nir.NetworkInterfaceReferenceProperties = &networkInterfaceReferenceProperties 9915 } 9916 case "id": 9917 if v != nil { 9918 var ID string 9919 err = json.Unmarshal(*v, &ID) 9920 if err != nil { 9921 return err 9922 } 9923 nir.ID = &ID 9924 } 9925 } 9926 } 9927 9928 return nil 9929} 9930 9931// NetworkInterfaceReferenceProperties describes a network interface reference properties. 9932type NetworkInterfaceReferenceProperties struct { 9933 // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. 9934 Primary *bool `json:"primary,omitempty"` 9935 // DeleteOption - Specify what happens to the network interface when the VM is deleted. Possible values include: 'DeleteOptionsDelete', 'DeleteOptionsDetach' 9936 DeleteOption DeleteOptions `json:"deleteOption,omitempty"` 9937} 9938 9939// NetworkProfile specifies the network interfaces or the networking configuration of the virtual machine. 9940type NetworkProfile struct { 9941 // NetworkInterfaces - Specifies the list of resource Ids for the network interfaces associated with the virtual machine. 9942 NetworkInterfaces *[]NetworkInterfaceReference `json:"networkInterfaces,omitempty"` 9943 // NetworkAPIVersion - specifies the Microsoft.Network API version used when creating networking resources in the Network Interface Configurations. Possible values include: 'NetworkAPIVersionTwoZeroTwoZeroHyphenMinusOneOneHyphenMinusZeroOne' 9944 NetworkAPIVersion NetworkAPIVersion `json:"networkApiVersion,omitempty"` 9945 // NetworkInterfaceConfigurations - Specifies the networking configurations that will be used to create the virtual machine networking resources. 9946 NetworkInterfaceConfigurations *[]VirtualMachineNetworkInterfaceConfiguration `json:"networkInterfaceConfigurations,omitempty"` 9947} 9948 9949// OperationListResult the List Compute Operation operation response. 9950type OperationListResult struct { 9951 autorest.Response `json:"-"` 9952 // Value - READ-ONLY; The list of compute operations 9953 Value *[]OperationValue `json:"value,omitempty"` 9954} 9955 9956// MarshalJSON is the custom marshaler for OperationListResult. 9957func (olr OperationListResult) MarshalJSON() ([]byte, error) { 9958 objectMap := make(map[string]interface{}) 9959 return json.Marshal(objectMap) 9960} 9961 9962// OperationValue describes the properties of a Compute Operation value. 9963type OperationValue struct { 9964 // Origin - READ-ONLY; The origin of the compute operation. 9965 Origin *string `json:"origin,omitempty"` 9966 // Name - READ-ONLY; The name of the compute operation. 9967 Name *string `json:"name,omitempty"` 9968 *OperationValueDisplay `json:"display,omitempty"` 9969} 9970 9971// MarshalJSON is the custom marshaler for OperationValue. 9972func (ov OperationValue) MarshalJSON() ([]byte, error) { 9973 objectMap := make(map[string]interface{}) 9974 if ov.OperationValueDisplay != nil { 9975 objectMap["display"] = ov.OperationValueDisplay 9976 } 9977 return json.Marshal(objectMap) 9978} 9979 9980// UnmarshalJSON is the custom unmarshaler for OperationValue struct. 9981func (ov *OperationValue) UnmarshalJSON(body []byte) error { 9982 var m map[string]*json.RawMessage 9983 err := json.Unmarshal(body, &m) 9984 if err != nil { 9985 return err 9986 } 9987 for k, v := range m { 9988 switch k { 9989 case "origin": 9990 if v != nil { 9991 var origin string 9992 err = json.Unmarshal(*v, &origin) 9993 if err != nil { 9994 return err 9995 } 9996 ov.Origin = &origin 9997 } 9998 case "name": 9999 if v != nil { 10000 var name string 10001 err = json.Unmarshal(*v, &name) 10002 if err != nil { 10003 return err 10004 } 10005 ov.Name = &name 10006 } 10007 case "display": 10008 if v != nil { 10009 var operationValueDisplay OperationValueDisplay 10010 err = json.Unmarshal(*v, &operationValueDisplay) 10011 if err != nil { 10012 return err 10013 } 10014 ov.OperationValueDisplay = &operationValueDisplay 10015 } 10016 } 10017 } 10018 10019 return nil 10020} 10021 10022// OperationValueDisplay describes the properties of a Compute Operation Value Display. 10023type OperationValueDisplay struct { 10024 // Operation - READ-ONLY; The display name of the compute operation. 10025 Operation *string `json:"operation,omitempty"` 10026 // Resource - READ-ONLY; The display name of the resource the operation applies to. 10027 Resource *string `json:"resource,omitempty"` 10028 // Description - READ-ONLY; The description of the operation. 10029 Description *string `json:"description,omitempty"` 10030 // Provider - READ-ONLY; The resource provider for the operation. 10031 Provider *string `json:"provider,omitempty"` 10032} 10033 10034// MarshalJSON is the custom marshaler for OperationValueDisplay. 10035func (ovd OperationValueDisplay) MarshalJSON() ([]byte, error) { 10036 objectMap := make(map[string]interface{}) 10037 return json.Marshal(objectMap) 10038} 10039 10040// OrchestrationServiceStateInput the input for OrchestrationServiceState 10041type OrchestrationServiceStateInput struct { 10042 // ServiceName - The name of the service. 10043 ServiceName *string `json:"serviceName,omitempty"` 10044 // Action - The action to be performed. Possible values include: 'OrchestrationServiceStateActionResume', 'OrchestrationServiceStateActionSuspend' 10045 Action OrchestrationServiceStateAction `json:"action,omitempty"` 10046} 10047 10048// OrchestrationServiceSummary summary for an orchestration service of a virtual machine scale set. 10049type OrchestrationServiceSummary struct { 10050 // ServiceName - READ-ONLY; The name of the service. Possible values include: 'OrchestrationServiceNamesAutomaticRepairs' 10051 ServiceName OrchestrationServiceNames `json:"serviceName,omitempty"` 10052 // ServiceState - READ-ONLY; The current state of the service. Possible values include: 'OrchestrationServiceStateNotRunning', 'OrchestrationServiceStateRunning', 'OrchestrationServiceStateSuspended' 10053 ServiceState OrchestrationServiceState `json:"serviceState,omitempty"` 10054} 10055 10056// MarshalJSON is the custom marshaler for OrchestrationServiceSummary. 10057func (oss OrchestrationServiceSummary) MarshalJSON() ([]byte, error) { 10058 objectMap := make(map[string]interface{}) 10059 return json.Marshal(objectMap) 10060} 10061 10062// OSDisk specifies information about the operating system disk used by the virtual machine. <br><br> For 10063// more information about disks, see [About disks and VHDs for Azure virtual 10064// machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). 10065type OSDisk struct { 10066 // 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' 10067 OsType OperatingSystemTypes `json:"osType,omitempty"` 10068 // EncryptionSettings - Specifies the encryption settings for the OS Disk. <br><br> Minimum api-version: 2015-06-15 10069 EncryptionSettings *DiskEncryptionSettings `json:"encryptionSettings,omitempty"` 10070 // Name - The disk name. 10071 Name *string `json:"name,omitempty"` 10072 // Vhd - The virtual hard disk. 10073 Vhd *VirtualHardDisk `json:"vhd,omitempty"` 10074 // 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. 10075 Image *VirtualHardDisk `json:"image,omitempty"` 10076 // 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' 10077 Caching CachingTypes `json:"caching,omitempty"` 10078 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 10079 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 10080 // DiffDiskSettings - Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine. 10081 DiffDiskSettings *DiffDiskSettings `json:"diffDiskSettings,omitempty"` 10082 // 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' 10083 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 10084 // 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 10085 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 10086 // ManagedDisk - The managed disk parameters. 10087 ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` 10088 // 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' 10089 DeleteOption DiskDeleteOptionTypes `json:"deleteOption,omitempty"` 10090} 10091 10092// OSDiskImage contains the os disk image information. 10093type OSDiskImage struct { 10094 // OperatingSystem - The operating system of the osDiskImage. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' 10095 OperatingSystem OperatingSystemTypes `json:"operatingSystem,omitempty"` 10096} 10097 10098// OSDiskImageEncryption contains encryption settings for an OS disk image. 10099type OSDiskImageEncryption struct { 10100 // DiskEncryptionSetID - A relative URI containing the resource ID of the disk encryption set. 10101 DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` 10102} 10103 10104// OSFamily describes a cloud service OS family. 10105type OSFamily struct { 10106 autorest.Response `json:"-"` 10107 // ID - READ-ONLY; Resource Id. 10108 ID *string `json:"id,omitempty"` 10109 // Name - READ-ONLY; Resource name. 10110 Name *string `json:"name,omitempty"` 10111 // Type - READ-ONLY; Resource type. 10112 Type *string `json:"type,omitempty"` 10113 // Location - READ-ONLY; Resource location. 10114 Location *string `json:"location,omitempty"` 10115 Properties *OSFamilyProperties `json:"properties,omitempty"` 10116} 10117 10118// MarshalJSON is the custom marshaler for OSFamily. 10119func (of OSFamily) MarshalJSON() ([]byte, error) { 10120 objectMap := make(map[string]interface{}) 10121 if of.Properties != nil { 10122 objectMap["properties"] = of.Properties 10123 } 10124 return json.Marshal(objectMap) 10125} 10126 10127// OSFamilyListResult ... 10128type OSFamilyListResult struct { 10129 autorest.Response `json:"-"` 10130 Value *[]OSFamily `json:"value,omitempty"` 10131 NextLink *string `json:"nextLink,omitempty"` 10132} 10133 10134// OSFamilyListResultIterator provides access to a complete listing of OSFamily values. 10135type OSFamilyListResultIterator struct { 10136 i int 10137 page OSFamilyListResultPage 10138} 10139 10140// NextWithContext advances to the next value. If there was an error making 10141// the request the iterator does not advance and the error is returned. 10142func (iter *OSFamilyListResultIterator) NextWithContext(ctx context.Context) (err error) { 10143 if tracing.IsEnabled() { 10144 ctx = tracing.StartSpan(ctx, fqdn+"/OSFamilyListResultIterator.NextWithContext") 10145 defer func() { 10146 sc := -1 10147 if iter.Response().Response.Response != nil { 10148 sc = iter.Response().Response.Response.StatusCode 10149 } 10150 tracing.EndSpan(ctx, sc, err) 10151 }() 10152 } 10153 iter.i++ 10154 if iter.i < len(iter.page.Values()) { 10155 return nil 10156 } 10157 err = iter.page.NextWithContext(ctx) 10158 if err != nil { 10159 iter.i-- 10160 return err 10161 } 10162 iter.i = 0 10163 return nil 10164} 10165 10166// Next advances to the next value. If there was an error making 10167// the request the iterator does not advance and the error is returned. 10168// Deprecated: Use NextWithContext() instead. 10169func (iter *OSFamilyListResultIterator) Next() error { 10170 return iter.NextWithContext(context.Background()) 10171} 10172 10173// NotDone returns true if the enumeration should be started or is not yet complete. 10174func (iter OSFamilyListResultIterator) NotDone() bool { 10175 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10176} 10177 10178// Response returns the raw server response from the last page request. 10179func (iter OSFamilyListResultIterator) Response() OSFamilyListResult { 10180 return iter.page.Response() 10181} 10182 10183// Value returns the current value or a zero-initialized value if the 10184// iterator has advanced beyond the end of the collection. 10185func (iter OSFamilyListResultIterator) Value() OSFamily { 10186 if !iter.page.NotDone() { 10187 return OSFamily{} 10188 } 10189 return iter.page.Values()[iter.i] 10190} 10191 10192// Creates a new instance of the OSFamilyListResultIterator type. 10193func NewOSFamilyListResultIterator(page OSFamilyListResultPage) OSFamilyListResultIterator { 10194 return OSFamilyListResultIterator{page: page} 10195} 10196 10197// IsEmpty returns true if the ListResult contains no values. 10198func (oflr OSFamilyListResult) IsEmpty() bool { 10199 return oflr.Value == nil || len(*oflr.Value) == 0 10200} 10201 10202// hasNextLink returns true if the NextLink is not empty. 10203func (oflr OSFamilyListResult) hasNextLink() bool { 10204 return oflr.NextLink != nil && len(*oflr.NextLink) != 0 10205} 10206 10207// oSFamilyListResultPreparer prepares a request to retrieve the next set of results. 10208// It returns nil if no more results exist. 10209func (oflr OSFamilyListResult) oSFamilyListResultPreparer(ctx context.Context) (*http.Request, error) { 10210 if !oflr.hasNextLink() { 10211 return nil, nil 10212 } 10213 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10214 autorest.AsJSON(), 10215 autorest.AsGet(), 10216 autorest.WithBaseURL(to.String(oflr.NextLink))) 10217} 10218 10219// OSFamilyListResultPage contains a page of OSFamily values. 10220type OSFamilyListResultPage struct { 10221 fn func(context.Context, OSFamilyListResult) (OSFamilyListResult, error) 10222 oflr OSFamilyListResult 10223} 10224 10225// NextWithContext advances to the next page of values. If there was an error making 10226// the request the page does not advance and the error is returned. 10227func (page *OSFamilyListResultPage) NextWithContext(ctx context.Context) (err error) { 10228 if tracing.IsEnabled() { 10229 ctx = tracing.StartSpan(ctx, fqdn+"/OSFamilyListResultPage.NextWithContext") 10230 defer func() { 10231 sc := -1 10232 if page.Response().Response.Response != nil { 10233 sc = page.Response().Response.Response.StatusCode 10234 } 10235 tracing.EndSpan(ctx, sc, err) 10236 }() 10237 } 10238 for { 10239 next, err := page.fn(ctx, page.oflr) 10240 if err != nil { 10241 return err 10242 } 10243 page.oflr = next 10244 if !next.hasNextLink() || !next.IsEmpty() { 10245 break 10246 } 10247 } 10248 return nil 10249} 10250 10251// Next advances to the next page of values. If there was an error making 10252// the request the page does not advance and the error is returned. 10253// Deprecated: Use NextWithContext() instead. 10254func (page *OSFamilyListResultPage) Next() error { 10255 return page.NextWithContext(context.Background()) 10256} 10257 10258// NotDone returns true if the page enumeration should be started or is not yet complete. 10259func (page OSFamilyListResultPage) NotDone() bool { 10260 return !page.oflr.IsEmpty() 10261} 10262 10263// Response returns the raw server response from the last page request. 10264func (page OSFamilyListResultPage) Response() OSFamilyListResult { 10265 return page.oflr 10266} 10267 10268// Values returns the slice of values for the current page or nil if there are no values. 10269func (page OSFamilyListResultPage) Values() []OSFamily { 10270 if page.oflr.IsEmpty() { 10271 return nil 10272 } 10273 return *page.oflr.Value 10274} 10275 10276// Creates a new instance of the OSFamilyListResultPage type. 10277func NewOSFamilyListResultPage(cur OSFamilyListResult, getNextPage func(context.Context, OSFamilyListResult) (OSFamilyListResult, error)) OSFamilyListResultPage { 10278 return OSFamilyListResultPage{ 10279 fn: getNextPage, 10280 oflr: cur, 10281 } 10282} 10283 10284// OSFamilyProperties OS family properties. 10285type OSFamilyProperties struct { 10286 // Name - READ-ONLY; The OS family name. 10287 Name *string `json:"name,omitempty"` 10288 // Label - READ-ONLY; The OS family label. 10289 Label *string `json:"label,omitempty"` 10290 // Versions - READ-ONLY; List of OS versions belonging to this family. 10291 Versions *[]OSVersionPropertiesBase `json:"versions,omitempty"` 10292} 10293 10294// MarshalJSON is the custom marshaler for OSFamilyProperties. 10295func (ofp OSFamilyProperties) MarshalJSON() ([]byte, error) { 10296 objectMap := make(map[string]interface{}) 10297 return json.Marshal(objectMap) 10298} 10299 10300// OSProfile specifies the operating system settings for the virtual machine. Some of the settings cannot 10301// be changed once VM is provisioned. 10302type OSProfile struct { 10303 // 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). 10304 ComputerName *string `json:"computerName,omitempty"` 10305 // 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. 10306 AdminUsername *string `json:"adminUsername,omitempty"` 10307 // 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) 10308 AdminPassword *string `json:"adminPassword,omitempty"` 10309 // 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) 10310 CustomData *string `json:"customData,omitempty"` 10311 // WindowsConfiguration - Specifies Windows operating system settings on the virtual machine. 10312 WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` 10313 // 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). 10314 LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` 10315 // Secrets - Specifies set of certificates that should be installed onto the virtual machine. 10316 Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` 10317 // 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. 10318 AllowExtensionOperations *bool `json:"allowExtensionOperations,omitempty"` 10319 // 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.** 10320 RequireGuestProvisionSignal *bool `json:"requireGuestProvisionSignal,omitempty"` 10321} 10322 10323// OSVersion describes a cloud service OS version. 10324type OSVersion struct { 10325 autorest.Response `json:"-"` 10326 // ID - READ-ONLY; Resource Id. 10327 ID *string `json:"id,omitempty"` 10328 // Name - READ-ONLY; Resource name. 10329 Name *string `json:"name,omitempty"` 10330 // Type - READ-ONLY; Resource type. 10331 Type *string `json:"type,omitempty"` 10332 // Location - READ-ONLY; Resource location. 10333 Location *string `json:"location,omitempty"` 10334 Properties *OSVersionProperties `json:"properties,omitempty"` 10335} 10336 10337// MarshalJSON is the custom marshaler for OSVersion. 10338func (ov OSVersion) MarshalJSON() ([]byte, error) { 10339 objectMap := make(map[string]interface{}) 10340 if ov.Properties != nil { 10341 objectMap["properties"] = ov.Properties 10342 } 10343 return json.Marshal(objectMap) 10344} 10345 10346// OSVersionListResult ... 10347type OSVersionListResult struct { 10348 autorest.Response `json:"-"` 10349 Value *[]OSVersion `json:"value,omitempty"` 10350 NextLink *string `json:"nextLink,omitempty"` 10351} 10352 10353// OSVersionListResultIterator provides access to a complete listing of OSVersion values. 10354type OSVersionListResultIterator struct { 10355 i int 10356 page OSVersionListResultPage 10357} 10358 10359// NextWithContext advances to the next value. If there was an error making 10360// the request the iterator does not advance and the error is returned. 10361func (iter *OSVersionListResultIterator) NextWithContext(ctx context.Context) (err error) { 10362 if tracing.IsEnabled() { 10363 ctx = tracing.StartSpan(ctx, fqdn+"/OSVersionListResultIterator.NextWithContext") 10364 defer func() { 10365 sc := -1 10366 if iter.Response().Response.Response != nil { 10367 sc = iter.Response().Response.Response.StatusCode 10368 } 10369 tracing.EndSpan(ctx, sc, err) 10370 }() 10371 } 10372 iter.i++ 10373 if iter.i < len(iter.page.Values()) { 10374 return nil 10375 } 10376 err = iter.page.NextWithContext(ctx) 10377 if err != nil { 10378 iter.i-- 10379 return err 10380 } 10381 iter.i = 0 10382 return nil 10383} 10384 10385// Next advances to the next value. If there was an error making 10386// the request the iterator does not advance and the error is returned. 10387// Deprecated: Use NextWithContext() instead. 10388func (iter *OSVersionListResultIterator) Next() error { 10389 return iter.NextWithContext(context.Background()) 10390} 10391 10392// NotDone returns true if the enumeration should be started or is not yet complete. 10393func (iter OSVersionListResultIterator) NotDone() bool { 10394 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10395} 10396 10397// Response returns the raw server response from the last page request. 10398func (iter OSVersionListResultIterator) Response() OSVersionListResult { 10399 return iter.page.Response() 10400} 10401 10402// Value returns the current value or a zero-initialized value if the 10403// iterator has advanced beyond the end of the collection. 10404func (iter OSVersionListResultIterator) Value() OSVersion { 10405 if !iter.page.NotDone() { 10406 return OSVersion{} 10407 } 10408 return iter.page.Values()[iter.i] 10409} 10410 10411// Creates a new instance of the OSVersionListResultIterator type. 10412func NewOSVersionListResultIterator(page OSVersionListResultPage) OSVersionListResultIterator { 10413 return OSVersionListResultIterator{page: page} 10414} 10415 10416// IsEmpty returns true if the ListResult contains no values. 10417func (ovlr OSVersionListResult) IsEmpty() bool { 10418 return ovlr.Value == nil || len(*ovlr.Value) == 0 10419} 10420 10421// hasNextLink returns true if the NextLink is not empty. 10422func (ovlr OSVersionListResult) hasNextLink() bool { 10423 return ovlr.NextLink != nil && len(*ovlr.NextLink) != 0 10424} 10425 10426// oSVersionListResultPreparer prepares a request to retrieve the next set of results. 10427// It returns nil if no more results exist. 10428func (ovlr OSVersionListResult) oSVersionListResultPreparer(ctx context.Context) (*http.Request, error) { 10429 if !ovlr.hasNextLink() { 10430 return nil, nil 10431 } 10432 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10433 autorest.AsJSON(), 10434 autorest.AsGet(), 10435 autorest.WithBaseURL(to.String(ovlr.NextLink))) 10436} 10437 10438// OSVersionListResultPage contains a page of OSVersion values. 10439type OSVersionListResultPage struct { 10440 fn func(context.Context, OSVersionListResult) (OSVersionListResult, error) 10441 ovlr OSVersionListResult 10442} 10443 10444// NextWithContext advances to the next page of values. If there was an error making 10445// the request the page does not advance and the error is returned. 10446func (page *OSVersionListResultPage) NextWithContext(ctx context.Context) (err error) { 10447 if tracing.IsEnabled() { 10448 ctx = tracing.StartSpan(ctx, fqdn+"/OSVersionListResultPage.NextWithContext") 10449 defer func() { 10450 sc := -1 10451 if page.Response().Response.Response != nil { 10452 sc = page.Response().Response.Response.StatusCode 10453 } 10454 tracing.EndSpan(ctx, sc, err) 10455 }() 10456 } 10457 for { 10458 next, err := page.fn(ctx, page.ovlr) 10459 if err != nil { 10460 return err 10461 } 10462 page.ovlr = next 10463 if !next.hasNextLink() || !next.IsEmpty() { 10464 break 10465 } 10466 } 10467 return nil 10468} 10469 10470// Next advances to the next page of values. If there was an error making 10471// the request the page does not advance and the error is returned. 10472// Deprecated: Use NextWithContext() instead. 10473func (page *OSVersionListResultPage) Next() error { 10474 return page.NextWithContext(context.Background()) 10475} 10476 10477// NotDone returns true if the page enumeration should be started or is not yet complete. 10478func (page OSVersionListResultPage) NotDone() bool { 10479 return !page.ovlr.IsEmpty() 10480} 10481 10482// Response returns the raw server response from the last page request. 10483func (page OSVersionListResultPage) Response() OSVersionListResult { 10484 return page.ovlr 10485} 10486 10487// Values returns the slice of values for the current page or nil if there are no values. 10488func (page OSVersionListResultPage) Values() []OSVersion { 10489 if page.ovlr.IsEmpty() { 10490 return nil 10491 } 10492 return *page.ovlr.Value 10493} 10494 10495// Creates a new instance of the OSVersionListResultPage type. 10496func NewOSVersionListResultPage(cur OSVersionListResult, getNextPage func(context.Context, OSVersionListResult) (OSVersionListResult, error)) OSVersionListResultPage { 10497 return OSVersionListResultPage{ 10498 fn: getNextPage, 10499 ovlr: cur, 10500 } 10501} 10502 10503// OSVersionProperties OS version properties. 10504type OSVersionProperties struct { 10505 // Family - READ-ONLY; The family of this OS version. 10506 Family *string `json:"family,omitempty"` 10507 // FamilyLabel - READ-ONLY; The family label of this OS version. 10508 FamilyLabel *string `json:"familyLabel,omitempty"` 10509 // Version - READ-ONLY; The OS version. 10510 Version *string `json:"version,omitempty"` 10511 // Label - READ-ONLY; The OS version label. 10512 Label *string `json:"label,omitempty"` 10513 // IsDefault - READ-ONLY; Specifies whether this is the default OS version for its family. 10514 IsDefault *bool `json:"isDefault,omitempty"` 10515 // IsActive - READ-ONLY; Specifies whether this OS version is active. 10516 IsActive *bool `json:"isActive,omitempty"` 10517} 10518 10519// MarshalJSON is the custom marshaler for OSVersionProperties. 10520func (ovp OSVersionProperties) MarshalJSON() ([]byte, error) { 10521 objectMap := make(map[string]interface{}) 10522 return json.Marshal(objectMap) 10523} 10524 10525// OSVersionPropertiesBase configuration view of an OS version. 10526type OSVersionPropertiesBase struct { 10527 // Version - READ-ONLY; The OS version. 10528 Version *string `json:"version,omitempty"` 10529 // Label - READ-ONLY; The OS version label. 10530 Label *string `json:"label,omitempty"` 10531 // IsDefault - READ-ONLY; Specifies whether this is the default OS version for its family. 10532 IsDefault *bool `json:"isDefault,omitempty"` 10533 // IsActive - READ-ONLY; Specifies whether this OS version is active. 10534 IsActive *bool `json:"isActive,omitempty"` 10535} 10536 10537// MarshalJSON is the custom marshaler for OSVersionPropertiesBase. 10538func (ovpb OSVersionPropertiesBase) MarshalJSON() ([]byte, error) { 10539 objectMap := make(map[string]interface{}) 10540 return json.Marshal(objectMap) 10541} 10542 10543// PatchInstallationDetail information about a specific patch that was encountered during an installation 10544// action. 10545type PatchInstallationDetail struct { 10546 // PatchID - READ-ONLY; A unique identifier for the patch. 10547 PatchID *string `json:"patchId,omitempty"` 10548 // Name - READ-ONLY; The friendly name of the patch. 10549 Name *string `json:"name,omitempty"` 10550 // Version - READ-ONLY; The version string of the package. It may conform to Semantic Versioning. Only applies to Linux. 10551 Version *string `json:"version,omitempty"` 10552 // KbID - READ-ONLY; The KBID of the patch. Only applies to Windows patches. 10553 KbID *string `json:"kbId,omitempty"` 10554 // Classifications - READ-ONLY; The classification(s) of the patch as provided by the patch publisher. 10555 Classifications *[]string `json:"classifications,omitempty"` 10556 // InstallationState - READ-ONLY; The state of the patch after the installation operation completed. Possible values include: 'PatchInstallationStateUnknown', 'PatchInstallationStateInstalled', 'PatchInstallationStateFailed', 'PatchInstallationStateExcluded', 'PatchInstallationStateNotSelected', 'PatchInstallationStatePending' 10557 InstallationState PatchInstallationState `json:"installationState,omitempty"` 10558} 10559 10560// MarshalJSON is the custom marshaler for PatchInstallationDetail. 10561func (pid PatchInstallationDetail) MarshalJSON() ([]byte, error) { 10562 objectMap := make(map[string]interface{}) 10563 return json.Marshal(objectMap) 10564} 10565 10566// PatchSettings specifies settings related to VM Guest Patching on Windows. 10567type PatchSettings struct { 10568 // 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' 10569 PatchMode WindowsVMGuestPatchMode `json:"patchMode,omitempty"` 10570 // 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'. 10571 EnableHotpatching *bool `json:"enableHotpatching,omitempty"` 10572 // 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' 10573 AssessmentMode WindowsPatchAssessmentMode `json:"assessmentMode,omitempty"` 10574} 10575 10576// PirResource the Resource model definition. 10577type PirResource struct { 10578 // Name - READ-ONLY; Resource name 10579 Name *string `json:"name,omitempty"` 10580 // Location - READ-ONLY; Resource location 10581 Location *string `json:"location,omitempty"` 10582} 10583 10584// MarshalJSON is the custom marshaler for PirResource. 10585func (pr PirResource) MarshalJSON() ([]byte, error) { 10586 objectMap := make(map[string]interface{}) 10587 return json.Marshal(objectMap) 10588} 10589 10590// PirSharedGalleryResource base information about the shared gallery resource in pir. 10591type PirSharedGalleryResource struct { 10592 *SharedGalleryIdentifier `json:"identifier,omitempty"` 10593 // Name - READ-ONLY; Resource name 10594 Name *string `json:"name,omitempty"` 10595 // Location - READ-ONLY; Resource location 10596 Location *string `json:"location,omitempty"` 10597} 10598 10599// MarshalJSON is the custom marshaler for PirSharedGalleryResource. 10600func (psgr PirSharedGalleryResource) MarshalJSON() ([]byte, error) { 10601 objectMap := make(map[string]interface{}) 10602 if psgr.SharedGalleryIdentifier != nil { 10603 objectMap["identifier"] = psgr.SharedGalleryIdentifier 10604 } 10605 return json.Marshal(objectMap) 10606} 10607 10608// UnmarshalJSON is the custom unmarshaler for PirSharedGalleryResource struct. 10609func (psgr *PirSharedGalleryResource) UnmarshalJSON(body []byte) error { 10610 var m map[string]*json.RawMessage 10611 err := json.Unmarshal(body, &m) 10612 if err != nil { 10613 return err 10614 } 10615 for k, v := range m { 10616 switch k { 10617 case "identifier": 10618 if v != nil { 10619 var sharedGalleryIdentifier SharedGalleryIdentifier 10620 err = json.Unmarshal(*v, &sharedGalleryIdentifier) 10621 if err != nil { 10622 return err 10623 } 10624 psgr.SharedGalleryIdentifier = &sharedGalleryIdentifier 10625 } 10626 case "name": 10627 if v != nil { 10628 var name string 10629 err = json.Unmarshal(*v, &name) 10630 if err != nil { 10631 return err 10632 } 10633 psgr.Name = &name 10634 } 10635 case "location": 10636 if v != nil { 10637 var location string 10638 err = json.Unmarshal(*v, &location) 10639 if err != nil { 10640 return err 10641 } 10642 psgr.Location = &location 10643 } 10644 } 10645 } 10646 10647 return nil 10648} 10649 10650// Plan specifies information about the marketplace image used to create the virtual machine. This element 10651// is only used for marketplace images. Before you can use a marketplace image from an API, you must enable 10652// the image for programmatic use. In the Azure portal, find the marketplace image that you want to use 10653// and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and 10654// then click **Save**. 10655type Plan struct { 10656 // Name - The plan ID. 10657 Name *string `json:"name,omitempty"` 10658 // Publisher - The publisher ID. 10659 Publisher *string `json:"publisher,omitempty"` 10660 // Product - Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. 10661 Product *string `json:"product,omitempty"` 10662 // PromotionCode - The promotion code. 10663 PromotionCode *string `json:"promotionCode,omitempty"` 10664} 10665 10666// PrivateEndpoint the Private Endpoint resource. 10667type PrivateEndpoint struct { 10668 // ID - READ-ONLY; The ARM identifier for Private Endpoint 10669 ID *string `json:"id,omitempty"` 10670} 10671 10672// MarshalJSON is the custom marshaler for PrivateEndpoint. 10673func (peVar PrivateEndpoint) MarshalJSON() ([]byte, error) { 10674 objectMap := make(map[string]interface{}) 10675 return json.Marshal(objectMap) 10676} 10677 10678// PrivateEndpointConnection the Private Endpoint Connection resource. 10679type PrivateEndpointConnection struct { 10680 autorest.Response `json:"-"` 10681 // PrivateEndpointConnectionProperties - Resource properties. 10682 *PrivateEndpointConnectionProperties `json:"properties,omitempty"` 10683 // ID - READ-ONLY; private endpoint connection Id 10684 ID *string `json:"id,omitempty"` 10685 // Name - READ-ONLY; private endpoint connection name 10686 Name *string `json:"name,omitempty"` 10687 // Type - READ-ONLY; private endpoint connection type 10688 Type *string `json:"type,omitempty"` 10689} 10690 10691// MarshalJSON is the custom marshaler for PrivateEndpointConnection. 10692func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) { 10693 objectMap := make(map[string]interface{}) 10694 if pec.PrivateEndpointConnectionProperties != nil { 10695 objectMap["properties"] = pec.PrivateEndpointConnectionProperties 10696 } 10697 return json.Marshal(objectMap) 10698} 10699 10700// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct. 10701func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error { 10702 var m map[string]*json.RawMessage 10703 err := json.Unmarshal(body, &m) 10704 if err != nil { 10705 return err 10706 } 10707 for k, v := range m { 10708 switch k { 10709 case "properties": 10710 if v != nil { 10711 var privateEndpointConnectionProperties PrivateEndpointConnectionProperties 10712 err = json.Unmarshal(*v, &privateEndpointConnectionProperties) 10713 if err != nil { 10714 return err 10715 } 10716 pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties 10717 } 10718 case "id": 10719 if v != nil { 10720 var ID string 10721 err = json.Unmarshal(*v, &ID) 10722 if err != nil { 10723 return err 10724 } 10725 pec.ID = &ID 10726 } 10727 case "name": 10728 if v != nil { 10729 var name string 10730 err = json.Unmarshal(*v, &name) 10731 if err != nil { 10732 return err 10733 } 10734 pec.Name = &name 10735 } 10736 case "type": 10737 if v != nil { 10738 var typeVar string 10739 err = json.Unmarshal(*v, &typeVar) 10740 if err != nil { 10741 return err 10742 } 10743 pec.Type = &typeVar 10744 } 10745 } 10746 } 10747 10748 return nil 10749} 10750 10751// PrivateEndpointConnectionListResult a list of private link resources 10752type PrivateEndpointConnectionListResult struct { 10753 autorest.Response `json:"-"` 10754 // Value - Array of private endpoint connections 10755 Value *[]PrivateEndpointConnection `json:"value,omitempty"` 10756 // NextLink - The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the next page of snapshots. 10757 NextLink *string `json:"nextLink,omitempty"` 10758} 10759 10760// PrivateEndpointConnectionListResultIterator provides access to a complete listing of 10761// PrivateEndpointConnection values. 10762type PrivateEndpointConnectionListResultIterator struct { 10763 i int 10764 page PrivateEndpointConnectionListResultPage 10765} 10766 10767// NextWithContext advances to the next value. If there was an error making 10768// the request the iterator does not advance and the error is returned. 10769func (iter *PrivateEndpointConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) { 10770 if tracing.IsEnabled() { 10771 ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultIterator.NextWithContext") 10772 defer func() { 10773 sc := -1 10774 if iter.Response().Response.Response != nil { 10775 sc = iter.Response().Response.Response.StatusCode 10776 } 10777 tracing.EndSpan(ctx, sc, err) 10778 }() 10779 } 10780 iter.i++ 10781 if iter.i < len(iter.page.Values()) { 10782 return nil 10783 } 10784 err = iter.page.NextWithContext(ctx) 10785 if err != nil { 10786 iter.i-- 10787 return err 10788 } 10789 iter.i = 0 10790 return nil 10791} 10792 10793// Next advances to the next value. If there was an error making 10794// the request the iterator does not advance and the error is returned. 10795// Deprecated: Use NextWithContext() instead. 10796func (iter *PrivateEndpointConnectionListResultIterator) Next() error { 10797 return iter.NextWithContext(context.Background()) 10798} 10799 10800// NotDone returns true if the enumeration should be started or is not yet complete. 10801func (iter PrivateEndpointConnectionListResultIterator) NotDone() bool { 10802 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10803} 10804 10805// Response returns the raw server response from the last page request. 10806func (iter PrivateEndpointConnectionListResultIterator) Response() PrivateEndpointConnectionListResult { 10807 return iter.page.Response() 10808} 10809 10810// Value returns the current value or a zero-initialized value if the 10811// iterator has advanced beyond the end of the collection. 10812func (iter PrivateEndpointConnectionListResultIterator) Value() PrivateEndpointConnection { 10813 if !iter.page.NotDone() { 10814 return PrivateEndpointConnection{} 10815 } 10816 return iter.page.Values()[iter.i] 10817} 10818 10819// Creates a new instance of the PrivateEndpointConnectionListResultIterator type. 10820func NewPrivateEndpointConnectionListResultIterator(page PrivateEndpointConnectionListResultPage) PrivateEndpointConnectionListResultIterator { 10821 return PrivateEndpointConnectionListResultIterator{page: page} 10822} 10823 10824// IsEmpty returns true if the ListResult contains no values. 10825func (peclr PrivateEndpointConnectionListResult) IsEmpty() bool { 10826 return peclr.Value == nil || len(*peclr.Value) == 0 10827} 10828 10829// hasNextLink returns true if the NextLink is not empty. 10830func (peclr PrivateEndpointConnectionListResult) hasNextLink() bool { 10831 return peclr.NextLink != nil && len(*peclr.NextLink) != 0 10832} 10833 10834// privateEndpointConnectionListResultPreparer prepares a request to retrieve the next set of results. 10835// It returns nil if no more results exist. 10836func (peclr PrivateEndpointConnectionListResult) privateEndpointConnectionListResultPreparer(ctx context.Context) (*http.Request, error) { 10837 if !peclr.hasNextLink() { 10838 return nil, nil 10839 } 10840 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10841 autorest.AsJSON(), 10842 autorest.AsGet(), 10843 autorest.WithBaseURL(to.String(peclr.NextLink))) 10844} 10845 10846// PrivateEndpointConnectionListResultPage contains a page of PrivateEndpointConnection values. 10847type PrivateEndpointConnectionListResultPage struct { 10848 fn func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error) 10849 peclr PrivateEndpointConnectionListResult 10850} 10851 10852// NextWithContext advances to the next page of values. If there was an error making 10853// the request the page does not advance and the error is returned. 10854func (page *PrivateEndpointConnectionListResultPage) NextWithContext(ctx context.Context) (err error) { 10855 if tracing.IsEnabled() { 10856 ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultPage.NextWithContext") 10857 defer func() { 10858 sc := -1 10859 if page.Response().Response.Response != nil { 10860 sc = page.Response().Response.Response.StatusCode 10861 } 10862 tracing.EndSpan(ctx, sc, err) 10863 }() 10864 } 10865 for { 10866 next, err := page.fn(ctx, page.peclr) 10867 if err != nil { 10868 return err 10869 } 10870 page.peclr = next 10871 if !next.hasNextLink() || !next.IsEmpty() { 10872 break 10873 } 10874 } 10875 return nil 10876} 10877 10878// Next advances to the next page of values. If there was an error making 10879// the request the page does not advance and the error is returned. 10880// Deprecated: Use NextWithContext() instead. 10881func (page *PrivateEndpointConnectionListResultPage) Next() error { 10882 return page.NextWithContext(context.Background()) 10883} 10884 10885// NotDone returns true if the page enumeration should be started or is not yet complete. 10886func (page PrivateEndpointConnectionListResultPage) NotDone() bool { 10887 return !page.peclr.IsEmpty() 10888} 10889 10890// Response returns the raw server response from the last page request. 10891func (page PrivateEndpointConnectionListResultPage) Response() PrivateEndpointConnectionListResult { 10892 return page.peclr 10893} 10894 10895// Values returns the slice of values for the current page or nil if there are no values. 10896func (page PrivateEndpointConnectionListResultPage) Values() []PrivateEndpointConnection { 10897 if page.peclr.IsEmpty() { 10898 return nil 10899 } 10900 return *page.peclr.Value 10901} 10902 10903// Creates a new instance of the PrivateEndpointConnectionListResultPage type. 10904func NewPrivateEndpointConnectionListResultPage(cur PrivateEndpointConnectionListResult, getNextPage func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error)) PrivateEndpointConnectionListResultPage { 10905 return PrivateEndpointConnectionListResultPage{ 10906 fn: getNextPage, 10907 peclr: cur, 10908 } 10909} 10910 10911// PrivateEndpointConnectionProperties properties of the PrivateEndpointConnectProperties. 10912type PrivateEndpointConnectionProperties struct { 10913 // PrivateEndpoint - READ-ONLY; The resource of private end point. 10914 PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` 10915 // PrivateLinkServiceConnectionState - A collection of information about the state of the connection between DiskAccess and Virtual Network. 10916 PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` 10917 // ProvisioningState - The provisioning state of the private endpoint connection resource. Possible values include: 'PrivateEndpointConnectionProvisioningStateSucceeded', 'PrivateEndpointConnectionProvisioningStateCreating', 'PrivateEndpointConnectionProvisioningStateDeleting', 'PrivateEndpointConnectionProvisioningStateFailed' 10918 ProvisioningState PrivateEndpointConnectionProvisioningState `json:"provisioningState,omitempty"` 10919} 10920 10921// MarshalJSON is the custom marshaler for PrivateEndpointConnectionProperties. 10922func (pecp PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { 10923 objectMap := make(map[string]interface{}) 10924 if pecp.PrivateLinkServiceConnectionState != nil { 10925 objectMap["privateLinkServiceConnectionState"] = pecp.PrivateLinkServiceConnectionState 10926 } 10927 if pecp.ProvisioningState != "" { 10928 objectMap["provisioningState"] = pecp.ProvisioningState 10929 } 10930 return json.Marshal(objectMap) 10931} 10932 10933// PrivateLinkResource a private link resource 10934type PrivateLinkResource struct { 10935 // PrivateLinkResourceProperties - Resource properties. 10936 *PrivateLinkResourceProperties `json:"properties,omitempty"` 10937 // ID - READ-ONLY; private link resource Id 10938 ID *string `json:"id,omitempty"` 10939 // Name - READ-ONLY; private link resource name 10940 Name *string `json:"name,omitempty"` 10941 // Type - READ-ONLY; private link resource type 10942 Type *string `json:"type,omitempty"` 10943} 10944 10945// MarshalJSON is the custom marshaler for PrivateLinkResource. 10946func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) { 10947 objectMap := make(map[string]interface{}) 10948 if plr.PrivateLinkResourceProperties != nil { 10949 objectMap["properties"] = plr.PrivateLinkResourceProperties 10950 } 10951 return json.Marshal(objectMap) 10952} 10953 10954// UnmarshalJSON is the custom unmarshaler for PrivateLinkResource struct. 10955func (plr *PrivateLinkResource) UnmarshalJSON(body []byte) error { 10956 var m map[string]*json.RawMessage 10957 err := json.Unmarshal(body, &m) 10958 if err != nil { 10959 return err 10960 } 10961 for k, v := range m { 10962 switch k { 10963 case "properties": 10964 if v != nil { 10965 var privateLinkResourceProperties PrivateLinkResourceProperties 10966 err = json.Unmarshal(*v, &privateLinkResourceProperties) 10967 if err != nil { 10968 return err 10969 } 10970 plr.PrivateLinkResourceProperties = &privateLinkResourceProperties 10971 } 10972 case "id": 10973 if v != nil { 10974 var ID string 10975 err = json.Unmarshal(*v, &ID) 10976 if err != nil { 10977 return err 10978 } 10979 plr.ID = &ID 10980 } 10981 case "name": 10982 if v != nil { 10983 var name string 10984 err = json.Unmarshal(*v, &name) 10985 if err != nil { 10986 return err 10987 } 10988 plr.Name = &name 10989 } 10990 case "type": 10991 if v != nil { 10992 var typeVar string 10993 err = json.Unmarshal(*v, &typeVar) 10994 if err != nil { 10995 return err 10996 } 10997 plr.Type = &typeVar 10998 } 10999 } 11000 } 11001 11002 return nil 11003} 11004 11005// PrivateLinkResourceListResult a list of private link resources 11006type PrivateLinkResourceListResult struct { 11007 autorest.Response `json:"-"` 11008 // Value - Array of private link resources 11009 Value *[]PrivateLinkResource `json:"value,omitempty"` 11010} 11011 11012// PrivateLinkResourceProperties properties of a private link resource. 11013type PrivateLinkResourceProperties struct { 11014 // GroupID - READ-ONLY; The private link resource group id. 11015 GroupID *string `json:"groupId,omitempty"` 11016 // RequiredMembers - READ-ONLY; The private link resource required member names. 11017 RequiredMembers *[]string `json:"requiredMembers,omitempty"` 11018 // RequiredZoneNames - The private link resource DNS zone name. 11019 RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` 11020} 11021 11022// MarshalJSON is the custom marshaler for PrivateLinkResourceProperties. 11023func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { 11024 objectMap := make(map[string]interface{}) 11025 if plrp.RequiredZoneNames != nil { 11026 objectMap["requiredZoneNames"] = plrp.RequiredZoneNames 11027 } 11028 return json.Marshal(objectMap) 11029} 11030 11031// PrivateLinkServiceConnectionState a collection of information about the state of the connection between 11032// service consumer and provider. 11033type PrivateLinkServiceConnectionState struct { 11034 // Status - Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: 'PrivateEndpointServiceConnectionStatusPending', 'PrivateEndpointServiceConnectionStatusApproved', 'PrivateEndpointServiceConnectionStatusRejected' 11035 Status PrivateEndpointServiceConnectionStatus `json:"status,omitempty"` 11036 // Description - The reason for approval/rejection of the connection. 11037 Description *string `json:"description,omitempty"` 11038 // ActionsRequired - A message indicating if changes on the service provider require any updates on the consumer. 11039 ActionsRequired *string `json:"actionsRequired,omitempty"` 11040} 11041 11042// PropertyUpdatesInProgress properties of the disk for which update is pending. 11043type PropertyUpdatesInProgress struct { 11044 // TargetTier - The target performance tier of the disk if a tier change operation is in progress. 11045 TargetTier *string `json:"targetTier,omitempty"` 11046} 11047 11048// ProximityPlacementGroup specifies information about the proximity placement group. 11049type ProximityPlacementGroup struct { 11050 autorest.Response `json:"-"` 11051 // ProximityPlacementGroupProperties - Describes the properties of a Proximity Placement Group. 11052 *ProximityPlacementGroupProperties `json:"properties,omitempty"` 11053 // ID - READ-ONLY; Resource Id 11054 ID *string `json:"id,omitempty"` 11055 // Name - READ-ONLY; Resource name 11056 Name *string `json:"name,omitempty"` 11057 // Type - READ-ONLY; Resource type 11058 Type *string `json:"type,omitempty"` 11059 // Location - Resource location 11060 Location *string `json:"location,omitempty"` 11061 // Tags - Resource tags 11062 Tags map[string]*string `json:"tags"` 11063} 11064 11065// MarshalJSON is the custom marshaler for ProximityPlacementGroup. 11066func (ppg ProximityPlacementGroup) MarshalJSON() ([]byte, error) { 11067 objectMap := make(map[string]interface{}) 11068 if ppg.ProximityPlacementGroupProperties != nil { 11069 objectMap["properties"] = ppg.ProximityPlacementGroupProperties 11070 } 11071 if ppg.Location != nil { 11072 objectMap["location"] = ppg.Location 11073 } 11074 if ppg.Tags != nil { 11075 objectMap["tags"] = ppg.Tags 11076 } 11077 return json.Marshal(objectMap) 11078} 11079 11080// UnmarshalJSON is the custom unmarshaler for ProximityPlacementGroup struct. 11081func (ppg *ProximityPlacementGroup) UnmarshalJSON(body []byte) error { 11082 var m map[string]*json.RawMessage 11083 err := json.Unmarshal(body, &m) 11084 if err != nil { 11085 return err 11086 } 11087 for k, v := range m { 11088 switch k { 11089 case "properties": 11090 if v != nil { 11091 var proximityPlacementGroupProperties ProximityPlacementGroupProperties 11092 err = json.Unmarshal(*v, &proximityPlacementGroupProperties) 11093 if err != nil { 11094 return err 11095 } 11096 ppg.ProximityPlacementGroupProperties = &proximityPlacementGroupProperties 11097 } 11098 case "id": 11099 if v != nil { 11100 var ID string 11101 err = json.Unmarshal(*v, &ID) 11102 if err != nil { 11103 return err 11104 } 11105 ppg.ID = &ID 11106 } 11107 case "name": 11108 if v != nil { 11109 var name string 11110 err = json.Unmarshal(*v, &name) 11111 if err != nil { 11112 return err 11113 } 11114 ppg.Name = &name 11115 } 11116 case "type": 11117 if v != nil { 11118 var typeVar string 11119 err = json.Unmarshal(*v, &typeVar) 11120 if err != nil { 11121 return err 11122 } 11123 ppg.Type = &typeVar 11124 } 11125 case "location": 11126 if v != nil { 11127 var location string 11128 err = json.Unmarshal(*v, &location) 11129 if err != nil { 11130 return err 11131 } 11132 ppg.Location = &location 11133 } 11134 case "tags": 11135 if v != nil { 11136 var tags map[string]*string 11137 err = json.Unmarshal(*v, &tags) 11138 if err != nil { 11139 return err 11140 } 11141 ppg.Tags = tags 11142 } 11143 } 11144 } 11145 11146 return nil 11147} 11148 11149// ProximityPlacementGroupListResult the List Proximity Placement Group operation response. 11150type ProximityPlacementGroupListResult struct { 11151 autorest.Response `json:"-"` 11152 // Value - The list of proximity placement groups 11153 Value *[]ProximityPlacementGroup `json:"value,omitempty"` 11154 // NextLink - The URI to fetch the next page of proximity placement groups. 11155 NextLink *string `json:"nextLink,omitempty"` 11156} 11157 11158// ProximityPlacementGroupListResultIterator provides access to a complete listing of 11159// ProximityPlacementGroup values. 11160type ProximityPlacementGroupListResultIterator struct { 11161 i int 11162 page ProximityPlacementGroupListResultPage 11163} 11164 11165// NextWithContext advances to the next value. If there was an error making 11166// the request the iterator does not advance and the error is returned. 11167func (iter *ProximityPlacementGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { 11168 if tracing.IsEnabled() { 11169 ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupListResultIterator.NextWithContext") 11170 defer func() { 11171 sc := -1 11172 if iter.Response().Response.Response != nil { 11173 sc = iter.Response().Response.Response.StatusCode 11174 } 11175 tracing.EndSpan(ctx, sc, err) 11176 }() 11177 } 11178 iter.i++ 11179 if iter.i < len(iter.page.Values()) { 11180 return nil 11181 } 11182 err = iter.page.NextWithContext(ctx) 11183 if err != nil { 11184 iter.i-- 11185 return err 11186 } 11187 iter.i = 0 11188 return nil 11189} 11190 11191// Next advances to the next value. If there was an error making 11192// the request the iterator does not advance and the error is returned. 11193// Deprecated: Use NextWithContext() instead. 11194func (iter *ProximityPlacementGroupListResultIterator) Next() error { 11195 return iter.NextWithContext(context.Background()) 11196} 11197 11198// NotDone returns true if the enumeration should be started or is not yet complete. 11199func (iter ProximityPlacementGroupListResultIterator) NotDone() bool { 11200 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11201} 11202 11203// Response returns the raw server response from the last page request. 11204func (iter ProximityPlacementGroupListResultIterator) Response() ProximityPlacementGroupListResult { 11205 return iter.page.Response() 11206} 11207 11208// Value returns the current value or a zero-initialized value if the 11209// iterator has advanced beyond the end of the collection. 11210func (iter ProximityPlacementGroupListResultIterator) Value() ProximityPlacementGroup { 11211 if !iter.page.NotDone() { 11212 return ProximityPlacementGroup{} 11213 } 11214 return iter.page.Values()[iter.i] 11215} 11216 11217// Creates a new instance of the ProximityPlacementGroupListResultIterator type. 11218func NewProximityPlacementGroupListResultIterator(page ProximityPlacementGroupListResultPage) ProximityPlacementGroupListResultIterator { 11219 return ProximityPlacementGroupListResultIterator{page: page} 11220} 11221 11222// IsEmpty returns true if the ListResult contains no values. 11223func (ppglr ProximityPlacementGroupListResult) IsEmpty() bool { 11224 return ppglr.Value == nil || len(*ppglr.Value) == 0 11225} 11226 11227// hasNextLink returns true if the NextLink is not empty. 11228func (ppglr ProximityPlacementGroupListResult) hasNextLink() bool { 11229 return ppglr.NextLink != nil && len(*ppglr.NextLink) != 0 11230} 11231 11232// proximityPlacementGroupListResultPreparer prepares a request to retrieve the next set of results. 11233// It returns nil if no more results exist. 11234func (ppglr ProximityPlacementGroupListResult) proximityPlacementGroupListResultPreparer(ctx context.Context) (*http.Request, error) { 11235 if !ppglr.hasNextLink() { 11236 return nil, nil 11237 } 11238 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11239 autorest.AsJSON(), 11240 autorest.AsGet(), 11241 autorest.WithBaseURL(to.String(ppglr.NextLink))) 11242} 11243 11244// ProximityPlacementGroupListResultPage contains a page of ProximityPlacementGroup values. 11245type ProximityPlacementGroupListResultPage struct { 11246 fn func(context.Context, ProximityPlacementGroupListResult) (ProximityPlacementGroupListResult, error) 11247 ppglr ProximityPlacementGroupListResult 11248} 11249 11250// NextWithContext advances to the next page of values. If there was an error making 11251// the request the page does not advance and the error is returned. 11252func (page *ProximityPlacementGroupListResultPage) NextWithContext(ctx context.Context) (err error) { 11253 if tracing.IsEnabled() { 11254 ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupListResultPage.NextWithContext") 11255 defer func() { 11256 sc := -1 11257 if page.Response().Response.Response != nil { 11258 sc = page.Response().Response.Response.StatusCode 11259 } 11260 tracing.EndSpan(ctx, sc, err) 11261 }() 11262 } 11263 for { 11264 next, err := page.fn(ctx, page.ppglr) 11265 if err != nil { 11266 return err 11267 } 11268 page.ppglr = next 11269 if !next.hasNextLink() || !next.IsEmpty() { 11270 break 11271 } 11272 } 11273 return nil 11274} 11275 11276// Next advances to the next page of values. If there was an error making 11277// the request the page does not advance and the error is returned. 11278// Deprecated: Use NextWithContext() instead. 11279func (page *ProximityPlacementGroupListResultPage) Next() error { 11280 return page.NextWithContext(context.Background()) 11281} 11282 11283// NotDone returns true if the page enumeration should be started or is not yet complete. 11284func (page ProximityPlacementGroupListResultPage) NotDone() bool { 11285 return !page.ppglr.IsEmpty() 11286} 11287 11288// Response returns the raw server response from the last page request. 11289func (page ProximityPlacementGroupListResultPage) Response() ProximityPlacementGroupListResult { 11290 return page.ppglr 11291} 11292 11293// Values returns the slice of values for the current page or nil if there are no values. 11294func (page ProximityPlacementGroupListResultPage) Values() []ProximityPlacementGroup { 11295 if page.ppglr.IsEmpty() { 11296 return nil 11297 } 11298 return *page.ppglr.Value 11299} 11300 11301// Creates a new instance of the ProximityPlacementGroupListResultPage type. 11302func NewProximityPlacementGroupListResultPage(cur ProximityPlacementGroupListResult, getNextPage func(context.Context, ProximityPlacementGroupListResult) (ProximityPlacementGroupListResult, error)) ProximityPlacementGroupListResultPage { 11303 return ProximityPlacementGroupListResultPage{ 11304 fn: getNextPage, 11305 ppglr: cur, 11306 } 11307} 11308 11309// ProximityPlacementGroupProperties describes the properties of a Proximity Placement Group. 11310type ProximityPlacementGroupProperties struct { 11311 // 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' 11312 ProximityPlacementGroupType ProximityPlacementGroupType `json:"proximityPlacementGroupType,omitempty"` 11313 // VirtualMachines - READ-ONLY; A list of references to all virtual machines in the proximity placement group. 11314 VirtualMachines *[]SubResourceWithColocationStatus `json:"virtualMachines,omitempty"` 11315 // VirtualMachineScaleSets - READ-ONLY; A list of references to all virtual machine scale sets in the proximity placement group. 11316 VirtualMachineScaleSets *[]SubResourceWithColocationStatus `json:"virtualMachineScaleSets,omitempty"` 11317 // AvailabilitySets - READ-ONLY; A list of references to all availability sets in the proximity placement group. 11318 AvailabilitySets *[]SubResourceWithColocationStatus `json:"availabilitySets,omitempty"` 11319 // ColocationStatus - Describes colocation status of the Proximity Placement Group. 11320 ColocationStatus *InstanceViewStatus `json:"colocationStatus,omitempty"` 11321} 11322 11323// MarshalJSON is the custom marshaler for ProximityPlacementGroupProperties. 11324func (ppgp ProximityPlacementGroupProperties) MarshalJSON() ([]byte, error) { 11325 objectMap := make(map[string]interface{}) 11326 if ppgp.ProximityPlacementGroupType != "" { 11327 objectMap["proximityPlacementGroupType"] = ppgp.ProximityPlacementGroupType 11328 } 11329 if ppgp.ColocationStatus != nil { 11330 objectMap["colocationStatus"] = ppgp.ColocationStatus 11331 } 11332 return json.Marshal(objectMap) 11333} 11334 11335// ProximityPlacementGroupUpdate specifies information about the proximity placement group. 11336type ProximityPlacementGroupUpdate struct { 11337 // Tags - Resource tags 11338 Tags map[string]*string `json:"tags"` 11339} 11340 11341// MarshalJSON is the custom marshaler for ProximityPlacementGroupUpdate. 11342func (ppgu ProximityPlacementGroupUpdate) MarshalJSON() ([]byte, error) { 11343 objectMap := make(map[string]interface{}) 11344 if ppgu.Tags != nil { 11345 objectMap["tags"] = ppgu.Tags 11346 } 11347 return json.Marshal(objectMap) 11348} 11349 11350// ProxyOnlyResource the ProxyOnly Resource model definition. 11351type ProxyOnlyResource struct { 11352 // ID - READ-ONLY; Resource Id 11353 ID *string `json:"id,omitempty"` 11354 // Name - READ-ONLY; Resource name 11355 Name *string `json:"name,omitempty"` 11356 // Type - READ-ONLY; Resource type 11357 Type *string `json:"type,omitempty"` 11358} 11359 11360// MarshalJSON is the custom marshaler for ProxyOnlyResource. 11361func (por ProxyOnlyResource) MarshalJSON() ([]byte, error) { 11362 objectMap := make(map[string]interface{}) 11363 return json.Marshal(objectMap) 11364} 11365 11366// ProxyResource the resource model definition for an Azure Resource Manager proxy resource. It will not 11367// have tags and a location 11368type ProxyResource struct { 11369 // ID - READ-ONLY; Resource Id 11370 ID *string `json:"id,omitempty"` 11371 // Name - READ-ONLY; Resource name 11372 Name *string `json:"name,omitempty"` 11373 // Type - READ-ONLY; Resource type 11374 Type *string `json:"type,omitempty"` 11375} 11376 11377// MarshalJSON is the custom marshaler for ProxyResource. 11378func (pr ProxyResource) MarshalJSON() ([]byte, error) { 11379 objectMap := make(map[string]interface{}) 11380 return json.Marshal(objectMap) 11381} 11382 11383// PublicIPAddressSku describes the public IP Sku 11384type PublicIPAddressSku struct { 11385 // Name - Specify public IP sku name. Possible values include: 'PublicIPAddressSkuNameBasic', 'PublicIPAddressSkuNameStandard' 11386 Name PublicIPAddressSkuName `json:"name,omitempty"` 11387 // Tier - Specify public IP sku tier. Possible values include: 'PublicIPAddressSkuTierRegional', 'PublicIPAddressSkuTierGlobal' 11388 Tier PublicIPAddressSkuTier `json:"tier,omitempty"` 11389} 11390 11391// PurchasePlan used for establishing the purchase context of any 3rd Party artifact through MarketPlace. 11392type PurchasePlan struct { 11393 // Publisher - The publisher ID. 11394 Publisher *string `json:"publisher,omitempty"` 11395 // Name - The plan ID. 11396 Name *string `json:"name,omitempty"` 11397 // Product - Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. 11398 Product *string `json:"product,omitempty"` 11399 // PromotionCode - The Offer Promotion Code. 11400 PromotionCode *string `json:"promotionCode,omitempty"` 11401} 11402 11403// ReadCloser ... 11404type ReadCloser struct { 11405 autorest.Response `json:"-"` 11406 Value *io.ReadCloser `json:"value,omitempty"` 11407} 11408 11409// RecommendedMachineConfiguration the properties describe the recommended machine configuration for this 11410// Image Definition. These properties are updatable. 11411type RecommendedMachineConfiguration struct { 11412 VCPUs *ResourceRange `json:"vCPUs,omitempty"` 11413 Memory *ResourceRange `json:"memory,omitempty"` 11414} 11415 11416// RecoveryWalkResponse response after calling a manual recovery walk 11417type RecoveryWalkResponse struct { 11418 autorest.Response `json:"-"` 11419 // WalkPerformed - READ-ONLY; Whether the recovery walk was performed 11420 WalkPerformed *bool `json:"walkPerformed,omitempty"` 11421 // NextPlatformUpdateDomain - READ-ONLY; The next update domain that needs to be walked. Null means walk spanning all update domains has been completed 11422 NextPlatformUpdateDomain *int32 `json:"nextPlatformUpdateDomain,omitempty"` 11423} 11424 11425// MarshalJSON is the custom marshaler for RecoveryWalkResponse. 11426func (rwr RecoveryWalkResponse) MarshalJSON() ([]byte, error) { 11427 objectMap := make(map[string]interface{}) 11428 return json.Marshal(objectMap) 11429} 11430 11431// RegionalReplicationStatus this is the regional replication status. 11432type RegionalReplicationStatus struct { 11433 // Region - READ-ONLY; The region to which the gallery image version is being replicated to. 11434 Region *string `json:"region,omitempty"` 11435 // State - READ-ONLY; This is the regional replication state. Possible values include: 'ReplicationStateUnknown', 'ReplicationStateReplicating', 'ReplicationStateCompleted', 'ReplicationStateFailed' 11436 State ReplicationState `json:"state,omitempty"` 11437 // Details - READ-ONLY; The details of the replication status. 11438 Details *string `json:"details,omitempty"` 11439 // Progress - READ-ONLY; It indicates progress of the replication job. 11440 Progress *int32 `json:"progress,omitempty"` 11441} 11442 11443// MarshalJSON is the custom marshaler for RegionalReplicationStatus. 11444func (rrs RegionalReplicationStatus) MarshalJSON() ([]byte, error) { 11445 objectMap := make(map[string]interface{}) 11446 return json.Marshal(objectMap) 11447} 11448 11449// ReplicationStatus this is the replication status of the gallery image version. 11450type ReplicationStatus struct { 11451 // AggregatedState - READ-ONLY; This is the aggregated replication status based on all the regional replication status flags. Possible values include: 'AggregatedReplicationStateUnknown', 'AggregatedReplicationStateInProgress', 'AggregatedReplicationStateCompleted', 'AggregatedReplicationStateFailed' 11452 AggregatedState AggregatedReplicationState `json:"aggregatedState,omitempty"` 11453 // Summary - READ-ONLY; This is a summary of replication status for each region. 11454 Summary *[]RegionalReplicationStatus `json:"summary,omitempty"` 11455} 11456 11457// MarshalJSON is the custom marshaler for ReplicationStatus. 11458func (rs ReplicationStatus) MarshalJSON() ([]byte, error) { 11459 objectMap := make(map[string]interface{}) 11460 return json.Marshal(objectMap) 11461} 11462 11463// RequestRateByIntervalInput api request input for LogAnalytics getRequestRateByInterval Api. 11464type RequestRateByIntervalInput struct { 11465 // IntervalLength - Interval value in minutes used to create LogAnalytics call rate logs. Possible values include: 'IntervalInMinsThreeMins', 'IntervalInMinsFiveMins', 'IntervalInMinsThirtyMins', 'IntervalInMinsSixtyMins' 11466 IntervalLength IntervalInMins `json:"intervalLength,omitempty"` 11467 // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. 11468 BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` 11469 // FromTime - From time of the query 11470 FromTime *date.Time `json:"fromTime,omitempty"` 11471 // ToTime - To time of the query 11472 ToTime *date.Time `json:"toTime,omitempty"` 11473 // GroupByThrottlePolicy - Group query result by Throttle Policy applied. 11474 GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` 11475 // GroupByOperationName - Group query result by Operation Name. 11476 GroupByOperationName *bool `json:"groupByOperationName,omitempty"` 11477 // GroupByResourceName - Group query result by Resource Name. 11478 GroupByResourceName *bool `json:"groupByResourceName,omitempty"` 11479 // GroupByClientApplicationID - Group query result by Client Application ID. 11480 GroupByClientApplicationID *bool `json:"groupByClientApplicationId,omitempty"` 11481 // GroupByUserAgent - Group query result by User Agent. 11482 GroupByUserAgent *bool `json:"groupByUserAgent,omitempty"` 11483} 11484 11485// Resource the Resource model definition. 11486type Resource struct { 11487 // ID - READ-ONLY; Resource Id 11488 ID *string `json:"id,omitempty"` 11489 // Name - READ-ONLY; Resource name 11490 Name *string `json:"name,omitempty"` 11491 // Type - READ-ONLY; Resource type 11492 Type *string `json:"type,omitempty"` 11493 // Location - Resource location 11494 Location *string `json:"location,omitempty"` 11495 // Tags - Resource tags 11496 Tags map[string]*string `json:"tags"` 11497} 11498 11499// MarshalJSON is the custom marshaler for Resource. 11500func (r Resource) MarshalJSON() ([]byte, error) { 11501 objectMap := make(map[string]interface{}) 11502 if r.Location != nil { 11503 objectMap["location"] = r.Location 11504 } 11505 if r.Tags != nil { 11506 objectMap["tags"] = r.Tags 11507 } 11508 return json.Marshal(objectMap) 11509} 11510 11511// ResourceInstanceViewStatus instance view status. 11512type ResourceInstanceViewStatus struct { 11513 // Code - READ-ONLY; The status code. 11514 Code *string `json:"code,omitempty"` 11515 // DisplayStatus - READ-ONLY; The short localizable label for the status. 11516 DisplayStatus *string `json:"displayStatus,omitempty"` 11517 // Message - READ-ONLY; The detailed status message, including for alerts and error messages. 11518 Message *string `json:"message,omitempty"` 11519 // Time - READ-ONLY; The time of the status. 11520 Time *date.Time `json:"time,omitempty"` 11521 // Level - The level code. Possible values include: 'StatusLevelTypesInfo', 'StatusLevelTypesWarning', 'StatusLevelTypesError' 11522 Level StatusLevelTypes `json:"level,omitempty"` 11523} 11524 11525// MarshalJSON is the custom marshaler for ResourceInstanceViewStatus. 11526func (rivs ResourceInstanceViewStatus) MarshalJSON() ([]byte, error) { 11527 objectMap := make(map[string]interface{}) 11528 if rivs.Level != "" { 11529 objectMap["level"] = rivs.Level 11530 } 11531 return json.Marshal(objectMap) 11532} 11533 11534// ResourceRange describes the resource range. 11535type ResourceRange struct { 11536 // Min - The minimum number of the resource. 11537 Min *int32 `json:"min,omitempty"` 11538 // Max - The maximum number of the resource. 11539 Max *int32 `json:"max,omitempty"` 11540} 11541 11542// ResourceSku describes an available Compute SKU. 11543type ResourceSku struct { 11544 // ResourceType - READ-ONLY; The type of resource the SKU applies to. 11545 ResourceType *string `json:"resourceType,omitempty"` 11546 // Name - READ-ONLY; The name of SKU. 11547 Name *string `json:"name,omitempty"` 11548 // Tier - READ-ONLY; Specifies the tier of virtual machines in a scale set.<br /><br /> Possible Values:<br /><br /> **Standard**<br /><br /> **Basic** 11549 Tier *string `json:"tier,omitempty"` 11550 // Size - READ-ONLY; The Size of the SKU. 11551 Size *string `json:"size,omitempty"` 11552 // Family - READ-ONLY; The Family of this particular SKU. 11553 Family *string `json:"family,omitempty"` 11554 // Kind - READ-ONLY; The Kind of resources that are supported in this SKU. 11555 Kind *string `json:"kind,omitempty"` 11556 // Capacity - READ-ONLY; Specifies the number of virtual machines in the scale set. 11557 Capacity *ResourceSkuCapacity `json:"capacity,omitempty"` 11558 // Locations - READ-ONLY; The set of locations that the SKU is available. 11559 Locations *[]string `json:"locations,omitempty"` 11560 // LocationInfo - READ-ONLY; A list of locations and availability zones in those locations where the SKU is available. 11561 LocationInfo *[]ResourceSkuLocationInfo `json:"locationInfo,omitempty"` 11562 // APIVersions - READ-ONLY; The api versions that support this SKU. 11563 APIVersions *[]string `json:"apiVersions,omitempty"` 11564 // Costs - READ-ONLY; Metadata for retrieving price info. 11565 Costs *[]ResourceSkuCosts `json:"costs,omitempty"` 11566 // Capabilities - READ-ONLY; A name value pair to describe the capability. 11567 Capabilities *[]ResourceSkuCapabilities `json:"capabilities,omitempty"` 11568 // Restrictions - READ-ONLY; The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. 11569 Restrictions *[]ResourceSkuRestrictions `json:"restrictions,omitempty"` 11570} 11571 11572// MarshalJSON is the custom marshaler for ResourceSku. 11573func (rs ResourceSku) MarshalJSON() ([]byte, error) { 11574 objectMap := make(map[string]interface{}) 11575 return json.Marshal(objectMap) 11576} 11577 11578// ResourceSkuCapabilities describes The SKU capabilities object. 11579type ResourceSkuCapabilities struct { 11580 // Name - READ-ONLY; An invariant to describe the feature. 11581 Name *string `json:"name,omitempty"` 11582 // Value - READ-ONLY; An invariant if the feature is measured by quantity. 11583 Value *string `json:"value,omitempty"` 11584} 11585 11586// MarshalJSON is the custom marshaler for ResourceSkuCapabilities. 11587func (rsc ResourceSkuCapabilities) MarshalJSON() ([]byte, error) { 11588 objectMap := make(map[string]interface{}) 11589 return json.Marshal(objectMap) 11590} 11591 11592// ResourceSkuCapacity describes scaling information of a SKU. 11593type ResourceSkuCapacity struct { 11594 // Minimum - READ-ONLY; The minimum capacity. 11595 Minimum *int64 `json:"minimum,omitempty"` 11596 // Maximum - READ-ONLY; The maximum capacity that can be set. 11597 Maximum *int64 `json:"maximum,omitempty"` 11598 // Default - READ-ONLY; The default capacity. 11599 Default *int64 `json:"default,omitempty"` 11600 // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'ResourceSkuCapacityScaleTypeAutomatic', 'ResourceSkuCapacityScaleTypeManual', 'ResourceSkuCapacityScaleTypeNone' 11601 ScaleType ResourceSkuCapacityScaleType `json:"scaleType,omitempty"` 11602} 11603 11604// MarshalJSON is the custom marshaler for ResourceSkuCapacity. 11605func (rsc ResourceSkuCapacity) MarshalJSON() ([]byte, error) { 11606 objectMap := make(map[string]interface{}) 11607 return json.Marshal(objectMap) 11608} 11609 11610// ResourceSkuCosts describes metadata for retrieving price info. 11611type ResourceSkuCosts struct { 11612 // MeterID - READ-ONLY; Used for querying price from commerce. 11613 MeterID *string `json:"meterID,omitempty"` 11614 // Quantity - READ-ONLY; The multiplier is needed to extend the base metered cost. 11615 Quantity *int64 `json:"quantity,omitempty"` 11616 // ExtendedUnit - READ-ONLY; An invariant to show the extended unit. 11617 ExtendedUnit *string `json:"extendedUnit,omitempty"` 11618} 11619 11620// MarshalJSON is the custom marshaler for ResourceSkuCosts. 11621func (rsc ResourceSkuCosts) MarshalJSON() ([]byte, error) { 11622 objectMap := make(map[string]interface{}) 11623 return json.Marshal(objectMap) 11624} 11625 11626// ResourceSkuLocationInfo ... 11627type ResourceSkuLocationInfo struct { 11628 // Location - READ-ONLY; Location of the SKU 11629 Location *string `json:"location,omitempty"` 11630 // Zones - READ-ONLY; List of availability zones where the SKU is supported. 11631 Zones *[]string `json:"zones,omitempty"` 11632 // ZoneDetails - READ-ONLY; Details of capabilities available to a SKU in specific zones. 11633 ZoneDetails *[]ResourceSkuZoneDetails `json:"zoneDetails,omitempty"` 11634} 11635 11636// MarshalJSON is the custom marshaler for ResourceSkuLocationInfo. 11637func (rsli ResourceSkuLocationInfo) MarshalJSON() ([]byte, error) { 11638 objectMap := make(map[string]interface{}) 11639 return json.Marshal(objectMap) 11640} 11641 11642// ResourceSkuRestrictionInfo ... 11643type ResourceSkuRestrictionInfo struct { 11644 // Locations - READ-ONLY; Locations where the SKU is restricted 11645 Locations *[]string `json:"locations,omitempty"` 11646 // Zones - READ-ONLY; List of availability zones where the SKU is restricted. 11647 Zones *[]string `json:"zones,omitempty"` 11648} 11649 11650// MarshalJSON is the custom marshaler for ResourceSkuRestrictionInfo. 11651func (rsri ResourceSkuRestrictionInfo) MarshalJSON() ([]byte, error) { 11652 objectMap := make(map[string]interface{}) 11653 return json.Marshal(objectMap) 11654} 11655 11656// ResourceSkuRestrictions describes scaling information of a SKU. 11657type ResourceSkuRestrictions struct { 11658 // Type - READ-ONLY; The type of restrictions. Possible values include: 'ResourceSkuRestrictionsTypeLocation', 'ResourceSkuRestrictionsTypeZone' 11659 Type ResourceSkuRestrictionsType `json:"type,omitempty"` 11660 // 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. 11661 Values *[]string `json:"values,omitempty"` 11662 // RestrictionInfo - READ-ONLY; The information about the restriction where the SKU cannot be used. 11663 RestrictionInfo *ResourceSkuRestrictionInfo `json:"restrictionInfo,omitempty"` 11664 // ReasonCode - READ-ONLY; The reason for restriction. Possible values include: 'ResourceSkuRestrictionsReasonCodeQuotaID', 'ResourceSkuRestrictionsReasonCodeNotAvailableForSubscription' 11665 ReasonCode ResourceSkuRestrictionsReasonCode `json:"reasonCode,omitempty"` 11666} 11667 11668// MarshalJSON is the custom marshaler for ResourceSkuRestrictions. 11669func (rsr ResourceSkuRestrictions) MarshalJSON() ([]byte, error) { 11670 objectMap := make(map[string]interface{}) 11671 return json.Marshal(objectMap) 11672} 11673 11674// ResourceSkusResult the List Resource Skus operation response. 11675type ResourceSkusResult struct { 11676 autorest.Response `json:"-"` 11677 // Value - The list of skus available for the subscription. 11678 Value *[]ResourceSku `json:"value,omitempty"` 11679 // NextLink - The URI to fetch the next page of Resource Skus. Call ListNext() with this URI to fetch the next page of Resource Skus 11680 NextLink *string `json:"nextLink,omitempty"` 11681} 11682 11683// ResourceSkusResultIterator provides access to a complete listing of ResourceSku values. 11684type ResourceSkusResultIterator struct { 11685 i int 11686 page ResourceSkusResultPage 11687} 11688 11689// NextWithContext advances to the next value. If there was an error making 11690// the request the iterator does not advance and the error is returned. 11691func (iter *ResourceSkusResultIterator) NextWithContext(ctx context.Context) (err error) { 11692 if tracing.IsEnabled() { 11693 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusResultIterator.NextWithContext") 11694 defer func() { 11695 sc := -1 11696 if iter.Response().Response.Response != nil { 11697 sc = iter.Response().Response.Response.StatusCode 11698 } 11699 tracing.EndSpan(ctx, sc, err) 11700 }() 11701 } 11702 iter.i++ 11703 if iter.i < len(iter.page.Values()) { 11704 return nil 11705 } 11706 err = iter.page.NextWithContext(ctx) 11707 if err != nil { 11708 iter.i-- 11709 return err 11710 } 11711 iter.i = 0 11712 return nil 11713} 11714 11715// Next advances to the next value. If there was an error making 11716// the request the iterator does not advance and the error is returned. 11717// Deprecated: Use NextWithContext() instead. 11718func (iter *ResourceSkusResultIterator) Next() error { 11719 return iter.NextWithContext(context.Background()) 11720} 11721 11722// NotDone returns true if the enumeration should be started or is not yet complete. 11723func (iter ResourceSkusResultIterator) NotDone() bool { 11724 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11725} 11726 11727// Response returns the raw server response from the last page request. 11728func (iter ResourceSkusResultIterator) Response() ResourceSkusResult { 11729 return iter.page.Response() 11730} 11731 11732// Value returns the current value or a zero-initialized value if the 11733// iterator has advanced beyond the end of the collection. 11734func (iter ResourceSkusResultIterator) Value() ResourceSku { 11735 if !iter.page.NotDone() { 11736 return ResourceSku{} 11737 } 11738 return iter.page.Values()[iter.i] 11739} 11740 11741// Creates a new instance of the ResourceSkusResultIterator type. 11742func NewResourceSkusResultIterator(page ResourceSkusResultPage) ResourceSkusResultIterator { 11743 return ResourceSkusResultIterator{page: page} 11744} 11745 11746// IsEmpty returns true if the ListResult contains no values. 11747func (rsr ResourceSkusResult) IsEmpty() bool { 11748 return rsr.Value == nil || len(*rsr.Value) == 0 11749} 11750 11751// hasNextLink returns true if the NextLink is not empty. 11752func (rsr ResourceSkusResult) hasNextLink() bool { 11753 return rsr.NextLink != nil && len(*rsr.NextLink) != 0 11754} 11755 11756// resourceSkusResultPreparer prepares a request to retrieve the next set of results. 11757// It returns nil if no more results exist. 11758func (rsr ResourceSkusResult) resourceSkusResultPreparer(ctx context.Context) (*http.Request, error) { 11759 if !rsr.hasNextLink() { 11760 return nil, nil 11761 } 11762 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11763 autorest.AsJSON(), 11764 autorest.AsGet(), 11765 autorest.WithBaseURL(to.String(rsr.NextLink))) 11766} 11767 11768// ResourceSkusResultPage contains a page of ResourceSku values. 11769type ResourceSkusResultPage struct { 11770 fn func(context.Context, ResourceSkusResult) (ResourceSkusResult, error) 11771 rsr ResourceSkusResult 11772} 11773 11774// NextWithContext advances to the next page of values. If there was an error making 11775// the request the page does not advance and the error is returned. 11776func (page *ResourceSkusResultPage) NextWithContext(ctx context.Context) (err error) { 11777 if tracing.IsEnabled() { 11778 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusResultPage.NextWithContext") 11779 defer func() { 11780 sc := -1 11781 if page.Response().Response.Response != nil { 11782 sc = page.Response().Response.Response.StatusCode 11783 } 11784 tracing.EndSpan(ctx, sc, err) 11785 }() 11786 } 11787 for { 11788 next, err := page.fn(ctx, page.rsr) 11789 if err != nil { 11790 return err 11791 } 11792 page.rsr = next 11793 if !next.hasNextLink() || !next.IsEmpty() { 11794 break 11795 } 11796 } 11797 return nil 11798} 11799 11800// Next advances to the next page of values. If there was an error making 11801// the request the page does not advance and the error is returned. 11802// Deprecated: Use NextWithContext() instead. 11803func (page *ResourceSkusResultPage) Next() error { 11804 return page.NextWithContext(context.Background()) 11805} 11806 11807// NotDone returns true if the page enumeration should be started or is not yet complete. 11808func (page ResourceSkusResultPage) NotDone() bool { 11809 return !page.rsr.IsEmpty() 11810} 11811 11812// Response returns the raw server response from the last page request. 11813func (page ResourceSkusResultPage) Response() ResourceSkusResult { 11814 return page.rsr 11815} 11816 11817// Values returns the slice of values for the current page or nil if there are no values. 11818func (page ResourceSkusResultPage) Values() []ResourceSku { 11819 if page.rsr.IsEmpty() { 11820 return nil 11821 } 11822 return *page.rsr.Value 11823} 11824 11825// Creates a new instance of the ResourceSkusResultPage type. 11826func NewResourceSkusResultPage(cur ResourceSkusResult, getNextPage func(context.Context, ResourceSkusResult) (ResourceSkusResult, error)) ResourceSkusResultPage { 11827 return ResourceSkusResultPage{ 11828 fn: getNextPage, 11829 rsr: cur, 11830 } 11831} 11832 11833// ResourceSkuZoneDetails describes The zonal capabilities of a SKU. 11834type ResourceSkuZoneDetails struct { 11835 // Name - READ-ONLY; The set of zones that the SKU is available in with the specified capabilities. 11836 Name *[]string `json:"name,omitempty"` 11837 // Capabilities - READ-ONLY; A list of capabilities that are available for the SKU in the specified list of zones. 11838 Capabilities *[]ResourceSkuCapabilities `json:"capabilities,omitempty"` 11839} 11840 11841// MarshalJSON is the custom marshaler for ResourceSkuZoneDetails. 11842func (rszd ResourceSkuZoneDetails) MarshalJSON() ([]byte, error) { 11843 objectMap := make(map[string]interface{}) 11844 return json.Marshal(objectMap) 11845} 11846 11847// ResourceURIList the List resources which are encrypted with the disk encryption set. 11848type ResourceURIList struct { 11849 autorest.Response `json:"-"` 11850 // Value - A list of IDs or Owner IDs of resources which are encrypted with the disk encryption set. 11851 Value *[]string `json:"value,omitempty"` 11852 // NextLink - The uri to fetch the next page of encrypted resources. Call ListNext() with this to fetch the next page of encrypted resources. 11853 NextLink *string `json:"nextLink,omitempty"` 11854} 11855 11856// ResourceURIListIterator provides access to a complete listing of string values. 11857type ResourceURIListIterator struct { 11858 i int 11859 page ResourceURIListPage 11860} 11861 11862// NextWithContext advances to the next value. If there was an error making 11863// the request the iterator does not advance and the error is returned. 11864func (iter *ResourceURIListIterator) NextWithContext(ctx context.Context) (err error) { 11865 if tracing.IsEnabled() { 11866 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceURIListIterator.NextWithContext") 11867 defer func() { 11868 sc := -1 11869 if iter.Response().Response.Response != nil { 11870 sc = iter.Response().Response.Response.StatusCode 11871 } 11872 tracing.EndSpan(ctx, sc, err) 11873 }() 11874 } 11875 iter.i++ 11876 if iter.i < len(iter.page.Values()) { 11877 return nil 11878 } 11879 err = iter.page.NextWithContext(ctx) 11880 if err != nil { 11881 iter.i-- 11882 return err 11883 } 11884 iter.i = 0 11885 return nil 11886} 11887 11888// Next advances to the next value. If there was an error making 11889// the request the iterator does not advance and the error is returned. 11890// Deprecated: Use NextWithContext() instead. 11891func (iter *ResourceURIListIterator) Next() error { 11892 return iter.NextWithContext(context.Background()) 11893} 11894 11895// NotDone returns true if the enumeration should be started or is not yet complete. 11896func (iter ResourceURIListIterator) NotDone() bool { 11897 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11898} 11899 11900// Response returns the raw server response from the last page request. 11901func (iter ResourceURIListIterator) Response() ResourceURIList { 11902 return iter.page.Response() 11903} 11904 11905// Value returns the current value or a zero-initialized value if the 11906// iterator has advanced beyond the end of the collection. 11907func (iter ResourceURIListIterator) Value() string { 11908 if !iter.page.NotDone() { 11909 return "" 11910 } 11911 return iter.page.Values()[iter.i] 11912} 11913 11914// Creates a new instance of the ResourceURIListIterator type. 11915func NewResourceURIListIterator(page ResourceURIListPage) ResourceURIListIterator { 11916 return ResourceURIListIterator{page: page} 11917} 11918 11919// IsEmpty returns true if the ListResult contains no values. 11920func (rul ResourceURIList) IsEmpty() bool { 11921 return rul.Value == nil || len(*rul.Value) == 0 11922} 11923 11924// hasNextLink returns true if the NextLink is not empty. 11925func (rul ResourceURIList) hasNextLink() bool { 11926 return rul.NextLink != nil && len(*rul.NextLink) != 0 11927} 11928 11929// resourceURIListPreparer prepares a request to retrieve the next set of results. 11930// It returns nil if no more results exist. 11931func (rul ResourceURIList) resourceURIListPreparer(ctx context.Context) (*http.Request, error) { 11932 if !rul.hasNextLink() { 11933 return nil, nil 11934 } 11935 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11936 autorest.AsJSON(), 11937 autorest.AsGet(), 11938 autorest.WithBaseURL(to.String(rul.NextLink))) 11939} 11940 11941// ResourceURIListPage contains a page of string values. 11942type ResourceURIListPage struct { 11943 fn func(context.Context, ResourceURIList) (ResourceURIList, error) 11944 rul ResourceURIList 11945} 11946 11947// NextWithContext advances to the next page of values. If there was an error making 11948// the request the page does not advance and the error is returned. 11949func (page *ResourceURIListPage) NextWithContext(ctx context.Context) (err error) { 11950 if tracing.IsEnabled() { 11951 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceURIListPage.NextWithContext") 11952 defer func() { 11953 sc := -1 11954 if page.Response().Response.Response != nil { 11955 sc = page.Response().Response.Response.StatusCode 11956 } 11957 tracing.EndSpan(ctx, sc, err) 11958 }() 11959 } 11960 for { 11961 next, err := page.fn(ctx, page.rul) 11962 if err != nil { 11963 return err 11964 } 11965 page.rul = next 11966 if !next.hasNextLink() || !next.IsEmpty() { 11967 break 11968 } 11969 } 11970 return nil 11971} 11972 11973// Next advances to the next page of values. If there was an error making 11974// the request the page does not advance and the error is returned. 11975// Deprecated: Use NextWithContext() instead. 11976func (page *ResourceURIListPage) Next() error { 11977 return page.NextWithContext(context.Background()) 11978} 11979 11980// NotDone returns true if the page enumeration should be started or is not yet complete. 11981func (page ResourceURIListPage) NotDone() bool { 11982 return !page.rul.IsEmpty() 11983} 11984 11985// Response returns the raw server response from the last page request. 11986func (page ResourceURIListPage) Response() ResourceURIList { 11987 return page.rul 11988} 11989 11990// Values returns the slice of values for the current page or nil if there are no values. 11991func (page ResourceURIListPage) Values() []string { 11992 if page.rul.IsEmpty() { 11993 return nil 11994 } 11995 return *page.rul.Value 11996} 11997 11998// Creates a new instance of the ResourceURIListPage type. 11999func NewResourceURIListPage(cur ResourceURIList, getNextPage func(context.Context, ResourceURIList) (ResourceURIList, error)) ResourceURIListPage { 12000 return ResourceURIListPage{ 12001 fn: getNextPage, 12002 rul: cur, 12003 } 12004} 12005 12006// RestorePoint restore Point details. 12007type RestorePoint struct { 12008 autorest.Response `json:"-"` 12009 *RestorePointProperties `json:"properties,omitempty"` 12010 // ID - READ-ONLY; Resource Id 12011 ID *string `json:"id,omitempty"` 12012 // Name - READ-ONLY; Resource name 12013 Name *string `json:"name,omitempty"` 12014 // Type - READ-ONLY; Resource type 12015 Type *string `json:"type,omitempty"` 12016} 12017 12018// MarshalJSON is the custom marshaler for RestorePoint. 12019func (rp RestorePoint) MarshalJSON() ([]byte, error) { 12020 objectMap := make(map[string]interface{}) 12021 if rp.RestorePointProperties != nil { 12022 objectMap["properties"] = rp.RestorePointProperties 12023 } 12024 return json.Marshal(objectMap) 12025} 12026 12027// UnmarshalJSON is the custom unmarshaler for RestorePoint struct. 12028func (rp *RestorePoint) UnmarshalJSON(body []byte) error { 12029 var m map[string]*json.RawMessage 12030 err := json.Unmarshal(body, &m) 12031 if err != nil { 12032 return err 12033 } 12034 for k, v := range m { 12035 switch k { 12036 case "properties": 12037 if v != nil { 12038 var restorePointProperties RestorePointProperties 12039 err = json.Unmarshal(*v, &restorePointProperties) 12040 if err != nil { 12041 return err 12042 } 12043 rp.RestorePointProperties = &restorePointProperties 12044 } 12045 case "id": 12046 if v != nil { 12047 var ID string 12048 err = json.Unmarshal(*v, &ID) 12049 if err != nil { 12050 return err 12051 } 12052 rp.ID = &ID 12053 } 12054 case "name": 12055 if v != nil { 12056 var name string 12057 err = json.Unmarshal(*v, &name) 12058 if err != nil { 12059 return err 12060 } 12061 rp.Name = &name 12062 } 12063 case "type": 12064 if v != nil { 12065 var typeVar string 12066 err = json.Unmarshal(*v, &typeVar) 12067 if err != nil { 12068 return err 12069 } 12070 rp.Type = &typeVar 12071 } 12072 } 12073 } 12074 12075 return nil 12076} 12077 12078// RestorePointCollection create or update Restore Point collection parameters. 12079type RestorePointCollection struct { 12080 autorest.Response `json:"-"` 12081 *RestorePointCollectionProperties `json:"properties,omitempty"` 12082 // ID - READ-ONLY; Resource Id 12083 ID *string `json:"id,omitempty"` 12084 // Name - READ-ONLY; Resource name 12085 Name *string `json:"name,omitempty"` 12086 // Type - READ-ONLY; Resource type 12087 Type *string `json:"type,omitempty"` 12088 // Location - Resource location 12089 Location *string `json:"location,omitempty"` 12090 // Tags - Resource tags 12091 Tags map[string]*string `json:"tags"` 12092} 12093 12094// MarshalJSON is the custom marshaler for RestorePointCollection. 12095func (RPCVar RestorePointCollection) MarshalJSON() ([]byte, error) { 12096 objectMap := make(map[string]interface{}) 12097 if RPCVar.RestorePointCollectionProperties != nil { 12098 objectMap["properties"] = RPCVar.RestorePointCollectionProperties 12099 } 12100 if RPCVar.Location != nil { 12101 objectMap["location"] = RPCVar.Location 12102 } 12103 if RPCVar.Tags != nil { 12104 objectMap["tags"] = RPCVar.Tags 12105 } 12106 return json.Marshal(objectMap) 12107} 12108 12109// UnmarshalJSON is the custom unmarshaler for RestorePointCollection struct. 12110func (RPCVar *RestorePointCollection) UnmarshalJSON(body []byte) error { 12111 var m map[string]*json.RawMessage 12112 err := json.Unmarshal(body, &m) 12113 if err != nil { 12114 return err 12115 } 12116 for k, v := range m { 12117 switch k { 12118 case "properties": 12119 if v != nil { 12120 var restorePointCollectionProperties RestorePointCollectionProperties 12121 err = json.Unmarshal(*v, &restorePointCollectionProperties) 12122 if err != nil { 12123 return err 12124 } 12125 RPCVar.RestorePointCollectionProperties = &restorePointCollectionProperties 12126 } 12127 case "id": 12128 if v != nil { 12129 var ID string 12130 err = json.Unmarshal(*v, &ID) 12131 if err != nil { 12132 return err 12133 } 12134 RPCVar.ID = &ID 12135 } 12136 case "name": 12137 if v != nil { 12138 var name string 12139 err = json.Unmarshal(*v, &name) 12140 if err != nil { 12141 return err 12142 } 12143 RPCVar.Name = &name 12144 } 12145 case "type": 12146 if v != nil { 12147 var typeVar string 12148 err = json.Unmarshal(*v, &typeVar) 12149 if err != nil { 12150 return err 12151 } 12152 RPCVar.Type = &typeVar 12153 } 12154 case "location": 12155 if v != nil { 12156 var location string 12157 err = json.Unmarshal(*v, &location) 12158 if err != nil { 12159 return err 12160 } 12161 RPCVar.Location = &location 12162 } 12163 case "tags": 12164 if v != nil { 12165 var tags map[string]*string 12166 err = json.Unmarshal(*v, &tags) 12167 if err != nil { 12168 return err 12169 } 12170 RPCVar.Tags = tags 12171 } 12172 } 12173 } 12174 12175 return nil 12176} 12177 12178// RestorePointCollectionListResult the List restore point collection operation response. 12179type RestorePointCollectionListResult struct { 12180 autorest.Response `json:"-"` 12181 // Value - Gets the list of restore point collections. 12182 Value *[]RestorePointCollection `json:"value,omitempty"` 12183 // NextLink - The uri to fetch the next page of RestorePointCollections. Call ListNext() with this to fetch the next page of RestorePointCollections 12184 NextLink *string `json:"nextLink,omitempty"` 12185} 12186 12187// RestorePointCollectionListResultIterator provides access to a complete listing of RestorePointCollection 12188// values. 12189type RestorePointCollectionListResultIterator struct { 12190 i int 12191 page RestorePointCollectionListResultPage 12192} 12193 12194// NextWithContext advances to the next value. If there was an error making 12195// the request the iterator does not advance and the error is returned. 12196func (iter *RestorePointCollectionListResultIterator) NextWithContext(ctx context.Context) (err error) { 12197 if tracing.IsEnabled() { 12198 ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointCollectionListResultIterator.NextWithContext") 12199 defer func() { 12200 sc := -1 12201 if iter.Response().Response.Response != nil { 12202 sc = iter.Response().Response.Response.StatusCode 12203 } 12204 tracing.EndSpan(ctx, sc, err) 12205 }() 12206 } 12207 iter.i++ 12208 if iter.i < len(iter.page.Values()) { 12209 return nil 12210 } 12211 err = iter.page.NextWithContext(ctx) 12212 if err != nil { 12213 iter.i-- 12214 return err 12215 } 12216 iter.i = 0 12217 return nil 12218} 12219 12220// Next advances to the next value. If there was an error making 12221// the request the iterator does not advance and the error is returned. 12222// Deprecated: Use NextWithContext() instead. 12223func (iter *RestorePointCollectionListResultIterator) Next() error { 12224 return iter.NextWithContext(context.Background()) 12225} 12226 12227// NotDone returns true if the enumeration should be started or is not yet complete. 12228func (iter RestorePointCollectionListResultIterator) NotDone() bool { 12229 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 12230} 12231 12232// Response returns the raw server response from the last page request. 12233func (iter RestorePointCollectionListResultIterator) Response() RestorePointCollectionListResult { 12234 return iter.page.Response() 12235} 12236 12237// Value returns the current value or a zero-initialized value if the 12238// iterator has advanced beyond the end of the collection. 12239func (iter RestorePointCollectionListResultIterator) Value() RestorePointCollection { 12240 if !iter.page.NotDone() { 12241 return RestorePointCollection{} 12242 } 12243 return iter.page.Values()[iter.i] 12244} 12245 12246// Creates a new instance of the RestorePointCollectionListResultIterator type. 12247func NewRestorePointCollectionListResultIterator(page RestorePointCollectionListResultPage) RestorePointCollectionListResultIterator { 12248 return RestorePointCollectionListResultIterator{page: page} 12249} 12250 12251// IsEmpty returns true if the ListResult contains no values. 12252func (rpclr RestorePointCollectionListResult) IsEmpty() bool { 12253 return rpclr.Value == nil || len(*rpclr.Value) == 0 12254} 12255 12256// hasNextLink returns true if the NextLink is not empty. 12257func (rpclr RestorePointCollectionListResult) hasNextLink() bool { 12258 return rpclr.NextLink != nil && len(*rpclr.NextLink) != 0 12259} 12260 12261// restorePointCollectionListResultPreparer prepares a request to retrieve the next set of results. 12262// It returns nil if no more results exist. 12263func (rpclr RestorePointCollectionListResult) restorePointCollectionListResultPreparer(ctx context.Context) (*http.Request, error) { 12264 if !rpclr.hasNextLink() { 12265 return nil, nil 12266 } 12267 return autorest.Prepare((&http.Request{}).WithContext(ctx), 12268 autorest.AsJSON(), 12269 autorest.AsGet(), 12270 autorest.WithBaseURL(to.String(rpclr.NextLink))) 12271} 12272 12273// RestorePointCollectionListResultPage contains a page of RestorePointCollection values. 12274type RestorePointCollectionListResultPage struct { 12275 fn func(context.Context, RestorePointCollectionListResult) (RestorePointCollectionListResult, error) 12276 rpclr RestorePointCollectionListResult 12277} 12278 12279// NextWithContext advances to the next page of values. If there was an error making 12280// the request the page does not advance and the error is returned. 12281func (page *RestorePointCollectionListResultPage) NextWithContext(ctx context.Context) (err error) { 12282 if tracing.IsEnabled() { 12283 ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointCollectionListResultPage.NextWithContext") 12284 defer func() { 12285 sc := -1 12286 if page.Response().Response.Response != nil { 12287 sc = page.Response().Response.Response.StatusCode 12288 } 12289 tracing.EndSpan(ctx, sc, err) 12290 }() 12291 } 12292 for { 12293 next, err := page.fn(ctx, page.rpclr) 12294 if err != nil { 12295 return err 12296 } 12297 page.rpclr = next 12298 if !next.hasNextLink() || !next.IsEmpty() { 12299 break 12300 } 12301 } 12302 return nil 12303} 12304 12305// Next advances to the next page of values. If there was an error making 12306// the request the page does not advance and the error is returned. 12307// Deprecated: Use NextWithContext() instead. 12308func (page *RestorePointCollectionListResultPage) Next() error { 12309 return page.NextWithContext(context.Background()) 12310} 12311 12312// NotDone returns true if the page enumeration should be started or is not yet complete. 12313func (page RestorePointCollectionListResultPage) NotDone() bool { 12314 return !page.rpclr.IsEmpty() 12315} 12316 12317// Response returns the raw server response from the last page request. 12318func (page RestorePointCollectionListResultPage) Response() RestorePointCollectionListResult { 12319 return page.rpclr 12320} 12321 12322// Values returns the slice of values for the current page or nil if there are no values. 12323func (page RestorePointCollectionListResultPage) Values() []RestorePointCollection { 12324 if page.rpclr.IsEmpty() { 12325 return nil 12326 } 12327 return *page.rpclr.Value 12328} 12329 12330// Creates a new instance of the RestorePointCollectionListResultPage type. 12331func NewRestorePointCollectionListResultPage(cur RestorePointCollectionListResult, getNextPage func(context.Context, RestorePointCollectionListResult) (RestorePointCollectionListResult, error)) RestorePointCollectionListResultPage { 12332 return RestorePointCollectionListResultPage{ 12333 fn: getNextPage, 12334 rpclr: cur, 12335 } 12336} 12337 12338// RestorePointCollectionProperties the restore point collection properties. 12339type RestorePointCollectionProperties struct { 12340 Source *RestorePointCollectionSourceProperties `json:"source,omitempty"` 12341 // ProvisioningState - READ-ONLY; The provisioning state of the restore point collection. 12342 ProvisioningState *string `json:"provisioningState,omitempty"` 12343 // RestorePointCollectionID - READ-ONLY; The unique id of the restore point collection. 12344 RestorePointCollectionID *string `json:"restorePointCollectionId,omitempty"` 12345 // RestorePoints - READ-ONLY; A list containing all restore points created under this restore point collection. 12346 RestorePoints *[]RestorePoint `json:"restorePoints,omitempty"` 12347} 12348 12349// MarshalJSON is the custom marshaler for RestorePointCollectionProperties. 12350func (rpcp RestorePointCollectionProperties) MarshalJSON() ([]byte, error) { 12351 objectMap := make(map[string]interface{}) 12352 if rpcp.Source != nil { 12353 objectMap["source"] = rpcp.Source 12354 } 12355 return json.Marshal(objectMap) 12356} 12357 12358// RestorePointCollectionsDeleteFuture an abstraction for monitoring and retrieving the results of a 12359// long-running operation. 12360type RestorePointCollectionsDeleteFuture struct { 12361 azure.FutureAPI 12362 // Result returns the result of the asynchronous operation. 12363 // If the operation has not completed it will return an error. 12364 Result func(RestorePointCollectionsClient) (autorest.Response, error) 12365} 12366 12367// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12368func (future *RestorePointCollectionsDeleteFuture) UnmarshalJSON(body []byte) error { 12369 var azFuture azure.Future 12370 if err := json.Unmarshal(body, &azFuture); err != nil { 12371 return err 12372 } 12373 future.FutureAPI = &azFuture 12374 future.Result = future.result 12375 return nil 12376} 12377 12378// result is the default implementation for RestorePointCollectionsDeleteFuture.Result. 12379func (future *RestorePointCollectionsDeleteFuture) result(client RestorePointCollectionsClient) (ar autorest.Response, err error) { 12380 var done bool 12381 done, err = future.DoneWithContext(context.Background(), client) 12382 if err != nil { 12383 err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsDeleteFuture", "Result", future.Response(), "Polling failure") 12384 return 12385 } 12386 if !done { 12387 ar.Response = future.Response() 12388 err = azure.NewAsyncOpIncompleteError("compute.RestorePointCollectionsDeleteFuture") 12389 return 12390 } 12391 ar.Response = future.Response() 12392 return 12393} 12394 12395// RestorePointCollectionSourceProperties the properties of the source resource that this restore point 12396// collection is created from. 12397type RestorePointCollectionSourceProperties struct { 12398 // Location - READ-ONLY; Location of the source resource used to create this restore point collection. 12399 Location *string `json:"location,omitempty"` 12400 // ID - Resource Id of the source resource used to create this restore point collection 12401 ID *string `json:"id,omitempty"` 12402} 12403 12404// MarshalJSON is the custom marshaler for RestorePointCollectionSourceProperties. 12405func (rpcsp RestorePointCollectionSourceProperties) MarshalJSON() ([]byte, error) { 12406 objectMap := make(map[string]interface{}) 12407 if rpcsp.ID != nil { 12408 objectMap["id"] = rpcsp.ID 12409 } 12410 return json.Marshal(objectMap) 12411} 12412 12413// RestorePointCollectionUpdate update Restore Point collection parameters. 12414type RestorePointCollectionUpdate struct { 12415 *RestorePointCollectionProperties `json:"properties,omitempty"` 12416 // Tags - Resource tags 12417 Tags map[string]*string `json:"tags"` 12418} 12419 12420// MarshalJSON is the custom marshaler for RestorePointCollectionUpdate. 12421func (rpcu RestorePointCollectionUpdate) MarshalJSON() ([]byte, error) { 12422 objectMap := make(map[string]interface{}) 12423 if rpcu.RestorePointCollectionProperties != nil { 12424 objectMap["properties"] = rpcu.RestorePointCollectionProperties 12425 } 12426 if rpcu.Tags != nil { 12427 objectMap["tags"] = rpcu.Tags 12428 } 12429 return json.Marshal(objectMap) 12430} 12431 12432// UnmarshalJSON is the custom unmarshaler for RestorePointCollectionUpdate struct. 12433func (rpcu *RestorePointCollectionUpdate) UnmarshalJSON(body []byte) error { 12434 var m map[string]*json.RawMessage 12435 err := json.Unmarshal(body, &m) 12436 if err != nil { 12437 return err 12438 } 12439 for k, v := range m { 12440 switch k { 12441 case "properties": 12442 if v != nil { 12443 var restorePointCollectionProperties RestorePointCollectionProperties 12444 err = json.Unmarshal(*v, &restorePointCollectionProperties) 12445 if err != nil { 12446 return err 12447 } 12448 rpcu.RestorePointCollectionProperties = &restorePointCollectionProperties 12449 } 12450 case "tags": 12451 if v != nil { 12452 var tags map[string]*string 12453 err = json.Unmarshal(*v, &tags) 12454 if err != nil { 12455 return err 12456 } 12457 rpcu.Tags = tags 12458 } 12459 } 12460 } 12461 12462 return nil 12463} 12464 12465// RestorePointProperties the restore point properties. 12466type RestorePointProperties struct { 12467 // 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. 12468 ExcludeDisks *[]APIEntityReference `json:"excludeDisks,omitempty"` 12469 // SourceMetadata - READ-ONLY; Gets the details of the VM captured at the time of the restore point creation. 12470 SourceMetadata *RestorePointSourceMetadata `json:"sourceMetadata,omitempty"` 12471 // ProvisioningState - READ-ONLY; Gets the provisioning state of the restore point. 12472 ProvisioningState *string `json:"provisioningState,omitempty"` 12473 // 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' 12474 ConsistencyMode ConsistencyModeTypes `json:"consistencyMode,omitempty"` 12475 // ProvisioningDetails - READ-ONLY; Gets the provisioning details set by the server during Create restore point operation. 12476 ProvisioningDetails *RestorePointProvisioningDetails `json:"provisioningDetails,omitempty"` 12477} 12478 12479// MarshalJSON is the custom marshaler for RestorePointProperties. 12480func (rpp RestorePointProperties) MarshalJSON() ([]byte, error) { 12481 objectMap := make(map[string]interface{}) 12482 if rpp.ExcludeDisks != nil { 12483 objectMap["excludeDisks"] = rpp.ExcludeDisks 12484 } 12485 return json.Marshal(objectMap) 12486} 12487 12488// RestorePointProvisioningDetails restore Point Provisioning details. 12489type RestorePointProvisioningDetails struct { 12490 // CreationTime - Gets the creation time of the restore point. 12491 CreationTime *date.Time `json:"creationTime,omitempty"` 12492 // TotalUsedSizeInBytes - Gets the total size of the data in all the disks which are part of the restore point. 12493 TotalUsedSizeInBytes *int64 `json:"totalUsedSizeInBytes,omitempty"` 12494 // StatusCode - Gets the status of the Create restore point operation. 12495 StatusCode *int32 `json:"statusCode,omitempty"` 12496 // StatusMessage - Gets the status message of the Create restore point operation. 12497 StatusMessage *string `json:"statusMessage,omitempty"` 12498} 12499 12500// RestorePointsCreateFuture an abstraction for monitoring and retrieving the results of a long-running 12501// operation. 12502type RestorePointsCreateFuture struct { 12503 azure.FutureAPI 12504 // Result returns the result of the asynchronous operation. 12505 // If the operation has not completed it will return an error. 12506 Result func(RestorePointsClient) (RestorePoint, error) 12507} 12508 12509// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12510func (future *RestorePointsCreateFuture) UnmarshalJSON(body []byte) error { 12511 var azFuture azure.Future 12512 if err := json.Unmarshal(body, &azFuture); err != nil { 12513 return err 12514 } 12515 future.FutureAPI = &azFuture 12516 future.Result = future.result 12517 return nil 12518} 12519 12520// result is the default implementation for RestorePointsCreateFuture.Result. 12521func (future *RestorePointsCreateFuture) result(client RestorePointsClient) (rp RestorePoint, err error) { 12522 var done bool 12523 done, err = future.DoneWithContext(context.Background(), client) 12524 if err != nil { 12525 err = autorest.NewErrorWithError(err, "compute.RestorePointsCreateFuture", "Result", future.Response(), "Polling failure") 12526 return 12527 } 12528 if !done { 12529 rp.Response.Response = future.Response() 12530 err = azure.NewAsyncOpIncompleteError("compute.RestorePointsCreateFuture") 12531 return 12532 } 12533 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 12534 if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { 12535 rp, err = client.CreateResponder(rp.Response.Response) 12536 if err != nil { 12537 err = autorest.NewErrorWithError(err, "compute.RestorePointsCreateFuture", "Result", rp.Response.Response, "Failure responding to request") 12538 } 12539 } 12540 return 12541} 12542 12543// RestorePointsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 12544// operation. 12545type RestorePointsDeleteFuture struct { 12546 azure.FutureAPI 12547 // Result returns the result of the asynchronous operation. 12548 // If the operation has not completed it will return an error. 12549 Result func(RestorePointsClient) (autorest.Response, error) 12550} 12551 12552// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12553func (future *RestorePointsDeleteFuture) UnmarshalJSON(body []byte) error { 12554 var azFuture azure.Future 12555 if err := json.Unmarshal(body, &azFuture); err != nil { 12556 return err 12557 } 12558 future.FutureAPI = &azFuture 12559 future.Result = future.result 12560 return nil 12561} 12562 12563// result is the default implementation for RestorePointsDeleteFuture.Result. 12564func (future *RestorePointsDeleteFuture) result(client RestorePointsClient) (ar autorest.Response, err error) { 12565 var done bool 12566 done, err = future.DoneWithContext(context.Background(), client) 12567 if err != nil { 12568 err = autorest.NewErrorWithError(err, "compute.RestorePointsDeleteFuture", "Result", future.Response(), "Polling failure") 12569 return 12570 } 12571 if !done { 12572 ar.Response = future.Response() 12573 err = azure.NewAsyncOpIncompleteError("compute.RestorePointsDeleteFuture") 12574 return 12575 } 12576 ar.Response = future.Response() 12577 return 12578} 12579 12580// RestorePointSourceMetadata describes the properties of the Virtual Machine for which the restore point 12581// was created. The properties provided are a subset and the snapshot of the overall Virtual Machine 12582// properties captured at the time of the restore point creation. 12583type RestorePointSourceMetadata struct { 12584 // HardwareProfile - Gets the hardware profile. 12585 HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` 12586 // StorageProfile - Gets the storage profile. 12587 StorageProfile *RestorePointSourceVMStorageProfile `json:"storageProfile,omitempty"` 12588 // OsProfile - Gets the OS profile. 12589 OsProfile *OSProfile `json:"osProfile,omitempty"` 12590 // DiagnosticsProfile - Gets the diagnostics profile. 12591 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 12592 // LicenseType - Gets the license type, which is for bring your own license scenario. 12593 LicenseType *string `json:"licenseType,omitempty"` 12594 // VMID - Gets the virtual machine unique id. 12595 VMID *string `json:"vmId,omitempty"` 12596 // SecurityProfile - Gets the security profile. 12597 SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` 12598 // Location - Location of the VM from which the restore point was created. 12599 Location *string `json:"location,omitempty"` 12600} 12601 12602// RestorePointSourceVMDataDisk describes a data disk. 12603type RestorePointSourceVMDataDisk struct { 12604 // Lun - Gets the logical unit number. 12605 Lun *int32 `json:"lun,omitempty"` 12606 // Name - Gets the disk name. 12607 Name *string `json:"name,omitempty"` 12608 // Caching - Gets the caching type. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' 12609 Caching CachingTypes `json:"caching,omitempty"` 12610 // DiskSizeGB - Gets the initial disk size in GB for blank data disks, and the new desired size for existing OS and Data disks. 12611 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 12612 // ManagedDisk - Gets the managed disk details 12613 ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` 12614 // DiskRestorePoint - Gets the disk restore point Id. 12615 DiskRestorePoint *APIEntityReference `json:"diskRestorePoint,omitempty"` 12616} 12617 12618// RestorePointSourceVMOSDisk describes an Operating System disk. 12619type RestorePointSourceVMOSDisk struct { 12620 // OsType - Gets the Operating System type. Possible values include: 'OperatingSystemTypeWindows', 'OperatingSystemTypeLinux' 12621 OsType OperatingSystemType `json:"osType,omitempty"` 12622 // EncryptionSettings - Gets the disk encryption settings. 12623 EncryptionSettings *DiskEncryptionSettings `json:"encryptionSettings,omitempty"` 12624 // Name - Gets the disk name. 12625 Name *string `json:"name,omitempty"` 12626 // Caching - Gets the caching type. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' 12627 Caching CachingTypes `json:"caching,omitempty"` 12628 // DiskSizeGB - Gets the disk size in GB. 12629 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 12630 // ManagedDisk - Gets the managed disk details 12631 ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` 12632 // DiskRestorePoint - Gets the disk restore point Id. 12633 DiskRestorePoint *APIEntityReference `json:"diskRestorePoint,omitempty"` 12634} 12635 12636// RestorePointSourceVMStorageProfile describes the storage profile. 12637type RestorePointSourceVMStorageProfile struct { 12638 // OsDisk - Gets the OS disk of the VM captured at the time of the restore point creation. 12639 OsDisk *RestorePointSourceVMOSDisk `json:"osDisk,omitempty"` 12640 // DataDisks - Gets the data disks of the VM captured at the time of the restore point creation. 12641 DataDisks *[]RestorePointSourceVMDataDisk `json:"dataDisks,omitempty"` 12642} 12643 12644// RetrieveBootDiagnosticsDataResult the SAS URIs of the console screenshot and serial log blobs. 12645type RetrieveBootDiagnosticsDataResult struct { 12646 autorest.Response `json:"-"` 12647 // ConsoleScreenshotBlobURI - READ-ONLY; The console screenshot blob URI 12648 ConsoleScreenshotBlobURI *string `json:"consoleScreenshotBlobUri,omitempty"` 12649 // SerialConsoleLogBlobURI - READ-ONLY; The serial console log blob URI. 12650 SerialConsoleLogBlobURI *string `json:"serialConsoleLogBlobUri,omitempty"` 12651} 12652 12653// MarshalJSON is the custom marshaler for RetrieveBootDiagnosticsDataResult. 12654func (rbddr RetrieveBootDiagnosticsDataResult) MarshalJSON() ([]byte, error) { 12655 objectMap := make(map[string]interface{}) 12656 return json.Marshal(objectMap) 12657} 12658 12659// RoleInstance ... 12660type RoleInstance struct { 12661 autorest.Response `json:"-"` 12662 // ID - READ-ONLY; Resource Id 12663 ID *string `json:"id,omitempty"` 12664 // Name - READ-ONLY; Resource Name. 12665 Name *string `json:"name,omitempty"` 12666 // Type - READ-ONLY; Resource Type. 12667 Type *string `json:"type,omitempty"` 12668 // Location - READ-ONLY; Resource Location. 12669 Location *string `json:"location,omitempty"` 12670 // Tags - READ-ONLY; Resource tags. 12671 Tags map[string]*string `json:"tags"` 12672 Sku *InstanceSku `json:"sku,omitempty"` 12673 Properties *RoleInstanceProperties `json:"properties,omitempty"` 12674} 12675 12676// MarshalJSON is the custom marshaler for RoleInstance. 12677func (ri RoleInstance) MarshalJSON() ([]byte, error) { 12678 objectMap := make(map[string]interface{}) 12679 if ri.Sku != nil { 12680 objectMap["sku"] = ri.Sku 12681 } 12682 if ri.Properties != nil { 12683 objectMap["properties"] = ri.Properties 12684 } 12685 return json.Marshal(objectMap) 12686} 12687 12688// RoleInstanceInstanceView the instance view of the role instance. 12689type RoleInstanceInstanceView struct { 12690 autorest.Response `json:"-"` 12691 // PlatformUpdateDomain - READ-ONLY; The Update Domain. 12692 PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` 12693 // PlatformFaultDomain - READ-ONLY; The Fault Domain. 12694 PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` 12695 // 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. 12696 PrivateID *string `json:"privateId,omitempty"` 12697 // Statuses - READ-ONLY 12698 Statuses *[]ResourceInstanceViewStatus `json:"statuses,omitempty"` 12699} 12700 12701// MarshalJSON is the custom marshaler for RoleInstanceInstanceView. 12702func (riiv RoleInstanceInstanceView) MarshalJSON() ([]byte, error) { 12703 objectMap := make(map[string]interface{}) 12704 return json.Marshal(objectMap) 12705} 12706 12707// RoleInstanceListResult ... 12708type RoleInstanceListResult struct { 12709 autorest.Response `json:"-"` 12710 Value *[]RoleInstance `json:"value,omitempty"` 12711 NextLink *string `json:"nextLink,omitempty"` 12712} 12713 12714// RoleInstanceListResultIterator provides access to a complete listing of RoleInstance values. 12715type RoleInstanceListResultIterator struct { 12716 i int 12717 page RoleInstanceListResultPage 12718} 12719 12720// NextWithContext advances to the next value. If there was an error making 12721// the request the iterator does not advance and the error is returned. 12722func (iter *RoleInstanceListResultIterator) NextWithContext(ctx context.Context) (err error) { 12723 if tracing.IsEnabled() { 12724 ctx = tracing.StartSpan(ctx, fqdn+"/RoleInstanceListResultIterator.NextWithContext") 12725 defer func() { 12726 sc := -1 12727 if iter.Response().Response.Response != nil { 12728 sc = iter.Response().Response.Response.StatusCode 12729 } 12730 tracing.EndSpan(ctx, sc, err) 12731 }() 12732 } 12733 iter.i++ 12734 if iter.i < len(iter.page.Values()) { 12735 return nil 12736 } 12737 err = iter.page.NextWithContext(ctx) 12738 if err != nil { 12739 iter.i-- 12740 return err 12741 } 12742 iter.i = 0 12743 return nil 12744} 12745 12746// Next advances to the next value. If there was an error making 12747// the request the iterator does not advance and the error is returned. 12748// Deprecated: Use NextWithContext() instead. 12749func (iter *RoleInstanceListResultIterator) Next() error { 12750 return iter.NextWithContext(context.Background()) 12751} 12752 12753// NotDone returns true if the enumeration should be started or is not yet complete. 12754func (iter RoleInstanceListResultIterator) NotDone() bool { 12755 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 12756} 12757 12758// Response returns the raw server response from the last page request. 12759func (iter RoleInstanceListResultIterator) Response() RoleInstanceListResult { 12760 return iter.page.Response() 12761} 12762 12763// Value returns the current value or a zero-initialized value if the 12764// iterator has advanced beyond the end of the collection. 12765func (iter RoleInstanceListResultIterator) Value() RoleInstance { 12766 if !iter.page.NotDone() { 12767 return RoleInstance{} 12768 } 12769 return iter.page.Values()[iter.i] 12770} 12771 12772// Creates a new instance of the RoleInstanceListResultIterator type. 12773func NewRoleInstanceListResultIterator(page RoleInstanceListResultPage) RoleInstanceListResultIterator { 12774 return RoleInstanceListResultIterator{page: page} 12775} 12776 12777// IsEmpty returns true if the ListResult contains no values. 12778func (rilr RoleInstanceListResult) IsEmpty() bool { 12779 return rilr.Value == nil || len(*rilr.Value) == 0 12780} 12781 12782// hasNextLink returns true if the NextLink is not empty. 12783func (rilr RoleInstanceListResult) hasNextLink() bool { 12784 return rilr.NextLink != nil && len(*rilr.NextLink) != 0 12785} 12786 12787// roleInstanceListResultPreparer prepares a request to retrieve the next set of results. 12788// It returns nil if no more results exist. 12789func (rilr RoleInstanceListResult) roleInstanceListResultPreparer(ctx context.Context) (*http.Request, error) { 12790 if !rilr.hasNextLink() { 12791 return nil, nil 12792 } 12793 return autorest.Prepare((&http.Request{}).WithContext(ctx), 12794 autorest.AsJSON(), 12795 autorest.AsGet(), 12796 autorest.WithBaseURL(to.String(rilr.NextLink))) 12797} 12798 12799// RoleInstanceListResultPage contains a page of RoleInstance values. 12800type RoleInstanceListResultPage struct { 12801 fn func(context.Context, RoleInstanceListResult) (RoleInstanceListResult, error) 12802 rilr RoleInstanceListResult 12803} 12804 12805// NextWithContext advances to the next page of values. If there was an error making 12806// the request the page does not advance and the error is returned. 12807func (page *RoleInstanceListResultPage) NextWithContext(ctx context.Context) (err error) { 12808 if tracing.IsEnabled() { 12809 ctx = tracing.StartSpan(ctx, fqdn+"/RoleInstanceListResultPage.NextWithContext") 12810 defer func() { 12811 sc := -1 12812 if page.Response().Response.Response != nil { 12813 sc = page.Response().Response.Response.StatusCode 12814 } 12815 tracing.EndSpan(ctx, sc, err) 12816 }() 12817 } 12818 for { 12819 next, err := page.fn(ctx, page.rilr) 12820 if err != nil { 12821 return err 12822 } 12823 page.rilr = next 12824 if !next.hasNextLink() || !next.IsEmpty() { 12825 break 12826 } 12827 } 12828 return nil 12829} 12830 12831// Next advances to the next page of values. If there was an error making 12832// the request the page does not advance and the error is returned. 12833// Deprecated: Use NextWithContext() instead. 12834func (page *RoleInstanceListResultPage) Next() error { 12835 return page.NextWithContext(context.Background()) 12836} 12837 12838// NotDone returns true if the page enumeration should be started or is not yet complete. 12839func (page RoleInstanceListResultPage) NotDone() bool { 12840 return !page.rilr.IsEmpty() 12841} 12842 12843// Response returns the raw server response from the last page request. 12844func (page RoleInstanceListResultPage) Response() RoleInstanceListResult { 12845 return page.rilr 12846} 12847 12848// Values returns the slice of values for the current page or nil if there are no values. 12849func (page RoleInstanceListResultPage) Values() []RoleInstance { 12850 if page.rilr.IsEmpty() { 12851 return nil 12852 } 12853 return *page.rilr.Value 12854} 12855 12856// Creates a new instance of the RoleInstanceListResultPage type. 12857func NewRoleInstanceListResultPage(cur RoleInstanceListResult, getNextPage func(context.Context, RoleInstanceListResult) (RoleInstanceListResult, error)) RoleInstanceListResultPage { 12858 return RoleInstanceListResultPage{ 12859 fn: getNextPage, 12860 rilr: cur, 12861 } 12862} 12863 12864// RoleInstanceNetworkProfile describes the network profile for the role instance. 12865type RoleInstanceNetworkProfile struct { 12866 // NetworkInterfaces - READ-ONLY; Specifies the list of resource Ids for the network interfaces associated with the role instance. 12867 NetworkInterfaces *[]SubResource `json:"networkInterfaces,omitempty"` 12868} 12869 12870// MarshalJSON is the custom marshaler for RoleInstanceNetworkProfile. 12871func (rinp RoleInstanceNetworkProfile) MarshalJSON() ([]byte, error) { 12872 objectMap := make(map[string]interface{}) 12873 return json.Marshal(objectMap) 12874} 12875 12876// RoleInstanceProperties ... 12877type RoleInstanceProperties struct { 12878 NetworkProfile *RoleInstanceNetworkProfile `json:"networkProfile,omitempty"` 12879 InstanceView *RoleInstanceInstanceView `json:"instanceView,omitempty"` 12880} 12881 12882// RoleInstances specifies a list of role instances from the cloud service. 12883type RoleInstances struct { 12884 // RoleInstances - List of cloud service role instance names. Value of '*' will signify all role instances of the cloud service. 12885 RoleInstances *[]string `json:"roleInstances,omitempty"` 12886} 12887 12888// RollbackStatusInfo information about rollback on failed VM instances after a OS Upgrade operation. 12889type RollbackStatusInfo struct { 12890 // SuccessfullyRolledbackInstanceCount - READ-ONLY; The number of instances which have been successfully rolled back. 12891 SuccessfullyRolledbackInstanceCount *int32 `json:"successfullyRolledbackInstanceCount,omitempty"` 12892 // FailedRolledbackInstanceCount - READ-ONLY; The number of instances which failed to rollback. 12893 FailedRolledbackInstanceCount *int32 `json:"failedRolledbackInstanceCount,omitempty"` 12894 // RollbackError - READ-ONLY; Error details if OS rollback failed. 12895 RollbackError *APIError `json:"rollbackError,omitempty"` 12896} 12897 12898// MarshalJSON is the custom marshaler for RollbackStatusInfo. 12899func (rsi RollbackStatusInfo) MarshalJSON() ([]byte, error) { 12900 objectMap := make(map[string]interface{}) 12901 return json.Marshal(objectMap) 12902} 12903 12904// RollingUpgradePolicy the configuration parameters used while performing a rolling upgrade. 12905type RollingUpgradePolicy struct { 12906 // 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%. 12907 MaxBatchInstancePercent *int32 `json:"maxBatchInstancePercent,omitempty"` 12908 // 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%. 12909 MaxUnhealthyInstancePercent *int32 `json:"maxUnhealthyInstancePercent,omitempty"` 12910 // 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%. 12911 MaxUnhealthyUpgradedInstancePercent *int32 `json:"maxUnhealthyUpgradedInstancePercent,omitempty"` 12912 // 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). 12913 PauseTimeBetweenBatches *string `json:"pauseTimeBetweenBatches,omitempty"` 12914 // EnableCrossZoneUpgrade - Allow VMSS to ignore AZ boundaries when constructing upgrade batches. Take into consideration the Update Domain and maxBatchInstancePercent to determine the batch size. 12915 EnableCrossZoneUpgrade *bool `json:"enableCrossZoneUpgrade,omitempty"` 12916 // PrioritizeUnhealthyInstances - Upgrade all unhealthy instances in a scale set before any healthy instances. 12917 PrioritizeUnhealthyInstances *bool `json:"prioritizeUnhealthyInstances,omitempty"` 12918} 12919 12920// RollingUpgradeProgressInfo information about the number of virtual machine instances in each upgrade 12921// state. 12922type RollingUpgradeProgressInfo struct { 12923 // SuccessfulInstanceCount - READ-ONLY; The number of instances that have been successfully upgraded. 12924 SuccessfulInstanceCount *int32 `json:"successfulInstanceCount,omitempty"` 12925 // FailedInstanceCount - READ-ONLY; The number of instances that have failed to be upgraded successfully. 12926 FailedInstanceCount *int32 `json:"failedInstanceCount,omitempty"` 12927 // InProgressInstanceCount - READ-ONLY; The number of instances that are currently being upgraded. 12928 InProgressInstanceCount *int32 `json:"inProgressInstanceCount,omitempty"` 12929 // PendingInstanceCount - READ-ONLY; The number of instances that have not yet begun to be upgraded. 12930 PendingInstanceCount *int32 `json:"pendingInstanceCount,omitempty"` 12931} 12932 12933// MarshalJSON is the custom marshaler for RollingUpgradeProgressInfo. 12934func (rupi RollingUpgradeProgressInfo) MarshalJSON() ([]byte, error) { 12935 objectMap := make(map[string]interface{}) 12936 return json.Marshal(objectMap) 12937} 12938 12939// RollingUpgradeRunningStatus information about the current running state of the overall upgrade. 12940type RollingUpgradeRunningStatus struct { 12941 // Code - READ-ONLY; Code indicating the current status of the upgrade. Possible values include: 'RollingUpgradeStatusCodeRollingForward', 'RollingUpgradeStatusCodeCancelled', 'RollingUpgradeStatusCodeCompleted', 'RollingUpgradeStatusCodeFaulted' 12942 Code RollingUpgradeStatusCode `json:"code,omitempty"` 12943 // StartTime - READ-ONLY; Start time of the upgrade. 12944 StartTime *date.Time `json:"startTime,omitempty"` 12945 // LastAction - READ-ONLY; The last action performed on the rolling upgrade. Possible values include: 'RollingUpgradeActionTypeStart', 'RollingUpgradeActionTypeCancel' 12946 LastAction RollingUpgradeActionType `json:"lastAction,omitempty"` 12947 // LastActionTime - READ-ONLY; Last action time of the upgrade. 12948 LastActionTime *date.Time `json:"lastActionTime,omitempty"` 12949} 12950 12951// MarshalJSON is the custom marshaler for RollingUpgradeRunningStatus. 12952func (rurs RollingUpgradeRunningStatus) MarshalJSON() ([]byte, error) { 12953 objectMap := make(map[string]interface{}) 12954 return json.Marshal(objectMap) 12955} 12956 12957// RollingUpgradeStatusInfo the status of the latest virtual machine scale set rolling upgrade. 12958type RollingUpgradeStatusInfo struct { 12959 autorest.Response `json:"-"` 12960 *RollingUpgradeStatusInfoProperties `json:"properties,omitempty"` 12961 // ID - READ-ONLY; Resource Id 12962 ID *string `json:"id,omitempty"` 12963 // Name - READ-ONLY; Resource name 12964 Name *string `json:"name,omitempty"` 12965 // Type - READ-ONLY; Resource type 12966 Type *string `json:"type,omitempty"` 12967 // Location - Resource location 12968 Location *string `json:"location,omitempty"` 12969 // Tags - Resource tags 12970 Tags map[string]*string `json:"tags"` 12971} 12972 12973// MarshalJSON is the custom marshaler for RollingUpgradeStatusInfo. 12974func (rusi RollingUpgradeStatusInfo) MarshalJSON() ([]byte, error) { 12975 objectMap := make(map[string]interface{}) 12976 if rusi.RollingUpgradeStatusInfoProperties != nil { 12977 objectMap["properties"] = rusi.RollingUpgradeStatusInfoProperties 12978 } 12979 if rusi.Location != nil { 12980 objectMap["location"] = rusi.Location 12981 } 12982 if rusi.Tags != nil { 12983 objectMap["tags"] = rusi.Tags 12984 } 12985 return json.Marshal(objectMap) 12986} 12987 12988// UnmarshalJSON is the custom unmarshaler for RollingUpgradeStatusInfo struct. 12989func (rusi *RollingUpgradeStatusInfo) UnmarshalJSON(body []byte) error { 12990 var m map[string]*json.RawMessage 12991 err := json.Unmarshal(body, &m) 12992 if err != nil { 12993 return err 12994 } 12995 for k, v := range m { 12996 switch k { 12997 case "properties": 12998 if v != nil { 12999 var rollingUpgradeStatusInfoProperties RollingUpgradeStatusInfoProperties 13000 err = json.Unmarshal(*v, &rollingUpgradeStatusInfoProperties) 13001 if err != nil { 13002 return err 13003 } 13004 rusi.RollingUpgradeStatusInfoProperties = &rollingUpgradeStatusInfoProperties 13005 } 13006 case "id": 13007 if v != nil { 13008 var ID string 13009 err = json.Unmarshal(*v, &ID) 13010 if err != nil { 13011 return err 13012 } 13013 rusi.ID = &ID 13014 } 13015 case "name": 13016 if v != nil { 13017 var name string 13018 err = json.Unmarshal(*v, &name) 13019 if err != nil { 13020 return err 13021 } 13022 rusi.Name = &name 13023 } 13024 case "type": 13025 if v != nil { 13026 var typeVar string 13027 err = json.Unmarshal(*v, &typeVar) 13028 if err != nil { 13029 return err 13030 } 13031 rusi.Type = &typeVar 13032 } 13033 case "location": 13034 if v != nil { 13035 var location string 13036 err = json.Unmarshal(*v, &location) 13037 if err != nil { 13038 return err 13039 } 13040 rusi.Location = &location 13041 } 13042 case "tags": 13043 if v != nil { 13044 var tags map[string]*string 13045 err = json.Unmarshal(*v, &tags) 13046 if err != nil { 13047 return err 13048 } 13049 rusi.Tags = tags 13050 } 13051 } 13052 } 13053 13054 return nil 13055} 13056 13057// RollingUpgradeStatusInfoProperties the status of the latest virtual machine scale set rolling upgrade. 13058type RollingUpgradeStatusInfoProperties struct { 13059 // Policy - READ-ONLY; The rolling upgrade policies applied for this upgrade. 13060 Policy *RollingUpgradePolicy `json:"policy,omitempty"` 13061 // RunningStatus - READ-ONLY; Information about the current running state of the overall upgrade. 13062 RunningStatus *RollingUpgradeRunningStatus `json:"runningStatus,omitempty"` 13063 // Progress - READ-ONLY; Information about the number of virtual machine instances in each upgrade state. 13064 Progress *RollingUpgradeProgressInfo `json:"progress,omitempty"` 13065 // Error - READ-ONLY; Error details for this upgrade, if there are any. 13066 Error *APIError `json:"error,omitempty"` 13067} 13068 13069// MarshalJSON is the custom marshaler for RollingUpgradeStatusInfoProperties. 13070func (rusip RollingUpgradeStatusInfoProperties) MarshalJSON() ([]byte, error) { 13071 objectMap := make(map[string]interface{}) 13072 return json.Marshal(objectMap) 13073} 13074 13075// RunCommandDocument describes the properties of a Run Command. 13076type RunCommandDocument struct { 13077 autorest.Response `json:"-"` 13078 // Script - The script to be executed. 13079 Script *[]string `json:"script,omitempty"` 13080 // Parameters - The parameters used by the script. 13081 Parameters *[]RunCommandParameterDefinition `json:"parameters,omitempty"` 13082 // Schema - The VM run command schema. 13083 Schema *string `json:"$schema,omitempty"` 13084 // ID - The VM run command id. 13085 ID *string `json:"id,omitempty"` 13086 // OsType - The Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' 13087 OsType OperatingSystemTypes `json:"osType,omitempty"` 13088 // Label - The VM run command label. 13089 Label *string `json:"label,omitempty"` 13090 // Description - The VM run command description. 13091 Description *string `json:"description,omitempty"` 13092} 13093 13094// RunCommandDocumentBase describes the properties of a Run Command metadata. 13095type RunCommandDocumentBase struct { 13096 // Schema - The VM run command schema. 13097 Schema *string `json:"$schema,omitempty"` 13098 // ID - The VM run command id. 13099 ID *string `json:"id,omitempty"` 13100 // OsType - The Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' 13101 OsType OperatingSystemTypes `json:"osType,omitempty"` 13102 // Label - The VM run command label. 13103 Label *string `json:"label,omitempty"` 13104 // Description - The VM run command description. 13105 Description *string `json:"description,omitempty"` 13106} 13107 13108// RunCommandInput capture Virtual Machine parameters. 13109type RunCommandInput struct { 13110 // CommandID - The run command id. 13111 CommandID *string `json:"commandId,omitempty"` 13112 // Script - Optional. The script to be executed. When this value is given, the given script will override the default script of the command. 13113 Script *[]string `json:"script,omitempty"` 13114 // Parameters - The run command parameters. 13115 Parameters *[]RunCommandInputParameter `json:"parameters,omitempty"` 13116} 13117 13118// RunCommandInputParameter describes the properties of a run command parameter. 13119type RunCommandInputParameter struct { 13120 // Name - The run command parameter name. 13121 Name *string `json:"name,omitempty"` 13122 // Value - The run command parameter value. 13123 Value *string `json:"value,omitempty"` 13124} 13125 13126// RunCommandListResult the List Virtual Machine operation response. 13127type RunCommandListResult struct { 13128 autorest.Response `json:"-"` 13129 // Value - The list of virtual machine run commands. 13130 Value *[]RunCommandDocumentBase `json:"value,omitempty"` 13131 // NextLink - The uri to fetch the next page of run commands. Call ListNext() with this to fetch the next page of run commands. 13132 NextLink *string `json:"nextLink,omitempty"` 13133} 13134 13135// RunCommandListResultIterator provides access to a complete listing of RunCommandDocumentBase values. 13136type RunCommandListResultIterator struct { 13137 i int 13138 page RunCommandListResultPage 13139} 13140 13141// NextWithContext advances to the next value. If there was an error making 13142// the request the iterator does not advance and the error is returned. 13143func (iter *RunCommandListResultIterator) NextWithContext(ctx context.Context) (err error) { 13144 if tracing.IsEnabled() { 13145 ctx = tracing.StartSpan(ctx, fqdn+"/RunCommandListResultIterator.NextWithContext") 13146 defer func() { 13147 sc := -1 13148 if iter.Response().Response.Response != nil { 13149 sc = iter.Response().Response.Response.StatusCode 13150 } 13151 tracing.EndSpan(ctx, sc, err) 13152 }() 13153 } 13154 iter.i++ 13155 if iter.i < len(iter.page.Values()) { 13156 return nil 13157 } 13158 err = iter.page.NextWithContext(ctx) 13159 if err != nil { 13160 iter.i-- 13161 return err 13162 } 13163 iter.i = 0 13164 return nil 13165} 13166 13167// Next advances to the next value. If there was an error making 13168// the request the iterator does not advance and the error is returned. 13169// Deprecated: Use NextWithContext() instead. 13170func (iter *RunCommandListResultIterator) Next() error { 13171 return iter.NextWithContext(context.Background()) 13172} 13173 13174// NotDone returns true if the enumeration should be started or is not yet complete. 13175func (iter RunCommandListResultIterator) NotDone() bool { 13176 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 13177} 13178 13179// Response returns the raw server response from the last page request. 13180func (iter RunCommandListResultIterator) Response() RunCommandListResult { 13181 return iter.page.Response() 13182} 13183 13184// Value returns the current value or a zero-initialized value if the 13185// iterator has advanced beyond the end of the collection. 13186func (iter RunCommandListResultIterator) Value() RunCommandDocumentBase { 13187 if !iter.page.NotDone() { 13188 return RunCommandDocumentBase{} 13189 } 13190 return iter.page.Values()[iter.i] 13191} 13192 13193// Creates a new instance of the RunCommandListResultIterator type. 13194func NewRunCommandListResultIterator(page RunCommandListResultPage) RunCommandListResultIterator { 13195 return RunCommandListResultIterator{page: page} 13196} 13197 13198// IsEmpty returns true if the ListResult contains no values. 13199func (rclr RunCommandListResult) IsEmpty() bool { 13200 return rclr.Value == nil || len(*rclr.Value) == 0 13201} 13202 13203// hasNextLink returns true if the NextLink is not empty. 13204func (rclr RunCommandListResult) hasNextLink() bool { 13205 return rclr.NextLink != nil && len(*rclr.NextLink) != 0 13206} 13207 13208// runCommandListResultPreparer prepares a request to retrieve the next set of results. 13209// It returns nil if no more results exist. 13210func (rclr RunCommandListResult) runCommandListResultPreparer(ctx context.Context) (*http.Request, error) { 13211 if !rclr.hasNextLink() { 13212 return nil, nil 13213 } 13214 return autorest.Prepare((&http.Request{}).WithContext(ctx), 13215 autorest.AsJSON(), 13216 autorest.AsGet(), 13217 autorest.WithBaseURL(to.String(rclr.NextLink))) 13218} 13219 13220// RunCommandListResultPage contains a page of RunCommandDocumentBase values. 13221type RunCommandListResultPage struct { 13222 fn func(context.Context, RunCommandListResult) (RunCommandListResult, error) 13223 rclr RunCommandListResult 13224} 13225 13226// NextWithContext advances to the next page of values. If there was an error making 13227// the request the page does not advance and the error is returned. 13228func (page *RunCommandListResultPage) NextWithContext(ctx context.Context) (err error) { 13229 if tracing.IsEnabled() { 13230 ctx = tracing.StartSpan(ctx, fqdn+"/RunCommandListResultPage.NextWithContext") 13231 defer func() { 13232 sc := -1 13233 if page.Response().Response.Response != nil { 13234 sc = page.Response().Response.Response.StatusCode 13235 } 13236 tracing.EndSpan(ctx, sc, err) 13237 }() 13238 } 13239 for { 13240 next, err := page.fn(ctx, page.rclr) 13241 if err != nil { 13242 return err 13243 } 13244 page.rclr = next 13245 if !next.hasNextLink() || !next.IsEmpty() { 13246 break 13247 } 13248 } 13249 return nil 13250} 13251 13252// Next advances to the next page of values. If there was an error making 13253// the request the page does not advance and the error is returned. 13254// Deprecated: Use NextWithContext() instead. 13255func (page *RunCommandListResultPage) Next() error { 13256 return page.NextWithContext(context.Background()) 13257} 13258 13259// NotDone returns true if the page enumeration should be started or is not yet complete. 13260func (page RunCommandListResultPage) NotDone() bool { 13261 return !page.rclr.IsEmpty() 13262} 13263 13264// Response returns the raw server response from the last page request. 13265func (page RunCommandListResultPage) Response() RunCommandListResult { 13266 return page.rclr 13267} 13268 13269// Values returns the slice of values for the current page or nil if there are no values. 13270func (page RunCommandListResultPage) Values() []RunCommandDocumentBase { 13271 if page.rclr.IsEmpty() { 13272 return nil 13273 } 13274 return *page.rclr.Value 13275} 13276 13277// Creates a new instance of the RunCommandListResultPage type. 13278func NewRunCommandListResultPage(cur RunCommandListResult, getNextPage func(context.Context, RunCommandListResult) (RunCommandListResult, error)) RunCommandListResultPage { 13279 return RunCommandListResultPage{ 13280 fn: getNextPage, 13281 rclr: cur, 13282 } 13283} 13284 13285// RunCommandParameterDefinition describes the properties of a run command parameter. 13286type RunCommandParameterDefinition struct { 13287 // Name - The run command parameter name. 13288 Name *string `json:"name,omitempty"` 13289 // Type - The run command parameter type. 13290 Type *string `json:"type,omitempty"` 13291 // DefaultValue - The run command parameter default value. 13292 DefaultValue *string `json:"defaultValue,omitempty"` 13293 // Required - The run command parameter required. 13294 Required *bool `json:"required,omitempty"` 13295} 13296 13297// RunCommandResult ... 13298type RunCommandResult struct { 13299 autorest.Response `json:"-"` 13300 // Value - Run command operation response. 13301 Value *[]InstanceViewStatus `json:"value,omitempty"` 13302} 13303 13304// ScaleInPolicy describes a scale-in policy for a virtual machine scale set. 13305type ScaleInPolicy struct { 13306 // 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> 13307 Rules *[]VirtualMachineScaleSetScaleInRules `json:"rules,omitempty"` 13308} 13309 13310// ScheduledEventsProfile ... 13311type ScheduledEventsProfile struct { 13312 // TerminateNotificationProfile - Specifies Terminate Scheduled Event related configurations. 13313 TerminateNotificationProfile *TerminateNotificationProfile `json:"terminateNotificationProfile,omitempty"` 13314} 13315 13316// SecurityProfile specifies the Security profile settings for the virtual machine or virtual machine scale 13317// set. 13318type SecurityProfile struct { 13319 // UefiSettings - Specifies the security settings like secure boot and vTPM used while creating the virtual machine. <br><br>Minimum api-version: 2020-12-01 13320 UefiSettings *UefiSettings `json:"uefiSettings,omitempty"` 13321 // 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. 13322 EncryptionAtHost *bool `json:"encryptionAtHost,omitempty"` 13323 // 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' 13324 SecurityType SecurityTypes `json:"securityType,omitempty"` 13325} 13326 13327// SharedGallery specifies information about the Shared Gallery that you want to create or update. 13328type SharedGallery struct { 13329 autorest.Response `json:"-"` 13330 *SharedGalleryIdentifier `json:"identifier,omitempty"` 13331 // Name - READ-ONLY; Resource name 13332 Name *string `json:"name,omitempty"` 13333 // Location - READ-ONLY; Resource location 13334 Location *string `json:"location,omitempty"` 13335} 13336 13337// MarshalJSON is the custom marshaler for SharedGallery. 13338func (sg SharedGallery) MarshalJSON() ([]byte, error) { 13339 objectMap := make(map[string]interface{}) 13340 if sg.SharedGalleryIdentifier != nil { 13341 objectMap["identifier"] = sg.SharedGalleryIdentifier 13342 } 13343 return json.Marshal(objectMap) 13344} 13345 13346// UnmarshalJSON is the custom unmarshaler for SharedGallery struct. 13347func (sg *SharedGallery) UnmarshalJSON(body []byte) error { 13348 var m map[string]*json.RawMessage 13349 err := json.Unmarshal(body, &m) 13350 if err != nil { 13351 return err 13352 } 13353 for k, v := range m { 13354 switch k { 13355 case "identifier": 13356 if v != nil { 13357 var sharedGalleryIdentifier SharedGalleryIdentifier 13358 err = json.Unmarshal(*v, &sharedGalleryIdentifier) 13359 if err != nil { 13360 return err 13361 } 13362 sg.SharedGalleryIdentifier = &sharedGalleryIdentifier 13363 } 13364 case "name": 13365 if v != nil { 13366 var name string 13367 err = json.Unmarshal(*v, &name) 13368 if err != nil { 13369 return err 13370 } 13371 sg.Name = &name 13372 } 13373 case "location": 13374 if v != nil { 13375 var location string 13376 err = json.Unmarshal(*v, &location) 13377 if err != nil { 13378 return err 13379 } 13380 sg.Location = &location 13381 } 13382 } 13383 } 13384 13385 return nil 13386} 13387 13388// SharedGalleryIdentifier the identifier information of shared gallery. 13389type SharedGalleryIdentifier struct { 13390 // UniqueID - The unique id of this shared gallery. 13391 UniqueID *string `json:"uniqueId,omitempty"` 13392} 13393 13394// SharedGalleryImage specifies information about the gallery image definition that you want to create or 13395// update. 13396type SharedGalleryImage struct { 13397 autorest.Response `json:"-"` 13398 *SharedGalleryImageProperties `json:"properties,omitempty"` 13399 *SharedGalleryIdentifier `json:"identifier,omitempty"` 13400 // Name - READ-ONLY; Resource name 13401 Name *string `json:"name,omitempty"` 13402 // Location - READ-ONLY; Resource location 13403 Location *string `json:"location,omitempty"` 13404} 13405 13406// MarshalJSON is the custom marshaler for SharedGalleryImage. 13407func (sgi SharedGalleryImage) MarshalJSON() ([]byte, error) { 13408 objectMap := make(map[string]interface{}) 13409 if sgi.SharedGalleryImageProperties != nil { 13410 objectMap["properties"] = sgi.SharedGalleryImageProperties 13411 } 13412 if sgi.SharedGalleryIdentifier != nil { 13413 objectMap["identifier"] = sgi.SharedGalleryIdentifier 13414 } 13415 return json.Marshal(objectMap) 13416} 13417 13418// UnmarshalJSON is the custom unmarshaler for SharedGalleryImage struct. 13419func (sgi *SharedGalleryImage) UnmarshalJSON(body []byte) error { 13420 var m map[string]*json.RawMessage 13421 err := json.Unmarshal(body, &m) 13422 if err != nil { 13423 return err 13424 } 13425 for k, v := range m { 13426 switch k { 13427 case "properties": 13428 if v != nil { 13429 var sharedGalleryImageProperties SharedGalleryImageProperties 13430 err = json.Unmarshal(*v, &sharedGalleryImageProperties) 13431 if err != nil { 13432 return err 13433 } 13434 sgi.SharedGalleryImageProperties = &sharedGalleryImageProperties 13435 } 13436 case "identifier": 13437 if v != nil { 13438 var sharedGalleryIdentifier SharedGalleryIdentifier 13439 err = json.Unmarshal(*v, &sharedGalleryIdentifier) 13440 if err != nil { 13441 return err 13442 } 13443 sgi.SharedGalleryIdentifier = &sharedGalleryIdentifier 13444 } 13445 case "name": 13446 if v != nil { 13447 var name string 13448 err = json.Unmarshal(*v, &name) 13449 if err != nil { 13450 return err 13451 } 13452 sgi.Name = &name 13453 } 13454 case "location": 13455 if v != nil { 13456 var location string 13457 err = json.Unmarshal(*v, &location) 13458 if err != nil { 13459 return err 13460 } 13461 sgi.Location = &location 13462 } 13463 } 13464 } 13465 13466 return nil 13467} 13468 13469// SharedGalleryImageList the List Shared Gallery Images operation response. 13470type SharedGalleryImageList struct { 13471 autorest.Response `json:"-"` 13472 // Value - A list of shared gallery images. 13473 Value *[]SharedGalleryImage `json:"value,omitempty"` 13474 // 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. 13475 NextLink *string `json:"nextLink,omitempty"` 13476} 13477 13478// SharedGalleryImageListIterator provides access to a complete listing of SharedGalleryImage values. 13479type SharedGalleryImageListIterator struct { 13480 i int 13481 page SharedGalleryImageListPage 13482} 13483 13484// NextWithContext advances to the next value. If there was an error making 13485// the request the iterator does not advance and the error is returned. 13486func (iter *SharedGalleryImageListIterator) NextWithContext(ctx context.Context) (err error) { 13487 if tracing.IsEnabled() { 13488 ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImageListIterator.NextWithContext") 13489 defer func() { 13490 sc := -1 13491 if iter.Response().Response.Response != nil { 13492 sc = iter.Response().Response.Response.StatusCode 13493 } 13494 tracing.EndSpan(ctx, sc, err) 13495 }() 13496 } 13497 iter.i++ 13498 if iter.i < len(iter.page.Values()) { 13499 return nil 13500 } 13501 err = iter.page.NextWithContext(ctx) 13502 if err != nil { 13503 iter.i-- 13504 return err 13505 } 13506 iter.i = 0 13507 return nil 13508} 13509 13510// Next advances to the next value. If there was an error making 13511// the request the iterator does not advance and the error is returned. 13512// Deprecated: Use NextWithContext() instead. 13513func (iter *SharedGalleryImageListIterator) Next() error { 13514 return iter.NextWithContext(context.Background()) 13515} 13516 13517// NotDone returns true if the enumeration should be started or is not yet complete. 13518func (iter SharedGalleryImageListIterator) NotDone() bool { 13519 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 13520} 13521 13522// Response returns the raw server response from the last page request. 13523func (iter SharedGalleryImageListIterator) Response() SharedGalleryImageList { 13524 return iter.page.Response() 13525} 13526 13527// Value returns the current value or a zero-initialized value if the 13528// iterator has advanced beyond the end of the collection. 13529func (iter SharedGalleryImageListIterator) Value() SharedGalleryImage { 13530 if !iter.page.NotDone() { 13531 return SharedGalleryImage{} 13532 } 13533 return iter.page.Values()[iter.i] 13534} 13535 13536// Creates a new instance of the SharedGalleryImageListIterator type. 13537func NewSharedGalleryImageListIterator(page SharedGalleryImageListPage) SharedGalleryImageListIterator { 13538 return SharedGalleryImageListIterator{page: page} 13539} 13540 13541// IsEmpty returns true if the ListResult contains no values. 13542func (sgil SharedGalleryImageList) IsEmpty() bool { 13543 return sgil.Value == nil || len(*sgil.Value) == 0 13544} 13545 13546// hasNextLink returns true if the NextLink is not empty. 13547func (sgil SharedGalleryImageList) hasNextLink() bool { 13548 return sgil.NextLink != nil && len(*sgil.NextLink) != 0 13549} 13550 13551// sharedGalleryImageListPreparer prepares a request to retrieve the next set of results. 13552// It returns nil if no more results exist. 13553func (sgil SharedGalleryImageList) sharedGalleryImageListPreparer(ctx context.Context) (*http.Request, error) { 13554 if !sgil.hasNextLink() { 13555 return nil, nil 13556 } 13557 return autorest.Prepare((&http.Request{}).WithContext(ctx), 13558 autorest.AsJSON(), 13559 autorest.AsGet(), 13560 autorest.WithBaseURL(to.String(sgil.NextLink))) 13561} 13562 13563// SharedGalleryImageListPage contains a page of SharedGalleryImage values. 13564type SharedGalleryImageListPage struct { 13565 fn func(context.Context, SharedGalleryImageList) (SharedGalleryImageList, error) 13566 sgil SharedGalleryImageList 13567} 13568 13569// NextWithContext advances to the next page of values. If there was an error making 13570// the request the page does not advance and the error is returned. 13571func (page *SharedGalleryImageListPage) NextWithContext(ctx context.Context) (err error) { 13572 if tracing.IsEnabled() { 13573 ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImageListPage.NextWithContext") 13574 defer func() { 13575 sc := -1 13576 if page.Response().Response.Response != nil { 13577 sc = page.Response().Response.Response.StatusCode 13578 } 13579 tracing.EndSpan(ctx, sc, err) 13580 }() 13581 } 13582 for { 13583 next, err := page.fn(ctx, page.sgil) 13584 if err != nil { 13585 return err 13586 } 13587 page.sgil = next 13588 if !next.hasNextLink() || !next.IsEmpty() { 13589 break 13590 } 13591 } 13592 return nil 13593} 13594 13595// Next advances to the next page of values. If there was an error making 13596// the request the page does not advance and the error is returned. 13597// Deprecated: Use NextWithContext() instead. 13598func (page *SharedGalleryImageListPage) Next() error { 13599 return page.NextWithContext(context.Background()) 13600} 13601 13602// NotDone returns true if the page enumeration should be started or is not yet complete. 13603func (page SharedGalleryImageListPage) NotDone() bool { 13604 return !page.sgil.IsEmpty() 13605} 13606 13607// Response returns the raw server response from the last page request. 13608func (page SharedGalleryImageListPage) Response() SharedGalleryImageList { 13609 return page.sgil 13610} 13611 13612// Values returns the slice of values for the current page or nil if there are no values. 13613func (page SharedGalleryImageListPage) Values() []SharedGalleryImage { 13614 if page.sgil.IsEmpty() { 13615 return nil 13616 } 13617 return *page.sgil.Value 13618} 13619 13620// Creates a new instance of the SharedGalleryImageListPage type. 13621func NewSharedGalleryImageListPage(cur SharedGalleryImageList, getNextPage func(context.Context, SharedGalleryImageList) (SharedGalleryImageList, error)) SharedGalleryImageListPage { 13622 return SharedGalleryImageListPage{ 13623 fn: getNextPage, 13624 sgil: cur, 13625 } 13626} 13627 13628// SharedGalleryImageProperties describes the properties of a gallery image definition. 13629type SharedGalleryImageProperties struct { 13630 // 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' 13631 OsType OperatingSystemTypes `json:"osType,omitempty"` 13632 // 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' 13633 OsState OperatingSystemStateTypes `json:"osState,omitempty"` 13634 // EndOfLifeDate - The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property is updatable. 13635 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 13636 Identifier *GalleryImageIdentifier `json:"identifier,omitempty"` 13637 Recommended *RecommendedMachineConfiguration `json:"recommended,omitempty"` 13638 Disallowed *Disallowed `json:"disallowed,omitempty"` 13639 // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'HyperVGenerationV1', 'HyperVGenerationV2' 13640 HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` 13641 // Features - A list of gallery image features. 13642 Features *[]GalleryImageFeature `json:"features,omitempty"` 13643 PurchasePlan *ImagePurchasePlan `json:"purchasePlan,omitempty"` 13644} 13645 13646// SharedGalleryImageVersion specifies information about the gallery image version that you want to create 13647// or update. 13648type SharedGalleryImageVersion struct { 13649 autorest.Response `json:"-"` 13650 *SharedGalleryImageVersionProperties `json:"properties,omitempty"` 13651 *SharedGalleryIdentifier `json:"identifier,omitempty"` 13652 // Name - READ-ONLY; Resource name 13653 Name *string `json:"name,omitempty"` 13654 // Location - READ-ONLY; Resource location 13655 Location *string `json:"location,omitempty"` 13656} 13657 13658// MarshalJSON is the custom marshaler for SharedGalleryImageVersion. 13659func (sgiv SharedGalleryImageVersion) MarshalJSON() ([]byte, error) { 13660 objectMap := make(map[string]interface{}) 13661 if sgiv.SharedGalleryImageVersionProperties != nil { 13662 objectMap["properties"] = sgiv.SharedGalleryImageVersionProperties 13663 } 13664 if sgiv.SharedGalleryIdentifier != nil { 13665 objectMap["identifier"] = sgiv.SharedGalleryIdentifier 13666 } 13667 return json.Marshal(objectMap) 13668} 13669 13670// UnmarshalJSON is the custom unmarshaler for SharedGalleryImageVersion struct. 13671func (sgiv *SharedGalleryImageVersion) UnmarshalJSON(body []byte) error { 13672 var m map[string]*json.RawMessage 13673 err := json.Unmarshal(body, &m) 13674 if err != nil { 13675 return err 13676 } 13677 for k, v := range m { 13678 switch k { 13679 case "properties": 13680 if v != nil { 13681 var sharedGalleryImageVersionProperties SharedGalleryImageVersionProperties 13682 err = json.Unmarshal(*v, &sharedGalleryImageVersionProperties) 13683 if err != nil { 13684 return err 13685 } 13686 sgiv.SharedGalleryImageVersionProperties = &sharedGalleryImageVersionProperties 13687 } 13688 case "identifier": 13689 if v != nil { 13690 var sharedGalleryIdentifier SharedGalleryIdentifier 13691 err = json.Unmarshal(*v, &sharedGalleryIdentifier) 13692 if err != nil { 13693 return err 13694 } 13695 sgiv.SharedGalleryIdentifier = &sharedGalleryIdentifier 13696 } 13697 case "name": 13698 if v != nil { 13699 var name string 13700 err = json.Unmarshal(*v, &name) 13701 if err != nil { 13702 return err 13703 } 13704 sgiv.Name = &name 13705 } 13706 case "location": 13707 if v != nil { 13708 var location string 13709 err = json.Unmarshal(*v, &location) 13710 if err != nil { 13711 return err 13712 } 13713 sgiv.Location = &location 13714 } 13715 } 13716 } 13717 13718 return nil 13719} 13720 13721// SharedGalleryImageVersionList the List Shared Gallery Image versions operation response. 13722type SharedGalleryImageVersionList struct { 13723 autorest.Response `json:"-"` 13724 // Value - A list of shared gallery images versions. 13725 Value *[]SharedGalleryImageVersion `json:"value,omitempty"` 13726 // 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. 13727 NextLink *string `json:"nextLink,omitempty"` 13728} 13729 13730// SharedGalleryImageVersionListIterator provides access to a complete listing of SharedGalleryImageVersion 13731// values. 13732type SharedGalleryImageVersionListIterator struct { 13733 i int 13734 page SharedGalleryImageVersionListPage 13735} 13736 13737// NextWithContext advances to the next value. If there was an error making 13738// the request the iterator does not advance and the error is returned. 13739func (iter *SharedGalleryImageVersionListIterator) NextWithContext(ctx context.Context) (err error) { 13740 if tracing.IsEnabled() { 13741 ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImageVersionListIterator.NextWithContext") 13742 defer func() { 13743 sc := -1 13744 if iter.Response().Response.Response != nil { 13745 sc = iter.Response().Response.Response.StatusCode 13746 } 13747 tracing.EndSpan(ctx, sc, err) 13748 }() 13749 } 13750 iter.i++ 13751 if iter.i < len(iter.page.Values()) { 13752 return nil 13753 } 13754 err = iter.page.NextWithContext(ctx) 13755 if err != nil { 13756 iter.i-- 13757 return err 13758 } 13759 iter.i = 0 13760 return nil 13761} 13762 13763// Next advances to the next value. If there was an error making 13764// the request the iterator does not advance and the error is returned. 13765// Deprecated: Use NextWithContext() instead. 13766func (iter *SharedGalleryImageVersionListIterator) Next() error { 13767 return iter.NextWithContext(context.Background()) 13768} 13769 13770// NotDone returns true if the enumeration should be started or is not yet complete. 13771func (iter SharedGalleryImageVersionListIterator) NotDone() bool { 13772 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 13773} 13774 13775// Response returns the raw server response from the last page request. 13776func (iter SharedGalleryImageVersionListIterator) Response() SharedGalleryImageVersionList { 13777 return iter.page.Response() 13778} 13779 13780// Value returns the current value or a zero-initialized value if the 13781// iterator has advanced beyond the end of the collection. 13782func (iter SharedGalleryImageVersionListIterator) Value() SharedGalleryImageVersion { 13783 if !iter.page.NotDone() { 13784 return SharedGalleryImageVersion{} 13785 } 13786 return iter.page.Values()[iter.i] 13787} 13788 13789// Creates a new instance of the SharedGalleryImageVersionListIterator type. 13790func NewSharedGalleryImageVersionListIterator(page SharedGalleryImageVersionListPage) SharedGalleryImageVersionListIterator { 13791 return SharedGalleryImageVersionListIterator{page: page} 13792} 13793 13794// IsEmpty returns true if the ListResult contains no values. 13795func (sgivl SharedGalleryImageVersionList) IsEmpty() bool { 13796 return sgivl.Value == nil || len(*sgivl.Value) == 0 13797} 13798 13799// hasNextLink returns true if the NextLink is not empty. 13800func (sgivl SharedGalleryImageVersionList) hasNextLink() bool { 13801 return sgivl.NextLink != nil && len(*sgivl.NextLink) != 0 13802} 13803 13804// sharedGalleryImageVersionListPreparer prepares a request to retrieve the next set of results. 13805// It returns nil if no more results exist. 13806func (sgivl SharedGalleryImageVersionList) sharedGalleryImageVersionListPreparer(ctx context.Context) (*http.Request, error) { 13807 if !sgivl.hasNextLink() { 13808 return nil, nil 13809 } 13810 return autorest.Prepare((&http.Request{}).WithContext(ctx), 13811 autorest.AsJSON(), 13812 autorest.AsGet(), 13813 autorest.WithBaseURL(to.String(sgivl.NextLink))) 13814} 13815 13816// SharedGalleryImageVersionListPage contains a page of SharedGalleryImageVersion values. 13817type SharedGalleryImageVersionListPage struct { 13818 fn func(context.Context, SharedGalleryImageVersionList) (SharedGalleryImageVersionList, error) 13819 sgivl SharedGalleryImageVersionList 13820} 13821 13822// NextWithContext advances to the next page of values. If there was an error making 13823// the request the page does not advance and the error is returned. 13824func (page *SharedGalleryImageVersionListPage) NextWithContext(ctx context.Context) (err error) { 13825 if tracing.IsEnabled() { 13826 ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImageVersionListPage.NextWithContext") 13827 defer func() { 13828 sc := -1 13829 if page.Response().Response.Response != nil { 13830 sc = page.Response().Response.Response.StatusCode 13831 } 13832 tracing.EndSpan(ctx, sc, err) 13833 }() 13834 } 13835 for { 13836 next, err := page.fn(ctx, page.sgivl) 13837 if err != nil { 13838 return err 13839 } 13840 page.sgivl = next 13841 if !next.hasNextLink() || !next.IsEmpty() { 13842 break 13843 } 13844 } 13845 return nil 13846} 13847 13848// Next advances to the next page of values. If there was an error making 13849// the request the page does not advance and the error is returned. 13850// Deprecated: Use NextWithContext() instead. 13851func (page *SharedGalleryImageVersionListPage) Next() error { 13852 return page.NextWithContext(context.Background()) 13853} 13854 13855// NotDone returns true if the page enumeration should be started or is not yet complete. 13856func (page SharedGalleryImageVersionListPage) NotDone() bool { 13857 return !page.sgivl.IsEmpty() 13858} 13859 13860// Response returns the raw server response from the last page request. 13861func (page SharedGalleryImageVersionListPage) Response() SharedGalleryImageVersionList { 13862 return page.sgivl 13863} 13864 13865// Values returns the slice of values for the current page or nil if there are no values. 13866func (page SharedGalleryImageVersionListPage) Values() []SharedGalleryImageVersion { 13867 if page.sgivl.IsEmpty() { 13868 return nil 13869 } 13870 return *page.sgivl.Value 13871} 13872 13873// Creates a new instance of the SharedGalleryImageVersionListPage type. 13874func NewSharedGalleryImageVersionListPage(cur SharedGalleryImageVersionList, getNextPage func(context.Context, SharedGalleryImageVersionList) (SharedGalleryImageVersionList, error)) SharedGalleryImageVersionListPage { 13875 return SharedGalleryImageVersionListPage{ 13876 fn: getNextPage, 13877 sgivl: cur, 13878 } 13879} 13880 13881// SharedGalleryImageVersionProperties describes the properties of a gallery image version. 13882type SharedGalleryImageVersionProperties struct { 13883 // PublishedDate - The published date of the gallery image version Definition. This property can be used for decommissioning purposes. This property is updatable. 13884 PublishedDate *date.Time `json:"publishedDate,omitempty"` 13885 // EndOfLifeDate - The end of life date of the gallery image version Definition. This property can be used for decommissioning purposes. This property is updatable. 13886 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 13887} 13888 13889// SharedGalleryList the List Shared Galleries operation response. 13890type SharedGalleryList struct { 13891 autorest.Response `json:"-"` 13892 // Value - A list of shared galleries. 13893 Value *[]SharedGallery `json:"value,omitempty"` 13894 // NextLink - The uri to fetch the next page of shared galleries. Call ListNext() with this to fetch the next page of shared galleries. 13895 NextLink *string `json:"nextLink,omitempty"` 13896} 13897 13898// SharedGalleryListIterator provides access to a complete listing of SharedGallery values. 13899type SharedGalleryListIterator struct { 13900 i int 13901 page SharedGalleryListPage 13902} 13903 13904// NextWithContext advances to the next value. If there was an error making 13905// the request the iterator does not advance and the error is returned. 13906func (iter *SharedGalleryListIterator) NextWithContext(ctx context.Context) (err error) { 13907 if tracing.IsEnabled() { 13908 ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryListIterator.NextWithContext") 13909 defer func() { 13910 sc := -1 13911 if iter.Response().Response.Response != nil { 13912 sc = iter.Response().Response.Response.StatusCode 13913 } 13914 tracing.EndSpan(ctx, sc, err) 13915 }() 13916 } 13917 iter.i++ 13918 if iter.i < len(iter.page.Values()) { 13919 return nil 13920 } 13921 err = iter.page.NextWithContext(ctx) 13922 if err != nil { 13923 iter.i-- 13924 return err 13925 } 13926 iter.i = 0 13927 return nil 13928} 13929 13930// Next advances to the next value. If there was an error making 13931// the request the iterator does not advance and the error is returned. 13932// Deprecated: Use NextWithContext() instead. 13933func (iter *SharedGalleryListIterator) Next() error { 13934 return iter.NextWithContext(context.Background()) 13935} 13936 13937// NotDone returns true if the enumeration should be started or is not yet complete. 13938func (iter SharedGalleryListIterator) NotDone() bool { 13939 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 13940} 13941 13942// Response returns the raw server response from the last page request. 13943func (iter SharedGalleryListIterator) Response() SharedGalleryList { 13944 return iter.page.Response() 13945} 13946 13947// Value returns the current value or a zero-initialized value if the 13948// iterator has advanced beyond the end of the collection. 13949func (iter SharedGalleryListIterator) Value() SharedGallery { 13950 if !iter.page.NotDone() { 13951 return SharedGallery{} 13952 } 13953 return iter.page.Values()[iter.i] 13954} 13955 13956// Creates a new instance of the SharedGalleryListIterator type. 13957func NewSharedGalleryListIterator(page SharedGalleryListPage) SharedGalleryListIterator { 13958 return SharedGalleryListIterator{page: page} 13959} 13960 13961// IsEmpty returns true if the ListResult contains no values. 13962func (sgl SharedGalleryList) IsEmpty() bool { 13963 return sgl.Value == nil || len(*sgl.Value) == 0 13964} 13965 13966// hasNextLink returns true if the NextLink is not empty. 13967func (sgl SharedGalleryList) hasNextLink() bool { 13968 return sgl.NextLink != nil && len(*sgl.NextLink) != 0 13969} 13970 13971// sharedGalleryListPreparer prepares a request to retrieve the next set of results. 13972// It returns nil if no more results exist. 13973func (sgl SharedGalleryList) sharedGalleryListPreparer(ctx context.Context) (*http.Request, error) { 13974 if !sgl.hasNextLink() { 13975 return nil, nil 13976 } 13977 return autorest.Prepare((&http.Request{}).WithContext(ctx), 13978 autorest.AsJSON(), 13979 autorest.AsGet(), 13980 autorest.WithBaseURL(to.String(sgl.NextLink))) 13981} 13982 13983// SharedGalleryListPage contains a page of SharedGallery values. 13984type SharedGalleryListPage struct { 13985 fn func(context.Context, SharedGalleryList) (SharedGalleryList, error) 13986 sgl SharedGalleryList 13987} 13988 13989// NextWithContext advances to the next page of values. If there was an error making 13990// the request the page does not advance and the error is returned. 13991func (page *SharedGalleryListPage) NextWithContext(ctx context.Context) (err error) { 13992 if tracing.IsEnabled() { 13993 ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryListPage.NextWithContext") 13994 defer func() { 13995 sc := -1 13996 if page.Response().Response.Response != nil { 13997 sc = page.Response().Response.Response.StatusCode 13998 } 13999 tracing.EndSpan(ctx, sc, err) 14000 }() 14001 } 14002 for { 14003 next, err := page.fn(ctx, page.sgl) 14004 if err != nil { 14005 return err 14006 } 14007 page.sgl = next 14008 if !next.hasNextLink() || !next.IsEmpty() { 14009 break 14010 } 14011 } 14012 return nil 14013} 14014 14015// Next advances to the next page of values. If there was an error making 14016// the request the page does not advance and the error is returned. 14017// Deprecated: Use NextWithContext() instead. 14018func (page *SharedGalleryListPage) Next() error { 14019 return page.NextWithContext(context.Background()) 14020} 14021 14022// NotDone returns true if the page enumeration should be started or is not yet complete. 14023func (page SharedGalleryListPage) NotDone() bool { 14024 return !page.sgl.IsEmpty() 14025} 14026 14027// Response returns the raw server response from the last page request. 14028func (page SharedGalleryListPage) Response() SharedGalleryList { 14029 return page.sgl 14030} 14031 14032// Values returns the slice of values for the current page or nil if there are no values. 14033func (page SharedGalleryListPage) Values() []SharedGallery { 14034 if page.sgl.IsEmpty() { 14035 return nil 14036 } 14037 return *page.sgl.Value 14038} 14039 14040// Creates a new instance of the SharedGalleryListPage type. 14041func NewSharedGalleryListPage(cur SharedGalleryList, getNextPage func(context.Context, SharedGalleryList) (SharedGalleryList, error)) SharedGalleryListPage { 14042 return SharedGalleryListPage{ 14043 fn: getNextPage, 14044 sgl: cur, 14045 } 14046} 14047 14048// ShareInfoElement ... 14049type ShareInfoElement struct { 14050 // VMURI - READ-ONLY; A relative URI containing the ID of the VM that has the disk attached. 14051 VMURI *string `json:"vmUri,omitempty"` 14052} 14053 14054// MarshalJSON is the custom marshaler for ShareInfoElement. 14055func (sie ShareInfoElement) MarshalJSON() ([]byte, error) { 14056 objectMap := make(map[string]interface{}) 14057 return json.Marshal(objectMap) 14058} 14059 14060// SharingProfile profile for gallery sharing to subscription or tenant 14061type SharingProfile struct { 14062 // 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' 14063 Permissions GallerySharingPermissionTypes `json:"permissions,omitempty"` 14064 // Groups - READ-ONLY; A list of sharing profile groups. 14065 Groups *[]SharingProfileGroup `json:"groups,omitempty"` 14066} 14067 14068// MarshalJSON is the custom marshaler for SharingProfile. 14069func (sp SharingProfile) MarshalJSON() ([]byte, error) { 14070 objectMap := make(map[string]interface{}) 14071 if sp.Permissions != "" { 14072 objectMap["permissions"] = sp.Permissions 14073 } 14074 return json.Marshal(objectMap) 14075} 14076 14077// SharingProfileGroup group of the gallery sharing profile 14078type SharingProfileGroup struct { 14079 // 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' 14080 Type SharingProfileGroupTypes `json:"type,omitempty"` 14081 // Ids - A list of subscription/tenant ids the gallery is aimed to be shared to. 14082 Ids *[]string `json:"ids,omitempty"` 14083} 14084 14085// SharingUpdate specifies information about the gallery sharing profile update. 14086type SharingUpdate struct { 14087 autorest.Response `json:"-"` 14088 // 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' 14089 OperationType SharingUpdateOperationTypes `json:"operationType,omitempty"` 14090 // Groups - A list of sharing profile groups. 14091 Groups *[]SharingProfileGroup `json:"groups,omitempty"` 14092} 14093 14094// Sku describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware 14095// the scale set is currently on, you need to deallocate the VMs in the scale set before you modify the SKU 14096// name. 14097type Sku struct { 14098 // Name - The sku name. 14099 Name *string `json:"name,omitempty"` 14100 // Tier - Specifies the tier of virtual machines in a scale set.<br /><br /> Possible Values:<br /><br /> **Standard**<br /><br /> **Basic** 14101 Tier *string `json:"tier,omitempty"` 14102 // Capacity - Specifies the number of virtual machines in the scale set. 14103 Capacity *int64 `json:"capacity,omitempty"` 14104} 14105 14106// Snapshot snapshot resource. 14107type Snapshot struct { 14108 autorest.Response `json:"-"` 14109 // ManagedBy - READ-ONLY; Unused. Always Null. 14110 ManagedBy *string `json:"managedBy,omitempty"` 14111 Sku *SnapshotSku `json:"sku,omitempty"` 14112 // ExtendedLocation - The extended location where the snapshot will be created. Extended location cannot be changed. 14113 ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` 14114 *SnapshotProperties `json:"properties,omitempty"` 14115 // ID - READ-ONLY; Resource Id 14116 ID *string `json:"id,omitempty"` 14117 // Name - READ-ONLY; Resource name 14118 Name *string `json:"name,omitempty"` 14119 // Type - READ-ONLY; Resource type 14120 Type *string `json:"type,omitempty"` 14121 // Location - Resource location 14122 Location *string `json:"location,omitempty"` 14123 // Tags - Resource tags 14124 Tags map[string]*string `json:"tags"` 14125} 14126 14127// MarshalJSON is the custom marshaler for Snapshot. 14128func (s Snapshot) MarshalJSON() ([]byte, error) { 14129 objectMap := make(map[string]interface{}) 14130 if s.Sku != nil { 14131 objectMap["sku"] = s.Sku 14132 } 14133 if s.ExtendedLocation != nil { 14134 objectMap["extendedLocation"] = s.ExtendedLocation 14135 } 14136 if s.SnapshotProperties != nil { 14137 objectMap["properties"] = s.SnapshotProperties 14138 } 14139 if s.Location != nil { 14140 objectMap["location"] = s.Location 14141 } 14142 if s.Tags != nil { 14143 objectMap["tags"] = s.Tags 14144 } 14145 return json.Marshal(objectMap) 14146} 14147 14148// UnmarshalJSON is the custom unmarshaler for Snapshot struct. 14149func (s *Snapshot) UnmarshalJSON(body []byte) error { 14150 var m map[string]*json.RawMessage 14151 err := json.Unmarshal(body, &m) 14152 if err != nil { 14153 return err 14154 } 14155 for k, v := range m { 14156 switch k { 14157 case "managedBy": 14158 if v != nil { 14159 var managedBy string 14160 err = json.Unmarshal(*v, &managedBy) 14161 if err != nil { 14162 return err 14163 } 14164 s.ManagedBy = &managedBy 14165 } 14166 case "sku": 14167 if v != nil { 14168 var sku SnapshotSku 14169 err = json.Unmarshal(*v, &sku) 14170 if err != nil { 14171 return err 14172 } 14173 s.Sku = &sku 14174 } 14175 case "extendedLocation": 14176 if v != nil { 14177 var extendedLocation ExtendedLocation 14178 err = json.Unmarshal(*v, &extendedLocation) 14179 if err != nil { 14180 return err 14181 } 14182 s.ExtendedLocation = &extendedLocation 14183 } 14184 case "properties": 14185 if v != nil { 14186 var snapshotProperties SnapshotProperties 14187 err = json.Unmarshal(*v, &snapshotProperties) 14188 if err != nil { 14189 return err 14190 } 14191 s.SnapshotProperties = &snapshotProperties 14192 } 14193 case "id": 14194 if v != nil { 14195 var ID string 14196 err = json.Unmarshal(*v, &ID) 14197 if err != nil { 14198 return err 14199 } 14200 s.ID = &ID 14201 } 14202 case "name": 14203 if v != nil { 14204 var name string 14205 err = json.Unmarshal(*v, &name) 14206 if err != nil { 14207 return err 14208 } 14209 s.Name = &name 14210 } 14211 case "type": 14212 if v != nil { 14213 var typeVar string 14214 err = json.Unmarshal(*v, &typeVar) 14215 if err != nil { 14216 return err 14217 } 14218 s.Type = &typeVar 14219 } 14220 case "location": 14221 if v != nil { 14222 var location string 14223 err = json.Unmarshal(*v, &location) 14224 if err != nil { 14225 return err 14226 } 14227 s.Location = &location 14228 } 14229 case "tags": 14230 if v != nil { 14231 var tags map[string]*string 14232 err = json.Unmarshal(*v, &tags) 14233 if err != nil { 14234 return err 14235 } 14236 s.Tags = tags 14237 } 14238 } 14239 } 14240 14241 return nil 14242} 14243 14244// SnapshotList the List Snapshots operation response. 14245type SnapshotList struct { 14246 autorest.Response `json:"-"` 14247 // Value - A list of snapshots. 14248 Value *[]Snapshot `json:"value,omitempty"` 14249 // NextLink - The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the next page of snapshots. 14250 NextLink *string `json:"nextLink,omitempty"` 14251} 14252 14253// SnapshotListIterator provides access to a complete listing of Snapshot values. 14254type SnapshotListIterator struct { 14255 i int 14256 page SnapshotListPage 14257} 14258 14259// NextWithContext advances to the next value. If there was an error making 14260// the request the iterator does not advance and the error is returned. 14261func (iter *SnapshotListIterator) NextWithContext(ctx context.Context) (err error) { 14262 if tracing.IsEnabled() { 14263 ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotListIterator.NextWithContext") 14264 defer func() { 14265 sc := -1 14266 if iter.Response().Response.Response != nil { 14267 sc = iter.Response().Response.Response.StatusCode 14268 } 14269 tracing.EndSpan(ctx, sc, err) 14270 }() 14271 } 14272 iter.i++ 14273 if iter.i < len(iter.page.Values()) { 14274 return nil 14275 } 14276 err = iter.page.NextWithContext(ctx) 14277 if err != nil { 14278 iter.i-- 14279 return err 14280 } 14281 iter.i = 0 14282 return nil 14283} 14284 14285// Next advances to the next value. If there was an error making 14286// the request the iterator does not advance and the error is returned. 14287// Deprecated: Use NextWithContext() instead. 14288func (iter *SnapshotListIterator) Next() error { 14289 return iter.NextWithContext(context.Background()) 14290} 14291 14292// NotDone returns true if the enumeration should be started or is not yet complete. 14293func (iter SnapshotListIterator) NotDone() bool { 14294 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 14295} 14296 14297// Response returns the raw server response from the last page request. 14298func (iter SnapshotListIterator) Response() SnapshotList { 14299 return iter.page.Response() 14300} 14301 14302// Value returns the current value or a zero-initialized value if the 14303// iterator has advanced beyond the end of the collection. 14304func (iter SnapshotListIterator) Value() Snapshot { 14305 if !iter.page.NotDone() { 14306 return Snapshot{} 14307 } 14308 return iter.page.Values()[iter.i] 14309} 14310 14311// Creates a new instance of the SnapshotListIterator type. 14312func NewSnapshotListIterator(page SnapshotListPage) SnapshotListIterator { 14313 return SnapshotListIterator{page: page} 14314} 14315 14316// IsEmpty returns true if the ListResult contains no values. 14317func (sl SnapshotList) IsEmpty() bool { 14318 return sl.Value == nil || len(*sl.Value) == 0 14319} 14320 14321// hasNextLink returns true if the NextLink is not empty. 14322func (sl SnapshotList) hasNextLink() bool { 14323 return sl.NextLink != nil && len(*sl.NextLink) != 0 14324} 14325 14326// snapshotListPreparer prepares a request to retrieve the next set of results. 14327// It returns nil if no more results exist. 14328func (sl SnapshotList) snapshotListPreparer(ctx context.Context) (*http.Request, error) { 14329 if !sl.hasNextLink() { 14330 return nil, nil 14331 } 14332 return autorest.Prepare((&http.Request{}).WithContext(ctx), 14333 autorest.AsJSON(), 14334 autorest.AsGet(), 14335 autorest.WithBaseURL(to.String(sl.NextLink))) 14336} 14337 14338// SnapshotListPage contains a page of Snapshot values. 14339type SnapshotListPage struct { 14340 fn func(context.Context, SnapshotList) (SnapshotList, error) 14341 sl SnapshotList 14342} 14343 14344// NextWithContext advances to the next page of values. If there was an error making 14345// the request the page does not advance and the error is returned. 14346func (page *SnapshotListPage) NextWithContext(ctx context.Context) (err error) { 14347 if tracing.IsEnabled() { 14348 ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotListPage.NextWithContext") 14349 defer func() { 14350 sc := -1 14351 if page.Response().Response.Response != nil { 14352 sc = page.Response().Response.Response.StatusCode 14353 } 14354 tracing.EndSpan(ctx, sc, err) 14355 }() 14356 } 14357 for { 14358 next, err := page.fn(ctx, page.sl) 14359 if err != nil { 14360 return err 14361 } 14362 page.sl = next 14363 if !next.hasNextLink() || !next.IsEmpty() { 14364 break 14365 } 14366 } 14367 return nil 14368} 14369 14370// Next advances to the next page of values. If there was an error making 14371// the request the page does not advance and the error is returned. 14372// Deprecated: Use NextWithContext() instead. 14373func (page *SnapshotListPage) Next() error { 14374 return page.NextWithContext(context.Background()) 14375} 14376 14377// NotDone returns true if the page enumeration should be started or is not yet complete. 14378func (page SnapshotListPage) NotDone() bool { 14379 return !page.sl.IsEmpty() 14380} 14381 14382// Response returns the raw server response from the last page request. 14383func (page SnapshotListPage) Response() SnapshotList { 14384 return page.sl 14385} 14386 14387// Values returns the slice of values for the current page or nil if there are no values. 14388func (page SnapshotListPage) Values() []Snapshot { 14389 if page.sl.IsEmpty() { 14390 return nil 14391 } 14392 return *page.sl.Value 14393} 14394 14395// Creates a new instance of the SnapshotListPage type. 14396func NewSnapshotListPage(cur SnapshotList, getNextPage func(context.Context, SnapshotList) (SnapshotList, error)) SnapshotListPage { 14397 return SnapshotListPage{ 14398 fn: getNextPage, 14399 sl: cur, 14400 } 14401} 14402 14403// SnapshotProperties snapshot resource properties. 14404type SnapshotProperties struct { 14405 // TimeCreated - READ-ONLY; The time when the snapshot was created. 14406 TimeCreated *date.Time `json:"timeCreated,omitempty"` 14407 // OsType - The Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' 14408 OsType OperatingSystemTypes `json:"osType,omitempty"` 14409 // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'HyperVGenerationV1', 'HyperVGenerationV2' 14410 HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` 14411 // PurchasePlan - Purchase plan information for the image from which the source disk for the snapshot was originally created. 14412 PurchasePlan *PurchasePlan `json:"purchasePlan,omitempty"` 14413 // CreationData - Disk source information. CreationData information cannot be changed after the disk has been created. 14414 CreationData *CreationData `json:"creationData,omitempty"` 14415 // 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. 14416 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 14417 // DiskSizeBytes - READ-ONLY; The size of the disk in bytes. This field is read only. 14418 DiskSizeBytes *int64 `json:"diskSizeBytes,omitempty"` 14419 // DiskState - The state of the snapshot. Possible values include: 'DiskStateUnattached', 'DiskStateAttached', 'DiskStateReserved', 'DiskStateActiveSAS', 'DiskStateReadyToUpload', 'DiskStateActiveUpload' 14420 DiskState DiskState `json:"diskState,omitempty"` 14421 // UniqueID - READ-ONLY; Unique Guid identifying the resource. 14422 UniqueID *string `json:"uniqueId,omitempty"` 14423 // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. 14424 EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` 14425 // ProvisioningState - READ-ONLY; The disk provisioning state. 14426 ProvisioningState *string `json:"provisioningState,omitempty"` 14427 // Incremental - Whether a snapshot is incremental. Incremental snapshots on the same disk occupy less space than full snapshots and can be diffed. 14428 Incremental *bool `json:"incremental,omitempty"` 14429 // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 14430 Encryption *Encryption `json:"encryption,omitempty"` 14431 // NetworkAccessPolicy - Possible values include: 'NetworkAccessPolicyAllowAll', 'NetworkAccessPolicyAllowPrivate', 'NetworkAccessPolicyDenyAll' 14432 NetworkAccessPolicy NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` 14433 // DiskAccessID - ARM id of the DiskAccess resource for using private endpoints on disks. 14434 DiskAccessID *string `json:"diskAccessId,omitempty"` 14435 // SupportsHibernation - Indicates the OS on a snapshot supports hibernation. 14436 SupportsHibernation *bool `json:"supportsHibernation,omitempty"` 14437} 14438 14439// MarshalJSON is the custom marshaler for SnapshotProperties. 14440func (sp SnapshotProperties) MarshalJSON() ([]byte, error) { 14441 objectMap := make(map[string]interface{}) 14442 if sp.OsType != "" { 14443 objectMap["osType"] = sp.OsType 14444 } 14445 if sp.HyperVGeneration != "" { 14446 objectMap["hyperVGeneration"] = sp.HyperVGeneration 14447 } 14448 if sp.PurchasePlan != nil { 14449 objectMap["purchasePlan"] = sp.PurchasePlan 14450 } 14451 if sp.CreationData != nil { 14452 objectMap["creationData"] = sp.CreationData 14453 } 14454 if sp.DiskSizeGB != nil { 14455 objectMap["diskSizeGB"] = sp.DiskSizeGB 14456 } 14457 if sp.DiskState != "" { 14458 objectMap["diskState"] = sp.DiskState 14459 } 14460 if sp.EncryptionSettingsCollection != nil { 14461 objectMap["encryptionSettingsCollection"] = sp.EncryptionSettingsCollection 14462 } 14463 if sp.Incremental != nil { 14464 objectMap["incremental"] = sp.Incremental 14465 } 14466 if sp.Encryption != nil { 14467 objectMap["encryption"] = sp.Encryption 14468 } 14469 if sp.NetworkAccessPolicy != "" { 14470 objectMap["networkAccessPolicy"] = sp.NetworkAccessPolicy 14471 } 14472 if sp.DiskAccessID != nil { 14473 objectMap["diskAccessId"] = sp.DiskAccessID 14474 } 14475 if sp.SupportsHibernation != nil { 14476 objectMap["supportsHibernation"] = sp.SupportsHibernation 14477 } 14478 return json.Marshal(objectMap) 14479} 14480 14481// SnapshotsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 14482// operation. 14483type SnapshotsCreateOrUpdateFuture struct { 14484 azure.FutureAPI 14485 // Result returns the result of the asynchronous operation. 14486 // If the operation has not completed it will return an error. 14487 Result func(SnapshotsClient) (Snapshot, error) 14488} 14489 14490// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14491func (future *SnapshotsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 14492 var azFuture azure.Future 14493 if err := json.Unmarshal(body, &azFuture); err != nil { 14494 return err 14495 } 14496 future.FutureAPI = &azFuture 14497 future.Result = future.result 14498 return nil 14499} 14500 14501// result is the default implementation for SnapshotsCreateOrUpdateFuture.Result. 14502func (future *SnapshotsCreateOrUpdateFuture) result(client SnapshotsClient) (s Snapshot, err error) { 14503 var done bool 14504 done, err = future.DoneWithContext(context.Background(), client) 14505 if err != nil { 14506 err = autorest.NewErrorWithError(err, "compute.SnapshotsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 14507 return 14508 } 14509 if !done { 14510 s.Response.Response = future.Response() 14511 err = azure.NewAsyncOpIncompleteError("compute.SnapshotsCreateOrUpdateFuture") 14512 return 14513 } 14514 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 14515 if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { 14516 s, err = client.CreateOrUpdateResponder(s.Response.Response) 14517 if err != nil { 14518 err = autorest.NewErrorWithError(err, "compute.SnapshotsCreateOrUpdateFuture", "Result", s.Response.Response, "Failure responding to request") 14519 } 14520 } 14521 return 14522} 14523 14524// SnapshotsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 14525// operation. 14526type SnapshotsDeleteFuture struct { 14527 azure.FutureAPI 14528 // Result returns the result of the asynchronous operation. 14529 // If the operation has not completed it will return an error. 14530 Result func(SnapshotsClient) (autorest.Response, error) 14531} 14532 14533// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14534func (future *SnapshotsDeleteFuture) UnmarshalJSON(body []byte) error { 14535 var azFuture azure.Future 14536 if err := json.Unmarshal(body, &azFuture); err != nil { 14537 return err 14538 } 14539 future.FutureAPI = &azFuture 14540 future.Result = future.result 14541 return nil 14542} 14543 14544// result is the default implementation for SnapshotsDeleteFuture.Result. 14545func (future *SnapshotsDeleteFuture) result(client SnapshotsClient) (ar autorest.Response, err error) { 14546 var done bool 14547 done, err = future.DoneWithContext(context.Background(), client) 14548 if err != nil { 14549 err = autorest.NewErrorWithError(err, "compute.SnapshotsDeleteFuture", "Result", future.Response(), "Polling failure") 14550 return 14551 } 14552 if !done { 14553 ar.Response = future.Response() 14554 err = azure.NewAsyncOpIncompleteError("compute.SnapshotsDeleteFuture") 14555 return 14556 } 14557 ar.Response = future.Response() 14558 return 14559} 14560 14561// SnapshotsGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running 14562// operation. 14563type SnapshotsGrantAccessFuture struct { 14564 azure.FutureAPI 14565 // Result returns the result of the asynchronous operation. 14566 // If the operation has not completed it will return an error. 14567 Result func(SnapshotsClient) (AccessURI, error) 14568} 14569 14570// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14571func (future *SnapshotsGrantAccessFuture) UnmarshalJSON(body []byte) error { 14572 var azFuture azure.Future 14573 if err := json.Unmarshal(body, &azFuture); err != nil { 14574 return err 14575 } 14576 future.FutureAPI = &azFuture 14577 future.Result = future.result 14578 return nil 14579} 14580 14581// result is the default implementation for SnapshotsGrantAccessFuture.Result. 14582func (future *SnapshotsGrantAccessFuture) result(client SnapshotsClient) (au AccessURI, err error) { 14583 var done bool 14584 done, err = future.DoneWithContext(context.Background(), client) 14585 if err != nil { 14586 err = autorest.NewErrorWithError(err, "compute.SnapshotsGrantAccessFuture", "Result", future.Response(), "Polling failure") 14587 return 14588 } 14589 if !done { 14590 au.Response.Response = future.Response() 14591 err = azure.NewAsyncOpIncompleteError("compute.SnapshotsGrantAccessFuture") 14592 return 14593 } 14594 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 14595 if au.Response.Response, err = future.GetResult(sender); err == nil && au.Response.Response.StatusCode != http.StatusNoContent { 14596 au, err = client.GrantAccessResponder(au.Response.Response) 14597 if err != nil { 14598 err = autorest.NewErrorWithError(err, "compute.SnapshotsGrantAccessFuture", "Result", au.Response.Response, "Failure responding to request") 14599 } 14600 } 14601 return 14602} 14603 14604// SnapshotSku the snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This is an 14605// optional parameter for incremental snapshot and the default behavior is the SKU will be set to the same 14606// sku as the previous snapshot 14607type SnapshotSku struct { 14608 // Name - The sku name. Possible values include: 'SnapshotStorageAccountTypesStandardLRS', 'SnapshotStorageAccountTypesPremiumLRS', 'SnapshotStorageAccountTypesStandardZRS' 14609 Name SnapshotStorageAccountTypes `json:"name,omitempty"` 14610 // Tier - READ-ONLY; The sku tier. 14611 Tier *string `json:"tier,omitempty"` 14612} 14613 14614// MarshalJSON is the custom marshaler for SnapshotSku. 14615func (ss SnapshotSku) MarshalJSON() ([]byte, error) { 14616 objectMap := make(map[string]interface{}) 14617 if ss.Name != "" { 14618 objectMap["name"] = ss.Name 14619 } 14620 return json.Marshal(objectMap) 14621} 14622 14623// SnapshotsRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running 14624// operation. 14625type SnapshotsRevokeAccessFuture struct { 14626 azure.FutureAPI 14627 // Result returns the result of the asynchronous operation. 14628 // If the operation has not completed it will return an error. 14629 Result func(SnapshotsClient) (autorest.Response, error) 14630} 14631 14632// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14633func (future *SnapshotsRevokeAccessFuture) UnmarshalJSON(body []byte) error { 14634 var azFuture azure.Future 14635 if err := json.Unmarshal(body, &azFuture); err != nil { 14636 return err 14637 } 14638 future.FutureAPI = &azFuture 14639 future.Result = future.result 14640 return nil 14641} 14642 14643// result is the default implementation for SnapshotsRevokeAccessFuture.Result. 14644func (future *SnapshotsRevokeAccessFuture) result(client SnapshotsClient) (ar autorest.Response, err error) { 14645 var done bool 14646 done, err = future.DoneWithContext(context.Background(), client) 14647 if err != nil { 14648 err = autorest.NewErrorWithError(err, "compute.SnapshotsRevokeAccessFuture", "Result", future.Response(), "Polling failure") 14649 return 14650 } 14651 if !done { 14652 ar.Response = future.Response() 14653 err = azure.NewAsyncOpIncompleteError("compute.SnapshotsRevokeAccessFuture") 14654 return 14655 } 14656 ar.Response = future.Response() 14657 return 14658} 14659 14660// SnapshotsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 14661// operation. 14662type SnapshotsUpdateFuture struct { 14663 azure.FutureAPI 14664 // Result returns the result of the asynchronous operation. 14665 // If the operation has not completed it will return an error. 14666 Result func(SnapshotsClient) (Snapshot, error) 14667} 14668 14669// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14670func (future *SnapshotsUpdateFuture) UnmarshalJSON(body []byte) error { 14671 var azFuture azure.Future 14672 if err := json.Unmarshal(body, &azFuture); err != nil { 14673 return err 14674 } 14675 future.FutureAPI = &azFuture 14676 future.Result = future.result 14677 return nil 14678} 14679 14680// result is the default implementation for SnapshotsUpdateFuture.Result. 14681func (future *SnapshotsUpdateFuture) result(client SnapshotsClient) (s Snapshot, err error) { 14682 var done bool 14683 done, err = future.DoneWithContext(context.Background(), client) 14684 if err != nil { 14685 err = autorest.NewErrorWithError(err, "compute.SnapshotsUpdateFuture", "Result", future.Response(), "Polling failure") 14686 return 14687 } 14688 if !done { 14689 s.Response.Response = future.Response() 14690 err = azure.NewAsyncOpIncompleteError("compute.SnapshotsUpdateFuture") 14691 return 14692 } 14693 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 14694 if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { 14695 s, err = client.UpdateResponder(s.Response.Response) 14696 if err != nil { 14697 err = autorest.NewErrorWithError(err, "compute.SnapshotsUpdateFuture", "Result", s.Response.Response, "Failure responding to request") 14698 } 14699 } 14700 return 14701} 14702 14703// SnapshotUpdate snapshot update resource. 14704type SnapshotUpdate struct { 14705 *SnapshotUpdateProperties `json:"properties,omitempty"` 14706 // Tags - Resource tags 14707 Tags map[string]*string `json:"tags"` 14708 Sku *SnapshotSku `json:"sku,omitempty"` 14709} 14710 14711// MarshalJSON is the custom marshaler for SnapshotUpdate. 14712func (su SnapshotUpdate) MarshalJSON() ([]byte, error) { 14713 objectMap := make(map[string]interface{}) 14714 if su.SnapshotUpdateProperties != nil { 14715 objectMap["properties"] = su.SnapshotUpdateProperties 14716 } 14717 if su.Tags != nil { 14718 objectMap["tags"] = su.Tags 14719 } 14720 if su.Sku != nil { 14721 objectMap["sku"] = su.Sku 14722 } 14723 return json.Marshal(objectMap) 14724} 14725 14726// UnmarshalJSON is the custom unmarshaler for SnapshotUpdate struct. 14727func (su *SnapshotUpdate) UnmarshalJSON(body []byte) error { 14728 var m map[string]*json.RawMessage 14729 err := json.Unmarshal(body, &m) 14730 if err != nil { 14731 return err 14732 } 14733 for k, v := range m { 14734 switch k { 14735 case "properties": 14736 if v != nil { 14737 var snapshotUpdateProperties SnapshotUpdateProperties 14738 err = json.Unmarshal(*v, &snapshotUpdateProperties) 14739 if err != nil { 14740 return err 14741 } 14742 su.SnapshotUpdateProperties = &snapshotUpdateProperties 14743 } 14744 case "tags": 14745 if v != nil { 14746 var tags map[string]*string 14747 err = json.Unmarshal(*v, &tags) 14748 if err != nil { 14749 return err 14750 } 14751 su.Tags = tags 14752 } 14753 case "sku": 14754 if v != nil { 14755 var sku SnapshotSku 14756 err = json.Unmarshal(*v, &sku) 14757 if err != nil { 14758 return err 14759 } 14760 su.Sku = &sku 14761 } 14762 } 14763 } 14764 14765 return nil 14766} 14767 14768// SnapshotUpdateProperties snapshot resource update properties. 14769type SnapshotUpdateProperties struct { 14770 // OsType - the Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' 14771 OsType OperatingSystemTypes `json:"osType,omitempty"` 14772 // 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. 14773 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 14774 // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. 14775 EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` 14776 // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 14777 Encryption *Encryption `json:"encryption,omitempty"` 14778 // NetworkAccessPolicy - Possible values include: 'NetworkAccessPolicyAllowAll', 'NetworkAccessPolicyAllowPrivate', 'NetworkAccessPolicyDenyAll' 14779 NetworkAccessPolicy NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` 14780 // DiskAccessID - ARM id of the DiskAccess resource for using private endpoints on disks. 14781 DiskAccessID *string `json:"diskAccessId,omitempty"` 14782 // SupportsHibernation - Indicates the OS on a snapshot supports hibernation. 14783 SupportsHibernation *bool `json:"supportsHibernation,omitempty"` 14784} 14785 14786// SourceVault the vault id is an Azure Resource Manager Resource id in the form 14787// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName} 14788type SourceVault struct { 14789 // ID - Resource Id 14790 ID *string `json:"id,omitempty"` 14791} 14792 14793// SpotRestorePolicy specifies the Spot-Try-Restore properties for the virtual machine scale set. <br><br> 14794// With this property customer can enable or disable automatic restore of the evicted Spot VMSS VM 14795// instances opportunistically based on capacity availability and pricing constraint. 14796type SpotRestorePolicy struct { 14797 // 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 14798 Enabled *bool `json:"enabled,omitempty"` 14799 // RestoreTimeout - Timeout value expressed as an ISO 8601 time duration after which the platform will not try to restore the VMSS SPOT instances 14800 RestoreTimeout *string `json:"restoreTimeout,omitempty"` 14801} 14802 14803// SSHConfiguration SSH configuration for Linux based VMs running on Azure 14804type SSHConfiguration struct { 14805 // PublicKeys - The list of SSH public keys used to authenticate with linux based VMs. 14806 PublicKeys *[]SSHPublicKey `json:"publicKeys,omitempty"` 14807} 14808 14809// SSHPublicKey contains information about SSH certificate public key and the path on the Linux VM where 14810// the public key is placed. 14811type SSHPublicKey struct { 14812 // 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 14813 Path *string `json:"path,omitempty"` 14814 // 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). 14815 KeyData *string `json:"keyData,omitempty"` 14816} 14817 14818// SSHPublicKeyGenerateKeyPairResult response from generation of an SSH key pair. 14819type SSHPublicKeyGenerateKeyPairResult struct { 14820 autorest.Response `json:"-"` 14821 // 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. 14822 PrivateKey *string `json:"privateKey,omitempty"` 14823 // 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. 14824 PublicKey *string `json:"publicKey,omitempty"` 14825 // ID - The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{SshPublicKeyName} 14826 ID *string `json:"id,omitempty"` 14827} 14828 14829// SSHPublicKeyResource specifies information about the SSH public key. 14830type SSHPublicKeyResource struct { 14831 autorest.Response `json:"-"` 14832 // SSHPublicKeyResourceProperties - Properties of the SSH public key. 14833 *SSHPublicKeyResourceProperties `json:"properties,omitempty"` 14834 // ID - READ-ONLY; Resource Id 14835 ID *string `json:"id,omitempty"` 14836 // Name - READ-ONLY; Resource name 14837 Name *string `json:"name,omitempty"` 14838 // Type - READ-ONLY; Resource type 14839 Type *string `json:"type,omitempty"` 14840 // Location - Resource location 14841 Location *string `json:"location,omitempty"` 14842 // Tags - Resource tags 14843 Tags map[string]*string `json:"tags"` 14844} 14845 14846// MarshalJSON is the custom marshaler for SSHPublicKeyResource. 14847func (spkr SSHPublicKeyResource) MarshalJSON() ([]byte, error) { 14848 objectMap := make(map[string]interface{}) 14849 if spkr.SSHPublicKeyResourceProperties != nil { 14850 objectMap["properties"] = spkr.SSHPublicKeyResourceProperties 14851 } 14852 if spkr.Location != nil { 14853 objectMap["location"] = spkr.Location 14854 } 14855 if spkr.Tags != nil { 14856 objectMap["tags"] = spkr.Tags 14857 } 14858 return json.Marshal(objectMap) 14859} 14860 14861// UnmarshalJSON is the custom unmarshaler for SSHPublicKeyResource struct. 14862func (spkr *SSHPublicKeyResource) UnmarshalJSON(body []byte) error { 14863 var m map[string]*json.RawMessage 14864 err := json.Unmarshal(body, &m) 14865 if err != nil { 14866 return err 14867 } 14868 for k, v := range m { 14869 switch k { 14870 case "properties": 14871 if v != nil { 14872 var SSHPublicKeyResourceProperties SSHPublicKeyResourceProperties 14873 err = json.Unmarshal(*v, &SSHPublicKeyResourceProperties) 14874 if err != nil { 14875 return err 14876 } 14877 spkr.SSHPublicKeyResourceProperties = &SSHPublicKeyResourceProperties 14878 } 14879 case "id": 14880 if v != nil { 14881 var ID string 14882 err = json.Unmarshal(*v, &ID) 14883 if err != nil { 14884 return err 14885 } 14886 spkr.ID = &ID 14887 } 14888 case "name": 14889 if v != nil { 14890 var name string 14891 err = json.Unmarshal(*v, &name) 14892 if err != nil { 14893 return err 14894 } 14895 spkr.Name = &name 14896 } 14897 case "type": 14898 if v != nil { 14899 var typeVar string 14900 err = json.Unmarshal(*v, &typeVar) 14901 if err != nil { 14902 return err 14903 } 14904 spkr.Type = &typeVar 14905 } 14906 case "location": 14907 if v != nil { 14908 var location string 14909 err = json.Unmarshal(*v, &location) 14910 if err != nil { 14911 return err 14912 } 14913 spkr.Location = &location 14914 } 14915 case "tags": 14916 if v != nil { 14917 var tags map[string]*string 14918 err = json.Unmarshal(*v, &tags) 14919 if err != nil { 14920 return err 14921 } 14922 spkr.Tags = tags 14923 } 14924 } 14925 } 14926 14927 return nil 14928} 14929 14930// SSHPublicKeyResourceProperties properties of the SSH public key. 14931type SSHPublicKeyResourceProperties struct { 14932 // 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. 14933 PublicKey *string `json:"publicKey,omitempty"` 14934} 14935 14936// SSHPublicKeysGroupListResult the list SSH public keys operation response. 14937type SSHPublicKeysGroupListResult struct { 14938 autorest.Response `json:"-"` 14939 // Value - The list of SSH public keys 14940 Value *[]SSHPublicKeyResource `json:"value,omitempty"` 14941 // 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. 14942 NextLink *string `json:"nextLink,omitempty"` 14943} 14944 14945// SSHPublicKeysGroupListResultIterator provides access to a complete listing of SSHPublicKeyResource 14946// values. 14947type SSHPublicKeysGroupListResultIterator struct { 14948 i int 14949 page SSHPublicKeysGroupListResultPage 14950} 14951 14952// NextWithContext advances to the next value. If there was an error making 14953// the request the iterator does not advance and the error is returned. 14954func (iter *SSHPublicKeysGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { 14955 if tracing.IsEnabled() { 14956 ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysGroupListResultIterator.NextWithContext") 14957 defer func() { 14958 sc := -1 14959 if iter.Response().Response.Response != nil { 14960 sc = iter.Response().Response.Response.StatusCode 14961 } 14962 tracing.EndSpan(ctx, sc, err) 14963 }() 14964 } 14965 iter.i++ 14966 if iter.i < len(iter.page.Values()) { 14967 return nil 14968 } 14969 err = iter.page.NextWithContext(ctx) 14970 if err != nil { 14971 iter.i-- 14972 return err 14973 } 14974 iter.i = 0 14975 return nil 14976} 14977 14978// Next advances to the next value. If there was an error making 14979// the request the iterator does not advance and the error is returned. 14980// Deprecated: Use NextWithContext() instead. 14981func (iter *SSHPublicKeysGroupListResultIterator) Next() error { 14982 return iter.NextWithContext(context.Background()) 14983} 14984 14985// NotDone returns true if the enumeration should be started or is not yet complete. 14986func (iter SSHPublicKeysGroupListResultIterator) NotDone() bool { 14987 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 14988} 14989 14990// Response returns the raw server response from the last page request. 14991func (iter SSHPublicKeysGroupListResultIterator) Response() SSHPublicKeysGroupListResult { 14992 return iter.page.Response() 14993} 14994 14995// Value returns the current value or a zero-initialized value if the 14996// iterator has advanced beyond the end of the collection. 14997func (iter SSHPublicKeysGroupListResultIterator) Value() SSHPublicKeyResource { 14998 if !iter.page.NotDone() { 14999 return SSHPublicKeyResource{} 15000 } 15001 return iter.page.Values()[iter.i] 15002} 15003 15004// Creates a new instance of the SSHPublicKeysGroupListResultIterator type. 15005func NewSSHPublicKeysGroupListResultIterator(page SSHPublicKeysGroupListResultPage) SSHPublicKeysGroupListResultIterator { 15006 return SSHPublicKeysGroupListResultIterator{page: page} 15007} 15008 15009// IsEmpty returns true if the ListResult contains no values. 15010func (spkglr SSHPublicKeysGroupListResult) IsEmpty() bool { 15011 return spkglr.Value == nil || len(*spkglr.Value) == 0 15012} 15013 15014// hasNextLink returns true if the NextLink is not empty. 15015func (spkglr SSHPublicKeysGroupListResult) hasNextLink() bool { 15016 return spkglr.NextLink != nil && len(*spkglr.NextLink) != 0 15017} 15018 15019// sSHPublicKeysGroupListResultPreparer prepares a request to retrieve the next set of results. 15020// It returns nil if no more results exist. 15021func (spkglr SSHPublicKeysGroupListResult) sSHPublicKeysGroupListResultPreparer(ctx context.Context) (*http.Request, error) { 15022 if !spkglr.hasNextLink() { 15023 return nil, nil 15024 } 15025 return autorest.Prepare((&http.Request{}).WithContext(ctx), 15026 autorest.AsJSON(), 15027 autorest.AsGet(), 15028 autorest.WithBaseURL(to.String(spkglr.NextLink))) 15029} 15030 15031// SSHPublicKeysGroupListResultPage contains a page of SSHPublicKeyResource values. 15032type SSHPublicKeysGroupListResultPage struct { 15033 fn func(context.Context, SSHPublicKeysGroupListResult) (SSHPublicKeysGroupListResult, error) 15034 spkglr SSHPublicKeysGroupListResult 15035} 15036 15037// NextWithContext advances to the next page of values. If there was an error making 15038// the request the page does not advance and the error is returned. 15039func (page *SSHPublicKeysGroupListResultPage) NextWithContext(ctx context.Context) (err error) { 15040 if tracing.IsEnabled() { 15041 ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysGroupListResultPage.NextWithContext") 15042 defer func() { 15043 sc := -1 15044 if page.Response().Response.Response != nil { 15045 sc = page.Response().Response.Response.StatusCode 15046 } 15047 tracing.EndSpan(ctx, sc, err) 15048 }() 15049 } 15050 for { 15051 next, err := page.fn(ctx, page.spkglr) 15052 if err != nil { 15053 return err 15054 } 15055 page.spkglr = next 15056 if !next.hasNextLink() || !next.IsEmpty() { 15057 break 15058 } 15059 } 15060 return nil 15061} 15062 15063// Next advances to the next page of values. If there was an error making 15064// the request the page does not advance and the error is returned. 15065// Deprecated: Use NextWithContext() instead. 15066func (page *SSHPublicKeysGroupListResultPage) Next() error { 15067 return page.NextWithContext(context.Background()) 15068} 15069 15070// NotDone returns true if the page enumeration should be started or is not yet complete. 15071func (page SSHPublicKeysGroupListResultPage) NotDone() bool { 15072 return !page.spkglr.IsEmpty() 15073} 15074 15075// Response returns the raw server response from the last page request. 15076func (page SSHPublicKeysGroupListResultPage) Response() SSHPublicKeysGroupListResult { 15077 return page.spkglr 15078} 15079 15080// Values returns the slice of values for the current page or nil if there are no values. 15081func (page SSHPublicKeysGroupListResultPage) Values() []SSHPublicKeyResource { 15082 if page.spkglr.IsEmpty() { 15083 return nil 15084 } 15085 return *page.spkglr.Value 15086} 15087 15088// Creates a new instance of the SSHPublicKeysGroupListResultPage type. 15089func NewSSHPublicKeysGroupListResultPage(cur SSHPublicKeysGroupListResult, getNextPage func(context.Context, SSHPublicKeysGroupListResult) (SSHPublicKeysGroupListResult, error)) SSHPublicKeysGroupListResultPage { 15090 return SSHPublicKeysGroupListResultPage{ 15091 fn: getNextPage, 15092 spkglr: cur, 15093 } 15094} 15095 15096// SSHPublicKeyUpdateResource specifies information about the SSH public key. 15097type SSHPublicKeyUpdateResource struct { 15098 // SSHPublicKeyResourceProperties - Properties of the SSH public key. 15099 *SSHPublicKeyResourceProperties `json:"properties,omitempty"` 15100 // Tags - Resource tags 15101 Tags map[string]*string `json:"tags"` 15102} 15103 15104// MarshalJSON is the custom marshaler for SSHPublicKeyUpdateResource. 15105func (spkur SSHPublicKeyUpdateResource) MarshalJSON() ([]byte, error) { 15106 objectMap := make(map[string]interface{}) 15107 if spkur.SSHPublicKeyResourceProperties != nil { 15108 objectMap["properties"] = spkur.SSHPublicKeyResourceProperties 15109 } 15110 if spkur.Tags != nil { 15111 objectMap["tags"] = spkur.Tags 15112 } 15113 return json.Marshal(objectMap) 15114} 15115 15116// UnmarshalJSON is the custom unmarshaler for SSHPublicKeyUpdateResource struct. 15117func (spkur *SSHPublicKeyUpdateResource) UnmarshalJSON(body []byte) error { 15118 var m map[string]*json.RawMessage 15119 err := json.Unmarshal(body, &m) 15120 if err != nil { 15121 return err 15122 } 15123 for k, v := range m { 15124 switch k { 15125 case "properties": 15126 if v != nil { 15127 var SSHPublicKeyResourceProperties SSHPublicKeyResourceProperties 15128 err = json.Unmarshal(*v, &SSHPublicKeyResourceProperties) 15129 if err != nil { 15130 return err 15131 } 15132 spkur.SSHPublicKeyResourceProperties = &SSHPublicKeyResourceProperties 15133 } 15134 case "tags": 15135 if v != nil { 15136 var tags map[string]*string 15137 err = json.Unmarshal(*v, &tags) 15138 if err != nil { 15139 return err 15140 } 15141 spkur.Tags = tags 15142 } 15143 } 15144 } 15145 15146 return nil 15147} 15148 15149// StatusCodeCount ... 15150type StatusCodeCount struct { 15151 // Code - READ-ONLY; The instance view status code 15152 Code *string `json:"code,omitempty"` 15153 // Count - READ-ONLY; Number of instances having this status code 15154 Count *int32 `json:"count,omitempty"` 15155} 15156 15157// MarshalJSON is the custom marshaler for StatusCodeCount. 15158func (scc StatusCodeCount) MarshalJSON() ([]byte, error) { 15159 objectMap := make(map[string]interface{}) 15160 return json.Marshal(objectMap) 15161} 15162 15163// StorageProfile specifies the storage settings for the virtual machine disks. 15164type StorageProfile struct { 15165 // 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. 15166 ImageReference *ImageReference `json:"imageReference,omitempty"` 15167 // 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). 15168 OsDisk *OSDisk `json:"osDisk,omitempty"` 15169 // 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). 15170 DataDisks *[]DataDisk `json:"dataDisks,omitempty"` 15171} 15172 15173// SubResource ... 15174type SubResource struct { 15175 // ID - Resource Id 15176 ID *string `json:"id,omitempty"` 15177} 15178 15179// SubResourceReadOnly ... 15180type SubResourceReadOnly struct { 15181 // ID - READ-ONLY; Resource Id 15182 ID *string `json:"id,omitempty"` 15183} 15184 15185// MarshalJSON is the custom marshaler for SubResourceReadOnly. 15186func (srro SubResourceReadOnly) MarshalJSON() ([]byte, error) { 15187 objectMap := make(map[string]interface{}) 15188 return json.Marshal(objectMap) 15189} 15190 15191// SubResourceWithColocationStatus ... 15192type SubResourceWithColocationStatus struct { 15193 // ColocationStatus - Describes colocation status of a resource in the Proximity Placement Group. 15194 ColocationStatus *InstanceViewStatus `json:"colocationStatus,omitempty"` 15195 // ID - Resource Id 15196 ID *string `json:"id,omitempty"` 15197} 15198 15199// TargetRegion describes the target region information. 15200type TargetRegion struct { 15201 // Name - The name of the region. 15202 Name *string `json:"name,omitempty"` 15203 // RegionalReplicaCount - The number of replicas of the Image Version to be created per region. This property is updatable. 15204 RegionalReplicaCount *int32 `json:"regionalReplicaCount,omitempty"` 15205 // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' 15206 StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` 15207 Encryption *EncryptionImages `json:"encryption,omitempty"` 15208} 15209 15210// TerminateNotificationProfile ... 15211type TerminateNotificationProfile struct { 15212 // 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) 15213 NotBeforeTimeout *string `json:"notBeforeTimeout,omitempty"` 15214 // Enable - Specifies whether the Terminate Scheduled event is enabled or disabled. 15215 Enable *bool `json:"enable,omitempty"` 15216} 15217 15218// ThrottledRequestsInput api request input for LogAnalytics getThrottledRequests Api. 15219type ThrottledRequestsInput struct { 15220 // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. 15221 BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` 15222 // FromTime - From time of the query 15223 FromTime *date.Time `json:"fromTime,omitempty"` 15224 // ToTime - To time of the query 15225 ToTime *date.Time `json:"toTime,omitempty"` 15226 // GroupByThrottlePolicy - Group query result by Throttle Policy applied. 15227 GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` 15228 // GroupByOperationName - Group query result by Operation Name. 15229 GroupByOperationName *bool `json:"groupByOperationName,omitempty"` 15230 // GroupByResourceName - Group query result by Resource Name. 15231 GroupByResourceName *bool `json:"groupByResourceName,omitempty"` 15232 // GroupByClientApplicationID - Group query result by Client Application ID. 15233 GroupByClientApplicationID *bool `json:"groupByClientApplicationId,omitempty"` 15234 // GroupByUserAgent - Group query result by User Agent. 15235 GroupByUserAgent *bool `json:"groupByUserAgent,omitempty"` 15236} 15237 15238// UefiSettings specifies the security settings like secure boot and vTPM used while creating the virtual 15239// machine. <br><br>Minimum api-version: 2020-12-01 15240type UefiSettings struct { 15241 // SecureBootEnabled - Specifies whether secure boot should be enabled on the virtual machine. <br><br>Minimum api-version: 2020-12-01 15242 SecureBootEnabled *bool `json:"secureBootEnabled,omitempty"` 15243 // VTpmEnabled - Specifies whether vTPM should be enabled on the virtual machine. <br><br>Minimum api-version: 2020-12-01 15244 VTpmEnabled *bool `json:"vTpmEnabled,omitempty"` 15245} 15246 15247// UpdateDomain defines an update domain for the cloud service. 15248type UpdateDomain struct { 15249 autorest.Response `json:"-"` 15250 // ID - READ-ONLY; Resource Id 15251 ID *string `json:"id,omitempty"` 15252 // Name - READ-ONLY; Resource Name 15253 Name *string `json:"name,omitempty"` 15254} 15255 15256// MarshalJSON is the custom marshaler for UpdateDomain. 15257func (ud UpdateDomain) MarshalJSON() ([]byte, error) { 15258 objectMap := make(map[string]interface{}) 15259 return json.Marshal(objectMap) 15260} 15261 15262// UpdateDomainListResult ... 15263type UpdateDomainListResult struct { 15264 autorest.Response `json:"-"` 15265 Value *[]UpdateDomain `json:"value,omitempty"` 15266 NextLink *string `json:"nextLink,omitempty"` 15267} 15268 15269// UpdateDomainListResultIterator provides access to a complete listing of UpdateDomain values. 15270type UpdateDomainListResultIterator struct { 15271 i int 15272 page UpdateDomainListResultPage 15273} 15274 15275// NextWithContext advances to the next value. If there was an error making 15276// the request the iterator does not advance and the error is returned. 15277func (iter *UpdateDomainListResultIterator) NextWithContext(ctx context.Context) (err error) { 15278 if tracing.IsEnabled() { 15279 ctx = tracing.StartSpan(ctx, fqdn+"/UpdateDomainListResultIterator.NextWithContext") 15280 defer func() { 15281 sc := -1 15282 if iter.Response().Response.Response != nil { 15283 sc = iter.Response().Response.Response.StatusCode 15284 } 15285 tracing.EndSpan(ctx, sc, err) 15286 }() 15287 } 15288 iter.i++ 15289 if iter.i < len(iter.page.Values()) { 15290 return nil 15291 } 15292 err = iter.page.NextWithContext(ctx) 15293 if err != nil { 15294 iter.i-- 15295 return err 15296 } 15297 iter.i = 0 15298 return nil 15299} 15300 15301// Next advances to the next value. If there was an error making 15302// the request the iterator does not advance and the error is returned. 15303// Deprecated: Use NextWithContext() instead. 15304func (iter *UpdateDomainListResultIterator) Next() error { 15305 return iter.NextWithContext(context.Background()) 15306} 15307 15308// NotDone returns true if the enumeration should be started or is not yet complete. 15309func (iter UpdateDomainListResultIterator) NotDone() bool { 15310 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 15311} 15312 15313// Response returns the raw server response from the last page request. 15314func (iter UpdateDomainListResultIterator) Response() UpdateDomainListResult { 15315 return iter.page.Response() 15316} 15317 15318// Value returns the current value or a zero-initialized value if the 15319// iterator has advanced beyond the end of the collection. 15320func (iter UpdateDomainListResultIterator) Value() UpdateDomain { 15321 if !iter.page.NotDone() { 15322 return UpdateDomain{} 15323 } 15324 return iter.page.Values()[iter.i] 15325} 15326 15327// Creates a new instance of the UpdateDomainListResultIterator type. 15328func NewUpdateDomainListResultIterator(page UpdateDomainListResultPage) UpdateDomainListResultIterator { 15329 return UpdateDomainListResultIterator{page: page} 15330} 15331 15332// IsEmpty returns true if the ListResult contains no values. 15333func (udlr UpdateDomainListResult) IsEmpty() bool { 15334 return udlr.Value == nil || len(*udlr.Value) == 0 15335} 15336 15337// hasNextLink returns true if the NextLink is not empty. 15338func (udlr UpdateDomainListResult) hasNextLink() bool { 15339 return udlr.NextLink != nil && len(*udlr.NextLink) != 0 15340} 15341 15342// updateDomainListResultPreparer prepares a request to retrieve the next set of results. 15343// It returns nil if no more results exist. 15344func (udlr UpdateDomainListResult) updateDomainListResultPreparer(ctx context.Context) (*http.Request, error) { 15345 if !udlr.hasNextLink() { 15346 return nil, nil 15347 } 15348 return autorest.Prepare((&http.Request{}).WithContext(ctx), 15349 autorest.AsJSON(), 15350 autorest.AsGet(), 15351 autorest.WithBaseURL(to.String(udlr.NextLink))) 15352} 15353 15354// UpdateDomainListResultPage contains a page of UpdateDomain values. 15355type UpdateDomainListResultPage struct { 15356 fn func(context.Context, UpdateDomainListResult) (UpdateDomainListResult, error) 15357 udlr UpdateDomainListResult 15358} 15359 15360// NextWithContext advances to the next page of values. If there was an error making 15361// the request the page does not advance and the error is returned. 15362func (page *UpdateDomainListResultPage) NextWithContext(ctx context.Context) (err error) { 15363 if tracing.IsEnabled() { 15364 ctx = tracing.StartSpan(ctx, fqdn+"/UpdateDomainListResultPage.NextWithContext") 15365 defer func() { 15366 sc := -1 15367 if page.Response().Response.Response != nil { 15368 sc = page.Response().Response.Response.StatusCode 15369 } 15370 tracing.EndSpan(ctx, sc, err) 15371 }() 15372 } 15373 for { 15374 next, err := page.fn(ctx, page.udlr) 15375 if err != nil { 15376 return err 15377 } 15378 page.udlr = next 15379 if !next.hasNextLink() || !next.IsEmpty() { 15380 break 15381 } 15382 } 15383 return nil 15384} 15385 15386// Next advances to the next page of values. If there was an error making 15387// the request the page does not advance and the error is returned. 15388// Deprecated: Use NextWithContext() instead. 15389func (page *UpdateDomainListResultPage) Next() error { 15390 return page.NextWithContext(context.Background()) 15391} 15392 15393// NotDone returns true if the page enumeration should be started or is not yet complete. 15394func (page UpdateDomainListResultPage) NotDone() bool { 15395 return !page.udlr.IsEmpty() 15396} 15397 15398// Response returns the raw server response from the last page request. 15399func (page UpdateDomainListResultPage) Response() UpdateDomainListResult { 15400 return page.udlr 15401} 15402 15403// Values returns the slice of values for the current page or nil if there are no values. 15404func (page UpdateDomainListResultPage) Values() []UpdateDomain { 15405 if page.udlr.IsEmpty() { 15406 return nil 15407 } 15408 return *page.udlr.Value 15409} 15410 15411// Creates a new instance of the UpdateDomainListResultPage type. 15412func NewUpdateDomainListResultPage(cur UpdateDomainListResult, getNextPage func(context.Context, UpdateDomainListResult) (UpdateDomainListResult, error)) UpdateDomainListResultPage { 15413 return UpdateDomainListResultPage{ 15414 fn: getNextPage, 15415 udlr: cur, 15416 } 15417} 15418 15419// UpdateResource the Update Resource model definition. 15420type UpdateResource struct { 15421 // Tags - Resource tags 15422 Tags map[string]*string `json:"tags"` 15423} 15424 15425// MarshalJSON is the custom marshaler for UpdateResource. 15426func (ur UpdateResource) MarshalJSON() ([]byte, error) { 15427 objectMap := make(map[string]interface{}) 15428 if ur.Tags != nil { 15429 objectMap["tags"] = ur.Tags 15430 } 15431 return json.Marshal(objectMap) 15432} 15433 15434// UpdateResourceDefinition the Update Resource model definition. 15435type UpdateResourceDefinition struct { 15436 // ID - READ-ONLY; Resource Id 15437 ID *string `json:"id,omitempty"` 15438 // Name - READ-ONLY; Resource name 15439 Name *string `json:"name,omitempty"` 15440 // Type - READ-ONLY; Resource type 15441 Type *string `json:"type,omitempty"` 15442 // Tags - Resource tags 15443 Tags map[string]*string `json:"tags"` 15444} 15445 15446// MarshalJSON is the custom marshaler for UpdateResourceDefinition. 15447func (urd UpdateResourceDefinition) MarshalJSON() ([]byte, error) { 15448 objectMap := make(map[string]interface{}) 15449 if urd.Tags != nil { 15450 objectMap["tags"] = urd.Tags 15451 } 15452 return json.Marshal(objectMap) 15453} 15454 15455// UpgradeOperationHistoricalStatusInfo virtual Machine Scale Set OS Upgrade History operation response. 15456type UpgradeOperationHistoricalStatusInfo struct { 15457 // Properties - READ-ONLY; Information about the properties of the upgrade operation. 15458 Properties *UpgradeOperationHistoricalStatusInfoProperties `json:"properties,omitempty"` 15459 // Type - READ-ONLY; Resource type 15460 Type *string `json:"type,omitempty"` 15461 // Location - READ-ONLY; Resource location 15462 Location *string `json:"location,omitempty"` 15463} 15464 15465// MarshalJSON is the custom marshaler for UpgradeOperationHistoricalStatusInfo. 15466func (uohsi UpgradeOperationHistoricalStatusInfo) MarshalJSON() ([]byte, error) { 15467 objectMap := make(map[string]interface{}) 15468 return json.Marshal(objectMap) 15469} 15470 15471// UpgradeOperationHistoricalStatusInfoProperties describes each OS upgrade on the Virtual Machine Scale 15472// Set. 15473type UpgradeOperationHistoricalStatusInfoProperties struct { 15474 // RunningStatus - READ-ONLY; Information about the overall status of the upgrade operation. 15475 RunningStatus *UpgradeOperationHistoryStatus `json:"runningStatus,omitempty"` 15476 // Progress - READ-ONLY; Counts of the VMs in each state. 15477 Progress *RollingUpgradeProgressInfo `json:"progress,omitempty"` 15478 // Error - READ-ONLY; Error Details for this upgrade if there are any. 15479 Error *APIError `json:"error,omitempty"` 15480 // StartedBy - READ-ONLY; Invoker of the Upgrade Operation. Possible values include: 'UpgradeOperationInvokerUnknown', 'UpgradeOperationInvokerUser', 'UpgradeOperationInvokerPlatform' 15481 StartedBy UpgradeOperationInvoker `json:"startedBy,omitempty"` 15482 // TargetImageReference - READ-ONLY; Image Reference details 15483 TargetImageReference *ImageReference `json:"targetImageReference,omitempty"` 15484 // RollbackInfo - READ-ONLY; Information about OS rollback if performed 15485 RollbackInfo *RollbackStatusInfo `json:"rollbackInfo,omitempty"` 15486} 15487 15488// MarshalJSON is the custom marshaler for UpgradeOperationHistoricalStatusInfoProperties. 15489func (uohsip UpgradeOperationHistoricalStatusInfoProperties) MarshalJSON() ([]byte, error) { 15490 objectMap := make(map[string]interface{}) 15491 return json.Marshal(objectMap) 15492} 15493 15494// UpgradeOperationHistoryStatus information about the current running state of the overall upgrade. 15495type UpgradeOperationHistoryStatus struct { 15496 // Code - READ-ONLY; Code indicating the current status of the upgrade. Possible values include: 'UpgradeStateRollingForward', 'UpgradeStateCancelled', 'UpgradeStateCompleted', 'UpgradeStateFaulted' 15497 Code UpgradeState `json:"code,omitempty"` 15498 // StartTime - READ-ONLY; Start time of the upgrade. 15499 StartTime *date.Time `json:"startTime,omitempty"` 15500 // EndTime - READ-ONLY; End time of the upgrade. 15501 EndTime *date.Time `json:"endTime,omitempty"` 15502} 15503 15504// MarshalJSON is the custom marshaler for UpgradeOperationHistoryStatus. 15505func (uohs UpgradeOperationHistoryStatus) MarshalJSON() ([]byte, error) { 15506 objectMap := make(map[string]interface{}) 15507 return json.Marshal(objectMap) 15508} 15509 15510// UpgradePolicy describes an upgrade policy - automatic, manual, or rolling. 15511type UpgradePolicy struct { 15512 // 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' 15513 Mode UpgradeMode `json:"mode,omitempty"` 15514 // RollingUpgradePolicy - The configuration parameters used while performing a rolling upgrade. 15515 RollingUpgradePolicy *RollingUpgradePolicy `json:"rollingUpgradePolicy,omitempty"` 15516 // AutomaticOSUpgradePolicy - Configuration parameters used for performing automatic OS Upgrade. 15517 AutomaticOSUpgradePolicy *AutomaticOSUpgradePolicy `json:"automaticOSUpgradePolicy,omitempty"` 15518} 15519 15520// Usage describes Compute Resource Usage. 15521type Usage struct { 15522 // Unit - An enum describing the unit of usage measurement. 15523 Unit *string `json:"unit,omitempty"` 15524 // CurrentValue - The current usage of the resource. 15525 CurrentValue *int32 `json:"currentValue,omitempty"` 15526 // Limit - The maximum permitted usage of the resource. 15527 Limit *int64 `json:"limit,omitempty"` 15528 // Name - The name of the type of usage. 15529 Name *UsageName `json:"name,omitempty"` 15530} 15531 15532// UsageName the Usage Names. 15533type UsageName struct { 15534 // Value - The name of the resource. 15535 Value *string `json:"value,omitempty"` 15536 // LocalizedValue - The localized name of the resource. 15537 LocalizedValue *string `json:"localizedValue,omitempty"` 15538} 15539 15540// UserArtifactManage ... 15541type UserArtifactManage struct { 15542 // Install - Required. The path and arguments to install the gallery application. This is limited to 4096 characters. 15543 Install *string `json:"install,omitempty"` 15544 // Remove - Required. The path and arguments to remove the gallery application. This is limited to 4096 characters. 15545 Remove *string `json:"remove,omitempty"` 15546 // 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. 15547 Update *string `json:"update,omitempty"` 15548} 15549 15550// UserArtifactSource the source image from which the Image Version is going to be created. 15551type UserArtifactSource struct { 15552 // MediaLink - Required. The mediaLink of the artifact, must be a readable storage page blob. 15553 MediaLink *string `json:"mediaLink,omitempty"` 15554 // DefaultConfigurationLink - Optional. The defaultConfigurationLink of the artifact, must be a readable storage page blob. 15555 DefaultConfigurationLink *string `json:"defaultConfigurationLink,omitempty"` 15556} 15557 15558// VaultCertificate describes a single certificate reference in a Key Vault, and where the certificate 15559// should reside on the VM. 15560type VaultCertificate struct { 15561 // 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>} 15562 CertificateURL *string `json:"certificateUrl,omitempty"` 15563 // 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. 15564 CertificateStore *string `json:"certificateStore,omitempty"` 15565} 15566 15567// VaultSecretGroup describes a set of certificates which are all in the same Key Vault. 15568type VaultSecretGroup struct { 15569 // SourceVault - The relative URL of the Key Vault containing all of the certificates in VaultCertificates. 15570 SourceVault *SubResource `json:"sourceVault,omitempty"` 15571 // VaultCertificates - The list of key vault references in SourceVault which contain certificates. 15572 VaultCertificates *[]VaultCertificate `json:"vaultCertificates,omitempty"` 15573} 15574 15575// VirtualHardDisk describes the uri of a disk. 15576type VirtualHardDisk struct { 15577 // URI - Specifies the virtual hard disk's uri. 15578 URI *string `json:"uri,omitempty"` 15579} 15580 15581// VirtualMachine describes a Virtual Machine. 15582type VirtualMachine struct { 15583 autorest.Response `json:"-"` 15584 // 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**. 15585 Plan *Plan `json:"plan,omitempty"` 15586 *VirtualMachineProperties `json:"properties,omitempty"` 15587 // Resources - READ-ONLY; The virtual machine child extension resources. 15588 Resources *[]VirtualMachineExtension `json:"resources,omitempty"` 15589 // Identity - The identity of the virtual machine, if configured. 15590 Identity *VirtualMachineIdentity `json:"identity,omitempty"` 15591 // Zones - The virtual machine zones. 15592 Zones *[]string `json:"zones,omitempty"` 15593 // ExtendedLocation - The extended location of the Virtual Machine. 15594 ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` 15595 // ID - READ-ONLY; Resource Id 15596 ID *string `json:"id,omitempty"` 15597 // Name - READ-ONLY; Resource name 15598 Name *string `json:"name,omitempty"` 15599 // Type - READ-ONLY; Resource type 15600 Type *string `json:"type,omitempty"` 15601 // Location - Resource location 15602 Location *string `json:"location,omitempty"` 15603 // Tags - Resource tags 15604 Tags map[string]*string `json:"tags"` 15605} 15606 15607// MarshalJSON is the custom marshaler for VirtualMachine. 15608func (VM VirtualMachine) MarshalJSON() ([]byte, error) { 15609 objectMap := make(map[string]interface{}) 15610 if VM.Plan != nil { 15611 objectMap["plan"] = VM.Plan 15612 } 15613 if VM.VirtualMachineProperties != nil { 15614 objectMap["properties"] = VM.VirtualMachineProperties 15615 } 15616 if VM.Identity != nil { 15617 objectMap["identity"] = VM.Identity 15618 } 15619 if VM.Zones != nil { 15620 objectMap["zones"] = VM.Zones 15621 } 15622 if VM.ExtendedLocation != nil { 15623 objectMap["extendedLocation"] = VM.ExtendedLocation 15624 } 15625 if VM.Location != nil { 15626 objectMap["location"] = VM.Location 15627 } 15628 if VM.Tags != nil { 15629 objectMap["tags"] = VM.Tags 15630 } 15631 return json.Marshal(objectMap) 15632} 15633 15634// UnmarshalJSON is the custom unmarshaler for VirtualMachine struct. 15635func (VM *VirtualMachine) UnmarshalJSON(body []byte) error { 15636 var m map[string]*json.RawMessage 15637 err := json.Unmarshal(body, &m) 15638 if err != nil { 15639 return err 15640 } 15641 for k, v := range m { 15642 switch k { 15643 case "plan": 15644 if v != nil { 15645 var plan Plan 15646 err = json.Unmarshal(*v, &plan) 15647 if err != nil { 15648 return err 15649 } 15650 VM.Plan = &plan 15651 } 15652 case "properties": 15653 if v != nil { 15654 var virtualMachineProperties VirtualMachineProperties 15655 err = json.Unmarshal(*v, &virtualMachineProperties) 15656 if err != nil { 15657 return err 15658 } 15659 VM.VirtualMachineProperties = &virtualMachineProperties 15660 } 15661 case "resources": 15662 if v != nil { 15663 var resources []VirtualMachineExtension 15664 err = json.Unmarshal(*v, &resources) 15665 if err != nil { 15666 return err 15667 } 15668 VM.Resources = &resources 15669 } 15670 case "identity": 15671 if v != nil { 15672 var identity VirtualMachineIdentity 15673 err = json.Unmarshal(*v, &identity) 15674 if err != nil { 15675 return err 15676 } 15677 VM.Identity = &identity 15678 } 15679 case "zones": 15680 if v != nil { 15681 var zones []string 15682 err = json.Unmarshal(*v, &zones) 15683 if err != nil { 15684 return err 15685 } 15686 VM.Zones = &zones 15687 } 15688 case "extendedLocation": 15689 if v != nil { 15690 var extendedLocation ExtendedLocation 15691 err = json.Unmarshal(*v, &extendedLocation) 15692 if err != nil { 15693 return err 15694 } 15695 VM.ExtendedLocation = &extendedLocation 15696 } 15697 case "id": 15698 if v != nil { 15699 var ID string 15700 err = json.Unmarshal(*v, &ID) 15701 if err != nil { 15702 return err 15703 } 15704 VM.ID = &ID 15705 } 15706 case "name": 15707 if v != nil { 15708 var name string 15709 err = json.Unmarshal(*v, &name) 15710 if err != nil { 15711 return err 15712 } 15713 VM.Name = &name 15714 } 15715 case "type": 15716 if v != nil { 15717 var typeVar string 15718 err = json.Unmarshal(*v, &typeVar) 15719 if err != nil { 15720 return err 15721 } 15722 VM.Type = &typeVar 15723 } 15724 case "location": 15725 if v != nil { 15726 var location string 15727 err = json.Unmarshal(*v, &location) 15728 if err != nil { 15729 return err 15730 } 15731 VM.Location = &location 15732 } 15733 case "tags": 15734 if v != nil { 15735 var tags map[string]*string 15736 err = json.Unmarshal(*v, &tags) 15737 if err != nil { 15738 return err 15739 } 15740 VM.Tags = tags 15741 } 15742 } 15743 } 15744 15745 return nil 15746} 15747 15748// VirtualMachineAgentInstanceView the instance view of the VM Agent running on the virtual machine. 15749type VirtualMachineAgentInstanceView struct { 15750 // VMAgentVersion - The VM Agent full version. 15751 VMAgentVersion *string `json:"vmAgentVersion,omitempty"` 15752 // ExtensionHandlers - The virtual machine extension handler instance view. 15753 ExtensionHandlers *[]VirtualMachineExtensionHandlerInstanceView `json:"extensionHandlers,omitempty"` 15754 // Statuses - The resource status information. 15755 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 15756} 15757 15758// VirtualMachineAssessPatchesResult describes the properties of an AssessPatches result. 15759type VirtualMachineAssessPatchesResult struct { 15760 autorest.Response `json:"-"` 15761 // 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' 15762 Status PatchOperationStatus `json:"status,omitempty"` 15763 // AssessmentActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. 15764 AssessmentActivityID *string `json:"assessmentActivityId,omitempty"` 15765 // 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. 15766 RebootPending *bool `json:"rebootPending,omitempty"` 15767 // CriticalAndSecurityPatchCount - READ-ONLY; The number of critical or security patches that have been detected as available and not yet installed. 15768 CriticalAndSecurityPatchCount *int32 `json:"criticalAndSecurityPatchCount,omitempty"` 15769 // OtherPatchCount - READ-ONLY; The number of all available patches excluding critical and security. 15770 OtherPatchCount *int32 `json:"otherPatchCount,omitempty"` 15771 // StartDateTime - READ-ONLY; The UTC timestamp when the operation began. 15772 StartDateTime *date.Time `json:"startDateTime,omitempty"` 15773 // AvailablePatches - READ-ONLY; The list of patches that have been detected as available for installation. 15774 AvailablePatches *[]VirtualMachineSoftwarePatchProperties `json:"availablePatches,omitempty"` 15775 // Error - READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. 15776 Error *APIError `json:"error,omitempty"` 15777} 15778 15779// MarshalJSON is the custom marshaler for VirtualMachineAssessPatchesResult. 15780func (vmapr VirtualMachineAssessPatchesResult) MarshalJSON() ([]byte, error) { 15781 objectMap := make(map[string]interface{}) 15782 return json.Marshal(objectMap) 15783} 15784 15785// VirtualMachineCaptureParameters capture Virtual Machine parameters. 15786type VirtualMachineCaptureParameters struct { 15787 // VhdPrefix - The captured virtual hard disk's name prefix. 15788 VhdPrefix *string `json:"vhdPrefix,omitempty"` 15789 // DestinationContainerName - The destination container name. 15790 DestinationContainerName *string `json:"destinationContainerName,omitempty"` 15791 // OverwriteVhds - Specifies whether to overwrite the destination virtual hard disk, in case of conflict. 15792 OverwriteVhds *bool `json:"overwriteVhds,omitempty"` 15793} 15794 15795// VirtualMachineCaptureResult output of virtual machine capture operation. 15796type VirtualMachineCaptureResult struct { 15797 autorest.Response `json:"-"` 15798 // Schema - READ-ONLY; the schema of the captured virtual machine 15799 Schema *string `json:"$schema,omitempty"` 15800 // ContentVersion - READ-ONLY; the version of the content 15801 ContentVersion *string `json:"contentVersion,omitempty"` 15802 // Parameters - READ-ONLY; parameters of the captured virtual machine 15803 Parameters interface{} `json:"parameters,omitempty"` 15804 // Resources - READ-ONLY; a list of resource items of the captured virtual machine 15805 Resources *[]interface{} `json:"resources,omitempty"` 15806 // ID - Resource Id 15807 ID *string `json:"id,omitempty"` 15808} 15809 15810// MarshalJSON is the custom marshaler for VirtualMachineCaptureResult. 15811func (vmcr VirtualMachineCaptureResult) MarshalJSON() ([]byte, error) { 15812 objectMap := make(map[string]interface{}) 15813 if vmcr.ID != nil { 15814 objectMap["id"] = vmcr.ID 15815 } 15816 return json.Marshal(objectMap) 15817} 15818 15819// VirtualMachineExtension describes a Virtual Machine Extension. 15820type VirtualMachineExtension struct { 15821 autorest.Response `json:"-"` 15822 *VirtualMachineExtensionProperties `json:"properties,omitempty"` 15823 // ID - READ-ONLY; Resource Id 15824 ID *string `json:"id,omitempty"` 15825 // Name - READ-ONLY; Resource name 15826 Name *string `json:"name,omitempty"` 15827 // Type - READ-ONLY; Resource type 15828 Type *string `json:"type,omitempty"` 15829 // Location - Resource location 15830 Location *string `json:"location,omitempty"` 15831 // Tags - Resource tags 15832 Tags map[string]*string `json:"tags"` 15833} 15834 15835// MarshalJSON is the custom marshaler for VirtualMachineExtension. 15836func (vme VirtualMachineExtension) MarshalJSON() ([]byte, error) { 15837 objectMap := make(map[string]interface{}) 15838 if vme.VirtualMachineExtensionProperties != nil { 15839 objectMap["properties"] = vme.VirtualMachineExtensionProperties 15840 } 15841 if vme.Location != nil { 15842 objectMap["location"] = vme.Location 15843 } 15844 if vme.Tags != nil { 15845 objectMap["tags"] = vme.Tags 15846 } 15847 return json.Marshal(objectMap) 15848} 15849 15850// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtension struct. 15851func (vme *VirtualMachineExtension) UnmarshalJSON(body []byte) error { 15852 var m map[string]*json.RawMessage 15853 err := json.Unmarshal(body, &m) 15854 if err != nil { 15855 return err 15856 } 15857 for k, v := range m { 15858 switch k { 15859 case "properties": 15860 if v != nil { 15861 var virtualMachineExtensionProperties VirtualMachineExtensionProperties 15862 err = json.Unmarshal(*v, &virtualMachineExtensionProperties) 15863 if err != nil { 15864 return err 15865 } 15866 vme.VirtualMachineExtensionProperties = &virtualMachineExtensionProperties 15867 } 15868 case "id": 15869 if v != nil { 15870 var ID string 15871 err = json.Unmarshal(*v, &ID) 15872 if err != nil { 15873 return err 15874 } 15875 vme.ID = &ID 15876 } 15877 case "name": 15878 if v != nil { 15879 var name string 15880 err = json.Unmarshal(*v, &name) 15881 if err != nil { 15882 return err 15883 } 15884 vme.Name = &name 15885 } 15886 case "type": 15887 if v != nil { 15888 var typeVar string 15889 err = json.Unmarshal(*v, &typeVar) 15890 if err != nil { 15891 return err 15892 } 15893 vme.Type = &typeVar 15894 } 15895 case "location": 15896 if v != nil { 15897 var location string 15898 err = json.Unmarshal(*v, &location) 15899 if err != nil { 15900 return err 15901 } 15902 vme.Location = &location 15903 } 15904 case "tags": 15905 if v != nil { 15906 var tags map[string]*string 15907 err = json.Unmarshal(*v, &tags) 15908 if err != nil { 15909 return err 15910 } 15911 vme.Tags = tags 15912 } 15913 } 15914 } 15915 15916 return nil 15917} 15918 15919// VirtualMachineExtensionHandlerInstanceView the instance view of a virtual machine extension handler. 15920type VirtualMachineExtensionHandlerInstanceView struct { 15921 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 15922 Type *string `json:"type,omitempty"` 15923 // TypeHandlerVersion - Specifies the version of the script handler. 15924 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 15925 // Status - The extension handler status. 15926 Status *InstanceViewStatus `json:"status,omitempty"` 15927} 15928 15929// VirtualMachineExtensionImage describes a Virtual Machine Extension Image. 15930type VirtualMachineExtensionImage struct { 15931 autorest.Response `json:"-"` 15932 *VirtualMachineExtensionImageProperties `json:"properties,omitempty"` 15933 // ID - READ-ONLY; Resource Id 15934 ID *string `json:"id,omitempty"` 15935 // Name - READ-ONLY; Resource name 15936 Name *string `json:"name,omitempty"` 15937 // Type - READ-ONLY; Resource type 15938 Type *string `json:"type,omitempty"` 15939 // Location - Resource location 15940 Location *string `json:"location,omitempty"` 15941 // Tags - Resource tags 15942 Tags map[string]*string `json:"tags"` 15943} 15944 15945// MarshalJSON is the custom marshaler for VirtualMachineExtensionImage. 15946func (vmei VirtualMachineExtensionImage) MarshalJSON() ([]byte, error) { 15947 objectMap := make(map[string]interface{}) 15948 if vmei.VirtualMachineExtensionImageProperties != nil { 15949 objectMap["properties"] = vmei.VirtualMachineExtensionImageProperties 15950 } 15951 if vmei.Location != nil { 15952 objectMap["location"] = vmei.Location 15953 } 15954 if vmei.Tags != nil { 15955 objectMap["tags"] = vmei.Tags 15956 } 15957 return json.Marshal(objectMap) 15958} 15959 15960// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtensionImage struct. 15961func (vmei *VirtualMachineExtensionImage) UnmarshalJSON(body []byte) error { 15962 var m map[string]*json.RawMessage 15963 err := json.Unmarshal(body, &m) 15964 if err != nil { 15965 return err 15966 } 15967 for k, v := range m { 15968 switch k { 15969 case "properties": 15970 if v != nil { 15971 var virtualMachineExtensionImageProperties VirtualMachineExtensionImageProperties 15972 err = json.Unmarshal(*v, &virtualMachineExtensionImageProperties) 15973 if err != nil { 15974 return err 15975 } 15976 vmei.VirtualMachineExtensionImageProperties = &virtualMachineExtensionImageProperties 15977 } 15978 case "id": 15979 if v != nil { 15980 var ID string 15981 err = json.Unmarshal(*v, &ID) 15982 if err != nil { 15983 return err 15984 } 15985 vmei.ID = &ID 15986 } 15987 case "name": 15988 if v != nil { 15989 var name string 15990 err = json.Unmarshal(*v, &name) 15991 if err != nil { 15992 return err 15993 } 15994 vmei.Name = &name 15995 } 15996 case "type": 15997 if v != nil { 15998 var typeVar string 15999 err = json.Unmarshal(*v, &typeVar) 16000 if err != nil { 16001 return err 16002 } 16003 vmei.Type = &typeVar 16004 } 16005 case "location": 16006 if v != nil { 16007 var location string 16008 err = json.Unmarshal(*v, &location) 16009 if err != nil { 16010 return err 16011 } 16012 vmei.Location = &location 16013 } 16014 case "tags": 16015 if v != nil { 16016 var tags map[string]*string 16017 err = json.Unmarshal(*v, &tags) 16018 if err != nil { 16019 return err 16020 } 16021 vmei.Tags = tags 16022 } 16023 } 16024 } 16025 16026 return nil 16027} 16028 16029// VirtualMachineExtensionImageProperties describes the properties of a Virtual Machine Extension Image. 16030type VirtualMachineExtensionImageProperties struct { 16031 // OperatingSystem - The operating system this extension supports. 16032 OperatingSystem *string `json:"operatingSystem,omitempty"` 16033 // ComputeRole - The type of role (IaaS or PaaS) this extension supports. 16034 ComputeRole *string `json:"computeRole,omitempty"` 16035 // HandlerSchema - The schema defined by publisher, where extension consumers should provide settings in a matching schema. 16036 HandlerSchema *string `json:"handlerSchema,omitempty"` 16037 // 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. 16038 VMScaleSetEnabled *bool `json:"vmScaleSetEnabled,omitempty"` 16039 // SupportsMultipleExtensions - Whether the handler can support multiple extensions. 16040 SupportsMultipleExtensions *bool `json:"supportsMultipleExtensions,omitempty"` 16041} 16042 16043// VirtualMachineExtensionInstanceView the instance view of a virtual machine extension. 16044type VirtualMachineExtensionInstanceView struct { 16045 // Name - The virtual machine extension name. 16046 Name *string `json:"name,omitempty"` 16047 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 16048 Type *string `json:"type,omitempty"` 16049 // TypeHandlerVersion - Specifies the version of the script handler. 16050 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 16051 // Substatuses - The resource status information. 16052 Substatuses *[]InstanceViewStatus `json:"substatuses,omitempty"` 16053 // Statuses - The resource status information. 16054 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 16055} 16056 16057// VirtualMachineExtensionProperties describes the properties of a Virtual Machine Extension. 16058type VirtualMachineExtensionProperties struct { 16059 // ForceUpdateTag - How the extension handler should be forced to update even if the extension configuration has not changed. 16060 ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` 16061 // Publisher - The name of the extension handler publisher. 16062 Publisher *string `json:"publisher,omitempty"` 16063 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 16064 Type *string `json:"type,omitempty"` 16065 // TypeHandlerVersion - Specifies the version of the script handler. 16066 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 16067 // 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. 16068 AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` 16069 // EnableAutomaticUpgrade - Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. 16070 EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` 16071 // Settings - Json formatted public settings for the extension. 16072 Settings interface{} `json:"settings,omitempty"` 16073 // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. 16074 ProtectedSettings interface{} `json:"protectedSettings,omitempty"` 16075 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 16076 ProvisioningState *string `json:"provisioningState,omitempty"` 16077 // InstanceView - The virtual machine extension instance view. 16078 InstanceView *VirtualMachineExtensionInstanceView `json:"instanceView,omitempty"` 16079} 16080 16081// MarshalJSON is the custom marshaler for VirtualMachineExtensionProperties. 16082func (vmep VirtualMachineExtensionProperties) MarshalJSON() ([]byte, error) { 16083 objectMap := make(map[string]interface{}) 16084 if vmep.ForceUpdateTag != nil { 16085 objectMap["forceUpdateTag"] = vmep.ForceUpdateTag 16086 } 16087 if vmep.Publisher != nil { 16088 objectMap["publisher"] = vmep.Publisher 16089 } 16090 if vmep.Type != nil { 16091 objectMap["type"] = vmep.Type 16092 } 16093 if vmep.TypeHandlerVersion != nil { 16094 objectMap["typeHandlerVersion"] = vmep.TypeHandlerVersion 16095 } 16096 if vmep.AutoUpgradeMinorVersion != nil { 16097 objectMap["autoUpgradeMinorVersion"] = vmep.AutoUpgradeMinorVersion 16098 } 16099 if vmep.EnableAutomaticUpgrade != nil { 16100 objectMap["enableAutomaticUpgrade"] = vmep.EnableAutomaticUpgrade 16101 } 16102 if vmep.Settings != nil { 16103 objectMap["settings"] = vmep.Settings 16104 } 16105 if vmep.ProtectedSettings != nil { 16106 objectMap["protectedSettings"] = vmep.ProtectedSettings 16107 } 16108 if vmep.InstanceView != nil { 16109 objectMap["instanceView"] = vmep.InstanceView 16110 } 16111 return json.Marshal(objectMap) 16112} 16113 16114// VirtualMachineExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of 16115// a long-running operation. 16116type VirtualMachineExtensionsCreateOrUpdateFuture struct { 16117 azure.FutureAPI 16118 // Result returns the result of the asynchronous operation. 16119 // If the operation has not completed it will return an error. 16120 Result func(VirtualMachineExtensionsClient) (VirtualMachineExtension, error) 16121} 16122 16123// UnmarshalJSON is the custom unmarshaller for CreateFuture. 16124func (future *VirtualMachineExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 16125 var azFuture azure.Future 16126 if err := json.Unmarshal(body, &azFuture); err != nil { 16127 return err 16128 } 16129 future.FutureAPI = &azFuture 16130 future.Result = future.result 16131 return nil 16132} 16133 16134// result is the default implementation for VirtualMachineExtensionsCreateOrUpdateFuture.Result. 16135func (future *VirtualMachineExtensionsCreateOrUpdateFuture) result(client VirtualMachineExtensionsClient) (vme VirtualMachineExtension, err error) { 16136 var done bool 16137 done, err = future.DoneWithContext(context.Background(), client) 16138 if err != nil { 16139 err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 16140 return 16141 } 16142 if !done { 16143 vme.Response.Response = future.Response() 16144 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsCreateOrUpdateFuture") 16145 return 16146 } 16147 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 16148 if vme.Response.Response, err = future.GetResult(sender); err == nil && vme.Response.Response.StatusCode != http.StatusNoContent { 16149 vme, err = client.CreateOrUpdateResponder(vme.Response.Response) 16150 if err != nil { 16151 err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsCreateOrUpdateFuture", "Result", vme.Response.Response, "Failure responding to request") 16152 } 16153 } 16154 return 16155} 16156 16157// VirtualMachineExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of a 16158// long-running operation. 16159type VirtualMachineExtensionsDeleteFuture struct { 16160 azure.FutureAPI 16161 // Result returns the result of the asynchronous operation. 16162 // If the operation has not completed it will return an error. 16163 Result func(VirtualMachineExtensionsClient) (autorest.Response, error) 16164} 16165 16166// UnmarshalJSON is the custom unmarshaller for CreateFuture. 16167func (future *VirtualMachineExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { 16168 var azFuture azure.Future 16169 if err := json.Unmarshal(body, &azFuture); err != nil { 16170 return err 16171 } 16172 future.FutureAPI = &azFuture 16173 future.Result = future.result 16174 return nil 16175} 16176 16177// result is the default implementation for VirtualMachineExtensionsDeleteFuture.Result. 16178func (future *VirtualMachineExtensionsDeleteFuture) result(client VirtualMachineExtensionsClient) (ar autorest.Response, err error) { 16179 var done bool 16180 done, err = future.DoneWithContext(context.Background(), client) 16181 if err != nil { 16182 err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") 16183 return 16184 } 16185 if !done { 16186 ar.Response = future.Response() 16187 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsDeleteFuture") 16188 return 16189 } 16190 ar.Response = future.Response() 16191 return 16192} 16193 16194// VirtualMachineExtensionsListResult the List Extension operation response 16195type VirtualMachineExtensionsListResult struct { 16196 autorest.Response `json:"-"` 16197 // Value - The list of extensions 16198 Value *[]VirtualMachineExtension `json:"value,omitempty"` 16199} 16200 16201// VirtualMachineExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of a 16202// long-running operation. 16203type VirtualMachineExtensionsUpdateFuture struct { 16204 azure.FutureAPI 16205 // Result returns the result of the asynchronous operation. 16206 // If the operation has not completed it will return an error. 16207 Result func(VirtualMachineExtensionsClient) (VirtualMachineExtension, error) 16208} 16209 16210// UnmarshalJSON is the custom unmarshaller for CreateFuture. 16211func (future *VirtualMachineExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { 16212 var azFuture azure.Future 16213 if err := json.Unmarshal(body, &azFuture); err != nil { 16214 return err 16215 } 16216 future.FutureAPI = &azFuture 16217 future.Result = future.result 16218 return nil 16219} 16220 16221// result is the default implementation for VirtualMachineExtensionsUpdateFuture.Result. 16222func (future *VirtualMachineExtensionsUpdateFuture) result(client VirtualMachineExtensionsClient) (vme VirtualMachineExtension, err error) { 16223 var done bool 16224 done, err = future.DoneWithContext(context.Background(), client) 16225 if err != nil { 16226 err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsUpdateFuture", "Result", future.Response(), "Polling failure") 16227 return 16228 } 16229 if !done { 16230 vme.Response.Response = future.Response() 16231 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsUpdateFuture") 16232 return 16233 } 16234 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 16235 if vme.Response.Response, err = future.GetResult(sender); err == nil && vme.Response.Response.StatusCode != http.StatusNoContent { 16236 vme, err = client.UpdateResponder(vme.Response.Response) 16237 if err != nil { 16238 err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsUpdateFuture", "Result", vme.Response.Response, "Failure responding to request") 16239 } 16240 } 16241 return 16242} 16243 16244// VirtualMachineExtensionUpdate describes a Virtual Machine Extension. 16245type VirtualMachineExtensionUpdate struct { 16246 *VirtualMachineExtensionUpdateProperties `json:"properties,omitempty"` 16247 // Tags - Resource tags 16248 Tags map[string]*string `json:"tags"` 16249} 16250 16251// MarshalJSON is the custom marshaler for VirtualMachineExtensionUpdate. 16252func (vmeu VirtualMachineExtensionUpdate) MarshalJSON() ([]byte, error) { 16253 objectMap := make(map[string]interface{}) 16254 if vmeu.VirtualMachineExtensionUpdateProperties != nil { 16255 objectMap["properties"] = vmeu.VirtualMachineExtensionUpdateProperties 16256 } 16257 if vmeu.Tags != nil { 16258 objectMap["tags"] = vmeu.Tags 16259 } 16260 return json.Marshal(objectMap) 16261} 16262 16263// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtensionUpdate struct. 16264func (vmeu *VirtualMachineExtensionUpdate) UnmarshalJSON(body []byte) error { 16265 var m map[string]*json.RawMessage 16266 err := json.Unmarshal(body, &m) 16267 if err != nil { 16268 return err 16269 } 16270 for k, v := range m { 16271 switch k { 16272 case "properties": 16273 if v != nil { 16274 var virtualMachineExtensionUpdateProperties VirtualMachineExtensionUpdateProperties 16275 err = json.Unmarshal(*v, &virtualMachineExtensionUpdateProperties) 16276 if err != nil { 16277 return err 16278 } 16279 vmeu.VirtualMachineExtensionUpdateProperties = &virtualMachineExtensionUpdateProperties 16280 } 16281 case "tags": 16282 if v != nil { 16283 var tags map[string]*string 16284 err = json.Unmarshal(*v, &tags) 16285 if err != nil { 16286 return err 16287 } 16288 vmeu.Tags = tags 16289 } 16290 } 16291 } 16292 16293 return nil 16294} 16295 16296// VirtualMachineExtensionUpdateProperties describes the properties of a Virtual Machine Extension. 16297type VirtualMachineExtensionUpdateProperties struct { 16298 // ForceUpdateTag - How the extension handler should be forced to update even if the extension configuration has not changed. 16299 ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` 16300 // Publisher - The name of the extension handler publisher. 16301 Publisher *string `json:"publisher,omitempty"` 16302 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 16303 Type *string `json:"type,omitempty"` 16304 // TypeHandlerVersion - Specifies the version of the script handler. 16305 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 16306 // 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. 16307 AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` 16308 // EnableAutomaticUpgrade - Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. 16309 EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` 16310 // Settings - Json formatted public settings for the extension. 16311 Settings interface{} `json:"settings,omitempty"` 16312 // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. 16313 ProtectedSettings interface{} `json:"protectedSettings,omitempty"` 16314} 16315 16316// VirtualMachineHealthStatus the health status of the VM. 16317type VirtualMachineHealthStatus struct { 16318 // Status - READ-ONLY; The health status information for the VM. 16319 Status *InstanceViewStatus `json:"status,omitempty"` 16320} 16321 16322// MarshalJSON is the custom marshaler for VirtualMachineHealthStatus. 16323func (vmhs VirtualMachineHealthStatus) MarshalJSON() ([]byte, error) { 16324 objectMap := make(map[string]interface{}) 16325 return json.Marshal(objectMap) 16326} 16327 16328// VirtualMachineIdentity identity for the virtual machine. 16329type VirtualMachineIdentity struct { 16330 // PrincipalID - READ-ONLY; The principal id of virtual machine identity. This property will only be provided for a system assigned identity. 16331 PrincipalID *string `json:"principalId,omitempty"` 16332 // TenantID - READ-ONLY; The tenant id associated with the virtual machine. This property will only be provided for a system assigned identity. 16333 TenantID *string `json:"tenantId,omitempty"` 16334 // 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' 16335 Type ResourceIdentityType `json:"type,omitempty"` 16336 // 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}'. 16337 UserAssignedIdentities map[string]*VirtualMachineIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` 16338} 16339 16340// MarshalJSON is the custom marshaler for VirtualMachineIdentity. 16341func (vmi VirtualMachineIdentity) MarshalJSON() ([]byte, error) { 16342 objectMap := make(map[string]interface{}) 16343 if vmi.Type != "" { 16344 objectMap["type"] = vmi.Type 16345 } 16346 if vmi.UserAssignedIdentities != nil { 16347 objectMap["userAssignedIdentities"] = vmi.UserAssignedIdentities 16348 } 16349 return json.Marshal(objectMap) 16350} 16351 16352// VirtualMachineIdentityUserAssignedIdentitiesValue ... 16353type VirtualMachineIdentityUserAssignedIdentitiesValue struct { 16354 // PrincipalID - READ-ONLY; The principal id of user assigned identity. 16355 PrincipalID *string `json:"principalId,omitempty"` 16356 // ClientID - READ-ONLY; The client id of user assigned identity. 16357 ClientID *string `json:"clientId,omitempty"` 16358} 16359 16360// MarshalJSON is the custom marshaler for VirtualMachineIdentityUserAssignedIdentitiesValue. 16361func (vmiAiv VirtualMachineIdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) { 16362 objectMap := make(map[string]interface{}) 16363 return json.Marshal(objectMap) 16364} 16365 16366// VirtualMachineImage describes a Virtual Machine Image. 16367type VirtualMachineImage struct { 16368 autorest.Response `json:"-"` 16369 *VirtualMachineImageProperties `json:"properties,omitempty"` 16370 // Name - The name of the resource. 16371 Name *string `json:"name,omitempty"` 16372 // Location - The supported Azure location of the resource. 16373 Location *string `json:"location,omitempty"` 16374 // 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). 16375 Tags map[string]*string `json:"tags"` 16376 // ExtendedLocation - The extended location of the Virtual Machine. 16377 ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` 16378 // ID - Resource Id 16379 ID *string `json:"id,omitempty"` 16380} 16381 16382// MarshalJSON is the custom marshaler for VirtualMachineImage. 16383func (vmi VirtualMachineImage) MarshalJSON() ([]byte, error) { 16384 objectMap := make(map[string]interface{}) 16385 if vmi.VirtualMachineImageProperties != nil { 16386 objectMap["properties"] = vmi.VirtualMachineImageProperties 16387 } 16388 if vmi.Name != nil { 16389 objectMap["name"] = vmi.Name 16390 } 16391 if vmi.Location != nil { 16392 objectMap["location"] = vmi.Location 16393 } 16394 if vmi.Tags != nil { 16395 objectMap["tags"] = vmi.Tags 16396 } 16397 if vmi.ExtendedLocation != nil { 16398 objectMap["extendedLocation"] = vmi.ExtendedLocation 16399 } 16400 if vmi.ID != nil { 16401 objectMap["id"] = vmi.ID 16402 } 16403 return json.Marshal(objectMap) 16404} 16405 16406// UnmarshalJSON is the custom unmarshaler for VirtualMachineImage struct. 16407func (vmi *VirtualMachineImage) UnmarshalJSON(body []byte) error { 16408 var m map[string]*json.RawMessage 16409 err := json.Unmarshal(body, &m) 16410 if err != nil { 16411 return err 16412 } 16413 for k, v := range m { 16414 switch k { 16415 case "properties": 16416 if v != nil { 16417 var virtualMachineImageProperties VirtualMachineImageProperties 16418 err = json.Unmarshal(*v, &virtualMachineImageProperties) 16419 if err != nil { 16420 return err 16421 } 16422 vmi.VirtualMachineImageProperties = &virtualMachineImageProperties 16423 } 16424 case "name": 16425 if v != nil { 16426 var name string 16427 err = json.Unmarshal(*v, &name) 16428 if err != nil { 16429 return err 16430 } 16431 vmi.Name = &name 16432 } 16433 case "location": 16434 if v != nil { 16435 var location string 16436 err = json.Unmarshal(*v, &location) 16437 if err != nil { 16438 return err 16439 } 16440 vmi.Location = &location 16441 } 16442 case "tags": 16443 if v != nil { 16444 var tags map[string]*string 16445 err = json.Unmarshal(*v, &tags) 16446 if err != nil { 16447 return err 16448 } 16449 vmi.Tags = tags 16450 } 16451 case "extendedLocation": 16452 if v != nil { 16453 var extendedLocation ExtendedLocation 16454 err = json.Unmarshal(*v, &extendedLocation) 16455 if err != nil { 16456 return err 16457 } 16458 vmi.ExtendedLocation = &extendedLocation 16459 } 16460 case "id": 16461 if v != nil { 16462 var ID string 16463 err = json.Unmarshal(*v, &ID) 16464 if err != nil { 16465 return err 16466 } 16467 vmi.ID = &ID 16468 } 16469 } 16470 } 16471 16472 return nil 16473} 16474 16475// VirtualMachineImageFeature specifies additional capabilities supported by the image 16476type VirtualMachineImageFeature struct { 16477 // Name - The name of the feature. 16478 Name *string `json:"name,omitempty"` 16479 // Value - The corresponding value for the feature. 16480 Value *string `json:"value,omitempty"` 16481} 16482 16483// VirtualMachineImageProperties describes the properties of a Virtual Machine Image. 16484type VirtualMachineImageProperties struct { 16485 Plan *PurchasePlan `json:"plan,omitempty"` 16486 OsDiskImage *OSDiskImage `json:"osDiskImage,omitempty"` 16487 DataDiskImages *[]DataDiskImage `json:"dataDiskImages,omitempty"` 16488 AutomaticOSUpgradeProperties *AutomaticOSUpgradeProperties `json:"automaticOSUpgradeProperties,omitempty"` 16489 // HyperVGeneration - Possible values include: 'HyperVGenerationTypesV1', 'HyperVGenerationTypesV2' 16490 HyperVGeneration HyperVGenerationTypes `json:"hyperVGeneration,omitempty"` 16491 // Disallowed - Specifies disallowed configuration for the VirtualMachine created from the image 16492 Disallowed *DisallowedConfiguration `json:"disallowed,omitempty"` 16493 Features *[]VirtualMachineImageFeature `json:"features,omitempty"` 16494} 16495 16496// VirtualMachineImageResource virtual machine image resource information. 16497type VirtualMachineImageResource struct { 16498 // Name - The name of the resource. 16499 Name *string `json:"name,omitempty"` 16500 // Location - The supported Azure location of the resource. 16501 Location *string `json:"location,omitempty"` 16502 // 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). 16503 Tags map[string]*string `json:"tags"` 16504 // ExtendedLocation - The extended location of the Virtual Machine. 16505 ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` 16506 // ID - Resource Id 16507 ID *string `json:"id,omitempty"` 16508} 16509 16510// MarshalJSON is the custom marshaler for VirtualMachineImageResource. 16511func (vmir VirtualMachineImageResource) MarshalJSON() ([]byte, error) { 16512 objectMap := make(map[string]interface{}) 16513 if vmir.Name != nil { 16514 objectMap["name"] = vmir.Name 16515 } 16516 if vmir.Location != nil { 16517 objectMap["location"] = vmir.Location 16518 } 16519 if vmir.Tags != nil { 16520 objectMap["tags"] = vmir.Tags 16521 } 16522 if vmir.ExtendedLocation != nil { 16523 objectMap["extendedLocation"] = vmir.ExtendedLocation 16524 } 16525 if vmir.ID != nil { 16526 objectMap["id"] = vmir.ID 16527 } 16528 return json.Marshal(objectMap) 16529} 16530 16531// VirtualMachineInstallPatchesParameters input for InstallPatches as directly received by the API 16532type VirtualMachineInstallPatchesParameters struct { 16533 // 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) 16534 MaximumDuration *string `json:"maximumDuration,omitempty"` 16535 // RebootSetting - Defines when it is acceptable to reboot a VM during a software update operation. Possible values include: 'VMGuestPatchRebootSettingIfRequired', 'VMGuestPatchRebootSettingNever', 'VMGuestPatchRebootSettingAlways' 16536 RebootSetting VMGuestPatchRebootSetting `json:"rebootSetting,omitempty"` 16537 // WindowsParameters - Input for InstallPatches on a Windows VM, as directly received by the API 16538 WindowsParameters *WindowsParameters `json:"windowsParameters,omitempty"` 16539 // LinuxParameters - Input for InstallPatches on a Linux VM, as directly received by the API 16540 LinuxParameters *LinuxParameters `json:"linuxParameters,omitempty"` 16541} 16542 16543// VirtualMachineInstallPatchesResult the result summary of an installation operation. 16544type VirtualMachineInstallPatchesResult struct { 16545 autorest.Response `json:"-"` 16546 // 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' 16547 Status PatchOperationStatus `json:"status,omitempty"` 16548 // InstallationActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. 16549 InstallationActivityID *string `json:"installationActivityId,omitempty"` 16550 // RebootStatus - READ-ONLY; The reboot state of the VM following completion of the operation. Possible values include: 'VMGuestPatchRebootStatusUnknown', 'VMGuestPatchRebootStatusNotNeeded', 'VMGuestPatchRebootStatusRequired', 'VMGuestPatchRebootStatusStarted', 'VMGuestPatchRebootStatusFailed', 'VMGuestPatchRebootStatusCompleted' 16551 RebootStatus VMGuestPatchRebootStatus `json:"rebootStatus,omitempty"` 16552 // MaintenanceWindowExceeded - READ-ONLY; Whether the operation ran out of time before it completed all its intended actions. 16553 MaintenanceWindowExceeded *bool `json:"maintenanceWindowExceeded,omitempty"` 16554 // ExcludedPatchCount - READ-ONLY; The number of patches that were not installed due to the user blocking their installation. 16555 ExcludedPatchCount *int32 `json:"excludedPatchCount,omitempty"` 16556 // NotSelectedPatchCount - READ-ONLY; The number of patches that were detected as available for install, but did not meet the operation's criteria. 16557 NotSelectedPatchCount *int32 `json:"notSelectedPatchCount,omitempty"` 16558 // 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. 16559 PendingPatchCount *int32 `json:"pendingPatchCount,omitempty"` 16560 // InstalledPatchCount - READ-ONLY; The number of patches successfully installed. 16561 InstalledPatchCount *int32 `json:"installedPatchCount,omitempty"` 16562 // FailedPatchCount - READ-ONLY; The number of patches that could not be installed due to some issue. See errors for details. 16563 FailedPatchCount *int32 `json:"failedPatchCount,omitempty"` 16564 // Patches - READ-ONLY; The patches that were installed during the operation. 16565 Patches *[]PatchInstallationDetail `json:"patches,omitempty"` 16566 // StartDateTime - READ-ONLY; The UTC timestamp when the operation began. 16567 StartDateTime *date.Time `json:"startDateTime,omitempty"` 16568 // Error - READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. 16569 Error *APIError `json:"error,omitempty"` 16570} 16571 16572// MarshalJSON is the custom marshaler for VirtualMachineInstallPatchesResult. 16573func (vmipr VirtualMachineInstallPatchesResult) MarshalJSON() ([]byte, error) { 16574 objectMap := make(map[string]interface{}) 16575 return json.Marshal(objectMap) 16576} 16577 16578// VirtualMachineInstanceView the instance view of a virtual machine. 16579type VirtualMachineInstanceView struct { 16580 autorest.Response `json:"-"` 16581 // PlatformUpdateDomain - Specifies the update domain of the virtual machine. 16582 PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` 16583 // PlatformFaultDomain - Specifies the fault domain of the virtual machine. 16584 PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` 16585 // ComputerName - The computer name assigned to the virtual machine. 16586 ComputerName *string `json:"computerName,omitempty"` 16587 // OsName - The Operating System running on the virtual machine. 16588 OsName *string `json:"osName,omitempty"` 16589 // OsVersion - The version of Operating System running on the virtual machine. 16590 OsVersion *string `json:"osVersion,omitempty"` 16591 // HyperVGeneration - Specifies the HyperVGeneration Type associated with a resource. Possible values include: 'HyperVGenerationTypeV1', 'HyperVGenerationTypeV2' 16592 HyperVGeneration HyperVGenerationType `json:"hyperVGeneration,omitempty"` 16593 // RdpThumbPrint - The Remote desktop certificate thumbprint. 16594 RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"` 16595 // VMAgent - The VM Agent running on the virtual machine. 16596 VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"` 16597 // MaintenanceRedeployStatus - The Maintenance Operation status on the virtual machine. 16598 MaintenanceRedeployStatus *MaintenanceRedeployStatus `json:"maintenanceRedeployStatus,omitempty"` 16599 // Disks - The virtual machine disk information. 16600 Disks *[]DiskInstanceView `json:"disks,omitempty"` 16601 // Extensions - The extensions information. 16602 Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` 16603 // VMHealth - READ-ONLY; The health status for the VM. 16604 VMHealth *VirtualMachineHealthStatus `json:"vmHealth,omitempty"` 16605 // 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. 16606 BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` 16607 // 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. 16608 AssignedHost *string `json:"assignedHost,omitempty"` 16609 // Statuses - The resource status information. 16610 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 16611 // PatchStatus - [Preview Feature] The status of virtual machine patch operations. 16612 PatchStatus *VirtualMachinePatchStatus `json:"patchStatus,omitempty"` 16613} 16614 16615// MarshalJSON is the custom marshaler for VirtualMachineInstanceView. 16616func (vmiv VirtualMachineInstanceView) MarshalJSON() ([]byte, error) { 16617 objectMap := make(map[string]interface{}) 16618 if vmiv.PlatformUpdateDomain != nil { 16619 objectMap["platformUpdateDomain"] = vmiv.PlatformUpdateDomain 16620 } 16621 if vmiv.PlatformFaultDomain != nil { 16622 objectMap["platformFaultDomain"] = vmiv.PlatformFaultDomain 16623 } 16624 if vmiv.ComputerName != nil { 16625 objectMap["computerName"] = vmiv.ComputerName 16626 } 16627 if vmiv.OsName != nil { 16628 objectMap["osName"] = vmiv.OsName 16629 } 16630 if vmiv.OsVersion != nil { 16631 objectMap["osVersion"] = vmiv.OsVersion 16632 } 16633 if vmiv.HyperVGeneration != "" { 16634 objectMap["hyperVGeneration"] = vmiv.HyperVGeneration 16635 } 16636 if vmiv.RdpThumbPrint != nil { 16637 objectMap["rdpThumbPrint"] = vmiv.RdpThumbPrint 16638 } 16639 if vmiv.VMAgent != nil { 16640 objectMap["vmAgent"] = vmiv.VMAgent 16641 } 16642 if vmiv.MaintenanceRedeployStatus != nil { 16643 objectMap["maintenanceRedeployStatus"] = vmiv.MaintenanceRedeployStatus 16644 } 16645 if vmiv.Disks != nil { 16646 objectMap["disks"] = vmiv.Disks 16647 } 16648 if vmiv.Extensions != nil { 16649 objectMap["extensions"] = vmiv.Extensions 16650 } 16651 if vmiv.BootDiagnostics != nil { 16652 objectMap["bootDiagnostics"] = vmiv.BootDiagnostics 16653 } 16654 if vmiv.Statuses != nil { 16655 objectMap["statuses"] = vmiv.Statuses 16656 } 16657 if vmiv.PatchStatus != nil { 16658 objectMap["patchStatus"] = vmiv.PatchStatus 16659 } 16660 return json.Marshal(objectMap) 16661} 16662 16663// VirtualMachineIPTag contains the IP tag associated with the public IP address. 16664type VirtualMachineIPTag struct { 16665 // IPTagType - IP tag type. Example: FirstPartyUsage. 16666 IPTagType *string `json:"ipTagType,omitempty"` 16667 // Tag - IP tag associated with the public IP. Example: SQL, Storage etc. 16668 Tag *string `json:"tag,omitempty"` 16669} 16670 16671// VirtualMachineListResult the List Virtual Machine operation response. 16672type VirtualMachineListResult struct { 16673 autorest.Response `json:"-"` 16674 // Value - The list of virtual machines. 16675 Value *[]VirtualMachine `json:"value,omitempty"` 16676 // NextLink - The URI to fetch the next page of VMs. Call ListNext() with this URI to fetch the next page of Virtual Machines. 16677 NextLink *string `json:"nextLink,omitempty"` 16678} 16679 16680// VirtualMachineListResultIterator provides access to a complete listing of VirtualMachine values. 16681type VirtualMachineListResultIterator struct { 16682 i int 16683 page VirtualMachineListResultPage 16684} 16685 16686// NextWithContext advances to the next value. If there was an error making 16687// the request the iterator does not advance and the error is returned. 16688func (iter *VirtualMachineListResultIterator) NextWithContext(ctx context.Context) (err error) { 16689 if tracing.IsEnabled() { 16690 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineListResultIterator.NextWithContext") 16691 defer func() { 16692 sc := -1 16693 if iter.Response().Response.Response != nil { 16694 sc = iter.Response().Response.Response.StatusCode 16695 } 16696 tracing.EndSpan(ctx, sc, err) 16697 }() 16698 } 16699 iter.i++ 16700 if iter.i < len(iter.page.Values()) { 16701 return nil 16702 } 16703 err = iter.page.NextWithContext(ctx) 16704 if err != nil { 16705 iter.i-- 16706 return err 16707 } 16708 iter.i = 0 16709 return nil 16710} 16711 16712// Next advances to the next value. If there was an error making 16713// the request the iterator does not advance and the error is returned. 16714// Deprecated: Use NextWithContext() instead. 16715func (iter *VirtualMachineListResultIterator) Next() error { 16716 return iter.NextWithContext(context.Background()) 16717} 16718 16719// NotDone returns true if the enumeration should be started or is not yet complete. 16720func (iter VirtualMachineListResultIterator) NotDone() bool { 16721 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 16722} 16723 16724// Response returns the raw server response from the last page request. 16725func (iter VirtualMachineListResultIterator) Response() VirtualMachineListResult { 16726 return iter.page.Response() 16727} 16728 16729// Value returns the current value or a zero-initialized value if the 16730// iterator has advanced beyond the end of the collection. 16731func (iter VirtualMachineListResultIterator) Value() VirtualMachine { 16732 if !iter.page.NotDone() { 16733 return VirtualMachine{} 16734 } 16735 return iter.page.Values()[iter.i] 16736} 16737 16738// Creates a new instance of the VirtualMachineListResultIterator type. 16739func NewVirtualMachineListResultIterator(page VirtualMachineListResultPage) VirtualMachineListResultIterator { 16740 return VirtualMachineListResultIterator{page: page} 16741} 16742 16743// IsEmpty returns true if the ListResult contains no values. 16744func (vmlr VirtualMachineListResult) IsEmpty() bool { 16745 return vmlr.Value == nil || len(*vmlr.Value) == 0 16746} 16747 16748// hasNextLink returns true if the NextLink is not empty. 16749func (vmlr VirtualMachineListResult) hasNextLink() bool { 16750 return vmlr.NextLink != nil && len(*vmlr.NextLink) != 0 16751} 16752 16753// virtualMachineListResultPreparer prepares a request to retrieve the next set of results. 16754// It returns nil if no more results exist. 16755func (vmlr VirtualMachineListResult) virtualMachineListResultPreparer(ctx context.Context) (*http.Request, error) { 16756 if !vmlr.hasNextLink() { 16757 return nil, nil 16758 } 16759 return autorest.Prepare((&http.Request{}).WithContext(ctx), 16760 autorest.AsJSON(), 16761 autorest.AsGet(), 16762 autorest.WithBaseURL(to.String(vmlr.NextLink))) 16763} 16764 16765// VirtualMachineListResultPage contains a page of VirtualMachine values. 16766type VirtualMachineListResultPage struct { 16767 fn func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error) 16768 vmlr VirtualMachineListResult 16769} 16770 16771// NextWithContext advances to the next page of values. If there was an error making 16772// the request the page does not advance and the error is returned. 16773func (page *VirtualMachineListResultPage) NextWithContext(ctx context.Context) (err error) { 16774 if tracing.IsEnabled() { 16775 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineListResultPage.NextWithContext") 16776 defer func() { 16777 sc := -1 16778 if page.Response().Response.Response != nil { 16779 sc = page.Response().Response.Response.StatusCode 16780 } 16781 tracing.EndSpan(ctx, sc, err) 16782 }() 16783 } 16784 for { 16785 next, err := page.fn(ctx, page.vmlr) 16786 if err != nil { 16787 return err 16788 } 16789 page.vmlr = next 16790 if !next.hasNextLink() || !next.IsEmpty() { 16791 break 16792 } 16793 } 16794 return nil 16795} 16796 16797// Next advances to the next page of values. If there was an error making 16798// the request the page does not advance and the error is returned. 16799// Deprecated: Use NextWithContext() instead. 16800func (page *VirtualMachineListResultPage) Next() error { 16801 return page.NextWithContext(context.Background()) 16802} 16803 16804// NotDone returns true if the page enumeration should be started or is not yet complete. 16805func (page VirtualMachineListResultPage) NotDone() bool { 16806 return !page.vmlr.IsEmpty() 16807} 16808 16809// Response returns the raw server response from the last page request. 16810func (page VirtualMachineListResultPage) Response() VirtualMachineListResult { 16811 return page.vmlr 16812} 16813 16814// Values returns the slice of values for the current page or nil if there are no values. 16815func (page VirtualMachineListResultPage) Values() []VirtualMachine { 16816 if page.vmlr.IsEmpty() { 16817 return nil 16818 } 16819 return *page.vmlr.Value 16820} 16821 16822// Creates a new instance of the VirtualMachineListResultPage type. 16823func NewVirtualMachineListResultPage(cur VirtualMachineListResult, getNextPage func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error)) VirtualMachineListResultPage { 16824 return VirtualMachineListResultPage{ 16825 fn: getNextPage, 16826 vmlr: cur, 16827 } 16828} 16829 16830// VirtualMachineNetworkInterfaceConfiguration describes a virtual machine network interface 16831// configurations. 16832type VirtualMachineNetworkInterfaceConfiguration struct { 16833 // Name - The network interface configuration name. 16834 Name *string `json:"name,omitempty"` 16835 *VirtualMachineNetworkInterfaceConfigurationProperties `json:"properties,omitempty"` 16836} 16837 16838// MarshalJSON is the custom marshaler for VirtualMachineNetworkInterfaceConfiguration. 16839func (vmnic VirtualMachineNetworkInterfaceConfiguration) MarshalJSON() ([]byte, error) { 16840 objectMap := make(map[string]interface{}) 16841 if vmnic.Name != nil { 16842 objectMap["name"] = vmnic.Name 16843 } 16844 if vmnic.VirtualMachineNetworkInterfaceConfigurationProperties != nil { 16845 objectMap["properties"] = vmnic.VirtualMachineNetworkInterfaceConfigurationProperties 16846 } 16847 return json.Marshal(objectMap) 16848} 16849 16850// UnmarshalJSON is the custom unmarshaler for VirtualMachineNetworkInterfaceConfiguration struct. 16851func (vmnic *VirtualMachineNetworkInterfaceConfiguration) UnmarshalJSON(body []byte) error { 16852 var m map[string]*json.RawMessage 16853 err := json.Unmarshal(body, &m) 16854 if err != nil { 16855 return err 16856 } 16857 for k, v := range m { 16858 switch k { 16859 case "name": 16860 if v != nil { 16861 var name string 16862 err = json.Unmarshal(*v, &name) 16863 if err != nil { 16864 return err 16865 } 16866 vmnic.Name = &name 16867 } 16868 case "properties": 16869 if v != nil { 16870 var virtualMachineNetworkInterfaceConfigurationProperties VirtualMachineNetworkInterfaceConfigurationProperties 16871 err = json.Unmarshal(*v, &virtualMachineNetworkInterfaceConfigurationProperties) 16872 if err != nil { 16873 return err 16874 } 16875 vmnic.VirtualMachineNetworkInterfaceConfigurationProperties = &virtualMachineNetworkInterfaceConfigurationProperties 16876 } 16877 } 16878 } 16879 16880 return nil 16881} 16882 16883// VirtualMachineNetworkInterfaceConfigurationProperties describes a virtual machine network profile's IP 16884// configuration. 16885type VirtualMachineNetworkInterfaceConfigurationProperties struct { 16886 // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. 16887 Primary *bool `json:"primary,omitempty"` 16888 // DeleteOption - Specify what happens to the network interface when the VM is deleted. Possible values include: 'DeleteOptionsDelete', 'DeleteOptionsDetach' 16889 DeleteOption DeleteOptions `json:"deleteOption,omitempty"` 16890 // EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled. 16891 EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` 16892 // EnableFpga - Specifies whether the network interface is FPGA networking-enabled. 16893 EnableFpga *bool `json:"enableFpga,omitempty"` 16894 // EnableIPForwarding - Whether IP forwarding enabled on this NIC. 16895 EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` 16896 // NetworkSecurityGroup - The network security group. 16897 NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` 16898 // DNSSettings - The dns settings to be applied on the network interfaces. 16899 DNSSettings *VirtualMachineNetworkInterfaceDNSSettingsConfiguration `json:"dnsSettings,omitempty"` 16900 // IPConfigurations - Specifies the IP configurations of the network interface. 16901 IPConfigurations *[]VirtualMachineNetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` 16902 DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` 16903} 16904 16905// VirtualMachineNetworkInterfaceDNSSettingsConfiguration describes a virtual machines network 16906// configuration's DNS settings. 16907type VirtualMachineNetworkInterfaceDNSSettingsConfiguration struct { 16908 // DNSServers - List of DNS servers IP addresses 16909 DNSServers *[]string `json:"dnsServers,omitempty"` 16910} 16911 16912// VirtualMachineNetworkInterfaceIPConfiguration describes a virtual machine network profile's IP 16913// configuration. 16914type VirtualMachineNetworkInterfaceIPConfiguration struct { 16915 // Name - The IP configuration name. 16916 Name *string `json:"name,omitempty"` 16917 *VirtualMachineNetworkInterfaceIPConfigurationProperties `json:"properties,omitempty"` 16918} 16919 16920// MarshalJSON is the custom marshaler for VirtualMachineNetworkInterfaceIPConfiguration. 16921func (vmniic VirtualMachineNetworkInterfaceIPConfiguration) MarshalJSON() ([]byte, error) { 16922 objectMap := make(map[string]interface{}) 16923 if vmniic.Name != nil { 16924 objectMap["name"] = vmniic.Name 16925 } 16926 if vmniic.VirtualMachineNetworkInterfaceIPConfigurationProperties != nil { 16927 objectMap["properties"] = vmniic.VirtualMachineNetworkInterfaceIPConfigurationProperties 16928 } 16929 return json.Marshal(objectMap) 16930} 16931 16932// UnmarshalJSON is the custom unmarshaler for VirtualMachineNetworkInterfaceIPConfiguration struct. 16933func (vmniic *VirtualMachineNetworkInterfaceIPConfiguration) UnmarshalJSON(body []byte) error { 16934 var m map[string]*json.RawMessage 16935 err := json.Unmarshal(body, &m) 16936 if err != nil { 16937 return err 16938 } 16939 for k, v := range m { 16940 switch k { 16941 case "name": 16942 if v != nil { 16943 var name string 16944 err = json.Unmarshal(*v, &name) 16945 if err != nil { 16946 return err 16947 } 16948 vmniic.Name = &name 16949 } 16950 case "properties": 16951 if v != nil { 16952 var virtualMachineNetworkInterfaceIPConfigurationProperties VirtualMachineNetworkInterfaceIPConfigurationProperties 16953 err = json.Unmarshal(*v, &virtualMachineNetworkInterfaceIPConfigurationProperties) 16954 if err != nil { 16955 return err 16956 } 16957 vmniic.VirtualMachineNetworkInterfaceIPConfigurationProperties = &virtualMachineNetworkInterfaceIPConfigurationProperties 16958 } 16959 } 16960 } 16961 16962 return nil 16963} 16964 16965// VirtualMachineNetworkInterfaceIPConfigurationProperties describes a virtual machine network interface IP 16966// configuration properties. 16967type VirtualMachineNetworkInterfaceIPConfigurationProperties struct { 16968 // Subnet - Specifies the identifier of the subnet. 16969 Subnet *SubResource `json:"subnet,omitempty"` 16970 // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. 16971 Primary *bool `json:"primary,omitempty"` 16972 // PublicIPAddressConfiguration - The publicIPAddressConfiguration. 16973 PublicIPAddressConfiguration *VirtualMachinePublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` 16974 // 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' 16975 PrivateIPAddressVersion IPVersions `json:"privateIPAddressVersion,omitempty"` 16976 // ApplicationSecurityGroups - Specifies an array of references to application security group. 16977 ApplicationSecurityGroups *[]SubResource `json:"applicationSecurityGroups,omitempty"` 16978 // 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. 16979 ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` 16980 // 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]. 16981 LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` 16982} 16983 16984// VirtualMachinePatchStatus the status of virtual machine patch operations. 16985type VirtualMachinePatchStatus struct { 16986 // AvailablePatchSummary - The available patch summary of the latest assessment operation for the virtual machine. 16987 AvailablePatchSummary *AvailablePatchSummary `json:"availablePatchSummary,omitempty"` 16988 // LastPatchInstallationSummary - The installation summary of the latest installation operation for the virtual machine. 16989 LastPatchInstallationSummary *LastPatchInstallationSummary `json:"lastPatchInstallationSummary,omitempty"` 16990 // ConfigurationStatuses - READ-ONLY; The enablement status of the specified patchMode 16991 ConfigurationStatuses *[]InstanceViewStatus `json:"configurationStatuses,omitempty"` 16992} 16993 16994// MarshalJSON is the custom marshaler for VirtualMachinePatchStatus. 16995func (vmps VirtualMachinePatchStatus) MarshalJSON() ([]byte, error) { 16996 objectMap := make(map[string]interface{}) 16997 if vmps.AvailablePatchSummary != nil { 16998 objectMap["availablePatchSummary"] = vmps.AvailablePatchSummary 16999 } 17000 if vmps.LastPatchInstallationSummary != nil { 17001 objectMap["lastPatchInstallationSummary"] = vmps.LastPatchInstallationSummary 17002 } 17003 return json.Marshal(objectMap) 17004} 17005 17006// VirtualMachineProperties describes the properties of a Virtual Machine. 17007type VirtualMachineProperties struct { 17008 // HardwareProfile - Specifies the hardware settings for the virtual machine. 17009 HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` 17010 // StorageProfile - Specifies the storage settings for the virtual machine disks. 17011 StorageProfile *StorageProfile `json:"storageProfile,omitempty"` 17012 // AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the virtual machine. 17013 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 17014 // OsProfile - Specifies the operating system settings used while creating the virtual machine. Some of the settings cannot be changed once VM is provisioned. 17015 OsProfile *OSProfile `json:"osProfile,omitempty"` 17016 // NetworkProfile - Specifies the network interfaces of the virtual machine. 17017 NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` 17018 // SecurityProfile - Specifies the Security related profile settings for the virtual machine. 17019 SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` 17020 // DiagnosticsProfile - Specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. 17021 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 17022 // 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. 17023 AvailabilitySet *SubResource `json:"availabilitySet,omitempty"` 17024 // 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 17025 VirtualMachineScaleSet *SubResource `json:"virtualMachineScaleSet,omitempty"` 17026 // ProximityPlacementGroup - Specifies information about the proximity placement group that the virtual machine should be assigned to. <br><br>Minimum api-version: 2018-04-01. 17027 ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` 17028 // Priority - Specifies the priority for the virtual machine. <br><br>Minimum api-version: 2019-03-01. Possible values include: 'VirtualMachinePriorityTypesRegular', 'VirtualMachinePriorityTypesLow', 'VirtualMachinePriorityTypesSpot' 17029 Priority VirtualMachinePriorityTypes `json:"priority,omitempty"` 17030 // 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' 17031 EvictionPolicy VirtualMachineEvictionPolicyTypes `json:"evictionPolicy,omitempty"` 17032 // BillingProfile - Specifies the billing related details of a Azure Spot virtual machine. <br><br>Minimum api-version: 2019-03-01. 17033 BillingProfile *BillingProfile `json:"billingProfile,omitempty"` 17034 // Host - Specifies information about the dedicated host that the virtual machine resides in. <br><br>Minimum api-version: 2018-10-01. 17035 Host *SubResource `json:"host,omitempty"` 17036 // 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. 17037 HostGroup *SubResource `json:"hostGroup,omitempty"` 17038 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 17039 ProvisioningState *string `json:"provisioningState,omitempty"` 17040 // InstanceView - READ-ONLY; The virtual machine instance view. 17041 InstanceView *VirtualMachineInstanceView `json:"instanceView,omitempty"` 17042 // 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 17043 LicenseType *string `json:"licenseType,omitempty"` 17044 // 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. 17045 VMID *string `json:"vmId,omitempty"` 17046 // 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 17047 ExtensionsTimeBudget *string `json:"extensionsTimeBudget,omitempty"` 17048 // 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 17049 PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` 17050 // ScheduledEventsProfile - Specifies Scheduled Event related configurations. 17051 ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` 17052 // 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 17053 UserData *string `json:"userData,omitempty"` 17054 // CapacityReservation - Specifies information about the capacity reservation that is used to allocate virtual machine. <br><br>Minimum api-version: 2021-04-01. 17055 CapacityReservation *CapacityReservationProfile `json:"capacityReservation,omitempty"` 17056} 17057 17058// MarshalJSON is the custom marshaler for VirtualMachineProperties. 17059func (vmp VirtualMachineProperties) MarshalJSON() ([]byte, error) { 17060 objectMap := make(map[string]interface{}) 17061 if vmp.HardwareProfile != nil { 17062 objectMap["hardwareProfile"] = vmp.HardwareProfile 17063 } 17064 if vmp.StorageProfile != nil { 17065 objectMap["storageProfile"] = vmp.StorageProfile 17066 } 17067 if vmp.AdditionalCapabilities != nil { 17068 objectMap["additionalCapabilities"] = vmp.AdditionalCapabilities 17069 } 17070 if vmp.OsProfile != nil { 17071 objectMap["osProfile"] = vmp.OsProfile 17072 } 17073 if vmp.NetworkProfile != nil { 17074 objectMap["networkProfile"] = vmp.NetworkProfile 17075 } 17076 if vmp.SecurityProfile != nil { 17077 objectMap["securityProfile"] = vmp.SecurityProfile 17078 } 17079 if vmp.DiagnosticsProfile != nil { 17080 objectMap["diagnosticsProfile"] = vmp.DiagnosticsProfile 17081 } 17082 if vmp.AvailabilitySet != nil { 17083 objectMap["availabilitySet"] = vmp.AvailabilitySet 17084 } 17085 if vmp.VirtualMachineScaleSet != nil { 17086 objectMap["virtualMachineScaleSet"] = vmp.VirtualMachineScaleSet 17087 } 17088 if vmp.ProximityPlacementGroup != nil { 17089 objectMap["proximityPlacementGroup"] = vmp.ProximityPlacementGroup 17090 } 17091 if vmp.Priority != "" { 17092 objectMap["priority"] = vmp.Priority 17093 } 17094 if vmp.EvictionPolicy != "" { 17095 objectMap["evictionPolicy"] = vmp.EvictionPolicy 17096 } 17097 if vmp.BillingProfile != nil { 17098 objectMap["billingProfile"] = vmp.BillingProfile 17099 } 17100 if vmp.Host != nil { 17101 objectMap["host"] = vmp.Host 17102 } 17103 if vmp.HostGroup != nil { 17104 objectMap["hostGroup"] = vmp.HostGroup 17105 } 17106 if vmp.LicenseType != nil { 17107 objectMap["licenseType"] = vmp.LicenseType 17108 } 17109 if vmp.ExtensionsTimeBudget != nil { 17110 objectMap["extensionsTimeBudget"] = vmp.ExtensionsTimeBudget 17111 } 17112 if vmp.PlatformFaultDomain != nil { 17113 objectMap["platformFaultDomain"] = vmp.PlatformFaultDomain 17114 } 17115 if vmp.ScheduledEventsProfile != nil { 17116 objectMap["scheduledEventsProfile"] = vmp.ScheduledEventsProfile 17117 } 17118 if vmp.UserData != nil { 17119 objectMap["userData"] = vmp.UserData 17120 } 17121 if vmp.CapacityReservation != nil { 17122 objectMap["capacityReservation"] = vmp.CapacityReservation 17123 } 17124 return json.Marshal(objectMap) 17125} 17126 17127// VirtualMachinePublicIPAddressConfiguration describes a virtual machines IP Configuration's 17128// PublicIPAddress configuration 17129type VirtualMachinePublicIPAddressConfiguration struct { 17130 // Name - The publicIP address configuration name. 17131 Name *string `json:"name,omitempty"` 17132 *VirtualMachinePublicIPAddressConfigurationProperties `json:"properties,omitempty"` 17133 Sku *PublicIPAddressSku `json:"sku,omitempty"` 17134} 17135 17136// MarshalJSON is the custom marshaler for VirtualMachinePublicIPAddressConfiguration. 17137func (vmpiac VirtualMachinePublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { 17138 objectMap := make(map[string]interface{}) 17139 if vmpiac.Name != nil { 17140 objectMap["name"] = vmpiac.Name 17141 } 17142 if vmpiac.VirtualMachinePublicIPAddressConfigurationProperties != nil { 17143 objectMap["properties"] = vmpiac.VirtualMachinePublicIPAddressConfigurationProperties 17144 } 17145 if vmpiac.Sku != nil { 17146 objectMap["sku"] = vmpiac.Sku 17147 } 17148 return json.Marshal(objectMap) 17149} 17150 17151// UnmarshalJSON is the custom unmarshaler for VirtualMachinePublicIPAddressConfiguration struct. 17152func (vmpiac *VirtualMachinePublicIPAddressConfiguration) UnmarshalJSON(body []byte) error { 17153 var m map[string]*json.RawMessage 17154 err := json.Unmarshal(body, &m) 17155 if err != nil { 17156 return err 17157 } 17158 for k, v := range m { 17159 switch k { 17160 case "name": 17161 if v != nil { 17162 var name string 17163 err = json.Unmarshal(*v, &name) 17164 if err != nil { 17165 return err 17166 } 17167 vmpiac.Name = &name 17168 } 17169 case "properties": 17170 if v != nil { 17171 var virtualMachinePublicIPAddressConfigurationProperties VirtualMachinePublicIPAddressConfigurationProperties 17172 err = json.Unmarshal(*v, &virtualMachinePublicIPAddressConfigurationProperties) 17173 if err != nil { 17174 return err 17175 } 17176 vmpiac.VirtualMachinePublicIPAddressConfigurationProperties = &virtualMachinePublicIPAddressConfigurationProperties 17177 } 17178 case "sku": 17179 if v != nil { 17180 var sku PublicIPAddressSku 17181 err = json.Unmarshal(*v, &sku) 17182 if err != nil { 17183 return err 17184 } 17185 vmpiac.Sku = &sku 17186 } 17187 } 17188 } 17189 17190 return nil 17191} 17192 17193// VirtualMachinePublicIPAddressConfigurationProperties describes a virtual machines IP Configuration's 17194// PublicIPAddress configuration 17195type VirtualMachinePublicIPAddressConfigurationProperties struct { 17196 // IdleTimeoutInMinutes - The idle timeout of the public IP address. 17197 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` 17198 // DeleteOption - Specify what happens to the public IP address when the VM is deleted. Possible values include: 'DeleteOptionsDelete', 'DeleteOptionsDetach' 17199 DeleteOption DeleteOptions `json:"deleteOption,omitempty"` 17200 // DNSSettings - The dns settings to be applied on the publicIP addresses . 17201 DNSSettings *VirtualMachinePublicIPAddressDNSSettingsConfiguration `json:"dnsSettings,omitempty"` 17202 // IPTags - The list of IP tags associated with the public IP address. 17203 IPTags *[]VirtualMachineIPTag `json:"ipTags,omitempty"` 17204 // PublicIPPrefix - The PublicIPPrefix from which to allocate publicIP addresses. 17205 PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` 17206 // 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' 17207 PublicIPAddressVersion IPVersions `json:"publicIPAddressVersion,omitempty"` 17208 // PublicIPAllocationMethod - Specify the public IP allocation type. Possible values include: 'PublicIPAllocationMethodDynamic', 'PublicIPAllocationMethodStatic' 17209 PublicIPAllocationMethod PublicIPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` 17210} 17211 17212// VirtualMachinePublicIPAddressDNSSettingsConfiguration describes a virtual machines network 17213// configuration's DNS settings. 17214type VirtualMachinePublicIPAddressDNSSettingsConfiguration struct { 17215 // 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. 17216 DomainNameLabel *string `json:"domainNameLabel,omitempty"` 17217} 17218 17219// VirtualMachineReimageParameters parameters for Reimaging Virtual Machine. NOTE: Virtual Machine OS disk 17220// will always be reimaged 17221type VirtualMachineReimageParameters struct { 17222 // 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. 17223 TempDisk *bool `json:"tempDisk,omitempty"` 17224} 17225 17226// VirtualMachineRunCommand describes a Virtual Machine run command. 17227type VirtualMachineRunCommand struct { 17228 autorest.Response `json:"-"` 17229 *VirtualMachineRunCommandProperties `json:"properties,omitempty"` 17230 // ID - READ-ONLY; Resource Id 17231 ID *string `json:"id,omitempty"` 17232 // Name - READ-ONLY; Resource name 17233 Name *string `json:"name,omitempty"` 17234 // Type - READ-ONLY; Resource type 17235 Type *string `json:"type,omitempty"` 17236 // Location - Resource location 17237 Location *string `json:"location,omitempty"` 17238 // Tags - Resource tags 17239 Tags map[string]*string `json:"tags"` 17240} 17241 17242// MarshalJSON is the custom marshaler for VirtualMachineRunCommand. 17243func (vmrc VirtualMachineRunCommand) MarshalJSON() ([]byte, error) { 17244 objectMap := make(map[string]interface{}) 17245 if vmrc.VirtualMachineRunCommandProperties != nil { 17246 objectMap["properties"] = vmrc.VirtualMachineRunCommandProperties 17247 } 17248 if vmrc.Location != nil { 17249 objectMap["location"] = vmrc.Location 17250 } 17251 if vmrc.Tags != nil { 17252 objectMap["tags"] = vmrc.Tags 17253 } 17254 return json.Marshal(objectMap) 17255} 17256 17257// UnmarshalJSON is the custom unmarshaler for VirtualMachineRunCommand struct. 17258func (vmrc *VirtualMachineRunCommand) UnmarshalJSON(body []byte) error { 17259 var m map[string]*json.RawMessage 17260 err := json.Unmarshal(body, &m) 17261 if err != nil { 17262 return err 17263 } 17264 for k, v := range m { 17265 switch k { 17266 case "properties": 17267 if v != nil { 17268 var virtualMachineRunCommandProperties VirtualMachineRunCommandProperties 17269 err = json.Unmarshal(*v, &virtualMachineRunCommandProperties) 17270 if err != nil { 17271 return err 17272 } 17273 vmrc.VirtualMachineRunCommandProperties = &virtualMachineRunCommandProperties 17274 } 17275 case "id": 17276 if v != nil { 17277 var ID string 17278 err = json.Unmarshal(*v, &ID) 17279 if err != nil { 17280 return err 17281 } 17282 vmrc.ID = &ID 17283 } 17284 case "name": 17285 if v != nil { 17286 var name string 17287 err = json.Unmarshal(*v, &name) 17288 if err != nil { 17289 return err 17290 } 17291 vmrc.Name = &name 17292 } 17293 case "type": 17294 if v != nil { 17295 var typeVar string 17296 err = json.Unmarshal(*v, &typeVar) 17297 if err != nil { 17298 return err 17299 } 17300 vmrc.Type = &typeVar 17301 } 17302 case "location": 17303 if v != nil { 17304 var location string 17305 err = json.Unmarshal(*v, &location) 17306 if err != nil { 17307 return err 17308 } 17309 vmrc.Location = &location 17310 } 17311 case "tags": 17312 if v != nil { 17313 var tags map[string]*string 17314 err = json.Unmarshal(*v, &tags) 17315 if err != nil { 17316 return err 17317 } 17318 vmrc.Tags = tags 17319 } 17320 } 17321 } 17322 17323 return nil 17324} 17325 17326// VirtualMachineRunCommandInstanceView the instance view of a virtual machine run command. 17327type VirtualMachineRunCommandInstanceView struct { 17328 // ExecutionState - Script execution status. Possible values include: 'ExecutionStateUnknown', 'ExecutionStatePending', 'ExecutionStateRunning', 'ExecutionStateFailed', 'ExecutionStateSucceeded', 'ExecutionStateTimedOut', 'ExecutionStateCanceled' 17329 ExecutionState ExecutionState `json:"executionState,omitempty"` 17330 // ExecutionMessage - Communicate script configuration errors or execution messages. 17331 ExecutionMessage *string `json:"executionMessage,omitempty"` 17332 // ExitCode - Exit code returned from script execution. 17333 ExitCode *int32 `json:"exitCode,omitempty"` 17334 // Output - Script output stream. 17335 Output *string `json:"output,omitempty"` 17336 // Error - Script error stream. 17337 Error *string `json:"error,omitempty"` 17338 // StartTime - Script start time. 17339 StartTime *date.Time `json:"startTime,omitempty"` 17340 // EndTime - Script end time. 17341 EndTime *date.Time `json:"endTime,omitempty"` 17342 // Statuses - The resource status information. 17343 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 17344} 17345 17346// VirtualMachineRunCommandProperties describes the properties of a Virtual Machine run command. 17347type VirtualMachineRunCommandProperties struct { 17348 // Source - The source of the run command script. 17349 Source *VirtualMachineRunCommandScriptSource `json:"source,omitempty"` 17350 // Parameters - The parameters used by the script. 17351 Parameters *[]RunCommandInputParameter `json:"parameters,omitempty"` 17352 // ProtectedParameters - The parameters used by the script. 17353 ProtectedParameters *[]RunCommandInputParameter `json:"protectedParameters,omitempty"` 17354 // AsyncExecution - Optional. If set to true, provisioning will complete as soon as the script starts and will not wait for script to complete. 17355 AsyncExecution *bool `json:"asyncExecution,omitempty"` 17356 // RunAsUser - Specifies the user account on the VM when executing the run command. 17357 RunAsUser *string `json:"runAsUser,omitempty"` 17358 // RunAsPassword - Specifies the user account password on the VM when executing the run command. 17359 RunAsPassword *string `json:"runAsPassword,omitempty"` 17360 // TimeoutInSeconds - The timeout in seconds to execute the run command. 17361 TimeoutInSeconds *int32 `json:"timeoutInSeconds,omitempty"` 17362 // OutputBlobURI - Specifies the Azure storage blob where script output stream will be uploaded. 17363 OutputBlobURI *string `json:"outputBlobUri,omitempty"` 17364 // ErrorBlobURI - Specifies the Azure storage blob where script error stream will be uploaded. 17365 ErrorBlobURI *string `json:"errorBlobUri,omitempty"` 17366 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 17367 ProvisioningState *string `json:"provisioningState,omitempty"` 17368 // InstanceView - READ-ONLY; The virtual machine run command instance view. 17369 InstanceView *VirtualMachineRunCommandInstanceView `json:"instanceView,omitempty"` 17370} 17371 17372// MarshalJSON is the custom marshaler for VirtualMachineRunCommandProperties. 17373func (vmrcp VirtualMachineRunCommandProperties) MarshalJSON() ([]byte, error) { 17374 objectMap := make(map[string]interface{}) 17375 if vmrcp.Source != nil { 17376 objectMap["source"] = vmrcp.Source 17377 } 17378 if vmrcp.Parameters != nil { 17379 objectMap["parameters"] = vmrcp.Parameters 17380 } 17381 if vmrcp.ProtectedParameters != nil { 17382 objectMap["protectedParameters"] = vmrcp.ProtectedParameters 17383 } 17384 if vmrcp.AsyncExecution != nil { 17385 objectMap["asyncExecution"] = vmrcp.AsyncExecution 17386 } 17387 if vmrcp.RunAsUser != nil { 17388 objectMap["runAsUser"] = vmrcp.RunAsUser 17389 } 17390 if vmrcp.RunAsPassword != nil { 17391 objectMap["runAsPassword"] = vmrcp.RunAsPassword 17392 } 17393 if vmrcp.TimeoutInSeconds != nil { 17394 objectMap["timeoutInSeconds"] = vmrcp.TimeoutInSeconds 17395 } 17396 if vmrcp.OutputBlobURI != nil { 17397 objectMap["outputBlobUri"] = vmrcp.OutputBlobURI 17398 } 17399 if vmrcp.ErrorBlobURI != nil { 17400 objectMap["errorBlobUri"] = vmrcp.ErrorBlobURI 17401 } 17402 return json.Marshal(objectMap) 17403} 17404 17405// VirtualMachineRunCommandsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results 17406// of a long-running operation. 17407type VirtualMachineRunCommandsCreateOrUpdateFuture struct { 17408 azure.FutureAPI 17409 // Result returns the result of the asynchronous operation. 17410 // If the operation has not completed it will return an error. 17411 Result func(VirtualMachineRunCommandsClient) (VirtualMachineRunCommand, error) 17412} 17413 17414// UnmarshalJSON is the custom unmarshaller for CreateFuture. 17415func (future *VirtualMachineRunCommandsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 17416 var azFuture azure.Future 17417 if err := json.Unmarshal(body, &azFuture); err != nil { 17418 return err 17419 } 17420 future.FutureAPI = &azFuture 17421 future.Result = future.result 17422 return nil 17423} 17424 17425// result is the default implementation for VirtualMachineRunCommandsCreateOrUpdateFuture.Result. 17426func (future *VirtualMachineRunCommandsCreateOrUpdateFuture) result(client VirtualMachineRunCommandsClient) (vmrc VirtualMachineRunCommand, err error) { 17427 var done bool 17428 done, err = future.DoneWithContext(context.Background(), client) 17429 if err != nil { 17430 err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 17431 return 17432 } 17433 if !done { 17434 vmrc.Response.Response = future.Response() 17435 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineRunCommandsCreateOrUpdateFuture") 17436 return 17437 } 17438 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 17439 if vmrc.Response.Response, err = future.GetResult(sender); err == nil && vmrc.Response.Response.StatusCode != http.StatusNoContent { 17440 vmrc, err = client.CreateOrUpdateResponder(vmrc.Response.Response) 17441 if err != nil { 17442 err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsCreateOrUpdateFuture", "Result", vmrc.Response.Response, "Failure responding to request") 17443 } 17444 } 17445 return 17446} 17447 17448// VirtualMachineRunCommandScriptSource describes the script sources for run command. 17449type VirtualMachineRunCommandScriptSource struct { 17450 // Script - Specifies the script content to be executed on the VM. 17451 Script *string `json:"script,omitempty"` 17452 // ScriptURI - Specifies the script download location. 17453 ScriptURI *string `json:"scriptUri,omitempty"` 17454 // CommandID - Specifies a commandId of predefined built-in script. 17455 CommandID *string `json:"commandId,omitempty"` 17456} 17457 17458// VirtualMachineRunCommandsDeleteFuture an abstraction for monitoring and retrieving the results of a 17459// long-running operation. 17460type VirtualMachineRunCommandsDeleteFuture struct { 17461 azure.FutureAPI 17462 // Result returns the result of the asynchronous operation. 17463 // If the operation has not completed it will return an error. 17464 Result func(VirtualMachineRunCommandsClient) (autorest.Response, error) 17465} 17466 17467// UnmarshalJSON is the custom unmarshaller for CreateFuture. 17468func (future *VirtualMachineRunCommandsDeleteFuture) UnmarshalJSON(body []byte) error { 17469 var azFuture azure.Future 17470 if err := json.Unmarshal(body, &azFuture); err != nil { 17471 return err 17472 } 17473 future.FutureAPI = &azFuture 17474 future.Result = future.result 17475 return nil 17476} 17477 17478// result is the default implementation for VirtualMachineRunCommandsDeleteFuture.Result. 17479func (future *VirtualMachineRunCommandsDeleteFuture) result(client VirtualMachineRunCommandsClient) (ar autorest.Response, err error) { 17480 var done bool 17481 done, err = future.DoneWithContext(context.Background(), client) 17482 if err != nil { 17483 err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsDeleteFuture", "Result", future.Response(), "Polling failure") 17484 return 17485 } 17486 if !done { 17487 ar.Response = future.Response() 17488 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineRunCommandsDeleteFuture") 17489 return 17490 } 17491 ar.Response = future.Response() 17492 return 17493} 17494 17495// VirtualMachineRunCommandsListResult the List run command operation response 17496type VirtualMachineRunCommandsListResult struct { 17497 autorest.Response `json:"-"` 17498 // Value - The list of run commands 17499 Value *[]VirtualMachineRunCommand `json:"value,omitempty"` 17500 // NextLink - The uri to fetch the next page of run commands. 17501 NextLink *string `json:"nextLink,omitempty"` 17502} 17503 17504// VirtualMachineRunCommandsListResultIterator provides access to a complete listing of 17505// VirtualMachineRunCommand values. 17506type VirtualMachineRunCommandsListResultIterator struct { 17507 i int 17508 page VirtualMachineRunCommandsListResultPage 17509} 17510 17511// NextWithContext advances to the next value. If there was an error making 17512// the request the iterator does not advance and the error is returned. 17513func (iter *VirtualMachineRunCommandsListResultIterator) NextWithContext(ctx context.Context) (err error) { 17514 if tracing.IsEnabled() { 17515 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsListResultIterator.NextWithContext") 17516 defer func() { 17517 sc := -1 17518 if iter.Response().Response.Response != nil { 17519 sc = iter.Response().Response.Response.StatusCode 17520 } 17521 tracing.EndSpan(ctx, sc, err) 17522 }() 17523 } 17524 iter.i++ 17525 if iter.i < len(iter.page.Values()) { 17526 return nil 17527 } 17528 err = iter.page.NextWithContext(ctx) 17529 if err != nil { 17530 iter.i-- 17531 return err 17532 } 17533 iter.i = 0 17534 return nil 17535} 17536 17537// Next advances to the next value. If there was an error making 17538// the request the iterator does not advance and the error is returned. 17539// Deprecated: Use NextWithContext() instead. 17540func (iter *VirtualMachineRunCommandsListResultIterator) Next() error { 17541 return iter.NextWithContext(context.Background()) 17542} 17543 17544// NotDone returns true if the enumeration should be started or is not yet complete. 17545func (iter VirtualMachineRunCommandsListResultIterator) NotDone() bool { 17546 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 17547} 17548 17549// Response returns the raw server response from the last page request. 17550func (iter VirtualMachineRunCommandsListResultIterator) Response() VirtualMachineRunCommandsListResult { 17551 return iter.page.Response() 17552} 17553 17554// Value returns the current value or a zero-initialized value if the 17555// iterator has advanced beyond the end of the collection. 17556func (iter VirtualMachineRunCommandsListResultIterator) Value() VirtualMachineRunCommand { 17557 if !iter.page.NotDone() { 17558 return VirtualMachineRunCommand{} 17559 } 17560 return iter.page.Values()[iter.i] 17561} 17562 17563// Creates a new instance of the VirtualMachineRunCommandsListResultIterator type. 17564func NewVirtualMachineRunCommandsListResultIterator(page VirtualMachineRunCommandsListResultPage) VirtualMachineRunCommandsListResultIterator { 17565 return VirtualMachineRunCommandsListResultIterator{page: page} 17566} 17567 17568// IsEmpty returns true if the ListResult contains no values. 17569func (vmrclr VirtualMachineRunCommandsListResult) IsEmpty() bool { 17570 return vmrclr.Value == nil || len(*vmrclr.Value) == 0 17571} 17572 17573// hasNextLink returns true if the NextLink is not empty. 17574func (vmrclr VirtualMachineRunCommandsListResult) hasNextLink() bool { 17575 return vmrclr.NextLink != nil && len(*vmrclr.NextLink) != 0 17576} 17577 17578// virtualMachineRunCommandsListResultPreparer prepares a request to retrieve the next set of results. 17579// It returns nil if no more results exist. 17580func (vmrclr VirtualMachineRunCommandsListResult) virtualMachineRunCommandsListResultPreparer(ctx context.Context) (*http.Request, error) { 17581 if !vmrclr.hasNextLink() { 17582 return nil, nil 17583 } 17584 return autorest.Prepare((&http.Request{}).WithContext(ctx), 17585 autorest.AsJSON(), 17586 autorest.AsGet(), 17587 autorest.WithBaseURL(to.String(vmrclr.NextLink))) 17588} 17589 17590// VirtualMachineRunCommandsListResultPage contains a page of VirtualMachineRunCommand values. 17591type VirtualMachineRunCommandsListResultPage struct { 17592 fn func(context.Context, VirtualMachineRunCommandsListResult) (VirtualMachineRunCommandsListResult, error) 17593 vmrclr VirtualMachineRunCommandsListResult 17594} 17595 17596// NextWithContext advances to the next page of values. If there was an error making 17597// the request the page does not advance and the error is returned. 17598func (page *VirtualMachineRunCommandsListResultPage) NextWithContext(ctx context.Context) (err error) { 17599 if tracing.IsEnabled() { 17600 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsListResultPage.NextWithContext") 17601 defer func() { 17602 sc := -1 17603 if page.Response().Response.Response != nil { 17604 sc = page.Response().Response.Response.StatusCode 17605 } 17606 tracing.EndSpan(ctx, sc, err) 17607 }() 17608 } 17609 for { 17610 next, err := page.fn(ctx, page.vmrclr) 17611 if err != nil { 17612 return err 17613 } 17614 page.vmrclr = next 17615 if !next.hasNextLink() || !next.IsEmpty() { 17616 break 17617 } 17618 } 17619 return nil 17620} 17621 17622// Next advances to the next page of values. If there was an error making 17623// the request the page does not advance and the error is returned. 17624// Deprecated: Use NextWithContext() instead. 17625func (page *VirtualMachineRunCommandsListResultPage) Next() error { 17626 return page.NextWithContext(context.Background()) 17627} 17628 17629// NotDone returns true if the page enumeration should be started or is not yet complete. 17630func (page VirtualMachineRunCommandsListResultPage) NotDone() bool { 17631 return !page.vmrclr.IsEmpty() 17632} 17633 17634// Response returns the raw server response from the last page request. 17635func (page VirtualMachineRunCommandsListResultPage) Response() VirtualMachineRunCommandsListResult { 17636 return page.vmrclr 17637} 17638 17639// Values returns the slice of values for the current page or nil if there are no values. 17640func (page VirtualMachineRunCommandsListResultPage) Values() []VirtualMachineRunCommand { 17641 if page.vmrclr.IsEmpty() { 17642 return nil 17643 } 17644 return *page.vmrclr.Value 17645} 17646 17647// Creates a new instance of the VirtualMachineRunCommandsListResultPage type. 17648func NewVirtualMachineRunCommandsListResultPage(cur VirtualMachineRunCommandsListResult, getNextPage func(context.Context, VirtualMachineRunCommandsListResult) (VirtualMachineRunCommandsListResult, error)) VirtualMachineRunCommandsListResultPage { 17649 return VirtualMachineRunCommandsListResultPage{ 17650 fn: getNextPage, 17651 vmrclr: cur, 17652 } 17653} 17654 17655// VirtualMachineRunCommandsUpdateFuture an abstraction for monitoring and retrieving the results of a 17656// long-running operation. 17657type VirtualMachineRunCommandsUpdateFuture struct { 17658 azure.FutureAPI 17659 // Result returns the result of the asynchronous operation. 17660 // If the operation has not completed it will return an error. 17661 Result func(VirtualMachineRunCommandsClient) (VirtualMachineRunCommand, error) 17662} 17663 17664// UnmarshalJSON is the custom unmarshaller for CreateFuture. 17665func (future *VirtualMachineRunCommandsUpdateFuture) UnmarshalJSON(body []byte) error { 17666 var azFuture azure.Future 17667 if err := json.Unmarshal(body, &azFuture); err != nil { 17668 return err 17669 } 17670 future.FutureAPI = &azFuture 17671 future.Result = future.result 17672 return nil 17673} 17674 17675// result is the default implementation for VirtualMachineRunCommandsUpdateFuture.Result. 17676func (future *VirtualMachineRunCommandsUpdateFuture) result(client VirtualMachineRunCommandsClient) (vmrc VirtualMachineRunCommand, err error) { 17677 var done bool 17678 done, err = future.DoneWithContext(context.Background(), client) 17679 if err != nil { 17680 err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsUpdateFuture", "Result", future.Response(), "Polling failure") 17681 return 17682 } 17683 if !done { 17684 vmrc.Response.Response = future.Response() 17685 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineRunCommandsUpdateFuture") 17686 return 17687 } 17688 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 17689 if vmrc.Response.Response, err = future.GetResult(sender); err == nil && vmrc.Response.Response.StatusCode != http.StatusNoContent { 17690 vmrc, err = client.UpdateResponder(vmrc.Response.Response) 17691 if err != nil { 17692 err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsUpdateFuture", "Result", vmrc.Response.Response, "Failure responding to request") 17693 } 17694 } 17695 return 17696} 17697 17698// VirtualMachineRunCommandUpdate describes a Virtual Machine run command. 17699type VirtualMachineRunCommandUpdate struct { 17700 *VirtualMachineRunCommandProperties `json:"properties,omitempty"` 17701 // Tags - Resource tags 17702 Tags map[string]*string `json:"tags"` 17703} 17704 17705// MarshalJSON is the custom marshaler for VirtualMachineRunCommandUpdate. 17706func (vmrcu VirtualMachineRunCommandUpdate) MarshalJSON() ([]byte, error) { 17707 objectMap := make(map[string]interface{}) 17708 if vmrcu.VirtualMachineRunCommandProperties != nil { 17709 objectMap["properties"] = vmrcu.VirtualMachineRunCommandProperties 17710 } 17711 if vmrcu.Tags != nil { 17712 objectMap["tags"] = vmrcu.Tags 17713 } 17714 return json.Marshal(objectMap) 17715} 17716 17717// UnmarshalJSON is the custom unmarshaler for VirtualMachineRunCommandUpdate struct. 17718func (vmrcu *VirtualMachineRunCommandUpdate) UnmarshalJSON(body []byte) error { 17719 var m map[string]*json.RawMessage 17720 err := json.Unmarshal(body, &m) 17721 if err != nil { 17722 return err 17723 } 17724 for k, v := range m { 17725 switch k { 17726 case "properties": 17727 if v != nil { 17728 var virtualMachineRunCommandProperties VirtualMachineRunCommandProperties 17729 err = json.Unmarshal(*v, &virtualMachineRunCommandProperties) 17730 if err != nil { 17731 return err 17732 } 17733 vmrcu.VirtualMachineRunCommandProperties = &virtualMachineRunCommandProperties 17734 } 17735 case "tags": 17736 if v != nil { 17737 var tags map[string]*string 17738 err = json.Unmarshal(*v, &tags) 17739 if err != nil { 17740 return err 17741 } 17742 vmrcu.Tags = tags 17743 } 17744 } 17745 } 17746 17747 return nil 17748} 17749 17750// VirtualMachinesAssessPatchesFuture an abstraction for monitoring and retrieving the results of a 17751// long-running operation. 17752type VirtualMachinesAssessPatchesFuture struct { 17753 azure.FutureAPI 17754 // Result returns the result of the asynchronous operation. 17755 // If the operation has not completed it will return an error. 17756 Result func(VirtualMachinesClient) (VirtualMachineAssessPatchesResult, error) 17757} 17758 17759// UnmarshalJSON is the custom unmarshaller for CreateFuture. 17760func (future *VirtualMachinesAssessPatchesFuture) UnmarshalJSON(body []byte) error { 17761 var azFuture azure.Future 17762 if err := json.Unmarshal(body, &azFuture); err != nil { 17763 return err 17764 } 17765 future.FutureAPI = &azFuture 17766 future.Result = future.result 17767 return nil 17768} 17769 17770// result is the default implementation for VirtualMachinesAssessPatchesFuture.Result. 17771func (future *VirtualMachinesAssessPatchesFuture) result(client VirtualMachinesClient) (vmapr VirtualMachineAssessPatchesResult, err error) { 17772 var done bool 17773 done, err = future.DoneWithContext(context.Background(), client) 17774 if err != nil { 17775 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesAssessPatchesFuture", "Result", future.Response(), "Polling failure") 17776 return 17777 } 17778 if !done { 17779 vmapr.Response.Response = future.Response() 17780 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesAssessPatchesFuture") 17781 return 17782 } 17783 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 17784 if vmapr.Response.Response, err = future.GetResult(sender); err == nil && vmapr.Response.Response.StatusCode != http.StatusNoContent { 17785 vmapr, err = client.AssessPatchesResponder(vmapr.Response.Response) 17786 if err != nil { 17787 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesAssessPatchesFuture", "Result", vmapr.Response.Response, "Failure responding to request") 17788 } 17789 } 17790 return 17791} 17792 17793// VirtualMachineScaleSet describes a Virtual Machine Scale Set. 17794type VirtualMachineScaleSet struct { 17795 autorest.Response `json:"-"` 17796 // Sku - The virtual machine scale set sku. 17797 Sku *Sku `json:"sku,omitempty"` 17798 // 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**. 17799 Plan *Plan `json:"plan,omitempty"` 17800 *VirtualMachineScaleSetProperties `json:"properties,omitempty"` 17801 // Identity - The identity of the virtual machine scale set, if configured. 17802 Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"` 17803 // Zones - The virtual machine scale set zones. NOTE: Availability zones can only be set when you create the scale set 17804 Zones *[]string `json:"zones,omitempty"` 17805 // ExtendedLocation - The extended location of the Virtual Machine Scale Set. 17806 ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` 17807 // ID - READ-ONLY; Resource Id 17808 ID *string `json:"id,omitempty"` 17809 // Name - READ-ONLY; Resource name 17810 Name *string `json:"name,omitempty"` 17811 // Type - READ-ONLY; Resource type 17812 Type *string `json:"type,omitempty"` 17813 // Location - Resource location 17814 Location *string `json:"location,omitempty"` 17815 // Tags - Resource tags 17816 Tags map[string]*string `json:"tags"` 17817} 17818 17819// MarshalJSON is the custom marshaler for VirtualMachineScaleSet. 17820func (vmss VirtualMachineScaleSet) MarshalJSON() ([]byte, error) { 17821 objectMap := make(map[string]interface{}) 17822 if vmss.Sku != nil { 17823 objectMap["sku"] = vmss.Sku 17824 } 17825 if vmss.Plan != nil { 17826 objectMap["plan"] = vmss.Plan 17827 } 17828 if vmss.VirtualMachineScaleSetProperties != nil { 17829 objectMap["properties"] = vmss.VirtualMachineScaleSetProperties 17830 } 17831 if vmss.Identity != nil { 17832 objectMap["identity"] = vmss.Identity 17833 } 17834 if vmss.Zones != nil { 17835 objectMap["zones"] = vmss.Zones 17836 } 17837 if vmss.ExtendedLocation != nil { 17838 objectMap["extendedLocation"] = vmss.ExtendedLocation 17839 } 17840 if vmss.Location != nil { 17841 objectMap["location"] = vmss.Location 17842 } 17843 if vmss.Tags != nil { 17844 objectMap["tags"] = vmss.Tags 17845 } 17846 return json.Marshal(objectMap) 17847} 17848 17849// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSet struct. 17850func (vmss *VirtualMachineScaleSet) UnmarshalJSON(body []byte) error { 17851 var m map[string]*json.RawMessage 17852 err := json.Unmarshal(body, &m) 17853 if err != nil { 17854 return err 17855 } 17856 for k, v := range m { 17857 switch k { 17858 case "sku": 17859 if v != nil { 17860 var sku Sku 17861 err = json.Unmarshal(*v, &sku) 17862 if err != nil { 17863 return err 17864 } 17865 vmss.Sku = &sku 17866 } 17867 case "plan": 17868 if v != nil { 17869 var plan Plan 17870 err = json.Unmarshal(*v, &plan) 17871 if err != nil { 17872 return err 17873 } 17874 vmss.Plan = &plan 17875 } 17876 case "properties": 17877 if v != nil { 17878 var virtualMachineScaleSetProperties VirtualMachineScaleSetProperties 17879 err = json.Unmarshal(*v, &virtualMachineScaleSetProperties) 17880 if err != nil { 17881 return err 17882 } 17883 vmss.VirtualMachineScaleSetProperties = &virtualMachineScaleSetProperties 17884 } 17885 case "identity": 17886 if v != nil { 17887 var identity VirtualMachineScaleSetIdentity 17888 err = json.Unmarshal(*v, &identity) 17889 if err != nil { 17890 return err 17891 } 17892 vmss.Identity = &identity 17893 } 17894 case "zones": 17895 if v != nil { 17896 var zones []string 17897 err = json.Unmarshal(*v, &zones) 17898 if err != nil { 17899 return err 17900 } 17901 vmss.Zones = &zones 17902 } 17903 case "extendedLocation": 17904 if v != nil { 17905 var extendedLocation ExtendedLocation 17906 err = json.Unmarshal(*v, &extendedLocation) 17907 if err != nil { 17908 return err 17909 } 17910 vmss.ExtendedLocation = &extendedLocation 17911 } 17912 case "id": 17913 if v != nil { 17914 var ID string 17915 err = json.Unmarshal(*v, &ID) 17916 if err != nil { 17917 return err 17918 } 17919 vmss.ID = &ID 17920 } 17921 case "name": 17922 if v != nil { 17923 var name string 17924 err = json.Unmarshal(*v, &name) 17925 if err != nil { 17926 return err 17927 } 17928 vmss.Name = &name 17929 } 17930 case "type": 17931 if v != nil { 17932 var typeVar string 17933 err = json.Unmarshal(*v, &typeVar) 17934 if err != nil { 17935 return err 17936 } 17937 vmss.Type = &typeVar 17938 } 17939 case "location": 17940 if v != nil { 17941 var location string 17942 err = json.Unmarshal(*v, &location) 17943 if err != nil { 17944 return err 17945 } 17946 vmss.Location = &location 17947 } 17948 case "tags": 17949 if v != nil { 17950 var tags map[string]*string 17951 err = json.Unmarshal(*v, &tags) 17952 if err != nil { 17953 return err 17954 } 17955 vmss.Tags = tags 17956 } 17957 } 17958 } 17959 17960 return nil 17961} 17962 17963// VirtualMachineScaleSetDataDisk describes a virtual machine scale set data disk. 17964type VirtualMachineScaleSetDataDisk struct { 17965 // Name - The disk name. 17966 Name *string `json:"name,omitempty"` 17967 // 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. 17968 Lun *int32 `json:"lun,omitempty"` 17969 // 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' 17970 Caching CachingTypes `json:"caching,omitempty"` 17971 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 17972 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 17973 // CreateOption - The create option. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' 17974 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 17975 // 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 17976 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 17977 // ManagedDisk - The managed disk parameters. 17978 ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` 17979 // 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. 17980 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 17981 // 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. 17982 DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` 17983} 17984 17985// VirtualMachineScaleSetExtension describes a Virtual Machine Scale Set Extension. 17986type VirtualMachineScaleSetExtension struct { 17987 autorest.Response `json:"-"` 17988 // Name - The name of the extension. 17989 Name *string `json:"name,omitempty"` 17990 // Type - READ-ONLY; Resource type 17991 Type *string `json:"type,omitempty"` 17992 *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"` 17993 // ID - READ-ONLY; Resource Id 17994 ID *string `json:"id,omitempty"` 17995} 17996 17997// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtension. 17998func (vmsse VirtualMachineScaleSetExtension) MarshalJSON() ([]byte, error) { 17999 objectMap := make(map[string]interface{}) 18000 if vmsse.Name != nil { 18001 objectMap["name"] = vmsse.Name 18002 } 18003 if vmsse.VirtualMachineScaleSetExtensionProperties != nil { 18004 objectMap["properties"] = vmsse.VirtualMachineScaleSetExtensionProperties 18005 } 18006 return json.Marshal(objectMap) 18007} 18008 18009// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetExtension struct. 18010func (vmsse *VirtualMachineScaleSetExtension) UnmarshalJSON(body []byte) error { 18011 var m map[string]*json.RawMessage 18012 err := json.Unmarshal(body, &m) 18013 if err != nil { 18014 return err 18015 } 18016 for k, v := range m { 18017 switch k { 18018 case "name": 18019 if v != nil { 18020 var name string 18021 err = json.Unmarshal(*v, &name) 18022 if err != nil { 18023 return err 18024 } 18025 vmsse.Name = &name 18026 } 18027 case "type": 18028 if v != nil { 18029 var typeVar string 18030 err = json.Unmarshal(*v, &typeVar) 18031 if err != nil { 18032 return err 18033 } 18034 vmsse.Type = &typeVar 18035 } 18036 case "properties": 18037 if v != nil { 18038 var virtualMachineScaleSetExtensionProperties VirtualMachineScaleSetExtensionProperties 18039 err = json.Unmarshal(*v, &virtualMachineScaleSetExtensionProperties) 18040 if err != nil { 18041 return err 18042 } 18043 vmsse.VirtualMachineScaleSetExtensionProperties = &virtualMachineScaleSetExtensionProperties 18044 } 18045 case "id": 18046 if v != nil { 18047 var ID string 18048 err = json.Unmarshal(*v, &ID) 18049 if err != nil { 18050 return err 18051 } 18052 vmsse.ID = &ID 18053 } 18054 } 18055 } 18056 18057 return nil 18058} 18059 18060// VirtualMachineScaleSetExtensionListResult the List VM scale set extension operation response. 18061type VirtualMachineScaleSetExtensionListResult struct { 18062 autorest.Response `json:"-"` 18063 // Value - The list of VM scale set extensions. 18064 Value *[]VirtualMachineScaleSetExtension `json:"value,omitempty"` 18065 // 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. 18066 NextLink *string `json:"nextLink,omitempty"` 18067} 18068 18069// VirtualMachineScaleSetExtensionListResultIterator provides access to a complete listing of 18070// VirtualMachineScaleSetExtension values. 18071type VirtualMachineScaleSetExtensionListResultIterator struct { 18072 i int 18073 page VirtualMachineScaleSetExtensionListResultPage 18074} 18075 18076// NextWithContext advances to the next value. If there was an error making 18077// the request the iterator does not advance and the error is returned. 18078func (iter *VirtualMachineScaleSetExtensionListResultIterator) NextWithContext(ctx context.Context) (err error) { 18079 if tracing.IsEnabled() { 18080 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionListResultIterator.NextWithContext") 18081 defer func() { 18082 sc := -1 18083 if iter.Response().Response.Response != nil { 18084 sc = iter.Response().Response.Response.StatusCode 18085 } 18086 tracing.EndSpan(ctx, sc, err) 18087 }() 18088 } 18089 iter.i++ 18090 if iter.i < len(iter.page.Values()) { 18091 return nil 18092 } 18093 err = iter.page.NextWithContext(ctx) 18094 if err != nil { 18095 iter.i-- 18096 return err 18097 } 18098 iter.i = 0 18099 return nil 18100} 18101 18102// Next advances to the next value. If there was an error making 18103// the request the iterator does not advance and the error is returned. 18104// Deprecated: Use NextWithContext() instead. 18105func (iter *VirtualMachineScaleSetExtensionListResultIterator) Next() error { 18106 return iter.NextWithContext(context.Background()) 18107} 18108 18109// NotDone returns true if the enumeration should be started or is not yet complete. 18110func (iter VirtualMachineScaleSetExtensionListResultIterator) NotDone() bool { 18111 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 18112} 18113 18114// Response returns the raw server response from the last page request. 18115func (iter VirtualMachineScaleSetExtensionListResultIterator) Response() VirtualMachineScaleSetExtensionListResult { 18116 return iter.page.Response() 18117} 18118 18119// Value returns the current value or a zero-initialized value if the 18120// iterator has advanced beyond the end of the collection. 18121func (iter VirtualMachineScaleSetExtensionListResultIterator) Value() VirtualMachineScaleSetExtension { 18122 if !iter.page.NotDone() { 18123 return VirtualMachineScaleSetExtension{} 18124 } 18125 return iter.page.Values()[iter.i] 18126} 18127 18128// Creates a new instance of the VirtualMachineScaleSetExtensionListResultIterator type. 18129func NewVirtualMachineScaleSetExtensionListResultIterator(page VirtualMachineScaleSetExtensionListResultPage) VirtualMachineScaleSetExtensionListResultIterator { 18130 return VirtualMachineScaleSetExtensionListResultIterator{page: page} 18131} 18132 18133// IsEmpty returns true if the ListResult contains no values. 18134func (vmsselr VirtualMachineScaleSetExtensionListResult) IsEmpty() bool { 18135 return vmsselr.Value == nil || len(*vmsselr.Value) == 0 18136} 18137 18138// hasNextLink returns true if the NextLink is not empty. 18139func (vmsselr VirtualMachineScaleSetExtensionListResult) hasNextLink() bool { 18140 return vmsselr.NextLink != nil && len(*vmsselr.NextLink) != 0 18141} 18142 18143// virtualMachineScaleSetExtensionListResultPreparer prepares a request to retrieve the next set of results. 18144// It returns nil if no more results exist. 18145func (vmsselr VirtualMachineScaleSetExtensionListResult) virtualMachineScaleSetExtensionListResultPreparer(ctx context.Context) (*http.Request, error) { 18146 if !vmsselr.hasNextLink() { 18147 return nil, nil 18148 } 18149 return autorest.Prepare((&http.Request{}).WithContext(ctx), 18150 autorest.AsJSON(), 18151 autorest.AsGet(), 18152 autorest.WithBaseURL(to.String(vmsselr.NextLink))) 18153} 18154 18155// VirtualMachineScaleSetExtensionListResultPage contains a page of VirtualMachineScaleSetExtension values. 18156type VirtualMachineScaleSetExtensionListResultPage struct { 18157 fn func(context.Context, VirtualMachineScaleSetExtensionListResult) (VirtualMachineScaleSetExtensionListResult, error) 18158 vmsselr VirtualMachineScaleSetExtensionListResult 18159} 18160 18161// NextWithContext advances to the next page of values. If there was an error making 18162// the request the page does not advance and the error is returned. 18163func (page *VirtualMachineScaleSetExtensionListResultPage) NextWithContext(ctx context.Context) (err error) { 18164 if tracing.IsEnabled() { 18165 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionListResultPage.NextWithContext") 18166 defer func() { 18167 sc := -1 18168 if page.Response().Response.Response != nil { 18169 sc = page.Response().Response.Response.StatusCode 18170 } 18171 tracing.EndSpan(ctx, sc, err) 18172 }() 18173 } 18174 for { 18175 next, err := page.fn(ctx, page.vmsselr) 18176 if err != nil { 18177 return err 18178 } 18179 page.vmsselr = next 18180 if !next.hasNextLink() || !next.IsEmpty() { 18181 break 18182 } 18183 } 18184 return nil 18185} 18186 18187// Next advances to the next page of values. If there was an error making 18188// the request the page does not advance and the error is returned. 18189// Deprecated: Use NextWithContext() instead. 18190func (page *VirtualMachineScaleSetExtensionListResultPage) Next() error { 18191 return page.NextWithContext(context.Background()) 18192} 18193 18194// NotDone returns true if the page enumeration should be started or is not yet complete. 18195func (page VirtualMachineScaleSetExtensionListResultPage) NotDone() bool { 18196 return !page.vmsselr.IsEmpty() 18197} 18198 18199// Response returns the raw server response from the last page request. 18200func (page VirtualMachineScaleSetExtensionListResultPage) Response() VirtualMachineScaleSetExtensionListResult { 18201 return page.vmsselr 18202} 18203 18204// Values returns the slice of values for the current page or nil if there are no values. 18205func (page VirtualMachineScaleSetExtensionListResultPage) Values() []VirtualMachineScaleSetExtension { 18206 if page.vmsselr.IsEmpty() { 18207 return nil 18208 } 18209 return *page.vmsselr.Value 18210} 18211 18212// Creates a new instance of the VirtualMachineScaleSetExtensionListResultPage type. 18213func NewVirtualMachineScaleSetExtensionListResultPage(cur VirtualMachineScaleSetExtensionListResult, getNextPage func(context.Context, VirtualMachineScaleSetExtensionListResult) (VirtualMachineScaleSetExtensionListResult, error)) VirtualMachineScaleSetExtensionListResultPage { 18214 return VirtualMachineScaleSetExtensionListResultPage{ 18215 fn: getNextPage, 18216 vmsselr: cur, 18217 } 18218} 18219 18220// VirtualMachineScaleSetExtensionProfile describes a virtual machine scale set extension profile. 18221type VirtualMachineScaleSetExtensionProfile struct { 18222 // Extensions - The virtual machine scale set child extension resources. 18223 Extensions *[]VirtualMachineScaleSetExtension `json:"extensions,omitempty"` 18224 // 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 18225 ExtensionsTimeBudget *string `json:"extensionsTimeBudget,omitempty"` 18226} 18227 18228// VirtualMachineScaleSetExtensionProperties describes the properties of a Virtual Machine Scale Set 18229// Extension. 18230type VirtualMachineScaleSetExtensionProperties struct { 18231 // 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. 18232 ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` 18233 // Publisher - The name of the extension handler publisher. 18234 Publisher *string `json:"publisher,omitempty"` 18235 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 18236 Type *string `json:"type,omitempty"` 18237 // TypeHandlerVersion - Specifies the version of the script handler. 18238 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 18239 // 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. 18240 AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` 18241 // EnableAutomaticUpgrade - Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. 18242 EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` 18243 // Settings - Json formatted public settings for the extension. 18244 Settings interface{} `json:"settings,omitempty"` 18245 // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. 18246 ProtectedSettings interface{} `json:"protectedSettings,omitempty"` 18247 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 18248 ProvisioningState *string `json:"provisioningState,omitempty"` 18249 // ProvisionAfterExtensions - Collection of extension names after which this extension needs to be provisioned. 18250 ProvisionAfterExtensions *[]string `json:"provisionAfterExtensions,omitempty"` 18251} 18252 18253// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtensionProperties. 18254func (vmssep VirtualMachineScaleSetExtensionProperties) MarshalJSON() ([]byte, error) { 18255 objectMap := make(map[string]interface{}) 18256 if vmssep.ForceUpdateTag != nil { 18257 objectMap["forceUpdateTag"] = vmssep.ForceUpdateTag 18258 } 18259 if vmssep.Publisher != nil { 18260 objectMap["publisher"] = vmssep.Publisher 18261 } 18262 if vmssep.Type != nil { 18263 objectMap["type"] = vmssep.Type 18264 } 18265 if vmssep.TypeHandlerVersion != nil { 18266 objectMap["typeHandlerVersion"] = vmssep.TypeHandlerVersion 18267 } 18268 if vmssep.AutoUpgradeMinorVersion != nil { 18269 objectMap["autoUpgradeMinorVersion"] = vmssep.AutoUpgradeMinorVersion 18270 } 18271 if vmssep.EnableAutomaticUpgrade != nil { 18272 objectMap["enableAutomaticUpgrade"] = vmssep.EnableAutomaticUpgrade 18273 } 18274 if vmssep.Settings != nil { 18275 objectMap["settings"] = vmssep.Settings 18276 } 18277 if vmssep.ProtectedSettings != nil { 18278 objectMap["protectedSettings"] = vmssep.ProtectedSettings 18279 } 18280 if vmssep.ProvisionAfterExtensions != nil { 18281 objectMap["provisionAfterExtensions"] = vmssep.ProvisionAfterExtensions 18282 } 18283 return json.Marshal(objectMap) 18284} 18285 18286// VirtualMachineScaleSetExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the 18287// results of a long-running operation. 18288type VirtualMachineScaleSetExtensionsCreateOrUpdateFuture struct { 18289 azure.FutureAPI 18290 // Result returns the result of the asynchronous operation. 18291 // If the operation has not completed it will return an error. 18292 Result func(VirtualMachineScaleSetExtensionsClient) (VirtualMachineScaleSetExtension, error) 18293} 18294 18295// UnmarshalJSON is the custom unmarshaller for CreateFuture. 18296func (future *VirtualMachineScaleSetExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 18297 var azFuture azure.Future 18298 if err := json.Unmarshal(body, &azFuture); err != nil { 18299 return err 18300 } 18301 future.FutureAPI = &azFuture 18302 future.Result = future.result 18303 return nil 18304} 18305 18306// result is the default implementation for VirtualMachineScaleSetExtensionsCreateOrUpdateFuture.Result. 18307func (future *VirtualMachineScaleSetExtensionsCreateOrUpdateFuture) result(client VirtualMachineScaleSetExtensionsClient) (vmsse VirtualMachineScaleSetExtension, err error) { 18308 var done bool 18309 done, err = future.DoneWithContext(context.Background(), client) 18310 if err != nil { 18311 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 18312 return 18313 } 18314 if !done { 18315 vmsse.Response.Response = future.Response() 18316 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture") 18317 return 18318 } 18319 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 18320 if vmsse.Response.Response, err = future.GetResult(sender); err == nil && vmsse.Response.Response.StatusCode != http.StatusNoContent { 18321 vmsse, err = client.CreateOrUpdateResponder(vmsse.Response.Response) 18322 if err != nil { 18323 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture", "Result", vmsse.Response.Response, "Failure responding to request") 18324 } 18325 } 18326 return 18327} 18328 18329// VirtualMachineScaleSetExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of 18330// a long-running operation. 18331type VirtualMachineScaleSetExtensionsDeleteFuture struct { 18332 azure.FutureAPI 18333 // Result returns the result of the asynchronous operation. 18334 // If the operation has not completed it will return an error. 18335 Result func(VirtualMachineScaleSetExtensionsClient) (autorest.Response, error) 18336} 18337 18338// UnmarshalJSON is the custom unmarshaller for CreateFuture. 18339func (future *VirtualMachineScaleSetExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { 18340 var azFuture azure.Future 18341 if err := json.Unmarshal(body, &azFuture); err != nil { 18342 return err 18343 } 18344 future.FutureAPI = &azFuture 18345 future.Result = future.result 18346 return nil 18347} 18348 18349// result is the default implementation for VirtualMachineScaleSetExtensionsDeleteFuture.Result. 18350func (future *VirtualMachineScaleSetExtensionsDeleteFuture) result(client VirtualMachineScaleSetExtensionsClient) (ar autorest.Response, err error) { 18351 var done bool 18352 done, err = future.DoneWithContext(context.Background(), client) 18353 if err != nil { 18354 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") 18355 return 18356 } 18357 if !done { 18358 ar.Response = future.Response() 18359 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsDeleteFuture") 18360 return 18361 } 18362 ar.Response = future.Response() 18363 return 18364} 18365 18366// VirtualMachineScaleSetExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of 18367// a long-running operation. 18368type VirtualMachineScaleSetExtensionsUpdateFuture struct { 18369 azure.FutureAPI 18370 // Result returns the result of the asynchronous operation. 18371 // If the operation has not completed it will return an error. 18372 Result func(VirtualMachineScaleSetExtensionsClient) (VirtualMachineScaleSetExtension, error) 18373} 18374 18375// UnmarshalJSON is the custom unmarshaller for CreateFuture. 18376func (future *VirtualMachineScaleSetExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { 18377 var azFuture azure.Future 18378 if err := json.Unmarshal(body, &azFuture); err != nil { 18379 return err 18380 } 18381 future.FutureAPI = &azFuture 18382 future.Result = future.result 18383 return nil 18384} 18385 18386// result is the default implementation for VirtualMachineScaleSetExtensionsUpdateFuture.Result. 18387func (future *VirtualMachineScaleSetExtensionsUpdateFuture) result(client VirtualMachineScaleSetExtensionsClient) (vmsse VirtualMachineScaleSetExtension, err error) { 18388 var done bool 18389 done, err = future.DoneWithContext(context.Background(), client) 18390 if err != nil { 18391 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsUpdateFuture", "Result", future.Response(), "Polling failure") 18392 return 18393 } 18394 if !done { 18395 vmsse.Response.Response = future.Response() 18396 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsUpdateFuture") 18397 return 18398 } 18399 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 18400 if vmsse.Response.Response, err = future.GetResult(sender); err == nil && vmsse.Response.Response.StatusCode != http.StatusNoContent { 18401 vmsse, err = client.UpdateResponder(vmsse.Response.Response) 18402 if err != nil { 18403 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsUpdateFuture", "Result", vmsse.Response.Response, "Failure responding to request") 18404 } 18405 } 18406 return 18407} 18408 18409// VirtualMachineScaleSetExtensionUpdate describes a Virtual Machine Scale Set Extension. 18410type VirtualMachineScaleSetExtensionUpdate struct { 18411 // Name - READ-ONLY; The name of the extension. 18412 Name *string `json:"name,omitempty"` 18413 // Type - READ-ONLY; Resource type 18414 Type *string `json:"type,omitempty"` 18415 *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"` 18416 // ID - READ-ONLY; Resource Id 18417 ID *string `json:"id,omitempty"` 18418} 18419 18420// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtensionUpdate. 18421func (vmsseu VirtualMachineScaleSetExtensionUpdate) MarshalJSON() ([]byte, error) { 18422 objectMap := make(map[string]interface{}) 18423 if vmsseu.VirtualMachineScaleSetExtensionProperties != nil { 18424 objectMap["properties"] = vmsseu.VirtualMachineScaleSetExtensionProperties 18425 } 18426 return json.Marshal(objectMap) 18427} 18428 18429// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetExtensionUpdate struct. 18430func (vmsseu *VirtualMachineScaleSetExtensionUpdate) UnmarshalJSON(body []byte) error { 18431 var m map[string]*json.RawMessage 18432 err := json.Unmarshal(body, &m) 18433 if err != nil { 18434 return err 18435 } 18436 for k, v := range m { 18437 switch k { 18438 case "name": 18439 if v != nil { 18440 var name string 18441 err = json.Unmarshal(*v, &name) 18442 if err != nil { 18443 return err 18444 } 18445 vmsseu.Name = &name 18446 } 18447 case "type": 18448 if v != nil { 18449 var typeVar string 18450 err = json.Unmarshal(*v, &typeVar) 18451 if err != nil { 18452 return err 18453 } 18454 vmsseu.Type = &typeVar 18455 } 18456 case "properties": 18457 if v != nil { 18458 var virtualMachineScaleSetExtensionProperties VirtualMachineScaleSetExtensionProperties 18459 err = json.Unmarshal(*v, &virtualMachineScaleSetExtensionProperties) 18460 if err != nil { 18461 return err 18462 } 18463 vmsseu.VirtualMachineScaleSetExtensionProperties = &virtualMachineScaleSetExtensionProperties 18464 } 18465 case "id": 18466 if v != nil { 18467 var ID string 18468 err = json.Unmarshal(*v, &ID) 18469 if err != nil { 18470 return err 18471 } 18472 vmsseu.ID = &ID 18473 } 18474 } 18475 } 18476 18477 return nil 18478} 18479 18480// VirtualMachineScaleSetIdentity identity for the virtual machine scale set. 18481type VirtualMachineScaleSetIdentity struct { 18482 // PrincipalID - READ-ONLY; The principal id of virtual machine scale set identity. This property will only be provided for a system assigned identity. 18483 PrincipalID *string `json:"principalId,omitempty"` 18484 // TenantID - READ-ONLY; The tenant id associated with the virtual machine scale set. This property will only be provided for a system assigned identity. 18485 TenantID *string `json:"tenantId,omitempty"` 18486 // 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' 18487 Type ResourceIdentityType `json:"type,omitempty"` 18488 // 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}'. 18489 UserAssignedIdentities map[string]*VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` 18490} 18491 18492// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIdentity. 18493func (vmssi VirtualMachineScaleSetIdentity) MarshalJSON() ([]byte, error) { 18494 objectMap := make(map[string]interface{}) 18495 if vmssi.Type != "" { 18496 objectMap["type"] = vmssi.Type 18497 } 18498 if vmssi.UserAssignedIdentities != nil { 18499 objectMap["userAssignedIdentities"] = vmssi.UserAssignedIdentities 18500 } 18501 return json.Marshal(objectMap) 18502} 18503 18504// VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue ... 18505type VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue struct { 18506 // PrincipalID - READ-ONLY; The principal id of user assigned identity. 18507 PrincipalID *string `json:"principalId,omitempty"` 18508 // ClientID - READ-ONLY; The client id of user assigned identity. 18509 ClientID *string `json:"clientId,omitempty"` 18510} 18511 18512// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue. 18513func (vmssiAiv VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) { 18514 objectMap := make(map[string]interface{}) 18515 return json.Marshal(objectMap) 18516} 18517 18518// VirtualMachineScaleSetInstanceView the instance view of a virtual machine scale set. 18519type VirtualMachineScaleSetInstanceView struct { 18520 autorest.Response `json:"-"` 18521 // VirtualMachine - READ-ONLY; The instance view status summary for the virtual machine scale set. 18522 VirtualMachine *VirtualMachineScaleSetInstanceViewStatusesSummary `json:"virtualMachine,omitempty"` 18523 // Extensions - READ-ONLY; The extensions information. 18524 Extensions *[]VirtualMachineScaleSetVMExtensionsSummary `json:"extensions,omitempty"` 18525 // Statuses - The resource status information. 18526 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 18527 // OrchestrationServices - READ-ONLY; The orchestration services information. 18528 OrchestrationServices *[]OrchestrationServiceSummary `json:"orchestrationServices,omitempty"` 18529} 18530 18531// MarshalJSON is the custom marshaler for VirtualMachineScaleSetInstanceView. 18532func (vmssiv VirtualMachineScaleSetInstanceView) MarshalJSON() ([]byte, error) { 18533 objectMap := make(map[string]interface{}) 18534 if vmssiv.Statuses != nil { 18535 objectMap["statuses"] = vmssiv.Statuses 18536 } 18537 return json.Marshal(objectMap) 18538} 18539 18540// VirtualMachineScaleSetInstanceViewStatusesSummary instance view statuses summary for virtual machines of 18541// a virtual machine scale set. 18542type VirtualMachineScaleSetInstanceViewStatusesSummary struct { 18543 // StatusesSummary - READ-ONLY; The extensions information. 18544 StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` 18545} 18546 18547// MarshalJSON is the custom marshaler for VirtualMachineScaleSetInstanceViewStatusesSummary. 18548func (vmssivss VirtualMachineScaleSetInstanceViewStatusesSummary) MarshalJSON() ([]byte, error) { 18549 objectMap := make(map[string]interface{}) 18550 return json.Marshal(objectMap) 18551} 18552 18553// VirtualMachineScaleSetIPConfiguration describes a virtual machine scale set network profile's IP 18554// configuration. 18555type VirtualMachineScaleSetIPConfiguration struct { 18556 // Name - The IP configuration name. 18557 Name *string `json:"name,omitempty"` 18558 *VirtualMachineScaleSetIPConfigurationProperties `json:"properties,omitempty"` 18559 // ID - Resource Id 18560 ID *string `json:"id,omitempty"` 18561} 18562 18563// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIPConfiguration. 18564func (vmssic VirtualMachineScaleSetIPConfiguration) MarshalJSON() ([]byte, error) { 18565 objectMap := make(map[string]interface{}) 18566 if vmssic.Name != nil { 18567 objectMap["name"] = vmssic.Name 18568 } 18569 if vmssic.VirtualMachineScaleSetIPConfigurationProperties != nil { 18570 objectMap["properties"] = vmssic.VirtualMachineScaleSetIPConfigurationProperties 18571 } 18572 if vmssic.ID != nil { 18573 objectMap["id"] = vmssic.ID 18574 } 18575 return json.Marshal(objectMap) 18576} 18577 18578// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetIPConfiguration struct. 18579func (vmssic *VirtualMachineScaleSetIPConfiguration) UnmarshalJSON(body []byte) error { 18580 var m map[string]*json.RawMessage 18581 err := json.Unmarshal(body, &m) 18582 if err != nil { 18583 return err 18584 } 18585 for k, v := range m { 18586 switch k { 18587 case "name": 18588 if v != nil { 18589 var name string 18590 err = json.Unmarshal(*v, &name) 18591 if err != nil { 18592 return err 18593 } 18594 vmssic.Name = &name 18595 } 18596 case "properties": 18597 if v != nil { 18598 var virtualMachineScaleSetIPConfigurationProperties VirtualMachineScaleSetIPConfigurationProperties 18599 err = json.Unmarshal(*v, &virtualMachineScaleSetIPConfigurationProperties) 18600 if err != nil { 18601 return err 18602 } 18603 vmssic.VirtualMachineScaleSetIPConfigurationProperties = &virtualMachineScaleSetIPConfigurationProperties 18604 } 18605 case "id": 18606 if v != nil { 18607 var ID string 18608 err = json.Unmarshal(*v, &ID) 18609 if err != nil { 18610 return err 18611 } 18612 vmssic.ID = &ID 18613 } 18614 } 18615 } 18616 18617 return nil 18618} 18619 18620// VirtualMachineScaleSetIPConfigurationProperties describes a virtual machine scale set network profile's 18621// IP configuration properties. 18622type VirtualMachineScaleSetIPConfigurationProperties struct { 18623 // Subnet - Specifies the identifier of the subnet. 18624 Subnet *APIEntityReference `json:"subnet,omitempty"` 18625 // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. 18626 Primary *bool `json:"primary,omitempty"` 18627 // PublicIPAddressConfiguration - The publicIPAddressConfiguration. 18628 PublicIPAddressConfiguration *VirtualMachineScaleSetPublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` 18629 // 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' 18630 PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` 18631 // 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. 18632 ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` 18633 // ApplicationSecurityGroups - Specifies an array of references to application security group. 18634 ApplicationSecurityGroups *[]SubResource `json:"applicationSecurityGroups,omitempty"` 18635 // 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. 18636 LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` 18637 // 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. 18638 LoadBalancerInboundNatPools *[]SubResource `json:"loadBalancerInboundNatPools,omitempty"` 18639} 18640 18641// VirtualMachineScaleSetIPTag contains the IP tag associated with the public IP address. 18642type VirtualMachineScaleSetIPTag struct { 18643 // IPTagType - IP tag type. Example: FirstPartyUsage. 18644 IPTagType *string `json:"ipTagType,omitempty"` 18645 // Tag - IP tag associated with the public IP. Example: SQL, Storage etc. 18646 Tag *string `json:"tag,omitempty"` 18647} 18648 18649// VirtualMachineScaleSetListOSUpgradeHistory list of Virtual Machine Scale Set OS Upgrade History 18650// operation response. 18651type VirtualMachineScaleSetListOSUpgradeHistory struct { 18652 autorest.Response `json:"-"` 18653 // Value - The list of OS upgrades performed on the virtual machine scale set. 18654 Value *[]UpgradeOperationHistoricalStatusInfo `json:"value,omitempty"` 18655 // 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. 18656 NextLink *string `json:"nextLink,omitempty"` 18657} 18658 18659// VirtualMachineScaleSetListOSUpgradeHistoryIterator provides access to a complete listing of 18660// UpgradeOperationHistoricalStatusInfo values. 18661type VirtualMachineScaleSetListOSUpgradeHistoryIterator struct { 18662 i int 18663 page VirtualMachineScaleSetListOSUpgradeHistoryPage 18664} 18665 18666// NextWithContext advances to the next value. If there was an error making 18667// the request the iterator does not advance and the error is returned. 18668func (iter *VirtualMachineScaleSetListOSUpgradeHistoryIterator) NextWithContext(ctx context.Context) (err error) { 18669 if tracing.IsEnabled() { 18670 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListOSUpgradeHistoryIterator.NextWithContext") 18671 defer func() { 18672 sc := -1 18673 if iter.Response().Response.Response != nil { 18674 sc = iter.Response().Response.Response.StatusCode 18675 } 18676 tracing.EndSpan(ctx, sc, err) 18677 }() 18678 } 18679 iter.i++ 18680 if iter.i < len(iter.page.Values()) { 18681 return nil 18682 } 18683 err = iter.page.NextWithContext(ctx) 18684 if err != nil { 18685 iter.i-- 18686 return err 18687 } 18688 iter.i = 0 18689 return nil 18690} 18691 18692// Next advances to the next value. If there was an error making 18693// the request the iterator does not advance and the error is returned. 18694// Deprecated: Use NextWithContext() instead. 18695func (iter *VirtualMachineScaleSetListOSUpgradeHistoryIterator) Next() error { 18696 return iter.NextWithContext(context.Background()) 18697} 18698 18699// NotDone returns true if the enumeration should be started or is not yet complete. 18700func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) NotDone() bool { 18701 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 18702} 18703 18704// Response returns the raw server response from the last page request. 18705func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) Response() VirtualMachineScaleSetListOSUpgradeHistory { 18706 return iter.page.Response() 18707} 18708 18709// Value returns the current value or a zero-initialized value if the 18710// iterator has advanced beyond the end of the collection. 18711func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) Value() UpgradeOperationHistoricalStatusInfo { 18712 if !iter.page.NotDone() { 18713 return UpgradeOperationHistoricalStatusInfo{} 18714 } 18715 return iter.page.Values()[iter.i] 18716} 18717 18718// Creates a new instance of the VirtualMachineScaleSetListOSUpgradeHistoryIterator type. 18719func NewVirtualMachineScaleSetListOSUpgradeHistoryIterator(page VirtualMachineScaleSetListOSUpgradeHistoryPage) VirtualMachineScaleSetListOSUpgradeHistoryIterator { 18720 return VirtualMachineScaleSetListOSUpgradeHistoryIterator{page: page} 18721} 18722 18723// IsEmpty returns true if the ListResult contains no values. 18724func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) IsEmpty() bool { 18725 return vmsslouh.Value == nil || len(*vmsslouh.Value) == 0 18726} 18727 18728// hasNextLink returns true if the NextLink is not empty. 18729func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) hasNextLink() bool { 18730 return vmsslouh.NextLink != nil && len(*vmsslouh.NextLink) != 0 18731} 18732 18733// virtualMachineScaleSetListOSUpgradeHistoryPreparer prepares a request to retrieve the next set of results. 18734// It returns nil if no more results exist. 18735func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) virtualMachineScaleSetListOSUpgradeHistoryPreparer(ctx context.Context) (*http.Request, error) { 18736 if !vmsslouh.hasNextLink() { 18737 return nil, nil 18738 } 18739 return autorest.Prepare((&http.Request{}).WithContext(ctx), 18740 autorest.AsJSON(), 18741 autorest.AsGet(), 18742 autorest.WithBaseURL(to.String(vmsslouh.NextLink))) 18743} 18744 18745// VirtualMachineScaleSetListOSUpgradeHistoryPage contains a page of UpgradeOperationHistoricalStatusInfo 18746// values. 18747type VirtualMachineScaleSetListOSUpgradeHistoryPage struct { 18748 fn func(context.Context, VirtualMachineScaleSetListOSUpgradeHistory) (VirtualMachineScaleSetListOSUpgradeHistory, error) 18749 vmsslouh VirtualMachineScaleSetListOSUpgradeHistory 18750} 18751 18752// NextWithContext advances to the next page of values. If there was an error making 18753// the request the page does not advance and the error is returned. 18754func (page *VirtualMachineScaleSetListOSUpgradeHistoryPage) NextWithContext(ctx context.Context) (err error) { 18755 if tracing.IsEnabled() { 18756 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListOSUpgradeHistoryPage.NextWithContext") 18757 defer func() { 18758 sc := -1 18759 if page.Response().Response.Response != nil { 18760 sc = page.Response().Response.Response.StatusCode 18761 } 18762 tracing.EndSpan(ctx, sc, err) 18763 }() 18764 } 18765 for { 18766 next, err := page.fn(ctx, page.vmsslouh) 18767 if err != nil { 18768 return err 18769 } 18770 page.vmsslouh = next 18771 if !next.hasNextLink() || !next.IsEmpty() { 18772 break 18773 } 18774 } 18775 return nil 18776} 18777 18778// Next advances to the next page of values. If there was an error making 18779// the request the page does not advance and the error is returned. 18780// Deprecated: Use NextWithContext() instead. 18781func (page *VirtualMachineScaleSetListOSUpgradeHistoryPage) Next() error { 18782 return page.NextWithContext(context.Background()) 18783} 18784 18785// NotDone returns true if the page enumeration should be started or is not yet complete. 18786func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) NotDone() bool { 18787 return !page.vmsslouh.IsEmpty() 18788} 18789 18790// Response returns the raw server response from the last page request. 18791func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) Response() VirtualMachineScaleSetListOSUpgradeHistory { 18792 return page.vmsslouh 18793} 18794 18795// Values returns the slice of values for the current page or nil if there are no values. 18796func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) Values() []UpgradeOperationHistoricalStatusInfo { 18797 if page.vmsslouh.IsEmpty() { 18798 return nil 18799 } 18800 return *page.vmsslouh.Value 18801} 18802 18803// Creates a new instance of the VirtualMachineScaleSetListOSUpgradeHistoryPage type. 18804func NewVirtualMachineScaleSetListOSUpgradeHistoryPage(cur VirtualMachineScaleSetListOSUpgradeHistory, getNextPage func(context.Context, VirtualMachineScaleSetListOSUpgradeHistory) (VirtualMachineScaleSetListOSUpgradeHistory, error)) VirtualMachineScaleSetListOSUpgradeHistoryPage { 18805 return VirtualMachineScaleSetListOSUpgradeHistoryPage{ 18806 fn: getNextPage, 18807 vmsslouh: cur, 18808 } 18809} 18810 18811// VirtualMachineScaleSetListResult the List Virtual Machine operation response. 18812type VirtualMachineScaleSetListResult struct { 18813 autorest.Response `json:"-"` 18814 // Value - The list of virtual machine scale sets. 18815 Value *[]VirtualMachineScaleSet `json:"value,omitempty"` 18816 // NextLink - The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with this to fetch the next page of VMSS. 18817 NextLink *string `json:"nextLink,omitempty"` 18818} 18819 18820// VirtualMachineScaleSetListResultIterator provides access to a complete listing of VirtualMachineScaleSet 18821// values. 18822type VirtualMachineScaleSetListResultIterator struct { 18823 i int 18824 page VirtualMachineScaleSetListResultPage 18825} 18826 18827// NextWithContext advances to the next value. If there was an error making 18828// the request the iterator does not advance and the error is returned. 18829func (iter *VirtualMachineScaleSetListResultIterator) NextWithContext(ctx context.Context) (err error) { 18830 if tracing.IsEnabled() { 18831 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListResultIterator.NextWithContext") 18832 defer func() { 18833 sc := -1 18834 if iter.Response().Response.Response != nil { 18835 sc = iter.Response().Response.Response.StatusCode 18836 } 18837 tracing.EndSpan(ctx, sc, err) 18838 }() 18839 } 18840 iter.i++ 18841 if iter.i < len(iter.page.Values()) { 18842 return nil 18843 } 18844 err = iter.page.NextWithContext(ctx) 18845 if err != nil { 18846 iter.i-- 18847 return err 18848 } 18849 iter.i = 0 18850 return nil 18851} 18852 18853// Next advances to the next value. If there was an error making 18854// the request the iterator does not advance and the error is returned. 18855// Deprecated: Use NextWithContext() instead. 18856func (iter *VirtualMachineScaleSetListResultIterator) Next() error { 18857 return iter.NextWithContext(context.Background()) 18858} 18859 18860// NotDone returns true if the enumeration should be started or is not yet complete. 18861func (iter VirtualMachineScaleSetListResultIterator) NotDone() bool { 18862 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 18863} 18864 18865// Response returns the raw server response from the last page request. 18866func (iter VirtualMachineScaleSetListResultIterator) Response() VirtualMachineScaleSetListResult { 18867 return iter.page.Response() 18868} 18869 18870// Value returns the current value or a zero-initialized value if the 18871// iterator has advanced beyond the end of the collection. 18872func (iter VirtualMachineScaleSetListResultIterator) Value() VirtualMachineScaleSet { 18873 if !iter.page.NotDone() { 18874 return VirtualMachineScaleSet{} 18875 } 18876 return iter.page.Values()[iter.i] 18877} 18878 18879// Creates a new instance of the VirtualMachineScaleSetListResultIterator type. 18880func NewVirtualMachineScaleSetListResultIterator(page VirtualMachineScaleSetListResultPage) VirtualMachineScaleSetListResultIterator { 18881 return VirtualMachineScaleSetListResultIterator{page: page} 18882} 18883 18884// IsEmpty returns true if the ListResult contains no values. 18885func (vmsslr VirtualMachineScaleSetListResult) IsEmpty() bool { 18886 return vmsslr.Value == nil || len(*vmsslr.Value) == 0 18887} 18888 18889// hasNextLink returns true if the NextLink is not empty. 18890func (vmsslr VirtualMachineScaleSetListResult) hasNextLink() bool { 18891 return vmsslr.NextLink != nil && len(*vmsslr.NextLink) != 0 18892} 18893 18894// virtualMachineScaleSetListResultPreparer prepares a request to retrieve the next set of results. 18895// It returns nil if no more results exist. 18896func (vmsslr VirtualMachineScaleSetListResult) virtualMachineScaleSetListResultPreparer(ctx context.Context) (*http.Request, error) { 18897 if !vmsslr.hasNextLink() { 18898 return nil, nil 18899 } 18900 return autorest.Prepare((&http.Request{}).WithContext(ctx), 18901 autorest.AsJSON(), 18902 autorest.AsGet(), 18903 autorest.WithBaseURL(to.String(vmsslr.NextLink))) 18904} 18905 18906// VirtualMachineScaleSetListResultPage contains a page of VirtualMachineScaleSet values. 18907type VirtualMachineScaleSetListResultPage struct { 18908 fn func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error) 18909 vmsslr VirtualMachineScaleSetListResult 18910} 18911 18912// NextWithContext advances to the next page of values. If there was an error making 18913// the request the page does not advance and the error is returned. 18914func (page *VirtualMachineScaleSetListResultPage) NextWithContext(ctx context.Context) (err error) { 18915 if tracing.IsEnabled() { 18916 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListResultPage.NextWithContext") 18917 defer func() { 18918 sc := -1 18919 if page.Response().Response.Response != nil { 18920 sc = page.Response().Response.Response.StatusCode 18921 } 18922 tracing.EndSpan(ctx, sc, err) 18923 }() 18924 } 18925 for { 18926 next, err := page.fn(ctx, page.vmsslr) 18927 if err != nil { 18928 return err 18929 } 18930 page.vmsslr = next 18931 if !next.hasNextLink() || !next.IsEmpty() { 18932 break 18933 } 18934 } 18935 return nil 18936} 18937 18938// Next advances to the next page of values. If there was an error making 18939// the request the page does not advance and the error is returned. 18940// Deprecated: Use NextWithContext() instead. 18941func (page *VirtualMachineScaleSetListResultPage) Next() error { 18942 return page.NextWithContext(context.Background()) 18943} 18944 18945// NotDone returns true if the page enumeration should be started or is not yet complete. 18946func (page VirtualMachineScaleSetListResultPage) NotDone() bool { 18947 return !page.vmsslr.IsEmpty() 18948} 18949 18950// Response returns the raw server response from the last page request. 18951func (page VirtualMachineScaleSetListResultPage) Response() VirtualMachineScaleSetListResult { 18952 return page.vmsslr 18953} 18954 18955// Values returns the slice of values for the current page or nil if there are no values. 18956func (page VirtualMachineScaleSetListResultPage) Values() []VirtualMachineScaleSet { 18957 if page.vmsslr.IsEmpty() { 18958 return nil 18959 } 18960 return *page.vmsslr.Value 18961} 18962 18963// Creates a new instance of the VirtualMachineScaleSetListResultPage type. 18964func NewVirtualMachineScaleSetListResultPage(cur VirtualMachineScaleSetListResult, getNextPage func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error)) VirtualMachineScaleSetListResultPage { 18965 return VirtualMachineScaleSetListResultPage{ 18966 fn: getNextPage, 18967 vmsslr: cur, 18968 } 18969} 18970 18971// VirtualMachineScaleSetListSkusResult the Virtual Machine Scale Set List Skus operation response. 18972type VirtualMachineScaleSetListSkusResult struct { 18973 autorest.Response `json:"-"` 18974 // Value - The list of skus available for the virtual machine scale set. 18975 Value *[]VirtualMachineScaleSetSku `json:"value,omitempty"` 18976 // 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. 18977 NextLink *string `json:"nextLink,omitempty"` 18978} 18979 18980// VirtualMachineScaleSetListSkusResultIterator provides access to a complete listing of 18981// VirtualMachineScaleSetSku values. 18982type VirtualMachineScaleSetListSkusResultIterator struct { 18983 i int 18984 page VirtualMachineScaleSetListSkusResultPage 18985} 18986 18987// NextWithContext advances to the next value. If there was an error making 18988// the request the iterator does not advance and the error is returned. 18989func (iter *VirtualMachineScaleSetListSkusResultIterator) NextWithContext(ctx context.Context) (err error) { 18990 if tracing.IsEnabled() { 18991 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListSkusResultIterator.NextWithContext") 18992 defer func() { 18993 sc := -1 18994 if iter.Response().Response.Response != nil { 18995 sc = iter.Response().Response.Response.StatusCode 18996 } 18997 tracing.EndSpan(ctx, sc, err) 18998 }() 18999 } 19000 iter.i++ 19001 if iter.i < len(iter.page.Values()) { 19002 return nil 19003 } 19004 err = iter.page.NextWithContext(ctx) 19005 if err != nil { 19006 iter.i-- 19007 return err 19008 } 19009 iter.i = 0 19010 return nil 19011} 19012 19013// Next advances to the next value. If there was an error making 19014// the request the iterator does not advance and the error is returned. 19015// Deprecated: Use NextWithContext() instead. 19016func (iter *VirtualMachineScaleSetListSkusResultIterator) Next() error { 19017 return iter.NextWithContext(context.Background()) 19018} 19019 19020// NotDone returns true if the enumeration should be started or is not yet complete. 19021func (iter VirtualMachineScaleSetListSkusResultIterator) NotDone() bool { 19022 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 19023} 19024 19025// Response returns the raw server response from the last page request. 19026func (iter VirtualMachineScaleSetListSkusResultIterator) Response() VirtualMachineScaleSetListSkusResult { 19027 return iter.page.Response() 19028} 19029 19030// Value returns the current value or a zero-initialized value if the 19031// iterator has advanced beyond the end of the collection. 19032func (iter VirtualMachineScaleSetListSkusResultIterator) Value() VirtualMachineScaleSetSku { 19033 if !iter.page.NotDone() { 19034 return VirtualMachineScaleSetSku{} 19035 } 19036 return iter.page.Values()[iter.i] 19037} 19038 19039// Creates a new instance of the VirtualMachineScaleSetListSkusResultIterator type. 19040func NewVirtualMachineScaleSetListSkusResultIterator(page VirtualMachineScaleSetListSkusResultPage) VirtualMachineScaleSetListSkusResultIterator { 19041 return VirtualMachineScaleSetListSkusResultIterator{page: page} 19042} 19043 19044// IsEmpty returns true if the ListResult contains no values. 19045func (vmsslsr VirtualMachineScaleSetListSkusResult) IsEmpty() bool { 19046 return vmsslsr.Value == nil || len(*vmsslsr.Value) == 0 19047} 19048 19049// hasNextLink returns true if the NextLink is not empty. 19050func (vmsslsr VirtualMachineScaleSetListSkusResult) hasNextLink() bool { 19051 return vmsslsr.NextLink != nil && len(*vmsslsr.NextLink) != 0 19052} 19053 19054// virtualMachineScaleSetListSkusResultPreparer prepares a request to retrieve the next set of results. 19055// It returns nil if no more results exist. 19056func (vmsslsr VirtualMachineScaleSetListSkusResult) virtualMachineScaleSetListSkusResultPreparer(ctx context.Context) (*http.Request, error) { 19057 if !vmsslsr.hasNextLink() { 19058 return nil, nil 19059 } 19060 return autorest.Prepare((&http.Request{}).WithContext(ctx), 19061 autorest.AsJSON(), 19062 autorest.AsGet(), 19063 autorest.WithBaseURL(to.String(vmsslsr.NextLink))) 19064} 19065 19066// VirtualMachineScaleSetListSkusResultPage contains a page of VirtualMachineScaleSetSku values. 19067type VirtualMachineScaleSetListSkusResultPage struct { 19068 fn func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error) 19069 vmsslsr VirtualMachineScaleSetListSkusResult 19070} 19071 19072// NextWithContext advances to the next page of values. If there was an error making 19073// the request the page does not advance and the error is returned. 19074func (page *VirtualMachineScaleSetListSkusResultPage) NextWithContext(ctx context.Context) (err error) { 19075 if tracing.IsEnabled() { 19076 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListSkusResultPage.NextWithContext") 19077 defer func() { 19078 sc := -1 19079 if page.Response().Response.Response != nil { 19080 sc = page.Response().Response.Response.StatusCode 19081 } 19082 tracing.EndSpan(ctx, sc, err) 19083 }() 19084 } 19085 for { 19086 next, err := page.fn(ctx, page.vmsslsr) 19087 if err != nil { 19088 return err 19089 } 19090 page.vmsslsr = next 19091 if !next.hasNextLink() || !next.IsEmpty() { 19092 break 19093 } 19094 } 19095 return nil 19096} 19097 19098// Next advances to the next page of values. If there was an error making 19099// the request the page does not advance and the error is returned. 19100// Deprecated: Use NextWithContext() instead. 19101func (page *VirtualMachineScaleSetListSkusResultPage) Next() error { 19102 return page.NextWithContext(context.Background()) 19103} 19104 19105// NotDone returns true if the page enumeration should be started or is not yet complete. 19106func (page VirtualMachineScaleSetListSkusResultPage) NotDone() bool { 19107 return !page.vmsslsr.IsEmpty() 19108} 19109 19110// Response returns the raw server response from the last page request. 19111func (page VirtualMachineScaleSetListSkusResultPage) Response() VirtualMachineScaleSetListSkusResult { 19112 return page.vmsslsr 19113} 19114 19115// Values returns the slice of values for the current page or nil if there are no values. 19116func (page VirtualMachineScaleSetListSkusResultPage) Values() []VirtualMachineScaleSetSku { 19117 if page.vmsslsr.IsEmpty() { 19118 return nil 19119 } 19120 return *page.vmsslsr.Value 19121} 19122 19123// Creates a new instance of the VirtualMachineScaleSetListSkusResultPage type. 19124func NewVirtualMachineScaleSetListSkusResultPage(cur VirtualMachineScaleSetListSkusResult, getNextPage func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error)) VirtualMachineScaleSetListSkusResultPage { 19125 return VirtualMachineScaleSetListSkusResultPage{ 19126 fn: getNextPage, 19127 vmsslsr: cur, 19128 } 19129} 19130 19131// VirtualMachineScaleSetListWithLinkResult the List Virtual Machine operation response. 19132type VirtualMachineScaleSetListWithLinkResult struct { 19133 autorest.Response `json:"-"` 19134 // Value - The list of virtual machine scale sets. 19135 Value *[]VirtualMachineScaleSet `json:"value,omitempty"` 19136 // 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. 19137 NextLink *string `json:"nextLink,omitempty"` 19138} 19139 19140// VirtualMachineScaleSetListWithLinkResultIterator provides access to a complete listing of 19141// VirtualMachineScaleSet values. 19142type VirtualMachineScaleSetListWithLinkResultIterator struct { 19143 i int 19144 page VirtualMachineScaleSetListWithLinkResultPage 19145} 19146 19147// NextWithContext advances to the next value. If there was an error making 19148// the request the iterator does not advance and the error is returned. 19149func (iter *VirtualMachineScaleSetListWithLinkResultIterator) NextWithContext(ctx context.Context) (err error) { 19150 if tracing.IsEnabled() { 19151 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListWithLinkResultIterator.NextWithContext") 19152 defer func() { 19153 sc := -1 19154 if iter.Response().Response.Response != nil { 19155 sc = iter.Response().Response.Response.StatusCode 19156 } 19157 tracing.EndSpan(ctx, sc, err) 19158 }() 19159 } 19160 iter.i++ 19161 if iter.i < len(iter.page.Values()) { 19162 return nil 19163 } 19164 err = iter.page.NextWithContext(ctx) 19165 if err != nil { 19166 iter.i-- 19167 return err 19168 } 19169 iter.i = 0 19170 return nil 19171} 19172 19173// Next advances to the next value. If there was an error making 19174// the request the iterator does not advance and the error is returned. 19175// Deprecated: Use NextWithContext() instead. 19176func (iter *VirtualMachineScaleSetListWithLinkResultIterator) Next() error { 19177 return iter.NextWithContext(context.Background()) 19178} 19179 19180// NotDone returns true if the enumeration should be started or is not yet complete. 19181func (iter VirtualMachineScaleSetListWithLinkResultIterator) NotDone() bool { 19182 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 19183} 19184 19185// Response returns the raw server response from the last page request. 19186func (iter VirtualMachineScaleSetListWithLinkResultIterator) Response() VirtualMachineScaleSetListWithLinkResult { 19187 return iter.page.Response() 19188} 19189 19190// Value returns the current value or a zero-initialized value if the 19191// iterator has advanced beyond the end of the collection. 19192func (iter VirtualMachineScaleSetListWithLinkResultIterator) Value() VirtualMachineScaleSet { 19193 if !iter.page.NotDone() { 19194 return VirtualMachineScaleSet{} 19195 } 19196 return iter.page.Values()[iter.i] 19197} 19198 19199// Creates a new instance of the VirtualMachineScaleSetListWithLinkResultIterator type. 19200func NewVirtualMachineScaleSetListWithLinkResultIterator(page VirtualMachineScaleSetListWithLinkResultPage) VirtualMachineScaleSetListWithLinkResultIterator { 19201 return VirtualMachineScaleSetListWithLinkResultIterator{page: page} 19202} 19203 19204// IsEmpty returns true if the ListResult contains no values. 19205func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) IsEmpty() bool { 19206 return vmsslwlr.Value == nil || len(*vmsslwlr.Value) == 0 19207} 19208 19209// hasNextLink returns true if the NextLink is not empty. 19210func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) hasNextLink() bool { 19211 return vmsslwlr.NextLink != nil && len(*vmsslwlr.NextLink) != 0 19212} 19213 19214// virtualMachineScaleSetListWithLinkResultPreparer prepares a request to retrieve the next set of results. 19215// It returns nil if no more results exist. 19216func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) virtualMachineScaleSetListWithLinkResultPreparer(ctx context.Context) (*http.Request, error) { 19217 if !vmsslwlr.hasNextLink() { 19218 return nil, nil 19219 } 19220 return autorest.Prepare((&http.Request{}).WithContext(ctx), 19221 autorest.AsJSON(), 19222 autorest.AsGet(), 19223 autorest.WithBaseURL(to.String(vmsslwlr.NextLink))) 19224} 19225 19226// VirtualMachineScaleSetListWithLinkResultPage contains a page of VirtualMachineScaleSet values. 19227type VirtualMachineScaleSetListWithLinkResultPage struct { 19228 fn func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error) 19229 vmsslwlr VirtualMachineScaleSetListWithLinkResult 19230} 19231 19232// NextWithContext advances to the next page of values. If there was an error making 19233// the request the page does not advance and the error is returned. 19234func (page *VirtualMachineScaleSetListWithLinkResultPage) NextWithContext(ctx context.Context) (err error) { 19235 if tracing.IsEnabled() { 19236 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListWithLinkResultPage.NextWithContext") 19237 defer func() { 19238 sc := -1 19239 if page.Response().Response.Response != nil { 19240 sc = page.Response().Response.Response.StatusCode 19241 } 19242 tracing.EndSpan(ctx, sc, err) 19243 }() 19244 } 19245 for { 19246 next, err := page.fn(ctx, page.vmsslwlr) 19247 if err != nil { 19248 return err 19249 } 19250 page.vmsslwlr = next 19251 if !next.hasNextLink() || !next.IsEmpty() { 19252 break 19253 } 19254 } 19255 return nil 19256} 19257 19258// Next advances to the next page of values. If there was an error making 19259// the request the page does not advance and the error is returned. 19260// Deprecated: Use NextWithContext() instead. 19261func (page *VirtualMachineScaleSetListWithLinkResultPage) Next() error { 19262 return page.NextWithContext(context.Background()) 19263} 19264 19265// NotDone returns true if the page enumeration should be started or is not yet complete. 19266func (page VirtualMachineScaleSetListWithLinkResultPage) NotDone() bool { 19267 return !page.vmsslwlr.IsEmpty() 19268} 19269 19270// Response returns the raw server response from the last page request. 19271func (page VirtualMachineScaleSetListWithLinkResultPage) Response() VirtualMachineScaleSetListWithLinkResult { 19272 return page.vmsslwlr 19273} 19274 19275// Values returns the slice of values for the current page or nil if there are no values. 19276func (page VirtualMachineScaleSetListWithLinkResultPage) Values() []VirtualMachineScaleSet { 19277 if page.vmsslwlr.IsEmpty() { 19278 return nil 19279 } 19280 return *page.vmsslwlr.Value 19281} 19282 19283// Creates a new instance of the VirtualMachineScaleSetListWithLinkResultPage type. 19284func NewVirtualMachineScaleSetListWithLinkResultPage(cur VirtualMachineScaleSetListWithLinkResult, getNextPage func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error)) VirtualMachineScaleSetListWithLinkResultPage { 19285 return VirtualMachineScaleSetListWithLinkResultPage{ 19286 fn: getNextPage, 19287 vmsslwlr: cur, 19288 } 19289} 19290 19291// VirtualMachineScaleSetManagedDiskParameters describes the parameters of a ScaleSet managed disk. 19292type VirtualMachineScaleSetManagedDiskParameters struct { 19293 // 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' 19294 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 19295 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed disk. 19296 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 19297} 19298 19299// VirtualMachineScaleSetNetworkConfiguration describes a virtual machine scale set network profile's 19300// network configurations. 19301type VirtualMachineScaleSetNetworkConfiguration struct { 19302 // Name - The network configuration name. 19303 Name *string `json:"name,omitempty"` 19304 *VirtualMachineScaleSetNetworkConfigurationProperties `json:"properties,omitempty"` 19305 // ID - Resource Id 19306 ID *string `json:"id,omitempty"` 19307} 19308 19309// MarshalJSON is the custom marshaler for VirtualMachineScaleSetNetworkConfiguration. 19310func (vmssnc VirtualMachineScaleSetNetworkConfiguration) MarshalJSON() ([]byte, error) { 19311 objectMap := make(map[string]interface{}) 19312 if vmssnc.Name != nil { 19313 objectMap["name"] = vmssnc.Name 19314 } 19315 if vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties != nil { 19316 objectMap["properties"] = vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties 19317 } 19318 if vmssnc.ID != nil { 19319 objectMap["id"] = vmssnc.ID 19320 } 19321 return json.Marshal(objectMap) 19322} 19323 19324// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetNetworkConfiguration struct. 19325func (vmssnc *VirtualMachineScaleSetNetworkConfiguration) UnmarshalJSON(body []byte) error { 19326 var m map[string]*json.RawMessage 19327 err := json.Unmarshal(body, &m) 19328 if err != nil { 19329 return err 19330 } 19331 for k, v := range m { 19332 switch k { 19333 case "name": 19334 if v != nil { 19335 var name string 19336 err = json.Unmarshal(*v, &name) 19337 if err != nil { 19338 return err 19339 } 19340 vmssnc.Name = &name 19341 } 19342 case "properties": 19343 if v != nil { 19344 var virtualMachineScaleSetNetworkConfigurationProperties VirtualMachineScaleSetNetworkConfigurationProperties 19345 err = json.Unmarshal(*v, &virtualMachineScaleSetNetworkConfigurationProperties) 19346 if err != nil { 19347 return err 19348 } 19349 vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties = &virtualMachineScaleSetNetworkConfigurationProperties 19350 } 19351 case "id": 19352 if v != nil { 19353 var ID string 19354 err = json.Unmarshal(*v, &ID) 19355 if err != nil { 19356 return err 19357 } 19358 vmssnc.ID = &ID 19359 } 19360 } 19361 } 19362 19363 return nil 19364} 19365 19366// VirtualMachineScaleSetNetworkConfigurationDNSSettings describes a virtual machines scale sets network 19367// configuration's DNS settings. 19368type VirtualMachineScaleSetNetworkConfigurationDNSSettings struct { 19369 // DNSServers - List of DNS servers IP addresses 19370 DNSServers *[]string `json:"dnsServers,omitempty"` 19371} 19372 19373// VirtualMachineScaleSetNetworkConfigurationProperties describes a virtual machine scale set network 19374// profile's IP configuration. 19375type VirtualMachineScaleSetNetworkConfigurationProperties struct { 19376 // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. 19377 Primary *bool `json:"primary,omitempty"` 19378 // EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled. 19379 EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` 19380 // EnableFpga - Specifies whether the network interface is FPGA networking-enabled. 19381 EnableFpga *bool `json:"enableFpga,omitempty"` 19382 // NetworkSecurityGroup - The network security group. 19383 NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` 19384 // DNSSettings - The dns settings to be applied on the network interfaces. 19385 DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings `json:"dnsSettings,omitempty"` 19386 // IPConfigurations - Specifies the IP configurations of the network interface. 19387 IPConfigurations *[]VirtualMachineScaleSetIPConfiguration `json:"ipConfigurations,omitempty"` 19388 // EnableIPForwarding - Whether IP forwarding enabled on this NIC. 19389 EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` 19390 // DeleteOption - Specify what happens to the network interface when the VM is deleted. Possible values include: 'DeleteOptionsDelete', 'DeleteOptionsDetach' 19391 DeleteOption DeleteOptions `json:"deleteOption,omitempty"` 19392} 19393 19394// VirtualMachineScaleSetNetworkProfile describes a virtual machine scale set network profile. 19395type VirtualMachineScaleSetNetworkProfile struct { 19396 // 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}'. 19397 HealthProbe *APIEntityReference `json:"healthProbe,omitempty"` 19398 // NetworkInterfaceConfigurations - The list of network configurations. 19399 NetworkInterfaceConfigurations *[]VirtualMachineScaleSetNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` 19400 // 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' 19401 NetworkAPIVersion NetworkAPIVersion `json:"networkApiVersion,omitempty"` 19402} 19403 19404// VirtualMachineScaleSetOSDisk describes a virtual machine scale set operating system disk. 19405type VirtualMachineScaleSetOSDisk struct { 19406 // Name - The disk name. 19407 Name *string `json:"name,omitempty"` 19408 // 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' 19409 Caching CachingTypes `json:"caching,omitempty"` 19410 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 19411 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 19412 // 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' 19413 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 19414 // DiffDiskSettings - Specifies the ephemeral disk Settings for the operating system disk used by the virtual machine scale set. 19415 DiffDiskSettings *DiffDiskSettings `json:"diffDiskSettings,omitempty"` 19416 // 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 19417 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 19418 // 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' 19419 OsType OperatingSystemTypes `json:"osType,omitempty"` 19420 // Image - Specifies information about the unmanaged user image to base the scale set on. 19421 Image *VirtualHardDisk `json:"image,omitempty"` 19422 // VhdContainers - Specifies the container urls that are used to store operating system disks for the scale set. 19423 VhdContainers *[]string `json:"vhdContainers,omitempty"` 19424 // ManagedDisk - The managed disk parameters. 19425 ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` 19426} 19427 19428// VirtualMachineScaleSetOSProfile describes a virtual machine scale set OS profile. 19429type VirtualMachineScaleSetOSProfile struct { 19430 // 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. 19431 ComputerNamePrefix *string `json:"computerNamePrefix,omitempty"` 19432 // 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 19433 AdminUsername *string `json:"adminUsername,omitempty"` 19434 // 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) 19435 AdminPassword *string `json:"adminPassword,omitempty"` 19436 // 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) 19437 CustomData *string `json:"customData,omitempty"` 19438 // WindowsConfiguration - Specifies Windows operating system settings on the virtual machine. 19439 WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` 19440 // 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). 19441 LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` 19442 // Secrets - Specifies set of certificates that should be installed onto the virtual machines in the scale set. 19443 Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` 19444} 19445 19446// VirtualMachineScaleSetProperties describes the properties of a Virtual Machine Scale Set. 19447type VirtualMachineScaleSetProperties struct { 19448 // UpgradePolicy - The upgrade policy. 19449 UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` 19450 // AutomaticRepairsPolicy - Policy for automatic repairs. 19451 AutomaticRepairsPolicy *AutomaticRepairsPolicy `json:"automaticRepairsPolicy,omitempty"` 19452 // VirtualMachineProfile - The virtual machine profile. 19453 VirtualMachineProfile *VirtualMachineScaleSetVMProfile `json:"virtualMachineProfile,omitempty"` 19454 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 19455 ProvisioningState *string `json:"provisioningState,omitempty"` 19456 // Overprovision - Specifies whether the Virtual Machine Scale Set should be overprovisioned. 19457 Overprovision *bool `json:"overprovision,omitempty"` 19458 // 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. 19459 DoNotRunExtensionsOnOverprovisionedVMs *bool `json:"doNotRunExtensionsOnOverprovisionedVMs,omitempty"` 19460 // UniqueID - READ-ONLY; Specifies the ID which uniquely identifies a Virtual Machine Scale Set. 19461 UniqueID *string `json:"uniqueId,omitempty"` 19462 // 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. 19463 SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"` 19464 // ZoneBalance - Whether to force strictly even Virtual Machine distribution cross x-zones in case there is zone outage. 19465 ZoneBalance *bool `json:"zoneBalance,omitempty"` 19466 // PlatformFaultDomainCount - Fault Domain count for each placement group. 19467 PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` 19468 // 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. 19469 ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` 19470 // HostGroup - Specifies information about the dedicated host group that the virtual machine scale set resides in. <br><br>Minimum api-version: 2020-06-01. 19471 HostGroup *SubResource `json:"hostGroup,omitempty"` 19472 // 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. 19473 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 19474 // ScaleInPolicy - Specifies the scale-in policy that decides which virtual machines are chosen for removal when a Virtual Machine Scale Set is scaled-in. 19475 ScaleInPolicy *ScaleInPolicy `json:"scaleInPolicy,omitempty"` 19476 // OrchestrationMode - Specifies the orchestration mode for the virtual machine scale set. Possible values include: 'OrchestrationModeUniform', 'OrchestrationModeFlexible' 19477 OrchestrationMode OrchestrationMode `json:"orchestrationMode,omitempty"` 19478 // SpotRestorePolicy - Specifies the Spot Restore properties for the virtual machine scale set. 19479 SpotRestorePolicy *SpotRestorePolicy `json:"spotRestorePolicy,omitempty"` 19480} 19481 19482// MarshalJSON is the custom marshaler for VirtualMachineScaleSetProperties. 19483func (vmssp VirtualMachineScaleSetProperties) MarshalJSON() ([]byte, error) { 19484 objectMap := make(map[string]interface{}) 19485 if vmssp.UpgradePolicy != nil { 19486 objectMap["upgradePolicy"] = vmssp.UpgradePolicy 19487 } 19488 if vmssp.AutomaticRepairsPolicy != nil { 19489 objectMap["automaticRepairsPolicy"] = vmssp.AutomaticRepairsPolicy 19490 } 19491 if vmssp.VirtualMachineProfile != nil { 19492 objectMap["virtualMachineProfile"] = vmssp.VirtualMachineProfile 19493 } 19494 if vmssp.Overprovision != nil { 19495 objectMap["overprovision"] = vmssp.Overprovision 19496 } 19497 if vmssp.DoNotRunExtensionsOnOverprovisionedVMs != nil { 19498 objectMap["doNotRunExtensionsOnOverprovisionedVMs"] = vmssp.DoNotRunExtensionsOnOverprovisionedVMs 19499 } 19500 if vmssp.SinglePlacementGroup != nil { 19501 objectMap["singlePlacementGroup"] = vmssp.SinglePlacementGroup 19502 } 19503 if vmssp.ZoneBalance != nil { 19504 objectMap["zoneBalance"] = vmssp.ZoneBalance 19505 } 19506 if vmssp.PlatformFaultDomainCount != nil { 19507 objectMap["platformFaultDomainCount"] = vmssp.PlatformFaultDomainCount 19508 } 19509 if vmssp.ProximityPlacementGroup != nil { 19510 objectMap["proximityPlacementGroup"] = vmssp.ProximityPlacementGroup 19511 } 19512 if vmssp.HostGroup != nil { 19513 objectMap["hostGroup"] = vmssp.HostGroup 19514 } 19515 if vmssp.AdditionalCapabilities != nil { 19516 objectMap["additionalCapabilities"] = vmssp.AdditionalCapabilities 19517 } 19518 if vmssp.ScaleInPolicy != nil { 19519 objectMap["scaleInPolicy"] = vmssp.ScaleInPolicy 19520 } 19521 if vmssp.OrchestrationMode != "" { 19522 objectMap["orchestrationMode"] = vmssp.OrchestrationMode 19523 } 19524 if vmssp.SpotRestorePolicy != nil { 19525 objectMap["spotRestorePolicy"] = vmssp.SpotRestorePolicy 19526 } 19527 return json.Marshal(objectMap) 19528} 19529 19530// VirtualMachineScaleSetPublicIPAddressConfiguration describes a virtual machines scale set IP 19531// Configuration's PublicIPAddress configuration 19532type VirtualMachineScaleSetPublicIPAddressConfiguration struct { 19533 // Name - The publicIP address configuration name. 19534 Name *string `json:"name,omitempty"` 19535 *VirtualMachineScaleSetPublicIPAddressConfigurationProperties `json:"properties,omitempty"` 19536 Sku *PublicIPAddressSku `json:"sku,omitempty"` 19537} 19538 19539// MarshalJSON is the custom marshaler for VirtualMachineScaleSetPublicIPAddressConfiguration. 19540func (vmsspiac VirtualMachineScaleSetPublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { 19541 objectMap := make(map[string]interface{}) 19542 if vmsspiac.Name != nil { 19543 objectMap["name"] = vmsspiac.Name 19544 } 19545 if vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties != nil { 19546 objectMap["properties"] = vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties 19547 } 19548 if vmsspiac.Sku != nil { 19549 objectMap["sku"] = vmsspiac.Sku 19550 } 19551 return json.Marshal(objectMap) 19552} 19553 19554// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetPublicIPAddressConfiguration struct. 19555func (vmsspiac *VirtualMachineScaleSetPublicIPAddressConfiguration) UnmarshalJSON(body []byte) error { 19556 var m map[string]*json.RawMessage 19557 err := json.Unmarshal(body, &m) 19558 if err != nil { 19559 return err 19560 } 19561 for k, v := range m { 19562 switch k { 19563 case "name": 19564 if v != nil { 19565 var name string 19566 err = json.Unmarshal(*v, &name) 19567 if err != nil { 19568 return err 19569 } 19570 vmsspiac.Name = &name 19571 } 19572 case "properties": 19573 if v != nil { 19574 var virtualMachineScaleSetPublicIPAddressConfigurationProperties VirtualMachineScaleSetPublicIPAddressConfigurationProperties 19575 err = json.Unmarshal(*v, &virtualMachineScaleSetPublicIPAddressConfigurationProperties) 19576 if err != nil { 19577 return err 19578 } 19579 vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties = &virtualMachineScaleSetPublicIPAddressConfigurationProperties 19580 } 19581 case "sku": 19582 if v != nil { 19583 var sku PublicIPAddressSku 19584 err = json.Unmarshal(*v, &sku) 19585 if err != nil { 19586 return err 19587 } 19588 vmsspiac.Sku = &sku 19589 } 19590 } 19591 } 19592 19593 return nil 19594} 19595 19596// VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings describes a virtual machines scale sets 19597// network configuration's DNS settings. 19598type VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings struct { 19599 // 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 19600 DomainNameLabel *string `json:"domainNameLabel,omitempty"` 19601} 19602 19603// VirtualMachineScaleSetPublicIPAddressConfigurationProperties describes a virtual machines scale set IP 19604// Configuration's PublicIPAddress configuration 19605type VirtualMachineScaleSetPublicIPAddressConfigurationProperties struct { 19606 // IdleTimeoutInMinutes - The idle timeout of the public IP address. 19607 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` 19608 // DNSSettings - The dns settings to be applied on the publicIP addresses . 19609 DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings `json:"dnsSettings,omitempty"` 19610 // IPTags - The list of IP tags associated with the public IP address. 19611 IPTags *[]VirtualMachineScaleSetIPTag `json:"ipTags,omitempty"` 19612 // PublicIPPrefix - The PublicIPPrefix from which to allocate publicIP addresses. 19613 PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` 19614 // 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' 19615 PublicIPAddressVersion IPVersion `json:"publicIPAddressVersion,omitempty"` 19616 // DeleteOption - Specify what happens to the public IP when the VM is deleted. Possible values include: 'DeleteOptionsDelete', 'DeleteOptionsDetach' 19617 DeleteOption DeleteOptions `json:"deleteOption,omitempty"` 19618} 19619 19620// VirtualMachineScaleSetReimageParameters describes a Virtual Machine Scale Set VM Reimage Parameters. 19621type VirtualMachineScaleSetReimageParameters struct { 19622 // 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. 19623 InstanceIds *[]string `json:"instanceIds,omitempty"` 19624 // 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. 19625 TempDisk *bool `json:"tempDisk,omitempty"` 19626} 19627 19628// VirtualMachineScaleSetRollingUpgradesCancelFuture an abstraction for monitoring and retrieving the 19629// results of a long-running operation. 19630type VirtualMachineScaleSetRollingUpgradesCancelFuture struct { 19631 azure.FutureAPI 19632 // Result returns the result of the asynchronous operation. 19633 // If the operation has not completed it will return an error. 19634 Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) 19635} 19636 19637// UnmarshalJSON is the custom unmarshaller for CreateFuture. 19638func (future *VirtualMachineScaleSetRollingUpgradesCancelFuture) UnmarshalJSON(body []byte) error { 19639 var azFuture azure.Future 19640 if err := json.Unmarshal(body, &azFuture); err != nil { 19641 return err 19642 } 19643 future.FutureAPI = &azFuture 19644 future.Result = future.result 19645 return nil 19646} 19647 19648// result is the default implementation for VirtualMachineScaleSetRollingUpgradesCancelFuture.Result. 19649func (future *VirtualMachineScaleSetRollingUpgradesCancelFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { 19650 var done bool 19651 done, err = future.DoneWithContext(context.Background(), client) 19652 if err != nil { 19653 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesCancelFuture", "Result", future.Response(), "Polling failure") 19654 return 19655 } 19656 if !done { 19657 ar.Response = future.Response() 19658 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesCancelFuture") 19659 return 19660 } 19661 ar.Response = future.Response() 19662 return 19663} 19664 19665// VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture an abstraction for monitoring and 19666// retrieving the results of a long-running operation. 19667type VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture struct { 19668 azure.FutureAPI 19669 // Result returns the result of the asynchronous operation. 19670 // If the operation has not completed it will return an error. 19671 Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) 19672} 19673 19674// UnmarshalJSON is the custom unmarshaller for CreateFuture. 19675func (future *VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture) UnmarshalJSON(body []byte) error { 19676 var azFuture azure.Future 19677 if err := json.Unmarshal(body, &azFuture); err != nil { 19678 return err 19679 } 19680 future.FutureAPI = &azFuture 19681 future.Result = future.result 19682 return nil 19683} 19684 19685// result is the default implementation for VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture.Result. 19686func (future *VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { 19687 var done bool 19688 done, err = future.DoneWithContext(context.Background(), client) 19689 if err != nil { 19690 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture", "Result", future.Response(), "Polling failure") 19691 return 19692 } 19693 if !done { 19694 ar.Response = future.Response() 19695 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture") 19696 return 19697 } 19698 ar.Response = future.Response() 19699 return 19700} 19701 19702// VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture an abstraction for monitoring and retrieving 19703// the results of a long-running operation. 19704type VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture struct { 19705 azure.FutureAPI 19706 // Result returns the result of the asynchronous operation. 19707 // If the operation has not completed it will return an error. 19708 Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) 19709} 19710 19711// UnmarshalJSON is the custom unmarshaller for CreateFuture. 19712func (future *VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture) UnmarshalJSON(body []byte) error { 19713 var azFuture azure.Future 19714 if err := json.Unmarshal(body, &azFuture); err != nil { 19715 return err 19716 } 19717 future.FutureAPI = &azFuture 19718 future.Result = future.result 19719 return nil 19720} 19721 19722// result is the default implementation for VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture.Result. 19723func (future *VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { 19724 var done bool 19725 done, err = future.DoneWithContext(context.Background(), client) 19726 if err != nil { 19727 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture", "Result", future.Response(), "Polling failure") 19728 return 19729 } 19730 if !done { 19731 ar.Response = future.Response() 19732 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture") 19733 return 19734 } 19735 ar.Response = future.Response() 19736 return 19737} 19738 19739// VirtualMachineScaleSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of 19740// a long-running operation. 19741type VirtualMachineScaleSetsCreateOrUpdateFuture struct { 19742 azure.FutureAPI 19743 // Result returns the result of the asynchronous operation. 19744 // If the operation has not completed it will return an error. 19745 Result func(VirtualMachineScaleSetsClient) (VirtualMachineScaleSet, error) 19746} 19747 19748// UnmarshalJSON is the custom unmarshaller for CreateFuture. 19749func (future *VirtualMachineScaleSetsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 19750 var azFuture azure.Future 19751 if err := json.Unmarshal(body, &azFuture); err != nil { 19752 return err 19753 } 19754 future.FutureAPI = &azFuture 19755 future.Result = future.result 19756 return nil 19757} 19758 19759// result is the default implementation for VirtualMachineScaleSetsCreateOrUpdateFuture.Result. 19760func (future *VirtualMachineScaleSetsCreateOrUpdateFuture) result(client VirtualMachineScaleSetsClient) (vmss VirtualMachineScaleSet, err error) { 19761 var done bool 19762 done, err = future.DoneWithContext(context.Background(), client) 19763 if err != nil { 19764 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 19765 return 19766 } 19767 if !done { 19768 vmss.Response.Response = future.Response() 19769 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsCreateOrUpdateFuture") 19770 return 19771 } 19772 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 19773 if vmss.Response.Response, err = future.GetResult(sender); err == nil && vmss.Response.Response.StatusCode != http.StatusNoContent { 19774 vmss, err = client.CreateOrUpdateResponder(vmss.Response.Response) 19775 if err != nil { 19776 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsCreateOrUpdateFuture", "Result", vmss.Response.Response, "Failure responding to request") 19777 } 19778 } 19779 return 19780} 19781 19782// VirtualMachineScaleSetsDeallocateFuture an abstraction for monitoring and retrieving the results of a 19783// long-running operation. 19784type VirtualMachineScaleSetsDeallocateFuture struct { 19785 azure.FutureAPI 19786 // Result returns the result of the asynchronous operation. 19787 // If the operation has not completed it will return an error. 19788 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 19789} 19790 19791// UnmarshalJSON is the custom unmarshaller for CreateFuture. 19792func (future *VirtualMachineScaleSetsDeallocateFuture) UnmarshalJSON(body []byte) error { 19793 var azFuture azure.Future 19794 if err := json.Unmarshal(body, &azFuture); err != nil { 19795 return err 19796 } 19797 future.FutureAPI = &azFuture 19798 future.Result = future.result 19799 return nil 19800} 19801 19802// result is the default implementation for VirtualMachineScaleSetsDeallocateFuture.Result. 19803func (future *VirtualMachineScaleSetsDeallocateFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 19804 var done bool 19805 done, err = future.DoneWithContext(context.Background(), client) 19806 if err != nil { 19807 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeallocateFuture", "Result", future.Response(), "Polling failure") 19808 return 19809 } 19810 if !done { 19811 ar.Response = future.Response() 19812 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeallocateFuture") 19813 return 19814 } 19815 ar.Response = future.Response() 19816 return 19817} 19818 19819// VirtualMachineScaleSetsDeleteFuture an abstraction for monitoring and retrieving the results of a 19820// long-running operation. 19821type VirtualMachineScaleSetsDeleteFuture struct { 19822 azure.FutureAPI 19823 // Result returns the result of the asynchronous operation. 19824 // If the operation has not completed it will return an error. 19825 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 19826} 19827 19828// UnmarshalJSON is the custom unmarshaller for CreateFuture. 19829func (future *VirtualMachineScaleSetsDeleteFuture) UnmarshalJSON(body []byte) error { 19830 var azFuture azure.Future 19831 if err := json.Unmarshal(body, &azFuture); err != nil { 19832 return err 19833 } 19834 future.FutureAPI = &azFuture 19835 future.Result = future.result 19836 return nil 19837} 19838 19839// result is the default implementation for VirtualMachineScaleSetsDeleteFuture.Result. 19840func (future *VirtualMachineScaleSetsDeleteFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 19841 var done bool 19842 done, err = future.DoneWithContext(context.Background(), client) 19843 if err != nil { 19844 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeleteFuture", "Result", future.Response(), "Polling failure") 19845 return 19846 } 19847 if !done { 19848 ar.Response = future.Response() 19849 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeleteFuture") 19850 return 19851 } 19852 ar.Response = future.Response() 19853 return 19854} 19855 19856// VirtualMachineScaleSetsDeleteInstancesFuture an abstraction for monitoring and retrieving the results of 19857// a long-running operation. 19858type VirtualMachineScaleSetsDeleteInstancesFuture struct { 19859 azure.FutureAPI 19860 // Result returns the result of the asynchronous operation. 19861 // If the operation has not completed it will return an error. 19862 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 19863} 19864 19865// UnmarshalJSON is the custom unmarshaller for CreateFuture. 19866func (future *VirtualMachineScaleSetsDeleteInstancesFuture) UnmarshalJSON(body []byte) error { 19867 var azFuture azure.Future 19868 if err := json.Unmarshal(body, &azFuture); err != nil { 19869 return err 19870 } 19871 future.FutureAPI = &azFuture 19872 future.Result = future.result 19873 return nil 19874} 19875 19876// result is the default implementation for VirtualMachineScaleSetsDeleteInstancesFuture.Result. 19877func (future *VirtualMachineScaleSetsDeleteInstancesFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 19878 var done bool 19879 done, err = future.DoneWithContext(context.Background(), client) 19880 if err != nil { 19881 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeleteInstancesFuture", "Result", future.Response(), "Polling failure") 19882 return 19883 } 19884 if !done { 19885 ar.Response = future.Response() 19886 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeleteInstancesFuture") 19887 return 19888 } 19889 ar.Response = future.Response() 19890 return 19891} 19892 19893// VirtualMachineScaleSetSku describes an available virtual machine scale set sku. 19894type VirtualMachineScaleSetSku struct { 19895 // ResourceType - READ-ONLY; The type of resource the sku applies to. 19896 ResourceType *string `json:"resourceType,omitempty"` 19897 // Sku - READ-ONLY; The Sku. 19898 Sku *Sku `json:"sku,omitempty"` 19899 // Capacity - READ-ONLY; Specifies the number of virtual machines in the scale set. 19900 Capacity *VirtualMachineScaleSetSkuCapacity `json:"capacity,omitempty"` 19901} 19902 19903// MarshalJSON is the custom marshaler for VirtualMachineScaleSetSku. 19904func (vmsss VirtualMachineScaleSetSku) MarshalJSON() ([]byte, error) { 19905 objectMap := make(map[string]interface{}) 19906 return json.Marshal(objectMap) 19907} 19908 19909// VirtualMachineScaleSetSkuCapacity describes scaling information of a sku. 19910type VirtualMachineScaleSetSkuCapacity struct { 19911 // Minimum - READ-ONLY; The minimum capacity. 19912 Minimum *int64 `json:"minimum,omitempty"` 19913 // Maximum - READ-ONLY; The maximum capacity that can be set. 19914 Maximum *int64 `json:"maximum,omitempty"` 19915 // DefaultCapacity - READ-ONLY; The default capacity. 19916 DefaultCapacity *int64 `json:"defaultCapacity,omitempty"` 19917 // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'VirtualMachineScaleSetSkuScaleTypeAutomatic', 'VirtualMachineScaleSetSkuScaleTypeNone' 19918 ScaleType VirtualMachineScaleSetSkuScaleType `json:"scaleType,omitempty"` 19919} 19920 19921// MarshalJSON is the custom marshaler for VirtualMachineScaleSetSkuCapacity. 19922func (vmsssc VirtualMachineScaleSetSkuCapacity) MarshalJSON() ([]byte, error) { 19923 objectMap := make(map[string]interface{}) 19924 return json.Marshal(objectMap) 19925} 19926 19927// VirtualMachineScaleSetsPerformMaintenanceFuture an abstraction for monitoring and retrieving the results 19928// of a long-running operation. 19929type VirtualMachineScaleSetsPerformMaintenanceFuture struct { 19930 azure.FutureAPI 19931 // Result returns the result of the asynchronous operation. 19932 // If the operation has not completed it will return an error. 19933 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 19934} 19935 19936// UnmarshalJSON is the custom unmarshaller for CreateFuture. 19937func (future *VirtualMachineScaleSetsPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { 19938 var azFuture azure.Future 19939 if err := json.Unmarshal(body, &azFuture); err != nil { 19940 return err 19941 } 19942 future.FutureAPI = &azFuture 19943 future.Result = future.result 19944 return nil 19945} 19946 19947// result is the default implementation for VirtualMachineScaleSetsPerformMaintenanceFuture.Result. 19948func (future *VirtualMachineScaleSetsPerformMaintenanceFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 19949 var done bool 19950 done, err = future.DoneWithContext(context.Background(), client) 19951 if err != nil { 19952 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsPerformMaintenanceFuture", "Result", future.Response(), "Polling failure") 19953 return 19954 } 19955 if !done { 19956 ar.Response = future.Response() 19957 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsPerformMaintenanceFuture") 19958 return 19959 } 19960 ar.Response = future.Response() 19961 return 19962} 19963 19964// VirtualMachineScaleSetsPowerOffFuture an abstraction for monitoring and retrieving the results of a 19965// long-running operation. 19966type VirtualMachineScaleSetsPowerOffFuture struct { 19967 azure.FutureAPI 19968 // Result returns the result of the asynchronous operation. 19969 // If the operation has not completed it will return an error. 19970 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 19971} 19972 19973// UnmarshalJSON is the custom unmarshaller for CreateFuture. 19974func (future *VirtualMachineScaleSetsPowerOffFuture) UnmarshalJSON(body []byte) error { 19975 var azFuture azure.Future 19976 if err := json.Unmarshal(body, &azFuture); err != nil { 19977 return err 19978 } 19979 future.FutureAPI = &azFuture 19980 future.Result = future.result 19981 return nil 19982} 19983 19984// result is the default implementation for VirtualMachineScaleSetsPowerOffFuture.Result. 19985func (future *VirtualMachineScaleSetsPowerOffFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 19986 var done bool 19987 done, err = future.DoneWithContext(context.Background(), client) 19988 if err != nil { 19989 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsPowerOffFuture", "Result", future.Response(), "Polling failure") 19990 return 19991 } 19992 if !done { 19993 ar.Response = future.Response() 19994 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsPowerOffFuture") 19995 return 19996 } 19997 ar.Response = future.Response() 19998 return 19999} 20000 20001// VirtualMachineScaleSetsRedeployFuture an abstraction for monitoring and retrieving the results of a 20002// long-running operation. 20003type VirtualMachineScaleSetsRedeployFuture struct { 20004 azure.FutureAPI 20005 // Result returns the result of the asynchronous operation. 20006 // If the operation has not completed it will return an error. 20007 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 20008} 20009 20010// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20011func (future *VirtualMachineScaleSetsRedeployFuture) UnmarshalJSON(body []byte) error { 20012 var azFuture azure.Future 20013 if err := json.Unmarshal(body, &azFuture); err != nil { 20014 return err 20015 } 20016 future.FutureAPI = &azFuture 20017 future.Result = future.result 20018 return nil 20019} 20020 20021// result is the default implementation for VirtualMachineScaleSetsRedeployFuture.Result. 20022func (future *VirtualMachineScaleSetsRedeployFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 20023 var done bool 20024 done, err = future.DoneWithContext(context.Background(), client) 20025 if err != nil { 20026 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsRedeployFuture", "Result", future.Response(), "Polling failure") 20027 return 20028 } 20029 if !done { 20030 ar.Response = future.Response() 20031 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsRedeployFuture") 20032 return 20033 } 20034 ar.Response = future.Response() 20035 return 20036} 20037 20038// VirtualMachineScaleSetsReimageAllFuture an abstraction for monitoring and retrieving the results of a 20039// long-running operation. 20040type VirtualMachineScaleSetsReimageAllFuture struct { 20041 azure.FutureAPI 20042 // Result returns the result of the asynchronous operation. 20043 // If the operation has not completed it will return an error. 20044 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 20045} 20046 20047// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20048func (future *VirtualMachineScaleSetsReimageAllFuture) UnmarshalJSON(body []byte) error { 20049 var azFuture azure.Future 20050 if err := json.Unmarshal(body, &azFuture); err != nil { 20051 return err 20052 } 20053 future.FutureAPI = &azFuture 20054 future.Result = future.result 20055 return nil 20056} 20057 20058// result is the default implementation for VirtualMachineScaleSetsReimageAllFuture.Result. 20059func (future *VirtualMachineScaleSetsReimageAllFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 20060 var done bool 20061 done, err = future.DoneWithContext(context.Background(), client) 20062 if err != nil { 20063 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsReimageAllFuture", "Result", future.Response(), "Polling failure") 20064 return 20065 } 20066 if !done { 20067 ar.Response = future.Response() 20068 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsReimageAllFuture") 20069 return 20070 } 20071 ar.Response = future.Response() 20072 return 20073} 20074 20075// VirtualMachineScaleSetsReimageFuture an abstraction for monitoring and retrieving the results of a 20076// long-running operation. 20077type VirtualMachineScaleSetsReimageFuture struct { 20078 azure.FutureAPI 20079 // Result returns the result of the asynchronous operation. 20080 // If the operation has not completed it will return an error. 20081 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 20082} 20083 20084// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20085func (future *VirtualMachineScaleSetsReimageFuture) UnmarshalJSON(body []byte) error { 20086 var azFuture azure.Future 20087 if err := json.Unmarshal(body, &azFuture); err != nil { 20088 return err 20089 } 20090 future.FutureAPI = &azFuture 20091 future.Result = future.result 20092 return nil 20093} 20094 20095// result is the default implementation for VirtualMachineScaleSetsReimageFuture.Result. 20096func (future *VirtualMachineScaleSetsReimageFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 20097 var done bool 20098 done, err = future.DoneWithContext(context.Background(), client) 20099 if err != nil { 20100 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsReimageFuture", "Result", future.Response(), "Polling failure") 20101 return 20102 } 20103 if !done { 20104 ar.Response = future.Response() 20105 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsReimageFuture") 20106 return 20107 } 20108 ar.Response = future.Response() 20109 return 20110} 20111 20112// VirtualMachineScaleSetsRestartFuture an abstraction for monitoring and retrieving the results of a 20113// long-running operation. 20114type VirtualMachineScaleSetsRestartFuture struct { 20115 azure.FutureAPI 20116 // Result returns the result of the asynchronous operation. 20117 // If the operation has not completed it will return an error. 20118 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 20119} 20120 20121// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20122func (future *VirtualMachineScaleSetsRestartFuture) UnmarshalJSON(body []byte) error { 20123 var azFuture azure.Future 20124 if err := json.Unmarshal(body, &azFuture); err != nil { 20125 return err 20126 } 20127 future.FutureAPI = &azFuture 20128 future.Result = future.result 20129 return nil 20130} 20131 20132// result is the default implementation for VirtualMachineScaleSetsRestartFuture.Result. 20133func (future *VirtualMachineScaleSetsRestartFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 20134 var done bool 20135 done, err = future.DoneWithContext(context.Background(), client) 20136 if err != nil { 20137 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsRestartFuture", "Result", future.Response(), "Polling failure") 20138 return 20139 } 20140 if !done { 20141 ar.Response = future.Response() 20142 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsRestartFuture") 20143 return 20144 } 20145 ar.Response = future.Response() 20146 return 20147} 20148 20149// VirtualMachineScaleSetsSetOrchestrationServiceStateFuture an abstraction for monitoring and retrieving 20150// the results of a long-running operation. 20151type VirtualMachineScaleSetsSetOrchestrationServiceStateFuture struct { 20152 azure.FutureAPI 20153 // Result returns the result of the asynchronous operation. 20154 // If the operation has not completed it will return an error. 20155 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 20156} 20157 20158// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20159func (future *VirtualMachineScaleSetsSetOrchestrationServiceStateFuture) UnmarshalJSON(body []byte) error { 20160 var azFuture azure.Future 20161 if err := json.Unmarshal(body, &azFuture); err != nil { 20162 return err 20163 } 20164 future.FutureAPI = &azFuture 20165 future.Result = future.result 20166 return nil 20167} 20168 20169// result is the default implementation for VirtualMachineScaleSetsSetOrchestrationServiceStateFuture.Result. 20170func (future *VirtualMachineScaleSetsSetOrchestrationServiceStateFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 20171 var done bool 20172 done, err = future.DoneWithContext(context.Background(), client) 20173 if err != nil { 20174 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsSetOrchestrationServiceStateFuture", "Result", future.Response(), "Polling failure") 20175 return 20176 } 20177 if !done { 20178 ar.Response = future.Response() 20179 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsSetOrchestrationServiceStateFuture") 20180 return 20181 } 20182 ar.Response = future.Response() 20183 return 20184} 20185 20186// VirtualMachineScaleSetsStartFuture an abstraction for monitoring and retrieving the results of a 20187// long-running operation. 20188type VirtualMachineScaleSetsStartFuture struct { 20189 azure.FutureAPI 20190 // Result returns the result of the asynchronous operation. 20191 // If the operation has not completed it will return an error. 20192 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 20193} 20194 20195// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20196func (future *VirtualMachineScaleSetsStartFuture) UnmarshalJSON(body []byte) error { 20197 var azFuture azure.Future 20198 if err := json.Unmarshal(body, &azFuture); err != nil { 20199 return err 20200 } 20201 future.FutureAPI = &azFuture 20202 future.Result = future.result 20203 return nil 20204} 20205 20206// result is the default implementation for VirtualMachineScaleSetsStartFuture.Result. 20207func (future *VirtualMachineScaleSetsStartFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 20208 var done bool 20209 done, err = future.DoneWithContext(context.Background(), client) 20210 if err != nil { 20211 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsStartFuture", "Result", future.Response(), "Polling failure") 20212 return 20213 } 20214 if !done { 20215 ar.Response = future.Response() 20216 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsStartFuture") 20217 return 20218 } 20219 ar.Response = future.Response() 20220 return 20221} 20222 20223// VirtualMachineScaleSetStorageProfile describes a virtual machine scale set storage profile. 20224type VirtualMachineScaleSetStorageProfile struct { 20225 // 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. 20226 ImageReference *ImageReference `json:"imageReference,omitempty"` 20227 // 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). 20228 OsDisk *VirtualMachineScaleSetOSDisk `json:"osDisk,omitempty"` 20229 // 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). 20230 DataDisks *[]VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"` 20231} 20232 20233// VirtualMachineScaleSetsUpdateFuture an abstraction for monitoring and retrieving the results of a 20234// long-running operation. 20235type VirtualMachineScaleSetsUpdateFuture struct { 20236 azure.FutureAPI 20237 // Result returns the result of the asynchronous operation. 20238 // If the operation has not completed it will return an error. 20239 Result func(VirtualMachineScaleSetsClient) (VirtualMachineScaleSet, error) 20240} 20241 20242// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20243func (future *VirtualMachineScaleSetsUpdateFuture) UnmarshalJSON(body []byte) error { 20244 var azFuture azure.Future 20245 if err := json.Unmarshal(body, &azFuture); err != nil { 20246 return err 20247 } 20248 future.FutureAPI = &azFuture 20249 future.Result = future.result 20250 return nil 20251} 20252 20253// result is the default implementation for VirtualMachineScaleSetsUpdateFuture.Result. 20254func (future *VirtualMachineScaleSetsUpdateFuture) result(client VirtualMachineScaleSetsClient) (vmss VirtualMachineScaleSet, err error) { 20255 var done bool 20256 done, err = future.DoneWithContext(context.Background(), client) 20257 if err != nil { 20258 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateFuture", "Result", future.Response(), "Polling failure") 20259 return 20260 } 20261 if !done { 20262 vmss.Response.Response = future.Response() 20263 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsUpdateFuture") 20264 return 20265 } 20266 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 20267 if vmss.Response.Response, err = future.GetResult(sender); err == nil && vmss.Response.Response.StatusCode != http.StatusNoContent { 20268 vmss, err = client.UpdateResponder(vmss.Response.Response) 20269 if err != nil { 20270 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateFuture", "Result", vmss.Response.Response, "Failure responding to request") 20271 } 20272 } 20273 return 20274} 20275 20276// VirtualMachineScaleSetsUpdateInstancesFuture an abstraction for monitoring and retrieving the results of 20277// a long-running operation. 20278type VirtualMachineScaleSetsUpdateInstancesFuture struct { 20279 azure.FutureAPI 20280 // Result returns the result of the asynchronous operation. 20281 // If the operation has not completed it will return an error. 20282 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 20283} 20284 20285// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20286func (future *VirtualMachineScaleSetsUpdateInstancesFuture) UnmarshalJSON(body []byte) error { 20287 var azFuture azure.Future 20288 if err := json.Unmarshal(body, &azFuture); err != nil { 20289 return err 20290 } 20291 future.FutureAPI = &azFuture 20292 future.Result = future.result 20293 return nil 20294} 20295 20296// result is the default implementation for VirtualMachineScaleSetsUpdateInstancesFuture.Result. 20297func (future *VirtualMachineScaleSetsUpdateInstancesFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 20298 var done bool 20299 done, err = future.DoneWithContext(context.Background(), client) 20300 if err != nil { 20301 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateInstancesFuture", "Result", future.Response(), "Polling failure") 20302 return 20303 } 20304 if !done { 20305 ar.Response = future.Response() 20306 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsUpdateInstancesFuture") 20307 return 20308 } 20309 ar.Response = future.Response() 20310 return 20311} 20312 20313// VirtualMachineScaleSetUpdate describes a Virtual Machine Scale Set. 20314type VirtualMachineScaleSetUpdate struct { 20315 // Sku - The virtual machine scale set sku. 20316 Sku *Sku `json:"sku,omitempty"` 20317 // Plan - The purchase plan when deploying a virtual machine scale set from VM Marketplace images. 20318 Plan *Plan `json:"plan,omitempty"` 20319 *VirtualMachineScaleSetUpdateProperties `json:"properties,omitempty"` 20320 // Identity - The identity of the virtual machine scale set, if configured. 20321 Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"` 20322 // Tags - Resource tags 20323 Tags map[string]*string `json:"tags"` 20324} 20325 20326// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdate. 20327func (vmssu VirtualMachineScaleSetUpdate) MarshalJSON() ([]byte, error) { 20328 objectMap := make(map[string]interface{}) 20329 if vmssu.Sku != nil { 20330 objectMap["sku"] = vmssu.Sku 20331 } 20332 if vmssu.Plan != nil { 20333 objectMap["plan"] = vmssu.Plan 20334 } 20335 if vmssu.VirtualMachineScaleSetUpdateProperties != nil { 20336 objectMap["properties"] = vmssu.VirtualMachineScaleSetUpdateProperties 20337 } 20338 if vmssu.Identity != nil { 20339 objectMap["identity"] = vmssu.Identity 20340 } 20341 if vmssu.Tags != nil { 20342 objectMap["tags"] = vmssu.Tags 20343 } 20344 return json.Marshal(objectMap) 20345} 20346 20347// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdate struct. 20348func (vmssu *VirtualMachineScaleSetUpdate) UnmarshalJSON(body []byte) error { 20349 var m map[string]*json.RawMessage 20350 err := json.Unmarshal(body, &m) 20351 if err != nil { 20352 return err 20353 } 20354 for k, v := range m { 20355 switch k { 20356 case "sku": 20357 if v != nil { 20358 var sku Sku 20359 err = json.Unmarshal(*v, &sku) 20360 if err != nil { 20361 return err 20362 } 20363 vmssu.Sku = &sku 20364 } 20365 case "plan": 20366 if v != nil { 20367 var plan Plan 20368 err = json.Unmarshal(*v, &plan) 20369 if err != nil { 20370 return err 20371 } 20372 vmssu.Plan = &plan 20373 } 20374 case "properties": 20375 if v != nil { 20376 var virtualMachineScaleSetUpdateProperties VirtualMachineScaleSetUpdateProperties 20377 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateProperties) 20378 if err != nil { 20379 return err 20380 } 20381 vmssu.VirtualMachineScaleSetUpdateProperties = &virtualMachineScaleSetUpdateProperties 20382 } 20383 case "identity": 20384 if v != nil { 20385 var identity VirtualMachineScaleSetIdentity 20386 err = json.Unmarshal(*v, &identity) 20387 if err != nil { 20388 return err 20389 } 20390 vmssu.Identity = &identity 20391 } 20392 case "tags": 20393 if v != nil { 20394 var tags map[string]*string 20395 err = json.Unmarshal(*v, &tags) 20396 if err != nil { 20397 return err 20398 } 20399 vmssu.Tags = tags 20400 } 20401 } 20402 } 20403 20404 return nil 20405} 20406 20407// VirtualMachineScaleSetUpdateIPConfiguration describes a virtual machine scale set network profile's IP 20408// configuration. NOTE: The subnet of a scale set may be modified as long as the original subnet and the 20409// new subnet are in the same virtual network 20410type VirtualMachineScaleSetUpdateIPConfiguration struct { 20411 // Name - The IP configuration name. 20412 Name *string `json:"name,omitempty"` 20413 *VirtualMachineScaleSetUpdateIPConfigurationProperties `json:"properties,omitempty"` 20414 // ID - Resource Id 20415 ID *string `json:"id,omitempty"` 20416} 20417 20418// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdateIPConfiguration. 20419func (vmssuic VirtualMachineScaleSetUpdateIPConfiguration) MarshalJSON() ([]byte, error) { 20420 objectMap := make(map[string]interface{}) 20421 if vmssuic.Name != nil { 20422 objectMap["name"] = vmssuic.Name 20423 } 20424 if vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties != nil { 20425 objectMap["properties"] = vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties 20426 } 20427 if vmssuic.ID != nil { 20428 objectMap["id"] = vmssuic.ID 20429 } 20430 return json.Marshal(objectMap) 20431} 20432 20433// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdateIPConfiguration struct. 20434func (vmssuic *VirtualMachineScaleSetUpdateIPConfiguration) UnmarshalJSON(body []byte) error { 20435 var m map[string]*json.RawMessage 20436 err := json.Unmarshal(body, &m) 20437 if err != nil { 20438 return err 20439 } 20440 for k, v := range m { 20441 switch k { 20442 case "name": 20443 if v != nil { 20444 var name string 20445 err = json.Unmarshal(*v, &name) 20446 if err != nil { 20447 return err 20448 } 20449 vmssuic.Name = &name 20450 } 20451 case "properties": 20452 if v != nil { 20453 var virtualMachineScaleSetUpdateIPConfigurationProperties VirtualMachineScaleSetUpdateIPConfigurationProperties 20454 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateIPConfigurationProperties) 20455 if err != nil { 20456 return err 20457 } 20458 vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties = &virtualMachineScaleSetUpdateIPConfigurationProperties 20459 } 20460 case "id": 20461 if v != nil { 20462 var ID string 20463 err = json.Unmarshal(*v, &ID) 20464 if err != nil { 20465 return err 20466 } 20467 vmssuic.ID = &ID 20468 } 20469 } 20470 } 20471 20472 return nil 20473} 20474 20475// VirtualMachineScaleSetUpdateIPConfigurationProperties describes a virtual machine scale set network 20476// profile's IP configuration properties. 20477type VirtualMachineScaleSetUpdateIPConfigurationProperties struct { 20478 // Subnet - The subnet. 20479 Subnet *APIEntityReference `json:"subnet,omitempty"` 20480 // Primary - Specifies the primary IP Configuration in case the network interface has more than one IP Configuration. 20481 Primary *bool `json:"primary,omitempty"` 20482 // PublicIPAddressConfiguration - The publicIPAddressConfiguration. 20483 PublicIPAddressConfiguration *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` 20484 // 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' 20485 PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` 20486 // ApplicationGatewayBackendAddressPools - The application gateway backend address pools. 20487 ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` 20488 // ApplicationSecurityGroups - Specifies an array of references to application security group. 20489 ApplicationSecurityGroups *[]SubResource `json:"applicationSecurityGroups,omitempty"` 20490 // LoadBalancerBackendAddressPools - The load balancer backend address pools. 20491 LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` 20492 // LoadBalancerInboundNatPools - The load balancer inbound nat pools. 20493 LoadBalancerInboundNatPools *[]SubResource `json:"loadBalancerInboundNatPools,omitempty"` 20494} 20495 20496// VirtualMachineScaleSetUpdateNetworkConfiguration describes a virtual machine scale set network profile's 20497// network configurations. 20498type VirtualMachineScaleSetUpdateNetworkConfiguration struct { 20499 // Name - The network configuration name. 20500 Name *string `json:"name,omitempty"` 20501 *VirtualMachineScaleSetUpdateNetworkConfigurationProperties `json:"properties,omitempty"` 20502 // ID - Resource Id 20503 ID *string `json:"id,omitempty"` 20504} 20505 20506// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdateNetworkConfiguration. 20507func (vmssunc VirtualMachineScaleSetUpdateNetworkConfiguration) MarshalJSON() ([]byte, error) { 20508 objectMap := make(map[string]interface{}) 20509 if vmssunc.Name != nil { 20510 objectMap["name"] = vmssunc.Name 20511 } 20512 if vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties != nil { 20513 objectMap["properties"] = vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties 20514 } 20515 if vmssunc.ID != nil { 20516 objectMap["id"] = vmssunc.ID 20517 } 20518 return json.Marshal(objectMap) 20519} 20520 20521// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdateNetworkConfiguration struct. 20522func (vmssunc *VirtualMachineScaleSetUpdateNetworkConfiguration) UnmarshalJSON(body []byte) error { 20523 var m map[string]*json.RawMessage 20524 err := json.Unmarshal(body, &m) 20525 if err != nil { 20526 return err 20527 } 20528 for k, v := range m { 20529 switch k { 20530 case "name": 20531 if v != nil { 20532 var name string 20533 err = json.Unmarshal(*v, &name) 20534 if err != nil { 20535 return err 20536 } 20537 vmssunc.Name = &name 20538 } 20539 case "properties": 20540 if v != nil { 20541 var virtualMachineScaleSetUpdateNetworkConfigurationProperties VirtualMachineScaleSetUpdateNetworkConfigurationProperties 20542 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateNetworkConfigurationProperties) 20543 if err != nil { 20544 return err 20545 } 20546 vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties = &virtualMachineScaleSetUpdateNetworkConfigurationProperties 20547 } 20548 case "id": 20549 if v != nil { 20550 var ID string 20551 err = json.Unmarshal(*v, &ID) 20552 if err != nil { 20553 return err 20554 } 20555 vmssunc.ID = &ID 20556 } 20557 } 20558 } 20559 20560 return nil 20561} 20562 20563// VirtualMachineScaleSetUpdateNetworkConfigurationProperties describes a virtual machine scale set 20564// updatable network profile's IP configuration.Use this object for updating network profile's IP 20565// Configuration. 20566type VirtualMachineScaleSetUpdateNetworkConfigurationProperties struct { 20567 // Primary - Whether this is a primary NIC on a virtual machine. 20568 Primary *bool `json:"primary,omitempty"` 20569 // EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled. 20570 EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` 20571 // EnableFpga - Specifies whether the network interface is FPGA networking-enabled. 20572 EnableFpga *bool `json:"enableFpga,omitempty"` 20573 // NetworkSecurityGroup - The network security group. 20574 NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` 20575 // DNSSettings - The dns settings to be applied on the network interfaces. 20576 DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings `json:"dnsSettings,omitempty"` 20577 // IPConfigurations - The virtual machine scale set IP Configuration. 20578 IPConfigurations *[]VirtualMachineScaleSetUpdateIPConfiguration `json:"ipConfigurations,omitempty"` 20579 // EnableIPForwarding - Whether IP forwarding enabled on this NIC. 20580 EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` 20581 // DeleteOption - Specify what happens to the network interface when the VM is deleted. Possible values include: 'DeleteOptionsDelete', 'DeleteOptionsDetach' 20582 DeleteOption DeleteOptions `json:"deleteOption,omitempty"` 20583} 20584 20585// VirtualMachineScaleSetUpdateNetworkProfile describes a virtual machine scale set network profile. 20586type VirtualMachineScaleSetUpdateNetworkProfile struct { 20587 // 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}'. 20588 HealthProbe *APIEntityReference `json:"healthProbe,omitempty"` 20589 // NetworkInterfaceConfigurations - The list of network configurations. 20590 NetworkInterfaceConfigurations *[]VirtualMachineScaleSetUpdateNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` 20591 // 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' 20592 NetworkAPIVersion NetworkAPIVersion `json:"networkApiVersion,omitempty"` 20593} 20594 20595// VirtualMachineScaleSetUpdateOSDisk describes virtual machine scale set operating system disk Update 20596// Object. This should be used for Updating VMSS OS Disk. 20597type VirtualMachineScaleSetUpdateOSDisk struct { 20598 // Caching - The caching type. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' 20599 Caching CachingTypes `json:"caching,omitempty"` 20600 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 20601 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 20602 // 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 20603 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 20604 // 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. 20605 Image *VirtualHardDisk `json:"image,omitempty"` 20606 // VhdContainers - The list of virtual hard disk container uris. 20607 VhdContainers *[]string `json:"vhdContainers,omitempty"` 20608 // ManagedDisk - The managed disk parameters. 20609 ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` 20610} 20611 20612// VirtualMachineScaleSetUpdateOSProfile describes a virtual machine scale set OS profile. 20613type VirtualMachineScaleSetUpdateOSProfile struct { 20614 // CustomData - A base-64 encoded string of custom data. 20615 CustomData *string `json:"customData,omitempty"` 20616 // WindowsConfiguration - The Windows Configuration of the OS profile. 20617 WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` 20618 // LinuxConfiguration - The Linux Configuration of the OS profile. 20619 LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` 20620 // Secrets - The List of certificates for addition to the VM. 20621 Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` 20622} 20623 20624// VirtualMachineScaleSetUpdateProperties describes the properties of a Virtual Machine Scale Set. 20625type VirtualMachineScaleSetUpdateProperties struct { 20626 // UpgradePolicy - The upgrade policy. 20627 UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` 20628 // AutomaticRepairsPolicy - Policy for automatic repairs. 20629 AutomaticRepairsPolicy *AutomaticRepairsPolicy `json:"automaticRepairsPolicy,omitempty"` 20630 // VirtualMachineProfile - The virtual machine profile. 20631 VirtualMachineProfile *VirtualMachineScaleSetUpdateVMProfile `json:"virtualMachineProfile,omitempty"` 20632 // Overprovision - Specifies whether the Virtual Machine Scale Set should be overprovisioned. 20633 Overprovision *bool `json:"overprovision,omitempty"` 20634 // 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. 20635 DoNotRunExtensionsOnOverprovisionedVMs *bool `json:"doNotRunExtensionsOnOverprovisionedVMs,omitempty"` 20636 // 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. 20637 SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"` 20638 // 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. 20639 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 20640 // ScaleInPolicy - Specifies the scale-in policy that decides which virtual machines are chosen for removal when a Virtual Machine Scale Set is scaled-in. 20641 ScaleInPolicy *ScaleInPolicy `json:"scaleInPolicy,omitempty"` 20642 // 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. 20643 ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` 20644} 20645 20646// VirtualMachineScaleSetUpdatePublicIPAddressConfiguration describes a virtual machines scale set IP 20647// Configuration's PublicIPAddress configuration 20648type VirtualMachineScaleSetUpdatePublicIPAddressConfiguration struct { 20649 // Name - The publicIP address configuration name. 20650 Name *string `json:"name,omitempty"` 20651 *VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties `json:"properties,omitempty"` 20652} 20653 20654// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdatePublicIPAddressConfiguration. 20655func (vmssupiac VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { 20656 objectMap := make(map[string]interface{}) 20657 if vmssupiac.Name != nil { 20658 objectMap["name"] = vmssupiac.Name 20659 } 20660 if vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties != nil { 20661 objectMap["properties"] = vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties 20662 } 20663 return json.Marshal(objectMap) 20664} 20665 20666// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdatePublicIPAddressConfiguration struct. 20667func (vmssupiac *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) UnmarshalJSON(body []byte) error { 20668 var m map[string]*json.RawMessage 20669 err := json.Unmarshal(body, &m) 20670 if err != nil { 20671 return err 20672 } 20673 for k, v := range m { 20674 switch k { 20675 case "name": 20676 if v != nil { 20677 var name string 20678 err = json.Unmarshal(*v, &name) 20679 if err != nil { 20680 return err 20681 } 20682 vmssupiac.Name = &name 20683 } 20684 case "properties": 20685 if v != nil { 20686 var virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties 20687 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties) 20688 if err != nil { 20689 return err 20690 } 20691 vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties = &virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties 20692 } 20693 } 20694 } 20695 20696 return nil 20697} 20698 20699// VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties describes a virtual machines scale 20700// set IP Configuration's PublicIPAddress configuration 20701type VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties struct { 20702 // IdleTimeoutInMinutes - The idle timeout of the public IP address. 20703 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` 20704 // DNSSettings - The dns settings to be applied on the publicIP addresses . 20705 DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings `json:"dnsSettings,omitempty"` 20706 // DeleteOption - Specify what happens to the public IP when the VM is deleted. Possible values include: 'DeleteOptionsDelete', 'DeleteOptionsDetach' 20707 DeleteOption DeleteOptions `json:"deleteOption,omitempty"` 20708} 20709 20710// VirtualMachineScaleSetUpdateStorageProfile describes a virtual machine scale set storage profile. 20711type VirtualMachineScaleSetUpdateStorageProfile struct { 20712 // ImageReference - The image reference. 20713 ImageReference *ImageReference `json:"imageReference,omitempty"` 20714 // OsDisk - The OS disk. 20715 OsDisk *VirtualMachineScaleSetUpdateOSDisk `json:"osDisk,omitempty"` 20716 // DataDisks - The data disks. 20717 DataDisks *[]VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"` 20718} 20719 20720// VirtualMachineScaleSetUpdateVMProfile describes a virtual machine scale set virtual machine profile. 20721type VirtualMachineScaleSetUpdateVMProfile struct { 20722 // OsProfile - The virtual machine scale set OS profile. 20723 OsProfile *VirtualMachineScaleSetUpdateOSProfile `json:"osProfile,omitempty"` 20724 // StorageProfile - The virtual machine scale set storage profile. 20725 StorageProfile *VirtualMachineScaleSetUpdateStorageProfile `json:"storageProfile,omitempty"` 20726 // NetworkProfile - The virtual machine scale set network profile. 20727 NetworkProfile *VirtualMachineScaleSetUpdateNetworkProfile `json:"networkProfile,omitempty"` 20728 // SecurityProfile - The virtual machine scale set Security profile 20729 SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` 20730 // DiagnosticsProfile - The virtual machine scale set diagnostics profile. 20731 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 20732 // ExtensionProfile - The virtual machine scale set extension profile. 20733 ExtensionProfile *VirtualMachineScaleSetExtensionProfile `json:"extensionProfile,omitempty"` 20734 // LicenseType - The license type, which is for bring your own license scenario. 20735 LicenseType *string `json:"licenseType,omitempty"` 20736 // BillingProfile - Specifies the billing related details of a Azure Spot VMSS. <br><br>Minimum api-version: 2019-03-01. 20737 BillingProfile *BillingProfile `json:"billingProfile,omitempty"` 20738 // ScheduledEventsProfile - Specifies Scheduled Event related configurations. 20739 ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` 20740 // 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 20741 UserData *string `json:"userData,omitempty"` 20742} 20743 20744// VirtualMachineScaleSetVM describes a virtual machine scale set virtual machine. 20745type VirtualMachineScaleSetVM struct { 20746 autorest.Response `json:"-"` 20747 // InstanceID - READ-ONLY; The virtual machine instance ID. 20748 InstanceID *string `json:"instanceId,omitempty"` 20749 // Sku - READ-ONLY; The virtual machine SKU. 20750 Sku *Sku `json:"sku,omitempty"` 20751 *VirtualMachineScaleSetVMProperties `json:"properties,omitempty"` 20752 // 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**. 20753 Plan *Plan `json:"plan,omitempty"` 20754 // Resources - READ-ONLY; The virtual machine child extension resources. 20755 Resources *[]VirtualMachineExtension `json:"resources,omitempty"` 20756 // Zones - READ-ONLY; The virtual machine zones. 20757 Zones *[]string `json:"zones,omitempty"` 20758 // ID - READ-ONLY; Resource Id 20759 ID *string `json:"id,omitempty"` 20760 // Name - READ-ONLY; Resource name 20761 Name *string `json:"name,omitempty"` 20762 // Type - READ-ONLY; Resource type 20763 Type *string `json:"type,omitempty"` 20764 // Location - Resource location 20765 Location *string `json:"location,omitempty"` 20766 // Tags - Resource tags 20767 Tags map[string]*string `json:"tags"` 20768} 20769 20770// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVM. 20771func (vmssv VirtualMachineScaleSetVM) MarshalJSON() ([]byte, error) { 20772 objectMap := make(map[string]interface{}) 20773 if vmssv.VirtualMachineScaleSetVMProperties != nil { 20774 objectMap["properties"] = vmssv.VirtualMachineScaleSetVMProperties 20775 } 20776 if vmssv.Plan != nil { 20777 objectMap["plan"] = vmssv.Plan 20778 } 20779 if vmssv.Location != nil { 20780 objectMap["location"] = vmssv.Location 20781 } 20782 if vmssv.Tags != nil { 20783 objectMap["tags"] = vmssv.Tags 20784 } 20785 return json.Marshal(objectMap) 20786} 20787 20788// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetVM struct. 20789func (vmssv *VirtualMachineScaleSetVM) UnmarshalJSON(body []byte) error { 20790 var m map[string]*json.RawMessage 20791 err := json.Unmarshal(body, &m) 20792 if err != nil { 20793 return err 20794 } 20795 for k, v := range m { 20796 switch k { 20797 case "instanceId": 20798 if v != nil { 20799 var instanceID string 20800 err = json.Unmarshal(*v, &instanceID) 20801 if err != nil { 20802 return err 20803 } 20804 vmssv.InstanceID = &instanceID 20805 } 20806 case "sku": 20807 if v != nil { 20808 var sku Sku 20809 err = json.Unmarshal(*v, &sku) 20810 if err != nil { 20811 return err 20812 } 20813 vmssv.Sku = &sku 20814 } 20815 case "properties": 20816 if v != nil { 20817 var virtualMachineScaleSetVMProperties VirtualMachineScaleSetVMProperties 20818 err = json.Unmarshal(*v, &virtualMachineScaleSetVMProperties) 20819 if err != nil { 20820 return err 20821 } 20822 vmssv.VirtualMachineScaleSetVMProperties = &virtualMachineScaleSetVMProperties 20823 } 20824 case "plan": 20825 if v != nil { 20826 var plan Plan 20827 err = json.Unmarshal(*v, &plan) 20828 if err != nil { 20829 return err 20830 } 20831 vmssv.Plan = &plan 20832 } 20833 case "resources": 20834 if v != nil { 20835 var resources []VirtualMachineExtension 20836 err = json.Unmarshal(*v, &resources) 20837 if err != nil { 20838 return err 20839 } 20840 vmssv.Resources = &resources 20841 } 20842 case "zones": 20843 if v != nil { 20844 var zones []string 20845 err = json.Unmarshal(*v, &zones) 20846 if err != nil { 20847 return err 20848 } 20849 vmssv.Zones = &zones 20850 } 20851 case "id": 20852 if v != nil { 20853 var ID string 20854 err = json.Unmarshal(*v, &ID) 20855 if err != nil { 20856 return err 20857 } 20858 vmssv.ID = &ID 20859 } 20860 case "name": 20861 if v != nil { 20862 var name string 20863 err = json.Unmarshal(*v, &name) 20864 if err != nil { 20865 return err 20866 } 20867 vmssv.Name = &name 20868 } 20869 case "type": 20870 if v != nil { 20871 var typeVar string 20872 err = json.Unmarshal(*v, &typeVar) 20873 if err != nil { 20874 return err 20875 } 20876 vmssv.Type = &typeVar 20877 } 20878 case "location": 20879 if v != nil { 20880 var location string 20881 err = json.Unmarshal(*v, &location) 20882 if err != nil { 20883 return err 20884 } 20885 vmssv.Location = &location 20886 } 20887 case "tags": 20888 if v != nil { 20889 var tags map[string]*string 20890 err = json.Unmarshal(*v, &tags) 20891 if err != nil { 20892 return err 20893 } 20894 vmssv.Tags = tags 20895 } 20896 } 20897 } 20898 20899 return nil 20900} 20901 20902// VirtualMachineScaleSetVMExtension describes a VMSS VM Extension. 20903type VirtualMachineScaleSetVMExtension struct { 20904 autorest.Response `json:"-"` 20905 // Name - READ-ONLY; The name of the extension. 20906 Name *string `json:"name,omitempty"` 20907 // Type - READ-ONLY; Resource type 20908 Type *string `json:"type,omitempty"` 20909 *VirtualMachineExtensionProperties `json:"properties,omitempty"` 20910 // ID - READ-ONLY; Resource Id 20911 ID *string `json:"id,omitempty"` 20912} 20913 20914// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMExtension. 20915func (vmssve VirtualMachineScaleSetVMExtension) MarshalJSON() ([]byte, error) { 20916 objectMap := make(map[string]interface{}) 20917 if vmssve.VirtualMachineExtensionProperties != nil { 20918 objectMap["properties"] = vmssve.VirtualMachineExtensionProperties 20919 } 20920 return json.Marshal(objectMap) 20921} 20922 20923// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetVMExtension struct. 20924func (vmssve *VirtualMachineScaleSetVMExtension) UnmarshalJSON(body []byte) error { 20925 var m map[string]*json.RawMessage 20926 err := json.Unmarshal(body, &m) 20927 if err != nil { 20928 return err 20929 } 20930 for k, v := range m { 20931 switch k { 20932 case "name": 20933 if v != nil { 20934 var name string 20935 err = json.Unmarshal(*v, &name) 20936 if err != nil { 20937 return err 20938 } 20939 vmssve.Name = &name 20940 } 20941 case "type": 20942 if v != nil { 20943 var typeVar string 20944 err = json.Unmarshal(*v, &typeVar) 20945 if err != nil { 20946 return err 20947 } 20948 vmssve.Type = &typeVar 20949 } 20950 case "properties": 20951 if v != nil { 20952 var virtualMachineExtensionProperties VirtualMachineExtensionProperties 20953 err = json.Unmarshal(*v, &virtualMachineExtensionProperties) 20954 if err != nil { 20955 return err 20956 } 20957 vmssve.VirtualMachineExtensionProperties = &virtualMachineExtensionProperties 20958 } 20959 case "id": 20960 if v != nil { 20961 var ID string 20962 err = json.Unmarshal(*v, &ID) 20963 if err != nil { 20964 return err 20965 } 20966 vmssve.ID = &ID 20967 } 20968 } 20969 } 20970 20971 return nil 20972} 20973 20974// VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the 20975// results of a long-running operation. 20976type VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture struct { 20977 azure.FutureAPI 20978 // Result returns the result of the asynchronous operation. 20979 // If the operation has not completed it will return an error. 20980 Result func(VirtualMachineScaleSetVMExtensionsClient) (VirtualMachineScaleSetVMExtension, error) 20981} 20982 20983// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20984func (future *VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 20985 var azFuture azure.Future 20986 if err := json.Unmarshal(body, &azFuture); err != nil { 20987 return err 20988 } 20989 future.FutureAPI = &azFuture 20990 future.Result = future.result 20991 return nil 20992} 20993 20994// result is the default implementation for VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture.Result. 20995func (future *VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture) result(client VirtualMachineScaleSetVMExtensionsClient) (vmssve VirtualMachineScaleSetVMExtension, err error) { 20996 var done bool 20997 done, err = future.DoneWithContext(context.Background(), client) 20998 if err != nil { 20999 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 21000 return 21001 } 21002 if !done { 21003 vmssve.Response.Response = future.Response() 21004 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture") 21005 return 21006 } 21007 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 21008 if vmssve.Response.Response, err = future.GetResult(sender); err == nil && vmssve.Response.Response.StatusCode != http.StatusNoContent { 21009 vmssve, err = client.CreateOrUpdateResponder(vmssve.Response.Response) 21010 if err != nil { 21011 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture", "Result", vmssve.Response.Response, "Failure responding to request") 21012 } 21013 } 21014 return 21015} 21016 21017// VirtualMachineScaleSetVMExtensionsDeleteFuture an abstraction for monitoring and retrieving the results 21018// of a long-running operation. 21019type VirtualMachineScaleSetVMExtensionsDeleteFuture struct { 21020 azure.FutureAPI 21021 // Result returns the result of the asynchronous operation. 21022 // If the operation has not completed it will return an error. 21023 Result func(VirtualMachineScaleSetVMExtensionsClient) (autorest.Response, error) 21024} 21025 21026// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21027func (future *VirtualMachineScaleSetVMExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { 21028 var azFuture azure.Future 21029 if err := json.Unmarshal(body, &azFuture); err != nil { 21030 return err 21031 } 21032 future.FutureAPI = &azFuture 21033 future.Result = future.result 21034 return nil 21035} 21036 21037// result is the default implementation for VirtualMachineScaleSetVMExtensionsDeleteFuture.Result. 21038func (future *VirtualMachineScaleSetVMExtensionsDeleteFuture) result(client VirtualMachineScaleSetVMExtensionsClient) (ar autorest.Response, err error) { 21039 var done bool 21040 done, err = future.DoneWithContext(context.Background(), client) 21041 if err != nil { 21042 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") 21043 return 21044 } 21045 if !done { 21046 ar.Response = future.Response() 21047 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsDeleteFuture") 21048 return 21049 } 21050 ar.Response = future.Response() 21051 return 21052} 21053 21054// VirtualMachineScaleSetVMExtensionsListResult the List VMSS VM Extension operation response 21055type VirtualMachineScaleSetVMExtensionsListResult struct { 21056 autorest.Response `json:"-"` 21057 // Value - The list of VMSS VM extensions 21058 Value *[]VirtualMachineScaleSetVMExtension `json:"value,omitempty"` 21059} 21060 21061// VirtualMachineScaleSetVMExtensionsSummary extensions summary for virtual machines of a virtual machine 21062// scale set. 21063type VirtualMachineScaleSetVMExtensionsSummary struct { 21064 // Name - READ-ONLY; The extension name. 21065 Name *string `json:"name,omitempty"` 21066 // StatusesSummary - READ-ONLY; The extensions information. 21067 StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` 21068} 21069 21070// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMExtensionsSummary. 21071func (vmssves VirtualMachineScaleSetVMExtensionsSummary) MarshalJSON() ([]byte, error) { 21072 objectMap := make(map[string]interface{}) 21073 return json.Marshal(objectMap) 21074} 21075 21076// VirtualMachineScaleSetVMExtensionsUpdateFuture an abstraction for monitoring and retrieving the results 21077// of a long-running operation. 21078type VirtualMachineScaleSetVMExtensionsUpdateFuture struct { 21079 azure.FutureAPI 21080 // Result returns the result of the asynchronous operation. 21081 // If the operation has not completed it will return an error. 21082 Result func(VirtualMachineScaleSetVMExtensionsClient) (VirtualMachineScaleSetVMExtension, error) 21083} 21084 21085// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21086func (future *VirtualMachineScaleSetVMExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { 21087 var azFuture azure.Future 21088 if err := json.Unmarshal(body, &azFuture); err != nil { 21089 return err 21090 } 21091 future.FutureAPI = &azFuture 21092 future.Result = future.result 21093 return nil 21094} 21095 21096// result is the default implementation for VirtualMachineScaleSetVMExtensionsUpdateFuture.Result. 21097func (future *VirtualMachineScaleSetVMExtensionsUpdateFuture) result(client VirtualMachineScaleSetVMExtensionsClient) (vmssve VirtualMachineScaleSetVMExtension, err error) { 21098 var done bool 21099 done, err = future.DoneWithContext(context.Background(), client) 21100 if err != nil { 21101 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsUpdateFuture", "Result", future.Response(), "Polling failure") 21102 return 21103 } 21104 if !done { 21105 vmssve.Response.Response = future.Response() 21106 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsUpdateFuture") 21107 return 21108 } 21109 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 21110 if vmssve.Response.Response, err = future.GetResult(sender); err == nil && vmssve.Response.Response.StatusCode != http.StatusNoContent { 21111 vmssve, err = client.UpdateResponder(vmssve.Response.Response) 21112 if err != nil { 21113 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsUpdateFuture", "Result", vmssve.Response.Response, "Failure responding to request") 21114 } 21115 } 21116 return 21117} 21118 21119// VirtualMachineScaleSetVMExtensionUpdate describes a VMSS VM Extension. 21120type VirtualMachineScaleSetVMExtensionUpdate struct { 21121 // Name - READ-ONLY; The name of the extension. 21122 Name *string `json:"name,omitempty"` 21123 // Type - READ-ONLY; Resource type 21124 Type *string `json:"type,omitempty"` 21125 *VirtualMachineExtensionUpdateProperties `json:"properties,omitempty"` 21126 // ID - READ-ONLY; Resource Id 21127 ID *string `json:"id,omitempty"` 21128} 21129 21130// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMExtensionUpdate. 21131func (vmssveu VirtualMachineScaleSetVMExtensionUpdate) MarshalJSON() ([]byte, error) { 21132 objectMap := make(map[string]interface{}) 21133 if vmssveu.VirtualMachineExtensionUpdateProperties != nil { 21134 objectMap["properties"] = vmssveu.VirtualMachineExtensionUpdateProperties 21135 } 21136 return json.Marshal(objectMap) 21137} 21138 21139// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetVMExtensionUpdate struct. 21140func (vmssveu *VirtualMachineScaleSetVMExtensionUpdate) UnmarshalJSON(body []byte) error { 21141 var m map[string]*json.RawMessage 21142 err := json.Unmarshal(body, &m) 21143 if err != nil { 21144 return err 21145 } 21146 for k, v := range m { 21147 switch k { 21148 case "name": 21149 if v != nil { 21150 var name string 21151 err = json.Unmarshal(*v, &name) 21152 if err != nil { 21153 return err 21154 } 21155 vmssveu.Name = &name 21156 } 21157 case "type": 21158 if v != nil { 21159 var typeVar string 21160 err = json.Unmarshal(*v, &typeVar) 21161 if err != nil { 21162 return err 21163 } 21164 vmssveu.Type = &typeVar 21165 } 21166 case "properties": 21167 if v != nil { 21168 var virtualMachineExtensionUpdateProperties VirtualMachineExtensionUpdateProperties 21169 err = json.Unmarshal(*v, &virtualMachineExtensionUpdateProperties) 21170 if err != nil { 21171 return err 21172 } 21173 vmssveu.VirtualMachineExtensionUpdateProperties = &virtualMachineExtensionUpdateProperties 21174 } 21175 case "id": 21176 if v != nil { 21177 var ID string 21178 err = json.Unmarshal(*v, &ID) 21179 if err != nil { 21180 return err 21181 } 21182 vmssveu.ID = &ID 21183 } 21184 } 21185 } 21186 21187 return nil 21188} 21189 21190// VirtualMachineScaleSetVMInstanceIDs specifies a list of virtual machine instance IDs from the VM scale 21191// set. 21192type VirtualMachineScaleSetVMInstanceIDs struct { 21193 // 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. 21194 InstanceIds *[]string `json:"instanceIds,omitempty"` 21195} 21196 21197// VirtualMachineScaleSetVMInstanceRequiredIDs specifies a list of virtual machine instance IDs from the VM 21198// scale set. 21199type VirtualMachineScaleSetVMInstanceRequiredIDs struct { 21200 // InstanceIds - The virtual machine scale set instance ids. 21201 InstanceIds *[]string `json:"instanceIds,omitempty"` 21202} 21203 21204// VirtualMachineScaleSetVMInstanceView the instance view of a virtual machine scale set VM. 21205type VirtualMachineScaleSetVMInstanceView struct { 21206 autorest.Response `json:"-"` 21207 // PlatformUpdateDomain - The Update Domain count. 21208 PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` 21209 // PlatformFaultDomain - The Fault Domain count. 21210 PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` 21211 // RdpThumbPrint - The Remote desktop certificate thumbprint. 21212 RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"` 21213 // VMAgent - The VM Agent running on the virtual machine. 21214 VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"` 21215 // MaintenanceRedeployStatus - The Maintenance Operation status on the virtual machine. 21216 MaintenanceRedeployStatus *MaintenanceRedeployStatus `json:"maintenanceRedeployStatus,omitempty"` 21217 // Disks - The disks information. 21218 Disks *[]DiskInstanceView `json:"disks,omitempty"` 21219 // Extensions - The extensions information. 21220 Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` 21221 // VMHealth - READ-ONLY; The health status for the VM. 21222 VMHealth *VirtualMachineHealthStatus `json:"vmHealth,omitempty"` 21223 // 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. 21224 BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` 21225 // Statuses - The resource status information. 21226 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 21227 // 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. 21228 AssignedHost *string `json:"assignedHost,omitempty"` 21229 // PlacementGroupID - The placement group in which the VM is running. If the VM is deallocated it will not have a placementGroupId. 21230 PlacementGroupID *string `json:"placementGroupId,omitempty"` 21231} 21232 21233// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMInstanceView. 21234func (vmssviv VirtualMachineScaleSetVMInstanceView) MarshalJSON() ([]byte, error) { 21235 objectMap := make(map[string]interface{}) 21236 if vmssviv.PlatformUpdateDomain != nil { 21237 objectMap["platformUpdateDomain"] = vmssviv.PlatformUpdateDomain 21238 } 21239 if vmssviv.PlatformFaultDomain != nil { 21240 objectMap["platformFaultDomain"] = vmssviv.PlatformFaultDomain 21241 } 21242 if vmssviv.RdpThumbPrint != nil { 21243 objectMap["rdpThumbPrint"] = vmssviv.RdpThumbPrint 21244 } 21245 if vmssviv.VMAgent != nil { 21246 objectMap["vmAgent"] = vmssviv.VMAgent 21247 } 21248 if vmssviv.MaintenanceRedeployStatus != nil { 21249 objectMap["maintenanceRedeployStatus"] = vmssviv.MaintenanceRedeployStatus 21250 } 21251 if vmssviv.Disks != nil { 21252 objectMap["disks"] = vmssviv.Disks 21253 } 21254 if vmssviv.Extensions != nil { 21255 objectMap["extensions"] = vmssviv.Extensions 21256 } 21257 if vmssviv.BootDiagnostics != nil { 21258 objectMap["bootDiagnostics"] = vmssviv.BootDiagnostics 21259 } 21260 if vmssviv.Statuses != nil { 21261 objectMap["statuses"] = vmssviv.Statuses 21262 } 21263 if vmssviv.PlacementGroupID != nil { 21264 objectMap["placementGroupId"] = vmssviv.PlacementGroupID 21265 } 21266 return json.Marshal(objectMap) 21267} 21268 21269// VirtualMachineScaleSetVMListResult the List Virtual Machine Scale Set VMs operation response. 21270type VirtualMachineScaleSetVMListResult struct { 21271 autorest.Response `json:"-"` 21272 // Value - The list of virtual machine scale sets VMs. 21273 Value *[]VirtualMachineScaleSetVM `json:"value,omitempty"` 21274 // 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 21275 NextLink *string `json:"nextLink,omitempty"` 21276} 21277 21278// VirtualMachineScaleSetVMListResultIterator provides access to a complete listing of 21279// VirtualMachineScaleSetVM values. 21280type VirtualMachineScaleSetVMListResultIterator struct { 21281 i int 21282 page VirtualMachineScaleSetVMListResultPage 21283} 21284 21285// NextWithContext advances to the next value. If there was an error making 21286// the request the iterator does not advance and the error is returned. 21287func (iter *VirtualMachineScaleSetVMListResultIterator) NextWithContext(ctx context.Context) (err error) { 21288 if tracing.IsEnabled() { 21289 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMListResultIterator.NextWithContext") 21290 defer func() { 21291 sc := -1 21292 if iter.Response().Response.Response != nil { 21293 sc = iter.Response().Response.Response.StatusCode 21294 } 21295 tracing.EndSpan(ctx, sc, err) 21296 }() 21297 } 21298 iter.i++ 21299 if iter.i < len(iter.page.Values()) { 21300 return nil 21301 } 21302 err = iter.page.NextWithContext(ctx) 21303 if err != nil { 21304 iter.i-- 21305 return err 21306 } 21307 iter.i = 0 21308 return nil 21309} 21310 21311// Next advances to the next value. If there was an error making 21312// the request the iterator does not advance and the error is returned. 21313// Deprecated: Use NextWithContext() instead. 21314func (iter *VirtualMachineScaleSetVMListResultIterator) Next() error { 21315 return iter.NextWithContext(context.Background()) 21316} 21317 21318// NotDone returns true if the enumeration should be started or is not yet complete. 21319func (iter VirtualMachineScaleSetVMListResultIterator) NotDone() bool { 21320 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 21321} 21322 21323// Response returns the raw server response from the last page request. 21324func (iter VirtualMachineScaleSetVMListResultIterator) Response() VirtualMachineScaleSetVMListResult { 21325 return iter.page.Response() 21326} 21327 21328// Value returns the current value or a zero-initialized value if the 21329// iterator has advanced beyond the end of the collection. 21330func (iter VirtualMachineScaleSetVMListResultIterator) Value() VirtualMachineScaleSetVM { 21331 if !iter.page.NotDone() { 21332 return VirtualMachineScaleSetVM{} 21333 } 21334 return iter.page.Values()[iter.i] 21335} 21336 21337// Creates a new instance of the VirtualMachineScaleSetVMListResultIterator type. 21338func NewVirtualMachineScaleSetVMListResultIterator(page VirtualMachineScaleSetVMListResultPage) VirtualMachineScaleSetVMListResultIterator { 21339 return VirtualMachineScaleSetVMListResultIterator{page: page} 21340} 21341 21342// IsEmpty returns true if the ListResult contains no values. 21343func (vmssvlr VirtualMachineScaleSetVMListResult) IsEmpty() bool { 21344 return vmssvlr.Value == nil || len(*vmssvlr.Value) == 0 21345} 21346 21347// hasNextLink returns true if the NextLink is not empty. 21348func (vmssvlr VirtualMachineScaleSetVMListResult) hasNextLink() bool { 21349 return vmssvlr.NextLink != nil && len(*vmssvlr.NextLink) != 0 21350} 21351 21352// virtualMachineScaleSetVMListResultPreparer prepares a request to retrieve the next set of results. 21353// It returns nil if no more results exist. 21354func (vmssvlr VirtualMachineScaleSetVMListResult) virtualMachineScaleSetVMListResultPreparer(ctx context.Context) (*http.Request, error) { 21355 if !vmssvlr.hasNextLink() { 21356 return nil, nil 21357 } 21358 return autorest.Prepare((&http.Request{}).WithContext(ctx), 21359 autorest.AsJSON(), 21360 autorest.AsGet(), 21361 autorest.WithBaseURL(to.String(vmssvlr.NextLink))) 21362} 21363 21364// VirtualMachineScaleSetVMListResultPage contains a page of VirtualMachineScaleSetVM values. 21365type VirtualMachineScaleSetVMListResultPage struct { 21366 fn func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error) 21367 vmssvlr VirtualMachineScaleSetVMListResult 21368} 21369 21370// NextWithContext advances to the next page of values. If there was an error making 21371// the request the page does not advance and the error is returned. 21372func (page *VirtualMachineScaleSetVMListResultPage) NextWithContext(ctx context.Context) (err error) { 21373 if tracing.IsEnabled() { 21374 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMListResultPage.NextWithContext") 21375 defer func() { 21376 sc := -1 21377 if page.Response().Response.Response != nil { 21378 sc = page.Response().Response.Response.StatusCode 21379 } 21380 tracing.EndSpan(ctx, sc, err) 21381 }() 21382 } 21383 for { 21384 next, err := page.fn(ctx, page.vmssvlr) 21385 if err != nil { 21386 return err 21387 } 21388 page.vmssvlr = next 21389 if !next.hasNextLink() || !next.IsEmpty() { 21390 break 21391 } 21392 } 21393 return nil 21394} 21395 21396// Next advances to the next page of values. If there was an error making 21397// the request the page does not advance and the error is returned. 21398// Deprecated: Use NextWithContext() instead. 21399func (page *VirtualMachineScaleSetVMListResultPage) Next() error { 21400 return page.NextWithContext(context.Background()) 21401} 21402 21403// NotDone returns true if the page enumeration should be started or is not yet complete. 21404func (page VirtualMachineScaleSetVMListResultPage) NotDone() bool { 21405 return !page.vmssvlr.IsEmpty() 21406} 21407 21408// Response returns the raw server response from the last page request. 21409func (page VirtualMachineScaleSetVMListResultPage) Response() VirtualMachineScaleSetVMListResult { 21410 return page.vmssvlr 21411} 21412 21413// Values returns the slice of values for the current page or nil if there are no values. 21414func (page VirtualMachineScaleSetVMListResultPage) Values() []VirtualMachineScaleSetVM { 21415 if page.vmssvlr.IsEmpty() { 21416 return nil 21417 } 21418 return *page.vmssvlr.Value 21419} 21420 21421// Creates a new instance of the VirtualMachineScaleSetVMListResultPage type. 21422func NewVirtualMachineScaleSetVMListResultPage(cur VirtualMachineScaleSetVMListResult, getNextPage func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error)) VirtualMachineScaleSetVMListResultPage { 21423 return VirtualMachineScaleSetVMListResultPage{ 21424 fn: getNextPage, 21425 vmssvlr: cur, 21426 } 21427} 21428 21429// VirtualMachineScaleSetVMNetworkProfileConfiguration describes a virtual machine scale set VM network 21430// profile. 21431type VirtualMachineScaleSetVMNetworkProfileConfiguration struct { 21432 // NetworkInterfaceConfigurations - The list of network configurations. 21433 NetworkInterfaceConfigurations *[]VirtualMachineScaleSetNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` 21434} 21435 21436// VirtualMachineScaleSetVMProfile describes a virtual machine scale set virtual machine profile. 21437type VirtualMachineScaleSetVMProfile struct { 21438 // OsProfile - Specifies the operating system settings for the virtual machines in the scale set. 21439 OsProfile *VirtualMachineScaleSetOSProfile `json:"osProfile,omitempty"` 21440 // StorageProfile - Specifies the storage settings for the virtual machine disks. 21441 StorageProfile *VirtualMachineScaleSetStorageProfile `json:"storageProfile,omitempty"` 21442 // NetworkProfile - Specifies properties of the network interfaces of the virtual machines in the scale set. 21443 NetworkProfile *VirtualMachineScaleSetNetworkProfile `json:"networkProfile,omitempty"` 21444 // SecurityProfile - Specifies the Security related profile settings for the virtual machines in the scale set. 21445 SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` 21446 // DiagnosticsProfile - Specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. 21447 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 21448 // ExtensionProfile - Specifies a collection of settings for extensions installed on virtual machines in the scale set. 21449 ExtensionProfile *VirtualMachineScaleSetExtensionProfile `json:"extensionProfile,omitempty"` 21450 // 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 21451 LicenseType *string `json:"licenseType,omitempty"` 21452 // 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' 21453 Priority VirtualMachinePriorityTypes `json:"priority,omitempty"` 21454 // 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' 21455 EvictionPolicy VirtualMachineEvictionPolicyTypes `json:"evictionPolicy,omitempty"` 21456 // BillingProfile - Specifies the billing related details of a Azure Spot VMSS. <br><br>Minimum api-version: 2019-03-01. 21457 BillingProfile *BillingProfile `json:"billingProfile,omitempty"` 21458 // ScheduledEventsProfile - Specifies Scheduled Event related configurations. 21459 ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` 21460 // 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 21461 UserData *string `json:"userData,omitempty"` 21462 // CapacityReservation - Specifies the capacity reservation related details of a scale set. <br><br>Minimum api-version: 2021-04-01. 21463 CapacityReservation *CapacityReservationProfile `json:"capacityReservation,omitempty"` 21464} 21465 21466// VirtualMachineScaleSetVMProperties describes the properties of a virtual machine scale set virtual 21467// machine. 21468type VirtualMachineScaleSetVMProperties struct { 21469 // LatestModelApplied - READ-ONLY; Specifies whether the latest model has been applied to the virtual machine. 21470 LatestModelApplied *bool `json:"latestModelApplied,omitempty"` 21471 // VMID - READ-ONLY; Azure VM unique ID. 21472 VMID *string `json:"vmId,omitempty"` 21473 // InstanceView - READ-ONLY; The virtual machine instance view. 21474 InstanceView *VirtualMachineScaleSetVMInstanceView `json:"instanceView,omitempty"` 21475 // HardwareProfile - Specifies the hardware settings for the virtual machine. 21476 HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` 21477 // StorageProfile - Specifies the storage settings for the virtual machine disks. 21478 StorageProfile *StorageProfile `json:"storageProfile,omitempty"` 21479 // 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. 21480 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 21481 // OsProfile - Specifies the operating system settings for the virtual machine. 21482 OsProfile *OSProfile `json:"osProfile,omitempty"` 21483 // SecurityProfile - Specifies the Security related profile settings for the virtual machine. 21484 SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` 21485 // NetworkProfile - Specifies the network interfaces of the virtual machine. 21486 NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` 21487 // NetworkProfileConfiguration - Specifies the network profile configuration of the virtual machine. 21488 NetworkProfileConfiguration *VirtualMachineScaleSetVMNetworkProfileConfiguration `json:"networkProfileConfiguration,omitempty"` 21489 // DiagnosticsProfile - Specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. 21490 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 21491 // 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. 21492 AvailabilitySet *SubResource `json:"availabilitySet,omitempty"` 21493 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 21494 ProvisioningState *string `json:"provisioningState,omitempty"` 21495 // 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 21496 LicenseType *string `json:"licenseType,omitempty"` 21497 // 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. 21498 ModelDefinitionApplied *string `json:"modelDefinitionApplied,omitempty"` 21499 // ProtectionPolicy - Specifies the protection policy of the virtual machine. 21500 ProtectionPolicy *VirtualMachineScaleSetVMProtectionPolicy `json:"protectionPolicy,omitempty"` 21501 // 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 21502 UserData *string `json:"userData,omitempty"` 21503} 21504 21505// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMProperties. 21506func (vmssvp VirtualMachineScaleSetVMProperties) MarshalJSON() ([]byte, error) { 21507 objectMap := make(map[string]interface{}) 21508 if vmssvp.HardwareProfile != nil { 21509 objectMap["hardwareProfile"] = vmssvp.HardwareProfile 21510 } 21511 if vmssvp.StorageProfile != nil { 21512 objectMap["storageProfile"] = vmssvp.StorageProfile 21513 } 21514 if vmssvp.AdditionalCapabilities != nil { 21515 objectMap["additionalCapabilities"] = vmssvp.AdditionalCapabilities 21516 } 21517 if vmssvp.OsProfile != nil { 21518 objectMap["osProfile"] = vmssvp.OsProfile 21519 } 21520 if vmssvp.SecurityProfile != nil { 21521 objectMap["securityProfile"] = vmssvp.SecurityProfile 21522 } 21523 if vmssvp.NetworkProfile != nil { 21524 objectMap["networkProfile"] = vmssvp.NetworkProfile 21525 } 21526 if vmssvp.NetworkProfileConfiguration != nil { 21527 objectMap["networkProfileConfiguration"] = vmssvp.NetworkProfileConfiguration 21528 } 21529 if vmssvp.DiagnosticsProfile != nil { 21530 objectMap["diagnosticsProfile"] = vmssvp.DiagnosticsProfile 21531 } 21532 if vmssvp.AvailabilitySet != nil { 21533 objectMap["availabilitySet"] = vmssvp.AvailabilitySet 21534 } 21535 if vmssvp.LicenseType != nil { 21536 objectMap["licenseType"] = vmssvp.LicenseType 21537 } 21538 if vmssvp.ProtectionPolicy != nil { 21539 objectMap["protectionPolicy"] = vmssvp.ProtectionPolicy 21540 } 21541 if vmssvp.UserData != nil { 21542 objectMap["userData"] = vmssvp.UserData 21543 } 21544 return json.Marshal(objectMap) 21545} 21546 21547// VirtualMachineScaleSetVMProtectionPolicy the protection policy of a virtual machine scale set VM. 21548type VirtualMachineScaleSetVMProtectionPolicy struct { 21549 // ProtectFromScaleIn - Indicates that the virtual machine scale set VM shouldn't be considered for deletion during a scale-in operation. 21550 ProtectFromScaleIn *bool `json:"protectFromScaleIn,omitempty"` 21551 // 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. 21552 ProtectFromScaleSetActions *bool `json:"protectFromScaleSetActions,omitempty"` 21553} 21554 21555// VirtualMachineScaleSetVMReimageParameters describes a Virtual Machine Scale Set VM Reimage Parameters. 21556type VirtualMachineScaleSetVMReimageParameters struct { 21557 // 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. 21558 TempDisk *bool `json:"tempDisk,omitempty"` 21559} 21560 21561// VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture an abstraction for monitoring and retrieving the 21562// results of a long-running operation. 21563type VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture struct { 21564 azure.FutureAPI 21565 // Result returns the result of the asynchronous operation. 21566 // If the operation has not completed it will return an error. 21567 Result func(VirtualMachineScaleSetVMRunCommandsClient) (VirtualMachineRunCommand, error) 21568} 21569 21570// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21571func (future *VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 21572 var azFuture azure.Future 21573 if err := json.Unmarshal(body, &azFuture); err != nil { 21574 return err 21575 } 21576 future.FutureAPI = &azFuture 21577 future.Result = future.result 21578 return nil 21579} 21580 21581// result is the default implementation for VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture.Result. 21582func (future *VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture) result(client VirtualMachineScaleSetVMRunCommandsClient) (vmrc VirtualMachineRunCommand, err error) { 21583 var done bool 21584 done, err = future.DoneWithContext(context.Background(), client) 21585 if err != nil { 21586 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 21587 return 21588 } 21589 if !done { 21590 vmrc.Response.Response = future.Response() 21591 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture") 21592 return 21593 } 21594 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 21595 if vmrc.Response.Response, err = future.GetResult(sender); err == nil && vmrc.Response.Response.StatusCode != http.StatusNoContent { 21596 vmrc, err = client.CreateOrUpdateResponder(vmrc.Response.Response) 21597 if err != nil { 21598 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture", "Result", vmrc.Response.Response, "Failure responding to request") 21599 } 21600 } 21601 return 21602} 21603 21604// VirtualMachineScaleSetVMRunCommandsDeleteFuture an abstraction for monitoring and retrieving the results 21605// of a long-running operation. 21606type VirtualMachineScaleSetVMRunCommandsDeleteFuture struct { 21607 azure.FutureAPI 21608 // Result returns the result of the asynchronous operation. 21609 // If the operation has not completed it will return an error. 21610 Result func(VirtualMachineScaleSetVMRunCommandsClient) (autorest.Response, error) 21611} 21612 21613// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21614func (future *VirtualMachineScaleSetVMRunCommandsDeleteFuture) UnmarshalJSON(body []byte) error { 21615 var azFuture azure.Future 21616 if err := json.Unmarshal(body, &azFuture); err != nil { 21617 return err 21618 } 21619 future.FutureAPI = &azFuture 21620 future.Result = future.result 21621 return nil 21622} 21623 21624// result is the default implementation for VirtualMachineScaleSetVMRunCommandsDeleteFuture.Result. 21625func (future *VirtualMachineScaleSetVMRunCommandsDeleteFuture) result(client VirtualMachineScaleSetVMRunCommandsClient) (ar autorest.Response, err error) { 21626 var done bool 21627 done, err = future.DoneWithContext(context.Background(), client) 21628 if err != nil { 21629 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsDeleteFuture", "Result", future.Response(), "Polling failure") 21630 return 21631 } 21632 if !done { 21633 ar.Response = future.Response() 21634 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMRunCommandsDeleteFuture") 21635 return 21636 } 21637 ar.Response = future.Response() 21638 return 21639} 21640 21641// VirtualMachineScaleSetVMRunCommandsUpdateFuture an abstraction for monitoring and retrieving the results 21642// of a long-running operation. 21643type VirtualMachineScaleSetVMRunCommandsUpdateFuture struct { 21644 azure.FutureAPI 21645 // Result returns the result of the asynchronous operation. 21646 // If the operation has not completed it will return an error. 21647 Result func(VirtualMachineScaleSetVMRunCommandsClient) (VirtualMachineRunCommand, error) 21648} 21649 21650// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21651func (future *VirtualMachineScaleSetVMRunCommandsUpdateFuture) UnmarshalJSON(body []byte) error { 21652 var azFuture azure.Future 21653 if err := json.Unmarshal(body, &azFuture); err != nil { 21654 return err 21655 } 21656 future.FutureAPI = &azFuture 21657 future.Result = future.result 21658 return nil 21659} 21660 21661// result is the default implementation for VirtualMachineScaleSetVMRunCommandsUpdateFuture.Result. 21662func (future *VirtualMachineScaleSetVMRunCommandsUpdateFuture) result(client VirtualMachineScaleSetVMRunCommandsClient) (vmrc VirtualMachineRunCommand, err error) { 21663 var done bool 21664 done, err = future.DoneWithContext(context.Background(), client) 21665 if err != nil { 21666 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsUpdateFuture", "Result", future.Response(), "Polling failure") 21667 return 21668 } 21669 if !done { 21670 vmrc.Response.Response = future.Response() 21671 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMRunCommandsUpdateFuture") 21672 return 21673 } 21674 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 21675 if vmrc.Response.Response, err = future.GetResult(sender); err == nil && vmrc.Response.Response.StatusCode != http.StatusNoContent { 21676 vmrc, err = client.UpdateResponder(vmrc.Response.Response) 21677 if err != nil { 21678 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsUpdateFuture", "Result", vmrc.Response.Response, "Failure responding to request") 21679 } 21680 } 21681 return 21682} 21683 21684// VirtualMachineScaleSetVMsDeallocateFuture an abstraction for monitoring and retrieving the results of a 21685// long-running operation. 21686type VirtualMachineScaleSetVMsDeallocateFuture struct { 21687 azure.FutureAPI 21688 // Result returns the result of the asynchronous operation. 21689 // If the operation has not completed it will return an error. 21690 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 21691} 21692 21693// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21694func (future *VirtualMachineScaleSetVMsDeallocateFuture) UnmarshalJSON(body []byte) error { 21695 var azFuture azure.Future 21696 if err := json.Unmarshal(body, &azFuture); err != nil { 21697 return err 21698 } 21699 future.FutureAPI = &azFuture 21700 future.Result = future.result 21701 return nil 21702} 21703 21704// result is the default implementation for VirtualMachineScaleSetVMsDeallocateFuture.Result. 21705func (future *VirtualMachineScaleSetVMsDeallocateFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 21706 var done bool 21707 done, err = future.DoneWithContext(context.Background(), client) 21708 if err != nil { 21709 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsDeallocateFuture", "Result", future.Response(), "Polling failure") 21710 return 21711 } 21712 if !done { 21713 ar.Response = future.Response() 21714 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsDeallocateFuture") 21715 return 21716 } 21717 ar.Response = future.Response() 21718 return 21719} 21720 21721// VirtualMachineScaleSetVMsDeleteFuture an abstraction for monitoring and retrieving the results of a 21722// long-running operation. 21723type VirtualMachineScaleSetVMsDeleteFuture struct { 21724 azure.FutureAPI 21725 // Result returns the result of the asynchronous operation. 21726 // If the operation has not completed it will return an error. 21727 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 21728} 21729 21730// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21731func (future *VirtualMachineScaleSetVMsDeleteFuture) UnmarshalJSON(body []byte) error { 21732 var azFuture azure.Future 21733 if err := json.Unmarshal(body, &azFuture); err != nil { 21734 return err 21735 } 21736 future.FutureAPI = &azFuture 21737 future.Result = future.result 21738 return nil 21739} 21740 21741// result is the default implementation for VirtualMachineScaleSetVMsDeleteFuture.Result. 21742func (future *VirtualMachineScaleSetVMsDeleteFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 21743 var done bool 21744 done, err = future.DoneWithContext(context.Background(), client) 21745 if err != nil { 21746 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsDeleteFuture", "Result", future.Response(), "Polling failure") 21747 return 21748 } 21749 if !done { 21750 ar.Response = future.Response() 21751 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsDeleteFuture") 21752 return 21753 } 21754 ar.Response = future.Response() 21755 return 21756} 21757 21758// VirtualMachineScaleSetVMsPerformMaintenanceFuture an abstraction for monitoring and retrieving the 21759// results of a long-running operation. 21760type VirtualMachineScaleSetVMsPerformMaintenanceFuture struct { 21761 azure.FutureAPI 21762 // Result returns the result of the asynchronous operation. 21763 // If the operation has not completed it will return an error. 21764 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 21765} 21766 21767// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21768func (future *VirtualMachineScaleSetVMsPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { 21769 var azFuture azure.Future 21770 if err := json.Unmarshal(body, &azFuture); err != nil { 21771 return err 21772 } 21773 future.FutureAPI = &azFuture 21774 future.Result = future.result 21775 return nil 21776} 21777 21778// result is the default implementation for VirtualMachineScaleSetVMsPerformMaintenanceFuture.Result. 21779func (future *VirtualMachineScaleSetVMsPerformMaintenanceFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 21780 var done bool 21781 done, err = future.DoneWithContext(context.Background(), client) 21782 if err != nil { 21783 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsPerformMaintenanceFuture", "Result", future.Response(), "Polling failure") 21784 return 21785 } 21786 if !done { 21787 ar.Response = future.Response() 21788 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsPerformMaintenanceFuture") 21789 return 21790 } 21791 ar.Response = future.Response() 21792 return 21793} 21794 21795// VirtualMachineScaleSetVMsPowerOffFuture an abstraction for monitoring and retrieving the results of a 21796// long-running operation. 21797type VirtualMachineScaleSetVMsPowerOffFuture struct { 21798 azure.FutureAPI 21799 // Result returns the result of the asynchronous operation. 21800 // If the operation has not completed it will return an error. 21801 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 21802} 21803 21804// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21805func (future *VirtualMachineScaleSetVMsPowerOffFuture) UnmarshalJSON(body []byte) error { 21806 var azFuture azure.Future 21807 if err := json.Unmarshal(body, &azFuture); err != nil { 21808 return err 21809 } 21810 future.FutureAPI = &azFuture 21811 future.Result = future.result 21812 return nil 21813} 21814 21815// result is the default implementation for VirtualMachineScaleSetVMsPowerOffFuture.Result. 21816func (future *VirtualMachineScaleSetVMsPowerOffFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 21817 var done bool 21818 done, err = future.DoneWithContext(context.Background(), client) 21819 if err != nil { 21820 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsPowerOffFuture", "Result", future.Response(), "Polling failure") 21821 return 21822 } 21823 if !done { 21824 ar.Response = future.Response() 21825 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsPowerOffFuture") 21826 return 21827 } 21828 ar.Response = future.Response() 21829 return 21830} 21831 21832// VirtualMachineScaleSetVMsRedeployFuture an abstraction for monitoring and retrieving the results of a 21833// long-running operation. 21834type VirtualMachineScaleSetVMsRedeployFuture struct { 21835 azure.FutureAPI 21836 // Result returns the result of the asynchronous operation. 21837 // If the operation has not completed it will return an error. 21838 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 21839} 21840 21841// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21842func (future *VirtualMachineScaleSetVMsRedeployFuture) UnmarshalJSON(body []byte) error { 21843 var azFuture azure.Future 21844 if err := json.Unmarshal(body, &azFuture); err != nil { 21845 return err 21846 } 21847 future.FutureAPI = &azFuture 21848 future.Result = future.result 21849 return nil 21850} 21851 21852// result is the default implementation for VirtualMachineScaleSetVMsRedeployFuture.Result. 21853func (future *VirtualMachineScaleSetVMsRedeployFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 21854 var done bool 21855 done, err = future.DoneWithContext(context.Background(), client) 21856 if err != nil { 21857 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRedeployFuture", "Result", future.Response(), "Polling failure") 21858 return 21859 } 21860 if !done { 21861 ar.Response = future.Response() 21862 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRedeployFuture") 21863 return 21864 } 21865 ar.Response = future.Response() 21866 return 21867} 21868 21869// VirtualMachineScaleSetVMsReimageAllFuture an abstraction for monitoring and retrieving the results of a 21870// long-running operation. 21871type VirtualMachineScaleSetVMsReimageAllFuture struct { 21872 azure.FutureAPI 21873 // Result returns the result of the asynchronous operation. 21874 // If the operation has not completed it will return an error. 21875 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 21876} 21877 21878// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21879func (future *VirtualMachineScaleSetVMsReimageAllFuture) UnmarshalJSON(body []byte) error { 21880 var azFuture azure.Future 21881 if err := json.Unmarshal(body, &azFuture); err != nil { 21882 return err 21883 } 21884 future.FutureAPI = &azFuture 21885 future.Result = future.result 21886 return nil 21887} 21888 21889// result is the default implementation for VirtualMachineScaleSetVMsReimageAllFuture.Result. 21890func (future *VirtualMachineScaleSetVMsReimageAllFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 21891 var done bool 21892 done, err = future.DoneWithContext(context.Background(), client) 21893 if err != nil { 21894 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsReimageAllFuture", "Result", future.Response(), "Polling failure") 21895 return 21896 } 21897 if !done { 21898 ar.Response = future.Response() 21899 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsReimageAllFuture") 21900 return 21901 } 21902 ar.Response = future.Response() 21903 return 21904} 21905 21906// VirtualMachineScaleSetVMsReimageFuture an abstraction for monitoring and retrieving the results of a 21907// long-running operation. 21908type VirtualMachineScaleSetVMsReimageFuture struct { 21909 azure.FutureAPI 21910 // Result returns the result of the asynchronous operation. 21911 // If the operation has not completed it will return an error. 21912 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 21913} 21914 21915// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21916func (future *VirtualMachineScaleSetVMsReimageFuture) UnmarshalJSON(body []byte) error { 21917 var azFuture azure.Future 21918 if err := json.Unmarshal(body, &azFuture); err != nil { 21919 return err 21920 } 21921 future.FutureAPI = &azFuture 21922 future.Result = future.result 21923 return nil 21924} 21925 21926// result is the default implementation for VirtualMachineScaleSetVMsReimageFuture.Result. 21927func (future *VirtualMachineScaleSetVMsReimageFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 21928 var done bool 21929 done, err = future.DoneWithContext(context.Background(), client) 21930 if err != nil { 21931 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsReimageFuture", "Result", future.Response(), "Polling failure") 21932 return 21933 } 21934 if !done { 21935 ar.Response = future.Response() 21936 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsReimageFuture") 21937 return 21938 } 21939 ar.Response = future.Response() 21940 return 21941} 21942 21943// VirtualMachineScaleSetVMsRestartFuture an abstraction for monitoring and retrieving the results of a 21944// long-running operation. 21945type VirtualMachineScaleSetVMsRestartFuture struct { 21946 azure.FutureAPI 21947 // Result returns the result of the asynchronous operation. 21948 // If the operation has not completed it will return an error. 21949 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 21950} 21951 21952// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21953func (future *VirtualMachineScaleSetVMsRestartFuture) UnmarshalJSON(body []byte) error { 21954 var azFuture azure.Future 21955 if err := json.Unmarshal(body, &azFuture); err != nil { 21956 return err 21957 } 21958 future.FutureAPI = &azFuture 21959 future.Result = future.result 21960 return nil 21961} 21962 21963// result is the default implementation for VirtualMachineScaleSetVMsRestartFuture.Result. 21964func (future *VirtualMachineScaleSetVMsRestartFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 21965 var done bool 21966 done, err = future.DoneWithContext(context.Background(), client) 21967 if err != nil { 21968 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRestartFuture", "Result", future.Response(), "Polling failure") 21969 return 21970 } 21971 if !done { 21972 ar.Response = future.Response() 21973 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRestartFuture") 21974 return 21975 } 21976 ar.Response = future.Response() 21977 return 21978} 21979 21980// VirtualMachineScaleSetVMsRunCommandFuture an abstraction for monitoring and retrieving the results of a 21981// long-running operation. 21982type VirtualMachineScaleSetVMsRunCommandFuture struct { 21983 azure.FutureAPI 21984 // Result returns the result of the asynchronous operation. 21985 // If the operation has not completed it will return an error. 21986 Result func(VirtualMachineScaleSetVMsClient) (RunCommandResult, error) 21987} 21988 21989// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21990func (future *VirtualMachineScaleSetVMsRunCommandFuture) UnmarshalJSON(body []byte) error { 21991 var azFuture azure.Future 21992 if err := json.Unmarshal(body, &azFuture); err != nil { 21993 return err 21994 } 21995 future.FutureAPI = &azFuture 21996 future.Result = future.result 21997 return nil 21998} 21999 22000// result is the default implementation for VirtualMachineScaleSetVMsRunCommandFuture.Result. 22001func (future *VirtualMachineScaleSetVMsRunCommandFuture) result(client VirtualMachineScaleSetVMsClient) (rcr RunCommandResult, err error) { 22002 var done bool 22003 done, err = future.DoneWithContext(context.Background(), client) 22004 if err != nil { 22005 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRunCommandFuture", "Result", future.Response(), "Polling failure") 22006 return 22007 } 22008 if !done { 22009 rcr.Response.Response = future.Response() 22010 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRunCommandFuture") 22011 return 22012 } 22013 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 22014 if rcr.Response.Response, err = future.GetResult(sender); err == nil && rcr.Response.Response.StatusCode != http.StatusNoContent { 22015 rcr, err = client.RunCommandResponder(rcr.Response.Response) 22016 if err != nil { 22017 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRunCommandFuture", "Result", rcr.Response.Response, "Failure responding to request") 22018 } 22019 } 22020 return 22021} 22022 22023// VirtualMachineScaleSetVMsStartFuture an abstraction for monitoring and retrieving the results of a 22024// long-running operation. 22025type VirtualMachineScaleSetVMsStartFuture struct { 22026 azure.FutureAPI 22027 // Result returns the result of the asynchronous operation. 22028 // If the operation has not completed it will return an error. 22029 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 22030} 22031 22032// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22033func (future *VirtualMachineScaleSetVMsStartFuture) UnmarshalJSON(body []byte) error { 22034 var azFuture azure.Future 22035 if err := json.Unmarshal(body, &azFuture); err != nil { 22036 return err 22037 } 22038 future.FutureAPI = &azFuture 22039 future.Result = future.result 22040 return nil 22041} 22042 22043// result is the default implementation for VirtualMachineScaleSetVMsStartFuture.Result. 22044func (future *VirtualMachineScaleSetVMsStartFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 22045 var done bool 22046 done, err = future.DoneWithContext(context.Background(), client) 22047 if err != nil { 22048 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsStartFuture", "Result", future.Response(), "Polling failure") 22049 return 22050 } 22051 if !done { 22052 ar.Response = future.Response() 22053 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsStartFuture") 22054 return 22055 } 22056 ar.Response = future.Response() 22057 return 22058} 22059 22060// VirtualMachineScaleSetVMsUpdateFuture an abstraction for monitoring and retrieving the results of a 22061// long-running operation. 22062type VirtualMachineScaleSetVMsUpdateFuture struct { 22063 azure.FutureAPI 22064 // Result returns the result of the asynchronous operation. 22065 // If the operation has not completed it will return an error. 22066 Result func(VirtualMachineScaleSetVMsClient) (VirtualMachineScaleSetVM, error) 22067} 22068 22069// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22070func (future *VirtualMachineScaleSetVMsUpdateFuture) UnmarshalJSON(body []byte) error { 22071 var azFuture azure.Future 22072 if err := json.Unmarshal(body, &azFuture); err != nil { 22073 return err 22074 } 22075 future.FutureAPI = &azFuture 22076 future.Result = future.result 22077 return nil 22078} 22079 22080// result is the default implementation for VirtualMachineScaleSetVMsUpdateFuture.Result. 22081func (future *VirtualMachineScaleSetVMsUpdateFuture) result(client VirtualMachineScaleSetVMsClient) (vmssv VirtualMachineScaleSetVM, err error) { 22082 var done bool 22083 done, err = future.DoneWithContext(context.Background(), client) 22084 if err != nil { 22085 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsUpdateFuture", "Result", future.Response(), "Polling failure") 22086 return 22087 } 22088 if !done { 22089 vmssv.Response.Response = future.Response() 22090 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsUpdateFuture") 22091 return 22092 } 22093 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 22094 if vmssv.Response.Response, err = future.GetResult(sender); err == nil && vmssv.Response.Response.StatusCode != http.StatusNoContent { 22095 vmssv, err = client.UpdateResponder(vmssv.Response.Response) 22096 if err != nil { 22097 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsUpdateFuture", "Result", vmssv.Response.Response, "Failure responding to request") 22098 } 22099 } 22100 return 22101} 22102 22103// VirtualMachinesCaptureFuture an abstraction for monitoring and retrieving the results of a long-running 22104// operation. 22105type VirtualMachinesCaptureFuture struct { 22106 azure.FutureAPI 22107 // Result returns the result of the asynchronous operation. 22108 // If the operation has not completed it will return an error. 22109 Result func(VirtualMachinesClient) (VirtualMachineCaptureResult, error) 22110} 22111 22112// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22113func (future *VirtualMachinesCaptureFuture) UnmarshalJSON(body []byte) error { 22114 var azFuture azure.Future 22115 if err := json.Unmarshal(body, &azFuture); err != nil { 22116 return err 22117 } 22118 future.FutureAPI = &azFuture 22119 future.Result = future.result 22120 return nil 22121} 22122 22123// result is the default implementation for VirtualMachinesCaptureFuture.Result. 22124func (future *VirtualMachinesCaptureFuture) result(client VirtualMachinesClient) (vmcr VirtualMachineCaptureResult, err error) { 22125 var done bool 22126 done, err = future.DoneWithContext(context.Background(), client) 22127 if err != nil { 22128 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCaptureFuture", "Result", future.Response(), "Polling failure") 22129 return 22130 } 22131 if !done { 22132 vmcr.Response.Response = future.Response() 22133 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesCaptureFuture") 22134 return 22135 } 22136 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 22137 if vmcr.Response.Response, err = future.GetResult(sender); err == nil && vmcr.Response.Response.StatusCode != http.StatusNoContent { 22138 vmcr, err = client.CaptureResponder(vmcr.Response.Response) 22139 if err != nil { 22140 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCaptureFuture", "Result", vmcr.Response.Response, "Failure responding to request") 22141 } 22142 } 22143 return 22144} 22145 22146// VirtualMachinesConvertToManagedDisksFuture an abstraction for monitoring and retrieving the results of a 22147// long-running operation. 22148type VirtualMachinesConvertToManagedDisksFuture struct { 22149 azure.FutureAPI 22150 // Result returns the result of the asynchronous operation. 22151 // If the operation has not completed it will return an error. 22152 Result func(VirtualMachinesClient) (autorest.Response, error) 22153} 22154 22155// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22156func (future *VirtualMachinesConvertToManagedDisksFuture) UnmarshalJSON(body []byte) error { 22157 var azFuture azure.Future 22158 if err := json.Unmarshal(body, &azFuture); err != nil { 22159 return err 22160 } 22161 future.FutureAPI = &azFuture 22162 future.Result = future.result 22163 return nil 22164} 22165 22166// result is the default implementation for VirtualMachinesConvertToManagedDisksFuture.Result. 22167func (future *VirtualMachinesConvertToManagedDisksFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 22168 var done bool 22169 done, err = future.DoneWithContext(context.Background(), client) 22170 if err != nil { 22171 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesConvertToManagedDisksFuture", "Result", future.Response(), "Polling failure") 22172 return 22173 } 22174 if !done { 22175 ar.Response = future.Response() 22176 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesConvertToManagedDisksFuture") 22177 return 22178 } 22179 ar.Response = future.Response() 22180 return 22181} 22182 22183// VirtualMachinesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 22184// long-running operation. 22185type VirtualMachinesCreateOrUpdateFuture struct { 22186 azure.FutureAPI 22187 // Result returns the result of the asynchronous operation. 22188 // If the operation has not completed it will return an error. 22189 Result func(VirtualMachinesClient) (VirtualMachine, error) 22190} 22191 22192// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22193func (future *VirtualMachinesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 22194 var azFuture azure.Future 22195 if err := json.Unmarshal(body, &azFuture); err != nil { 22196 return err 22197 } 22198 future.FutureAPI = &azFuture 22199 future.Result = future.result 22200 return nil 22201} 22202 22203// result is the default implementation for VirtualMachinesCreateOrUpdateFuture.Result. 22204func (future *VirtualMachinesCreateOrUpdateFuture) result(client VirtualMachinesClient) (VM VirtualMachine, err error) { 22205 var done bool 22206 done, err = future.DoneWithContext(context.Background(), client) 22207 if err != nil { 22208 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 22209 return 22210 } 22211 if !done { 22212 VM.Response.Response = future.Response() 22213 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesCreateOrUpdateFuture") 22214 return 22215 } 22216 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 22217 if VM.Response.Response, err = future.GetResult(sender); err == nil && VM.Response.Response.StatusCode != http.StatusNoContent { 22218 VM, err = client.CreateOrUpdateResponder(VM.Response.Response) 22219 if err != nil { 22220 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCreateOrUpdateFuture", "Result", VM.Response.Response, "Failure responding to request") 22221 } 22222 } 22223 return 22224} 22225 22226// VirtualMachinesDeallocateFuture an abstraction for monitoring and retrieving the results of a 22227// long-running operation. 22228type VirtualMachinesDeallocateFuture struct { 22229 azure.FutureAPI 22230 // Result returns the result of the asynchronous operation. 22231 // If the operation has not completed it will return an error. 22232 Result func(VirtualMachinesClient) (autorest.Response, error) 22233} 22234 22235// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22236func (future *VirtualMachinesDeallocateFuture) UnmarshalJSON(body []byte) error { 22237 var azFuture azure.Future 22238 if err := json.Unmarshal(body, &azFuture); err != nil { 22239 return err 22240 } 22241 future.FutureAPI = &azFuture 22242 future.Result = future.result 22243 return nil 22244} 22245 22246// result is the default implementation for VirtualMachinesDeallocateFuture.Result. 22247func (future *VirtualMachinesDeallocateFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 22248 var done bool 22249 done, err = future.DoneWithContext(context.Background(), client) 22250 if err != nil { 22251 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesDeallocateFuture", "Result", future.Response(), "Polling failure") 22252 return 22253 } 22254 if !done { 22255 ar.Response = future.Response() 22256 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesDeallocateFuture") 22257 return 22258 } 22259 ar.Response = future.Response() 22260 return 22261} 22262 22263// VirtualMachinesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 22264// operation. 22265type VirtualMachinesDeleteFuture struct { 22266 azure.FutureAPI 22267 // Result returns the result of the asynchronous operation. 22268 // If the operation has not completed it will return an error. 22269 Result func(VirtualMachinesClient) (autorest.Response, error) 22270} 22271 22272// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22273func (future *VirtualMachinesDeleteFuture) UnmarshalJSON(body []byte) error { 22274 var azFuture azure.Future 22275 if err := json.Unmarshal(body, &azFuture); err != nil { 22276 return err 22277 } 22278 future.FutureAPI = &azFuture 22279 future.Result = future.result 22280 return nil 22281} 22282 22283// result is the default implementation for VirtualMachinesDeleteFuture.Result. 22284func (future *VirtualMachinesDeleteFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 22285 var done bool 22286 done, err = future.DoneWithContext(context.Background(), client) 22287 if err != nil { 22288 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesDeleteFuture", "Result", future.Response(), "Polling failure") 22289 return 22290 } 22291 if !done { 22292 ar.Response = future.Response() 22293 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesDeleteFuture") 22294 return 22295 } 22296 ar.Response = future.Response() 22297 return 22298} 22299 22300// VirtualMachinesInstallPatchesFuture an abstraction for monitoring and retrieving the results of a 22301// long-running operation. 22302type VirtualMachinesInstallPatchesFuture struct { 22303 azure.FutureAPI 22304 // Result returns the result of the asynchronous operation. 22305 // If the operation has not completed it will return an error. 22306 Result func(VirtualMachinesClient) (VirtualMachineInstallPatchesResult, error) 22307} 22308 22309// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22310func (future *VirtualMachinesInstallPatchesFuture) UnmarshalJSON(body []byte) error { 22311 var azFuture azure.Future 22312 if err := json.Unmarshal(body, &azFuture); err != nil { 22313 return err 22314 } 22315 future.FutureAPI = &azFuture 22316 future.Result = future.result 22317 return nil 22318} 22319 22320// result is the default implementation for VirtualMachinesInstallPatchesFuture.Result. 22321func (future *VirtualMachinesInstallPatchesFuture) result(client VirtualMachinesClient) (vmipr VirtualMachineInstallPatchesResult, err error) { 22322 var done bool 22323 done, err = future.DoneWithContext(context.Background(), client) 22324 if err != nil { 22325 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesInstallPatchesFuture", "Result", future.Response(), "Polling failure") 22326 return 22327 } 22328 if !done { 22329 vmipr.Response.Response = future.Response() 22330 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesInstallPatchesFuture") 22331 return 22332 } 22333 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 22334 if vmipr.Response.Response, err = future.GetResult(sender); err == nil && vmipr.Response.Response.StatusCode != http.StatusNoContent { 22335 vmipr, err = client.InstallPatchesResponder(vmipr.Response.Response) 22336 if err != nil { 22337 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesInstallPatchesFuture", "Result", vmipr.Response.Response, "Failure responding to request") 22338 } 22339 } 22340 return 22341} 22342 22343// VirtualMachineSize describes the properties of a VM size. 22344type VirtualMachineSize struct { 22345 // Name - The name of the virtual machine size. 22346 Name *string `json:"name,omitempty"` 22347 // 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 22348 NumberOfCores *int32 `json:"numberOfCores,omitempty"` 22349 // OsDiskSizeInMB - The OS disk size, in MB, allowed by the virtual machine size. 22350 OsDiskSizeInMB *int32 `json:"osDiskSizeInMB,omitempty"` 22351 // ResourceDiskSizeInMB - The resource disk size, in MB, allowed by the virtual machine size. 22352 ResourceDiskSizeInMB *int32 `json:"resourceDiskSizeInMB,omitempty"` 22353 // MemoryInMB - The amount of memory, in MB, supported by the virtual machine size. 22354 MemoryInMB *int32 `json:"memoryInMB,omitempty"` 22355 // MaxDataDiskCount - The maximum number of data disks that can be attached to the virtual machine size. 22356 MaxDataDiskCount *int32 `json:"maxDataDiskCount,omitempty"` 22357} 22358 22359// VirtualMachineSizeListResult the List Virtual Machine operation response. 22360type VirtualMachineSizeListResult struct { 22361 autorest.Response `json:"-"` 22362 // Value - The list of virtual machine sizes. 22363 Value *[]VirtualMachineSize `json:"value,omitempty"` 22364} 22365 22366// VirtualMachineSoftwarePatchProperties describes the properties of a Virtual Machine software patch. 22367type VirtualMachineSoftwarePatchProperties struct { 22368 // PatchID - READ-ONLY; A unique identifier for the patch. 22369 PatchID *string `json:"patchId,omitempty"` 22370 // Name - READ-ONLY; The friendly name of the patch. 22371 Name *string `json:"name,omitempty"` 22372 // Version - READ-ONLY; The version number of the patch. This property applies only to Linux patches. 22373 Version *string `json:"version,omitempty"` 22374 // KbID - READ-ONLY; The KBID of the patch. Only applies to Windows patches. 22375 KbID *string `json:"kbId,omitempty"` 22376 // Classifications - READ-ONLY; The classification(s) of the patch as provided by the patch publisher. 22377 Classifications *[]string `json:"classifications,omitempty"` 22378 // RebootBehavior - READ-ONLY; Describes the reboot requirements of the patch. Possible values include: 'VMGuestPatchRebootBehaviorUnknown', 'VMGuestPatchRebootBehaviorNeverReboots', 'VMGuestPatchRebootBehaviorAlwaysRequiresReboot', 'VMGuestPatchRebootBehaviorCanRequestReboot' 22379 RebootBehavior VMGuestPatchRebootBehavior `json:"rebootBehavior,omitempty"` 22380 // ActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. 22381 ActivityID *string `json:"activityId,omitempty"` 22382 // PublishedDate - READ-ONLY; The UTC timestamp when the repository published this patch. 22383 PublishedDate *date.Time `json:"publishedDate,omitempty"` 22384 // LastModifiedDateTime - READ-ONLY; The UTC timestamp of the last update to this patch record. 22385 LastModifiedDateTime *date.Time `json:"lastModifiedDateTime,omitempty"` 22386 // AssessmentState - READ-ONLY; Describes the availability of a given patch. Possible values include: 'PatchAssessmentStateUnknown', 'PatchAssessmentStateAvailable' 22387 AssessmentState PatchAssessmentState `json:"assessmentState,omitempty"` 22388} 22389 22390// MarshalJSON is the custom marshaler for VirtualMachineSoftwarePatchProperties. 22391func (vmspp VirtualMachineSoftwarePatchProperties) MarshalJSON() ([]byte, error) { 22392 objectMap := make(map[string]interface{}) 22393 return json.Marshal(objectMap) 22394} 22395 22396// VirtualMachinesPerformMaintenanceFuture an abstraction for monitoring and retrieving the results of a 22397// long-running operation. 22398type VirtualMachinesPerformMaintenanceFuture struct { 22399 azure.FutureAPI 22400 // Result returns the result of the asynchronous operation. 22401 // If the operation has not completed it will return an error. 22402 Result func(VirtualMachinesClient) (autorest.Response, error) 22403} 22404 22405// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22406func (future *VirtualMachinesPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { 22407 var azFuture azure.Future 22408 if err := json.Unmarshal(body, &azFuture); err != nil { 22409 return err 22410 } 22411 future.FutureAPI = &azFuture 22412 future.Result = future.result 22413 return nil 22414} 22415 22416// result is the default implementation for VirtualMachinesPerformMaintenanceFuture.Result. 22417func (future *VirtualMachinesPerformMaintenanceFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 22418 var done bool 22419 done, err = future.DoneWithContext(context.Background(), client) 22420 if err != nil { 22421 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesPerformMaintenanceFuture", "Result", future.Response(), "Polling failure") 22422 return 22423 } 22424 if !done { 22425 ar.Response = future.Response() 22426 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesPerformMaintenanceFuture") 22427 return 22428 } 22429 ar.Response = future.Response() 22430 return 22431} 22432 22433// VirtualMachinesPowerOffFuture an abstraction for monitoring and retrieving the results of a long-running 22434// operation. 22435type VirtualMachinesPowerOffFuture struct { 22436 azure.FutureAPI 22437 // Result returns the result of the asynchronous operation. 22438 // If the operation has not completed it will return an error. 22439 Result func(VirtualMachinesClient) (autorest.Response, error) 22440} 22441 22442// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22443func (future *VirtualMachinesPowerOffFuture) UnmarshalJSON(body []byte) error { 22444 var azFuture azure.Future 22445 if err := json.Unmarshal(body, &azFuture); err != nil { 22446 return err 22447 } 22448 future.FutureAPI = &azFuture 22449 future.Result = future.result 22450 return nil 22451} 22452 22453// result is the default implementation for VirtualMachinesPowerOffFuture.Result. 22454func (future *VirtualMachinesPowerOffFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 22455 var done bool 22456 done, err = future.DoneWithContext(context.Background(), client) 22457 if err != nil { 22458 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesPowerOffFuture", "Result", future.Response(), "Polling failure") 22459 return 22460 } 22461 if !done { 22462 ar.Response = future.Response() 22463 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesPowerOffFuture") 22464 return 22465 } 22466 ar.Response = future.Response() 22467 return 22468} 22469 22470// VirtualMachinesReapplyFuture an abstraction for monitoring and retrieving the results of a long-running 22471// operation. 22472type VirtualMachinesReapplyFuture struct { 22473 azure.FutureAPI 22474 // Result returns the result of the asynchronous operation. 22475 // If the operation has not completed it will return an error. 22476 Result func(VirtualMachinesClient) (autorest.Response, error) 22477} 22478 22479// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22480func (future *VirtualMachinesReapplyFuture) UnmarshalJSON(body []byte) error { 22481 var azFuture azure.Future 22482 if err := json.Unmarshal(body, &azFuture); err != nil { 22483 return err 22484 } 22485 future.FutureAPI = &azFuture 22486 future.Result = future.result 22487 return nil 22488} 22489 22490// result is the default implementation for VirtualMachinesReapplyFuture.Result. 22491func (future *VirtualMachinesReapplyFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 22492 var done bool 22493 done, err = future.DoneWithContext(context.Background(), client) 22494 if err != nil { 22495 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesReapplyFuture", "Result", future.Response(), "Polling failure") 22496 return 22497 } 22498 if !done { 22499 ar.Response = future.Response() 22500 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesReapplyFuture") 22501 return 22502 } 22503 ar.Response = future.Response() 22504 return 22505} 22506 22507// VirtualMachinesRedeployFuture an abstraction for monitoring and retrieving the results of a long-running 22508// operation. 22509type VirtualMachinesRedeployFuture struct { 22510 azure.FutureAPI 22511 // Result returns the result of the asynchronous operation. 22512 // If the operation has not completed it will return an error. 22513 Result func(VirtualMachinesClient) (autorest.Response, error) 22514} 22515 22516// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22517func (future *VirtualMachinesRedeployFuture) UnmarshalJSON(body []byte) error { 22518 var azFuture azure.Future 22519 if err := json.Unmarshal(body, &azFuture); err != nil { 22520 return err 22521 } 22522 future.FutureAPI = &azFuture 22523 future.Result = future.result 22524 return nil 22525} 22526 22527// result is the default implementation for VirtualMachinesRedeployFuture.Result. 22528func (future *VirtualMachinesRedeployFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 22529 var done bool 22530 done, err = future.DoneWithContext(context.Background(), client) 22531 if err != nil { 22532 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRedeployFuture", "Result", future.Response(), "Polling failure") 22533 return 22534 } 22535 if !done { 22536 ar.Response = future.Response() 22537 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRedeployFuture") 22538 return 22539 } 22540 ar.Response = future.Response() 22541 return 22542} 22543 22544// VirtualMachinesReimageFuture an abstraction for monitoring and retrieving the results of a long-running 22545// operation. 22546type VirtualMachinesReimageFuture struct { 22547 azure.FutureAPI 22548 // Result returns the result of the asynchronous operation. 22549 // If the operation has not completed it will return an error. 22550 Result func(VirtualMachinesClient) (autorest.Response, error) 22551} 22552 22553// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22554func (future *VirtualMachinesReimageFuture) UnmarshalJSON(body []byte) error { 22555 var azFuture azure.Future 22556 if err := json.Unmarshal(body, &azFuture); err != nil { 22557 return err 22558 } 22559 future.FutureAPI = &azFuture 22560 future.Result = future.result 22561 return nil 22562} 22563 22564// result is the default implementation for VirtualMachinesReimageFuture.Result. 22565func (future *VirtualMachinesReimageFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 22566 var done bool 22567 done, err = future.DoneWithContext(context.Background(), client) 22568 if err != nil { 22569 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesReimageFuture", "Result", future.Response(), "Polling failure") 22570 return 22571 } 22572 if !done { 22573 ar.Response = future.Response() 22574 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesReimageFuture") 22575 return 22576 } 22577 ar.Response = future.Response() 22578 return 22579} 22580 22581// VirtualMachinesRestartFuture an abstraction for monitoring and retrieving the results of a long-running 22582// operation. 22583type VirtualMachinesRestartFuture struct { 22584 azure.FutureAPI 22585 // Result returns the result of the asynchronous operation. 22586 // If the operation has not completed it will return an error. 22587 Result func(VirtualMachinesClient) (autorest.Response, error) 22588} 22589 22590// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22591func (future *VirtualMachinesRestartFuture) UnmarshalJSON(body []byte) error { 22592 var azFuture azure.Future 22593 if err := json.Unmarshal(body, &azFuture); err != nil { 22594 return err 22595 } 22596 future.FutureAPI = &azFuture 22597 future.Result = future.result 22598 return nil 22599} 22600 22601// result is the default implementation for VirtualMachinesRestartFuture.Result. 22602func (future *VirtualMachinesRestartFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 22603 var done bool 22604 done, err = future.DoneWithContext(context.Background(), client) 22605 if err != nil { 22606 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRestartFuture", "Result", future.Response(), "Polling failure") 22607 return 22608 } 22609 if !done { 22610 ar.Response = future.Response() 22611 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRestartFuture") 22612 return 22613 } 22614 ar.Response = future.Response() 22615 return 22616} 22617 22618// VirtualMachinesRunCommandFuture an abstraction for monitoring and retrieving the results of a 22619// long-running operation. 22620type VirtualMachinesRunCommandFuture struct { 22621 azure.FutureAPI 22622 // Result returns the result of the asynchronous operation. 22623 // If the operation has not completed it will return an error. 22624 Result func(VirtualMachinesClient) (RunCommandResult, error) 22625} 22626 22627// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22628func (future *VirtualMachinesRunCommandFuture) UnmarshalJSON(body []byte) error { 22629 var azFuture azure.Future 22630 if err := json.Unmarshal(body, &azFuture); err != nil { 22631 return err 22632 } 22633 future.FutureAPI = &azFuture 22634 future.Result = future.result 22635 return nil 22636} 22637 22638// result is the default implementation for VirtualMachinesRunCommandFuture.Result. 22639func (future *VirtualMachinesRunCommandFuture) result(client VirtualMachinesClient) (rcr RunCommandResult, err error) { 22640 var done bool 22641 done, err = future.DoneWithContext(context.Background(), client) 22642 if err != nil { 22643 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRunCommandFuture", "Result", future.Response(), "Polling failure") 22644 return 22645 } 22646 if !done { 22647 rcr.Response.Response = future.Response() 22648 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRunCommandFuture") 22649 return 22650 } 22651 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 22652 if rcr.Response.Response, err = future.GetResult(sender); err == nil && rcr.Response.Response.StatusCode != http.StatusNoContent { 22653 rcr, err = client.RunCommandResponder(rcr.Response.Response) 22654 if err != nil { 22655 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRunCommandFuture", "Result", rcr.Response.Response, "Failure responding to request") 22656 } 22657 } 22658 return 22659} 22660 22661// VirtualMachinesStartFuture an abstraction for monitoring and retrieving the results of a long-running 22662// operation. 22663type VirtualMachinesStartFuture struct { 22664 azure.FutureAPI 22665 // Result returns the result of the asynchronous operation. 22666 // If the operation has not completed it will return an error. 22667 Result func(VirtualMachinesClient) (autorest.Response, error) 22668} 22669 22670// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22671func (future *VirtualMachinesStartFuture) UnmarshalJSON(body []byte) error { 22672 var azFuture azure.Future 22673 if err := json.Unmarshal(body, &azFuture); err != nil { 22674 return err 22675 } 22676 future.FutureAPI = &azFuture 22677 future.Result = future.result 22678 return nil 22679} 22680 22681// result is the default implementation for VirtualMachinesStartFuture.Result. 22682func (future *VirtualMachinesStartFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 22683 var done bool 22684 done, err = future.DoneWithContext(context.Background(), client) 22685 if err != nil { 22686 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesStartFuture", "Result", future.Response(), "Polling failure") 22687 return 22688 } 22689 if !done { 22690 ar.Response = future.Response() 22691 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesStartFuture") 22692 return 22693 } 22694 ar.Response = future.Response() 22695 return 22696} 22697 22698// VirtualMachineStatusCodeCount the status code and count of the virtual machine scale set instance view 22699// status summary. 22700type VirtualMachineStatusCodeCount struct { 22701 // Code - READ-ONLY; The instance view status code. 22702 Code *string `json:"code,omitempty"` 22703 // Count - READ-ONLY; The number of instances having a particular status code. 22704 Count *int32 `json:"count,omitempty"` 22705} 22706 22707// MarshalJSON is the custom marshaler for VirtualMachineStatusCodeCount. 22708func (vmscc VirtualMachineStatusCodeCount) MarshalJSON() ([]byte, error) { 22709 objectMap := make(map[string]interface{}) 22710 return json.Marshal(objectMap) 22711} 22712 22713// VirtualMachinesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 22714// operation. 22715type VirtualMachinesUpdateFuture struct { 22716 azure.FutureAPI 22717 // Result returns the result of the asynchronous operation. 22718 // If the operation has not completed it will return an error. 22719 Result func(VirtualMachinesClient) (VirtualMachine, error) 22720} 22721 22722// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22723func (future *VirtualMachinesUpdateFuture) UnmarshalJSON(body []byte) error { 22724 var azFuture azure.Future 22725 if err := json.Unmarshal(body, &azFuture); err != nil { 22726 return err 22727 } 22728 future.FutureAPI = &azFuture 22729 future.Result = future.result 22730 return nil 22731} 22732 22733// result is the default implementation for VirtualMachinesUpdateFuture.Result. 22734func (future *VirtualMachinesUpdateFuture) result(client VirtualMachinesClient) (VM VirtualMachine, err error) { 22735 var done bool 22736 done, err = future.DoneWithContext(context.Background(), client) 22737 if err != nil { 22738 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesUpdateFuture", "Result", future.Response(), "Polling failure") 22739 return 22740 } 22741 if !done { 22742 VM.Response.Response = future.Response() 22743 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesUpdateFuture") 22744 return 22745 } 22746 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 22747 if VM.Response.Response, err = future.GetResult(sender); err == nil && VM.Response.Response.StatusCode != http.StatusNoContent { 22748 VM, err = client.UpdateResponder(VM.Response.Response) 22749 if err != nil { 22750 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesUpdateFuture", "Result", VM.Response.Response, "Failure responding to request") 22751 } 22752 } 22753 return 22754} 22755 22756// VirtualMachineUpdate describes a Virtual Machine Update. 22757type VirtualMachineUpdate struct { 22758 // 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**. 22759 Plan *Plan `json:"plan,omitempty"` 22760 *VirtualMachineProperties `json:"properties,omitempty"` 22761 // Identity - The identity of the virtual machine, if configured. 22762 Identity *VirtualMachineIdentity `json:"identity,omitempty"` 22763 // Zones - The virtual machine zones. 22764 Zones *[]string `json:"zones,omitempty"` 22765 // Tags - Resource tags 22766 Tags map[string]*string `json:"tags"` 22767} 22768 22769// MarshalJSON is the custom marshaler for VirtualMachineUpdate. 22770func (vmu VirtualMachineUpdate) MarshalJSON() ([]byte, error) { 22771 objectMap := make(map[string]interface{}) 22772 if vmu.Plan != nil { 22773 objectMap["plan"] = vmu.Plan 22774 } 22775 if vmu.VirtualMachineProperties != nil { 22776 objectMap["properties"] = vmu.VirtualMachineProperties 22777 } 22778 if vmu.Identity != nil { 22779 objectMap["identity"] = vmu.Identity 22780 } 22781 if vmu.Zones != nil { 22782 objectMap["zones"] = vmu.Zones 22783 } 22784 if vmu.Tags != nil { 22785 objectMap["tags"] = vmu.Tags 22786 } 22787 return json.Marshal(objectMap) 22788} 22789 22790// UnmarshalJSON is the custom unmarshaler for VirtualMachineUpdate struct. 22791func (vmu *VirtualMachineUpdate) UnmarshalJSON(body []byte) error { 22792 var m map[string]*json.RawMessage 22793 err := json.Unmarshal(body, &m) 22794 if err != nil { 22795 return err 22796 } 22797 for k, v := range m { 22798 switch k { 22799 case "plan": 22800 if v != nil { 22801 var plan Plan 22802 err = json.Unmarshal(*v, &plan) 22803 if err != nil { 22804 return err 22805 } 22806 vmu.Plan = &plan 22807 } 22808 case "properties": 22809 if v != nil { 22810 var virtualMachineProperties VirtualMachineProperties 22811 err = json.Unmarshal(*v, &virtualMachineProperties) 22812 if err != nil { 22813 return err 22814 } 22815 vmu.VirtualMachineProperties = &virtualMachineProperties 22816 } 22817 case "identity": 22818 if v != nil { 22819 var identity VirtualMachineIdentity 22820 err = json.Unmarshal(*v, &identity) 22821 if err != nil { 22822 return err 22823 } 22824 vmu.Identity = &identity 22825 } 22826 case "zones": 22827 if v != nil { 22828 var zones []string 22829 err = json.Unmarshal(*v, &zones) 22830 if err != nil { 22831 return err 22832 } 22833 vmu.Zones = &zones 22834 } 22835 case "tags": 22836 if v != nil { 22837 var tags map[string]*string 22838 err = json.Unmarshal(*v, &tags) 22839 if err != nil { 22840 return err 22841 } 22842 vmu.Tags = tags 22843 } 22844 } 22845 } 22846 22847 return nil 22848} 22849 22850// VMScaleSetConvertToSinglePlacementGroupInput ... 22851type VMScaleSetConvertToSinglePlacementGroupInput struct { 22852 // 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. 22853 ActivePlacementGroupID *string `json:"activePlacementGroupId,omitempty"` 22854} 22855 22856// WindowsConfiguration specifies Windows operating system settings on the virtual machine. 22857type WindowsConfiguration struct { 22858 // 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. 22859 ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` 22860 // 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. 22861 EnableAutomaticUpdates *bool `json:"enableAutomaticUpdates,omitempty"` 22862 // 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). 22863 TimeZone *string `json:"timeZone,omitempty"` 22864 // AdditionalUnattendContent - Specifies additional base-64 encoded XML formatted information that can be included in the Unattend.xml file, which is used by Windows Setup. 22865 AdditionalUnattendContent *[]AdditionalUnattendContent `json:"additionalUnattendContent,omitempty"` 22866 // PatchSettings - [Preview Feature] Specifies settings related to VM Guest Patching on Windows. 22867 PatchSettings *PatchSettings `json:"patchSettings,omitempty"` 22868 // WinRM - Specifies the Windows Remote Management listeners. This enables remote Windows PowerShell. 22869 WinRM *WinRMConfiguration `json:"winRM,omitempty"` 22870} 22871 22872// WindowsParameters input for InstallPatches on a Windows VM, as directly received by the API 22873type WindowsParameters struct { 22874 // ClassificationsToInclude - The update classifications to select when installing patches for Windows. 22875 ClassificationsToInclude *[]VMGuestPatchClassificationWindows `json:"classificationsToInclude,omitempty"` 22876 // KbNumbersToInclude - Kbs to include in the patch operation 22877 KbNumbersToInclude *[]string `json:"kbNumbersToInclude,omitempty"` 22878 // KbNumbersToExclude - Kbs to exclude in the patch operation 22879 KbNumbersToExclude *[]string `json:"kbNumbersToExclude,omitempty"` 22880 // ExcludeKbsRequiringReboot - Filters out Kbs that don't have an InstallationRebootBehavior of 'NeverReboots' when this is set to true. 22881 ExcludeKbsRequiringReboot *bool `json:"excludeKbsRequiringReboot,omitempty"` 22882 // MaxPatchPublishDate - This is used to install patches that were published on or before this given max published date. 22883 MaxPatchPublishDate *date.Time `json:"maxPatchPublishDate,omitempty"` 22884} 22885 22886// WinRMConfiguration describes Windows Remote Management configuration of the VM 22887type WinRMConfiguration struct { 22888 // Listeners - The list of Windows Remote Management listeners 22889 Listeners *[]WinRMListener `json:"listeners,omitempty"` 22890} 22891 22892// WinRMListener describes Protocol and thumbprint of Windows Remote Management listener 22893type WinRMListener struct { 22894 // Protocol - Specifies the protocol of WinRM listener. <br><br> Possible values are: <br>**http** <br><br> **https**. Possible values include: 'ProtocolTypesHTTP', 'ProtocolTypesHTTPS' 22895 Protocol ProtocolTypes `json:"protocol,omitempty"` 22896 // 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>} 22897 CertificateURL *string `json:"certificateUrl,omitempty"` 22898} 22899