1package compute 2 3// Copyright (c) Microsoft Corporation. All rights reserved. 4// Licensed under the MIT License. See License.txt in the project root for license information. 5// 6// Code generated by Microsoft (R) AutoRest Code Generator. 7// Changes may cause incorrect behavior and will be lost if the code is regenerated. 8 9import ( 10 "context" 11 "encoding/json" 12 "github.com/Azure/go-autorest/autorest" 13 "github.com/Azure/go-autorest/autorest/azure" 14 "github.com/Azure/go-autorest/autorest/date" 15 "github.com/Azure/go-autorest/autorest/to" 16 "github.com/Azure/go-autorest/tracing" 17 "net/http" 18) 19 20// The package's fully qualified name. 21const fqdn = "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2020-06-30/compute" 22 23// AccessURI a disk access SAS uri. 24type AccessURI struct { 25 autorest.Response `json:"-"` 26 // AccessSAS - READ-ONLY; A SAS uri for accessing a disk. 27 AccessSAS *string `json:"accessSAS,omitempty"` 28} 29 30// MarshalJSON is the custom marshaler for AccessURI. 31func (au AccessURI) MarshalJSON() ([]byte, error) { 32 objectMap := make(map[string]interface{}) 33 return json.Marshal(objectMap) 34} 35 36// AdditionalCapabilities enables or disables a capability on the virtual machine or virtual machine scale 37// set. 38type AdditionalCapabilities struct { 39 // 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. 40 UltraSSDEnabled *bool `json:"ultraSSDEnabled,omitempty"` 41} 42 43// AdditionalUnattendContent specifies additional XML formatted information that can be included in the 44// Unattend.xml file, which is used by Windows Setup. Contents are defined by setting name, component name, 45// and the pass in which the content is applied. 46type AdditionalUnattendContent struct { 47 // PassName - The pass name. Currently, the only allowable value is OobeSystem. Possible values include: 'OobeSystem' 48 PassName PassNames `json:"passName,omitempty"` 49 // ComponentName - The component name. Currently, the only allowable value is Microsoft-Windows-Shell-Setup. Possible values include: 'MicrosoftWindowsShellSetup' 50 ComponentName ComponentNames `json:"componentName,omitempty"` 51 // SettingName - Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon. Possible values include: 'AutoLogon', 'FirstLogonCommands' 52 SettingName SettingNames `json:"settingName,omitempty"` 53 // 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. 54 Content *string `json:"content,omitempty"` 55} 56 57// APIEntityReference the API entity reference. 58type APIEntityReference struct { 59 // ID - The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... 60 ID *string `json:"id,omitempty"` 61} 62 63// APIError api error. 64type APIError struct { 65 // Details - The Api error details 66 Details *[]APIErrorBase `json:"details,omitempty"` 67 // Innererror - The Api inner error 68 Innererror *InnerError `json:"innererror,omitempty"` 69 // Code - The error code. 70 Code *string `json:"code,omitempty"` 71 // Target - The target of the particular error. 72 Target *string `json:"target,omitempty"` 73 // Message - The error message. 74 Message *string `json:"message,omitempty"` 75} 76 77// APIErrorBase api error base. 78type APIErrorBase struct { 79 // Code - The error code. 80 Code *string `json:"code,omitempty"` 81 // Target - The target of the particular error. 82 Target *string `json:"target,omitempty"` 83 // Message - The error message. 84 Message *string `json:"message,omitempty"` 85} 86 87// AutomaticOSUpgradePolicy the configuration parameters used for performing automatic OS upgrade. 88type AutomaticOSUpgradePolicy struct { 89 // 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. 90 EnableAutomaticOSUpgrade *bool `json:"enableAutomaticOSUpgrade,omitempty"` 91 // DisableAutomaticRollback - Whether OS image rollback feature should be disabled. Default value is false. 92 DisableAutomaticRollback *bool `json:"disableAutomaticRollback,omitempty"` 93} 94 95// AutomaticOSUpgradeProperties describes automatic OS upgrade properties on the image. 96type AutomaticOSUpgradeProperties struct { 97 // AutomaticOSUpgradeSupported - Specifies whether automatic OS upgrade is supported on the image. 98 AutomaticOSUpgradeSupported *bool `json:"automaticOSUpgradeSupported,omitempty"` 99} 100 101// AutomaticRepairsPolicy specifies the configuration parameters for automatic repairs on the virtual 102// machine scale set. 103type AutomaticRepairsPolicy struct { 104 // Enabled - Specifies whether automatic repairs should be enabled on the virtual machine scale set. The default value is false. 105 Enabled *bool `json:"enabled,omitempty"` 106 // 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). 107 GracePeriod *string `json:"gracePeriod,omitempty"` 108} 109 110// AvailabilitySet specifies information about the availability set that the virtual machine should be 111// assigned to. Virtual machines specified in the same availability set are allocated to different nodes to 112// maximize availability. For more information about availability sets, see [Manage the availability of 113// virtual 114// machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). 115// <br><br> For more information on Azure planned maintenance, see [Planned maintenance for virtual 116// machines in 117// Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) 118// <br><br> Currently, a VM can only be added to availability set at creation time. An existing VM cannot 119// be added to an availability set. 120type AvailabilitySet struct { 121 autorest.Response `json:"-"` 122 *AvailabilitySetProperties `json:"properties,omitempty"` 123 // 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'. 124 Sku *Sku `json:"sku,omitempty"` 125 // ID - READ-ONLY; Resource Id 126 ID *string `json:"id,omitempty"` 127 // Name - READ-ONLY; Resource name 128 Name *string `json:"name,omitempty"` 129 // Type - READ-ONLY; Resource type 130 Type *string `json:"type,omitempty"` 131 // Location - Resource location 132 Location *string `json:"location,omitempty"` 133 // Tags - Resource tags 134 Tags map[string]*string `json:"tags"` 135} 136 137// MarshalJSON is the custom marshaler for AvailabilitySet. 138func (as AvailabilitySet) MarshalJSON() ([]byte, error) { 139 objectMap := make(map[string]interface{}) 140 if as.AvailabilitySetProperties != nil { 141 objectMap["properties"] = as.AvailabilitySetProperties 142 } 143 if as.Sku != nil { 144 objectMap["sku"] = as.Sku 145 } 146 if as.Location != nil { 147 objectMap["location"] = as.Location 148 } 149 if as.Tags != nil { 150 objectMap["tags"] = as.Tags 151 } 152 return json.Marshal(objectMap) 153} 154 155// UnmarshalJSON is the custom unmarshaler for AvailabilitySet struct. 156func (as *AvailabilitySet) UnmarshalJSON(body []byte) error { 157 var m map[string]*json.RawMessage 158 err := json.Unmarshal(body, &m) 159 if err != nil { 160 return err 161 } 162 for k, v := range m { 163 switch k { 164 case "properties": 165 if v != nil { 166 var availabilitySetProperties AvailabilitySetProperties 167 err = json.Unmarshal(*v, &availabilitySetProperties) 168 if err != nil { 169 return err 170 } 171 as.AvailabilitySetProperties = &availabilitySetProperties 172 } 173 case "sku": 174 if v != nil { 175 var sku Sku 176 err = json.Unmarshal(*v, &sku) 177 if err != nil { 178 return err 179 } 180 as.Sku = &sku 181 } 182 case "id": 183 if v != nil { 184 var ID string 185 err = json.Unmarshal(*v, &ID) 186 if err != nil { 187 return err 188 } 189 as.ID = &ID 190 } 191 case "name": 192 if v != nil { 193 var name string 194 err = json.Unmarshal(*v, &name) 195 if err != nil { 196 return err 197 } 198 as.Name = &name 199 } 200 case "type": 201 if v != nil { 202 var typeVar string 203 err = json.Unmarshal(*v, &typeVar) 204 if err != nil { 205 return err 206 } 207 as.Type = &typeVar 208 } 209 case "location": 210 if v != nil { 211 var location string 212 err = json.Unmarshal(*v, &location) 213 if err != nil { 214 return err 215 } 216 as.Location = &location 217 } 218 case "tags": 219 if v != nil { 220 var tags map[string]*string 221 err = json.Unmarshal(*v, &tags) 222 if err != nil { 223 return err 224 } 225 as.Tags = tags 226 } 227 } 228 } 229 230 return nil 231} 232 233// AvailabilitySetListResult the List Availability Set operation response. 234type AvailabilitySetListResult struct { 235 autorest.Response `json:"-"` 236 // Value - The list of availability sets 237 Value *[]AvailabilitySet `json:"value,omitempty"` 238 // NextLink - The URI to fetch the next page of AvailabilitySets. Call ListNext() with this URI to fetch the next page of AvailabilitySets. 239 NextLink *string `json:"nextLink,omitempty"` 240} 241 242// AvailabilitySetListResultIterator provides access to a complete listing of AvailabilitySet values. 243type AvailabilitySetListResultIterator struct { 244 i int 245 page AvailabilitySetListResultPage 246} 247 248// NextWithContext advances to the next value. If there was an error making 249// the request the iterator does not advance and the error is returned. 250func (iter *AvailabilitySetListResultIterator) NextWithContext(ctx context.Context) (err error) { 251 if tracing.IsEnabled() { 252 ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetListResultIterator.NextWithContext") 253 defer func() { 254 sc := -1 255 if iter.Response().Response.Response != nil { 256 sc = iter.Response().Response.Response.StatusCode 257 } 258 tracing.EndSpan(ctx, sc, err) 259 }() 260 } 261 iter.i++ 262 if iter.i < len(iter.page.Values()) { 263 return nil 264 } 265 err = iter.page.NextWithContext(ctx) 266 if err != nil { 267 iter.i-- 268 return err 269 } 270 iter.i = 0 271 return nil 272} 273 274// Next advances to the next value. If there was an error making 275// the request the iterator does not advance and the error is returned. 276// Deprecated: Use NextWithContext() instead. 277func (iter *AvailabilitySetListResultIterator) Next() error { 278 return iter.NextWithContext(context.Background()) 279} 280 281// NotDone returns true if the enumeration should be started or is not yet complete. 282func (iter AvailabilitySetListResultIterator) NotDone() bool { 283 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 284} 285 286// Response returns the raw server response from the last page request. 287func (iter AvailabilitySetListResultIterator) Response() AvailabilitySetListResult { 288 return iter.page.Response() 289} 290 291// Value returns the current value or a zero-initialized value if the 292// iterator has advanced beyond the end of the collection. 293func (iter AvailabilitySetListResultIterator) Value() AvailabilitySet { 294 if !iter.page.NotDone() { 295 return AvailabilitySet{} 296 } 297 return iter.page.Values()[iter.i] 298} 299 300// Creates a new instance of the AvailabilitySetListResultIterator type. 301func NewAvailabilitySetListResultIterator(page AvailabilitySetListResultPage) AvailabilitySetListResultIterator { 302 return AvailabilitySetListResultIterator{page: page} 303} 304 305// IsEmpty returns true if the ListResult contains no values. 306func (aslr AvailabilitySetListResult) IsEmpty() bool { 307 return aslr.Value == nil || len(*aslr.Value) == 0 308} 309 310// hasNextLink returns true if the NextLink is not empty. 311func (aslr AvailabilitySetListResult) hasNextLink() bool { 312 return aslr.NextLink != nil && len(*aslr.NextLink) != 0 313} 314 315// availabilitySetListResultPreparer prepares a request to retrieve the next set of results. 316// It returns nil if no more results exist. 317func (aslr AvailabilitySetListResult) availabilitySetListResultPreparer(ctx context.Context) (*http.Request, error) { 318 if !aslr.hasNextLink() { 319 return nil, nil 320 } 321 return autorest.Prepare((&http.Request{}).WithContext(ctx), 322 autorest.AsJSON(), 323 autorest.AsGet(), 324 autorest.WithBaseURL(to.String(aslr.NextLink))) 325} 326 327// AvailabilitySetListResultPage contains a page of AvailabilitySet values. 328type AvailabilitySetListResultPage struct { 329 fn func(context.Context, AvailabilitySetListResult) (AvailabilitySetListResult, error) 330 aslr AvailabilitySetListResult 331} 332 333// NextWithContext advances to the next page of values. If there was an error making 334// the request the page does not advance and the error is returned. 335func (page *AvailabilitySetListResultPage) NextWithContext(ctx context.Context) (err error) { 336 if tracing.IsEnabled() { 337 ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetListResultPage.NextWithContext") 338 defer func() { 339 sc := -1 340 if page.Response().Response.Response != nil { 341 sc = page.Response().Response.Response.StatusCode 342 } 343 tracing.EndSpan(ctx, sc, err) 344 }() 345 } 346 for { 347 next, err := page.fn(ctx, page.aslr) 348 if err != nil { 349 return err 350 } 351 page.aslr = next 352 if !next.hasNextLink() || !next.IsEmpty() { 353 break 354 } 355 } 356 return nil 357} 358 359// Next advances to the next page of values. If there was an error making 360// the request the page does not advance and the error is returned. 361// Deprecated: Use NextWithContext() instead. 362func (page *AvailabilitySetListResultPage) Next() error { 363 return page.NextWithContext(context.Background()) 364} 365 366// NotDone returns true if the page enumeration should be started or is not yet complete. 367func (page AvailabilitySetListResultPage) NotDone() bool { 368 return !page.aslr.IsEmpty() 369} 370 371// Response returns the raw server response from the last page request. 372func (page AvailabilitySetListResultPage) Response() AvailabilitySetListResult { 373 return page.aslr 374} 375 376// Values returns the slice of values for the current page or nil if there are no values. 377func (page AvailabilitySetListResultPage) Values() []AvailabilitySet { 378 if page.aslr.IsEmpty() { 379 return nil 380 } 381 return *page.aslr.Value 382} 383 384// Creates a new instance of the AvailabilitySetListResultPage type. 385func NewAvailabilitySetListResultPage(cur AvailabilitySetListResult, getNextPage func(context.Context, AvailabilitySetListResult) (AvailabilitySetListResult, error)) AvailabilitySetListResultPage { 386 return AvailabilitySetListResultPage{ 387 fn: getNextPage, 388 aslr: cur, 389 } 390} 391 392// AvailabilitySetProperties the instance view of a resource. 393type AvailabilitySetProperties struct { 394 // PlatformUpdateDomainCount - Update Domain count. 395 PlatformUpdateDomainCount *int32 `json:"platformUpdateDomainCount,omitempty"` 396 // PlatformFaultDomainCount - Fault Domain count. 397 PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` 398 // VirtualMachines - A list of references to all virtual machines in the availability set. 399 VirtualMachines *[]SubResource `json:"virtualMachines,omitempty"` 400 // ProximityPlacementGroup - Specifies information about the proximity placement group that the availability set should be assigned to. <br><br>Minimum api-version: 2018-04-01. 401 ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` 402 // Statuses - READ-ONLY; The resource status information. 403 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 404} 405 406// MarshalJSON is the custom marshaler for AvailabilitySetProperties. 407func (asp AvailabilitySetProperties) MarshalJSON() ([]byte, error) { 408 objectMap := make(map[string]interface{}) 409 if asp.PlatformUpdateDomainCount != nil { 410 objectMap["platformUpdateDomainCount"] = asp.PlatformUpdateDomainCount 411 } 412 if asp.PlatformFaultDomainCount != nil { 413 objectMap["platformFaultDomainCount"] = asp.PlatformFaultDomainCount 414 } 415 if asp.VirtualMachines != nil { 416 objectMap["virtualMachines"] = asp.VirtualMachines 417 } 418 if asp.ProximityPlacementGroup != nil { 419 objectMap["proximityPlacementGroup"] = asp.ProximityPlacementGroup 420 } 421 return json.Marshal(objectMap) 422} 423 424// AvailabilitySetUpdate specifies information about the availability set that the virtual machine should 425// be assigned to. Only tags may be updated. 426type AvailabilitySetUpdate struct { 427 *AvailabilitySetProperties `json:"properties,omitempty"` 428 // Sku - Sku of the availability set 429 Sku *Sku `json:"sku,omitempty"` 430 // Tags - Resource tags 431 Tags map[string]*string `json:"tags"` 432} 433 434// MarshalJSON is the custom marshaler for AvailabilitySetUpdate. 435func (asu AvailabilitySetUpdate) MarshalJSON() ([]byte, error) { 436 objectMap := make(map[string]interface{}) 437 if asu.AvailabilitySetProperties != nil { 438 objectMap["properties"] = asu.AvailabilitySetProperties 439 } 440 if asu.Sku != nil { 441 objectMap["sku"] = asu.Sku 442 } 443 if asu.Tags != nil { 444 objectMap["tags"] = asu.Tags 445 } 446 return json.Marshal(objectMap) 447} 448 449// UnmarshalJSON is the custom unmarshaler for AvailabilitySetUpdate struct. 450func (asu *AvailabilitySetUpdate) UnmarshalJSON(body []byte) error { 451 var m map[string]*json.RawMessage 452 err := json.Unmarshal(body, &m) 453 if err != nil { 454 return err 455 } 456 for k, v := range m { 457 switch k { 458 case "properties": 459 if v != nil { 460 var availabilitySetProperties AvailabilitySetProperties 461 err = json.Unmarshal(*v, &availabilitySetProperties) 462 if err != nil { 463 return err 464 } 465 asu.AvailabilitySetProperties = &availabilitySetProperties 466 } 467 case "sku": 468 if v != nil { 469 var sku Sku 470 err = json.Unmarshal(*v, &sku) 471 if err != nil { 472 return err 473 } 474 asu.Sku = &sku 475 } 476 case "tags": 477 if v != nil { 478 var tags map[string]*string 479 err = json.Unmarshal(*v, &tags) 480 if err != nil { 481 return err 482 } 483 asu.Tags = tags 484 } 485 } 486 } 487 488 return nil 489} 490 491// AvailablePatchSummary describes the properties of an virtual machine instance view for available patch 492// summary. 493type AvailablePatchSummary struct { 494 // Status - READ-ONLY; The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Failed", "Succeeded", or "CompletedWithWarnings.". Possible values include: 'PatchOperationStatusInProgress', 'PatchOperationStatusFailed', 'PatchOperationStatusSucceeded', 'PatchOperationStatusCompletedWithWarnings' 495 Status PatchOperationStatus `json:"status,omitempty"` 496 // AssessmentActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. 497 AssessmentActivityID *string `json:"assessmentActivityId,omitempty"` 498 // 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. 499 RebootPending *bool `json:"rebootPending,omitempty"` 500 // CriticalAndSecurityPatchCount - READ-ONLY; The number of critical or security patches that have been detected as available and not yet installed. 501 CriticalAndSecurityPatchCount *int32 `json:"criticalAndSecurityPatchCount,omitempty"` 502 // OtherPatchCount - READ-ONLY; The number of all available patches excluding critical and security. 503 OtherPatchCount *int32 `json:"otherPatchCount,omitempty"` 504 // StartTime - READ-ONLY; The UTC timestamp when the operation began. 505 StartTime *date.Time `json:"startTime,omitempty"` 506 // LastModifiedTime - READ-ONLY; The UTC timestamp when the operation began. 507 LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` 508 // Error - READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. 509 Error *APIError `json:"error,omitempty"` 510} 511 512// MarshalJSON is the custom marshaler for AvailablePatchSummary. 513func (aps AvailablePatchSummary) MarshalJSON() ([]byte, error) { 514 objectMap := make(map[string]interface{}) 515 return json.Marshal(objectMap) 516} 517 518// BillingProfile specifies the billing related details of a Azure Spot VM or VMSS. <br><br>Minimum 519// api-version: 2019-03-01. 520type BillingProfile struct { 521 // 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. 522 MaxPrice *float64 `json:"maxPrice,omitempty"` 523} 524 525// BootDiagnostics boot Diagnostics is a debugging feature which allows you to view Console Output and 526// Screenshot to diagnose VM status. <br><br> You can easily view the output of your console log. <br><br> 527// Azure also enables you to see a screenshot of the VM from the hypervisor. 528type BootDiagnostics struct { 529 // Enabled - Whether boot diagnostics should be enabled on the Virtual Machine. 530 Enabled *bool `json:"enabled,omitempty"` 531 // 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. 532 StorageURI *string `json:"storageUri,omitempty"` 533} 534 535// BootDiagnosticsInstanceView the instance view of a virtual machine boot diagnostics. 536type BootDiagnosticsInstanceView struct { 537 // 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. 538 ConsoleScreenshotBlobURI *string `json:"consoleScreenshotBlobUri,omitempty"` 539 // 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. 540 SerialConsoleLogBlobURI *string `json:"serialConsoleLogBlobUri,omitempty"` 541 // 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. 542 Status *InstanceViewStatus `json:"status,omitempty"` 543} 544 545// MarshalJSON is the custom marshaler for BootDiagnosticsInstanceView. 546func (bdiv BootDiagnosticsInstanceView) MarshalJSON() ([]byte, error) { 547 objectMap := make(map[string]interface{}) 548 return json.Marshal(objectMap) 549} 550 551// CloudError an error response from the Compute service. 552type CloudError struct { 553 Error *APIError `json:"error,omitempty"` 554} 555 556// ContainerService container service. 557type ContainerService struct { 558 autorest.Response `json:"-"` 559 *ContainerServiceProperties `json:"properties,omitempty"` 560 // ID - READ-ONLY; Resource Id 561 ID *string `json:"id,omitempty"` 562 // Name - READ-ONLY; Resource name 563 Name *string `json:"name,omitempty"` 564 // Type - READ-ONLY; Resource type 565 Type *string `json:"type,omitempty"` 566 // Location - Resource location 567 Location *string `json:"location,omitempty"` 568 // Tags - Resource tags 569 Tags map[string]*string `json:"tags"` 570} 571 572// MarshalJSON is the custom marshaler for ContainerService. 573func (cs ContainerService) MarshalJSON() ([]byte, error) { 574 objectMap := make(map[string]interface{}) 575 if cs.ContainerServiceProperties != nil { 576 objectMap["properties"] = cs.ContainerServiceProperties 577 } 578 if cs.Location != nil { 579 objectMap["location"] = cs.Location 580 } 581 if cs.Tags != nil { 582 objectMap["tags"] = cs.Tags 583 } 584 return json.Marshal(objectMap) 585} 586 587// UnmarshalJSON is the custom unmarshaler for ContainerService struct. 588func (cs *ContainerService) UnmarshalJSON(body []byte) error { 589 var m map[string]*json.RawMessage 590 err := json.Unmarshal(body, &m) 591 if err != nil { 592 return err 593 } 594 for k, v := range m { 595 switch k { 596 case "properties": 597 if v != nil { 598 var containerServiceProperties ContainerServiceProperties 599 err = json.Unmarshal(*v, &containerServiceProperties) 600 if err != nil { 601 return err 602 } 603 cs.ContainerServiceProperties = &containerServiceProperties 604 } 605 case "id": 606 if v != nil { 607 var ID string 608 err = json.Unmarshal(*v, &ID) 609 if err != nil { 610 return err 611 } 612 cs.ID = &ID 613 } 614 case "name": 615 if v != nil { 616 var name string 617 err = json.Unmarshal(*v, &name) 618 if err != nil { 619 return err 620 } 621 cs.Name = &name 622 } 623 case "type": 624 if v != nil { 625 var typeVar string 626 err = json.Unmarshal(*v, &typeVar) 627 if err != nil { 628 return err 629 } 630 cs.Type = &typeVar 631 } 632 case "location": 633 if v != nil { 634 var location string 635 err = json.Unmarshal(*v, &location) 636 if err != nil { 637 return err 638 } 639 cs.Location = &location 640 } 641 case "tags": 642 if v != nil { 643 var tags map[string]*string 644 err = json.Unmarshal(*v, &tags) 645 if err != nil { 646 return err 647 } 648 cs.Tags = tags 649 } 650 } 651 } 652 653 return nil 654} 655 656// ContainerServiceAgentPoolProfile profile for the container service agent pool. 657type ContainerServiceAgentPoolProfile struct { 658 // Name - Unique name of the agent pool profile in the context of the subscription and resource group. 659 Name *string `json:"name,omitempty"` 660 // Count - Number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. 661 Count *int32 `json:"count,omitempty"` 662 // VMSize - Size of agent VMs. Possible values include: 'StandardA0', 'StandardA1', 'StandardA2', 'StandardA3', 'StandardA4', 'StandardA5', 'StandardA6', 'StandardA7', 'StandardA8', 'StandardA9', 'StandardA10', 'StandardA11', 'StandardD1', 'StandardD2', 'StandardD3', 'StandardD4', 'StandardD11', 'StandardD12', 'StandardD13', 'StandardD14', 'StandardD1V2', 'StandardD2V2', 'StandardD3V2', 'StandardD4V2', 'StandardD5V2', 'StandardD11V2', 'StandardD12V2', 'StandardD13V2', 'StandardD14V2', 'StandardG1', 'StandardG2', 'StandardG3', 'StandardG4', 'StandardG5', 'StandardDS1', 'StandardDS2', 'StandardDS3', 'StandardDS4', 'StandardDS11', 'StandardDS12', 'StandardDS13', 'StandardDS14', 'StandardGS1', 'StandardGS2', 'StandardGS3', 'StandardGS4', 'StandardGS5' 663 VMSize ContainerServiceVMSizeTypes `json:"vmSize,omitempty"` 664 // DNSPrefix - DNS prefix to be used to create the FQDN for the agent pool. 665 DNSPrefix *string `json:"dnsPrefix,omitempty"` 666 // Fqdn - READ-ONLY; FQDN for the agent pool. 667 Fqdn *string `json:"fqdn,omitempty"` 668} 669 670// MarshalJSON is the custom marshaler for ContainerServiceAgentPoolProfile. 671func (csapp ContainerServiceAgentPoolProfile) MarshalJSON() ([]byte, error) { 672 objectMap := make(map[string]interface{}) 673 if csapp.Name != nil { 674 objectMap["name"] = csapp.Name 675 } 676 if csapp.Count != nil { 677 objectMap["count"] = csapp.Count 678 } 679 if csapp.VMSize != "" { 680 objectMap["vmSize"] = csapp.VMSize 681 } 682 if csapp.DNSPrefix != nil { 683 objectMap["dnsPrefix"] = csapp.DNSPrefix 684 } 685 return json.Marshal(objectMap) 686} 687 688// ContainerServiceCustomProfile properties to configure a custom container service cluster. 689type ContainerServiceCustomProfile struct { 690 // Orchestrator - The name of the custom orchestrator to use. 691 Orchestrator *string `json:"orchestrator,omitempty"` 692} 693 694// ContainerServiceDiagnosticsProfile ... 695type ContainerServiceDiagnosticsProfile struct { 696 // VMDiagnostics - Profile for the container service VM diagnostic agent. 697 VMDiagnostics *ContainerServiceVMDiagnostics `json:"vmDiagnostics,omitempty"` 698} 699 700// ContainerServiceLinuxProfile profile for Linux VMs in the container service cluster. 701type ContainerServiceLinuxProfile struct { 702 // AdminUsername - The administrator username to use for Linux VMs. 703 AdminUsername *string `json:"adminUsername,omitempty"` 704 // SSH - The ssh key configuration for Linux VMs. 705 SSH *ContainerServiceSSHConfiguration `json:"ssh,omitempty"` 706} 707 708// ContainerServiceListResult the response from the List Container Services operation. 709type ContainerServiceListResult struct { 710 autorest.Response `json:"-"` 711 // Value - the list of container services. 712 Value *[]ContainerService `json:"value,omitempty"` 713 // NextLink - The URL to get the next set of container service results. 714 NextLink *string `json:"nextLink,omitempty"` 715} 716 717// ContainerServiceListResultIterator provides access to a complete listing of ContainerService values. 718type ContainerServiceListResultIterator struct { 719 i int 720 page ContainerServiceListResultPage 721} 722 723// NextWithContext advances to the next value. If there was an error making 724// the request the iterator does not advance and the error is returned. 725func (iter *ContainerServiceListResultIterator) NextWithContext(ctx context.Context) (err error) { 726 if tracing.IsEnabled() { 727 ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServiceListResultIterator.NextWithContext") 728 defer func() { 729 sc := -1 730 if iter.Response().Response.Response != nil { 731 sc = iter.Response().Response.Response.StatusCode 732 } 733 tracing.EndSpan(ctx, sc, err) 734 }() 735 } 736 iter.i++ 737 if iter.i < len(iter.page.Values()) { 738 return nil 739 } 740 err = iter.page.NextWithContext(ctx) 741 if err != nil { 742 iter.i-- 743 return err 744 } 745 iter.i = 0 746 return nil 747} 748 749// Next advances to the next value. If there was an error making 750// the request the iterator does not advance and the error is returned. 751// Deprecated: Use NextWithContext() instead. 752func (iter *ContainerServiceListResultIterator) Next() error { 753 return iter.NextWithContext(context.Background()) 754} 755 756// NotDone returns true if the enumeration should be started or is not yet complete. 757func (iter ContainerServiceListResultIterator) NotDone() bool { 758 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 759} 760 761// Response returns the raw server response from the last page request. 762func (iter ContainerServiceListResultIterator) Response() ContainerServiceListResult { 763 return iter.page.Response() 764} 765 766// Value returns the current value or a zero-initialized value if the 767// iterator has advanced beyond the end of the collection. 768func (iter ContainerServiceListResultIterator) Value() ContainerService { 769 if !iter.page.NotDone() { 770 return ContainerService{} 771 } 772 return iter.page.Values()[iter.i] 773} 774 775// Creates a new instance of the ContainerServiceListResultIterator type. 776func NewContainerServiceListResultIterator(page ContainerServiceListResultPage) ContainerServiceListResultIterator { 777 return ContainerServiceListResultIterator{page: page} 778} 779 780// IsEmpty returns true if the ListResult contains no values. 781func (cslr ContainerServiceListResult) IsEmpty() bool { 782 return cslr.Value == nil || len(*cslr.Value) == 0 783} 784 785// hasNextLink returns true if the NextLink is not empty. 786func (cslr ContainerServiceListResult) hasNextLink() bool { 787 return cslr.NextLink != nil && len(*cslr.NextLink) != 0 788} 789 790// containerServiceListResultPreparer prepares a request to retrieve the next set of results. 791// It returns nil if no more results exist. 792func (cslr ContainerServiceListResult) containerServiceListResultPreparer(ctx context.Context) (*http.Request, error) { 793 if !cslr.hasNextLink() { 794 return nil, nil 795 } 796 return autorest.Prepare((&http.Request{}).WithContext(ctx), 797 autorest.AsJSON(), 798 autorest.AsGet(), 799 autorest.WithBaseURL(to.String(cslr.NextLink))) 800} 801 802// ContainerServiceListResultPage contains a page of ContainerService values. 803type ContainerServiceListResultPage struct { 804 fn func(context.Context, ContainerServiceListResult) (ContainerServiceListResult, error) 805 cslr ContainerServiceListResult 806} 807 808// NextWithContext advances to the next page of values. If there was an error making 809// the request the page does not advance and the error is returned. 810func (page *ContainerServiceListResultPage) NextWithContext(ctx context.Context) (err error) { 811 if tracing.IsEnabled() { 812 ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServiceListResultPage.NextWithContext") 813 defer func() { 814 sc := -1 815 if page.Response().Response.Response != nil { 816 sc = page.Response().Response.Response.StatusCode 817 } 818 tracing.EndSpan(ctx, sc, err) 819 }() 820 } 821 for { 822 next, err := page.fn(ctx, page.cslr) 823 if err != nil { 824 return err 825 } 826 page.cslr = next 827 if !next.hasNextLink() || !next.IsEmpty() { 828 break 829 } 830 } 831 return nil 832} 833 834// Next advances to the next page of values. If there was an error making 835// the request the page does not advance and the error is returned. 836// Deprecated: Use NextWithContext() instead. 837func (page *ContainerServiceListResultPage) Next() error { 838 return page.NextWithContext(context.Background()) 839} 840 841// NotDone returns true if the page enumeration should be started or is not yet complete. 842func (page ContainerServiceListResultPage) NotDone() bool { 843 return !page.cslr.IsEmpty() 844} 845 846// Response returns the raw server response from the last page request. 847func (page ContainerServiceListResultPage) Response() ContainerServiceListResult { 848 return page.cslr 849} 850 851// Values returns the slice of values for the current page or nil if there are no values. 852func (page ContainerServiceListResultPage) Values() []ContainerService { 853 if page.cslr.IsEmpty() { 854 return nil 855 } 856 return *page.cslr.Value 857} 858 859// Creates a new instance of the ContainerServiceListResultPage type. 860func NewContainerServiceListResultPage(cur ContainerServiceListResult, getNextPage func(context.Context, ContainerServiceListResult) (ContainerServiceListResult, error)) ContainerServiceListResultPage { 861 return ContainerServiceListResultPage{ 862 fn: getNextPage, 863 cslr: cur, 864 } 865} 866 867// ContainerServiceMasterProfile profile for the container service master. 868type ContainerServiceMasterProfile struct { 869 // Count - Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. 870 Count *int32 `json:"count,omitempty"` 871 // DNSPrefix - DNS prefix to be used to create the FQDN for master. 872 DNSPrefix *string `json:"dnsPrefix,omitempty"` 873 // Fqdn - READ-ONLY; FQDN for the master. 874 Fqdn *string `json:"fqdn,omitempty"` 875} 876 877// MarshalJSON is the custom marshaler for ContainerServiceMasterProfile. 878func (csmp ContainerServiceMasterProfile) MarshalJSON() ([]byte, error) { 879 objectMap := make(map[string]interface{}) 880 if csmp.Count != nil { 881 objectMap["count"] = csmp.Count 882 } 883 if csmp.DNSPrefix != nil { 884 objectMap["dnsPrefix"] = csmp.DNSPrefix 885 } 886 return json.Marshal(objectMap) 887} 888 889// ContainerServiceOrchestratorProfile profile for the container service orchestrator. 890type ContainerServiceOrchestratorProfile struct { 891 // OrchestratorType - The orchestrator to use to manage container service cluster resources. Valid values are Swarm, DCOS, and Custom. Possible values include: 'Swarm', 'DCOS', 'Custom', 'Kubernetes' 892 OrchestratorType ContainerServiceOrchestratorTypes `json:"orchestratorType,omitempty"` 893} 894 895// ContainerServiceProperties properties of the container service. 896type ContainerServiceProperties struct { 897 // ProvisioningState - READ-ONLY; the current deployment or provisioning state, which only appears in the response. 898 ProvisioningState *string `json:"provisioningState,omitempty"` 899 // OrchestratorProfile - Properties of the orchestrator. 900 OrchestratorProfile *ContainerServiceOrchestratorProfile `json:"orchestratorProfile,omitempty"` 901 // CustomProfile - Properties for custom clusters. 902 CustomProfile *ContainerServiceCustomProfile `json:"customProfile,omitempty"` 903 // ServicePrincipalProfile - Properties for cluster service principals. 904 ServicePrincipalProfile *ContainerServiceServicePrincipalProfile `json:"servicePrincipalProfile,omitempty"` 905 // MasterProfile - Properties of master agents. 906 MasterProfile *ContainerServiceMasterProfile `json:"masterProfile,omitempty"` 907 // AgentPoolProfiles - Properties of the agent pool. 908 AgentPoolProfiles *[]ContainerServiceAgentPoolProfile `json:"agentPoolProfiles,omitempty"` 909 // WindowsProfile - Properties of Windows VMs. 910 WindowsProfile *ContainerServiceWindowsProfile `json:"windowsProfile,omitempty"` 911 // LinuxProfile - Properties of Linux VMs. 912 LinuxProfile *ContainerServiceLinuxProfile `json:"linuxProfile,omitempty"` 913 // DiagnosticsProfile - Properties of the diagnostic agent. 914 DiagnosticsProfile *ContainerServiceDiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 915} 916 917// MarshalJSON is the custom marshaler for ContainerServiceProperties. 918func (csp ContainerServiceProperties) MarshalJSON() ([]byte, error) { 919 objectMap := make(map[string]interface{}) 920 if csp.OrchestratorProfile != nil { 921 objectMap["orchestratorProfile"] = csp.OrchestratorProfile 922 } 923 if csp.CustomProfile != nil { 924 objectMap["customProfile"] = csp.CustomProfile 925 } 926 if csp.ServicePrincipalProfile != nil { 927 objectMap["servicePrincipalProfile"] = csp.ServicePrincipalProfile 928 } 929 if csp.MasterProfile != nil { 930 objectMap["masterProfile"] = csp.MasterProfile 931 } 932 if csp.AgentPoolProfiles != nil { 933 objectMap["agentPoolProfiles"] = csp.AgentPoolProfiles 934 } 935 if csp.WindowsProfile != nil { 936 objectMap["windowsProfile"] = csp.WindowsProfile 937 } 938 if csp.LinuxProfile != nil { 939 objectMap["linuxProfile"] = csp.LinuxProfile 940 } 941 if csp.DiagnosticsProfile != nil { 942 objectMap["diagnosticsProfile"] = csp.DiagnosticsProfile 943 } 944 return json.Marshal(objectMap) 945} 946 947// ContainerServicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 948// long-running operation. 949type ContainerServicesCreateOrUpdateFuture struct { 950 azure.FutureAPI 951 // Result returns the result of the asynchronous operation. 952 // If the operation has not completed it will return an error. 953 Result func(ContainerServicesClient) (ContainerService, error) 954} 955 956// UnmarshalJSON is the custom unmarshaller for CreateFuture. 957func (future *ContainerServicesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 958 var azFuture azure.Future 959 if err := json.Unmarshal(body, &azFuture); err != nil { 960 return err 961 } 962 future.FutureAPI = &azFuture 963 future.Result = future.result 964 return nil 965} 966 967// result is the default implementation for ContainerServicesCreateOrUpdateFuture.Result. 968func (future *ContainerServicesCreateOrUpdateFuture) result(client ContainerServicesClient) (cs ContainerService, err error) { 969 var done bool 970 done, err = future.DoneWithContext(context.Background(), client) 971 if err != nil { 972 err = autorest.NewErrorWithError(err, "compute.ContainerServicesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 973 return 974 } 975 if !done { 976 cs.Response.Response = future.Response() 977 err = azure.NewAsyncOpIncompleteError("compute.ContainerServicesCreateOrUpdateFuture") 978 return 979 } 980 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 981 if cs.Response.Response, err = future.GetResult(sender); err == nil && cs.Response.Response.StatusCode != http.StatusNoContent { 982 cs, err = client.CreateOrUpdateResponder(cs.Response.Response) 983 if err != nil { 984 err = autorest.NewErrorWithError(err, "compute.ContainerServicesCreateOrUpdateFuture", "Result", cs.Response.Response, "Failure responding to request") 985 } 986 } 987 return 988} 989 990// ContainerServicesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 991// operation. 992type ContainerServicesDeleteFuture struct { 993 azure.FutureAPI 994 // Result returns the result of the asynchronous operation. 995 // If the operation has not completed it will return an error. 996 Result func(ContainerServicesClient) (autorest.Response, error) 997} 998 999// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1000func (future *ContainerServicesDeleteFuture) UnmarshalJSON(body []byte) error { 1001 var azFuture azure.Future 1002 if err := json.Unmarshal(body, &azFuture); err != nil { 1003 return err 1004 } 1005 future.FutureAPI = &azFuture 1006 future.Result = future.result 1007 return nil 1008} 1009 1010// result is the default implementation for ContainerServicesDeleteFuture.Result. 1011func (future *ContainerServicesDeleteFuture) result(client ContainerServicesClient) (ar autorest.Response, err error) { 1012 var done bool 1013 done, err = future.DoneWithContext(context.Background(), client) 1014 if err != nil { 1015 err = autorest.NewErrorWithError(err, "compute.ContainerServicesDeleteFuture", "Result", future.Response(), "Polling failure") 1016 return 1017 } 1018 if !done { 1019 ar.Response = future.Response() 1020 err = azure.NewAsyncOpIncompleteError("compute.ContainerServicesDeleteFuture") 1021 return 1022 } 1023 ar.Response = future.Response() 1024 return 1025} 1026 1027// ContainerServiceServicePrincipalProfile information about a service principal identity for the cluster 1028// to use for manipulating Azure APIs. 1029type ContainerServiceServicePrincipalProfile struct { 1030 // ClientID - The ID for the service principal. 1031 ClientID *string `json:"clientId,omitempty"` 1032 // Secret - The secret password associated with the service principal. 1033 Secret *string `json:"secret,omitempty"` 1034} 1035 1036// ContainerServiceSSHConfiguration SSH configuration for Linux-based VMs running on Azure. 1037type ContainerServiceSSHConfiguration struct { 1038 // PublicKeys - the list of SSH public keys used to authenticate with Linux-based VMs. 1039 PublicKeys *[]ContainerServiceSSHPublicKey `json:"publicKeys,omitempty"` 1040} 1041 1042// ContainerServiceSSHPublicKey contains information about SSH certificate public key data. 1043type ContainerServiceSSHPublicKey struct { 1044 // KeyData - Certificate public key used to authenticate with VMs through SSH. The certificate must be in PEM format with or without headers. 1045 KeyData *string `json:"keyData,omitempty"` 1046} 1047 1048// ContainerServiceVMDiagnostics profile for diagnostics on the container service VMs. 1049type ContainerServiceVMDiagnostics struct { 1050 // Enabled - Whether the VM diagnostic agent is provisioned on the VM. 1051 Enabled *bool `json:"enabled,omitempty"` 1052 // StorageURI - READ-ONLY; The URI of the storage account where diagnostics are stored. 1053 StorageURI *string `json:"storageUri,omitempty"` 1054} 1055 1056// MarshalJSON is the custom marshaler for ContainerServiceVMDiagnostics. 1057func (csvd ContainerServiceVMDiagnostics) MarshalJSON() ([]byte, error) { 1058 objectMap := make(map[string]interface{}) 1059 if csvd.Enabled != nil { 1060 objectMap["enabled"] = csvd.Enabled 1061 } 1062 return json.Marshal(objectMap) 1063} 1064 1065// ContainerServiceWindowsProfile profile for Windows VMs in the container service cluster. 1066type ContainerServiceWindowsProfile struct { 1067 // AdminUsername - The administrator username to use for Windows VMs. 1068 AdminUsername *string `json:"adminUsername,omitempty"` 1069 // AdminPassword - The administrator password to use for Windows VMs. 1070 AdminPassword *string `json:"adminPassword,omitempty"` 1071} 1072 1073// CreationData data used when creating a disk. 1074type CreationData struct { 1075 // CreateOption - This enumerates the possible sources of a disk's creation. Possible values include: 'Empty', 'Attach', 'FromImage', 'Import', 'Copy', 'Restore', 'Upload' 1076 CreateOption DiskCreateOption `json:"createOption,omitempty"` 1077 // StorageAccountID - Required if createOption is Import. The Azure Resource Manager identifier of the storage account containing the blob to import as a disk. 1078 StorageAccountID *string `json:"storageAccountId,omitempty"` 1079 // ImageReference - Disk source information. 1080 ImageReference *ImageDiskReference `json:"imageReference,omitempty"` 1081 // 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. 1082 GalleryImageReference *ImageDiskReference `json:"galleryImageReference,omitempty"` 1083 // SourceURI - If createOption is Import, this is the URI of a blob to be imported into a managed disk. 1084 SourceURI *string `json:"sourceUri,omitempty"` 1085 // SourceResourceID - If createOption is Copy, this is the ARM id of the source snapshot or disk. 1086 SourceResourceID *string `json:"sourceResourceId,omitempty"` 1087 // SourceUniqueID - READ-ONLY; If this field is set, this is the unique id identifying the source of this resource. 1088 SourceUniqueID *string `json:"sourceUniqueId,omitempty"` 1089 // 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). 1090 UploadSizeBytes *int64 `json:"uploadSizeBytes,omitempty"` 1091 // LogicalSectorSize - Logical sector size in bytes for Ultra disks. Supported values are 512 ad 4096. 4096 is the default. 1092 LogicalSectorSize *int32 `json:"logicalSectorSize,omitempty"` 1093} 1094 1095// MarshalJSON is the custom marshaler for CreationData. 1096func (cd CreationData) MarshalJSON() ([]byte, error) { 1097 objectMap := make(map[string]interface{}) 1098 if cd.CreateOption != "" { 1099 objectMap["createOption"] = cd.CreateOption 1100 } 1101 if cd.StorageAccountID != nil { 1102 objectMap["storageAccountId"] = cd.StorageAccountID 1103 } 1104 if cd.ImageReference != nil { 1105 objectMap["imageReference"] = cd.ImageReference 1106 } 1107 if cd.GalleryImageReference != nil { 1108 objectMap["galleryImageReference"] = cd.GalleryImageReference 1109 } 1110 if cd.SourceURI != nil { 1111 objectMap["sourceUri"] = cd.SourceURI 1112 } 1113 if cd.SourceResourceID != nil { 1114 objectMap["sourceResourceId"] = cd.SourceResourceID 1115 } 1116 if cd.UploadSizeBytes != nil { 1117 objectMap["uploadSizeBytes"] = cd.UploadSizeBytes 1118 } 1119 if cd.LogicalSectorSize != nil { 1120 objectMap["logicalSectorSize"] = cd.LogicalSectorSize 1121 } 1122 return json.Marshal(objectMap) 1123} 1124 1125// DataDisk describes a data disk. 1126type DataDisk struct { 1127 // 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. 1128 Lun *int32 `json:"lun,omitempty"` 1129 // Name - The disk name. 1130 Name *string `json:"name,omitempty"` 1131 // Vhd - The virtual hard disk. 1132 Vhd *VirtualHardDisk `json:"vhd,omitempty"` 1133 // 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. 1134 Image *VirtualHardDisk `json:"image,omitempty"` 1135 // 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' 1136 Caching CachingTypes `json:"caching,omitempty"` 1137 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 1138 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 1139 // 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' 1140 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 1141 // 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 1142 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 1143 // ManagedDisk - The managed disk parameters. 1144 ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` 1145 // ToBeDetached - Specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset 1146 ToBeDetached *bool `json:"toBeDetached,omitempty"` 1147 // 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. 1148 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 1149 // 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. 1150 DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` 1151} 1152 1153// MarshalJSON is the custom marshaler for DataDisk. 1154func (dd DataDisk) MarshalJSON() ([]byte, error) { 1155 objectMap := make(map[string]interface{}) 1156 if dd.Lun != nil { 1157 objectMap["lun"] = dd.Lun 1158 } 1159 if dd.Name != nil { 1160 objectMap["name"] = dd.Name 1161 } 1162 if dd.Vhd != nil { 1163 objectMap["vhd"] = dd.Vhd 1164 } 1165 if dd.Image != nil { 1166 objectMap["image"] = dd.Image 1167 } 1168 if dd.Caching != "" { 1169 objectMap["caching"] = dd.Caching 1170 } 1171 if dd.WriteAcceleratorEnabled != nil { 1172 objectMap["writeAcceleratorEnabled"] = dd.WriteAcceleratorEnabled 1173 } 1174 if dd.CreateOption != "" { 1175 objectMap["createOption"] = dd.CreateOption 1176 } 1177 if dd.DiskSizeGB != nil { 1178 objectMap["diskSizeGB"] = dd.DiskSizeGB 1179 } 1180 if dd.ManagedDisk != nil { 1181 objectMap["managedDisk"] = dd.ManagedDisk 1182 } 1183 if dd.ToBeDetached != nil { 1184 objectMap["toBeDetached"] = dd.ToBeDetached 1185 } 1186 return json.Marshal(objectMap) 1187} 1188 1189// DataDiskImage contains the data disk images information. 1190type DataDiskImage struct { 1191 // 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. 1192 Lun *int32 `json:"lun,omitempty"` 1193} 1194 1195// MarshalJSON is the custom marshaler for DataDiskImage. 1196func (ddi DataDiskImage) MarshalJSON() ([]byte, error) { 1197 objectMap := make(map[string]interface{}) 1198 return json.Marshal(objectMap) 1199} 1200 1201// DataDiskImageEncryption contains encryption settings for a data disk image. 1202type DataDiskImageEncryption struct { 1203 // 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. 1204 Lun *int32 `json:"lun,omitempty"` 1205 // DiskEncryptionSetID - A relative URI containing the resource ID of the disk encryption set. 1206 DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` 1207} 1208 1209// DedicatedHost specifies information about the Dedicated host. 1210type DedicatedHost struct { 1211 autorest.Response `json:"-"` 1212 *DedicatedHostProperties `json:"properties,omitempty"` 1213 // 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. 1214 Sku *Sku `json:"sku,omitempty"` 1215 // ID - READ-ONLY; Resource Id 1216 ID *string `json:"id,omitempty"` 1217 // Name - READ-ONLY; Resource name 1218 Name *string `json:"name,omitempty"` 1219 // Type - READ-ONLY; Resource type 1220 Type *string `json:"type,omitempty"` 1221 // Location - Resource location 1222 Location *string `json:"location,omitempty"` 1223 // Tags - Resource tags 1224 Tags map[string]*string `json:"tags"` 1225} 1226 1227// MarshalJSON is the custom marshaler for DedicatedHost. 1228func (dh DedicatedHost) MarshalJSON() ([]byte, error) { 1229 objectMap := make(map[string]interface{}) 1230 if dh.DedicatedHostProperties != nil { 1231 objectMap["properties"] = dh.DedicatedHostProperties 1232 } 1233 if dh.Sku != nil { 1234 objectMap["sku"] = dh.Sku 1235 } 1236 if dh.Location != nil { 1237 objectMap["location"] = dh.Location 1238 } 1239 if dh.Tags != nil { 1240 objectMap["tags"] = dh.Tags 1241 } 1242 return json.Marshal(objectMap) 1243} 1244 1245// UnmarshalJSON is the custom unmarshaler for DedicatedHost struct. 1246func (dh *DedicatedHost) UnmarshalJSON(body []byte) error { 1247 var m map[string]*json.RawMessage 1248 err := json.Unmarshal(body, &m) 1249 if err != nil { 1250 return err 1251 } 1252 for k, v := range m { 1253 switch k { 1254 case "properties": 1255 if v != nil { 1256 var dedicatedHostProperties DedicatedHostProperties 1257 err = json.Unmarshal(*v, &dedicatedHostProperties) 1258 if err != nil { 1259 return err 1260 } 1261 dh.DedicatedHostProperties = &dedicatedHostProperties 1262 } 1263 case "sku": 1264 if v != nil { 1265 var sku Sku 1266 err = json.Unmarshal(*v, &sku) 1267 if err != nil { 1268 return err 1269 } 1270 dh.Sku = &sku 1271 } 1272 case "id": 1273 if v != nil { 1274 var ID string 1275 err = json.Unmarshal(*v, &ID) 1276 if err != nil { 1277 return err 1278 } 1279 dh.ID = &ID 1280 } 1281 case "name": 1282 if v != nil { 1283 var name string 1284 err = json.Unmarshal(*v, &name) 1285 if err != nil { 1286 return err 1287 } 1288 dh.Name = &name 1289 } 1290 case "type": 1291 if v != nil { 1292 var typeVar string 1293 err = json.Unmarshal(*v, &typeVar) 1294 if err != nil { 1295 return err 1296 } 1297 dh.Type = &typeVar 1298 } 1299 case "location": 1300 if v != nil { 1301 var location string 1302 err = json.Unmarshal(*v, &location) 1303 if err != nil { 1304 return err 1305 } 1306 dh.Location = &location 1307 } 1308 case "tags": 1309 if v != nil { 1310 var tags map[string]*string 1311 err = json.Unmarshal(*v, &tags) 1312 if err != nil { 1313 return err 1314 } 1315 dh.Tags = tags 1316 } 1317 } 1318 } 1319 1320 return nil 1321} 1322 1323// DedicatedHostAllocatableVM represents the dedicated host unutilized capacity in terms of a specific VM 1324// size. 1325type DedicatedHostAllocatableVM struct { 1326 // VMSize - VM size in terms of which the unutilized capacity is represented. 1327 VMSize *string `json:"vmSize,omitempty"` 1328 // Count - Maximum number of VMs of size vmSize that can fit in the dedicated host's remaining capacity. 1329 Count *float64 `json:"count,omitempty"` 1330} 1331 1332// DedicatedHostAvailableCapacity dedicated host unutilized capacity. 1333type DedicatedHostAvailableCapacity struct { 1334 // 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. 1335 AllocatableVMs *[]DedicatedHostAllocatableVM `json:"allocatableVMs,omitempty"` 1336} 1337 1338// DedicatedHostGroup specifies information about the dedicated host group that the dedicated hosts should 1339// be assigned to. <br><br> Currently, a dedicated host can only be added to a dedicated host group at 1340// creation time. An existing dedicated host cannot be added to another dedicated host group. 1341type DedicatedHostGroup struct { 1342 autorest.Response `json:"-"` 1343 *DedicatedHostGroupProperties `json:"properties,omitempty"` 1344 // 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. 1345 Zones *[]string `json:"zones,omitempty"` 1346 // ID - READ-ONLY; Resource Id 1347 ID *string `json:"id,omitempty"` 1348 // Name - READ-ONLY; Resource name 1349 Name *string `json:"name,omitempty"` 1350 // Type - READ-ONLY; Resource type 1351 Type *string `json:"type,omitempty"` 1352 // Location - Resource location 1353 Location *string `json:"location,omitempty"` 1354 // Tags - Resource tags 1355 Tags map[string]*string `json:"tags"` 1356} 1357 1358// MarshalJSON is the custom marshaler for DedicatedHostGroup. 1359func (dhg DedicatedHostGroup) MarshalJSON() ([]byte, error) { 1360 objectMap := make(map[string]interface{}) 1361 if dhg.DedicatedHostGroupProperties != nil { 1362 objectMap["properties"] = dhg.DedicatedHostGroupProperties 1363 } 1364 if dhg.Zones != nil { 1365 objectMap["zones"] = dhg.Zones 1366 } 1367 if dhg.Location != nil { 1368 objectMap["location"] = dhg.Location 1369 } 1370 if dhg.Tags != nil { 1371 objectMap["tags"] = dhg.Tags 1372 } 1373 return json.Marshal(objectMap) 1374} 1375 1376// UnmarshalJSON is the custom unmarshaler for DedicatedHostGroup struct. 1377func (dhg *DedicatedHostGroup) UnmarshalJSON(body []byte) error { 1378 var m map[string]*json.RawMessage 1379 err := json.Unmarshal(body, &m) 1380 if err != nil { 1381 return err 1382 } 1383 for k, v := range m { 1384 switch k { 1385 case "properties": 1386 if v != nil { 1387 var dedicatedHostGroupProperties DedicatedHostGroupProperties 1388 err = json.Unmarshal(*v, &dedicatedHostGroupProperties) 1389 if err != nil { 1390 return err 1391 } 1392 dhg.DedicatedHostGroupProperties = &dedicatedHostGroupProperties 1393 } 1394 case "zones": 1395 if v != nil { 1396 var zones []string 1397 err = json.Unmarshal(*v, &zones) 1398 if err != nil { 1399 return err 1400 } 1401 dhg.Zones = &zones 1402 } 1403 case "id": 1404 if v != nil { 1405 var ID string 1406 err = json.Unmarshal(*v, &ID) 1407 if err != nil { 1408 return err 1409 } 1410 dhg.ID = &ID 1411 } 1412 case "name": 1413 if v != nil { 1414 var name string 1415 err = json.Unmarshal(*v, &name) 1416 if err != nil { 1417 return err 1418 } 1419 dhg.Name = &name 1420 } 1421 case "type": 1422 if v != nil { 1423 var typeVar string 1424 err = json.Unmarshal(*v, &typeVar) 1425 if err != nil { 1426 return err 1427 } 1428 dhg.Type = &typeVar 1429 } 1430 case "location": 1431 if v != nil { 1432 var location string 1433 err = json.Unmarshal(*v, &location) 1434 if err != nil { 1435 return err 1436 } 1437 dhg.Location = &location 1438 } 1439 case "tags": 1440 if v != nil { 1441 var tags map[string]*string 1442 err = json.Unmarshal(*v, &tags) 1443 if err != nil { 1444 return err 1445 } 1446 dhg.Tags = tags 1447 } 1448 } 1449 } 1450 1451 return nil 1452} 1453 1454// DedicatedHostGroupInstanceView ... 1455type DedicatedHostGroupInstanceView struct { 1456 // Hosts - List of instance view of the dedicated hosts under the dedicated host group. 1457 Hosts *[]DedicatedHostInstanceViewWithName `json:"hosts,omitempty"` 1458} 1459 1460// DedicatedHostGroupListResult the List Dedicated Host Group with resource group response. 1461type DedicatedHostGroupListResult struct { 1462 autorest.Response `json:"-"` 1463 // Value - The list of dedicated host groups 1464 Value *[]DedicatedHostGroup `json:"value,omitempty"` 1465 // 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. 1466 NextLink *string `json:"nextLink,omitempty"` 1467} 1468 1469// DedicatedHostGroupListResultIterator provides access to a complete listing of DedicatedHostGroup values. 1470type DedicatedHostGroupListResultIterator struct { 1471 i int 1472 page DedicatedHostGroupListResultPage 1473} 1474 1475// NextWithContext advances to the next value. If there was an error making 1476// the request the iterator does not advance and the error is returned. 1477func (iter *DedicatedHostGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { 1478 if tracing.IsEnabled() { 1479 ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupListResultIterator.NextWithContext") 1480 defer func() { 1481 sc := -1 1482 if iter.Response().Response.Response != nil { 1483 sc = iter.Response().Response.Response.StatusCode 1484 } 1485 tracing.EndSpan(ctx, sc, err) 1486 }() 1487 } 1488 iter.i++ 1489 if iter.i < len(iter.page.Values()) { 1490 return nil 1491 } 1492 err = iter.page.NextWithContext(ctx) 1493 if err != nil { 1494 iter.i-- 1495 return err 1496 } 1497 iter.i = 0 1498 return nil 1499} 1500 1501// Next advances to the next value. If there was an error making 1502// the request the iterator does not advance and the error is returned. 1503// Deprecated: Use NextWithContext() instead. 1504func (iter *DedicatedHostGroupListResultIterator) Next() error { 1505 return iter.NextWithContext(context.Background()) 1506} 1507 1508// NotDone returns true if the enumeration should be started or is not yet complete. 1509func (iter DedicatedHostGroupListResultIterator) NotDone() bool { 1510 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1511} 1512 1513// Response returns the raw server response from the last page request. 1514func (iter DedicatedHostGroupListResultIterator) Response() DedicatedHostGroupListResult { 1515 return iter.page.Response() 1516} 1517 1518// Value returns the current value or a zero-initialized value if the 1519// iterator has advanced beyond the end of the collection. 1520func (iter DedicatedHostGroupListResultIterator) Value() DedicatedHostGroup { 1521 if !iter.page.NotDone() { 1522 return DedicatedHostGroup{} 1523 } 1524 return iter.page.Values()[iter.i] 1525} 1526 1527// Creates a new instance of the DedicatedHostGroupListResultIterator type. 1528func NewDedicatedHostGroupListResultIterator(page DedicatedHostGroupListResultPage) DedicatedHostGroupListResultIterator { 1529 return DedicatedHostGroupListResultIterator{page: page} 1530} 1531 1532// IsEmpty returns true if the ListResult contains no values. 1533func (dhglr DedicatedHostGroupListResult) IsEmpty() bool { 1534 return dhglr.Value == nil || len(*dhglr.Value) == 0 1535} 1536 1537// hasNextLink returns true if the NextLink is not empty. 1538func (dhglr DedicatedHostGroupListResult) hasNextLink() bool { 1539 return dhglr.NextLink != nil && len(*dhglr.NextLink) != 0 1540} 1541 1542// dedicatedHostGroupListResultPreparer prepares a request to retrieve the next set of results. 1543// It returns nil if no more results exist. 1544func (dhglr DedicatedHostGroupListResult) dedicatedHostGroupListResultPreparer(ctx context.Context) (*http.Request, error) { 1545 if !dhglr.hasNextLink() { 1546 return nil, nil 1547 } 1548 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1549 autorest.AsJSON(), 1550 autorest.AsGet(), 1551 autorest.WithBaseURL(to.String(dhglr.NextLink))) 1552} 1553 1554// DedicatedHostGroupListResultPage contains a page of DedicatedHostGroup values. 1555type DedicatedHostGroupListResultPage struct { 1556 fn func(context.Context, DedicatedHostGroupListResult) (DedicatedHostGroupListResult, error) 1557 dhglr DedicatedHostGroupListResult 1558} 1559 1560// NextWithContext advances to the next page of values. If there was an error making 1561// the request the page does not advance and the error is returned. 1562func (page *DedicatedHostGroupListResultPage) NextWithContext(ctx context.Context) (err error) { 1563 if tracing.IsEnabled() { 1564 ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupListResultPage.NextWithContext") 1565 defer func() { 1566 sc := -1 1567 if page.Response().Response.Response != nil { 1568 sc = page.Response().Response.Response.StatusCode 1569 } 1570 tracing.EndSpan(ctx, sc, err) 1571 }() 1572 } 1573 for { 1574 next, err := page.fn(ctx, page.dhglr) 1575 if err != nil { 1576 return err 1577 } 1578 page.dhglr = next 1579 if !next.hasNextLink() || !next.IsEmpty() { 1580 break 1581 } 1582 } 1583 return nil 1584} 1585 1586// Next advances to the next page of values. If there was an error making 1587// the request the page does not advance and the error is returned. 1588// Deprecated: Use NextWithContext() instead. 1589func (page *DedicatedHostGroupListResultPage) Next() error { 1590 return page.NextWithContext(context.Background()) 1591} 1592 1593// NotDone returns true if the page enumeration should be started or is not yet complete. 1594func (page DedicatedHostGroupListResultPage) NotDone() bool { 1595 return !page.dhglr.IsEmpty() 1596} 1597 1598// Response returns the raw server response from the last page request. 1599func (page DedicatedHostGroupListResultPage) Response() DedicatedHostGroupListResult { 1600 return page.dhglr 1601} 1602 1603// Values returns the slice of values for the current page or nil if there are no values. 1604func (page DedicatedHostGroupListResultPage) Values() []DedicatedHostGroup { 1605 if page.dhglr.IsEmpty() { 1606 return nil 1607 } 1608 return *page.dhglr.Value 1609} 1610 1611// Creates a new instance of the DedicatedHostGroupListResultPage type. 1612func NewDedicatedHostGroupListResultPage(cur DedicatedHostGroupListResult, getNextPage func(context.Context, DedicatedHostGroupListResult) (DedicatedHostGroupListResult, error)) DedicatedHostGroupListResultPage { 1613 return DedicatedHostGroupListResultPage{ 1614 fn: getNextPage, 1615 dhglr: cur, 1616 } 1617} 1618 1619// DedicatedHostGroupProperties dedicated Host Group Properties. 1620type DedicatedHostGroupProperties struct { 1621 // PlatformFaultDomainCount - Number of fault domains that the host group can span. 1622 PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` 1623 // Hosts - READ-ONLY; A list of references to all dedicated hosts in the dedicated host group. 1624 Hosts *[]SubResourceReadOnly `json:"hosts,omitempty"` 1625 // 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. 1626 InstanceView *DedicatedHostGroupInstanceView `json:"instanceView,omitempty"` 1627 // 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. 1628 SupportAutomaticPlacement *bool `json:"supportAutomaticPlacement,omitempty"` 1629} 1630 1631// MarshalJSON is the custom marshaler for DedicatedHostGroupProperties. 1632func (dhgp DedicatedHostGroupProperties) MarshalJSON() ([]byte, error) { 1633 objectMap := make(map[string]interface{}) 1634 if dhgp.PlatformFaultDomainCount != nil { 1635 objectMap["platformFaultDomainCount"] = dhgp.PlatformFaultDomainCount 1636 } 1637 if dhgp.SupportAutomaticPlacement != nil { 1638 objectMap["supportAutomaticPlacement"] = dhgp.SupportAutomaticPlacement 1639 } 1640 return json.Marshal(objectMap) 1641} 1642 1643// DedicatedHostGroupUpdate specifies information about the dedicated host group that the dedicated host 1644// should be assigned to. Only tags may be updated. 1645type DedicatedHostGroupUpdate struct { 1646 *DedicatedHostGroupProperties `json:"properties,omitempty"` 1647 // 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. 1648 Zones *[]string `json:"zones,omitempty"` 1649 // Tags - Resource tags 1650 Tags map[string]*string `json:"tags"` 1651} 1652 1653// MarshalJSON is the custom marshaler for DedicatedHostGroupUpdate. 1654func (dhgu DedicatedHostGroupUpdate) MarshalJSON() ([]byte, error) { 1655 objectMap := make(map[string]interface{}) 1656 if dhgu.DedicatedHostGroupProperties != nil { 1657 objectMap["properties"] = dhgu.DedicatedHostGroupProperties 1658 } 1659 if dhgu.Zones != nil { 1660 objectMap["zones"] = dhgu.Zones 1661 } 1662 if dhgu.Tags != nil { 1663 objectMap["tags"] = dhgu.Tags 1664 } 1665 return json.Marshal(objectMap) 1666} 1667 1668// UnmarshalJSON is the custom unmarshaler for DedicatedHostGroupUpdate struct. 1669func (dhgu *DedicatedHostGroupUpdate) UnmarshalJSON(body []byte) error { 1670 var m map[string]*json.RawMessage 1671 err := json.Unmarshal(body, &m) 1672 if err != nil { 1673 return err 1674 } 1675 for k, v := range m { 1676 switch k { 1677 case "properties": 1678 if v != nil { 1679 var dedicatedHostGroupProperties DedicatedHostGroupProperties 1680 err = json.Unmarshal(*v, &dedicatedHostGroupProperties) 1681 if err != nil { 1682 return err 1683 } 1684 dhgu.DedicatedHostGroupProperties = &dedicatedHostGroupProperties 1685 } 1686 case "zones": 1687 if v != nil { 1688 var zones []string 1689 err = json.Unmarshal(*v, &zones) 1690 if err != nil { 1691 return err 1692 } 1693 dhgu.Zones = &zones 1694 } 1695 case "tags": 1696 if v != nil { 1697 var tags map[string]*string 1698 err = json.Unmarshal(*v, &tags) 1699 if err != nil { 1700 return err 1701 } 1702 dhgu.Tags = tags 1703 } 1704 } 1705 } 1706 1707 return nil 1708} 1709 1710// DedicatedHostInstanceView the instance view of a dedicated host. 1711type DedicatedHostInstanceView struct { 1712 // AssetID - READ-ONLY; Specifies the unique id of the dedicated physical machine on which the dedicated host resides. 1713 AssetID *string `json:"assetId,omitempty"` 1714 // AvailableCapacity - Unutilized capacity of the dedicated host. 1715 AvailableCapacity *DedicatedHostAvailableCapacity `json:"availableCapacity,omitempty"` 1716 // Statuses - The resource status information. 1717 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 1718} 1719 1720// MarshalJSON is the custom marshaler for DedicatedHostInstanceView. 1721func (dhiv DedicatedHostInstanceView) MarshalJSON() ([]byte, error) { 1722 objectMap := make(map[string]interface{}) 1723 if dhiv.AvailableCapacity != nil { 1724 objectMap["availableCapacity"] = dhiv.AvailableCapacity 1725 } 1726 if dhiv.Statuses != nil { 1727 objectMap["statuses"] = dhiv.Statuses 1728 } 1729 return json.Marshal(objectMap) 1730} 1731 1732// DedicatedHostInstanceViewWithName the instance view of a dedicated host that includes the name of the 1733// dedicated host. It is used for the response to the instance view of a dedicated host group. 1734type DedicatedHostInstanceViewWithName struct { 1735 // Name - READ-ONLY; The name of the dedicated host. 1736 Name *string `json:"name,omitempty"` 1737 // AssetID - READ-ONLY; Specifies the unique id of the dedicated physical machine on which the dedicated host resides. 1738 AssetID *string `json:"assetId,omitempty"` 1739 // AvailableCapacity - Unutilized capacity of the dedicated host. 1740 AvailableCapacity *DedicatedHostAvailableCapacity `json:"availableCapacity,omitempty"` 1741 // Statuses - The resource status information. 1742 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 1743} 1744 1745// MarshalJSON is the custom marshaler for DedicatedHostInstanceViewWithName. 1746func (dhivwn DedicatedHostInstanceViewWithName) MarshalJSON() ([]byte, error) { 1747 objectMap := make(map[string]interface{}) 1748 if dhivwn.AvailableCapacity != nil { 1749 objectMap["availableCapacity"] = dhivwn.AvailableCapacity 1750 } 1751 if dhivwn.Statuses != nil { 1752 objectMap["statuses"] = dhivwn.Statuses 1753 } 1754 return json.Marshal(objectMap) 1755} 1756 1757// DedicatedHostListResult the list dedicated host operation response. 1758type DedicatedHostListResult struct { 1759 autorest.Response `json:"-"` 1760 // Value - The list of dedicated hosts 1761 Value *[]DedicatedHost `json:"value,omitempty"` 1762 // NextLink - The URI to fetch the next page of dedicated hosts. Call ListNext() with this URI to fetch the next page of dedicated hosts. 1763 NextLink *string `json:"nextLink,omitempty"` 1764} 1765 1766// DedicatedHostListResultIterator provides access to a complete listing of DedicatedHost values. 1767type DedicatedHostListResultIterator struct { 1768 i int 1769 page DedicatedHostListResultPage 1770} 1771 1772// NextWithContext advances to the next value. If there was an error making 1773// the request the iterator does not advance and the error is returned. 1774func (iter *DedicatedHostListResultIterator) NextWithContext(ctx context.Context) (err error) { 1775 if tracing.IsEnabled() { 1776 ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostListResultIterator.NextWithContext") 1777 defer func() { 1778 sc := -1 1779 if iter.Response().Response.Response != nil { 1780 sc = iter.Response().Response.Response.StatusCode 1781 } 1782 tracing.EndSpan(ctx, sc, err) 1783 }() 1784 } 1785 iter.i++ 1786 if iter.i < len(iter.page.Values()) { 1787 return nil 1788 } 1789 err = iter.page.NextWithContext(ctx) 1790 if err != nil { 1791 iter.i-- 1792 return err 1793 } 1794 iter.i = 0 1795 return nil 1796} 1797 1798// Next advances to the next value. If there was an error making 1799// the request the iterator does not advance and the error is returned. 1800// Deprecated: Use NextWithContext() instead. 1801func (iter *DedicatedHostListResultIterator) Next() error { 1802 return iter.NextWithContext(context.Background()) 1803} 1804 1805// NotDone returns true if the enumeration should be started or is not yet complete. 1806func (iter DedicatedHostListResultIterator) NotDone() bool { 1807 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1808} 1809 1810// Response returns the raw server response from the last page request. 1811func (iter DedicatedHostListResultIterator) Response() DedicatedHostListResult { 1812 return iter.page.Response() 1813} 1814 1815// Value returns the current value or a zero-initialized value if the 1816// iterator has advanced beyond the end of the collection. 1817func (iter DedicatedHostListResultIterator) Value() DedicatedHost { 1818 if !iter.page.NotDone() { 1819 return DedicatedHost{} 1820 } 1821 return iter.page.Values()[iter.i] 1822} 1823 1824// Creates a new instance of the DedicatedHostListResultIterator type. 1825func NewDedicatedHostListResultIterator(page DedicatedHostListResultPage) DedicatedHostListResultIterator { 1826 return DedicatedHostListResultIterator{page: page} 1827} 1828 1829// IsEmpty returns true if the ListResult contains no values. 1830func (dhlr DedicatedHostListResult) IsEmpty() bool { 1831 return dhlr.Value == nil || len(*dhlr.Value) == 0 1832} 1833 1834// hasNextLink returns true if the NextLink is not empty. 1835func (dhlr DedicatedHostListResult) hasNextLink() bool { 1836 return dhlr.NextLink != nil && len(*dhlr.NextLink) != 0 1837} 1838 1839// dedicatedHostListResultPreparer prepares a request to retrieve the next set of results. 1840// It returns nil if no more results exist. 1841func (dhlr DedicatedHostListResult) dedicatedHostListResultPreparer(ctx context.Context) (*http.Request, error) { 1842 if !dhlr.hasNextLink() { 1843 return nil, nil 1844 } 1845 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1846 autorest.AsJSON(), 1847 autorest.AsGet(), 1848 autorest.WithBaseURL(to.String(dhlr.NextLink))) 1849} 1850 1851// DedicatedHostListResultPage contains a page of DedicatedHost values. 1852type DedicatedHostListResultPage struct { 1853 fn func(context.Context, DedicatedHostListResult) (DedicatedHostListResult, error) 1854 dhlr DedicatedHostListResult 1855} 1856 1857// NextWithContext advances to the next page of values. If there was an error making 1858// the request the page does not advance and the error is returned. 1859func (page *DedicatedHostListResultPage) NextWithContext(ctx context.Context) (err error) { 1860 if tracing.IsEnabled() { 1861 ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostListResultPage.NextWithContext") 1862 defer func() { 1863 sc := -1 1864 if page.Response().Response.Response != nil { 1865 sc = page.Response().Response.Response.StatusCode 1866 } 1867 tracing.EndSpan(ctx, sc, err) 1868 }() 1869 } 1870 for { 1871 next, err := page.fn(ctx, page.dhlr) 1872 if err != nil { 1873 return err 1874 } 1875 page.dhlr = next 1876 if !next.hasNextLink() || !next.IsEmpty() { 1877 break 1878 } 1879 } 1880 return nil 1881} 1882 1883// Next advances to the next page of values. If there was an error making 1884// the request the page does not advance and the error is returned. 1885// Deprecated: Use NextWithContext() instead. 1886func (page *DedicatedHostListResultPage) Next() error { 1887 return page.NextWithContext(context.Background()) 1888} 1889 1890// NotDone returns true if the page enumeration should be started or is not yet complete. 1891func (page DedicatedHostListResultPage) NotDone() bool { 1892 return !page.dhlr.IsEmpty() 1893} 1894 1895// Response returns the raw server response from the last page request. 1896func (page DedicatedHostListResultPage) Response() DedicatedHostListResult { 1897 return page.dhlr 1898} 1899 1900// Values returns the slice of values for the current page or nil if there are no values. 1901func (page DedicatedHostListResultPage) Values() []DedicatedHost { 1902 if page.dhlr.IsEmpty() { 1903 return nil 1904 } 1905 return *page.dhlr.Value 1906} 1907 1908// Creates a new instance of the DedicatedHostListResultPage type. 1909func NewDedicatedHostListResultPage(cur DedicatedHostListResult, getNextPage func(context.Context, DedicatedHostListResult) (DedicatedHostListResult, error)) DedicatedHostListResultPage { 1910 return DedicatedHostListResultPage{ 1911 fn: getNextPage, 1912 dhlr: cur, 1913 } 1914} 1915 1916// DedicatedHostProperties properties of the dedicated host. 1917type DedicatedHostProperties struct { 1918 // PlatformFaultDomain - Fault domain of the dedicated host within a dedicated host group. 1919 PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` 1920 // AutoReplaceOnFailure - Specifies whether the dedicated host should be replaced automatically in case of a failure. The value is defaulted to 'true' when not provided. 1921 AutoReplaceOnFailure *bool `json:"autoReplaceOnFailure,omitempty"` 1922 // 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. 1923 HostID *string `json:"hostId,omitempty"` 1924 // VirtualMachines - READ-ONLY; A list of references to all virtual machines in the Dedicated Host. 1925 VirtualMachines *[]SubResourceReadOnly `json:"virtualMachines,omitempty"` 1926 // 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' 1927 LicenseType DedicatedHostLicenseTypes `json:"licenseType,omitempty"` 1928 // ProvisioningTime - READ-ONLY; The date when the host was first provisioned. 1929 ProvisioningTime *date.Time `json:"provisioningTime,omitempty"` 1930 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 1931 ProvisioningState *string `json:"provisioningState,omitempty"` 1932 // InstanceView - READ-ONLY; The dedicated host instance view. 1933 InstanceView *DedicatedHostInstanceView `json:"instanceView,omitempty"` 1934} 1935 1936// MarshalJSON is the custom marshaler for DedicatedHostProperties. 1937func (dhp DedicatedHostProperties) MarshalJSON() ([]byte, error) { 1938 objectMap := make(map[string]interface{}) 1939 if dhp.PlatformFaultDomain != nil { 1940 objectMap["platformFaultDomain"] = dhp.PlatformFaultDomain 1941 } 1942 if dhp.AutoReplaceOnFailure != nil { 1943 objectMap["autoReplaceOnFailure"] = dhp.AutoReplaceOnFailure 1944 } 1945 if dhp.LicenseType != "" { 1946 objectMap["licenseType"] = dhp.LicenseType 1947 } 1948 return json.Marshal(objectMap) 1949} 1950 1951// DedicatedHostsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 1952// long-running operation. 1953type DedicatedHostsCreateOrUpdateFuture struct { 1954 azure.FutureAPI 1955 // Result returns the result of the asynchronous operation. 1956 // If the operation has not completed it will return an error. 1957 Result func(DedicatedHostsClient) (DedicatedHost, error) 1958} 1959 1960// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1961func (future *DedicatedHostsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 1962 var azFuture azure.Future 1963 if err := json.Unmarshal(body, &azFuture); err != nil { 1964 return err 1965 } 1966 future.FutureAPI = &azFuture 1967 future.Result = future.result 1968 return nil 1969} 1970 1971// result is the default implementation for DedicatedHostsCreateOrUpdateFuture.Result. 1972func (future *DedicatedHostsCreateOrUpdateFuture) result(client DedicatedHostsClient) (dh DedicatedHost, err error) { 1973 var done bool 1974 done, err = future.DoneWithContext(context.Background(), client) 1975 if err != nil { 1976 err = autorest.NewErrorWithError(err, "compute.DedicatedHostsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 1977 return 1978 } 1979 if !done { 1980 dh.Response.Response = future.Response() 1981 err = azure.NewAsyncOpIncompleteError("compute.DedicatedHostsCreateOrUpdateFuture") 1982 return 1983 } 1984 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1985 if dh.Response.Response, err = future.GetResult(sender); err == nil && dh.Response.Response.StatusCode != http.StatusNoContent { 1986 dh, err = client.CreateOrUpdateResponder(dh.Response.Response) 1987 if err != nil { 1988 err = autorest.NewErrorWithError(err, "compute.DedicatedHostsCreateOrUpdateFuture", "Result", dh.Response.Response, "Failure responding to request") 1989 } 1990 } 1991 return 1992} 1993 1994// DedicatedHostsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 1995// operation. 1996type DedicatedHostsDeleteFuture struct { 1997 azure.FutureAPI 1998 // Result returns the result of the asynchronous operation. 1999 // If the operation has not completed it will return an error. 2000 Result func(DedicatedHostsClient) (autorest.Response, error) 2001} 2002 2003// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2004func (future *DedicatedHostsDeleteFuture) UnmarshalJSON(body []byte) error { 2005 var azFuture azure.Future 2006 if err := json.Unmarshal(body, &azFuture); err != nil { 2007 return err 2008 } 2009 future.FutureAPI = &azFuture 2010 future.Result = future.result 2011 return nil 2012} 2013 2014// result is the default implementation for DedicatedHostsDeleteFuture.Result. 2015func (future *DedicatedHostsDeleteFuture) result(client DedicatedHostsClient) (ar autorest.Response, err error) { 2016 var done bool 2017 done, err = future.DoneWithContext(context.Background(), client) 2018 if err != nil { 2019 err = autorest.NewErrorWithError(err, "compute.DedicatedHostsDeleteFuture", "Result", future.Response(), "Polling failure") 2020 return 2021 } 2022 if !done { 2023 ar.Response = future.Response() 2024 err = azure.NewAsyncOpIncompleteError("compute.DedicatedHostsDeleteFuture") 2025 return 2026 } 2027 ar.Response = future.Response() 2028 return 2029} 2030 2031// DedicatedHostsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 2032// operation. 2033type DedicatedHostsUpdateFuture struct { 2034 azure.FutureAPI 2035 // Result returns the result of the asynchronous operation. 2036 // If the operation has not completed it will return an error. 2037 Result func(DedicatedHostsClient) (DedicatedHost, error) 2038} 2039 2040// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2041func (future *DedicatedHostsUpdateFuture) UnmarshalJSON(body []byte) error { 2042 var azFuture azure.Future 2043 if err := json.Unmarshal(body, &azFuture); err != nil { 2044 return err 2045 } 2046 future.FutureAPI = &azFuture 2047 future.Result = future.result 2048 return nil 2049} 2050 2051// result is the default implementation for DedicatedHostsUpdateFuture.Result. 2052func (future *DedicatedHostsUpdateFuture) result(client DedicatedHostsClient) (dh DedicatedHost, err error) { 2053 var done bool 2054 done, err = future.DoneWithContext(context.Background(), client) 2055 if err != nil { 2056 err = autorest.NewErrorWithError(err, "compute.DedicatedHostsUpdateFuture", "Result", future.Response(), "Polling failure") 2057 return 2058 } 2059 if !done { 2060 dh.Response.Response = future.Response() 2061 err = azure.NewAsyncOpIncompleteError("compute.DedicatedHostsUpdateFuture") 2062 return 2063 } 2064 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2065 if dh.Response.Response, err = future.GetResult(sender); err == nil && dh.Response.Response.StatusCode != http.StatusNoContent { 2066 dh, err = client.UpdateResponder(dh.Response.Response) 2067 if err != nil { 2068 err = autorest.NewErrorWithError(err, "compute.DedicatedHostsUpdateFuture", "Result", dh.Response.Response, "Failure responding to request") 2069 } 2070 } 2071 return 2072} 2073 2074// DedicatedHostUpdate specifies information about the dedicated host. Only tags, autoReplaceOnFailure and 2075// licenseType may be updated. 2076type DedicatedHostUpdate struct { 2077 *DedicatedHostProperties `json:"properties,omitempty"` 2078 // Tags - Resource tags 2079 Tags map[string]*string `json:"tags"` 2080} 2081 2082// MarshalJSON is the custom marshaler for DedicatedHostUpdate. 2083func (dhu DedicatedHostUpdate) MarshalJSON() ([]byte, error) { 2084 objectMap := make(map[string]interface{}) 2085 if dhu.DedicatedHostProperties != nil { 2086 objectMap["properties"] = dhu.DedicatedHostProperties 2087 } 2088 if dhu.Tags != nil { 2089 objectMap["tags"] = dhu.Tags 2090 } 2091 return json.Marshal(objectMap) 2092} 2093 2094// UnmarshalJSON is the custom unmarshaler for DedicatedHostUpdate struct. 2095func (dhu *DedicatedHostUpdate) UnmarshalJSON(body []byte) error { 2096 var m map[string]*json.RawMessage 2097 err := json.Unmarshal(body, &m) 2098 if err != nil { 2099 return err 2100 } 2101 for k, v := range m { 2102 switch k { 2103 case "properties": 2104 if v != nil { 2105 var dedicatedHostProperties DedicatedHostProperties 2106 err = json.Unmarshal(*v, &dedicatedHostProperties) 2107 if err != nil { 2108 return err 2109 } 2110 dhu.DedicatedHostProperties = &dedicatedHostProperties 2111 } 2112 case "tags": 2113 if v != nil { 2114 var tags map[string]*string 2115 err = json.Unmarshal(*v, &tags) 2116 if err != nil { 2117 return err 2118 } 2119 dhu.Tags = tags 2120 } 2121 } 2122 } 2123 2124 return nil 2125} 2126 2127// DiagnosticsProfile specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2128// 2015-06-15. 2129type DiagnosticsProfile struct { 2130 // 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. 2131 BootDiagnostics *BootDiagnostics `json:"bootDiagnostics,omitempty"` 2132} 2133 2134// DiffDiskSettings describes the parameters of ephemeral disk settings that can be specified for operating 2135// system disk. <br><br> NOTE: The ephemeral disk settings can only be specified for managed disk. 2136type DiffDiskSettings struct { 2137 // Option - Specifies the ephemeral disk settings for operating system disk. Possible values include: 'Local' 2138 Option DiffDiskOptions `json:"option,omitempty"` 2139 // Placement - Specifies the ephemeral disk placement for operating system disk.<br><br> Possible values are: <br><br> **CacheDisk** <br><br> **ResourceDisk** <br><br> Default: **CacheDisk** if one is configured for the VM size otherwise **ResourceDisk** is used.<br><br> Refer to VM size documentation for Windows VM at https://docs.microsoft.com/en-us/azure/virtual-machines/windows/sizes and Linux VM at https://docs.microsoft.com/en-us/azure/virtual-machines/linux/sizes to check which VM sizes exposes a cache disk. Possible values include: 'CacheDisk', 'ResourceDisk' 2140 Placement DiffDiskPlacement `json:"placement,omitempty"` 2141} 2142 2143// Disallowed describes the disallowed disk types. 2144type Disallowed struct { 2145 // DiskTypes - A list of disk types. 2146 DiskTypes *[]string `json:"diskTypes,omitempty"` 2147} 2148 2149// DisallowedConfiguration specifies the disallowed configuration for a virtual machine image. 2150type DisallowedConfiguration struct { 2151 // VMDiskType - VM disk types which are disallowed. Possible values include: 'VMDiskTypesNone', 'VMDiskTypesUnmanaged' 2152 VMDiskType VMDiskTypes `json:"vmDiskType,omitempty"` 2153} 2154 2155// Disk disk resource. 2156type Disk struct { 2157 autorest.Response `json:"-"` 2158 // ManagedBy - READ-ONLY; A relative URI containing the ID of the VM that has the disk attached. 2159 ManagedBy *string `json:"managedBy,omitempty"` 2160 // 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. 2161 ManagedByExtended *[]string `json:"managedByExtended,omitempty"` 2162 Sku *DiskSku `json:"sku,omitempty"` 2163 // Zones - The Logical zone list for Disk. 2164 Zones *[]string `json:"zones,omitempty"` 2165 *DiskProperties `json:"properties,omitempty"` 2166 // ID - READ-ONLY; Resource Id 2167 ID *string `json:"id,omitempty"` 2168 // Name - READ-ONLY; Resource name 2169 Name *string `json:"name,omitempty"` 2170 // Type - READ-ONLY; Resource type 2171 Type *string `json:"type,omitempty"` 2172 // Location - Resource location 2173 Location *string `json:"location,omitempty"` 2174 // Tags - Resource tags 2175 Tags map[string]*string `json:"tags"` 2176} 2177 2178// MarshalJSON is the custom marshaler for Disk. 2179func (d Disk) MarshalJSON() ([]byte, error) { 2180 objectMap := make(map[string]interface{}) 2181 if d.Sku != nil { 2182 objectMap["sku"] = d.Sku 2183 } 2184 if d.Zones != nil { 2185 objectMap["zones"] = d.Zones 2186 } 2187 if d.DiskProperties != nil { 2188 objectMap["properties"] = d.DiskProperties 2189 } 2190 if d.Location != nil { 2191 objectMap["location"] = d.Location 2192 } 2193 if d.Tags != nil { 2194 objectMap["tags"] = d.Tags 2195 } 2196 return json.Marshal(objectMap) 2197} 2198 2199// UnmarshalJSON is the custom unmarshaler for Disk struct. 2200func (d *Disk) UnmarshalJSON(body []byte) error { 2201 var m map[string]*json.RawMessage 2202 err := json.Unmarshal(body, &m) 2203 if err != nil { 2204 return err 2205 } 2206 for k, v := range m { 2207 switch k { 2208 case "managedBy": 2209 if v != nil { 2210 var managedBy string 2211 err = json.Unmarshal(*v, &managedBy) 2212 if err != nil { 2213 return err 2214 } 2215 d.ManagedBy = &managedBy 2216 } 2217 case "managedByExtended": 2218 if v != nil { 2219 var managedByExtended []string 2220 err = json.Unmarshal(*v, &managedByExtended) 2221 if err != nil { 2222 return err 2223 } 2224 d.ManagedByExtended = &managedByExtended 2225 } 2226 case "sku": 2227 if v != nil { 2228 var sku DiskSku 2229 err = json.Unmarshal(*v, &sku) 2230 if err != nil { 2231 return err 2232 } 2233 d.Sku = &sku 2234 } 2235 case "zones": 2236 if v != nil { 2237 var zones []string 2238 err = json.Unmarshal(*v, &zones) 2239 if err != nil { 2240 return err 2241 } 2242 d.Zones = &zones 2243 } 2244 case "properties": 2245 if v != nil { 2246 var diskProperties DiskProperties 2247 err = json.Unmarshal(*v, &diskProperties) 2248 if err != nil { 2249 return err 2250 } 2251 d.DiskProperties = &diskProperties 2252 } 2253 case "id": 2254 if v != nil { 2255 var ID string 2256 err = json.Unmarshal(*v, &ID) 2257 if err != nil { 2258 return err 2259 } 2260 d.ID = &ID 2261 } 2262 case "name": 2263 if v != nil { 2264 var name string 2265 err = json.Unmarshal(*v, &name) 2266 if err != nil { 2267 return err 2268 } 2269 d.Name = &name 2270 } 2271 case "type": 2272 if v != nil { 2273 var typeVar string 2274 err = json.Unmarshal(*v, &typeVar) 2275 if err != nil { 2276 return err 2277 } 2278 d.Type = &typeVar 2279 } 2280 case "location": 2281 if v != nil { 2282 var location string 2283 err = json.Unmarshal(*v, &location) 2284 if err != nil { 2285 return err 2286 } 2287 d.Location = &location 2288 } 2289 case "tags": 2290 if v != nil { 2291 var tags map[string]*string 2292 err = json.Unmarshal(*v, &tags) 2293 if err != nil { 2294 return err 2295 } 2296 d.Tags = tags 2297 } 2298 } 2299 } 2300 2301 return nil 2302} 2303 2304// DiskAccess disk access resource. 2305type DiskAccess struct { 2306 autorest.Response `json:"-"` 2307 *DiskAccessProperties `json:"properties,omitempty"` 2308 // ID - READ-ONLY; Resource Id 2309 ID *string `json:"id,omitempty"` 2310 // Name - READ-ONLY; Resource name 2311 Name *string `json:"name,omitempty"` 2312 // Type - READ-ONLY; Resource type 2313 Type *string `json:"type,omitempty"` 2314 // Location - Resource location 2315 Location *string `json:"location,omitempty"` 2316 // Tags - Resource tags 2317 Tags map[string]*string `json:"tags"` 2318} 2319 2320// MarshalJSON is the custom marshaler for DiskAccess. 2321func (da DiskAccess) MarshalJSON() ([]byte, error) { 2322 objectMap := make(map[string]interface{}) 2323 if da.DiskAccessProperties != nil { 2324 objectMap["properties"] = da.DiskAccessProperties 2325 } 2326 if da.Location != nil { 2327 objectMap["location"] = da.Location 2328 } 2329 if da.Tags != nil { 2330 objectMap["tags"] = da.Tags 2331 } 2332 return json.Marshal(objectMap) 2333} 2334 2335// UnmarshalJSON is the custom unmarshaler for DiskAccess struct. 2336func (da *DiskAccess) UnmarshalJSON(body []byte) error { 2337 var m map[string]*json.RawMessage 2338 err := json.Unmarshal(body, &m) 2339 if err != nil { 2340 return err 2341 } 2342 for k, v := range m { 2343 switch k { 2344 case "properties": 2345 if v != nil { 2346 var diskAccessProperties DiskAccessProperties 2347 err = json.Unmarshal(*v, &diskAccessProperties) 2348 if err != nil { 2349 return err 2350 } 2351 da.DiskAccessProperties = &diskAccessProperties 2352 } 2353 case "id": 2354 if v != nil { 2355 var ID string 2356 err = json.Unmarshal(*v, &ID) 2357 if err != nil { 2358 return err 2359 } 2360 da.ID = &ID 2361 } 2362 case "name": 2363 if v != nil { 2364 var name string 2365 err = json.Unmarshal(*v, &name) 2366 if err != nil { 2367 return err 2368 } 2369 da.Name = &name 2370 } 2371 case "type": 2372 if v != nil { 2373 var typeVar string 2374 err = json.Unmarshal(*v, &typeVar) 2375 if err != nil { 2376 return err 2377 } 2378 da.Type = &typeVar 2379 } 2380 case "location": 2381 if v != nil { 2382 var location string 2383 err = json.Unmarshal(*v, &location) 2384 if err != nil { 2385 return err 2386 } 2387 da.Location = &location 2388 } 2389 case "tags": 2390 if v != nil { 2391 var tags map[string]*string 2392 err = json.Unmarshal(*v, &tags) 2393 if err != nil { 2394 return err 2395 } 2396 da.Tags = tags 2397 } 2398 } 2399 } 2400 2401 return nil 2402} 2403 2404// DiskAccessesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 2405// long-running operation. 2406type DiskAccessesCreateOrUpdateFuture struct { 2407 azure.FutureAPI 2408 // Result returns the result of the asynchronous operation. 2409 // If the operation has not completed it will return an error. 2410 Result func(DiskAccessesClient) (DiskAccess, error) 2411} 2412 2413// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2414func (future *DiskAccessesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 2415 var azFuture azure.Future 2416 if err := json.Unmarshal(body, &azFuture); err != nil { 2417 return err 2418 } 2419 future.FutureAPI = &azFuture 2420 future.Result = future.result 2421 return nil 2422} 2423 2424// result is the default implementation for DiskAccessesCreateOrUpdateFuture.Result. 2425func (future *DiskAccessesCreateOrUpdateFuture) result(client DiskAccessesClient) (da DiskAccess, err error) { 2426 var done bool 2427 done, err = future.DoneWithContext(context.Background(), client) 2428 if err != nil { 2429 err = autorest.NewErrorWithError(err, "compute.DiskAccessesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 2430 return 2431 } 2432 if !done { 2433 da.Response.Response = future.Response() 2434 err = azure.NewAsyncOpIncompleteError("compute.DiskAccessesCreateOrUpdateFuture") 2435 return 2436 } 2437 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2438 if da.Response.Response, err = future.GetResult(sender); err == nil && da.Response.Response.StatusCode != http.StatusNoContent { 2439 da, err = client.CreateOrUpdateResponder(da.Response.Response) 2440 if err != nil { 2441 err = autorest.NewErrorWithError(err, "compute.DiskAccessesCreateOrUpdateFuture", "Result", da.Response.Response, "Failure responding to request") 2442 } 2443 } 2444 return 2445} 2446 2447// DiskAccessesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 2448// operation. 2449type DiskAccessesDeleteFuture struct { 2450 azure.FutureAPI 2451 // Result returns the result of the asynchronous operation. 2452 // If the operation has not completed it will return an error. 2453 Result func(DiskAccessesClient) (autorest.Response, error) 2454} 2455 2456// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2457func (future *DiskAccessesDeleteFuture) UnmarshalJSON(body []byte) error { 2458 var azFuture azure.Future 2459 if err := json.Unmarshal(body, &azFuture); err != nil { 2460 return err 2461 } 2462 future.FutureAPI = &azFuture 2463 future.Result = future.result 2464 return nil 2465} 2466 2467// result is the default implementation for DiskAccessesDeleteFuture.Result. 2468func (future *DiskAccessesDeleteFuture) result(client DiskAccessesClient) (ar autorest.Response, err error) { 2469 var done bool 2470 done, err = future.DoneWithContext(context.Background(), client) 2471 if err != nil { 2472 err = autorest.NewErrorWithError(err, "compute.DiskAccessesDeleteFuture", "Result", future.Response(), "Polling failure") 2473 return 2474 } 2475 if !done { 2476 ar.Response = future.Response() 2477 err = azure.NewAsyncOpIncompleteError("compute.DiskAccessesDeleteFuture") 2478 return 2479 } 2480 ar.Response = future.Response() 2481 return 2482} 2483 2484// DiskAccessesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 2485// operation. 2486type DiskAccessesUpdateFuture struct { 2487 azure.FutureAPI 2488 // Result returns the result of the asynchronous operation. 2489 // If the operation has not completed it will return an error. 2490 Result func(DiskAccessesClient) (DiskAccess, error) 2491} 2492 2493// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2494func (future *DiskAccessesUpdateFuture) UnmarshalJSON(body []byte) error { 2495 var azFuture azure.Future 2496 if err := json.Unmarshal(body, &azFuture); err != nil { 2497 return err 2498 } 2499 future.FutureAPI = &azFuture 2500 future.Result = future.result 2501 return nil 2502} 2503 2504// result is the default implementation for DiskAccessesUpdateFuture.Result. 2505func (future *DiskAccessesUpdateFuture) result(client DiskAccessesClient) (da DiskAccess, err error) { 2506 var done bool 2507 done, err = future.DoneWithContext(context.Background(), client) 2508 if err != nil { 2509 err = autorest.NewErrorWithError(err, "compute.DiskAccessesUpdateFuture", "Result", future.Response(), "Polling failure") 2510 return 2511 } 2512 if !done { 2513 da.Response.Response = future.Response() 2514 err = azure.NewAsyncOpIncompleteError("compute.DiskAccessesUpdateFuture") 2515 return 2516 } 2517 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2518 if da.Response.Response, err = future.GetResult(sender); err == nil && da.Response.Response.StatusCode != http.StatusNoContent { 2519 da, err = client.UpdateResponder(da.Response.Response) 2520 if err != nil { 2521 err = autorest.NewErrorWithError(err, "compute.DiskAccessesUpdateFuture", "Result", da.Response.Response, "Failure responding to request") 2522 } 2523 } 2524 return 2525} 2526 2527// DiskAccessList the List disk access operation response. 2528type DiskAccessList struct { 2529 autorest.Response `json:"-"` 2530 // Value - A list of disk access resources. 2531 Value *[]DiskAccess `json:"value,omitempty"` 2532 // 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. 2533 NextLink *string `json:"nextLink,omitempty"` 2534} 2535 2536// DiskAccessListIterator provides access to a complete listing of DiskAccess values. 2537type DiskAccessListIterator struct { 2538 i int 2539 page DiskAccessListPage 2540} 2541 2542// NextWithContext advances to the next value. If there was an error making 2543// the request the iterator does not advance and the error is returned. 2544func (iter *DiskAccessListIterator) NextWithContext(ctx context.Context) (err error) { 2545 if tracing.IsEnabled() { 2546 ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessListIterator.NextWithContext") 2547 defer func() { 2548 sc := -1 2549 if iter.Response().Response.Response != nil { 2550 sc = iter.Response().Response.Response.StatusCode 2551 } 2552 tracing.EndSpan(ctx, sc, err) 2553 }() 2554 } 2555 iter.i++ 2556 if iter.i < len(iter.page.Values()) { 2557 return nil 2558 } 2559 err = iter.page.NextWithContext(ctx) 2560 if err != nil { 2561 iter.i-- 2562 return err 2563 } 2564 iter.i = 0 2565 return nil 2566} 2567 2568// Next advances to the next value. If there was an error making 2569// the request the iterator does not advance and the error is returned. 2570// Deprecated: Use NextWithContext() instead. 2571func (iter *DiskAccessListIterator) Next() error { 2572 return iter.NextWithContext(context.Background()) 2573} 2574 2575// NotDone returns true if the enumeration should be started or is not yet complete. 2576func (iter DiskAccessListIterator) NotDone() bool { 2577 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2578} 2579 2580// Response returns the raw server response from the last page request. 2581func (iter DiskAccessListIterator) Response() DiskAccessList { 2582 return iter.page.Response() 2583} 2584 2585// Value returns the current value or a zero-initialized value if the 2586// iterator has advanced beyond the end of the collection. 2587func (iter DiskAccessListIterator) Value() DiskAccess { 2588 if !iter.page.NotDone() { 2589 return DiskAccess{} 2590 } 2591 return iter.page.Values()[iter.i] 2592} 2593 2594// Creates a new instance of the DiskAccessListIterator type. 2595func NewDiskAccessListIterator(page DiskAccessListPage) DiskAccessListIterator { 2596 return DiskAccessListIterator{page: page} 2597} 2598 2599// IsEmpty returns true if the ListResult contains no values. 2600func (dal DiskAccessList) IsEmpty() bool { 2601 return dal.Value == nil || len(*dal.Value) == 0 2602} 2603 2604// hasNextLink returns true if the NextLink is not empty. 2605func (dal DiskAccessList) hasNextLink() bool { 2606 return dal.NextLink != nil && len(*dal.NextLink) != 0 2607} 2608 2609// diskAccessListPreparer prepares a request to retrieve the next set of results. 2610// It returns nil if no more results exist. 2611func (dal DiskAccessList) diskAccessListPreparer(ctx context.Context) (*http.Request, error) { 2612 if !dal.hasNextLink() { 2613 return nil, nil 2614 } 2615 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2616 autorest.AsJSON(), 2617 autorest.AsGet(), 2618 autorest.WithBaseURL(to.String(dal.NextLink))) 2619} 2620 2621// DiskAccessListPage contains a page of DiskAccess values. 2622type DiskAccessListPage struct { 2623 fn func(context.Context, DiskAccessList) (DiskAccessList, error) 2624 dal DiskAccessList 2625} 2626 2627// NextWithContext advances to the next page of values. If there was an error making 2628// the request the page does not advance and the error is returned. 2629func (page *DiskAccessListPage) NextWithContext(ctx context.Context) (err error) { 2630 if tracing.IsEnabled() { 2631 ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessListPage.NextWithContext") 2632 defer func() { 2633 sc := -1 2634 if page.Response().Response.Response != nil { 2635 sc = page.Response().Response.Response.StatusCode 2636 } 2637 tracing.EndSpan(ctx, sc, err) 2638 }() 2639 } 2640 for { 2641 next, err := page.fn(ctx, page.dal) 2642 if err != nil { 2643 return err 2644 } 2645 page.dal = next 2646 if !next.hasNextLink() || !next.IsEmpty() { 2647 break 2648 } 2649 } 2650 return nil 2651} 2652 2653// Next advances to the next page of values. If there was an error making 2654// the request the page does not advance and the error is returned. 2655// Deprecated: Use NextWithContext() instead. 2656func (page *DiskAccessListPage) Next() error { 2657 return page.NextWithContext(context.Background()) 2658} 2659 2660// NotDone returns true if the page enumeration should be started or is not yet complete. 2661func (page DiskAccessListPage) NotDone() bool { 2662 return !page.dal.IsEmpty() 2663} 2664 2665// Response returns the raw server response from the last page request. 2666func (page DiskAccessListPage) Response() DiskAccessList { 2667 return page.dal 2668} 2669 2670// Values returns the slice of values for the current page or nil if there are no values. 2671func (page DiskAccessListPage) Values() []DiskAccess { 2672 if page.dal.IsEmpty() { 2673 return nil 2674 } 2675 return *page.dal.Value 2676} 2677 2678// Creates a new instance of the DiskAccessListPage type. 2679func NewDiskAccessListPage(cur DiskAccessList, getNextPage func(context.Context, DiskAccessList) (DiskAccessList, error)) DiskAccessListPage { 2680 return DiskAccessListPage{ 2681 fn: getNextPage, 2682 dal: cur, 2683 } 2684} 2685 2686// DiskAccessProperties ... 2687type DiskAccessProperties struct { 2688 // PrivateEndpointConnections - READ-ONLY; A readonly collection of private endpoint connections created on the disk. Currently only one endpoint connection is supported. 2689 PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` 2690 // ProvisioningState - READ-ONLY; The disk access resource provisioning state. 2691 ProvisioningState *string `json:"provisioningState,omitempty"` 2692 // TimeCreated - READ-ONLY; The time when the disk access was created. 2693 TimeCreated *date.Time `json:"timeCreated,omitempty"` 2694} 2695 2696// MarshalJSON is the custom marshaler for DiskAccessProperties. 2697func (dap DiskAccessProperties) MarshalJSON() ([]byte, error) { 2698 objectMap := make(map[string]interface{}) 2699 return json.Marshal(objectMap) 2700} 2701 2702// DiskAccessUpdate used for updating a disk access resource. 2703type DiskAccessUpdate struct { 2704 // Tags - Resource tags 2705 Tags map[string]*string `json:"tags"` 2706} 2707 2708// MarshalJSON is the custom marshaler for DiskAccessUpdate. 2709func (dau DiskAccessUpdate) MarshalJSON() ([]byte, error) { 2710 objectMap := make(map[string]interface{}) 2711 if dau.Tags != nil { 2712 objectMap["tags"] = dau.Tags 2713 } 2714 return json.Marshal(objectMap) 2715} 2716 2717// DiskEncryptionSet disk encryption set resource. 2718type DiskEncryptionSet struct { 2719 autorest.Response `json:"-"` 2720 Identity *EncryptionSetIdentity `json:"identity,omitempty"` 2721 *EncryptionSetProperties `json:"properties,omitempty"` 2722 // ID - READ-ONLY; Resource Id 2723 ID *string `json:"id,omitempty"` 2724 // Name - READ-ONLY; Resource name 2725 Name *string `json:"name,omitempty"` 2726 // Type - READ-ONLY; Resource type 2727 Type *string `json:"type,omitempty"` 2728 // Location - Resource location 2729 Location *string `json:"location,omitempty"` 2730 // Tags - Resource tags 2731 Tags map[string]*string `json:"tags"` 2732} 2733 2734// MarshalJSON is the custom marshaler for DiskEncryptionSet. 2735func (desVar DiskEncryptionSet) MarshalJSON() ([]byte, error) { 2736 objectMap := make(map[string]interface{}) 2737 if desVar.Identity != nil { 2738 objectMap["identity"] = desVar.Identity 2739 } 2740 if desVar.EncryptionSetProperties != nil { 2741 objectMap["properties"] = desVar.EncryptionSetProperties 2742 } 2743 if desVar.Location != nil { 2744 objectMap["location"] = desVar.Location 2745 } 2746 if desVar.Tags != nil { 2747 objectMap["tags"] = desVar.Tags 2748 } 2749 return json.Marshal(objectMap) 2750} 2751 2752// UnmarshalJSON is the custom unmarshaler for DiskEncryptionSet struct. 2753func (desVar *DiskEncryptionSet) UnmarshalJSON(body []byte) error { 2754 var m map[string]*json.RawMessage 2755 err := json.Unmarshal(body, &m) 2756 if err != nil { 2757 return err 2758 } 2759 for k, v := range m { 2760 switch k { 2761 case "identity": 2762 if v != nil { 2763 var identity EncryptionSetIdentity 2764 err = json.Unmarshal(*v, &identity) 2765 if err != nil { 2766 return err 2767 } 2768 desVar.Identity = &identity 2769 } 2770 case "properties": 2771 if v != nil { 2772 var encryptionSetProperties EncryptionSetProperties 2773 err = json.Unmarshal(*v, &encryptionSetProperties) 2774 if err != nil { 2775 return err 2776 } 2777 desVar.EncryptionSetProperties = &encryptionSetProperties 2778 } 2779 case "id": 2780 if v != nil { 2781 var ID string 2782 err = json.Unmarshal(*v, &ID) 2783 if err != nil { 2784 return err 2785 } 2786 desVar.ID = &ID 2787 } 2788 case "name": 2789 if v != nil { 2790 var name string 2791 err = json.Unmarshal(*v, &name) 2792 if err != nil { 2793 return err 2794 } 2795 desVar.Name = &name 2796 } 2797 case "type": 2798 if v != nil { 2799 var typeVar string 2800 err = json.Unmarshal(*v, &typeVar) 2801 if err != nil { 2802 return err 2803 } 2804 desVar.Type = &typeVar 2805 } 2806 case "location": 2807 if v != nil { 2808 var location string 2809 err = json.Unmarshal(*v, &location) 2810 if err != nil { 2811 return err 2812 } 2813 desVar.Location = &location 2814 } 2815 case "tags": 2816 if v != nil { 2817 var tags map[string]*string 2818 err = json.Unmarshal(*v, &tags) 2819 if err != nil { 2820 return err 2821 } 2822 desVar.Tags = tags 2823 } 2824 } 2825 } 2826 2827 return nil 2828} 2829 2830// DiskEncryptionSetList the List disk encryption set operation response. 2831type DiskEncryptionSetList struct { 2832 autorest.Response `json:"-"` 2833 // Value - A list of disk encryption sets. 2834 Value *[]DiskEncryptionSet `json:"value,omitempty"` 2835 // 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. 2836 NextLink *string `json:"nextLink,omitempty"` 2837} 2838 2839// DiskEncryptionSetListIterator provides access to a complete listing of DiskEncryptionSet values. 2840type DiskEncryptionSetListIterator struct { 2841 i int 2842 page DiskEncryptionSetListPage 2843} 2844 2845// NextWithContext advances to the next value. If there was an error making 2846// the request the iterator does not advance and the error is returned. 2847func (iter *DiskEncryptionSetListIterator) NextWithContext(ctx context.Context) (err error) { 2848 if tracing.IsEnabled() { 2849 ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetListIterator.NextWithContext") 2850 defer func() { 2851 sc := -1 2852 if iter.Response().Response.Response != nil { 2853 sc = iter.Response().Response.Response.StatusCode 2854 } 2855 tracing.EndSpan(ctx, sc, err) 2856 }() 2857 } 2858 iter.i++ 2859 if iter.i < len(iter.page.Values()) { 2860 return nil 2861 } 2862 err = iter.page.NextWithContext(ctx) 2863 if err != nil { 2864 iter.i-- 2865 return err 2866 } 2867 iter.i = 0 2868 return nil 2869} 2870 2871// Next advances to the next value. If there was an error making 2872// the request the iterator does not advance and the error is returned. 2873// Deprecated: Use NextWithContext() instead. 2874func (iter *DiskEncryptionSetListIterator) Next() error { 2875 return iter.NextWithContext(context.Background()) 2876} 2877 2878// NotDone returns true if the enumeration should be started or is not yet complete. 2879func (iter DiskEncryptionSetListIterator) NotDone() bool { 2880 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2881} 2882 2883// Response returns the raw server response from the last page request. 2884func (iter DiskEncryptionSetListIterator) Response() DiskEncryptionSetList { 2885 return iter.page.Response() 2886} 2887 2888// Value returns the current value or a zero-initialized value if the 2889// iterator has advanced beyond the end of the collection. 2890func (iter DiskEncryptionSetListIterator) Value() DiskEncryptionSet { 2891 if !iter.page.NotDone() { 2892 return DiskEncryptionSet{} 2893 } 2894 return iter.page.Values()[iter.i] 2895} 2896 2897// Creates a new instance of the DiskEncryptionSetListIterator type. 2898func NewDiskEncryptionSetListIterator(page DiskEncryptionSetListPage) DiskEncryptionSetListIterator { 2899 return DiskEncryptionSetListIterator{page: page} 2900} 2901 2902// IsEmpty returns true if the ListResult contains no values. 2903func (desl DiskEncryptionSetList) IsEmpty() bool { 2904 return desl.Value == nil || len(*desl.Value) == 0 2905} 2906 2907// hasNextLink returns true if the NextLink is not empty. 2908func (desl DiskEncryptionSetList) hasNextLink() bool { 2909 return desl.NextLink != nil && len(*desl.NextLink) != 0 2910} 2911 2912// diskEncryptionSetListPreparer prepares a request to retrieve the next set of results. 2913// It returns nil if no more results exist. 2914func (desl DiskEncryptionSetList) diskEncryptionSetListPreparer(ctx context.Context) (*http.Request, error) { 2915 if !desl.hasNextLink() { 2916 return nil, nil 2917 } 2918 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2919 autorest.AsJSON(), 2920 autorest.AsGet(), 2921 autorest.WithBaseURL(to.String(desl.NextLink))) 2922} 2923 2924// DiskEncryptionSetListPage contains a page of DiskEncryptionSet values. 2925type DiskEncryptionSetListPage struct { 2926 fn func(context.Context, DiskEncryptionSetList) (DiskEncryptionSetList, error) 2927 desl DiskEncryptionSetList 2928} 2929 2930// NextWithContext advances to the next page of values. If there was an error making 2931// the request the page does not advance and the error is returned. 2932func (page *DiskEncryptionSetListPage) NextWithContext(ctx context.Context) (err error) { 2933 if tracing.IsEnabled() { 2934 ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetListPage.NextWithContext") 2935 defer func() { 2936 sc := -1 2937 if page.Response().Response.Response != nil { 2938 sc = page.Response().Response.Response.StatusCode 2939 } 2940 tracing.EndSpan(ctx, sc, err) 2941 }() 2942 } 2943 for { 2944 next, err := page.fn(ctx, page.desl) 2945 if err != nil { 2946 return err 2947 } 2948 page.desl = next 2949 if !next.hasNextLink() || !next.IsEmpty() { 2950 break 2951 } 2952 } 2953 return nil 2954} 2955 2956// Next advances to the next page of values. If there was an error making 2957// the request the page does not advance and the error is returned. 2958// Deprecated: Use NextWithContext() instead. 2959func (page *DiskEncryptionSetListPage) Next() error { 2960 return page.NextWithContext(context.Background()) 2961} 2962 2963// NotDone returns true if the page enumeration should be started or is not yet complete. 2964func (page DiskEncryptionSetListPage) NotDone() bool { 2965 return !page.desl.IsEmpty() 2966} 2967 2968// Response returns the raw server response from the last page request. 2969func (page DiskEncryptionSetListPage) Response() DiskEncryptionSetList { 2970 return page.desl 2971} 2972 2973// Values returns the slice of values for the current page or nil if there are no values. 2974func (page DiskEncryptionSetListPage) Values() []DiskEncryptionSet { 2975 if page.desl.IsEmpty() { 2976 return nil 2977 } 2978 return *page.desl.Value 2979} 2980 2981// Creates a new instance of the DiskEncryptionSetListPage type. 2982func NewDiskEncryptionSetListPage(cur DiskEncryptionSetList, getNextPage func(context.Context, DiskEncryptionSetList) (DiskEncryptionSetList, error)) DiskEncryptionSetListPage { 2983 return DiskEncryptionSetListPage{ 2984 fn: getNextPage, 2985 desl: cur, 2986 } 2987} 2988 2989// DiskEncryptionSetParameters describes the parameter of customer managed disk encryption set resource id 2990// that can be specified for disk. <br><br> NOTE: The disk encryption set resource id can only be specified 2991// for managed disk. Please refer https://aka.ms/mdssewithcmkoverview for more details. 2992type DiskEncryptionSetParameters struct { 2993 // ID - Resource Id 2994 ID *string `json:"id,omitempty"` 2995} 2996 2997// DiskEncryptionSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 2998// long-running operation. 2999type DiskEncryptionSetsCreateOrUpdateFuture struct { 3000 azure.FutureAPI 3001 // Result returns the result of the asynchronous operation. 3002 // If the operation has not completed it will return an error. 3003 Result func(DiskEncryptionSetsClient) (DiskEncryptionSet, error) 3004} 3005 3006// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3007func (future *DiskEncryptionSetsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 3008 var azFuture azure.Future 3009 if err := json.Unmarshal(body, &azFuture); err != nil { 3010 return err 3011 } 3012 future.FutureAPI = &azFuture 3013 future.Result = future.result 3014 return nil 3015} 3016 3017// result is the default implementation for DiskEncryptionSetsCreateOrUpdateFuture.Result. 3018func (future *DiskEncryptionSetsCreateOrUpdateFuture) result(client DiskEncryptionSetsClient) (desVar DiskEncryptionSet, err error) { 3019 var done bool 3020 done, err = future.DoneWithContext(context.Background(), client) 3021 if err != nil { 3022 err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 3023 return 3024 } 3025 if !done { 3026 desVar.Response.Response = future.Response() 3027 err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsCreateOrUpdateFuture") 3028 return 3029 } 3030 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3031 if desVar.Response.Response, err = future.GetResult(sender); err == nil && desVar.Response.Response.StatusCode != http.StatusNoContent { 3032 desVar, err = client.CreateOrUpdateResponder(desVar.Response.Response) 3033 if err != nil { 3034 err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsCreateOrUpdateFuture", "Result", desVar.Response.Response, "Failure responding to request") 3035 } 3036 } 3037 return 3038} 3039 3040// DiskEncryptionSetsDeleteFuture an abstraction for monitoring and retrieving the results of a 3041// long-running operation. 3042type DiskEncryptionSetsDeleteFuture struct { 3043 azure.FutureAPI 3044 // Result returns the result of the asynchronous operation. 3045 // If the operation has not completed it will return an error. 3046 Result func(DiskEncryptionSetsClient) (autorest.Response, error) 3047} 3048 3049// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3050func (future *DiskEncryptionSetsDeleteFuture) UnmarshalJSON(body []byte) error { 3051 var azFuture azure.Future 3052 if err := json.Unmarshal(body, &azFuture); err != nil { 3053 return err 3054 } 3055 future.FutureAPI = &azFuture 3056 future.Result = future.result 3057 return nil 3058} 3059 3060// result is the default implementation for DiskEncryptionSetsDeleteFuture.Result. 3061func (future *DiskEncryptionSetsDeleteFuture) result(client DiskEncryptionSetsClient) (ar autorest.Response, err error) { 3062 var done bool 3063 done, err = future.DoneWithContext(context.Background(), client) 3064 if err != nil { 3065 err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsDeleteFuture", "Result", future.Response(), "Polling failure") 3066 return 3067 } 3068 if !done { 3069 ar.Response = future.Response() 3070 err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsDeleteFuture") 3071 return 3072 } 3073 ar.Response = future.Response() 3074 return 3075} 3076 3077// DiskEncryptionSetsUpdateFuture an abstraction for monitoring and retrieving the results of a 3078// long-running operation. 3079type DiskEncryptionSetsUpdateFuture struct { 3080 azure.FutureAPI 3081 // Result returns the result of the asynchronous operation. 3082 // If the operation has not completed it will return an error. 3083 Result func(DiskEncryptionSetsClient) (DiskEncryptionSet, error) 3084} 3085 3086// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3087func (future *DiskEncryptionSetsUpdateFuture) UnmarshalJSON(body []byte) error { 3088 var azFuture azure.Future 3089 if err := json.Unmarshal(body, &azFuture); err != nil { 3090 return err 3091 } 3092 future.FutureAPI = &azFuture 3093 future.Result = future.result 3094 return nil 3095} 3096 3097// result is the default implementation for DiskEncryptionSetsUpdateFuture.Result. 3098func (future *DiskEncryptionSetsUpdateFuture) result(client DiskEncryptionSetsClient) (desVar DiskEncryptionSet, err error) { 3099 var done bool 3100 done, err = future.DoneWithContext(context.Background(), client) 3101 if err != nil { 3102 err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsUpdateFuture", "Result", future.Response(), "Polling failure") 3103 return 3104 } 3105 if !done { 3106 desVar.Response.Response = future.Response() 3107 err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsUpdateFuture") 3108 return 3109 } 3110 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3111 if desVar.Response.Response, err = future.GetResult(sender); err == nil && desVar.Response.Response.StatusCode != http.StatusNoContent { 3112 desVar, err = client.UpdateResponder(desVar.Response.Response) 3113 if err != nil { 3114 err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsUpdateFuture", "Result", desVar.Response.Response, "Failure responding to request") 3115 } 3116 } 3117 return 3118} 3119 3120// DiskEncryptionSettings describes a Encryption Settings for a Disk 3121type DiskEncryptionSettings struct { 3122 // DiskEncryptionKey - Specifies the location of the disk encryption key, which is a Key Vault Secret. 3123 DiskEncryptionKey *KeyVaultSecretReference `json:"diskEncryptionKey,omitempty"` 3124 // KeyEncryptionKey - Specifies the location of the key encryption key in Key Vault. 3125 KeyEncryptionKey *KeyVaultKeyReference `json:"keyEncryptionKey,omitempty"` 3126 // Enabled - Specifies whether disk encryption should be enabled on the virtual machine. 3127 Enabled *bool `json:"enabled,omitempty"` 3128} 3129 3130// DiskEncryptionSetUpdate disk encryption set update resource. 3131type DiskEncryptionSetUpdate struct { 3132 *DiskEncryptionSetUpdateProperties `json:"properties,omitempty"` 3133 // Tags - Resource tags 3134 Tags map[string]*string `json:"tags"` 3135} 3136 3137// MarshalJSON is the custom marshaler for DiskEncryptionSetUpdate. 3138func (desu DiskEncryptionSetUpdate) MarshalJSON() ([]byte, error) { 3139 objectMap := make(map[string]interface{}) 3140 if desu.DiskEncryptionSetUpdateProperties != nil { 3141 objectMap["properties"] = desu.DiskEncryptionSetUpdateProperties 3142 } 3143 if desu.Tags != nil { 3144 objectMap["tags"] = desu.Tags 3145 } 3146 return json.Marshal(objectMap) 3147} 3148 3149// UnmarshalJSON is the custom unmarshaler for DiskEncryptionSetUpdate struct. 3150func (desu *DiskEncryptionSetUpdate) UnmarshalJSON(body []byte) error { 3151 var m map[string]*json.RawMessage 3152 err := json.Unmarshal(body, &m) 3153 if err != nil { 3154 return err 3155 } 3156 for k, v := range m { 3157 switch k { 3158 case "properties": 3159 if v != nil { 3160 var diskEncryptionSetUpdateProperties DiskEncryptionSetUpdateProperties 3161 err = json.Unmarshal(*v, &diskEncryptionSetUpdateProperties) 3162 if err != nil { 3163 return err 3164 } 3165 desu.DiskEncryptionSetUpdateProperties = &diskEncryptionSetUpdateProperties 3166 } 3167 case "tags": 3168 if v != nil { 3169 var tags map[string]*string 3170 err = json.Unmarshal(*v, &tags) 3171 if err != nil { 3172 return err 3173 } 3174 desu.Tags = tags 3175 } 3176 } 3177 } 3178 3179 return nil 3180} 3181 3182// DiskEncryptionSetUpdateProperties disk encryption set resource update properties. 3183type DiskEncryptionSetUpdateProperties struct { 3184 // EncryptionType - Possible values include: 'EncryptionAtRestWithCustomerKey', 'EncryptionAtRestWithPlatformAndCustomerKeys' 3185 EncryptionType DiskEncryptionSetType `json:"encryptionType,omitempty"` 3186 ActiveKey *KeyVaultAndKeyReference `json:"activeKey,omitempty"` 3187} 3188 3189// DiskImageEncryption this is the disk image encryption base class. 3190type DiskImageEncryption struct { 3191 // DiskEncryptionSetID - A relative URI containing the resource ID of the disk encryption set. 3192 DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` 3193} 3194 3195// DiskInstanceView the instance view of the disk. 3196type DiskInstanceView struct { 3197 // Name - The disk name. 3198 Name *string `json:"name,omitempty"` 3199 // EncryptionSettings - Specifies the encryption settings for the OS Disk. <br><br> Minimum api-version: 2015-06-15 3200 EncryptionSettings *[]DiskEncryptionSettings `json:"encryptionSettings,omitempty"` 3201 // Statuses - The resource status information. 3202 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 3203} 3204 3205// DiskList the List Disks operation response. 3206type DiskList struct { 3207 autorest.Response `json:"-"` 3208 // Value - A list of disks. 3209 Value *[]Disk `json:"value,omitempty"` 3210 // NextLink - The uri to fetch the next page of disks. Call ListNext() with this to fetch the next page of disks. 3211 NextLink *string `json:"nextLink,omitempty"` 3212} 3213 3214// DiskListIterator provides access to a complete listing of Disk values. 3215type DiskListIterator struct { 3216 i int 3217 page DiskListPage 3218} 3219 3220// NextWithContext advances to the next value. If there was an error making 3221// the request the iterator does not advance and the error is returned. 3222func (iter *DiskListIterator) NextWithContext(ctx context.Context) (err error) { 3223 if tracing.IsEnabled() { 3224 ctx = tracing.StartSpan(ctx, fqdn+"/DiskListIterator.NextWithContext") 3225 defer func() { 3226 sc := -1 3227 if iter.Response().Response.Response != nil { 3228 sc = iter.Response().Response.Response.StatusCode 3229 } 3230 tracing.EndSpan(ctx, sc, err) 3231 }() 3232 } 3233 iter.i++ 3234 if iter.i < len(iter.page.Values()) { 3235 return nil 3236 } 3237 err = iter.page.NextWithContext(ctx) 3238 if err != nil { 3239 iter.i-- 3240 return err 3241 } 3242 iter.i = 0 3243 return nil 3244} 3245 3246// Next advances to the next value. If there was an error making 3247// the request the iterator does not advance and the error is returned. 3248// Deprecated: Use NextWithContext() instead. 3249func (iter *DiskListIterator) Next() error { 3250 return iter.NextWithContext(context.Background()) 3251} 3252 3253// NotDone returns true if the enumeration should be started or is not yet complete. 3254func (iter DiskListIterator) NotDone() bool { 3255 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3256} 3257 3258// Response returns the raw server response from the last page request. 3259func (iter DiskListIterator) Response() DiskList { 3260 return iter.page.Response() 3261} 3262 3263// Value returns the current value or a zero-initialized value if the 3264// iterator has advanced beyond the end of the collection. 3265func (iter DiskListIterator) Value() Disk { 3266 if !iter.page.NotDone() { 3267 return Disk{} 3268 } 3269 return iter.page.Values()[iter.i] 3270} 3271 3272// Creates a new instance of the DiskListIterator type. 3273func NewDiskListIterator(page DiskListPage) DiskListIterator { 3274 return DiskListIterator{page: page} 3275} 3276 3277// IsEmpty returns true if the ListResult contains no values. 3278func (dl DiskList) IsEmpty() bool { 3279 return dl.Value == nil || len(*dl.Value) == 0 3280} 3281 3282// hasNextLink returns true if the NextLink is not empty. 3283func (dl DiskList) hasNextLink() bool { 3284 return dl.NextLink != nil && len(*dl.NextLink) != 0 3285} 3286 3287// diskListPreparer prepares a request to retrieve the next set of results. 3288// It returns nil if no more results exist. 3289func (dl DiskList) diskListPreparer(ctx context.Context) (*http.Request, error) { 3290 if !dl.hasNextLink() { 3291 return nil, nil 3292 } 3293 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3294 autorest.AsJSON(), 3295 autorest.AsGet(), 3296 autorest.WithBaseURL(to.String(dl.NextLink))) 3297} 3298 3299// DiskListPage contains a page of Disk values. 3300type DiskListPage struct { 3301 fn func(context.Context, DiskList) (DiskList, error) 3302 dl DiskList 3303} 3304 3305// NextWithContext advances to the next page of values. If there was an error making 3306// the request the page does not advance and the error is returned. 3307func (page *DiskListPage) NextWithContext(ctx context.Context) (err error) { 3308 if tracing.IsEnabled() { 3309 ctx = tracing.StartSpan(ctx, fqdn+"/DiskListPage.NextWithContext") 3310 defer func() { 3311 sc := -1 3312 if page.Response().Response.Response != nil { 3313 sc = page.Response().Response.Response.StatusCode 3314 } 3315 tracing.EndSpan(ctx, sc, err) 3316 }() 3317 } 3318 for { 3319 next, err := page.fn(ctx, page.dl) 3320 if err != nil { 3321 return err 3322 } 3323 page.dl = next 3324 if !next.hasNextLink() || !next.IsEmpty() { 3325 break 3326 } 3327 } 3328 return nil 3329} 3330 3331// Next advances to the next page of values. If there was an error making 3332// the request the page does not advance and the error is returned. 3333// Deprecated: Use NextWithContext() instead. 3334func (page *DiskListPage) Next() error { 3335 return page.NextWithContext(context.Background()) 3336} 3337 3338// NotDone returns true if the page enumeration should be started or is not yet complete. 3339func (page DiskListPage) NotDone() bool { 3340 return !page.dl.IsEmpty() 3341} 3342 3343// Response returns the raw server response from the last page request. 3344func (page DiskListPage) Response() DiskList { 3345 return page.dl 3346} 3347 3348// Values returns the slice of values for the current page or nil if there are no values. 3349func (page DiskListPage) Values() []Disk { 3350 if page.dl.IsEmpty() { 3351 return nil 3352 } 3353 return *page.dl.Value 3354} 3355 3356// Creates a new instance of the DiskListPage type. 3357func NewDiskListPage(cur DiskList, getNextPage func(context.Context, DiskList) (DiskList, error)) DiskListPage { 3358 return DiskListPage{ 3359 fn: getNextPage, 3360 dl: cur, 3361 } 3362} 3363 3364// DiskProperties disk resource properties. 3365type DiskProperties struct { 3366 // TimeCreated - READ-ONLY; The time when the disk was created. 3367 TimeCreated *date.Time `json:"timeCreated,omitempty"` 3368 // OsType - The Operating System type. Possible values include: 'Windows', 'Linux' 3369 OsType OperatingSystemTypes `json:"osType,omitempty"` 3370 // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'V1', 'V2' 3371 HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` 3372 // CreationData - Disk source information. CreationData information cannot be changed after the disk has been created. 3373 CreationData *CreationData `json:"creationData,omitempty"` 3374 // 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. 3375 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 3376 // DiskSizeBytes - READ-ONLY; The size of the disk in bytes. This field is read only. 3377 DiskSizeBytes *int64 `json:"diskSizeBytes,omitempty"` 3378 // UniqueID - READ-ONLY; Unique Guid identifying the resource. 3379 UniqueID *string `json:"uniqueId,omitempty"` 3380 // EncryptionSettingsCollection - Encryption settings collection used for Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. 3381 EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` 3382 // ProvisioningState - READ-ONLY; The disk provisioning state. 3383 ProvisioningState *string `json:"provisioningState,omitempty"` 3384 // DiskIOPSReadWrite - The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. 3385 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 3386 // 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. 3387 DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` 3388 // 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. 3389 DiskIOPSReadOnly *int64 `json:"diskIOPSReadOnly,omitempty"` 3390 // 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. 3391 DiskMBpsReadOnly *int64 `json:"diskMBpsReadOnly,omitempty"` 3392 // DiskState - The state of the disk. Possible values include: 'Unattached', 'Attached', 'Reserved', 'ActiveSAS', 'ReadyToUpload', 'ActiveUpload' 3393 DiskState DiskState `json:"diskState,omitempty"` 3394 // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 3395 Encryption *Encryption `json:"encryption,omitempty"` 3396 // 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. 3397 MaxShares *int32 `json:"maxShares,omitempty"` 3398 // 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. 3399 ShareInfo *[]ShareInfoElement `json:"shareInfo,omitempty"` 3400 // NetworkAccessPolicy - Possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll' 3401 NetworkAccessPolicy NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` 3402 // DiskAccessID - ARM id of the DiskAccess resource for using private endpoints on disks. 3403 DiskAccessID *string `json:"diskAccessId,omitempty"` 3404 // 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. 3405 Tier *string `json:"tier,omitempty"` 3406} 3407 3408// MarshalJSON is the custom marshaler for DiskProperties. 3409func (dp DiskProperties) MarshalJSON() ([]byte, error) { 3410 objectMap := make(map[string]interface{}) 3411 if dp.OsType != "" { 3412 objectMap["osType"] = dp.OsType 3413 } 3414 if dp.HyperVGeneration != "" { 3415 objectMap["hyperVGeneration"] = dp.HyperVGeneration 3416 } 3417 if dp.CreationData != nil { 3418 objectMap["creationData"] = dp.CreationData 3419 } 3420 if dp.DiskSizeGB != nil { 3421 objectMap["diskSizeGB"] = dp.DiskSizeGB 3422 } 3423 if dp.EncryptionSettingsCollection != nil { 3424 objectMap["encryptionSettingsCollection"] = dp.EncryptionSettingsCollection 3425 } 3426 if dp.DiskIOPSReadWrite != nil { 3427 objectMap["diskIOPSReadWrite"] = dp.DiskIOPSReadWrite 3428 } 3429 if dp.DiskMBpsReadWrite != nil { 3430 objectMap["diskMBpsReadWrite"] = dp.DiskMBpsReadWrite 3431 } 3432 if dp.DiskIOPSReadOnly != nil { 3433 objectMap["diskIOPSReadOnly"] = dp.DiskIOPSReadOnly 3434 } 3435 if dp.DiskMBpsReadOnly != nil { 3436 objectMap["diskMBpsReadOnly"] = dp.DiskMBpsReadOnly 3437 } 3438 if dp.DiskState != "" { 3439 objectMap["diskState"] = dp.DiskState 3440 } 3441 if dp.Encryption != nil { 3442 objectMap["encryption"] = dp.Encryption 3443 } 3444 if dp.MaxShares != nil { 3445 objectMap["maxShares"] = dp.MaxShares 3446 } 3447 if dp.NetworkAccessPolicy != "" { 3448 objectMap["networkAccessPolicy"] = dp.NetworkAccessPolicy 3449 } 3450 if dp.DiskAccessID != nil { 3451 objectMap["diskAccessId"] = dp.DiskAccessID 3452 } 3453 if dp.Tier != nil { 3454 objectMap["tier"] = dp.Tier 3455 } 3456 return json.Marshal(objectMap) 3457} 3458 3459// DisksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 3460// operation. 3461type DisksCreateOrUpdateFuture struct { 3462 azure.FutureAPI 3463 // Result returns the result of the asynchronous operation. 3464 // If the operation has not completed it will return an error. 3465 Result func(DisksClient) (Disk, error) 3466} 3467 3468// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3469func (future *DisksCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 3470 var azFuture azure.Future 3471 if err := json.Unmarshal(body, &azFuture); err != nil { 3472 return err 3473 } 3474 future.FutureAPI = &azFuture 3475 future.Result = future.result 3476 return nil 3477} 3478 3479// result is the default implementation for DisksCreateOrUpdateFuture.Result. 3480func (future *DisksCreateOrUpdateFuture) result(client DisksClient) (d Disk, err error) { 3481 var done bool 3482 done, err = future.DoneWithContext(context.Background(), client) 3483 if err != nil { 3484 err = autorest.NewErrorWithError(err, "compute.DisksCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 3485 return 3486 } 3487 if !done { 3488 d.Response.Response = future.Response() 3489 err = azure.NewAsyncOpIncompleteError("compute.DisksCreateOrUpdateFuture") 3490 return 3491 } 3492 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3493 if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent { 3494 d, err = client.CreateOrUpdateResponder(d.Response.Response) 3495 if err != nil { 3496 err = autorest.NewErrorWithError(err, "compute.DisksCreateOrUpdateFuture", "Result", d.Response.Response, "Failure responding to request") 3497 } 3498 } 3499 return 3500} 3501 3502// DisksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 3503type DisksDeleteFuture struct { 3504 azure.FutureAPI 3505 // Result returns the result of the asynchronous operation. 3506 // If the operation has not completed it will return an error. 3507 Result func(DisksClient) (autorest.Response, error) 3508} 3509 3510// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3511func (future *DisksDeleteFuture) UnmarshalJSON(body []byte) error { 3512 var azFuture azure.Future 3513 if err := json.Unmarshal(body, &azFuture); err != nil { 3514 return err 3515 } 3516 future.FutureAPI = &azFuture 3517 future.Result = future.result 3518 return nil 3519} 3520 3521// result is the default implementation for DisksDeleteFuture.Result. 3522func (future *DisksDeleteFuture) result(client DisksClient) (ar autorest.Response, err error) { 3523 var done bool 3524 done, err = future.DoneWithContext(context.Background(), client) 3525 if err != nil { 3526 err = autorest.NewErrorWithError(err, "compute.DisksDeleteFuture", "Result", future.Response(), "Polling failure") 3527 return 3528 } 3529 if !done { 3530 ar.Response = future.Response() 3531 err = azure.NewAsyncOpIncompleteError("compute.DisksDeleteFuture") 3532 return 3533 } 3534 ar.Response = future.Response() 3535 return 3536} 3537 3538// DisksGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running 3539// operation. 3540type DisksGrantAccessFuture struct { 3541 azure.FutureAPI 3542 // Result returns the result of the asynchronous operation. 3543 // If the operation has not completed it will return an error. 3544 Result func(DisksClient) (AccessURI, error) 3545} 3546 3547// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3548func (future *DisksGrantAccessFuture) UnmarshalJSON(body []byte) error { 3549 var azFuture azure.Future 3550 if err := json.Unmarshal(body, &azFuture); err != nil { 3551 return err 3552 } 3553 future.FutureAPI = &azFuture 3554 future.Result = future.result 3555 return nil 3556} 3557 3558// result is the default implementation for DisksGrantAccessFuture.Result. 3559func (future *DisksGrantAccessFuture) result(client DisksClient) (au AccessURI, err error) { 3560 var done bool 3561 done, err = future.DoneWithContext(context.Background(), client) 3562 if err != nil { 3563 err = autorest.NewErrorWithError(err, "compute.DisksGrantAccessFuture", "Result", future.Response(), "Polling failure") 3564 return 3565 } 3566 if !done { 3567 au.Response.Response = future.Response() 3568 err = azure.NewAsyncOpIncompleteError("compute.DisksGrantAccessFuture") 3569 return 3570 } 3571 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3572 if au.Response.Response, err = future.GetResult(sender); err == nil && au.Response.Response.StatusCode != http.StatusNoContent { 3573 au, err = client.GrantAccessResponder(au.Response.Response) 3574 if err != nil { 3575 err = autorest.NewErrorWithError(err, "compute.DisksGrantAccessFuture", "Result", au.Response.Response, "Failure responding to request") 3576 } 3577 } 3578 return 3579} 3580 3581// DiskSku the disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, or UltraSSD_LRS. 3582type DiskSku struct { 3583 // Name - The sku name. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS', 'UltraSSDLRS' 3584 Name DiskStorageAccountTypes `json:"name,omitempty"` 3585 // Tier - READ-ONLY; The sku tier. 3586 Tier *string `json:"tier,omitempty"` 3587} 3588 3589// MarshalJSON is the custom marshaler for DiskSku. 3590func (ds DiskSku) MarshalJSON() ([]byte, error) { 3591 objectMap := make(map[string]interface{}) 3592 if ds.Name != "" { 3593 objectMap["name"] = ds.Name 3594 } 3595 return json.Marshal(objectMap) 3596} 3597 3598// DisksRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running 3599// operation. 3600type DisksRevokeAccessFuture struct { 3601 azure.FutureAPI 3602 // Result returns the result of the asynchronous operation. 3603 // If the operation has not completed it will return an error. 3604 Result func(DisksClient) (autorest.Response, error) 3605} 3606 3607// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3608func (future *DisksRevokeAccessFuture) UnmarshalJSON(body []byte) error { 3609 var azFuture azure.Future 3610 if err := json.Unmarshal(body, &azFuture); err != nil { 3611 return err 3612 } 3613 future.FutureAPI = &azFuture 3614 future.Result = future.result 3615 return nil 3616} 3617 3618// result is the default implementation for DisksRevokeAccessFuture.Result. 3619func (future *DisksRevokeAccessFuture) result(client DisksClient) (ar autorest.Response, err error) { 3620 var done bool 3621 done, err = future.DoneWithContext(context.Background(), client) 3622 if err != nil { 3623 err = autorest.NewErrorWithError(err, "compute.DisksRevokeAccessFuture", "Result", future.Response(), "Polling failure") 3624 return 3625 } 3626 if !done { 3627 ar.Response = future.Response() 3628 err = azure.NewAsyncOpIncompleteError("compute.DisksRevokeAccessFuture") 3629 return 3630 } 3631 ar.Response = future.Response() 3632 return 3633} 3634 3635// DisksUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. 3636type DisksUpdateFuture struct { 3637 azure.FutureAPI 3638 // Result returns the result of the asynchronous operation. 3639 // If the operation has not completed it will return an error. 3640 Result func(DisksClient) (Disk, error) 3641} 3642 3643// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3644func (future *DisksUpdateFuture) UnmarshalJSON(body []byte) error { 3645 var azFuture azure.Future 3646 if err := json.Unmarshal(body, &azFuture); err != nil { 3647 return err 3648 } 3649 future.FutureAPI = &azFuture 3650 future.Result = future.result 3651 return nil 3652} 3653 3654// result is the default implementation for DisksUpdateFuture.Result. 3655func (future *DisksUpdateFuture) result(client DisksClient) (d Disk, err error) { 3656 var done bool 3657 done, err = future.DoneWithContext(context.Background(), client) 3658 if err != nil { 3659 err = autorest.NewErrorWithError(err, "compute.DisksUpdateFuture", "Result", future.Response(), "Polling failure") 3660 return 3661 } 3662 if !done { 3663 d.Response.Response = future.Response() 3664 err = azure.NewAsyncOpIncompleteError("compute.DisksUpdateFuture") 3665 return 3666 } 3667 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3668 if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent { 3669 d, err = client.UpdateResponder(d.Response.Response) 3670 if err != nil { 3671 err = autorest.NewErrorWithError(err, "compute.DisksUpdateFuture", "Result", d.Response.Response, "Failure responding to request") 3672 } 3673 } 3674 return 3675} 3676 3677// DiskUpdate disk update resource. 3678type DiskUpdate struct { 3679 *DiskUpdateProperties `json:"properties,omitempty"` 3680 // Tags - Resource tags 3681 Tags map[string]*string `json:"tags"` 3682 Sku *DiskSku `json:"sku,omitempty"` 3683} 3684 3685// MarshalJSON is the custom marshaler for DiskUpdate. 3686func (du DiskUpdate) MarshalJSON() ([]byte, error) { 3687 objectMap := make(map[string]interface{}) 3688 if du.DiskUpdateProperties != nil { 3689 objectMap["properties"] = du.DiskUpdateProperties 3690 } 3691 if du.Tags != nil { 3692 objectMap["tags"] = du.Tags 3693 } 3694 if du.Sku != nil { 3695 objectMap["sku"] = du.Sku 3696 } 3697 return json.Marshal(objectMap) 3698} 3699 3700// UnmarshalJSON is the custom unmarshaler for DiskUpdate struct. 3701func (du *DiskUpdate) UnmarshalJSON(body []byte) error { 3702 var m map[string]*json.RawMessage 3703 err := json.Unmarshal(body, &m) 3704 if err != nil { 3705 return err 3706 } 3707 for k, v := range m { 3708 switch k { 3709 case "properties": 3710 if v != nil { 3711 var diskUpdateProperties DiskUpdateProperties 3712 err = json.Unmarshal(*v, &diskUpdateProperties) 3713 if err != nil { 3714 return err 3715 } 3716 du.DiskUpdateProperties = &diskUpdateProperties 3717 } 3718 case "tags": 3719 if v != nil { 3720 var tags map[string]*string 3721 err = json.Unmarshal(*v, &tags) 3722 if err != nil { 3723 return err 3724 } 3725 du.Tags = tags 3726 } 3727 case "sku": 3728 if v != nil { 3729 var sku DiskSku 3730 err = json.Unmarshal(*v, &sku) 3731 if err != nil { 3732 return err 3733 } 3734 du.Sku = &sku 3735 } 3736 } 3737 } 3738 3739 return nil 3740} 3741 3742// DiskUpdateProperties disk resource update properties. 3743type DiskUpdateProperties struct { 3744 // OsType - the Operating System type. Possible values include: 'Windows', 'Linux' 3745 OsType OperatingSystemTypes `json:"osType,omitempty"` 3746 // 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. 3747 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 3748 // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. 3749 EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` 3750 // DiskIOPSReadWrite - The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. 3751 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 3752 // 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. 3753 DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` 3754 // 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. 3755 DiskIOPSReadOnly *int64 `json:"diskIOPSReadOnly,omitempty"` 3756 // 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. 3757 DiskMBpsReadOnly *int64 `json:"diskMBpsReadOnly,omitempty"` 3758 // 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. 3759 MaxShares *int32 `json:"maxShares,omitempty"` 3760 // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 3761 Encryption *Encryption `json:"encryption,omitempty"` 3762 // NetworkAccessPolicy - Possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll' 3763 NetworkAccessPolicy NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` 3764 // DiskAccessID - ARM id of the DiskAccess resource for using private endpoints on disks. 3765 DiskAccessID *string `json:"diskAccessId,omitempty"` 3766 // 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. 3767 Tier *string `json:"tier,omitempty"` 3768} 3769 3770// Encryption encryption at rest settings for disk or snapshot 3771type Encryption struct { 3772 // DiskEncryptionSetID - ResourceId of the disk encryption set to use for enabling encryption at rest. 3773 DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` 3774 // Type - Possible values include: 'EncryptionTypeEncryptionAtRestWithPlatformKey', 'EncryptionTypeEncryptionAtRestWithCustomerKey', 'EncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys' 3775 Type EncryptionType `json:"type,omitempty"` 3776} 3777 3778// EncryptionImages optional. Allows users to provide customer managed keys for encrypting the OS and data 3779// disks in the gallery artifact. 3780type EncryptionImages struct { 3781 OsDiskImage *OSDiskImageEncryption `json:"osDiskImage,omitempty"` 3782 // DataDiskImages - A list of encryption specifications for data disk images. 3783 DataDiskImages *[]DataDiskImageEncryption `json:"dataDiskImages,omitempty"` 3784} 3785 3786// EncryptionSetIdentity the managed identity for the disk encryption set. It should be given permission on 3787// the key vault before it can be used to encrypt disks. 3788type EncryptionSetIdentity struct { 3789 // Type - The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is supported. Possible values include: 'SystemAssigned' 3790 Type DiskEncryptionSetIdentityType `json:"type,omitempty"` 3791 // 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 3792 PrincipalID *string `json:"principalId,omitempty"` 3793 // 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 3794 TenantID *string `json:"tenantId,omitempty"` 3795} 3796 3797// MarshalJSON is the custom marshaler for EncryptionSetIdentity. 3798func (esi EncryptionSetIdentity) MarshalJSON() ([]byte, error) { 3799 objectMap := make(map[string]interface{}) 3800 if esi.Type != "" { 3801 objectMap["type"] = esi.Type 3802 } 3803 return json.Marshal(objectMap) 3804} 3805 3806// EncryptionSetProperties ... 3807type EncryptionSetProperties struct { 3808 // EncryptionType - Possible values include: 'EncryptionAtRestWithCustomerKey', 'EncryptionAtRestWithPlatformAndCustomerKeys' 3809 EncryptionType DiskEncryptionSetType `json:"encryptionType,omitempty"` 3810 // ActiveKey - The key vault key which is currently used by this disk encryption set. 3811 ActiveKey *KeyVaultAndKeyReference `json:"activeKey,omitempty"` 3812 // 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. 3813 PreviousKeys *[]KeyVaultAndKeyReference `json:"previousKeys,omitempty"` 3814 // ProvisioningState - READ-ONLY; The disk encryption set provisioning state. 3815 ProvisioningState *string `json:"provisioningState,omitempty"` 3816} 3817 3818// MarshalJSON is the custom marshaler for EncryptionSetProperties. 3819func (esp EncryptionSetProperties) MarshalJSON() ([]byte, error) { 3820 objectMap := make(map[string]interface{}) 3821 if esp.EncryptionType != "" { 3822 objectMap["encryptionType"] = esp.EncryptionType 3823 } 3824 if esp.ActiveKey != nil { 3825 objectMap["activeKey"] = esp.ActiveKey 3826 } 3827 return json.Marshal(objectMap) 3828} 3829 3830// EncryptionSettingsCollection encryption settings for disk or snapshot 3831type EncryptionSettingsCollection struct { 3832 // 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. 3833 Enabled *bool `json:"enabled,omitempty"` 3834 // EncryptionSettings - A collection of encryption settings, one for each disk volume. 3835 EncryptionSettings *[]EncryptionSettingsElement `json:"encryptionSettings,omitempty"` 3836 // 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. 3837 EncryptionSettingsVersion *string `json:"encryptionSettingsVersion,omitempty"` 3838} 3839 3840// EncryptionSettingsElement encryption settings for one disk volume. 3841type EncryptionSettingsElement struct { 3842 // DiskEncryptionKey - Key Vault Secret Url and vault id of the disk encryption key 3843 DiskEncryptionKey *KeyVaultAndSecretReference `json:"diskEncryptionKey,omitempty"` 3844 // 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. 3845 KeyEncryptionKey *KeyVaultAndKeyReference `json:"keyEncryptionKey,omitempty"` 3846} 3847 3848// GalleriesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 3849// operation. 3850type GalleriesCreateOrUpdateFuture struct { 3851 azure.FutureAPI 3852 // Result returns the result of the asynchronous operation. 3853 // If the operation has not completed it will return an error. 3854 Result func(GalleriesClient) (Gallery, error) 3855} 3856 3857// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3858func (future *GalleriesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 3859 var azFuture azure.Future 3860 if err := json.Unmarshal(body, &azFuture); err != nil { 3861 return err 3862 } 3863 future.FutureAPI = &azFuture 3864 future.Result = future.result 3865 return nil 3866} 3867 3868// result is the default implementation for GalleriesCreateOrUpdateFuture.Result. 3869func (future *GalleriesCreateOrUpdateFuture) result(client GalleriesClient) (g Gallery, err error) { 3870 var done bool 3871 done, err = future.DoneWithContext(context.Background(), client) 3872 if err != nil { 3873 err = autorest.NewErrorWithError(err, "compute.GalleriesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 3874 return 3875 } 3876 if !done { 3877 g.Response.Response = future.Response() 3878 err = azure.NewAsyncOpIncompleteError("compute.GalleriesCreateOrUpdateFuture") 3879 return 3880 } 3881 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3882 if g.Response.Response, err = future.GetResult(sender); err == nil && g.Response.Response.StatusCode != http.StatusNoContent { 3883 g, err = client.CreateOrUpdateResponder(g.Response.Response) 3884 if err != nil { 3885 err = autorest.NewErrorWithError(err, "compute.GalleriesCreateOrUpdateFuture", "Result", g.Response.Response, "Failure responding to request") 3886 } 3887 } 3888 return 3889} 3890 3891// GalleriesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 3892// operation. 3893type GalleriesDeleteFuture struct { 3894 azure.FutureAPI 3895 // Result returns the result of the asynchronous operation. 3896 // If the operation has not completed it will return an error. 3897 Result func(GalleriesClient) (autorest.Response, error) 3898} 3899 3900// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3901func (future *GalleriesDeleteFuture) UnmarshalJSON(body []byte) error { 3902 var azFuture azure.Future 3903 if err := json.Unmarshal(body, &azFuture); err != nil { 3904 return err 3905 } 3906 future.FutureAPI = &azFuture 3907 future.Result = future.result 3908 return nil 3909} 3910 3911// result is the default implementation for GalleriesDeleteFuture.Result. 3912func (future *GalleriesDeleteFuture) result(client GalleriesClient) (ar autorest.Response, err error) { 3913 var done bool 3914 done, err = future.DoneWithContext(context.Background(), client) 3915 if err != nil { 3916 err = autorest.NewErrorWithError(err, "compute.GalleriesDeleteFuture", "Result", future.Response(), "Polling failure") 3917 return 3918 } 3919 if !done { 3920 ar.Response = future.Response() 3921 err = azure.NewAsyncOpIncompleteError("compute.GalleriesDeleteFuture") 3922 return 3923 } 3924 ar.Response = future.Response() 3925 return 3926} 3927 3928// GalleriesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 3929// operation. 3930type GalleriesUpdateFuture struct { 3931 azure.FutureAPI 3932 // Result returns the result of the asynchronous operation. 3933 // If the operation has not completed it will return an error. 3934 Result func(GalleriesClient) (Gallery, error) 3935} 3936 3937// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3938func (future *GalleriesUpdateFuture) UnmarshalJSON(body []byte) error { 3939 var azFuture azure.Future 3940 if err := json.Unmarshal(body, &azFuture); err != nil { 3941 return err 3942 } 3943 future.FutureAPI = &azFuture 3944 future.Result = future.result 3945 return nil 3946} 3947 3948// result is the default implementation for GalleriesUpdateFuture.Result. 3949func (future *GalleriesUpdateFuture) result(client GalleriesClient) (g Gallery, err error) { 3950 var done bool 3951 done, err = future.DoneWithContext(context.Background(), client) 3952 if err != nil { 3953 err = autorest.NewErrorWithError(err, "compute.GalleriesUpdateFuture", "Result", future.Response(), "Polling failure") 3954 return 3955 } 3956 if !done { 3957 g.Response.Response = future.Response() 3958 err = azure.NewAsyncOpIncompleteError("compute.GalleriesUpdateFuture") 3959 return 3960 } 3961 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3962 if g.Response.Response, err = future.GetResult(sender); err == nil && g.Response.Response.StatusCode != http.StatusNoContent { 3963 g, err = client.UpdateResponder(g.Response.Response) 3964 if err != nil { 3965 err = autorest.NewErrorWithError(err, "compute.GalleriesUpdateFuture", "Result", g.Response.Response, "Failure responding to request") 3966 } 3967 } 3968 return 3969} 3970 3971// Gallery specifies information about the Shared Image Gallery that you want to create or update. 3972type Gallery struct { 3973 autorest.Response `json:"-"` 3974 *GalleryProperties `json:"properties,omitempty"` 3975 // ID - READ-ONLY; Resource Id 3976 ID *string `json:"id,omitempty"` 3977 // Name - READ-ONLY; Resource name 3978 Name *string `json:"name,omitempty"` 3979 // Type - READ-ONLY; Resource type 3980 Type *string `json:"type,omitempty"` 3981 // Location - Resource location 3982 Location *string `json:"location,omitempty"` 3983 // Tags - Resource tags 3984 Tags map[string]*string `json:"tags"` 3985} 3986 3987// MarshalJSON is the custom marshaler for Gallery. 3988func (g Gallery) MarshalJSON() ([]byte, error) { 3989 objectMap := make(map[string]interface{}) 3990 if g.GalleryProperties != nil { 3991 objectMap["properties"] = g.GalleryProperties 3992 } 3993 if g.Location != nil { 3994 objectMap["location"] = g.Location 3995 } 3996 if g.Tags != nil { 3997 objectMap["tags"] = g.Tags 3998 } 3999 return json.Marshal(objectMap) 4000} 4001 4002// UnmarshalJSON is the custom unmarshaler for Gallery struct. 4003func (g *Gallery) UnmarshalJSON(body []byte) error { 4004 var m map[string]*json.RawMessage 4005 err := json.Unmarshal(body, &m) 4006 if err != nil { 4007 return err 4008 } 4009 for k, v := range m { 4010 switch k { 4011 case "properties": 4012 if v != nil { 4013 var galleryProperties GalleryProperties 4014 err = json.Unmarshal(*v, &galleryProperties) 4015 if err != nil { 4016 return err 4017 } 4018 g.GalleryProperties = &galleryProperties 4019 } 4020 case "id": 4021 if v != nil { 4022 var ID string 4023 err = json.Unmarshal(*v, &ID) 4024 if err != nil { 4025 return err 4026 } 4027 g.ID = &ID 4028 } 4029 case "name": 4030 if v != nil { 4031 var name string 4032 err = json.Unmarshal(*v, &name) 4033 if err != nil { 4034 return err 4035 } 4036 g.Name = &name 4037 } 4038 case "type": 4039 if v != nil { 4040 var typeVar string 4041 err = json.Unmarshal(*v, &typeVar) 4042 if err != nil { 4043 return err 4044 } 4045 g.Type = &typeVar 4046 } 4047 case "location": 4048 if v != nil { 4049 var location string 4050 err = json.Unmarshal(*v, &location) 4051 if err != nil { 4052 return err 4053 } 4054 g.Location = &location 4055 } 4056 case "tags": 4057 if v != nil { 4058 var tags map[string]*string 4059 err = json.Unmarshal(*v, &tags) 4060 if err != nil { 4061 return err 4062 } 4063 g.Tags = tags 4064 } 4065 } 4066 } 4067 4068 return nil 4069} 4070 4071// GalleryApplication specifies information about the gallery Application Definition that you want to 4072// create or update. 4073type GalleryApplication struct { 4074 autorest.Response `json:"-"` 4075 *GalleryApplicationProperties `json:"properties,omitempty"` 4076 // ID - READ-ONLY; Resource Id 4077 ID *string `json:"id,omitempty"` 4078 // Name - READ-ONLY; Resource name 4079 Name *string `json:"name,omitempty"` 4080 // Type - READ-ONLY; Resource type 4081 Type *string `json:"type,omitempty"` 4082 // Location - Resource location 4083 Location *string `json:"location,omitempty"` 4084 // Tags - Resource tags 4085 Tags map[string]*string `json:"tags"` 4086} 4087 4088// MarshalJSON is the custom marshaler for GalleryApplication. 4089func (ga GalleryApplication) MarshalJSON() ([]byte, error) { 4090 objectMap := make(map[string]interface{}) 4091 if ga.GalleryApplicationProperties != nil { 4092 objectMap["properties"] = ga.GalleryApplicationProperties 4093 } 4094 if ga.Location != nil { 4095 objectMap["location"] = ga.Location 4096 } 4097 if ga.Tags != nil { 4098 objectMap["tags"] = ga.Tags 4099 } 4100 return json.Marshal(objectMap) 4101} 4102 4103// UnmarshalJSON is the custom unmarshaler for GalleryApplication struct. 4104func (ga *GalleryApplication) UnmarshalJSON(body []byte) error { 4105 var m map[string]*json.RawMessage 4106 err := json.Unmarshal(body, &m) 4107 if err != nil { 4108 return err 4109 } 4110 for k, v := range m { 4111 switch k { 4112 case "properties": 4113 if v != nil { 4114 var galleryApplicationProperties GalleryApplicationProperties 4115 err = json.Unmarshal(*v, &galleryApplicationProperties) 4116 if err != nil { 4117 return err 4118 } 4119 ga.GalleryApplicationProperties = &galleryApplicationProperties 4120 } 4121 case "id": 4122 if v != nil { 4123 var ID string 4124 err = json.Unmarshal(*v, &ID) 4125 if err != nil { 4126 return err 4127 } 4128 ga.ID = &ID 4129 } 4130 case "name": 4131 if v != nil { 4132 var name string 4133 err = json.Unmarshal(*v, &name) 4134 if err != nil { 4135 return err 4136 } 4137 ga.Name = &name 4138 } 4139 case "type": 4140 if v != nil { 4141 var typeVar string 4142 err = json.Unmarshal(*v, &typeVar) 4143 if err != nil { 4144 return err 4145 } 4146 ga.Type = &typeVar 4147 } 4148 case "location": 4149 if v != nil { 4150 var location string 4151 err = json.Unmarshal(*v, &location) 4152 if err != nil { 4153 return err 4154 } 4155 ga.Location = &location 4156 } 4157 case "tags": 4158 if v != nil { 4159 var tags map[string]*string 4160 err = json.Unmarshal(*v, &tags) 4161 if err != nil { 4162 return err 4163 } 4164 ga.Tags = tags 4165 } 4166 } 4167 } 4168 4169 return nil 4170} 4171 4172// GalleryApplicationList the List Gallery Applications operation response. 4173type GalleryApplicationList struct { 4174 autorest.Response `json:"-"` 4175 // Value - A list of Gallery Applications. 4176 Value *[]GalleryApplication `json:"value,omitempty"` 4177 // 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. 4178 NextLink *string `json:"nextLink,omitempty"` 4179} 4180 4181// GalleryApplicationListIterator provides access to a complete listing of GalleryApplication values. 4182type GalleryApplicationListIterator struct { 4183 i int 4184 page GalleryApplicationListPage 4185} 4186 4187// NextWithContext advances to the next value. If there was an error making 4188// the request the iterator does not advance and the error is returned. 4189func (iter *GalleryApplicationListIterator) NextWithContext(ctx context.Context) (err error) { 4190 if tracing.IsEnabled() { 4191 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationListIterator.NextWithContext") 4192 defer func() { 4193 sc := -1 4194 if iter.Response().Response.Response != nil { 4195 sc = iter.Response().Response.Response.StatusCode 4196 } 4197 tracing.EndSpan(ctx, sc, err) 4198 }() 4199 } 4200 iter.i++ 4201 if iter.i < len(iter.page.Values()) { 4202 return nil 4203 } 4204 err = iter.page.NextWithContext(ctx) 4205 if err != nil { 4206 iter.i-- 4207 return err 4208 } 4209 iter.i = 0 4210 return nil 4211} 4212 4213// Next advances to the next value. If there was an error making 4214// the request the iterator does not advance and the error is returned. 4215// Deprecated: Use NextWithContext() instead. 4216func (iter *GalleryApplicationListIterator) Next() error { 4217 return iter.NextWithContext(context.Background()) 4218} 4219 4220// NotDone returns true if the enumeration should be started or is not yet complete. 4221func (iter GalleryApplicationListIterator) NotDone() bool { 4222 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4223} 4224 4225// Response returns the raw server response from the last page request. 4226func (iter GalleryApplicationListIterator) Response() GalleryApplicationList { 4227 return iter.page.Response() 4228} 4229 4230// Value returns the current value or a zero-initialized value if the 4231// iterator has advanced beyond the end of the collection. 4232func (iter GalleryApplicationListIterator) Value() GalleryApplication { 4233 if !iter.page.NotDone() { 4234 return GalleryApplication{} 4235 } 4236 return iter.page.Values()[iter.i] 4237} 4238 4239// Creates a new instance of the GalleryApplicationListIterator type. 4240func NewGalleryApplicationListIterator(page GalleryApplicationListPage) GalleryApplicationListIterator { 4241 return GalleryApplicationListIterator{page: page} 4242} 4243 4244// IsEmpty returns true if the ListResult contains no values. 4245func (gal GalleryApplicationList) IsEmpty() bool { 4246 return gal.Value == nil || len(*gal.Value) == 0 4247} 4248 4249// hasNextLink returns true if the NextLink is not empty. 4250func (gal GalleryApplicationList) hasNextLink() bool { 4251 return gal.NextLink != nil && len(*gal.NextLink) != 0 4252} 4253 4254// galleryApplicationListPreparer prepares a request to retrieve the next set of results. 4255// It returns nil if no more results exist. 4256func (gal GalleryApplicationList) galleryApplicationListPreparer(ctx context.Context) (*http.Request, error) { 4257 if !gal.hasNextLink() { 4258 return nil, nil 4259 } 4260 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4261 autorest.AsJSON(), 4262 autorest.AsGet(), 4263 autorest.WithBaseURL(to.String(gal.NextLink))) 4264} 4265 4266// GalleryApplicationListPage contains a page of GalleryApplication values. 4267type GalleryApplicationListPage struct { 4268 fn func(context.Context, GalleryApplicationList) (GalleryApplicationList, error) 4269 gal GalleryApplicationList 4270} 4271 4272// NextWithContext advances to the next page of values. If there was an error making 4273// the request the page does not advance and the error is returned. 4274func (page *GalleryApplicationListPage) NextWithContext(ctx context.Context) (err error) { 4275 if tracing.IsEnabled() { 4276 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationListPage.NextWithContext") 4277 defer func() { 4278 sc := -1 4279 if page.Response().Response.Response != nil { 4280 sc = page.Response().Response.Response.StatusCode 4281 } 4282 tracing.EndSpan(ctx, sc, err) 4283 }() 4284 } 4285 for { 4286 next, err := page.fn(ctx, page.gal) 4287 if err != nil { 4288 return err 4289 } 4290 page.gal = next 4291 if !next.hasNextLink() || !next.IsEmpty() { 4292 break 4293 } 4294 } 4295 return nil 4296} 4297 4298// Next advances to the next page of values. If there was an error making 4299// the request the page does not advance and the error is returned. 4300// Deprecated: Use NextWithContext() instead. 4301func (page *GalleryApplicationListPage) Next() error { 4302 return page.NextWithContext(context.Background()) 4303} 4304 4305// NotDone returns true if the page enumeration should be started or is not yet complete. 4306func (page GalleryApplicationListPage) NotDone() bool { 4307 return !page.gal.IsEmpty() 4308} 4309 4310// Response returns the raw server response from the last page request. 4311func (page GalleryApplicationListPage) Response() GalleryApplicationList { 4312 return page.gal 4313} 4314 4315// Values returns the slice of values for the current page or nil if there are no values. 4316func (page GalleryApplicationListPage) Values() []GalleryApplication { 4317 if page.gal.IsEmpty() { 4318 return nil 4319 } 4320 return *page.gal.Value 4321} 4322 4323// Creates a new instance of the GalleryApplicationListPage type. 4324func NewGalleryApplicationListPage(cur GalleryApplicationList, getNextPage func(context.Context, GalleryApplicationList) (GalleryApplicationList, error)) GalleryApplicationListPage { 4325 return GalleryApplicationListPage{ 4326 fn: getNextPage, 4327 gal: cur, 4328 } 4329} 4330 4331// GalleryApplicationProperties describes the properties of a gallery Application Definition. 4332type GalleryApplicationProperties struct { 4333 // Description - The description of this gallery Application Definition resource. This property is updatable. 4334 Description *string `json:"description,omitempty"` 4335 // Eula - The Eula agreement for the gallery Application Definition. 4336 Eula *string `json:"eula,omitempty"` 4337 // PrivacyStatementURI - The privacy statement uri. 4338 PrivacyStatementURI *string `json:"privacyStatementUri,omitempty"` 4339 // ReleaseNoteURI - The release note uri. 4340 ReleaseNoteURI *string `json:"releaseNoteUri,omitempty"` 4341 // EndOfLifeDate - The end of life date of the gallery Application Definition. This property can be used for decommissioning purposes. This property is updatable. 4342 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 4343 // 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: 'Windows', 'Linux' 4344 SupportedOSType OperatingSystemTypes `json:"supportedOSType,omitempty"` 4345} 4346 4347// GalleryApplicationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 4348// long-running operation. 4349type GalleryApplicationsCreateOrUpdateFuture struct { 4350 azure.FutureAPI 4351 // Result returns the result of the asynchronous operation. 4352 // If the operation has not completed it will return an error. 4353 Result func(GalleryApplicationsClient) (GalleryApplication, error) 4354} 4355 4356// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4357func (future *GalleryApplicationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 4358 var azFuture azure.Future 4359 if err := json.Unmarshal(body, &azFuture); err != nil { 4360 return err 4361 } 4362 future.FutureAPI = &azFuture 4363 future.Result = future.result 4364 return nil 4365} 4366 4367// result is the default implementation for GalleryApplicationsCreateOrUpdateFuture.Result. 4368func (future *GalleryApplicationsCreateOrUpdateFuture) result(client GalleryApplicationsClient) (ga GalleryApplication, err error) { 4369 var done bool 4370 done, err = future.DoneWithContext(context.Background(), client) 4371 if err != nil { 4372 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 4373 return 4374 } 4375 if !done { 4376 ga.Response.Response = future.Response() 4377 err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationsCreateOrUpdateFuture") 4378 return 4379 } 4380 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4381 if ga.Response.Response, err = future.GetResult(sender); err == nil && ga.Response.Response.StatusCode != http.StatusNoContent { 4382 ga, err = client.CreateOrUpdateResponder(ga.Response.Response) 4383 if err != nil { 4384 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsCreateOrUpdateFuture", "Result", ga.Response.Response, "Failure responding to request") 4385 } 4386 } 4387 return 4388} 4389 4390// GalleryApplicationsDeleteFuture an abstraction for monitoring and retrieving the results of a 4391// long-running operation. 4392type GalleryApplicationsDeleteFuture struct { 4393 azure.FutureAPI 4394 // Result returns the result of the asynchronous operation. 4395 // If the operation has not completed it will return an error. 4396 Result func(GalleryApplicationsClient) (autorest.Response, error) 4397} 4398 4399// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4400func (future *GalleryApplicationsDeleteFuture) UnmarshalJSON(body []byte) error { 4401 var azFuture azure.Future 4402 if err := json.Unmarshal(body, &azFuture); err != nil { 4403 return err 4404 } 4405 future.FutureAPI = &azFuture 4406 future.Result = future.result 4407 return nil 4408} 4409 4410// result is the default implementation for GalleryApplicationsDeleteFuture.Result. 4411func (future *GalleryApplicationsDeleteFuture) result(client GalleryApplicationsClient) (ar autorest.Response, err error) { 4412 var done bool 4413 done, err = future.DoneWithContext(context.Background(), client) 4414 if err != nil { 4415 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsDeleteFuture", "Result", future.Response(), "Polling failure") 4416 return 4417 } 4418 if !done { 4419 ar.Response = future.Response() 4420 err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationsDeleteFuture") 4421 return 4422 } 4423 ar.Response = future.Response() 4424 return 4425} 4426 4427// GalleryApplicationsUpdateFuture an abstraction for monitoring and retrieving the results of a 4428// long-running operation. 4429type GalleryApplicationsUpdateFuture struct { 4430 azure.FutureAPI 4431 // Result returns the result of the asynchronous operation. 4432 // If the operation has not completed it will return an error. 4433 Result func(GalleryApplicationsClient) (GalleryApplication, error) 4434} 4435 4436// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4437func (future *GalleryApplicationsUpdateFuture) UnmarshalJSON(body []byte) error { 4438 var azFuture azure.Future 4439 if err := json.Unmarshal(body, &azFuture); err != nil { 4440 return err 4441 } 4442 future.FutureAPI = &azFuture 4443 future.Result = future.result 4444 return nil 4445} 4446 4447// result is the default implementation for GalleryApplicationsUpdateFuture.Result. 4448func (future *GalleryApplicationsUpdateFuture) result(client GalleryApplicationsClient) (ga GalleryApplication, err error) { 4449 var done bool 4450 done, err = future.DoneWithContext(context.Background(), client) 4451 if err != nil { 4452 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsUpdateFuture", "Result", future.Response(), "Polling failure") 4453 return 4454 } 4455 if !done { 4456 ga.Response.Response = future.Response() 4457 err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationsUpdateFuture") 4458 return 4459 } 4460 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4461 if ga.Response.Response, err = future.GetResult(sender); err == nil && ga.Response.Response.StatusCode != http.StatusNoContent { 4462 ga, err = client.UpdateResponder(ga.Response.Response) 4463 if err != nil { 4464 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsUpdateFuture", "Result", ga.Response.Response, "Failure responding to request") 4465 } 4466 } 4467 return 4468} 4469 4470// GalleryApplicationUpdate specifies information about the gallery Application Definition that you want to 4471// update. 4472type GalleryApplicationUpdate struct { 4473 *GalleryApplicationProperties `json:"properties,omitempty"` 4474 // ID - READ-ONLY; Resource Id 4475 ID *string `json:"id,omitempty"` 4476 // Name - READ-ONLY; Resource name 4477 Name *string `json:"name,omitempty"` 4478 // Type - READ-ONLY; Resource type 4479 Type *string `json:"type,omitempty"` 4480 // Tags - Resource tags 4481 Tags map[string]*string `json:"tags"` 4482} 4483 4484// MarshalJSON is the custom marshaler for GalleryApplicationUpdate. 4485func (gau GalleryApplicationUpdate) MarshalJSON() ([]byte, error) { 4486 objectMap := make(map[string]interface{}) 4487 if gau.GalleryApplicationProperties != nil { 4488 objectMap["properties"] = gau.GalleryApplicationProperties 4489 } 4490 if gau.Tags != nil { 4491 objectMap["tags"] = gau.Tags 4492 } 4493 return json.Marshal(objectMap) 4494} 4495 4496// UnmarshalJSON is the custom unmarshaler for GalleryApplicationUpdate struct. 4497func (gau *GalleryApplicationUpdate) UnmarshalJSON(body []byte) error { 4498 var m map[string]*json.RawMessage 4499 err := json.Unmarshal(body, &m) 4500 if err != nil { 4501 return err 4502 } 4503 for k, v := range m { 4504 switch k { 4505 case "properties": 4506 if v != nil { 4507 var galleryApplicationProperties GalleryApplicationProperties 4508 err = json.Unmarshal(*v, &galleryApplicationProperties) 4509 if err != nil { 4510 return err 4511 } 4512 gau.GalleryApplicationProperties = &galleryApplicationProperties 4513 } 4514 case "id": 4515 if v != nil { 4516 var ID string 4517 err = json.Unmarshal(*v, &ID) 4518 if err != nil { 4519 return err 4520 } 4521 gau.ID = &ID 4522 } 4523 case "name": 4524 if v != nil { 4525 var name string 4526 err = json.Unmarshal(*v, &name) 4527 if err != nil { 4528 return err 4529 } 4530 gau.Name = &name 4531 } 4532 case "type": 4533 if v != nil { 4534 var typeVar string 4535 err = json.Unmarshal(*v, &typeVar) 4536 if err != nil { 4537 return err 4538 } 4539 gau.Type = &typeVar 4540 } 4541 case "tags": 4542 if v != nil { 4543 var tags map[string]*string 4544 err = json.Unmarshal(*v, &tags) 4545 if err != nil { 4546 return err 4547 } 4548 gau.Tags = tags 4549 } 4550 } 4551 } 4552 4553 return nil 4554} 4555 4556// GalleryApplicationVersion specifies information about the gallery Application Version that you want to 4557// create or update. 4558type GalleryApplicationVersion struct { 4559 autorest.Response `json:"-"` 4560 *GalleryApplicationVersionProperties `json:"properties,omitempty"` 4561 // ID - READ-ONLY; Resource Id 4562 ID *string `json:"id,omitempty"` 4563 // Name - READ-ONLY; Resource name 4564 Name *string `json:"name,omitempty"` 4565 // Type - READ-ONLY; Resource type 4566 Type *string `json:"type,omitempty"` 4567 // Location - Resource location 4568 Location *string `json:"location,omitempty"` 4569 // Tags - Resource tags 4570 Tags map[string]*string `json:"tags"` 4571} 4572 4573// MarshalJSON is the custom marshaler for GalleryApplicationVersion. 4574func (gav GalleryApplicationVersion) MarshalJSON() ([]byte, error) { 4575 objectMap := make(map[string]interface{}) 4576 if gav.GalleryApplicationVersionProperties != nil { 4577 objectMap["properties"] = gav.GalleryApplicationVersionProperties 4578 } 4579 if gav.Location != nil { 4580 objectMap["location"] = gav.Location 4581 } 4582 if gav.Tags != nil { 4583 objectMap["tags"] = gav.Tags 4584 } 4585 return json.Marshal(objectMap) 4586} 4587 4588// UnmarshalJSON is the custom unmarshaler for GalleryApplicationVersion struct. 4589func (gav *GalleryApplicationVersion) UnmarshalJSON(body []byte) error { 4590 var m map[string]*json.RawMessage 4591 err := json.Unmarshal(body, &m) 4592 if err != nil { 4593 return err 4594 } 4595 for k, v := range m { 4596 switch k { 4597 case "properties": 4598 if v != nil { 4599 var galleryApplicationVersionProperties GalleryApplicationVersionProperties 4600 err = json.Unmarshal(*v, &galleryApplicationVersionProperties) 4601 if err != nil { 4602 return err 4603 } 4604 gav.GalleryApplicationVersionProperties = &galleryApplicationVersionProperties 4605 } 4606 case "id": 4607 if v != nil { 4608 var ID string 4609 err = json.Unmarshal(*v, &ID) 4610 if err != nil { 4611 return err 4612 } 4613 gav.ID = &ID 4614 } 4615 case "name": 4616 if v != nil { 4617 var name string 4618 err = json.Unmarshal(*v, &name) 4619 if err != nil { 4620 return err 4621 } 4622 gav.Name = &name 4623 } 4624 case "type": 4625 if v != nil { 4626 var typeVar string 4627 err = json.Unmarshal(*v, &typeVar) 4628 if err != nil { 4629 return err 4630 } 4631 gav.Type = &typeVar 4632 } 4633 case "location": 4634 if v != nil { 4635 var location string 4636 err = json.Unmarshal(*v, &location) 4637 if err != nil { 4638 return err 4639 } 4640 gav.Location = &location 4641 } 4642 case "tags": 4643 if v != nil { 4644 var tags map[string]*string 4645 err = json.Unmarshal(*v, &tags) 4646 if err != nil { 4647 return err 4648 } 4649 gav.Tags = tags 4650 } 4651 } 4652 } 4653 4654 return nil 4655} 4656 4657// GalleryApplicationVersionList the List Gallery Application version operation response. 4658type GalleryApplicationVersionList struct { 4659 autorest.Response `json:"-"` 4660 // Value - A list of gallery Application Versions. 4661 Value *[]GalleryApplicationVersion `json:"value,omitempty"` 4662 // 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. 4663 NextLink *string `json:"nextLink,omitempty"` 4664} 4665 4666// GalleryApplicationVersionListIterator provides access to a complete listing of GalleryApplicationVersion 4667// values. 4668type GalleryApplicationVersionListIterator struct { 4669 i int 4670 page GalleryApplicationVersionListPage 4671} 4672 4673// NextWithContext advances to the next value. If there was an error making 4674// the request the iterator does not advance and the error is returned. 4675func (iter *GalleryApplicationVersionListIterator) NextWithContext(ctx context.Context) (err error) { 4676 if tracing.IsEnabled() { 4677 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionListIterator.NextWithContext") 4678 defer func() { 4679 sc := -1 4680 if iter.Response().Response.Response != nil { 4681 sc = iter.Response().Response.Response.StatusCode 4682 } 4683 tracing.EndSpan(ctx, sc, err) 4684 }() 4685 } 4686 iter.i++ 4687 if iter.i < len(iter.page.Values()) { 4688 return nil 4689 } 4690 err = iter.page.NextWithContext(ctx) 4691 if err != nil { 4692 iter.i-- 4693 return err 4694 } 4695 iter.i = 0 4696 return nil 4697} 4698 4699// Next advances to the next value. If there was an error making 4700// the request the iterator does not advance and the error is returned. 4701// Deprecated: Use NextWithContext() instead. 4702func (iter *GalleryApplicationVersionListIterator) Next() error { 4703 return iter.NextWithContext(context.Background()) 4704} 4705 4706// NotDone returns true if the enumeration should be started or is not yet complete. 4707func (iter GalleryApplicationVersionListIterator) NotDone() bool { 4708 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4709} 4710 4711// Response returns the raw server response from the last page request. 4712func (iter GalleryApplicationVersionListIterator) Response() GalleryApplicationVersionList { 4713 return iter.page.Response() 4714} 4715 4716// Value returns the current value or a zero-initialized value if the 4717// iterator has advanced beyond the end of the collection. 4718func (iter GalleryApplicationVersionListIterator) Value() GalleryApplicationVersion { 4719 if !iter.page.NotDone() { 4720 return GalleryApplicationVersion{} 4721 } 4722 return iter.page.Values()[iter.i] 4723} 4724 4725// Creates a new instance of the GalleryApplicationVersionListIterator type. 4726func NewGalleryApplicationVersionListIterator(page GalleryApplicationVersionListPage) GalleryApplicationVersionListIterator { 4727 return GalleryApplicationVersionListIterator{page: page} 4728} 4729 4730// IsEmpty returns true if the ListResult contains no values. 4731func (gavl GalleryApplicationVersionList) IsEmpty() bool { 4732 return gavl.Value == nil || len(*gavl.Value) == 0 4733} 4734 4735// hasNextLink returns true if the NextLink is not empty. 4736func (gavl GalleryApplicationVersionList) hasNextLink() bool { 4737 return gavl.NextLink != nil && len(*gavl.NextLink) != 0 4738} 4739 4740// galleryApplicationVersionListPreparer prepares a request to retrieve the next set of results. 4741// It returns nil if no more results exist. 4742func (gavl GalleryApplicationVersionList) galleryApplicationVersionListPreparer(ctx context.Context) (*http.Request, error) { 4743 if !gavl.hasNextLink() { 4744 return nil, nil 4745 } 4746 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4747 autorest.AsJSON(), 4748 autorest.AsGet(), 4749 autorest.WithBaseURL(to.String(gavl.NextLink))) 4750} 4751 4752// GalleryApplicationVersionListPage contains a page of GalleryApplicationVersion values. 4753type GalleryApplicationVersionListPage struct { 4754 fn func(context.Context, GalleryApplicationVersionList) (GalleryApplicationVersionList, error) 4755 gavl GalleryApplicationVersionList 4756} 4757 4758// NextWithContext advances to the next page of values. If there was an error making 4759// the request the page does not advance and the error is returned. 4760func (page *GalleryApplicationVersionListPage) NextWithContext(ctx context.Context) (err error) { 4761 if tracing.IsEnabled() { 4762 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionListPage.NextWithContext") 4763 defer func() { 4764 sc := -1 4765 if page.Response().Response.Response != nil { 4766 sc = page.Response().Response.Response.StatusCode 4767 } 4768 tracing.EndSpan(ctx, sc, err) 4769 }() 4770 } 4771 for { 4772 next, err := page.fn(ctx, page.gavl) 4773 if err != nil { 4774 return err 4775 } 4776 page.gavl = next 4777 if !next.hasNextLink() || !next.IsEmpty() { 4778 break 4779 } 4780 } 4781 return nil 4782} 4783 4784// Next advances to the next page of values. If there was an error making 4785// the request the page does not advance and the error is returned. 4786// Deprecated: Use NextWithContext() instead. 4787func (page *GalleryApplicationVersionListPage) Next() error { 4788 return page.NextWithContext(context.Background()) 4789} 4790 4791// NotDone returns true if the page enumeration should be started or is not yet complete. 4792func (page GalleryApplicationVersionListPage) NotDone() bool { 4793 return !page.gavl.IsEmpty() 4794} 4795 4796// Response returns the raw server response from the last page request. 4797func (page GalleryApplicationVersionListPage) Response() GalleryApplicationVersionList { 4798 return page.gavl 4799} 4800 4801// Values returns the slice of values for the current page or nil if there are no values. 4802func (page GalleryApplicationVersionListPage) Values() []GalleryApplicationVersion { 4803 if page.gavl.IsEmpty() { 4804 return nil 4805 } 4806 return *page.gavl.Value 4807} 4808 4809// Creates a new instance of the GalleryApplicationVersionListPage type. 4810func NewGalleryApplicationVersionListPage(cur GalleryApplicationVersionList, getNextPage func(context.Context, GalleryApplicationVersionList) (GalleryApplicationVersionList, error)) GalleryApplicationVersionListPage { 4811 return GalleryApplicationVersionListPage{ 4812 fn: getNextPage, 4813 gavl: cur, 4814 } 4815} 4816 4817// GalleryApplicationVersionProperties describes the properties of a gallery Image Version. 4818type GalleryApplicationVersionProperties struct { 4819 PublishingProfile *GalleryApplicationVersionPublishingProfile `json:"publishingProfile,omitempty"` 4820 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningState1Creating', 'ProvisioningState1Updating', 'ProvisioningState1Failed', 'ProvisioningState1Succeeded', 'ProvisioningState1Deleting', 'ProvisioningState1Migrating' 4821 ProvisioningState ProvisioningState1 `json:"provisioningState,omitempty"` 4822 // ReplicationStatus - READ-ONLY 4823 ReplicationStatus *ReplicationStatus `json:"replicationStatus,omitempty"` 4824} 4825 4826// MarshalJSON is the custom marshaler for GalleryApplicationVersionProperties. 4827func (gavp GalleryApplicationVersionProperties) MarshalJSON() ([]byte, error) { 4828 objectMap := make(map[string]interface{}) 4829 if gavp.PublishingProfile != nil { 4830 objectMap["publishingProfile"] = gavp.PublishingProfile 4831 } 4832 return json.Marshal(objectMap) 4833} 4834 4835// GalleryApplicationVersionPublishingProfile the publishing profile of a gallery Image Version. 4836type GalleryApplicationVersionPublishingProfile struct { 4837 Source *UserArtifactSource `json:"source,omitempty"` 4838 // ContentType - Optional. May be used to help process this file. The type of file contained in the source, e.g. zip, json, etc. 4839 ContentType *string `json:"contentType,omitempty"` 4840 // EnableHealthCheck - Optional. Whether or not this application reports health. 4841 EnableHealthCheck *bool `json:"enableHealthCheck,omitempty"` 4842 // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. 4843 TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` 4844 // 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. 4845 ReplicaCount *int32 `json:"replicaCount,omitempty"` 4846 // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. 4847 ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` 4848 // PublishedDate - READ-ONLY; The timestamp for when the gallery Image Version is published. 4849 PublishedDate *date.Time `json:"publishedDate,omitempty"` 4850 // EndOfLifeDate - The end of life date of the gallery Image Version. This property can be used for decommissioning purposes. This property is updatable. 4851 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 4852 // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' 4853 StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` 4854} 4855 4856// MarshalJSON is the custom marshaler for GalleryApplicationVersionPublishingProfile. 4857func (gavpp GalleryApplicationVersionPublishingProfile) MarshalJSON() ([]byte, error) { 4858 objectMap := make(map[string]interface{}) 4859 if gavpp.Source != nil { 4860 objectMap["source"] = gavpp.Source 4861 } 4862 if gavpp.ContentType != nil { 4863 objectMap["contentType"] = gavpp.ContentType 4864 } 4865 if gavpp.EnableHealthCheck != nil { 4866 objectMap["enableHealthCheck"] = gavpp.EnableHealthCheck 4867 } 4868 if gavpp.TargetRegions != nil { 4869 objectMap["targetRegions"] = gavpp.TargetRegions 4870 } 4871 if gavpp.ReplicaCount != nil { 4872 objectMap["replicaCount"] = gavpp.ReplicaCount 4873 } 4874 if gavpp.ExcludeFromLatest != nil { 4875 objectMap["excludeFromLatest"] = gavpp.ExcludeFromLatest 4876 } 4877 if gavpp.EndOfLifeDate != nil { 4878 objectMap["endOfLifeDate"] = gavpp.EndOfLifeDate 4879 } 4880 if gavpp.StorageAccountType != "" { 4881 objectMap["storageAccountType"] = gavpp.StorageAccountType 4882 } 4883 return json.Marshal(objectMap) 4884} 4885 4886// GalleryApplicationVersionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results 4887// of a long-running operation. 4888type GalleryApplicationVersionsCreateOrUpdateFuture struct { 4889 azure.FutureAPI 4890 // Result returns the result of the asynchronous operation. 4891 // If the operation has not completed it will return an error. 4892 Result func(GalleryApplicationVersionsClient) (GalleryApplicationVersion, error) 4893} 4894 4895// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4896func (future *GalleryApplicationVersionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 4897 var azFuture azure.Future 4898 if err := json.Unmarshal(body, &azFuture); err != nil { 4899 return err 4900 } 4901 future.FutureAPI = &azFuture 4902 future.Result = future.result 4903 return nil 4904} 4905 4906// result is the default implementation for GalleryApplicationVersionsCreateOrUpdateFuture.Result. 4907func (future *GalleryApplicationVersionsCreateOrUpdateFuture) result(client GalleryApplicationVersionsClient) (gav GalleryApplicationVersion, err error) { 4908 var done bool 4909 done, err = future.DoneWithContext(context.Background(), client) 4910 if err != nil { 4911 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 4912 return 4913 } 4914 if !done { 4915 gav.Response.Response = future.Response() 4916 err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationVersionsCreateOrUpdateFuture") 4917 return 4918 } 4919 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4920 if gav.Response.Response, err = future.GetResult(sender); err == nil && gav.Response.Response.StatusCode != http.StatusNoContent { 4921 gav, err = client.CreateOrUpdateResponder(gav.Response.Response) 4922 if err != nil { 4923 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsCreateOrUpdateFuture", "Result", gav.Response.Response, "Failure responding to request") 4924 } 4925 } 4926 return 4927} 4928 4929// GalleryApplicationVersionsDeleteFuture an abstraction for monitoring and retrieving the results of a 4930// long-running operation. 4931type GalleryApplicationVersionsDeleteFuture struct { 4932 azure.FutureAPI 4933 // Result returns the result of the asynchronous operation. 4934 // If the operation has not completed it will return an error. 4935 Result func(GalleryApplicationVersionsClient) (autorest.Response, error) 4936} 4937 4938// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4939func (future *GalleryApplicationVersionsDeleteFuture) UnmarshalJSON(body []byte) error { 4940 var azFuture azure.Future 4941 if err := json.Unmarshal(body, &azFuture); err != nil { 4942 return err 4943 } 4944 future.FutureAPI = &azFuture 4945 future.Result = future.result 4946 return nil 4947} 4948 4949// result is the default implementation for GalleryApplicationVersionsDeleteFuture.Result. 4950func (future *GalleryApplicationVersionsDeleteFuture) result(client GalleryApplicationVersionsClient) (ar autorest.Response, err error) { 4951 var done bool 4952 done, err = future.DoneWithContext(context.Background(), client) 4953 if err != nil { 4954 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsDeleteFuture", "Result", future.Response(), "Polling failure") 4955 return 4956 } 4957 if !done { 4958 ar.Response = future.Response() 4959 err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationVersionsDeleteFuture") 4960 return 4961 } 4962 ar.Response = future.Response() 4963 return 4964} 4965 4966// GalleryApplicationVersionsUpdateFuture an abstraction for monitoring and retrieving the results of a 4967// long-running operation. 4968type GalleryApplicationVersionsUpdateFuture struct { 4969 azure.FutureAPI 4970 // Result returns the result of the asynchronous operation. 4971 // If the operation has not completed it will return an error. 4972 Result func(GalleryApplicationVersionsClient) (GalleryApplicationVersion, error) 4973} 4974 4975// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4976func (future *GalleryApplicationVersionsUpdateFuture) UnmarshalJSON(body []byte) error { 4977 var azFuture azure.Future 4978 if err := json.Unmarshal(body, &azFuture); err != nil { 4979 return err 4980 } 4981 future.FutureAPI = &azFuture 4982 future.Result = future.result 4983 return nil 4984} 4985 4986// result is the default implementation for GalleryApplicationVersionsUpdateFuture.Result. 4987func (future *GalleryApplicationVersionsUpdateFuture) result(client GalleryApplicationVersionsClient) (gav GalleryApplicationVersion, err error) { 4988 var done bool 4989 done, err = future.DoneWithContext(context.Background(), client) 4990 if err != nil { 4991 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsUpdateFuture", "Result", future.Response(), "Polling failure") 4992 return 4993 } 4994 if !done { 4995 gav.Response.Response = future.Response() 4996 err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationVersionsUpdateFuture") 4997 return 4998 } 4999 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5000 if gav.Response.Response, err = future.GetResult(sender); err == nil && gav.Response.Response.StatusCode != http.StatusNoContent { 5001 gav, err = client.UpdateResponder(gav.Response.Response) 5002 if err != nil { 5003 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsUpdateFuture", "Result", gav.Response.Response, "Failure responding to request") 5004 } 5005 } 5006 return 5007} 5008 5009// GalleryApplicationVersionUpdate specifies information about the gallery Application Version that you 5010// want to update. 5011type GalleryApplicationVersionUpdate struct { 5012 *GalleryApplicationVersionProperties `json:"properties,omitempty"` 5013 // ID - READ-ONLY; Resource Id 5014 ID *string `json:"id,omitempty"` 5015 // Name - READ-ONLY; Resource name 5016 Name *string `json:"name,omitempty"` 5017 // Type - READ-ONLY; Resource type 5018 Type *string `json:"type,omitempty"` 5019 // Tags - Resource tags 5020 Tags map[string]*string `json:"tags"` 5021} 5022 5023// MarshalJSON is the custom marshaler for GalleryApplicationVersionUpdate. 5024func (gavu GalleryApplicationVersionUpdate) MarshalJSON() ([]byte, error) { 5025 objectMap := make(map[string]interface{}) 5026 if gavu.GalleryApplicationVersionProperties != nil { 5027 objectMap["properties"] = gavu.GalleryApplicationVersionProperties 5028 } 5029 if gavu.Tags != nil { 5030 objectMap["tags"] = gavu.Tags 5031 } 5032 return json.Marshal(objectMap) 5033} 5034 5035// UnmarshalJSON is the custom unmarshaler for GalleryApplicationVersionUpdate struct. 5036func (gavu *GalleryApplicationVersionUpdate) UnmarshalJSON(body []byte) error { 5037 var m map[string]*json.RawMessage 5038 err := json.Unmarshal(body, &m) 5039 if err != nil { 5040 return err 5041 } 5042 for k, v := range m { 5043 switch k { 5044 case "properties": 5045 if v != nil { 5046 var galleryApplicationVersionProperties GalleryApplicationVersionProperties 5047 err = json.Unmarshal(*v, &galleryApplicationVersionProperties) 5048 if err != nil { 5049 return err 5050 } 5051 gavu.GalleryApplicationVersionProperties = &galleryApplicationVersionProperties 5052 } 5053 case "id": 5054 if v != nil { 5055 var ID string 5056 err = json.Unmarshal(*v, &ID) 5057 if err != nil { 5058 return err 5059 } 5060 gavu.ID = &ID 5061 } 5062 case "name": 5063 if v != nil { 5064 var name string 5065 err = json.Unmarshal(*v, &name) 5066 if err != nil { 5067 return err 5068 } 5069 gavu.Name = &name 5070 } 5071 case "type": 5072 if v != nil { 5073 var typeVar string 5074 err = json.Unmarshal(*v, &typeVar) 5075 if err != nil { 5076 return err 5077 } 5078 gavu.Type = &typeVar 5079 } 5080 case "tags": 5081 if v != nil { 5082 var tags map[string]*string 5083 err = json.Unmarshal(*v, &tags) 5084 if err != nil { 5085 return err 5086 } 5087 gavu.Tags = tags 5088 } 5089 } 5090 } 5091 5092 return nil 5093} 5094 5095// GalleryArtifactPublishingProfileBase describes the basic gallery artifact publishing profile. 5096type GalleryArtifactPublishingProfileBase struct { 5097 // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. 5098 TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` 5099 // 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. 5100 ReplicaCount *int32 `json:"replicaCount,omitempty"` 5101 // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. 5102 ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` 5103 // PublishedDate - READ-ONLY; The timestamp for when the gallery Image Version is published. 5104 PublishedDate *date.Time `json:"publishedDate,omitempty"` 5105 // EndOfLifeDate - The end of life date of the gallery Image Version. This property can be used for decommissioning purposes. This property is updatable. 5106 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 5107 // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' 5108 StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` 5109} 5110 5111// MarshalJSON is the custom marshaler for GalleryArtifactPublishingProfileBase. 5112func (gappb GalleryArtifactPublishingProfileBase) MarshalJSON() ([]byte, error) { 5113 objectMap := make(map[string]interface{}) 5114 if gappb.TargetRegions != nil { 5115 objectMap["targetRegions"] = gappb.TargetRegions 5116 } 5117 if gappb.ReplicaCount != nil { 5118 objectMap["replicaCount"] = gappb.ReplicaCount 5119 } 5120 if gappb.ExcludeFromLatest != nil { 5121 objectMap["excludeFromLatest"] = gappb.ExcludeFromLatest 5122 } 5123 if gappb.EndOfLifeDate != nil { 5124 objectMap["endOfLifeDate"] = gappb.EndOfLifeDate 5125 } 5126 if gappb.StorageAccountType != "" { 5127 objectMap["storageAccountType"] = gappb.StorageAccountType 5128 } 5129 return json.Marshal(objectMap) 5130} 5131 5132// GalleryArtifactSource the source image from which the Image Version is going to be created. 5133type GalleryArtifactSource struct { 5134 ManagedImage *ManagedArtifact `json:"managedImage,omitempty"` 5135} 5136 5137// GalleryArtifactVersionSource the gallery artifact version source. 5138type GalleryArtifactVersionSource struct { 5139 // ID - The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, or user image. 5140 ID *string `json:"id,omitempty"` 5141} 5142 5143// GalleryDataDiskImage this is the data disk image. 5144type GalleryDataDiskImage struct { 5145 // 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. 5146 Lun *int32 `json:"lun,omitempty"` 5147 // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. 5148 SizeInGB *int32 `json:"sizeInGB,omitempty"` 5149 // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' 5150 HostCaching HostCaching `json:"hostCaching,omitempty"` 5151 Source *GalleryArtifactVersionSource `json:"source,omitempty"` 5152} 5153 5154// MarshalJSON is the custom marshaler for GalleryDataDiskImage. 5155func (gddi GalleryDataDiskImage) MarshalJSON() ([]byte, error) { 5156 objectMap := make(map[string]interface{}) 5157 if gddi.Lun != nil { 5158 objectMap["lun"] = gddi.Lun 5159 } 5160 if gddi.HostCaching != "" { 5161 objectMap["hostCaching"] = gddi.HostCaching 5162 } 5163 if gddi.Source != nil { 5164 objectMap["source"] = gddi.Source 5165 } 5166 return json.Marshal(objectMap) 5167} 5168 5169// GalleryDiskImage this is the disk image base class. 5170type GalleryDiskImage struct { 5171 // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. 5172 SizeInGB *int32 `json:"sizeInGB,omitempty"` 5173 // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' 5174 HostCaching HostCaching `json:"hostCaching,omitempty"` 5175 Source *GalleryArtifactVersionSource `json:"source,omitempty"` 5176} 5177 5178// MarshalJSON is the custom marshaler for GalleryDiskImage. 5179func (gdi GalleryDiskImage) MarshalJSON() ([]byte, error) { 5180 objectMap := make(map[string]interface{}) 5181 if gdi.HostCaching != "" { 5182 objectMap["hostCaching"] = gdi.HostCaching 5183 } 5184 if gdi.Source != nil { 5185 objectMap["source"] = gdi.Source 5186 } 5187 return json.Marshal(objectMap) 5188} 5189 5190// GalleryIdentifier describes the gallery unique name. 5191type GalleryIdentifier struct { 5192 // UniqueName - READ-ONLY; The unique name of the Shared Image Gallery. This name is generated automatically by Azure. 5193 UniqueName *string `json:"uniqueName,omitempty"` 5194} 5195 5196// MarshalJSON is the custom marshaler for GalleryIdentifier. 5197func (gi GalleryIdentifier) MarshalJSON() ([]byte, error) { 5198 objectMap := make(map[string]interface{}) 5199 return json.Marshal(objectMap) 5200} 5201 5202// GalleryImage specifies information about the gallery Image Definition that you want to create or update. 5203type GalleryImage struct { 5204 autorest.Response `json:"-"` 5205 *GalleryImageProperties `json:"properties,omitempty"` 5206 // ID - READ-ONLY; Resource Id 5207 ID *string `json:"id,omitempty"` 5208 // Name - READ-ONLY; Resource name 5209 Name *string `json:"name,omitempty"` 5210 // Type - READ-ONLY; Resource type 5211 Type *string `json:"type,omitempty"` 5212 // Location - Resource location 5213 Location *string `json:"location,omitempty"` 5214 // Tags - Resource tags 5215 Tags map[string]*string `json:"tags"` 5216} 5217 5218// MarshalJSON is the custom marshaler for GalleryImage. 5219func (gi GalleryImage) MarshalJSON() ([]byte, error) { 5220 objectMap := make(map[string]interface{}) 5221 if gi.GalleryImageProperties != nil { 5222 objectMap["properties"] = gi.GalleryImageProperties 5223 } 5224 if gi.Location != nil { 5225 objectMap["location"] = gi.Location 5226 } 5227 if gi.Tags != nil { 5228 objectMap["tags"] = gi.Tags 5229 } 5230 return json.Marshal(objectMap) 5231} 5232 5233// UnmarshalJSON is the custom unmarshaler for GalleryImage struct. 5234func (gi *GalleryImage) UnmarshalJSON(body []byte) error { 5235 var m map[string]*json.RawMessage 5236 err := json.Unmarshal(body, &m) 5237 if err != nil { 5238 return err 5239 } 5240 for k, v := range m { 5241 switch k { 5242 case "properties": 5243 if v != nil { 5244 var galleryImageProperties GalleryImageProperties 5245 err = json.Unmarshal(*v, &galleryImageProperties) 5246 if err != nil { 5247 return err 5248 } 5249 gi.GalleryImageProperties = &galleryImageProperties 5250 } 5251 case "id": 5252 if v != nil { 5253 var ID string 5254 err = json.Unmarshal(*v, &ID) 5255 if err != nil { 5256 return err 5257 } 5258 gi.ID = &ID 5259 } 5260 case "name": 5261 if v != nil { 5262 var name string 5263 err = json.Unmarshal(*v, &name) 5264 if err != nil { 5265 return err 5266 } 5267 gi.Name = &name 5268 } 5269 case "type": 5270 if v != nil { 5271 var typeVar string 5272 err = json.Unmarshal(*v, &typeVar) 5273 if err != nil { 5274 return err 5275 } 5276 gi.Type = &typeVar 5277 } 5278 case "location": 5279 if v != nil { 5280 var location string 5281 err = json.Unmarshal(*v, &location) 5282 if err != nil { 5283 return err 5284 } 5285 gi.Location = &location 5286 } 5287 case "tags": 5288 if v != nil { 5289 var tags map[string]*string 5290 err = json.Unmarshal(*v, &tags) 5291 if err != nil { 5292 return err 5293 } 5294 gi.Tags = tags 5295 } 5296 } 5297 } 5298 5299 return nil 5300} 5301 5302// GalleryImageIdentifier this is the gallery Image Definition identifier. 5303type GalleryImageIdentifier struct { 5304 // Publisher - The name of the gallery Image Definition publisher. 5305 Publisher *string `json:"publisher,omitempty"` 5306 // Offer - The name of the gallery Image Definition offer. 5307 Offer *string `json:"offer,omitempty"` 5308 // Sku - The name of the gallery Image Definition SKU. 5309 Sku *string `json:"sku,omitempty"` 5310} 5311 5312// GalleryImageList the List Gallery Images operation response. 5313type GalleryImageList struct { 5314 autorest.Response `json:"-"` 5315 // Value - A list of Shared Image Gallery images. 5316 Value *[]GalleryImage `json:"value,omitempty"` 5317 // 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. 5318 NextLink *string `json:"nextLink,omitempty"` 5319} 5320 5321// GalleryImageListIterator provides access to a complete listing of GalleryImage values. 5322type GalleryImageListIterator struct { 5323 i int 5324 page GalleryImageListPage 5325} 5326 5327// NextWithContext advances to the next value. If there was an error making 5328// the request the iterator does not advance and the error is returned. 5329func (iter *GalleryImageListIterator) NextWithContext(ctx context.Context) (err error) { 5330 if tracing.IsEnabled() { 5331 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageListIterator.NextWithContext") 5332 defer func() { 5333 sc := -1 5334 if iter.Response().Response.Response != nil { 5335 sc = iter.Response().Response.Response.StatusCode 5336 } 5337 tracing.EndSpan(ctx, sc, err) 5338 }() 5339 } 5340 iter.i++ 5341 if iter.i < len(iter.page.Values()) { 5342 return nil 5343 } 5344 err = iter.page.NextWithContext(ctx) 5345 if err != nil { 5346 iter.i-- 5347 return err 5348 } 5349 iter.i = 0 5350 return nil 5351} 5352 5353// Next advances to the next value. If there was an error making 5354// the request the iterator does not advance and the error is returned. 5355// Deprecated: Use NextWithContext() instead. 5356func (iter *GalleryImageListIterator) Next() error { 5357 return iter.NextWithContext(context.Background()) 5358} 5359 5360// NotDone returns true if the enumeration should be started or is not yet complete. 5361func (iter GalleryImageListIterator) NotDone() bool { 5362 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5363} 5364 5365// Response returns the raw server response from the last page request. 5366func (iter GalleryImageListIterator) Response() GalleryImageList { 5367 return iter.page.Response() 5368} 5369 5370// Value returns the current value or a zero-initialized value if the 5371// iterator has advanced beyond the end of the collection. 5372func (iter GalleryImageListIterator) Value() GalleryImage { 5373 if !iter.page.NotDone() { 5374 return GalleryImage{} 5375 } 5376 return iter.page.Values()[iter.i] 5377} 5378 5379// Creates a new instance of the GalleryImageListIterator type. 5380func NewGalleryImageListIterator(page GalleryImageListPage) GalleryImageListIterator { 5381 return GalleryImageListIterator{page: page} 5382} 5383 5384// IsEmpty returns true if the ListResult contains no values. 5385func (gil GalleryImageList) IsEmpty() bool { 5386 return gil.Value == nil || len(*gil.Value) == 0 5387} 5388 5389// hasNextLink returns true if the NextLink is not empty. 5390func (gil GalleryImageList) hasNextLink() bool { 5391 return gil.NextLink != nil && len(*gil.NextLink) != 0 5392} 5393 5394// galleryImageListPreparer prepares a request to retrieve the next set of results. 5395// It returns nil if no more results exist. 5396func (gil GalleryImageList) galleryImageListPreparer(ctx context.Context) (*http.Request, error) { 5397 if !gil.hasNextLink() { 5398 return nil, nil 5399 } 5400 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5401 autorest.AsJSON(), 5402 autorest.AsGet(), 5403 autorest.WithBaseURL(to.String(gil.NextLink))) 5404} 5405 5406// GalleryImageListPage contains a page of GalleryImage values. 5407type GalleryImageListPage struct { 5408 fn func(context.Context, GalleryImageList) (GalleryImageList, error) 5409 gil GalleryImageList 5410} 5411 5412// NextWithContext advances to the next page of values. If there was an error making 5413// the request the page does not advance and the error is returned. 5414func (page *GalleryImageListPage) NextWithContext(ctx context.Context) (err error) { 5415 if tracing.IsEnabled() { 5416 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageListPage.NextWithContext") 5417 defer func() { 5418 sc := -1 5419 if page.Response().Response.Response != nil { 5420 sc = page.Response().Response.Response.StatusCode 5421 } 5422 tracing.EndSpan(ctx, sc, err) 5423 }() 5424 } 5425 for { 5426 next, err := page.fn(ctx, page.gil) 5427 if err != nil { 5428 return err 5429 } 5430 page.gil = next 5431 if !next.hasNextLink() || !next.IsEmpty() { 5432 break 5433 } 5434 } 5435 return nil 5436} 5437 5438// Next advances to the next page of values. If there was an error making 5439// the request the page does not advance and the error is returned. 5440// Deprecated: Use NextWithContext() instead. 5441func (page *GalleryImageListPage) Next() error { 5442 return page.NextWithContext(context.Background()) 5443} 5444 5445// NotDone returns true if the page enumeration should be started or is not yet complete. 5446func (page GalleryImageListPage) NotDone() bool { 5447 return !page.gil.IsEmpty() 5448} 5449 5450// Response returns the raw server response from the last page request. 5451func (page GalleryImageListPage) Response() GalleryImageList { 5452 return page.gil 5453} 5454 5455// Values returns the slice of values for the current page or nil if there are no values. 5456func (page GalleryImageListPage) Values() []GalleryImage { 5457 if page.gil.IsEmpty() { 5458 return nil 5459 } 5460 return *page.gil.Value 5461} 5462 5463// Creates a new instance of the GalleryImageListPage type. 5464func NewGalleryImageListPage(cur GalleryImageList, getNextPage func(context.Context, GalleryImageList) (GalleryImageList, error)) GalleryImageListPage { 5465 return GalleryImageListPage{ 5466 fn: getNextPage, 5467 gil: cur, 5468 } 5469} 5470 5471// GalleryImageProperties describes the properties of a gallery Image Definition. 5472type GalleryImageProperties struct { 5473 // Description - The description of this gallery Image Definition resource. This property is updatable. 5474 Description *string `json:"description,omitempty"` 5475 // Eula - The Eula agreement for the gallery Image Definition. 5476 Eula *string `json:"eula,omitempty"` 5477 // PrivacyStatementURI - The privacy statement uri. 5478 PrivacyStatementURI *string `json:"privacyStatementUri,omitempty"` 5479 // ReleaseNoteURI - The release note uri. 5480 ReleaseNoteURI *string `json:"releaseNoteUri,omitempty"` 5481 // 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: 'Windows', 'Linux' 5482 OsType OperatingSystemTypes `json:"osType,omitempty"` 5483 // OsState - This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'. Possible values include: 'Generalized', 'Specialized' 5484 OsState OperatingSystemStateTypes `json:"osState,omitempty"` 5485 // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'V1', 'V2' 5486 HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` 5487 // EndOfLifeDate - The end of life date of the gallery Image Definition. This property can be used for decommissioning purposes. This property is updatable. 5488 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 5489 Identifier *GalleryImageIdentifier `json:"identifier,omitempty"` 5490 Recommended *RecommendedMachineConfiguration `json:"recommended,omitempty"` 5491 Disallowed *Disallowed `json:"disallowed,omitempty"` 5492 PurchasePlan *ImagePurchasePlan `json:"purchasePlan,omitempty"` 5493 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningState2Creating', 'ProvisioningState2Updating', 'ProvisioningState2Failed', 'ProvisioningState2Succeeded', 'ProvisioningState2Deleting', 'ProvisioningState2Migrating' 5494 ProvisioningState ProvisioningState2 `json:"provisioningState,omitempty"` 5495} 5496 5497// MarshalJSON is the custom marshaler for GalleryImageProperties. 5498func (gip GalleryImageProperties) MarshalJSON() ([]byte, error) { 5499 objectMap := make(map[string]interface{}) 5500 if gip.Description != nil { 5501 objectMap["description"] = gip.Description 5502 } 5503 if gip.Eula != nil { 5504 objectMap["eula"] = gip.Eula 5505 } 5506 if gip.PrivacyStatementURI != nil { 5507 objectMap["privacyStatementUri"] = gip.PrivacyStatementURI 5508 } 5509 if gip.ReleaseNoteURI != nil { 5510 objectMap["releaseNoteUri"] = gip.ReleaseNoteURI 5511 } 5512 if gip.OsType != "" { 5513 objectMap["osType"] = gip.OsType 5514 } 5515 if gip.OsState != "" { 5516 objectMap["osState"] = gip.OsState 5517 } 5518 if gip.HyperVGeneration != "" { 5519 objectMap["hyperVGeneration"] = gip.HyperVGeneration 5520 } 5521 if gip.EndOfLifeDate != nil { 5522 objectMap["endOfLifeDate"] = gip.EndOfLifeDate 5523 } 5524 if gip.Identifier != nil { 5525 objectMap["identifier"] = gip.Identifier 5526 } 5527 if gip.Recommended != nil { 5528 objectMap["recommended"] = gip.Recommended 5529 } 5530 if gip.Disallowed != nil { 5531 objectMap["disallowed"] = gip.Disallowed 5532 } 5533 if gip.PurchasePlan != nil { 5534 objectMap["purchasePlan"] = gip.PurchasePlan 5535 } 5536 return json.Marshal(objectMap) 5537} 5538 5539// GalleryImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 5540// long-running operation. 5541type GalleryImagesCreateOrUpdateFuture struct { 5542 azure.FutureAPI 5543 // Result returns the result of the asynchronous operation. 5544 // If the operation has not completed it will return an error. 5545 Result func(GalleryImagesClient) (GalleryImage, error) 5546} 5547 5548// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5549func (future *GalleryImagesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 5550 var azFuture azure.Future 5551 if err := json.Unmarshal(body, &azFuture); err != nil { 5552 return err 5553 } 5554 future.FutureAPI = &azFuture 5555 future.Result = future.result 5556 return nil 5557} 5558 5559// result is the default implementation for GalleryImagesCreateOrUpdateFuture.Result. 5560func (future *GalleryImagesCreateOrUpdateFuture) result(client GalleryImagesClient) (gi GalleryImage, err error) { 5561 var done bool 5562 done, err = future.DoneWithContext(context.Background(), client) 5563 if err != nil { 5564 err = autorest.NewErrorWithError(err, "compute.GalleryImagesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 5565 return 5566 } 5567 if !done { 5568 gi.Response.Response = future.Response() 5569 err = azure.NewAsyncOpIncompleteError("compute.GalleryImagesCreateOrUpdateFuture") 5570 return 5571 } 5572 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5573 if gi.Response.Response, err = future.GetResult(sender); err == nil && gi.Response.Response.StatusCode != http.StatusNoContent { 5574 gi, err = client.CreateOrUpdateResponder(gi.Response.Response) 5575 if err != nil { 5576 err = autorest.NewErrorWithError(err, "compute.GalleryImagesCreateOrUpdateFuture", "Result", gi.Response.Response, "Failure responding to request") 5577 } 5578 } 5579 return 5580} 5581 5582// GalleryImagesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 5583// operation. 5584type GalleryImagesDeleteFuture struct { 5585 azure.FutureAPI 5586 // Result returns the result of the asynchronous operation. 5587 // If the operation has not completed it will return an error. 5588 Result func(GalleryImagesClient) (autorest.Response, error) 5589} 5590 5591// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5592func (future *GalleryImagesDeleteFuture) UnmarshalJSON(body []byte) error { 5593 var azFuture azure.Future 5594 if err := json.Unmarshal(body, &azFuture); err != nil { 5595 return err 5596 } 5597 future.FutureAPI = &azFuture 5598 future.Result = future.result 5599 return nil 5600} 5601 5602// result is the default implementation for GalleryImagesDeleteFuture.Result. 5603func (future *GalleryImagesDeleteFuture) result(client GalleryImagesClient) (ar autorest.Response, err error) { 5604 var done bool 5605 done, err = future.DoneWithContext(context.Background(), client) 5606 if err != nil { 5607 err = autorest.NewErrorWithError(err, "compute.GalleryImagesDeleteFuture", "Result", future.Response(), "Polling failure") 5608 return 5609 } 5610 if !done { 5611 ar.Response = future.Response() 5612 err = azure.NewAsyncOpIncompleteError("compute.GalleryImagesDeleteFuture") 5613 return 5614 } 5615 ar.Response = future.Response() 5616 return 5617} 5618 5619// GalleryImagesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 5620// operation. 5621type GalleryImagesUpdateFuture struct { 5622 azure.FutureAPI 5623 // Result returns the result of the asynchronous operation. 5624 // If the operation has not completed it will return an error. 5625 Result func(GalleryImagesClient) (GalleryImage, error) 5626} 5627 5628// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5629func (future *GalleryImagesUpdateFuture) UnmarshalJSON(body []byte) error { 5630 var azFuture azure.Future 5631 if err := json.Unmarshal(body, &azFuture); err != nil { 5632 return err 5633 } 5634 future.FutureAPI = &azFuture 5635 future.Result = future.result 5636 return nil 5637} 5638 5639// result is the default implementation for GalleryImagesUpdateFuture.Result. 5640func (future *GalleryImagesUpdateFuture) result(client GalleryImagesClient) (gi GalleryImage, err error) { 5641 var done bool 5642 done, err = future.DoneWithContext(context.Background(), client) 5643 if err != nil { 5644 err = autorest.NewErrorWithError(err, "compute.GalleryImagesUpdateFuture", "Result", future.Response(), "Polling failure") 5645 return 5646 } 5647 if !done { 5648 gi.Response.Response = future.Response() 5649 err = azure.NewAsyncOpIncompleteError("compute.GalleryImagesUpdateFuture") 5650 return 5651 } 5652 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5653 if gi.Response.Response, err = future.GetResult(sender); err == nil && gi.Response.Response.StatusCode != http.StatusNoContent { 5654 gi, err = client.UpdateResponder(gi.Response.Response) 5655 if err != nil { 5656 err = autorest.NewErrorWithError(err, "compute.GalleryImagesUpdateFuture", "Result", gi.Response.Response, "Failure responding to request") 5657 } 5658 } 5659 return 5660} 5661 5662// GalleryImageUpdate specifies information about the gallery Image Definition that you want to update. 5663type GalleryImageUpdate struct { 5664 *GalleryImageProperties `json:"properties,omitempty"` 5665 // ID - READ-ONLY; Resource Id 5666 ID *string `json:"id,omitempty"` 5667 // Name - READ-ONLY; Resource name 5668 Name *string `json:"name,omitempty"` 5669 // Type - READ-ONLY; Resource type 5670 Type *string `json:"type,omitempty"` 5671 // Tags - Resource tags 5672 Tags map[string]*string `json:"tags"` 5673} 5674 5675// MarshalJSON is the custom marshaler for GalleryImageUpdate. 5676func (giu GalleryImageUpdate) MarshalJSON() ([]byte, error) { 5677 objectMap := make(map[string]interface{}) 5678 if giu.GalleryImageProperties != nil { 5679 objectMap["properties"] = giu.GalleryImageProperties 5680 } 5681 if giu.Tags != nil { 5682 objectMap["tags"] = giu.Tags 5683 } 5684 return json.Marshal(objectMap) 5685} 5686 5687// UnmarshalJSON is the custom unmarshaler for GalleryImageUpdate struct. 5688func (giu *GalleryImageUpdate) UnmarshalJSON(body []byte) error { 5689 var m map[string]*json.RawMessage 5690 err := json.Unmarshal(body, &m) 5691 if err != nil { 5692 return err 5693 } 5694 for k, v := range m { 5695 switch k { 5696 case "properties": 5697 if v != nil { 5698 var galleryImageProperties GalleryImageProperties 5699 err = json.Unmarshal(*v, &galleryImageProperties) 5700 if err != nil { 5701 return err 5702 } 5703 giu.GalleryImageProperties = &galleryImageProperties 5704 } 5705 case "id": 5706 if v != nil { 5707 var ID string 5708 err = json.Unmarshal(*v, &ID) 5709 if err != nil { 5710 return err 5711 } 5712 giu.ID = &ID 5713 } 5714 case "name": 5715 if v != nil { 5716 var name string 5717 err = json.Unmarshal(*v, &name) 5718 if err != nil { 5719 return err 5720 } 5721 giu.Name = &name 5722 } 5723 case "type": 5724 if v != nil { 5725 var typeVar string 5726 err = json.Unmarshal(*v, &typeVar) 5727 if err != nil { 5728 return err 5729 } 5730 giu.Type = &typeVar 5731 } 5732 case "tags": 5733 if v != nil { 5734 var tags map[string]*string 5735 err = json.Unmarshal(*v, &tags) 5736 if err != nil { 5737 return err 5738 } 5739 giu.Tags = tags 5740 } 5741 } 5742 } 5743 5744 return nil 5745} 5746 5747// GalleryImageVersion specifies information about the gallery Image Version that you want to create or 5748// update. 5749type GalleryImageVersion struct { 5750 autorest.Response `json:"-"` 5751 *GalleryImageVersionProperties `json:"properties,omitempty"` 5752 // ID - READ-ONLY; Resource Id 5753 ID *string `json:"id,omitempty"` 5754 // Name - READ-ONLY; Resource name 5755 Name *string `json:"name,omitempty"` 5756 // Type - READ-ONLY; Resource type 5757 Type *string `json:"type,omitempty"` 5758 // Location - Resource location 5759 Location *string `json:"location,omitempty"` 5760 // Tags - Resource tags 5761 Tags map[string]*string `json:"tags"` 5762} 5763 5764// MarshalJSON is the custom marshaler for GalleryImageVersion. 5765func (giv GalleryImageVersion) MarshalJSON() ([]byte, error) { 5766 objectMap := make(map[string]interface{}) 5767 if giv.GalleryImageVersionProperties != nil { 5768 objectMap["properties"] = giv.GalleryImageVersionProperties 5769 } 5770 if giv.Location != nil { 5771 objectMap["location"] = giv.Location 5772 } 5773 if giv.Tags != nil { 5774 objectMap["tags"] = giv.Tags 5775 } 5776 return json.Marshal(objectMap) 5777} 5778 5779// UnmarshalJSON is the custom unmarshaler for GalleryImageVersion struct. 5780func (giv *GalleryImageVersion) UnmarshalJSON(body []byte) error { 5781 var m map[string]*json.RawMessage 5782 err := json.Unmarshal(body, &m) 5783 if err != nil { 5784 return err 5785 } 5786 for k, v := range m { 5787 switch k { 5788 case "properties": 5789 if v != nil { 5790 var galleryImageVersionProperties GalleryImageVersionProperties 5791 err = json.Unmarshal(*v, &galleryImageVersionProperties) 5792 if err != nil { 5793 return err 5794 } 5795 giv.GalleryImageVersionProperties = &galleryImageVersionProperties 5796 } 5797 case "id": 5798 if v != nil { 5799 var ID string 5800 err = json.Unmarshal(*v, &ID) 5801 if err != nil { 5802 return err 5803 } 5804 giv.ID = &ID 5805 } 5806 case "name": 5807 if v != nil { 5808 var name string 5809 err = json.Unmarshal(*v, &name) 5810 if err != nil { 5811 return err 5812 } 5813 giv.Name = &name 5814 } 5815 case "type": 5816 if v != nil { 5817 var typeVar string 5818 err = json.Unmarshal(*v, &typeVar) 5819 if err != nil { 5820 return err 5821 } 5822 giv.Type = &typeVar 5823 } 5824 case "location": 5825 if v != nil { 5826 var location string 5827 err = json.Unmarshal(*v, &location) 5828 if err != nil { 5829 return err 5830 } 5831 giv.Location = &location 5832 } 5833 case "tags": 5834 if v != nil { 5835 var tags map[string]*string 5836 err = json.Unmarshal(*v, &tags) 5837 if err != nil { 5838 return err 5839 } 5840 giv.Tags = tags 5841 } 5842 } 5843 } 5844 5845 return nil 5846} 5847 5848// GalleryImageVersionList the List Gallery Image version operation response. 5849type GalleryImageVersionList struct { 5850 autorest.Response `json:"-"` 5851 // Value - A list of gallery Image Versions. 5852 Value *[]GalleryImageVersion `json:"value,omitempty"` 5853 // 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. 5854 NextLink *string `json:"nextLink,omitempty"` 5855} 5856 5857// GalleryImageVersionListIterator provides access to a complete listing of GalleryImageVersion values. 5858type GalleryImageVersionListIterator struct { 5859 i int 5860 page GalleryImageVersionListPage 5861} 5862 5863// NextWithContext advances to the next value. If there was an error making 5864// the request the iterator does not advance and the error is returned. 5865func (iter *GalleryImageVersionListIterator) NextWithContext(ctx context.Context) (err error) { 5866 if tracing.IsEnabled() { 5867 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionListIterator.NextWithContext") 5868 defer func() { 5869 sc := -1 5870 if iter.Response().Response.Response != nil { 5871 sc = iter.Response().Response.Response.StatusCode 5872 } 5873 tracing.EndSpan(ctx, sc, err) 5874 }() 5875 } 5876 iter.i++ 5877 if iter.i < len(iter.page.Values()) { 5878 return nil 5879 } 5880 err = iter.page.NextWithContext(ctx) 5881 if err != nil { 5882 iter.i-- 5883 return err 5884 } 5885 iter.i = 0 5886 return nil 5887} 5888 5889// Next advances to the next value. If there was an error making 5890// the request the iterator does not advance and the error is returned. 5891// Deprecated: Use NextWithContext() instead. 5892func (iter *GalleryImageVersionListIterator) Next() error { 5893 return iter.NextWithContext(context.Background()) 5894} 5895 5896// NotDone returns true if the enumeration should be started or is not yet complete. 5897func (iter GalleryImageVersionListIterator) NotDone() bool { 5898 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5899} 5900 5901// Response returns the raw server response from the last page request. 5902func (iter GalleryImageVersionListIterator) Response() GalleryImageVersionList { 5903 return iter.page.Response() 5904} 5905 5906// Value returns the current value or a zero-initialized value if the 5907// iterator has advanced beyond the end of the collection. 5908func (iter GalleryImageVersionListIterator) Value() GalleryImageVersion { 5909 if !iter.page.NotDone() { 5910 return GalleryImageVersion{} 5911 } 5912 return iter.page.Values()[iter.i] 5913} 5914 5915// Creates a new instance of the GalleryImageVersionListIterator type. 5916func NewGalleryImageVersionListIterator(page GalleryImageVersionListPage) GalleryImageVersionListIterator { 5917 return GalleryImageVersionListIterator{page: page} 5918} 5919 5920// IsEmpty returns true if the ListResult contains no values. 5921func (givl GalleryImageVersionList) IsEmpty() bool { 5922 return givl.Value == nil || len(*givl.Value) == 0 5923} 5924 5925// hasNextLink returns true if the NextLink is not empty. 5926func (givl GalleryImageVersionList) hasNextLink() bool { 5927 return givl.NextLink != nil && len(*givl.NextLink) != 0 5928} 5929 5930// galleryImageVersionListPreparer prepares a request to retrieve the next set of results. 5931// It returns nil if no more results exist. 5932func (givl GalleryImageVersionList) galleryImageVersionListPreparer(ctx context.Context) (*http.Request, error) { 5933 if !givl.hasNextLink() { 5934 return nil, nil 5935 } 5936 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5937 autorest.AsJSON(), 5938 autorest.AsGet(), 5939 autorest.WithBaseURL(to.String(givl.NextLink))) 5940} 5941 5942// GalleryImageVersionListPage contains a page of GalleryImageVersion values. 5943type GalleryImageVersionListPage struct { 5944 fn func(context.Context, GalleryImageVersionList) (GalleryImageVersionList, error) 5945 givl GalleryImageVersionList 5946} 5947 5948// NextWithContext advances to the next page of values. If there was an error making 5949// the request the page does not advance and the error is returned. 5950func (page *GalleryImageVersionListPage) NextWithContext(ctx context.Context) (err error) { 5951 if tracing.IsEnabled() { 5952 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionListPage.NextWithContext") 5953 defer func() { 5954 sc := -1 5955 if page.Response().Response.Response != nil { 5956 sc = page.Response().Response.Response.StatusCode 5957 } 5958 tracing.EndSpan(ctx, sc, err) 5959 }() 5960 } 5961 for { 5962 next, err := page.fn(ctx, page.givl) 5963 if err != nil { 5964 return err 5965 } 5966 page.givl = next 5967 if !next.hasNextLink() || !next.IsEmpty() { 5968 break 5969 } 5970 } 5971 return nil 5972} 5973 5974// Next advances to the next page of values. If there was an error making 5975// the request the page does not advance and the error is returned. 5976// Deprecated: Use NextWithContext() instead. 5977func (page *GalleryImageVersionListPage) Next() error { 5978 return page.NextWithContext(context.Background()) 5979} 5980 5981// NotDone returns true if the page enumeration should be started or is not yet complete. 5982func (page GalleryImageVersionListPage) NotDone() bool { 5983 return !page.givl.IsEmpty() 5984} 5985 5986// Response returns the raw server response from the last page request. 5987func (page GalleryImageVersionListPage) Response() GalleryImageVersionList { 5988 return page.givl 5989} 5990 5991// Values returns the slice of values for the current page or nil if there are no values. 5992func (page GalleryImageVersionListPage) Values() []GalleryImageVersion { 5993 if page.givl.IsEmpty() { 5994 return nil 5995 } 5996 return *page.givl.Value 5997} 5998 5999// Creates a new instance of the GalleryImageVersionListPage type. 6000func NewGalleryImageVersionListPage(cur GalleryImageVersionList, getNextPage func(context.Context, GalleryImageVersionList) (GalleryImageVersionList, error)) GalleryImageVersionListPage { 6001 return GalleryImageVersionListPage{ 6002 fn: getNextPage, 6003 givl: cur, 6004 } 6005} 6006 6007// GalleryImageVersionProperties describes the properties of a gallery Image Version. 6008type GalleryImageVersionProperties struct { 6009 PublishingProfile *GalleryImageVersionPublishingProfile `json:"publishingProfile,omitempty"` 6010 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningState3Creating', 'ProvisioningState3Updating', 'ProvisioningState3Failed', 'ProvisioningState3Succeeded', 'ProvisioningState3Deleting', 'ProvisioningState3Migrating' 6011 ProvisioningState ProvisioningState3 `json:"provisioningState,omitempty"` 6012 StorageProfile *GalleryImageVersionStorageProfile `json:"storageProfile,omitempty"` 6013 // ReplicationStatus - READ-ONLY 6014 ReplicationStatus *ReplicationStatus `json:"replicationStatus,omitempty"` 6015} 6016 6017// MarshalJSON is the custom marshaler for GalleryImageVersionProperties. 6018func (givp GalleryImageVersionProperties) MarshalJSON() ([]byte, error) { 6019 objectMap := make(map[string]interface{}) 6020 if givp.PublishingProfile != nil { 6021 objectMap["publishingProfile"] = givp.PublishingProfile 6022 } 6023 if givp.StorageProfile != nil { 6024 objectMap["storageProfile"] = givp.StorageProfile 6025 } 6026 return json.Marshal(objectMap) 6027} 6028 6029// GalleryImageVersionPublishingProfile the publishing profile of a gallery Image Version. 6030type GalleryImageVersionPublishingProfile struct { 6031 // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. 6032 TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` 6033 // 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. 6034 ReplicaCount *int32 `json:"replicaCount,omitempty"` 6035 // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. 6036 ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` 6037 // PublishedDate - READ-ONLY; The timestamp for when the gallery Image Version is published. 6038 PublishedDate *date.Time `json:"publishedDate,omitempty"` 6039 // EndOfLifeDate - The end of life date of the gallery Image Version. This property can be used for decommissioning purposes. This property is updatable. 6040 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 6041 // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' 6042 StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` 6043} 6044 6045// MarshalJSON is the custom marshaler for GalleryImageVersionPublishingProfile. 6046func (givpp GalleryImageVersionPublishingProfile) MarshalJSON() ([]byte, error) { 6047 objectMap := make(map[string]interface{}) 6048 if givpp.TargetRegions != nil { 6049 objectMap["targetRegions"] = givpp.TargetRegions 6050 } 6051 if givpp.ReplicaCount != nil { 6052 objectMap["replicaCount"] = givpp.ReplicaCount 6053 } 6054 if givpp.ExcludeFromLatest != nil { 6055 objectMap["excludeFromLatest"] = givpp.ExcludeFromLatest 6056 } 6057 if givpp.EndOfLifeDate != nil { 6058 objectMap["endOfLifeDate"] = givpp.EndOfLifeDate 6059 } 6060 if givpp.StorageAccountType != "" { 6061 objectMap["storageAccountType"] = givpp.StorageAccountType 6062 } 6063 return json.Marshal(objectMap) 6064} 6065 6066// GalleryImageVersionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 6067// long-running operation. 6068type GalleryImageVersionsCreateOrUpdateFuture struct { 6069 azure.FutureAPI 6070 // Result returns the result of the asynchronous operation. 6071 // If the operation has not completed it will return an error. 6072 Result func(GalleryImageVersionsClient) (GalleryImageVersion, error) 6073} 6074 6075// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6076func (future *GalleryImageVersionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 6077 var azFuture azure.Future 6078 if err := json.Unmarshal(body, &azFuture); err != nil { 6079 return err 6080 } 6081 future.FutureAPI = &azFuture 6082 future.Result = future.result 6083 return nil 6084} 6085 6086// result is the default implementation for GalleryImageVersionsCreateOrUpdateFuture.Result. 6087func (future *GalleryImageVersionsCreateOrUpdateFuture) result(client GalleryImageVersionsClient) (giv GalleryImageVersion, err error) { 6088 var done bool 6089 done, err = future.DoneWithContext(context.Background(), client) 6090 if err != nil { 6091 err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 6092 return 6093 } 6094 if !done { 6095 giv.Response.Response = future.Response() 6096 err = azure.NewAsyncOpIncompleteError("compute.GalleryImageVersionsCreateOrUpdateFuture") 6097 return 6098 } 6099 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6100 if giv.Response.Response, err = future.GetResult(sender); err == nil && giv.Response.Response.StatusCode != http.StatusNoContent { 6101 giv, err = client.CreateOrUpdateResponder(giv.Response.Response) 6102 if err != nil { 6103 err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsCreateOrUpdateFuture", "Result", giv.Response.Response, "Failure responding to request") 6104 } 6105 } 6106 return 6107} 6108 6109// GalleryImageVersionsDeleteFuture an abstraction for monitoring and retrieving the results of a 6110// long-running operation. 6111type GalleryImageVersionsDeleteFuture struct { 6112 azure.FutureAPI 6113 // Result returns the result of the asynchronous operation. 6114 // If the operation has not completed it will return an error. 6115 Result func(GalleryImageVersionsClient) (autorest.Response, error) 6116} 6117 6118// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6119func (future *GalleryImageVersionsDeleteFuture) UnmarshalJSON(body []byte) error { 6120 var azFuture azure.Future 6121 if err := json.Unmarshal(body, &azFuture); err != nil { 6122 return err 6123 } 6124 future.FutureAPI = &azFuture 6125 future.Result = future.result 6126 return nil 6127} 6128 6129// result is the default implementation for GalleryImageVersionsDeleteFuture.Result. 6130func (future *GalleryImageVersionsDeleteFuture) result(client GalleryImageVersionsClient) (ar autorest.Response, err error) { 6131 var done bool 6132 done, err = future.DoneWithContext(context.Background(), client) 6133 if err != nil { 6134 err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsDeleteFuture", "Result", future.Response(), "Polling failure") 6135 return 6136 } 6137 if !done { 6138 ar.Response = future.Response() 6139 err = azure.NewAsyncOpIncompleteError("compute.GalleryImageVersionsDeleteFuture") 6140 return 6141 } 6142 ar.Response = future.Response() 6143 return 6144} 6145 6146// GalleryImageVersionStorageProfile this is the storage profile of a Gallery Image Version. 6147type GalleryImageVersionStorageProfile struct { 6148 Source *GalleryArtifactVersionSource `json:"source,omitempty"` 6149 OsDiskImage *GalleryOSDiskImage `json:"osDiskImage,omitempty"` 6150 // DataDiskImages - A list of data disk images. 6151 DataDiskImages *[]GalleryDataDiskImage `json:"dataDiskImages,omitempty"` 6152} 6153 6154// GalleryImageVersionsUpdateFuture an abstraction for monitoring and retrieving the results of a 6155// long-running operation. 6156type GalleryImageVersionsUpdateFuture struct { 6157 azure.FutureAPI 6158 // Result returns the result of the asynchronous operation. 6159 // If the operation has not completed it will return an error. 6160 Result func(GalleryImageVersionsClient) (GalleryImageVersion, error) 6161} 6162 6163// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6164func (future *GalleryImageVersionsUpdateFuture) UnmarshalJSON(body []byte) error { 6165 var azFuture azure.Future 6166 if err := json.Unmarshal(body, &azFuture); err != nil { 6167 return err 6168 } 6169 future.FutureAPI = &azFuture 6170 future.Result = future.result 6171 return nil 6172} 6173 6174// result is the default implementation for GalleryImageVersionsUpdateFuture.Result. 6175func (future *GalleryImageVersionsUpdateFuture) result(client GalleryImageVersionsClient) (giv GalleryImageVersion, err error) { 6176 var done bool 6177 done, err = future.DoneWithContext(context.Background(), client) 6178 if err != nil { 6179 err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsUpdateFuture", "Result", future.Response(), "Polling failure") 6180 return 6181 } 6182 if !done { 6183 giv.Response.Response = future.Response() 6184 err = azure.NewAsyncOpIncompleteError("compute.GalleryImageVersionsUpdateFuture") 6185 return 6186 } 6187 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6188 if giv.Response.Response, err = future.GetResult(sender); err == nil && giv.Response.Response.StatusCode != http.StatusNoContent { 6189 giv, err = client.UpdateResponder(giv.Response.Response) 6190 if err != nil { 6191 err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsUpdateFuture", "Result", giv.Response.Response, "Failure responding to request") 6192 } 6193 } 6194 return 6195} 6196 6197// GalleryImageVersionUpdate specifies information about the gallery Image Version that you want to update. 6198type GalleryImageVersionUpdate struct { 6199 *GalleryImageVersionProperties `json:"properties,omitempty"` 6200 // ID - READ-ONLY; Resource Id 6201 ID *string `json:"id,omitempty"` 6202 // Name - READ-ONLY; Resource name 6203 Name *string `json:"name,omitempty"` 6204 // Type - READ-ONLY; Resource type 6205 Type *string `json:"type,omitempty"` 6206 // Tags - Resource tags 6207 Tags map[string]*string `json:"tags"` 6208} 6209 6210// MarshalJSON is the custom marshaler for GalleryImageVersionUpdate. 6211func (givu GalleryImageVersionUpdate) MarshalJSON() ([]byte, error) { 6212 objectMap := make(map[string]interface{}) 6213 if givu.GalleryImageVersionProperties != nil { 6214 objectMap["properties"] = givu.GalleryImageVersionProperties 6215 } 6216 if givu.Tags != nil { 6217 objectMap["tags"] = givu.Tags 6218 } 6219 return json.Marshal(objectMap) 6220} 6221 6222// UnmarshalJSON is the custom unmarshaler for GalleryImageVersionUpdate struct. 6223func (givu *GalleryImageVersionUpdate) UnmarshalJSON(body []byte) error { 6224 var m map[string]*json.RawMessage 6225 err := json.Unmarshal(body, &m) 6226 if err != nil { 6227 return err 6228 } 6229 for k, v := range m { 6230 switch k { 6231 case "properties": 6232 if v != nil { 6233 var galleryImageVersionProperties GalleryImageVersionProperties 6234 err = json.Unmarshal(*v, &galleryImageVersionProperties) 6235 if err != nil { 6236 return err 6237 } 6238 givu.GalleryImageVersionProperties = &galleryImageVersionProperties 6239 } 6240 case "id": 6241 if v != nil { 6242 var ID string 6243 err = json.Unmarshal(*v, &ID) 6244 if err != nil { 6245 return err 6246 } 6247 givu.ID = &ID 6248 } 6249 case "name": 6250 if v != nil { 6251 var name string 6252 err = json.Unmarshal(*v, &name) 6253 if err != nil { 6254 return err 6255 } 6256 givu.Name = &name 6257 } 6258 case "type": 6259 if v != nil { 6260 var typeVar string 6261 err = json.Unmarshal(*v, &typeVar) 6262 if err != nil { 6263 return err 6264 } 6265 givu.Type = &typeVar 6266 } 6267 case "tags": 6268 if v != nil { 6269 var tags map[string]*string 6270 err = json.Unmarshal(*v, &tags) 6271 if err != nil { 6272 return err 6273 } 6274 givu.Tags = tags 6275 } 6276 } 6277 } 6278 6279 return nil 6280} 6281 6282// GalleryList the List Galleries operation response. 6283type GalleryList struct { 6284 autorest.Response `json:"-"` 6285 // Value - A list of galleries. 6286 Value *[]Gallery `json:"value,omitempty"` 6287 // NextLink - The uri to fetch the next page of galleries. Call ListNext() with this to fetch the next page of galleries. 6288 NextLink *string `json:"nextLink,omitempty"` 6289} 6290 6291// GalleryListIterator provides access to a complete listing of Gallery values. 6292type GalleryListIterator struct { 6293 i int 6294 page GalleryListPage 6295} 6296 6297// NextWithContext advances to the next value. If there was an error making 6298// the request the iterator does not advance and the error is returned. 6299func (iter *GalleryListIterator) NextWithContext(ctx context.Context) (err error) { 6300 if tracing.IsEnabled() { 6301 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryListIterator.NextWithContext") 6302 defer func() { 6303 sc := -1 6304 if iter.Response().Response.Response != nil { 6305 sc = iter.Response().Response.Response.StatusCode 6306 } 6307 tracing.EndSpan(ctx, sc, err) 6308 }() 6309 } 6310 iter.i++ 6311 if iter.i < len(iter.page.Values()) { 6312 return nil 6313 } 6314 err = iter.page.NextWithContext(ctx) 6315 if err != nil { 6316 iter.i-- 6317 return err 6318 } 6319 iter.i = 0 6320 return nil 6321} 6322 6323// Next advances to the next value. If there was an error making 6324// the request the iterator does not advance and the error is returned. 6325// Deprecated: Use NextWithContext() instead. 6326func (iter *GalleryListIterator) Next() error { 6327 return iter.NextWithContext(context.Background()) 6328} 6329 6330// NotDone returns true if the enumeration should be started or is not yet complete. 6331func (iter GalleryListIterator) NotDone() bool { 6332 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6333} 6334 6335// Response returns the raw server response from the last page request. 6336func (iter GalleryListIterator) Response() GalleryList { 6337 return iter.page.Response() 6338} 6339 6340// Value returns the current value or a zero-initialized value if the 6341// iterator has advanced beyond the end of the collection. 6342func (iter GalleryListIterator) Value() Gallery { 6343 if !iter.page.NotDone() { 6344 return Gallery{} 6345 } 6346 return iter.page.Values()[iter.i] 6347} 6348 6349// Creates a new instance of the GalleryListIterator type. 6350func NewGalleryListIterator(page GalleryListPage) GalleryListIterator { 6351 return GalleryListIterator{page: page} 6352} 6353 6354// IsEmpty returns true if the ListResult contains no values. 6355func (gl GalleryList) IsEmpty() bool { 6356 return gl.Value == nil || len(*gl.Value) == 0 6357} 6358 6359// hasNextLink returns true if the NextLink is not empty. 6360func (gl GalleryList) hasNextLink() bool { 6361 return gl.NextLink != nil && len(*gl.NextLink) != 0 6362} 6363 6364// galleryListPreparer prepares a request to retrieve the next set of results. 6365// It returns nil if no more results exist. 6366func (gl GalleryList) galleryListPreparer(ctx context.Context) (*http.Request, error) { 6367 if !gl.hasNextLink() { 6368 return nil, nil 6369 } 6370 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6371 autorest.AsJSON(), 6372 autorest.AsGet(), 6373 autorest.WithBaseURL(to.String(gl.NextLink))) 6374} 6375 6376// GalleryListPage contains a page of Gallery values. 6377type GalleryListPage struct { 6378 fn func(context.Context, GalleryList) (GalleryList, error) 6379 gl GalleryList 6380} 6381 6382// NextWithContext advances to the next page of values. If there was an error making 6383// the request the page does not advance and the error is returned. 6384func (page *GalleryListPage) NextWithContext(ctx context.Context) (err error) { 6385 if tracing.IsEnabled() { 6386 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryListPage.NextWithContext") 6387 defer func() { 6388 sc := -1 6389 if page.Response().Response.Response != nil { 6390 sc = page.Response().Response.Response.StatusCode 6391 } 6392 tracing.EndSpan(ctx, sc, err) 6393 }() 6394 } 6395 for { 6396 next, err := page.fn(ctx, page.gl) 6397 if err != nil { 6398 return err 6399 } 6400 page.gl = next 6401 if !next.hasNextLink() || !next.IsEmpty() { 6402 break 6403 } 6404 } 6405 return nil 6406} 6407 6408// Next advances to the next page of values. If there was an error making 6409// the request the page does not advance and the error is returned. 6410// Deprecated: Use NextWithContext() instead. 6411func (page *GalleryListPage) Next() error { 6412 return page.NextWithContext(context.Background()) 6413} 6414 6415// NotDone returns true if the page enumeration should be started or is not yet complete. 6416func (page GalleryListPage) NotDone() bool { 6417 return !page.gl.IsEmpty() 6418} 6419 6420// Response returns the raw server response from the last page request. 6421func (page GalleryListPage) Response() GalleryList { 6422 return page.gl 6423} 6424 6425// Values returns the slice of values for the current page or nil if there are no values. 6426func (page GalleryListPage) Values() []Gallery { 6427 if page.gl.IsEmpty() { 6428 return nil 6429 } 6430 return *page.gl.Value 6431} 6432 6433// Creates a new instance of the GalleryListPage type. 6434func NewGalleryListPage(cur GalleryList, getNextPage func(context.Context, GalleryList) (GalleryList, error)) GalleryListPage { 6435 return GalleryListPage{ 6436 fn: getNextPage, 6437 gl: cur, 6438 } 6439} 6440 6441// GalleryOSDiskImage this is the OS disk image. 6442type GalleryOSDiskImage struct { 6443 // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. 6444 SizeInGB *int32 `json:"sizeInGB,omitempty"` 6445 // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' 6446 HostCaching HostCaching `json:"hostCaching,omitempty"` 6447 Source *GalleryArtifactVersionSource `json:"source,omitempty"` 6448} 6449 6450// MarshalJSON is the custom marshaler for GalleryOSDiskImage. 6451func (godi GalleryOSDiskImage) MarshalJSON() ([]byte, error) { 6452 objectMap := make(map[string]interface{}) 6453 if godi.HostCaching != "" { 6454 objectMap["hostCaching"] = godi.HostCaching 6455 } 6456 if godi.Source != nil { 6457 objectMap["source"] = godi.Source 6458 } 6459 return json.Marshal(objectMap) 6460} 6461 6462// GalleryProperties describes the properties of a Shared Image Gallery. 6463type GalleryProperties struct { 6464 // Description - The description of this Shared Image Gallery resource. This property is updatable. 6465 Description *string `json:"description,omitempty"` 6466 Identifier *GalleryIdentifier `json:"identifier,omitempty"` 6467 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningStateCreating', 'ProvisioningStateUpdating', 'ProvisioningStateFailed', 'ProvisioningStateSucceeded', 'ProvisioningStateDeleting', 'ProvisioningStateMigrating' 6468 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 6469} 6470 6471// MarshalJSON is the custom marshaler for GalleryProperties. 6472func (gp GalleryProperties) MarshalJSON() ([]byte, error) { 6473 objectMap := make(map[string]interface{}) 6474 if gp.Description != nil { 6475 objectMap["description"] = gp.Description 6476 } 6477 if gp.Identifier != nil { 6478 objectMap["identifier"] = gp.Identifier 6479 } 6480 return json.Marshal(objectMap) 6481} 6482 6483// GalleryUpdate specifies information about the Shared Image Gallery that you want to update. 6484type GalleryUpdate struct { 6485 *GalleryProperties `json:"properties,omitempty"` 6486 // ID - READ-ONLY; Resource Id 6487 ID *string `json:"id,omitempty"` 6488 // Name - READ-ONLY; Resource name 6489 Name *string `json:"name,omitempty"` 6490 // Type - READ-ONLY; Resource type 6491 Type *string `json:"type,omitempty"` 6492 // Tags - Resource tags 6493 Tags map[string]*string `json:"tags"` 6494} 6495 6496// MarshalJSON is the custom marshaler for GalleryUpdate. 6497func (gu GalleryUpdate) MarshalJSON() ([]byte, error) { 6498 objectMap := make(map[string]interface{}) 6499 if gu.GalleryProperties != nil { 6500 objectMap["properties"] = gu.GalleryProperties 6501 } 6502 if gu.Tags != nil { 6503 objectMap["tags"] = gu.Tags 6504 } 6505 return json.Marshal(objectMap) 6506} 6507 6508// UnmarshalJSON is the custom unmarshaler for GalleryUpdate struct. 6509func (gu *GalleryUpdate) UnmarshalJSON(body []byte) error { 6510 var m map[string]*json.RawMessage 6511 err := json.Unmarshal(body, &m) 6512 if err != nil { 6513 return err 6514 } 6515 for k, v := range m { 6516 switch k { 6517 case "properties": 6518 if v != nil { 6519 var galleryProperties GalleryProperties 6520 err = json.Unmarshal(*v, &galleryProperties) 6521 if err != nil { 6522 return err 6523 } 6524 gu.GalleryProperties = &galleryProperties 6525 } 6526 case "id": 6527 if v != nil { 6528 var ID string 6529 err = json.Unmarshal(*v, &ID) 6530 if err != nil { 6531 return err 6532 } 6533 gu.ID = &ID 6534 } 6535 case "name": 6536 if v != nil { 6537 var name string 6538 err = json.Unmarshal(*v, &name) 6539 if err != nil { 6540 return err 6541 } 6542 gu.Name = &name 6543 } 6544 case "type": 6545 if v != nil { 6546 var typeVar string 6547 err = json.Unmarshal(*v, &typeVar) 6548 if err != nil { 6549 return err 6550 } 6551 gu.Type = &typeVar 6552 } 6553 case "tags": 6554 if v != nil { 6555 var tags map[string]*string 6556 err = json.Unmarshal(*v, &tags) 6557 if err != nil { 6558 return err 6559 } 6560 gu.Tags = tags 6561 } 6562 } 6563 } 6564 6565 return nil 6566} 6567 6568// GrantAccessData data used for requesting a SAS. 6569type GrantAccessData struct { 6570 // Access - Possible values include: 'None', 'Read', 'Write' 6571 Access AccessLevel `json:"access,omitempty"` 6572 // DurationInSeconds - Time duration in seconds until the SAS access expires. 6573 DurationInSeconds *int32 `json:"durationInSeconds,omitempty"` 6574} 6575 6576// HardwareProfile specifies the hardware settings for the virtual machine. 6577type HardwareProfile struct { 6578 // VMSize - Specifies the size of the virtual machine. For more information about virtual machine sizes, see [Sizes for virtual machines](https://docs.microsoft.com/en-us/azure/virtual-machines/sizes). <br><br> The available VM sizes depend on region and availability set. For a list of available sizes use these APIs: <br><br> [List all available virtual machine sizes in an availability set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) <br><br> [List all available virtual machine sizes in a region]( https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list) <br><br> [List all available virtual machine sizes for resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). <br><br> This list of sizes is no longer updated and the **VirtualMachineSizeTypes** string constants will be removed from the subsequent REST API specification. Use [List all available virtual machine sizes in a region]( https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list) to get the latest sizes. Possible values include: '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' 6579 VMSize VirtualMachineSizeTypes `json:"vmSize,omitempty"` 6580} 6581 6582// Image the source user image virtual hard disk. The virtual hard disk will be copied before being 6583// attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not 6584// exist. 6585type Image struct { 6586 autorest.Response `json:"-"` 6587 *ImageProperties `json:"properties,omitempty"` 6588 // ID - READ-ONLY; Resource Id 6589 ID *string `json:"id,omitempty"` 6590 // Name - READ-ONLY; Resource name 6591 Name *string `json:"name,omitempty"` 6592 // Type - READ-ONLY; Resource type 6593 Type *string `json:"type,omitempty"` 6594 // Location - Resource location 6595 Location *string `json:"location,omitempty"` 6596 // Tags - Resource tags 6597 Tags map[string]*string `json:"tags"` 6598} 6599 6600// MarshalJSON is the custom marshaler for Image. 6601func (i Image) MarshalJSON() ([]byte, error) { 6602 objectMap := make(map[string]interface{}) 6603 if i.ImageProperties != nil { 6604 objectMap["properties"] = i.ImageProperties 6605 } 6606 if i.Location != nil { 6607 objectMap["location"] = i.Location 6608 } 6609 if i.Tags != nil { 6610 objectMap["tags"] = i.Tags 6611 } 6612 return json.Marshal(objectMap) 6613} 6614 6615// UnmarshalJSON is the custom unmarshaler for Image struct. 6616func (i *Image) UnmarshalJSON(body []byte) error { 6617 var m map[string]*json.RawMessage 6618 err := json.Unmarshal(body, &m) 6619 if err != nil { 6620 return err 6621 } 6622 for k, v := range m { 6623 switch k { 6624 case "properties": 6625 if v != nil { 6626 var imageProperties ImageProperties 6627 err = json.Unmarshal(*v, &imageProperties) 6628 if err != nil { 6629 return err 6630 } 6631 i.ImageProperties = &imageProperties 6632 } 6633 case "id": 6634 if v != nil { 6635 var ID string 6636 err = json.Unmarshal(*v, &ID) 6637 if err != nil { 6638 return err 6639 } 6640 i.ID = &ID 6641 } 6642 case "name": 6643 if v != nil { 6644 var name string 6645 err = json.Unmarshal(*v, &name) 6646 if err != nil { 6647 return err 6648 } 6649 i.Name = &name 6650 } 6651 case "type": 6652 if v != nil { 6653 var typeVar string 6654 err = json.Unmarshal(*v, &typeVar) 6655 if err != nil { 6656 return err 6657 } 6658 i.Type = &typeVar 6659 } 6660 case "location": 6661 if v != nil { 6662 var location string 6663 err = json.Unmarshal(*v, &location) 6664 if err != nil { 6665 return err 6666 } 6667 i.Location = &location 6668 } 6669 case "tags": 6670 if v != nil { 6671 var tags map[string]*string 6672 err = json.Unmarshal(*v, &tags) 6673 if err != nil { 6674 return err 6675 } 6676 i.Tags = tags 6677 } 6678 } 6679 } 6680 6681 return nil 6682} 6683 6684// ImageDataDisk describes a data disk. 6685type ImageDataDisk struct { 6686 // 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. 6687 Lun *int32 `json:"lun,omitempty"` 6688 // Snapshot - The snapshot. 6689 Snapshot *SubResource `json:"snapshot,omitempty"` 6690 // ManagedDisk - The managedDisk. 6691 ManagedDisk *SubResource `json:"managedDisk,omitempty"` 6692 // BlobURI - The Virtual Hard Disk. 6693 BlobURI *string `json:"blobUri,omitempty"` 6694 // 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' 6695 Caching CachingTypes `json:"caching,omitempty"` 6696 // 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 6697 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 6698 // 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' 6699 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 6700 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. 6701 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 6702} 6703 6704// ImageDisk describes a image disk. 6705type ImageDisk struct { 6706 // Snapshot - The snapshot. 6707 Snapshot *SubResource `json:"snapshot,omitempty"` 6708 // ManagedDisk - The managedDisk. 6709 ManagedDisk *SubResource `json:"managedDisk,omitempty"` 6710 // BlobURI - The Virtual Hard Disk. 6711 BlobURI *string `json:"blobUri,omitempty"` 6712 // 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' 6713 Caching CachingTypes `json:"caching,omitempty"` 6714 // 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 6715 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 6716 // 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' 6717 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 6718 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. 6719 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 6720} 6721 6722// ImageDiskReference the source image used for creating the disk. 6723type ImageDiskReference struct { 6724 // ID - A relative uri containing either a Platform Image Repository or user image reference. 6725 ID *string `json:"id,omitempty"` 6726 // 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. 6727 Lun *int32 `json:"lun,omitempty"` 6728} 6729 6730// ImageListResult the List Image operation response. 6731type ImageListResult struct { 6732 autorest.Response `json:"-"` 6733 // Value - The list of Images. 6734 Value *[]Image `json:"value,omitempty"` 6735 // NextLink - The uri to fetch the next page of Images. Call ListNext() with this to fetch the next page of Images. 6736 NextLink *string `json:"nextLink,omitempty"` 6737} 6738 6739// ImageListResultIterator provides access to a complete listing of Image values. 6740type ImageListResultIterator struct { 6741 i int 6742 page ImageListResultPage 6743} 6744 6745// NextWithContext advances to the next value. If there was an error making 6746// the request the iterator does not advance and the error is returned. 6747func (iter *ImageListResultIterator) NextWithContext(ctx context.Context) (err error) { 6748 if tracing.IsEnabled() { 6749 ctx = tracing.StartSpan(ctx, fqdn+"/ImageListResultIterator.NextWithContext") 6750 defer func() { 6751 sc := -1 6752 if iter.Response().Response.Response != nil { 6753 sc = iter.Response().Response.Response.StatusCode 6754 } 6755 tracing.EndSpan(ctx, sc, err) 6756 }() 6757 } 6758 iter.i++ 6759 if iter.i < len(iter.page.Values()) { 6760 return nil 6761 } 6762 err = iter.page.NextWithContext(ctx) 6763 if err != nil { 6764 iter.i-- 6765 return err 6766 } 6767 iter.i = 0 6768 return nil 6769} 6770 6771// Next advances to the next value. If there was an error making 6772// the request the iterator does not advance and the error is returned. 6773// Deprecated: Use NextWithContext() instead. 6774func (iter *ImageListResultIterator) Next() error { 6775 return iter.NextWithContext(context.Background()) 6776} 6777 6778// NotDone returns true if the enumeration should be started or is not yet complete. 6779func (iter ImageListResultIterator) NotDone() bool { 6780 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6781} 6782 6783// Response returns the raw server response from the last page request. 6784func (iter ImageListResultIterator) Response() ImageListResult { 6785 return iter.page.Response() 6786} 6787 6788// Value returns the current value or a zero-initialized value if the 6789// iterator has advanced beyond the end of the collection. 6790func (iter ImageListResultIterator) Value() Image { 6791 if !iter.page.NotDone() { 6792 return Image{} 6793 } 6794 return iter.page.Values()[iter.i] 6795} 6796 6797// Creates a new instance of the ImageListResultIterator type. 6798func NewImageListResultIterator(page ImageListResultPage) ImageListResultIterator { 6799 return ImageListResultIterator{page: page} 6800} 6801 6802// IsEmpty returns true if the ListResult contains no values. 6803func (ilr ImageListResult) IsEmpty() bool { 6804 return ilr.Value == nil || len(*ilr.Value) == 0 6805} 6806 6807// hasNextLink returns true if the NextLink is not empty. 6808func (ilr ImageListResult) hasNextLink() bool { 6809 return ilr.NextLink != nil && len(*ilr.NextLink) != 0 6810} 6811 6812// imageListResultPreparer prepares a request to retrieve the next set of results. 6813// It returns nil if no more results exist. 6814func (ilr ImageListResult) imageListResultPreparer(ctx context.Context) (*http.Request, error) { 6815 if !ilr.hasNextLink() { 6816 return nil, nil 6817 } 6818 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6819 autorest.AsJSON(), 6820 autorest.AsGet(), 6821 autorest.WithBaseURL(to.String(ilr.NextLink))) 6822} 6823 6824// ImageListResultPage contains a page of Image values. 6825type ImageListResultPage struct { 6826 fn func(context.Context, ImageListResult) (ImageListResult, error) 6827 ilr ImageListResult 6828} 6829 6830// NextWithContext advances to the next page of values. If there was an error making 6831// the request the page does not advance and the error is returned. 6832func (page *ImageListResultPage) NextWithContext(ctx context.Context) (err error) { 6833 if tracing.IsEnabled() { 6834 ctx = tracing.StartSpan(ctx, fqdn+"/ImageListResultPage.NextWithContext") 6835 defer func() { 6836 sc := -1 6837 if page.Response().Response.Response != nil { 6838 sc = page.Response().Response.Response.StatusCode 6839 } 6840 tracing.EndSpan(ctx, sc, err) 6841 }() 6842 } 6843 for { 6844 next, err := page.fn(ctx, page.ilr) 6845 if err != nil { 6846 return err 6847 } 6848 page.ilr = next 6849 if !next.hasNextLink() || !next.IsEmpty() { 6850 break 6851 } 6852 } 6853 return nil 6854} 6855 6856// Next advances to the next page of values. If there was an error making 6857// the request the page does not advance and the error is returned. 6858// Deprecated: Use NextWithContext() instead. 6859func (page *ImageListResultPage) Next() error { 6860 return page.NextWithContext(context.Background()) 6861} 6862 6863// NotDone returns true if the page enumeration should be started or is not yet complete. 6864func (page ImageListResultPage) NotDone() bool { 6865 return !page.ilr.IsEmpty() 6866} 6867 6868// Response returns the raw server response from the last page request. 6869func (page ImageListResultPage) Response() ImageListResult { 6870 return page.ilr 6871} 6872 6873// Values returns the slice of values for the current page or nil if there are no values. 6874func (page ImageListResultPage) Values() []Image { 6875 if page.ilr.IsEmpty() { 6876 return nil 6877 } 6878 return *page.ilr.Value 6879} 6880 6881// Creates a new instance of the ImageListResultPage type. 6882func NewImageListResultPage(cur ImageListResult, getNextPage func(context.Context, ImageListResult) (ImageListResult, error)) ImageListResultPage { 6883 return ImageListResultPage{ 6884 fn: getNextPage, 6885 ilr: cur, 6886 } 6887} 6888 6889// ImageOSDisk describes an Operating System disk. 6890type ImageOSDisk struct { 6891 // OsType - This property allows you to specify the type of the OS that is included in the disk if creating a VM from a custom image. <br><br> Possible values are: <br><br> **Windows** <br><br> **Linux**. Possible values include: 'Windows', 'Linux' 6892 OsType OperatingSystemTypes `json:"osType,omitempty"` 6893 // OsState - The OS State. Possible values include: 'Generalized', 'Specialized' 6894 OsState OperatingSystemStateTypes `json:"osState,omitempty"` 6895 // Snapshot - The snapshot. 6896 Snapshot *SubResource `json:"snapshot,omitempty"` 6897 // ManagedDisk - The managedDisk. 6898 ManagedDisk *SubResource `json:"managedDisk,omitempty"` 6899 // BlobURI - The Virtual Hard Disk. 6900 BlobURI *string `json:"blobUri,omitempty"` 6901 // 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' 6902 Caching CachingTypes `json:"caching,omitempty"` 6903 // 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 6904 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 6905 // 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' 6906 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 6907 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. 6908 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 6909} 6910 6911// ImageProperties describes the properties of an Image. 6912type ImageProperties struct { 6913 // SourceVirtualMachine - The source virtual machine from which Image is created. 6914 SourceVirtualMachine *SubResource `json:"sourceVirtualMachine,omitempty"` 6915 // StorageProfile - Specifies the storage settings for the virtual machine disks. 6916 StorageProfile *ImageStorageProfile `json:"storageProfile,omitempty"` 6917 // ProvisioningState - READ-ONLY; The provisioning state. 6918 ProvisioningState *string `json:"provisioningState,omitempty"` 6919 // HyperVGeneration - Gets the HyperVGenerationType of the VirtualMachine created from the image. Possible values include: 'HyperVGenerationTypesV1', 'HyperVGenerationTypesV2' 6920 HyperVGeneration HyperVGenerationTypes `json:"hyperVGeneration,omitempty"` 6921} 6922 6923// MarshalJSON is the custom marshaler for ImageProperties. 6924func (IP ImageProperties) MarshalJSON() ([]byte, error) { 6925 objectMap := make(map[string]interface{}) 6926 if IP.SourceVirtualMachine != nil { 6927 objectMap["sourceVirtualMachine"] = IP.SourceVirtualMachine 6928 } 6929 if IP.StorageProfile != nil { 6930 objectMap["storageProfile"] = IP.StorageProfile 6931 } 6932 if IP.HyperVGeneration != "" { 6933 objectMap["hyperVGeneration"] = IP.HyperVGeneration 6934 } 6935 return json.Marshal(objectMap) 6936} 6937 6938// ImagePurchasePlan describes the gallery Image Definition purchase plan. This is used by marketplace 6939// images. 6940type ImagePurchasePlan struct { 6941 // Name - The plan ID. 6942 Name *string `json:"name,omitempty"` 6943 // Publisher - The publisher ID. 6944 Publisher *string `json:"publisher,omitempty"` 6945 // Product - The product ID. 6946 Product *string `json:"product,omitempty"` 6947} 6948 6949// ImageReference specifies information about the image to use. You can specify information about platform 6950// images, marketplace images, or virtual machine images. This element is required when you want to use a 6951// platform image, marketplace image, or virtual machine image, but is not used in other creation 6952// operations. NOTE: Image reference publisher and offer can only be set when you create the scale set. 6953type ImageReference struct { 6954 // Publisher - The image publisher. 6955 Publisher *string `json:"publisher,omitempty"` 6956 // Offer - Specifies the offer of the platform image or marketplace image used to create the virtual machine. 6957 Offer *string `json:"offer,omitempty"` 6958 // Sku - The image SKU. 6959 Sku *string `json:"sku,omitempty"` 6960 // 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. 6961 Version *string `json:"version,omitempty"` 6962 // 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'. 6963 ExactVersion *string `json:"exactVersion,omitempty"` 6964 // ID - Resource Id 6965 ID *string `json:"id,omitempty"` 6966} 6967 6968// MarshalJSON is the custom marshaler for ImageReference. 6969func (ir ImageReference) MarshalJSON() ([]byte, error) { 6970 objectMap := make(map[string]interface{}) 6971 if ir.Publisher != nil { 6972 objectMap["publisher"] = ir.Publisher 6973 } 6974 if ir.Offer != nil { 6975 objectMap["offer"] = ir.Offer 6976 } 6977 if ir.Sku != nil { 6978 objectMap["sku"] = ir.Sku 6979 } 6980 if ir.Version != nil { 6981 objectMap["version"] = ir.Version 6982 } 6983 if ir.ID != nil { 6984 objectMap["id"] = ir.ID 6985 } 6986 return json.Marshal(objectMap) 6987} 6988 6989// ImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 6990// operation. 6991type ImagesCreateOrUpdateFuture struct { 6992 azure.FutureAPI 6993 // Result returns the result of the asynchronous operation. 6994 // If the operation has not completed it will return an error. 6995 Result func(ImagesClient) (Image, error) 6996} 6997 6998// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6999func (future *ImagesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 7000 var azFuture azure.Future 7001 if err := json.Unmarshal(body, &azFuture); err != nil { 7002 return err 7003 } 7004 future.FutureAPI = &azFuture 7005 future.Result = future.result 7006 return nil 7007} 7008 7009// result is the default implementation for ImagesCreateOrUpdateFuture.Result. 7010func (future *ImagesCreateOrUpdateFuture) result(client ImagesClient) (i Image, err error) { 7011 var done bool 7012 done, err = future.DoneWithContext(context.Background(), client) 7013 if err != nil { 7014 err = autorest.NewErrorWithError(err, "compute.ImagesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 7015 return 7016 } 7017 if !done { 7018 i.Response.Response = future.Response() 7019 err = azure.NewAsyncOpIncompleteError("compute.ImagesCreateOrUpdateFuture") 7020 return 7021 } 7022 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7023 if i.Response.Response, err = future.GetResult(sender); err == nil && i.Response.Response.StatusCode != http.StatusNoContent { 7024 i, err = client.CreateOrUpdateResponder(i.Response.Response) 7025 if err != nil { 7026 err = autorest.NewErrorWithError(err, "compute.ImagesCreateOrUpdateFuture", "Result", i.Response.Response, "Failure responding to request") 7027 } 7028 } 7029 return 7030} 7031 7032// ImagesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 7033type ImagesDeleteFuture struct { 7034 azure.FutureAPI 7035 // Result returns the result of the asynchronous operation. 7036 // If the operation has not completed it will return an error. 7037 Result func(ImagesClient) (autorest.Response, error) 7038} 7039 7040// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7041func (future *ImagesDeleteFuture) UnmarshalJSON(body []byte) error { 7042 var azFuture azure.Future 7043 if err := json.Unmarshal(body, &azFuture); err != nil { 7044 return err 7045 } 7046 future.FutureAPI = &azFuture 7047 future.Result = future.result 7048 return nil 7049} 7050 7051// result is the default implementation for ImagesDeleteFuture.Result. 7052func (future *ImagesDeleteFuture) result(client ImagesClient) (ar autorest.Response, err error) { 7053 var done bool 7054 done, err = future.DoneWithContext(context.Background(), client) 7055 if err != nil { 7056 err = autorest.NewErrorWithError(err, "compute.ImagesDeleteFuture", "Result", future.Response(), "Polling failure") 7057 return 7058 } 7059 if !done { 7060 ar.Response = future.Response() 7061 err = azure.NewAsyncOpIncompleteError("compute.ImagesDeleteFuture") 7062 return 7063 } 7064 ar.Response = future.Response() 7065 return 7066} 7067 7068// ImageStorageProfile describes a storage profile. 7069type ImageStorageProfile struct { 7070 // OsDisk - Specifies information about the operating system disk used by the virtual machine. <br><br> For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). 7071 OsDisk *ImageOSDisk `json:"osDisk,omitempty"` 7072 // DataDisks - Specifies the parameters that are used to add a data disk to a virtual machine. <br><br> For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). 7073 DataDisks *[]ImageDataDisk `json:"dataDisks,omitempty"` 7074 // 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). 7075 ZoneResilient *bool `json:"zoneResilient,omitempty"` 7076} 7077 7078// ImagesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. 7079type ImagesUpdateFuture struct { 7080 azure.FutureAPI 7081 // Result returns the result of the asynchronous operation. 7082 // If the operation has not completed it will return an error. 7083 Result func(ImagesClient) (Image, error) 7084} 7085 7086// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7087func (future *ImagesUpdateFuture) UnmarshalJSON(body []byte) error { 7088 var azFuture azure.Future 7089 if err := json.Unmarshal(body, &azFuture); err != nil { 7090 return err 7091 } 7092 future.FutureAPI = &azFuture 7093 future.Result = future.result 7094 return nil 7095} 7096 7097// result is the default implementation for ImagesUpdateFuture.Result. 7098func (future *ImagesUpdateFuture) result(client ImagesClient) (i Image, err error) { 7099 var done bool 7100 done, err = future.DoneWithContext(context.Background(), client) 7101 if err != nil { 7102 err = autorest.NewErrorWithError(err, "compute.ImagesUpdateFuture", "Result", future.Response(), "Polling failure") 7103 return 7104 } 7105 if !done { 7106 i.Response.Response = future.Response() 7107 err = azure.NewAsyncOpIncompleteError("compute.ImagesUpdateFuture") 7108 return 7109 } 7110 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7111 if i.Response.Response, err = future.GetResult(sender); err == nil && i.Response.Response.StatusCode != http.StatusNoContent { 7112 i, err = client.UpdateResponder(i.Response.Response) 7113 if err != nil { 7114 err = autorest.NewErrorWithError(err, "compute.ImagesUpdateFuture", "Result", i.Response.Response, "Failure responding to request") 7115 } 7116 } 7117 return 7118} 7119 7120// ImageUpdate the source user image virtual hard disk. Only tags may be updated. 7121type ImageUpdate struct { 7122 *ImageProperties `json:"properties,omitempty"` 7123 // Tags - Resource tags 7124 Tags map[string]*string `json:"tags"` 7125} 7126 7127// MarshalJSON is the custom marshaler for ImageUpdate. 7128func (iu ImageUpdate) MarshalJSON() ([]byte, error) { 7129 objectMap := make(map[string]interface{}) 7130 if iu.ImageProperties != nil { 7131 objectMap["properties"] = iu.ImageProperties 7132 } 7133 if iu.Tags != nil { 7134 objectMap["tags"] = iu.Tags 7135 } 7136 return json.Marshal(objectMap) 7137} 7138 7139// UnmarshalJSON is the custom unmarshaler for ImageUpdate struct. 7140func (iu *ImageUpdate) UnmarshalJSON(body []byte) error { 7141 var m map[string]*json.RawMessage 7142 err := json.Unmarshal(body, &m) 7143 if err != nil { 7144 return err 7145 } 7146 for k, v := range m { 7147 switch k { 7148 case "properties": 7149 if v != nil { 7150 var imageProperties ImageProperties 7151 err = json.Unmarshal(*v, &imageProperties) 7152 if err != nil { 7153 return err 7154 } 7155 iu.ImageProperties = &imageProperties 7156 } 7157 case "tags": 7158 if v != nil { 7159 var tags map[string]*string 7160 err = json.Unmarshal(*v, &tags) 7161 if err != nil { 7162 return err 7163 } 7164 iu.Tags = tags 7165 } 7166 } 7167 } 7168 7169 return nil 7170} 7171 7172// InnerError inner error details. 7173type InnerError struct { 7174 // Exceptiontype - The exception type. 7175 Exceptiontype *string `json:"exceptiontype,omitempty"` 7176 // Errordetail - The internal error message or exception dump. 7177 Errordetail *string `json:"errordetail,omitempty"` 7178} 7179 7180// InstanceViewStatus instance view status. 7181type InstanceViewStatus struct { 7182 // Code - The status code. 7183 Code *string `json:"code,omitempty"` 7184 // Level - The level code. Possible values include: 'Info', 'Warning', 'Error' 7185 Level StatusLevelTypes `json:"level,omitempty"` 7186 // DisplayStatus - The short localizable label for the status. 7187 DisplayStatus *string `json:"displayStatus,omitempty"` 7188 // Message - The detailed status message, including for alerts and error messages. 7189 Message *string `json:"message,omitempty"` 7190 // Time - The time of the status. 7191 Time *date.Time `json:"time,omitempty"` 7192} 7193 7194// KeyVaultAndKeyReference key Vault Key Url and vault id of KeK, KeK is optional and when provided is used 7195// to unwrap the encryptionKey 7196type KeyVaultAndKeyReference struct { 7197 // SourceVault - Resource id of the KeyVault containing the key or secret 7198 SourceVault *SourceVault `json:"sourceVault,omitempty"` 7199 // KeyURL - Url pointing to a key or secret in KeyVault 7200 KeyURL *string `json:"keyUrl,omitempty"` 7201} 7202 7203// KeyVaultAndSecretReference key Vault Secret Url and vault id of the encryption key 7204type KeyVaultAndSecretReference struct { 7205 // SourceVault - Resource id of the KeyVault containing the key or secret 7206 SourceVault *SourceVault `json:"sourceVault,omitempty"` 7207 // SecretURL - Url pointing to a key or secret in KeyVault 7208 SecretURL *string `json:"secretUrl,omitempty"` 7209} 7210 7211// KeyVaultKeyReference describes a reference to Key Vault Key 7212type KeyVaultKeyReference struct { 7213 // KeyURL - The URL referencing a key encryption key in Key Vault. 7214 KeyURL *string `json:"keyUrl,omitempty"` 7215 // SourceVault - The relative URL of the Key Vault containing the key. 7216 SourceVault *SubResource `json:"sourceVault,omitempty"` 7217} 7218 7219// KeyVaultSecretReference describes a reference to Key Vault Secret 7220type KeyVaultSecretReference struct { 7221 // SecretURL - The URL referencing a secret in a Key Vault. 7222 SecretURL *string `json:"secretUrl,omitempty"` 7223 // SourceVault - The relative URL of the Key Vault containing the secret. 7224 SourceVault *SubResource `json:"sourceVault,omitempty"` 7225} 7226 7227// LastPatchInstallationSummary describes the properties of the last installed patch summary. 7228type LastPatchInstallationSummary struct { 7229 // Status - READ-ONLY; The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Failed", "Succeeded", or "CompletedWithWarnings.". Possible values include: 'PatchOperationStatusInProgress', 'PatchOperationStatusFailed', 'PatchOperationStatusSucceeded', 'PatchOperationStatusCompletedWithWarnings' 7230 Status PatchOperationStatus `json:"status,omitempty"` 7231 // InstallationActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. 7232 InstallationActivityID *string `json:"installationActivityId,omitempty"` 7233 // MaintenanceWindowExceeded - READ-ONLY; Describes whether the operation ran out of time before it completed all its intended actions 7234 MaintenanceWindowExceeded *bool `json:"maintenanceWindowExceeded,omitempty"` 7235 // RebootStatus - READ-ONLY; The reboot status of the machine after the patch operation. It will be in "NotNeeded" status if reboot is not needed after the patch operation. "Required" will be the status once the patch is applied and machine is required to reboot. "Started" will be the reboot status when the machine has started to reboot. "Failed" will be the status if the machine is failed to reboot. "Completed" will be the status once the machine is rebooted successfully. Possible values include: 'RebootStatusNotNeeded', 'RebootStatusRequired', 'RebootStatusStarted', 'RebootStatusFailed', 'RebootStatusCompleted' 7236 RebootStatus RebootStatus `json:"rebootStatus,omitempty"` 7237 // 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. 7238 NotSelectedPatchCount *int32 `json:"notSelectedPatchCount,omitempty"` 7239 // ExcludedPatchCount - READ-ONLY; The number of all available patches but excluded explicitly by a customer-specified exclusion list match. 7240 ExcludedPatchCount *int32 `json:"excludedPatchCount,omitempty"` 7241 // PendingPatchCount - READ-ONLY; The number of all available patches expected to be installed over the course of the patch installation operation. 7242 PendingPatchCount *int32 `json:"pendingPatchCount,omitempty"` 7243 // InstalledPatchCount - READ-ONLY; The count of patches that successfully installed. 7244 InstalledPatchCount *int32 `json:"installedPatchCount,omitempty"` 7245 // FailedPatchCount - READ-ONLY; The count of patches that failed installation. 7246 FailedPatchCount *int32 `json:"failedPatchCount,omitempty"` 7247 // StartTime - READ-ONLY; The UTC timestamp when the operation began. 7248 StartTime *date.Time `json:"startTime,omitempty"` 7249 // LastModifiedTime - READ-ONLY; The UTC timestamp when the operation began. 7250 LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` 7251 // StartedBy - READ-ONLY; The person or system account that started the operation 7252 StartedBy *string `json:"startedBy,omitempty"` 7253 // Error - READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. 7254 Error *APIError `json:"error,omitempty"` 7255} 7256 7257// MarshalJSON is the custom marshaler for LastPatchInstallationSummary. 7258func (lpis LastPatchInstallationSummary) MarshalJSON() ([]byte, error) { 7259 objectMap := make(map[string]interface{}) 7260 return json.Marshal(objectMap) 7261} 7262 7263// LinuxConfiguration specifies the Linux operating system settings on the virtual machine. <br><br>For a 7264// list of supported Linux distributions, see [Linux on Azure-Endorsed 7265// Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) 7266// <br><br> For running non-endorsed distributions, see [Information for Non-Endorsed 7267// Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). 7268type LinuxConfiguration struct { 7269 // DisablePasswordAuthentication - Specifies whether password authentication should be disabled. 7270 DisablePasswordAuthentication *bool `json:"disablePasswordAuthentication,omitempty"` 7271 // SSH - Specifies the ssh key configuration for a Linux OS. 7272 SSH *SSHConfiguration `json:"ssh,omitempty"` 7273 // 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. 7274 ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` 7275} 7276 7277// ListUsagesResult the List Usages operation response. 7278type ListUsagesResult struct { 7279 autorest.Response `json:"-"` 7280 // Value - The list of compute resource usages. 7281 Value *[]Usage `json:"value,omitempty"` 7282 // 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. 7283 NextLink *string `json:"nextLink,omitempty"` 7284} 7285 7286// ListUsagesResultIterator provides access to a complete listing of Usage values. 7287type ListUsagesResultIterator struct { 7288 i int 7289 page ListUsagesResultPage 7290} 7291 7292// NextWithContext advances to the next value. If there was an error making 7293// the request the iterator does not advance and the error is returned. 7294func (iter *ListUsagesResultIterator) NextWithContext(ctx context.Context) (err error) { 7295 if tracing.IsEnabled() { 7296 ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultIterator.NextWithContext") 7297 defer func() { 7298 sc := -1 7299 if iter.Response().Response.Response != nil { 7300 sc = iter.Response().Response.Response.StatusCode 7301 } 7302 tracing.EndSpan(ctx, sc, err) 7303 }() 7304 } 7305 iter.i++ 7306 if iter.i < len(iter.page.Values()) { 7307 return nil 7308 } 7309 err = iter.page.NextWithContext(ctx) 7310 if err != nil { 7311 iter.i-- 7312 return err 7313 } 7314 iter.i = 0 7315 return nil 7316} 7317 7318// Next advances to the next value. If there was an error making 7319// the request the iterator does not advance and the error is returned. 7320// Deprecated: Use NextWithContext() instead. 7321func (iter *ListUsagesResultIterator) Next() error { 7322 return iter.NextWithContext(context.Background()) 7323} 7324 7325// NotDone returns true if the enumeration should be started or is not yet complete. 7326func (iter ListUsagesResultIterator) NotDone() bool { 7327 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7328} 7329 7330// Response returns the raw server response from the last page request. 7331func (iter ListUsagesResultIterator) Response() ListUsagesResult { 7332 return iter.page.Response() 7333} 7334 7335// Value returns the current value or a zero-initialized value if the 7336// iterator has advanced beyond the end of the collection. 7337func (iter ListUsagesResultIterator) Value() Usage { 7338 if !iter.page.NotDone() { 7339 return Usage{} 7340 } 7341 return iter.page.Values()[iter.i] 7342} 7343 7344// Creates a new instance of the ListUsagesResultIterator type. 7345func NewListUsagesResultIterator(page ListUsagesResultPage) ListUsagesResultIterator { 7346 return ListUsagesResultIterator{page: page} 7347} 7348 7349// IsEmpty returns true if the ListResult contains no values. 7350func (lur ListUsagesResult) IsEmpty() bool { 7351 return lur.Value == nil || len(*lur.Value) == 0 7352} 7353 7354// hasNextLink returns true if the NextLink is not empty. 7355func (lur ListUsagesResult) hasNextLink() bool { 7356 return lur.NextLink != nil && len(*lur.NextLink) != 0 7357} 7358 7359// listUsagesResultPreparer prepares a request to retrieve the next set of results. 7360// It returns nil if no more results exist. 7361func (lur ListUsagesResult) listUsagesResultPreparer(ctx context.Context) (*http.Request, error) { 7362 if !lur.hasNextLink() { 7363 return nil, nil 7364 } 7365 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7366 autorest.AsJSON(), 7367 autorest.AsGet(), 7368 autorest.WithBaseURL(to.String(lur.NextLink))) 7369} 7370 7371// ListUsagesResultPage contains a page of Usage values. 7372type ListUsagesResultPage struct { 7373 fn func(context.Context, ListUsagesResult) (ListUsagesResult, error) 7374 lur ListUsagesResult 7375} 7376 7377// NextWithContext advances to the next page of values. If there was an error making 7378// the request the page does not advance and the error is returned. 7379func (page *ListUsagesResultPage) NextWithContext(ctx context.Context) (err error) { 7380 if tracing.IsEnabled() { 7381 ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultPage.NextWithContext") 7382 defer func() { 7383 sc := -1 7384 if page.Response().Response.Response != nil { 7385 sc = page.Response().Response.Response.StatusCode 7386 } 7387 tracing.EndSpan(ctx, sc, err) 7388 }() 7389 } 7390 for { 7391 next, err := page.fn(ctx, page.lur) 7392 if err != nil { 7393 return err 7394 } 7395 page.lur = next 7396 if !next.hasNextLink() || !next.IsEmpty() { 7397 break 7398 } 7399 } 7400 return nil 7401} 7402 7403// Next advances to the next page of values. If there was an error making 7404// the request the page does not advance and the error is returned. 7405// Deprecated: Use NextWithContext() instead. 7406func (page *ListUsagesResultPage) Next() error { 7407 return page.NextWithContext(context.Background()) 7408} 7409 7410// NotDone returns true if the page enumeration should be started or is not yet complete. 7411func (page ListUsagesResultPage) NotDone() bool { 7412 return !page.lur.IsEmpty() 7413} 7414 7415// Response returns the raw server response from the last page request. 7416func (page ListUsagesResultPage) Response() ListUsagesResult { 7417 return page.lur 7418} 7419 7420// Values returns the slice of values for the current page or nil if there are no values. 7421func (page ListUsagesResultPage) Values() []Usage { 7422 if page.lur.IsEmpty() { 7423 return nil 7424 } 7425 return *page.lur.Value 7426} 7427 7428// Creates a new instance of the ListUsagesResultPage type. 7429func NewListUsagesResultPage(cur ListUsagesResult, getNextPage func(context.Context, ListUsagesResult) (ListUsagesResult, error)) ListUsagesResultPage { 7430 return ListUsagesResultPage{ 7431 fn: getNextPage, 7432 lur: cur, 7433 } 7434} 7435 7436// ListVirtualMachineExtensionImage ... 7437type ListVirtualMachineExtensionImage struct { 7438 autorest.Response `json:"-"` 7439 Value *[]VirtualMachineExtensionImage `json:"value,omitempty"` 7440} 7441 7442// ListVirtualMachineImageResource ... 7443type ListVirtualMachineImageResource struct { 7444 autorest.Response `json:"-"` 7445 Value *[]VirtualMachineImageResource `json:"value,omitempty"` 7446} 7447 7448// LogAnalyticsExportRequestRateByIntervalFuture an abstraction for monitoring and retrieving the results 7449// of a long-running operation. 7450type LogAnalyticsExportRequestRateByIntervalFuture struct { 7451 azure.FutureAPI 7452 // Result returns the result of the asynchronous operation. 7453 // If the operation has not completed it will return an error. 7454 Result func(LogAnalyticsClient) (LogAnalyticsOperationResult, error) 7455} 7456 7457// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7458func (future *LogAnalyticsExportRequestRateByIntervalFuture) UnmarshalJSON(body []byte) error { 7459 var azFuture azure.Future 7460 if err := json.Unmarshal(body, &azFuture); err != nil { 7461 return err 7462 } 7463 future.FutureAPI = &azFuture 7464 future.Result = future.result 7465 return nil 7466} 7467 7468// result is the default implementation for LogAnalyticsExportRequestRateByIntervalFuture.Result. 7469func (future *LogAnalyticsExportRequestRateByIntervalFuture) result(client LogAnalyticsClient) (laor LogAnalyticsOperationResult, err error) { 7470 var done bool 7471 done, err = future.DoneWithContext(context.Background(), client) 7472 if err != nil { 7473 err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportRequestRateByIntervalFuture", "Result", future.Response(), "Polling failure") 7474 return 7475 } 7476 if !done { 7477 laor.Response.Response = future.Response() 7478 err = azure.NewAsyncOpIncompleteError("compute.LogAnalyticsExportRequestRateByIntervalFuture") 7479 return 7480 } 7481 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7482 if laor.Response.Response, err = future.GetResult(sender); err == nil && laor.Response.Response.StatusCode != http.StatusNoContent { 7483 laor, err = client.ExportRequestRateByIntervalResponder(laor.Response.Response) 7484 if err != nil { 7485 err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportRequestRateByIntervalFuture", "Result", laor.Response.Response, "Failure responding to request") 7486 } 7487 } 7488 return 7489} 7490 7491// LogAnalyticsExportThrottledRequestsFuture an abstraction for monitoring and retrieving the results of a 7492// long-running operation. 7493type LogAnalyticsExportThrottledRequestsFuture struct { 7494 azure.FutureAPI 7495 // Result returns the result of the asynchronous operation. 7496 // If the operation has not completed it will return an error. 7497 Result func(LogAnalyticsClient) (LogAnalyticsOperationResult, error) 7498} 7499 7500// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7501func (future *LogAnalyticsExportThrottledRequestsFuture) UnmarshalJSON(body []byte) error { 7502 var azFuture azure.Future 7503 if err := json.Unmarshal(body, &azFuture); err != nil { 7504 return err 7505 } 7506 future.FutureAPI = &azFuture 7507 future.Result = future.result 7508 return nil 7509} 7510 7511// result is the default implementation for LogAnalyticsExportThrottledRequestsFuture.Result. 7512func (future *LogAnalyticsExportThrottledRequestsFuture) result(client LogAnalyticsClient) (laor LogAnalyticsOperationResult, err error) { 7513 var done bool 7514 done, err = future.DoneWithContext(context.Background(), client) 7515 if err != nil { 7516 err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportThrottledRequestsFuture", "Result", future.Response(), "Polling failure") 7517 return 7518 } 7519 if !done { 7520 laor.Response.Response = future.Response() 7521 err = azure.NewAsyncOpIncompleteError("compute.LogAnalyticsExportThrottledRequestsFuture") 7522 return 7523 } 7524 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7525 if laor.Response.Response, err = future.GetResult(sender); err == nil && laor.Response.Response.StatusCode != http.StatusNoContent { 7526 laor, err = client.ExportThrottledRequestsResponder(laor.Response.Response) 7527 if err != nil { 7528 err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportThrottledRequestsFuture", "Result", laor.Response.Response, "Failure responding to request") 7529 } 7530 } 7531 return 7532} 7533 7534// LogAnalyticsInputBase api input base class for LogAnalytics Api. 7535type LogAnalyticsInputBase struct { 7536 // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. 7537 BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` 7538 // FromTime - From time of the query 7539 FromTime *date.Time `json:"fromTime,omitempty"` 7540 // ToTime - To time of the query 7541 ToTime *date.Time `json:"toTime,omitempty"` 7542 // GroupByThrottlePolicy - Group query result by Throttle Policy applied. 7543 GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` 7544 // GroupByOperationName - Group query result by Operation Name. 7545 GroupByOperationName *bool `json:"groupByOperationName,omitempty"` 7546 // GroupByResourceName - Group query result by Resource Name. 7547 GroupByResourceName *bool `json:"groupByResourceName,omitempty"` 7548} 7549 7550// LogAnalyticsOperationResult logAnalytics operation status response 7551type LogAnalyticsOperationResult struct { 7552 autorest.Response `json:"-"` 7553 // Properties - READ-ONLY; LogAnalyticsOutput 7554 Properties *LogAnalyticsOutput `json:"properties,omitempty"` 7555} 7556 7557// MarshalJSON is the custom marshaler for LogAnalyticsOperationResult. 7558func (laor LogAnalyticsOperationResult) MarshalJSON() ([]byte, error) { 7559 objectMap := make(map[string]interface{}) 7560 return json.Marshal(objectMap) 7561} 7562 7563// LogAnalyticsOutput logAnalytics output properties 7564type LogAnalyticsOutput struct { 7565 // Output - READ-ONLY; Output file Uri path to blob container. 7566 Output *string `json:"output,omitempty"` 7567} 7568 7569// MarshalJSON is the custom marshaler for LogAnalyticsOutput. 7570func (lao LogAnalyticsOutput) MarshalJSON() ([]byte, error) { 7571 objectMap := make(map[string]interface{}) 7572 return json.Marshal(objectMap) 7573} 7574 7575// MaintenanceRedeployStatus maintenance Operation Status. 7576type MaintenanceRedeployStatus struct { 7577 // IsCustomerInitiatedMaintenanceAllowed - True, if customer is allowed to perform Maintenance. 7578 IsCustomerInitiatedMaintenanceAllowed *bool `json:"isCustomerInitiatedMaintenanceAllowed,omitempty"` 7579 // PreMaintenanceWindowStartTime - Start Time for the Pre Maintenance Window. 7580 PreMaintenanceWindowStartTime *date.Time `json:"preMaintenanceWindowStartTime,omitempty"` 7581 // PreMaintenanceWindowEndTime - End Time for the Pre Maintenance Window. 7582 PreMaintenanceWindowEndTime *date.Time `json:"preMaintenanceWindowEndTime,omitempty"` 7583 // MaintenanceWindowStartTime - Start Time for the Maintenance Window. 7584 MaintenanceWindowStartTime *date.Time `json:"maintenanceWindowStartTime,omitempty"` 7585 // MaintenanceWindowEndTime - End Time for the Maintenance Window. 7586 MaintenanceWindowEndTime *date.Time `json:"maintenanceWindowEndTime,omitempty"` 7587 // LastOperationResultCode - The Last Maintenance Operation Result Code. Possible values include: 'MaintenanceOperationResultCodeTypesNone', 'MaintenanceOperationResultCodeTypesRetryLater', 'MaintenanceOperationResultCodeTypesMaintenanceAborted', 'MaintenanceOperationResultCodeTypesMaintenanceCompleted' 7588 LastOperationResultCode MaintenanceOperationResultCodeTypes `json:"lastOperationResultCode,omitempty"` 7589 // LastOperationMessage - Message returned for the last Maintenance Operation. 7590 LastOperationMessage *string `json:"lastOperationMessage,omitempty"` 7591} 7592 7593// ManagedArtifact the managed artifact. 7594type ManagedArtifact struct { 7595 // ID - The managed artifact id. 7596 ID *string `json:"id,omitempty"` 7597} 7598 7599// ManagedDiskParameters the parameters of a managed disk. 7600type ManagedDiskParameters struct { 7601 // 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' 7602 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 7603 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed disk. 7604 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 7605 // ID - Resource Id 7606 ID *string `json:"id,omitempty"` 7607} 7608 7609// NetworkInterfaceReference describes a network interface reference. 7610type NetworkInterfaceReference struct { 7611 *NetworkInterfaceReferenceProperties `json:"properties,omitempty"` 7612 // ID - Resource Id 7613 ID *string `json:"id,omitempty"` 7614} 7615 7616// MarshalJSON is the custom marshaler for NetworkInterfaceReference. 7617func (nir NetworkInterfaceReference) MarshalJSON() ([]byte, error) { 7618 objectMap := make(map[string]interface{}) 7619 if nir.NetworkInterfaceReferenceProperties != nil { 7620 objectMap["properties"] = nir.NetworkInterfaceReferenceProperties 7621 } 7622 if nir.ID != nil { 7623 objectMap["id"] = nir.ID 7624 } 7625 return json.Marshal(objectMap) 7626} 7627 7628// UnmarshalJSON is the custom unmarshaler for NetworkInterfaceReference struct. 7629func (nir *NetworkInterfaceReference) UnmarshalJSON(body []byte) error { 7630 var m map[string]*json.RawMessage 7631 err := json.Unmarshal(body, &m) 7632 if err != nil { 7633 return err 7634 } 7635 for k, v := range m { 7636 switch k { 7637 case "properties": 7638 if v != nil { 7639 var networkInterfaceReferenceProperties NetworkInterfaceReferenceProperties 7640 err = json.Unmarshal(*v, &networkInterfaceReferenceProperties) 7641 if err != nil { 7642 return err 7643 } 7644 nir.NetworkInterfaceReferenceProperties = &networkInterfaceReferenceProperties 7645 } 7646 case "id": 7647 if v != nil { 7648 var ID string 7649 err = json.Unmarshal(*v, &ID) 7650 if err != nil { 7651 return err 7652 } 7653 nir.ID = &ID 7654 } 7655 } 7656 } 7657 7658 return nil 7659} 7660 7661// NetworkInterfaceReferenceProperties describes a network interface reference properties. 7662type NetworkInterfaceReferenceProperties struct { 7663 // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. 7664 Primary *bool `json:"primary,omitempty"` 7665} 7666 7667// NetworkProfile specifies the network interfaces of the virtual machine. 7668type NetworkProfile struct { 7669 // NetworkInterfaces - Specifies the list of resource Ids for the network interfaces associated with the virtual machine. 7670 NetworkInterfaces *[]NetworkInterfaceReference `json:"networkInterfaces,omitempty"` 7671} 7672 7673// OperationListResult the List Compute Operation operation response. 7674type OperationListResult struct { 7675 autorest.Response `json:"-"` 7676 // Value - READ-ONLY; The list of compute operations 7677 Value *[]OperationValue `json:"value,omitempty"` 7678} 7679 7680// MarshalJSON is the custom marshaler for OperationListResult. 7681func (olr OperationListResult) MarshalJSON() ([]byte, error) { 7682 objectMap := make(map[string]interface{}) 7683 return json.Marshal(objectMap) 7684} 7685 7686// OperationValue describes the properties of a Compute Operation value. 7687type OperationValue struct { 7688 // Origin - READ-ONLY; The origin of the compute operation. 7689 Origin *string `json:"origin,omitempty"` 7690 // Name - READ-ONLY; The name of the compute operation. 7691 Name *string `json:"name,omitempty"` 7692 *OperationValueDisplay `json:"display,omitempty"` 7693} 7694 7695// MarshalJSON is the custom marshaler for OperationValue. 7696func (ov OperationValue) MarshalJSON() ([]byte, error) { 7697 objectMap := make(map[string]interface{}) 7698 if ov.OperationValueDisplay != nil { 7699 objectMap["display"] = ov.OperationValueDisplay 7700 } 7701 return json.Marshal(objectMap) 7702} 7703 7704// UnmarshalJSON is the custom unmarshaler for OperationValue struct. 7705func (ov *OperationValue) UnmarshalJSON(body []byte) error { 7706 var m map[string]*json.RawMessage 7707 err := json.Unmarshal(body, &m) 7708 if err != nil { 7709 return err 7710 } 7711 for k, v := range m { 7712 switch k { 7713 case "origin": 7714 if v != nil { 7715 var origin string 7716 err = json.Unmarshal(*v, &origin) 7717 if err != nil { 7718 return err 7719 } 7720 ov.Origin = &origin 7721 } 7722 case "name": 7723 if v != nil { 7724 var name string 7725 err = json.Unmarshal(*v, &name) 7726 if err != nil { 7727 return err 7728 } 7729 ov.Name = &name 7730 } 7731 case "display": 7732 if v != nil { 7733 var operationValueDisplay OperationValueDisplay 7734 err = json.Unmarshal(*v, &operationValueDisplay) 7735 if err != nil { 7736 return err 7737 } 7738 ov.OperationValueDisplay = &operationValueDisplay 7739 } 7740 } 7741 } 7742 7743 return nil 7744} 7745 7746// OperationValueDisplay describes the properties of a Compute Operation Value Display. 7747type OperationValueDisplay struct { 7748 // Operation - READ-ONLY; The display name of the compute operation. 7749 Operation *string `json:"operation,omitempty"` 7750 // Resource - READ-ONLY; The display name of the resource the operation applies to. 7751 Resource *string `json:"resource,omitempty"` 7752 // Description - READ-ONLY; The description of the operation. 7753 Description *string `json:"description,omitempty"` 7754 // Provider - READ-ONLY; The resource provider for the operation. 7755 Provider *string `json:"provider,omitempty"` 7756} 7757 7758// MarshalJSON is the custom marshaler for OperationValueDisplay. 7759func (ovd OperationValueDisplay) MarshalJSON() ([]byte, error) { 7760 objectMap := make(map[string]interface{}) 7761 return json.Marshal(objectMap) 7762} 7763 7764// OrchestrationServiceStateInput the input for OrchestrationServiceState 7765type OrchestrationServiceStateInput struct { 7766 // ServiceName - The name of the service. Possible values include: 'AutomaticRepairs' 7767 ServiceName OrchestrationServiceNames `json:"serviceName,omitempty"` 7768 // Action - The action to be performed. Possible values include: 'Resume', 'Suspend' 7769 Action OrchestrationServiceStateAction `json:"action,omitempty"` 7770} 7771 7772// OrchestrationServiceSummary summary for an orchestration service of a virtual machine scale set. 7773type OrchestrationServiceSummary struct { 7774 // ServiceName - READ-ONLY; The name of the service. Possible values include: 'AutomaticRepairs', 'DummyOrchestrationServiceName' 7775 ServiceName OrchestrationServiceNames `json:"serviceName,omitempty"` 7776 // ServiceState - READ-ONLY; The current state of the service. Possible values include: 'NotRunning', 'Running', 'Suspended' 7777 ServiceState OrchestrationServiceState `json:"serviceState,omitempty"` 7778} 7779 7780// MarshalJSON is the custom marshaler for OrchestrationServiceSummary. 7781func (oss OrchestrationServiceSummary) MarshalJSON() ([]byte, error) { 7782 objectMap := make(map[string]interface{}) 7783 return json.Marshal(objectMap) 7784} 7785 7786// OSDisk specifies information about the operating system disk used by the virtual machine. <br><br> For 7787// more information about disks, see [About disks and VHDs for Azure virtual 7788// machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). 7789type OSDisk struct { 7790 // OsType - This property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD. <br><br> Possible values are: <br><br> **Windows** <br><br> **Linux**. Possible values include: 'Windows', 'Linux' 7791 OsType OperatingSystemTypes `json:"osType,omitempty"` 7792 // EncryptionSettings - Specifies the encryption settings for the OS Disk. <br><br> Minimum api-version: 2015-06-15 7793 EncryptionSettings *DiskEncryptionSettings `json:"encryptionSettings,omitempty"` 7794 // Name - The disk name. 7795 Name *string `json:"name,omitempty"` 7796 // Vhd - The virtual hard disk. 7797 Vhd *VirtualHardDisk `json:"vhd,omitempty"` 7798 // 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. 7799 Image *VirtualHardDisk `json:"image,omitempty"` 7800 // 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' 7801 Caching CachingTypes `json:"caching,omitempty"` 7802 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 7803 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 7804 // DiffDiskSettings - Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine. 7805 DiffDiskSettings *DiffDiskSettings `json:"diffDiskSettings,omitempty"` 7806 // 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' 7807 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 7808 // 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 7809 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 7810 // ManagedDisk - The managed disk parameters. 7811 ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` 7812} 7813 7814// OSDiskImage contains the os disk image information. 7815type OSDiskImage struct { 7816 // OperatingSystem - The operating system of the osDiskImage. Possible values include: 'Windows', 'Linux' 7817 OperatingSystem OperatingSystemTypes `json:"operatingSystem,omitempty"` 7818} 7819 7820// OSDiskImageEncryption contains encryption settings for an OS disk image. 7821type OSDiskImageEncryption struct { 7822 // DiskEncryptionSetID - A relative URI containing the resource ID of the disk encryption set. 7823 DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` 7824} 7825 7826// OSProfile specifies the operating system settings for the virtual machine. Some of the settings cannot 7827// be changed once VM is provisioned. 7828type OSProfile struct { 7829 // ComputerName - Specifies the host OS name of the virtual machine. <br><br> This name cannot be updated after the VM is created. <br><br> **Max-length (Windows):** 15 characters <br><br> **Max-length (Linux):** 64 characters. <br><br> For naming conventions and restrictions see [Azure infrastructure services implementation guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). 7830 ComputerName *string `json:"computerName,omitempty"` 7831 // AdminUsername - Specifies the name of the administrator account. <br><br> This property cannot be updated after the VM is created. <br><br> **Windows-only restriction:** Cannot end in "." <br><br> **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". <br><br> **Minimum-length (Linux):** 1 character <br><br> **Max-length (Linux):** 64 characters <br><br> **Max-length (Windows):** 20 characters <br><br><li> For root access to the Linux VM, see [Using root privileges on Linux virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)<br><li> For a list of built-in system users on Linux that should not be used in this field, see [Selecting User Names for Linux on Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) 7832 AdminUsername *string `json:"adminUsername,omitempty"` 7833 // AdminPassword - Specifies the password of the administrator account. <br><br> **Minimum-length (Windows):** 8 characters <br><br> **Minimum-length (Linux):** 6 characters <br><br> **Max-length (Windows):** 123 characters <br><br> **Max-length (Linux):** 72 characters <br><br> **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled <br> Has lower characters <br>Has upper characters <br> Has a digit <br> Has a special character (Regex match [\W_]) <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" <br><br> For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) <br><br> For resetting root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) 7834 AdminPassword *string `json:"adminPassword,omitempty"` 7835 // CustomData - Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array is 65535 bytes. <br><br> **Note: Do not pass any secrets or passwords in customData property** <br><br> This property cannot be updated after the VM is created. <br><br> customData is passed to the VM to be saved as a file, for more information see [Custom Data on Azure VMs](https://azure.microsoft.com/en-us/blog/custom-data-and-cloud-init-on-windows-azure/) <br><br> For using cloud-init for your Linux VM, see [Using cloud-init to customize a Linux VM during creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) 7836 CustomData *string `json:"customData,omitempty"` 7837 // WindowsConfiguration - Specifies Windows operating system settings on the virtual machine. 7838 WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` 7839 // LinuxConfiguration - Specifies the Linux operating system settings on the virtual machine. <br><br>For a list of supported Linux distributions, see [Linux on Azure-Endorsed Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) <br><br> For running non-endorsed distributions, see [Information for Non-Endorsed Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). 7840 LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` 7841 // Secrets - Specifies set of certificates that should be installed onto the virtual machine. 7842 Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` 7843 // 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. 7844 AllowExtensionOperations *bool `json:"allowExtensionOperations,omitempty"` 7845 // 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.** 7846 RequireGuestProvisionSignal *bool `json:"requireGuestProvisionSignal,omitempty"` 7847} 7848 7849// PatchSettings ... 7850type PatchSettings struct { 7851 // PatchMode - Specifies the mode of in-guest patching to IaaS virtual machine.<br /><br /> Possible values are:<br /><br /> **Manual** - You control the application of patches to a virtual machine. You do this by applying patches manually inside the VM. In this mode, automatic updates are disabled; the property WindowsConfiguration.enableAutomaticUpdates must be false<br /><br /> **AutomaticByOS** - The virtual machine will automatically be updated by the OS. The property WindowsConfiguration.enableAutomaticUpdates must be true. <br /><br /> ** AutomaticByPlatform** - the virtual machine will automatically updated by the platform. The properties provisionVMAgent and WindowsConfiguration.enableAutomaticUpdates must be true. Possible values include: 'Manual', 'AutomaticByOS', 'AutomaticByPlatform' 7852 PatchMode InGuestPatchMode `json:"patchMode,omitempty"` 7853} 7854 7855// Plan specifies information about the marketplace image used to create the virtual machine. This element 7856// is only used for marketplace images. Before you can use a marketplace image from an API, you must enable 7857// the image for programmatic use. In the Azure portal, find the marketplace image that you want to use 7858// and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and 7859// then click **Save**. 7860type Plan struct { 7861 // Name - The plan ID. 7862 Name *string `json:"name,omitempty"` 7863 // Publisher - The publisher ID. 7864 Publisher *string `json:"publisher,omitempty"` 7865 // Product - Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. 7866 Product *string `json:"product,omitempty"` 7867 // PromotionCode - The promotion code. 7868 PromotionCode *string `json:"promotionCode,omitempty"` 7869} 7870 7871// PrivateEndpoint the Private Endpoint resource. 7872type PrivateEndpoint struct { 7873 // ID - READ-ONLY; The ARM identifier for Private Endpoint 7874 ID *string `json:"id,omitempty"` 7875} 7876 7877// MarshalJSON is the custom marshaler for PrivateEndpoint. 7878func (peVar PrivateEndpoint) MarshalJSON() ([]byte, error) { 7879 objectMap := make(map[string]interface{}) 7880 return json.Marshal(objectMap) 7881} 7882 7883// PrivateEndpointConnection the Private Endpoint Connection resource. 7884type PrivateEndpointConnection struct { 7885 // PrivateEndpointConnectionProperties - Resource properties. 7886 *PrivateEndpointConnectionProperties `json:"properties,omitempty"` 7887 // ID - READ-ONLY; private endpoint connection Id 7888 ID *string `json:"id,omitempty"` 7889 // Name - READ-ONLY; private endpoint connection name 7890 Name *string `json:"name,omitempty"` 7891 // Type - READ-ONLY; private endpoint connection type 7892 Type *string `json:"type,omitempty"` 7893} 7894 7895// MarshalJSON is the custom marshaler for PrivateEndpointConnection. 7896func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) { 7897 objectMap := make(map[string]interface{}) 7898 if pec.PrivateEndpointConnectionProperties != nil { 7899 objectMap["properties"] = pec.PrivateEndpointConnectionProperties 7900 } 7901 return json.Marshal(objectMap) 7902} 7903 7904// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct. 7905func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error { 7906 var m map[string]*json.RawMessage 7907 err := json.Unmarshal(body, &m) 7908 if err != nil { 7909 return err 7910 } 7911 for k, v := range m { 7912 switch k { 7913 case "properties": 7914 if v != nil { 7915 var privateEndpointConnectionProperties PrivateEndpointConnectionProperties 7916 err = json.Unmarshal(*v, &privateEndpointConnectionProperties) 7917 if err != nil { 7918 return err 7919 } 7920 pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties 7921 } 7922 case "id": 7923 if v != nil { 7924 var ID string 7925 err = json.Unmarshal(*v, &ID) 7926 if err != nil { 7927 return err 7928 } 7929 pec.ID = &ID 7930 } 7931 case "name": 7932 if v != nil { 7933 var name string 7934 err = json.Unmarshal(*v, &name) 7935 if err != nil { 7936 return err 7937 } 7938 pec.Name = &name 7939 } 7940 case "type": 7941 if v != nil { 7942 var typeVar string 7943 err = json.Unmarshal(*v, &typeVar) 7944 if err != nil { 7945 return err 7946 } 7947 pec.Type = &typeVar 7948 } 7949 } 7950 } 7951 7952 return nil 7953} 7954 7955// PrivateEndpointConnectionProperties properties of the PrivateEndpointConnectProperties. 7956type PrivateEndpointConnectionProperties struct { 7957 // PrivateEndpoint - The resource of private end point. 7958 PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` 7959 // PrivateLinkServiceConnectionState - A collection of information about the state of the connection between DiskAccess and Virtual Network. 7960 PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` 7961 // ProvisioningState - The provisioning state of the private endpoint connection resource. Possible values include: 'PrivateEndpointConnectionProvisioningStateSucceeded', 'PrivateEndpointConnectionProvisioningStateCreating', 'PrivateEndpointConnectionProvisioningStateDeleting', 'PrivateEndpointConnectionProvisioningStateFailed' 7962 ProvisioningState PrivateEndpointConnectionProvisioningState `json:"provisioningState,omitempty"` 7963} 7964 7965// PrivateLinkResource a private link resource 7966type PrivateLinkResource struct { 7967 // PrivateLinkResourceProperties - Resource properties. 7968 *PrivateLinkResourceProperties `json:"properties,omitempty"` 7969 // ID - READ-ONLY; private link resource Id 7970 ID *string `json:"id,omitempty"` 7971 // Name - READ-ONLY; private link resource name 7972 Name *string `json:"name,omitempty"` 7973 // Type - READ-ONLY; private link resource type 7974 Type *string `json:"type,omitempty"` 7975} 7976 7977// MarshalJSON is the custom marshaler for PrivateLinkResource. 7978func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) { 7979 objectMap := make(map[string]interface{}) 7980 if plr.PrivateLinkResourceProperties != nil { 7981 objectMap["properties"] = plr.PrivateLinkResourceProperties 7982 } 7983 return json.Marshal(objectMap) 7984} 7985 7986// UnmarshalJSON is the custom unmarshaler for PrivateLinkResource struct. 7987func (plr *PrivateLinkResource) UnmarshalJSON(body []byte) error { 7988 var m map[string]*json.RawMessage 7989 err := json.Unmarshal(body, &m) 7990 if err != nil { 7991 return err 7992 } 7993 for k, v := range m { 7994 switch k { 7995 case "properties": 7996 if v != nil { 7997 var privateLinkResourceProperties PrivateLinkResourceProperties 7998 err = json.Unmarshal(*v, &privateLinkResourceProperties) 7999 if err != nil { 8000 return err 8001 } 8002 plr.PrivateLinkResourceProperties = &privateLinkResourceProperties 8003 } 8004 case "id": 8005 if v != nil { 8006 var ID string 8007 err = json.Unmarshal(*v, &ID) 8008 if err != nil { 8009 return err 8010 } 8011 plr.ID = &ID 8012 } 8013 case "name": 8014 if v != nil { 8015 var name string 8016 err = json.Unmarshal(*v, &name) 8017 if err != nil { 8018 return err 8019 } 8020 plr.Name = &name 8021 } 8022 case "type": 8023 if v != nil { 8024 var typeVar string 8025 err = json.Unmarshal(*v, &typeVar) 8026 if err != nil { 8027 return err 8028 } 8029 plr.Type = &typeVar 8030 } 8031 } 8032 } 8033 8034 return nil 8035} 8036 8037// PrivateLinkResourceListResult a list of private link resources 8038type PrivateLinkResourceListResult struct { 8039 autorest.Response `json:"-"` 8040 // Value - Array of private link resources 8041 Value *[]PrivateLinkResource `json:"value,omitempty"` 8042} 8043 8044// PrivateLinkResourceProperties properties of a private link resource. 8045type PrivateLinkResourceProperties struct { 8046 // GroupID - READ-ONLY; The private link resource group id. 8047 GroupID *string `json:"groupId,omitempty"` 8048 // RequiredMembers - READ-ONLY; The private link resource required member names. 8049 RequiredMembers *[]string `json:"requiredMembers,omitempty"` 8050 // RequiredZoneNames - The private link resource DNS zone name. 8051 RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` 8052} 8053 8054// MarshalJSON is the custom marshaler for PrivateLinkResourceProperties. 8055func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { 8056 objectMap := make(map[string]interface{}) 8057 if plrp.RequiredZoneNames != nil { 8058 objectMap["requiredZoneNames"] = plrp.RequiredZoneNames 8059 } 8060 return json.Marshal(objectMap) 8061} 8062 8063// PrivateLinkServiceConnectionState a collection of information about the state of the connection between 8064// service consumer and provider. 8065type PrivateLinkServiceConnectionState struct { 8066 // Status - Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: 'Pending', 'Approved', 'Rejected' 8067 Status PrivateEndpointServiceConnectionStatus `json:"status,omitempty"` 8068 // Description - The reason for approval/rejection of the connection. 8069 Description *string `json:"description,omitempty"` 8070 // ActionsRequired - A message indicating if changes on the service provider require any updates on the consumer. 8071 ActionsRequired *string `json:"actionsRequired,omitempty"` 8072} 8073 8074// ProximityPlacementGroup specifies information about the proximity placement group. 8075type ProximityPlacementGroup struct { 8076 autorest.Response `json:"-"` 8077 // ProximityPlacementGroupProperties - Describes the properties of a Proximity Placement Group. 8078 *ProximityPlacementGroupProperties `json:"properties,omitempty"` 8079 // ID - READ-ONLY; Resource Id 8080 ID *string `json:"id,omitempty"` 8081 // Name - READ-ONLY; Resource name 8082 Name *string `json:"name,omitempty"` 8083 // Type - READ-ONLY; Resource type 8084 Type *string `json:"type,omitempty"` 8085 // Location - Resource location 8086 Location *string `json:"location,omitempty"` 8087 // Tags - Resource tags 8088 Tags map[string]*string `json:"tags"` 8089} 8090 8091// MarshalJSON is the custom marshaler for ProximityPlacementGroup. 8092func (ppg ProximityPlacementGroup) MarshalJSON() ([]byte, error) { 8093 objectMap := make(map[string]interface{}) 8094 if ppg.ProximityPlacementGroupProperties != nil { 8095 objectMap["properties"] = ppg.ProximityPlacementGroupProperties 8096 } 8097 if ppg.Location != nil { 8098 objectMap["location"] = ppg.Location 8099 } 8100 if ppg.Tags != nil { 8101 objectMap["tags"] = ppg.Tags 8102 } 8103 return json.Marshal(objectMap) 8104} 8105 8106// UnmarshalJSON is the custom unmarshaler for ProximityPlacementGroup struct. 8107func (ppg *ProximityPlacementGroup) UnmarshalJSON(body []byte) error { 8108 var m map[string]*json.RawMessage 8109 err := json.Unmarshal(body, &m) 8110 if err != nil { 8111 return err 8112 } 8113 for k, v := range m { 8114 switch k { 8115 case "properties": 8116 if v != nil { 8117 var proximityPlacementGroupProperties ProximityPlacementGroupProperties 8118 err = json.Unmarshal(*v, &proximityPlacementGroupProperties) 8119 if err != nil { 8120 return err 8121 } 8122 ppg.ProximityPlacementGroupProperties = &proximityPlacementGroupProperties 8123 } 8124 case "id": 8125 if v != nil { 8126 var ID string 8127 err = json.Unmarshal(*v, &ID) 8128 if err != nil { 8129 return err 8130 } 8131 ppg.ID = &ID 8132 } 8133 case "name": 8134 if v != nil { 8135 var name string 8136 err = json.Unmarshal(*v, &name) 8137 if err != nil { 8138 return err 8139 } 8140 ppg.Name = &name 8141 } 8142 case "type": 8143 if v != nil { 8144 var typeVar string 8145 err = json.Unmarshal(*v, &typeVar) 8146 if err != nil { 8147 return err 8148 } 8149 ppg.Type = &typeVar 8150 } 8151 case "location": 8152 if v != nil { 8153 var location string 8154 err = json.Unmarshal(*v, &location) 8155 if err != nil { 8156 return err 8157 } 8158 ppg.Location = &location 8159 } 8160 case "tags": 8161 if v != nil { 8162 var tags map[string]*string 8163 err = json.Unmarshal(*v, &tags) 8164 if err != nil { 8165 return err 8166 } 8167 ppg.Tags = tags 8168 } 8169 } 8170 } 8171 8172 return nil 8173} 8174 8175// ProximityPlacementGroupListResult the List Proximity Placement Group operation response. 8176type ProximityPlacementGroupListResult struct { 8177 autorest.Response `json:"-"` 8178 // Value - The list of proximity placement groups 8179 Value *[]ProximityPlacementGroup `json:"value,omitempty"` 8180 // NextLink - The URI to fetch the next page of proximity placement groups. 8181 NextLink *string `json:"nextLink,omitempty"` 8182} 8183 8184// ProximityPlacementGroupListResultIterator provides access to a complete listing of 8185// ProximityPlacementGroup values. 8186type ProximityPlacementGroupListResultIterator struct { 8187 i int 8188 page ProximityPlacementGroupListResultPage 8189} 8190 8191// NextWithContext advances to the next value. If there was an error making 8192// the request the iterator does not advance and the error is returned. 8193func (iter *ProximityPlacementGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { 8194 if tracing.IsEnabled() { 8195 ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupListResultIterator.NextWithContext") 8196 defer func() { 8197 sc := -1 8198 if iter.Response().Response.Response != nil { 8199 sc = iter.Response().Response.Response.StatusCode 8200 } 8201 tracing.EndSpan(ctx, sc, err) 8202 }() 8203 } 8204 iter.i++ 8205 if iter.i < len(iter.page.Values()) { 8206 return nil 8207 } 8208 err = iter.page.NextWithContext(ctx) 8209 if err != nil { 8210 iter.i-- 8211 return err 8212 } 8213 iter.i = 0 8214 return nil 8215} 8216 8217// Next advances to the next value. If there was an error making 8218// the request the iterator does not advance and the error is returned. 8219// Deprecated: Use NextWithContext() instead. 8220func (iter *ProximityPlacementGroupListResultIterator) Next() error { 8221 return iter.NextWithContext(context.Background()) 8222} 8223 8224// NotDone returns true if the enumeration should be started or is not yet complete. 8225func (iter ProximityPlacementGroupListResultIterator) NotDone() bool { 8226 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8227} 8228 8229// Response returns the raw server response from the last page request. 8230func (iter ProximityPlacementGroupListResultIterator) Response() ProximityPlacementGroupListResult { 8231 return iter.page.Response() 8232} 8233 8234// Value returns the current value or a zero-initialized value if the 8235// iterator has advanced beyond the end of the collection. 8236func (iter ProximityPlacementGroupListResultIterator) Value() ProximityPlacementGroup { 8237 if !iter.page.NotDone() { 8238 return ProximityPlacementGroup{} 8239 } 8240 return iter.page.Values()[iter.i] 8241} 8242 8243// Creates a new instance of the ProximityPlacementGroupListResultIterator type. 8244func NewProximityPlacementGroupListResultIterator(page ProximityPlacementGroupListResultPage) ProximityPlacementGroupListResultIterator { 8245 return ProximityPlacementGroupListResultIterator{page: page} 8246} 8247 8248// IsEmpty returns true if the ListResult contains no values. 8249func (ppglr ProximityPlacementGroupListResult) IsEmpty() bool { 8250 return ppglr.Value == nil || len(*ppglr.Value) == 0 8251} 8252 8253// hasNextLink returns true if the NextLink is not empty. 8254func (ppglr ProximityPlacementGroupListResult) hasNextLink() bool { 8255 return ppglr.NextLink != nil && len(*ppglr.NextLink) != 0 8256} 8257 8258// proximityPlacementGroupListResultPreparer prepares a request to retrieve the next set of results. 8259// It returns nil if no more results exist. 8260func (ppglr ProximityPlacementGroupListResult) proximityPlacementGroupListResultPreparer(ctx context.Context) (*http.Request, error) { 8261 if !ppglr.hasNextLink() { 8262 return nil, nil 8263 } 8264 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8265 autorest.AsJSON(), 8266 autorest.AsGet(), 8267 autorest.WithBaseURL(to.String(ppglr.NextLink))) 8268} 8269 8270// ProximityPlacementGroupListResultPage contains a page of ProximityPlacementGroup values. 8271type ProximityPlacementGroupListResultPage struct { 8272 fn func(context.Context, ProximityPlacementGroupListResult) (ProximityPlacementGroupListResult, error) 8273 ppglr ProximityPlacementGroupListResult 8274} 8275 8276// NextWithContext advances to the next page of values. If there was an error making 8277// the request the page does not advance and the error is returned. 8278func (page *ProximityPlacementGroupListResultPage) NextWithContext(ctx context.Context) (err error) { 8279 if tracing.IsEnabled() { 8280 ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupListResultPage.NextWithContext") 8281 defer func() { 8282 sc := -1 8283 if page.Response().Response.Response != nil { 8284 sc = page.Response().Response.Response.StatusCode 8285 } 8286 tracing.EndSpan(ctx, sc, err) 8287 }() 8288 } 8289 for { 8290 next, err := page.fn(ctx, page.ppglr) 8291 if err != nil { 8292 return err 8293 } 8294 page.ppglr = next 8295 if !next.hasNextLink() || !next.IsEmpty() { 8296 break 8297 } 8298 } 8299 return nil 8300} 8301 8302// Next advances to the next page of values. If there was an error making 8303// the request the page does not advance and the error is returned. 8304// Deprecated: Use NextWithContext() instead. 8305func (page *ProximityPlacementGroupListResultPage) Next() error { 8306 return page.NextWithContext(context.Background()) 8307} 8308 8309// NotDone returns true if the page enumeration should be started or is not yet complete. 8310func (page ProximityPlacementGroupListResultPage) NotDone() bool { 8311 return !page.ppglr.IsEmpty() 8312} 8313 8314// Response returns the raw server response from the last page request. 8315func (page ProximityPlacementGroupListResultPage) Response() ProximityPlacementGroupListResult { 8316 return page.ppglr 8317} 8318 8319// Values returns the slice of values for the current page or nil if there are no values. 8320func (page ProximityPlacementGroupListResultPage) Values() []ProximityPlacementGroup { 8321 if page.ppglr.IsEmpty() { 8322 return nil 8323 } 8324 return *page.ppglr.Value 8325} 8326 8327// Creates a new instance of the ProximityPlacementGroupListResultPage type. 8328func NewProximityPlacementGroupListResultPage(cur ProximityPlacementGroupListResult, getNextPage func(context.Context, ProximityPlacementGroupListResult) (ProximityPlacementGroupListResult, error)) ProximityPlacementGroupListResultPage { 8329 return ProximityPlacementGroupListResultPage{ 8330 fn: getNextPage, 8331 ppglr: cur, 8332 } 8333} 8334 8335// ProximityPlacementGroupProperties describes the properties of a Proximity Placement Group. 8336type ProximityPlacementGroupProperties struct { 8337 // ProximityPlacementGroupType - Specifies the type of the proximity placement group. <br><br> Possible values are: <br><br> **Standard** : Co-locate resources within an Azure region or Availability Zone. <br><br> **Ultra** : For future use. Possible values include: 'Standard', 'Ultra' 8338 ProximityPlacementGroupType ProximityPlacementGroupType `json:"proximityPlacementGroupType,omitempty"` 8339 // VirtualMachines - READ-ONLY; A list of references to all virtual machines in the proximity placement group. 8340 VirtualMachines *[]SubResourceWithColocationStatus `json:"virtualMachines,omitempty"` 8341 // VirtualMachineScaleSets - READ-ONLY; A list of references to all virtual machine scale sets in the proximity placement group. 8342 VirtualMachineScaleSets *[]SubResourceWithColocationStatus `json:"virtualMachineScaleSets,omitempty"` 8343 // AvailabilitySets - READ-ONLY; A list of references to all availability sets in the proximity placement group. 8344 AvailabilitySets *[]SubResourceWithColocationStatus `json:"availabilitySets,omitempty"` 8345 // ColocationStatus - Describes colocation status of the Proximity Placement Group. 8346 ColocationStatus *InstanceViewStatus `json:"colocationStatus,omitempty"` 8347} 8348 8349// MarshalJSON is the custom marshaler for ProximityPlacementGroupProperties. 8350func (ppgp ProximityPlacementGroupProperties) MarshalJSON() ([]byte, error) { 8351 objectMap := make(map[string]interface{}) 8352 if ppgp.ProximityPlacementGroupType != "" { 8353 objectMap["proximityPlacementGroupType"] = ppgp.ProximityPlacementGroupType 8354 } 8355 if ppgp.ColocationStatus != nil { 8356 objectMap["colocationStatus"] = ppgp.ColocationStatus 8357 } 8358 return json.Marshal(objectMap) 8359} 8360 8361// ProximityPlacementGroupUpdate specifies information about the proximity placement group. 8362type ProximityPlacementGroupUpdate struct { 8363 // Tags - Resource tags 8364 Tags map[string]*string `json:"tags"` 8365} 8366 8367// MarshalJSON is the custom marshaler for ProximityPlacementGroupUpdate. 8368func (ppgu ProximityPlacementGroupUpdate) MarshalJSON() ([]byte, error) { 8369 objectMap := make(map[string]interface{}) 8370 if ppgu.Tags != nil { 8371 objectMap["tags"] = ppgu.Tags 8372 } 8373 return json.Marshal(objectMap) 8374} 8375 8376// PurchasePlan used for establishing the purchase context of any 3rd Party artifact through MarketPlace. 8377type PurchasePlan struct { 8378 // Publisher - The publisher ID. 8379 Publisher *string `json:"publisher,omitempty"` 8380 // Name - The plan ID. 8381 Name *string `json:"name,omitempty"` 8382 // Product - Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. 8383 Product *string `json:"product,omitempty"` 8384} 8385 8386// RecommendedMachineConfiguration the properties describe the recommended machine configuration for this 8387// Image Definition. These properties are updatable. 8388type RecommendedMachineConfiguration struct { 8389 VCPUs *ResourceRange `json:"vCPUs,omitempty"` 8390 Memory *ResourceRange `json:"memory,omitempty"` 8391} 8392 8393// RecoveryWalkResponse response after calling a manual recovery walk 8394type RecoveryWalkResponse struct { 8395 autorest.Response `json:"-"` 8396 // WalkPerformed - READ-ONLY; Whether the recovery walk was performed 8397 WalkPerformed *bool `json:"walkPerformed,omitempty"` 8398 // NextPlatformUpdateDomain - READ-ONLY; The next update domain that needs to be walked. Null means walk spanning all update domains has been completed 8399 NextPlatformUpdateDomain *int32 `json:"nextPlatformUpdateDomain,omitempty"` 8400} 8401 8402// MarshalJSON is the custom marshaler for RecoveryWalkResponse. 8403func (rwr RecoveryWalkResponse) MarshalJSON() ([]byte, error) { 8404 objectMap := make(map[string]interface{}) 8405 return json.Marshal(objectMap) 8406} 8407 8408// RegionalReplicationStatus this is the regional replication status. 8409type RegionalReplicationStatus struct { 8410 // Region - READ-ONLY; The region to which the gallery Image Version is being replicated to. 8411 Region *string `json:"region,omitempty"` 8412 // State - READ-ONLY; This is the regional replication state. Possible values include: 'ReplicationStateUnknown', 'ReplicationStateReplicating', 'ReplicationStateCompleted', 'ReplicationStateFailed' 8413 State ReplicationState `json:"state,omitempty"` 8414 // Details - READ-ONLY; The details of the replication status. 8415 Details *string `json:"details,omitempty"` 8416 // Progress - READ-ONLY; It indicates progress of the replication job. 8417 Progress *int32 `json:"progress,omitempty"` 8418} 8419 8420// MarshalJSON is the custom marshaler for RegionalReplicationStatus. 8421func (rrs RegionalReplicationStatus) MarshalJSON() ([]byte, error) { 8422 objectMap := make(map[string]interface{}) 8423 return json.Marshal(objectMap) 8424} 8425 8426// ReplicationStatus this is the replication status of the gallery Image Version. 8427type ReplicationStatus struct { 8428 // AggregatedState - READ-ONLY; This is the aggregated replication status based on all the regional replication status flags. Possible values include: 'Unknown', 'InProgress', 'Completed', 'Failed' 8429 AggregatedState AggregatedReplicationState `json:"aggregatedState,omitempty"` 8430 // Summary - READ-ONLY; This is a summary of replication status for each region. 8431 Summary *[]RegionalReplicationStatus `json:"summary,omitempty"` 8432} 8433 8434// MarshalJSON is the custom marshaler for ReplicationStatus. 8435func (rs ReplicationStatus) MarshalJSON() ([]byte, error) { 8436 objectMap := make(map[string]interface{}) 8437 return json.Marshal(objectMap) 8438} 8439 8440// RequestRateByIntervalInput api request input for LogAnalytics getRequestRateByInterval Api. 8441type RequestRateByIntervalInput struct { 8442 // IntervalLength - Interval value in minutes used to create LogAnalytics call rate logs. Possible values include: 'ThreeMins', 'FiveMins', 'ThirtyMins', 'SixtyMins' 8443 IntervalLength IntervalInMins `json:"intervalLength,omitempty"` 8444 // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. 8445 BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` 8446 // FromTime - From time of the query 8447 FromTime *date.Time `json:"fromTime,omitempty"` 8448 // ToTime - To time of the query 8449 ToTime *date.Time `json:"toTime,omitempty"` 8450 // GroupByThrottlePolicy - Group query result by Throttle Policy applied. 8451 GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` 8452 // GroupByOperationName - Group query result by Operation Name. 8453 GroupByOperationName *bool `json:"groupByOperationName,omitempty"` 8454 // GroupByResourceName - Group query result by Resource Name. 8455 GroupByResourceName *bool `json:"groupByResourceName,omitempty"` 8456} 8457 8458// Resource the Resource model definition. 8459type Resource struct { 8460 // ID - READ-ONLY; Resource Id 8461 ID *string `json:"id,omitempty"` 8462 // Name - READ-ONLY; Resource name 8463 Name *string `json:"name,omitempty"` 8464 // Type - READ-ONLY; Resource type 8465 Type *string `json:"type,omitempty"` 8466 // Location - Resource location 8467 Location *string `json:"location,omitempty"` 8468 // Tags - Resource tags 8469 Tags map[string]*string `json:"tags"` 8470} 8471 8472// MarshalJSON is the custom marshaler for Resource. 8473func (r Resource) MarshalJSON() ([]byte, error) { 8474 objectMap := make(map[string]interface{}) 8475 if r.Location != nil { 8476 objectMap["location"] = r.Location 8477 } 8478 if r.Tags != nil { 8479 objectMap["tags"] = r.Tags 8480 } 8481 return json.Marshal(objectMap) 8482} 8483 8484// ResourceRange describes the resource range. 8485type ResourceRange struct { 8486 // Min - The minimum number of the resource. 8487 Min *int32 `json:"min,omitempty"` 8488 // Max - The maximum number of the resource. 8489 Max *int32 `json:"max,omitempty"` 8490} 8491 8492// ResourceSku describes an available Compute SKU. 8493type ResourceSku struct { 8494 // ResourceType - READ-ONLY; The type of resource the SKU applies to. 8495 ResourceType *string `json:"resourceType,omitempty"` 8496 // Name - READ-ONLY; The name of SKU. 8497 Name *string `json:"name,omitempty"` 8498 // Tier - READ-ONLY; Specifies the tier of virtual machines in a scale set.<br /><br /> Possible Values:<br /><br /> **Standard**<br /><br /> **Basic** 8499 Tier *string `json:"tier,omitempty"` 8500 // Size - READ-ONLY; The Size of the SKU. 8501 Size *string `json:"size,omitempty"` 8502 // Family - READ-ONLY; The Family of this particular SKU. 8503 Family *string `json:"family,omitempty"` 8504 // Kind - READ-ONLY; The Kind of resources that are supported in this SKU. 8505 Kind *string `json:"kind,omitempty"` 8506 // Capacity - READ-ONLY; Specifies the number of virtual machines in the scale set. 8507 Capacity *ResourceSkuCapacity `json:"capacity,omitempty"` 8508 // Locations - READ-ONLY; The set of locations that the SKU is available. 8509 Locations *[]string `json:"locations,omitempty"` 8510 // LocationInfo - READ-ONLY; A list of locations and availability zones in those locations where the SKU is available. 8511 LocationInfo *[]ResourceSkuLocationInfo `json:"locationInfo,omitempty"` 8512 // APIVersions - READ-ONLY; The api versions that support this SKU. 8513 APIVersions *[]string `json:"apiVersions,omitempty"` 8514 // Costs - READ-ONLY; Metadata for retrieving price info. 8515 Costs *[]ResourceSkuCosts `json:"costs,omitempty"` 8516 // Capabilities - READ-ONLY; A name value pair to describe the capability. 8517 Capabilities *[]ResourceSkuCapabilities `json:"capabilities,omitempty"` 8518 // Restrictions - READ-ONLY; The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. 8519 Restrictions *[]ResourceSkuRestrictions `json:"restrictions,omitempty"` 8520} 8521 8522// MarshalJSON is the custom marshaler for ResourceSku. 8523func (rs ResourceSku) MarshalJSON() ([]byte, error) { 8524 objectMap := make(map[string]interface{}) 8525 return json.Marshal(objectMap) 8526} 8527 8528// ResourceSkuCapabilities describes The SKU capabilities object. 8529type ResourceSkuCapabilities struct { 8530 // Name - READ-ONLY; An invariant to describe the feature. 8531 Name *string `json:"name,omitempty"` 8532 // Value - READ-ONLY; An invariant if the feature is measured by quantity. 8533 Value *string `json:"value,omitempty"` 8534} 8535 8536// MarshalJSON is the custom marshaler for ResourceSkuCapabilities. 8537func (rsc ResourceSkuCapabilities) MarshalJSON() ([]byte, error) { 8538 objectMap := make(map[string]interface{}) 8539 return json.Marshal(objectMap) 8540} 8541 8542// ResourceSkuCapacity describes scaling information of a SKU. 8543type ResourceSkuCapacity struct { 8544 // Minimum - READ-ONLY; The minimum capacity. 8545 Minimum *int64 `json:"minimum,omitempty"` 8546 // Maximum - READ-ONLY; The maximum capacity that can be set. 8547 Maximum *int64 `json:"maximum,omitempty"` 8548 // Default - READ-ONLY; The default capacity. 8549 Default *int64 `json:"default,omitempty"` 8550 // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'ResourceSkuCapacityScaleTypeAutomatic', 'ResourceSkuCapacityScaleTypeManual', 'ResourceSkuCapacityScaleTypeNone' 8551 ScaleType ResourceSkuCapacityScaleType `json:"scaleType,omitempty"` 8552} 8553 8554// MarshalJSON is the custom marshaler for ResourceSkuCapacity. 8555func (rsc ResourceSkuCapacity) MarshalJSON() ([]byte, error) { 8556 objectMap := make(map[string]interface{}) 8557 return json.Marshal(objectMap) 8558} 8559 8560// ResourceSkuCosts describes metadata for retrieving price info. 8561type ResourceSkuCosts struct { 8562 // MeterID - READ-ONLY; Used for querying price from commerce. 8563 MeterID *string `json:"meterID,omitempty"` 8564 // Quantity - READ-ONLY; The multiplier is needed to extend the base metered cost. 8565 Quantity *int64 `json:"quantity,omitempty"` 8566 // ExtendedUnit - READ-ONLY; An invariant to show the extended unit. 8567 ExtendedUnit *string `json:"extendedUnit,omitempty"` 8568} 8569 8570// MarshalJSON is the custom marshaler for ResourceSkuCosts. 8571func (rsc ResourceSkuCosts) MarshalJSON() ([]byte, error) { 8572 objectMap := make(map[string]interface{}) 8573 return json.Marshal(objectMap) 8574} 8575 8576// ResourceSkuLocationInfo ... 8577type ResourceSkuLocationInfo struct { 8578 // Location - READ-ONLY; Location of the SKU 8579 Location *string `json:"location,omitempty"` 8580 // Zones - READ-ONLY; List of availability zones where the SKU is supported. 8581 Zones *[]string `json:"zones,omitempty"` 8582 // ZoneDetails - READ-ONLY; Details of capabilities available to a SKU in specific zones. 8583 ZoneDetails *[]ResourceSkuZoneDetails `json:"zoneDetails,omitempty"` 8584} 8585 8586// MarshalJSON is the custom marshaler for ResourceSkuLocationInfo. 8587func (rsli ResourceSkuLocationInfo) MarshalJSON() ([]byte, error) { 8588 objectMap := make(map[string]interface{}) 8589 return json.Marshal(objectMap) 8590} 8591 8592// ResourceSkuRestrictionInfo ... 8593type ResourceSkuRestrictionInfo struct { 8594 // Locations - READ-ONLY; Locations where the SKU is restricted 8595 Locations *[]string `json:"locations,omitempty"` 8596 // Zones - READ-ONLY; List of availability zones where the SKU is restricted. 8597 Zones *[]string `json:"zones,omitempty"` 8598} 8599 8600// MarshalJSON is the custom marshaler for ResourceSkuRestrictionInfo. 8601func (rsri ResourceSkuRestrictionInfo) MarshalJSON() ([]byte, error) { 8602 objectMap := make(map[string]interface{}) 8603 return json.Marshal(objectMap) 8604} 8605 8606// ResourceSkuRestrictions describes scaling information of a SKU. 8607type ResourceSkuRestrictions struct { 8608 // Type - READ-ONLY; The type of restrictions. Possible values include: 'Location', 'Zone' 8609 Type ResourceSkuRestrictionsType `json:"type,omitempty"` 8610 // 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. 8611 Values *[]string `json:"values,omitempty"` 8612 // RestrictionInfo - READ-ONLY; The information about the restriction where the SKU cannot be used. 8613 RestrictionInfo *ResourceSkuRestrictionInfo `json:"restrictionInfo,omitempty"` 8614 // ReasonCode - READ-ONLY; The reason for restriction. Possible values include: 'QuotaID', 'NotAvailableForSubscription' 8615 ReasonCode ResourceSkuRestrictionsReasonCode `json:"reasonCode,omitempty"` 8616} 8617 8618// MarshalJSON is the custom marshaler for ResourceSkuRestrictions. 8619func (rsr ResourceSkuRestrictions) MarshalJSON() ([]byte, error) { 8620 objectMap := make(map[string]interface{}) 8621 return json.Marshal(objectMap) 8622} 8623 8624// ResourceSkusResult the List Resource Skus operation response. 8625type ResourceSkusResult struct { 8626 autorest.Response `json:"-"` 8627 // Value - The list of skus available for the subscription. 8628 Value *[]ResourceSku `json:"value,omitempty"` 8629 // NextLink - The URI to fetch the next page of Resource Skus. Call ListNext() with this URI to fetch the next page of Resource Skus 8630 NextLink *string `json:"nextLink,omitempty"` 8631} 8632 8633// ResourceSkusResultIterator provides access to a complete listing of ResourceSku values. 8634type ResourceSkusResultIterator struct { 8635 i int 8636 page ResourceSkusResultPage 8637} 8638 8639// NextWithContext advances to the next value. If there was an error making 8640// the request the iterator does not advance and the error is returned. 8641func (iter *ResourceSkusResultIterator) NextWithContext(ctx context.Context) (err error) { 8642 if tracing.IsEnabled() { 8643 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusResultIterator.NextWithContext") 8644 defer func() { 8645 sc := -1 8646 if iter.Response().Response.Response != nil { 8647 sc = iter.Response().Response.Response.StatusCode 8648 } 8649 tracing.EndSpan(ctx, sc, err) 8650 }() 8651 } 8652 iter.i++ 8653 if iter.i < len(iter.page.Values()) { 8654 return nil 8655 } 8656 err = iter.page.NextWithContext(ctx) 8657 if err != nil { 8658 iter.i-- 8659 return err 8660 } 8661 iter.i = 0 8662 return nil 8663} 8664 8665// Next advances to the next value. If there was an error making 8666// the request the iterator does not advance and the error is returned. 8667// Deprecated: Use NextWithContext() instead. 8668func (iter *ResourceSkusResultIterator) Next() error { 8669 return iter.NextWithContext(context.Background()) 8670} 8671 8672// NotDone returns true if the enumeration should be started or is not yet complete. 8673func (iter ResourceSkusResultIterator) NotDone() bool { 8674 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8675} 8676 8677// Response returns the raw server response from the last page request. 8678func (iter ResourceSkusResultIterator) Response() ResourceSkusResult { 8679 return iter.page.Response() 8680} 8681 8682// Value returns the current value or a zero-initialized value if the 8683// iterator has advanced beyond the end of the collection. 8684func (iter ResourceSkusResultIterator) Value() ResourceSku { 8685 if !iter.page.NotDone() { 8686 return ResourceSku{} 8687 } 8688 return iter.page.Values()[iter.i] 8689} 8690 8691// Creates a new instance of the ResourceSkusResultIterator type. 8692func NewResourceSkusResultIterator(page ResourceSkusResultPage) ResourceSkusResultIterator { 8693 return ResourceSkusResultIterator{page: page} 8694} 8695 8696// IsEmpty returns true if the ListResult contains no values. 8697func (rsr ResourceSkusResult) IsEmpty() bool { 8698 return rsr.Value == nil || len(*rsr.Value) == 0 8699} 8700 8701// hasNextLink returns true if the NextLink is not empty. 8702func (rsr ResourceSkusResult) hasNextLink() bool { 8703 return rsr.NextLink != nil && len(*rsr.NextLink) != 0 8704} 8705 8706// resourceSkusResultPreparer prepares a request to retrieve the next set of results. 8707// It returns nil if no more results exist. 8708func (rsr ResourceSkusResult) resourceSkusResultPreparer(ctx context.Context) (*http.Request, error) { 8709 if !rsr.hasNextLink() { 8710 return nil, nil 8711 } 8712 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8713 autorest.AsJSON(), 8714 autorest.AsGet(), 8715 autorest.WithBaseURL(to.String(rsr.NextLink))) 8716} 8717 8718// ResourceSkusResultPage contains a page of ResourceSku values. 8719type ResourceSkusResultPage struct { 8720 fn func(context.Context, ResourceSkusResult) (ResourceSkusResult, error) 8721 rsr ResourceSkusResult 8722} 8723 8724// NextWithContext advances to the next page of values. If there was an error making 8725// the request the page does not advance and the error is returned. 8726func (page *ResourceSkusResultPage) NextWithContext(ctx context.Context) (err error) { 8727 if tracing.IsEnabled() { 8728 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusResultPage.NextWithContext") 8729 defer func() { 8730 sc := -1 8731 if page.Response().Response.Response != nil { 8732 sc = page.Response().Response.Response.StatusCode 8733 } 8734 tracing.EndSpan(ctx, sc, err) 8735 }() 8736 } 8737 for { 8738 next, err := page.fn(ctx, page.rsr) 8739 if err != nil { 8740 return err 8741 } 8742 page.rsr = next 8743 if !next.hasNextLink() || !next.IsEmpty() { 8744 break 8745 } 8746 } 8747 return nil 8748} 8749 8750// Next advances to the next page of values. If there was an error making 8751// the request the page does not advance and the error is returned. 8752// Deprecated: Use NextWithContext() instead. 8753func (page *ResourceSkusResultPage) Next() error { 8754 return page.NextWithContext(context.Background()) 8755} 8756 8757// NotDone returns true if the page enumeration should be started or is not yet complete. 8758func (page ResourceSkusResultPage) NotDone() bool { 8759 return !page.rsr.IsEmpty() 8760} 8761 8762// Response returns the raw server response from the last page request. 8763func (page ResourceSkusResultPage) Response() ResourceSkusResult { 8764 return page.rsr 8765} 8766 8767// Values returns the slice of values for the current page or nil if there are no values. 8768func (page ResourceSkusResultPage) Values() []ResourceSku { 8769 if page.rsr.IsEmpty() { 8770 return nil 8771 } 8772 return *page.rsr.Value 8773} 8774 8775// Creates a new instance of the ResourceSkusResultPage type. 8776func NewResourceSkusResultPage(cur ResourceSkusResult, getNextPage func(context.Context, ResourceSkusResult) (ResourceSkusResult, error)) ResourceSkusResultPage { 8777 return ResourceSkusResultPage{ 8778 fn: getNextPage, 8779 rsr: cur, 8780 } 8781} 8782 8783// ResourceSkuZoneDetails describes The zonal capabilities of a SKU. 8784type ResourceSkuZoneDetails struct { 8785 // Name - READ-ONLY; The set of zones that the SKU is available in with the specified capabilities. 8786 Name *[]string `json:"name,omitempty"` 8787 // Capabilities - READ-ONLY; A list of capabilities that are available for the SKU in the specified list of zones. 8788 Capabilities *[]ResourceSkuCapabilities `json:"capabilities,omitempty"` 8789} 8790 8791// MarshalJSON is the custom marshaler for ResourceSkuZoneDetails. 8792func (rszd ResourceSkuZoneDetails) MarshalJSON() ([]byte, error) { 8793 objectMap := make(map[string]interface{}) 8794 return json.Marshal(objectMap) 8795} 8796 8797// ResourceURIList the List resources which are encrypted with the disk encryption set. 8798type ResourceURIList struct { 8799 autorest.Response `json:"-"` 8800 // Value - A list of IDs or Owner IDs of resources which are encrypted with the disk encryption set. 8801 Value *[]string `json:"value,omitempty"` 8802 // NextLink - The uri to fetch the next page of encrypted resources. Call ListNext() with this to fetch the next page of encrypted resources. 8803 NextLink *string `json:"nextLink,omitempty"` 8804} 8805 8806// ResourceURIListIterator provides access to a complete listing of string values. 8807type ResourceURIListIterator struct { 8808 i int 8809 page ResourceURIListPage 8810} 8811 8812// NextWithContext advances to the next value. If there was an error making 8813// the request the iterator does not advance and the error is returned. 8814func (iter *ResourceURIListIterator) NextWithContext(ctx context.Context) (err error) { 8815 if tracing.IsEnabled() { 8816 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceURIListIterator.NextWithContext") 8817 defer func() { 8818 sc := -1 8819 if iter.Response().Response.Response != nil { 8820 sc = iter.Response().Response.Response.StatusCode 8821 } 8822 tracing.EndSpan(ctx, sc, err) 8823 }() 8824 } 8825 iter.i++ 8826 if iter.i < len(iter.page.Values()) { 8827 return nil 8828 } 8829 err = iter.page.NextWithContext(ctx) 8830 if err != nil { 8831 iter.i-- 8832 return err 8833 } 8834 iter.i = 0 8835 return nil 8836} 8837 8838// Next advances to the next value. If there was an error making 8839// the request the iterator does not advance and the error is returned. 8840// Deprecated: Use NextWithContext() instead. 8841func (iter *ResourceURIListIterator) Next() error { 8842 return iter.NextWithContext(context.Background()) 8843} 8844 8845// NotDone returns true if the enumeration should be started or is not yet complete. 8846func (iter ResourceURIListIterator) NotDone() bool { 8847 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8848} 8849 8850// Response returns the raw server response from the last page request. 8851func (iter ResourceURIListIterator) Response() ResourceURIList { 8852 return iter.page.Response() 8853} 8854 8855// Value returns the current value or a zero-initialized value if the 8856// iterator has advanced beyond the end of the collection. 8857func (iter ResourceURIListIterator) Value() string { 8858 if !iter.page.NotDone() { 8859 return "" 8860 } 8861 return iter.page.Values()[iter.i] 8862} 8863 8864// Creates a new instance of the ResourceURIListIterator type. 8865func NewResourceURIListIterator(page ResourceURIListPage) ResourceURIListIterator { 8866 return ResourceURIListIterator{page: page} 8867} 8868 8869// IsEmpty returns true if the ListResult contains no values. 8870func (rul ResourceURIList) IsEmpty() bool { 8871 return rul.Value == nil || len(*rul.Value) == 0 8872} 8873 8874// hasNextLink returns true if the NextLink is not empty. 8875func (rul ResourceURIList) hasNextLink() bool { 8876 return rul.NextLink != nil && len(*rul.NextLink) != 0 8877} 8878 8879// resourceURIListPreparer prepares a request to retrieve the next set of results. 8880// It returns nil if no more results exist. 8881func (rul ResourceURIList) resourceURIListPreparer(ctx context.Context) (*http.Request, error) { 8882 if !rul.hasNextLink() { 8883 return nil, nil 8884 } 8885 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8886 autorest.AsJSON(), 8887 autorest.AsGet(), 8888 autorest.WithBaseURL(to.String(rul.NextLink))) 8889} 8890 8891// ResourceURIListPage contains a page of string values. 8892type ResourceURIListPage struct { 8893 fn func(context.Context, ResourceURIList) (ResourceURIList, error) 8894 rul ResourceURIList 8895} 8896 8897// NextWithContext advances to the next page of values. If there was an error making 8898// the request the page does not advance and the error is returned. 8899func (page *ResourceURIListPage) NextWithContext(ctx context.Context) (err error) { 8900 if tracing.IsEnabled() { 8901 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceURIListPage.NextWithContext") 8902 defer func() { 8903 sc := -1 8904 if page.Response().Response.Response != nil { 8905 sc = page.Response().Response.Response.StatusCode 8906 } 8907 tracing.EndSpan(ctx, sc, err) 8908 }() 8909 } 8910 for { 8911 next, err := page.fn(ctx, page.rul) 8912 if err != nil { 8913 return err 8914 } 8915 page.rul = next 8916 if !next.hasNextLink() || !next.IsEmpty() { 8917 break 8918 } 8919 } 8920 return nil 8921} 8922 8923// Next advances to the next page of values. If there was an error making 8924// the request the page does not advance and the error is returned. 8925// Deprecated: Use NextWithContext() instead. 8926func (page *ResourceURIListPage) Next() error { 8927 return page.NextWithContext(context.Background()) 8928} 8929 8930// NotDone returns true if the page enumeration should be started or is not yet complete. 8931func (page ResourceURIListPage) NotDone() bool { 8932 return !page.rul.IsEmpty() 8933} 8934 8935// Response returns the raw server response from the last page request. 8936func (page ResourceURIListPage) Response() ResourceURIList { 8937 return page.rul 8938} 8939 8940// Values returns the slice of values for the current page or nil if there are no values. 8941func (page ResourceURIListPage) Values() []string { 8942 if page.rul.IsEmpty() { 8943 return nil 8944 } 8945 return *page.rul.Value 8946} 8947 8948// Creates a new instance of the ResourceURIListPage type. 8949func NewResourceURIListPage(cur ResourceURIList, getNextPage func(context.Context, ResourceURIList) (ResourceURIList, error)) ResourceURIListPage { 8950 return ResourceURIListPage{ 8951 fn: getNextPage, 8952 rul: cur, 8953 } 8954} 8955 8956// RetrieveBootDiagnosticsDataResult the SAS URIs of the console screenshot and serial log blobs. 8957type RetrieveBootDiagnosticsDataResult struct { 8958 autorest.Response `json:"-"` 8959 // ConsoleScreenshotBlobURI - READ-ONLY; The console screenshot blob URI 8960 ConsoleScreenshotBlobURI *string `json:"consoleScreenshotBlobUri,omitempty"` 8961 // SerialConsoleLogBlobURI - READ-ONLY; The serial console log blob URI. 8962 SerialConsoleLogBlobURI *string `json:"serialConsoleLogBlobUri,omitempty"` 8963} 8964 8965// MarshalJSON is the custom marshaler for RetrieveBootDiagnosticsDataResult. 8966func (rbddr RetrieveBootDiagnosticsDataResult) MarshalJSON() ([]byte, error) { 8967 objectMap := make(map[string]interface{}) 8968 return json.Marshal(objectMap) 8969} 8970 8971// RollbackStatusInfo information about rollback on failed VM instances after a OS Upgrade operation. 8972type RollbackStatusInfo struct { 8973 // SuccessfullyRolledbackInstanceCount - READ-ONLY; The number of instances which have been successfully rolled back. 8974 SuccessfullyRolledbackInstanceCount *int32 `json:"successfullyRolledbackInstanceCount,omitempty"` 8975 // FailedRolledbackInstanceCount - READ-ONLY; The number of instances which failed to rollback. 8976 FailedRolledbackInstanceCount *int32 `json:"failedRolledbackInstanceCount,omitempty"` 8977 // RollbackError - READ-ONLY; Error details if OS rollback failed. 8978 RollbackError *APIError `json:"rollbackError,omitempty"` 8979} 8980 8981// MarshalJSON is the custom marshaler for RollbackStatusInfo. 8982func (rsi RollbackStatusInfo) MarshalJSON() ([]byte, error) { 8983 objectMap := make(map[string]interface{}) 8984 return json.Marshal(objectMap) 8985} 8986 8987// RollingUpgradePolicy the configuration parameters used while performing a rolling upgrade. 8988type RollingUpgradePolicy struct { 8989 // 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%. 8990 MaxBatchInstancePercent *int32 `json:"maxBatchInstancePercent,omitempty"` 8991 // 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%. 8992 MaxUnhealthyInstancePercent *int32 `json:"maxUnhealthyInstancePercent,omitempty"` 8993 // 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%. 8994 MaxUnhealthyUpgradedInstancePercent *int32 `json:"maxUnhealthyUpgradedInstancePercent,omitempty"` 8995 // 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). 8996 PauseTimeBetweenBatches *string `json:"pauseTimeBetweenBatches,omitempty"` 8997} 8998 8999// RollingUpgradeProgressInfo information about the number of virtual machine instances in each upgrade 9000// state. 9001type RollingUpgradeProgressInfo struct { 9002 // SuccessfulInstanceCount - READ-ONLY; The number of instances that have been successfully upgraded. 9003 SuccessfulInstanceCount *int32 `json:"successfulInstanceCount,omitempty"` 9004 // FailedInstanceCount - READ-ONLY; The number of instances that have failed to be upgraded successfully. 9005 FailedInstanceCount *int32 `json:"failedInstanceCount,omitempty"` 9006 // InProgressInstanceCount - READ-ONLY; The number of instances that are currently being upgraded. 9007 InProgressInstanceCount *int32 `json:"inProgressInstanceCount,omitempty"` 9008 // PendingInstanceCount - READ-ONLY; The number of instances that have not yet begun to be upgraded. 9009 PendingInstanceCount *int32 `json:"pendingInstanceCount,omitempty"` 9010} 9011 9012// MarshalJSON is the custom marshaler for RollingUpgradeProgressInfo. 9013func (rupi RollingUpgradeProgressInfo) MarshalJSON() ([]byte, error) { 9014 objectMap := make(map[string]interface{}) 9015 return json.Marshal(objectMap) 9016} 9017 9018// RollingUpgradeRunningStatus information about the current running state of the overall upgrade. 9019type RollingUpgradeRunningStatus struct { 9020 // Code - READ-ONLY; Code indicating the current status of the upgrade. Possible values include: 'RollingUpgradeStatusCodeRollingForward', 'RollingUpgradeStatusCodeCancelled', 'RollingUpgradeStatusCodeCompleted', 'RollingUpgradeStatusCodeFaulted' 9021 Code RollingUpgradeStatusCode `json:"code,omitempty"` 9022 // StartTime - READ-ONLY; Start time of the upgrade. 9023 StartTime *date.Time `json:"startTime,omitempty"` 9024 // LastAction - READ-ONLY; The last action performed on the rolling upgrade. Possible values include: 'Start', 'Cancel' 9025 LastAction RollingUpgradeActionType `json:"lastAction,omitempty"` 9026 // LastActionTime - READ-ONLY; Last action time of the upgrade. 9027 LastActionTime *date.Time `json:"lastActionTime,omitempty"` 9028} 9029 9030// MarshalJSON is the custom marshaler for RollingUpgradeRunningStatus. 9031func (rurs RollingUpgradeRunningStatus) MarshalJSON() ([]byte, error) { 9032 objectMap := make(map[string]interface{}) 9033 return json.Marshal(objectMap) 9034} 9035 9036// RollingUpgradeStatusInfo the status of the latest virtual machine scale set rolling upgrade. 9037type RollingUpgradeStatusInfo struct { 9038 autorest.Response `json:"-"` 9039 *RollingUpgradeStatusInfoProperties `json:"properties,omitempty"` 9040 // ID - READ-ONLY; Resource Id 9041 ID *string `json:"id,omitempty"` 9042 // Name - READ-ONLY; Resource name 9043 Name *string `json:"name,omitempty"` 9044 // Type - READ-ONLY; Resource type 9045 Type *string `json:"type,omitempty"` 9046 // Location - Resource location 9047 Location *string `json:"location,omitempty"` 9048 // Tags - Resource tags 9049 Tags map[string]*string `json:"tags"` 9050} 9051 9052// MarshalJSON is the custom marshaler for RollingUpgradeStatusInfo. 9053func (rusi RollingUpgradeStatusInfo) MarshalJSON() ([]byte, error) { 9054 objectMap := make(map[string]interface{}) 9055 if rusi.RollingUpgradeStatusInfoProperties != nil { 9056 objectMap["properties"] = rusi.RollingUpgradeStatusInfoProperties 9057 } 9058 if rusi.Location != nil { 9059 objectMap["location"] = rusi.Location 9060 } 9061 if rusi.Tags != nil { 9062 objectMap["tags"] = rusi.Tags 9063 } 9064 return json.Marshal(objectMap) 9065} 9066 9067// UnmarshalJSON is the custom unmarshaler for RollingUpgradeStatusInfo struct. 9068func (rusi *RollingUpgradeStatusInfo) UnmarshalJSON(body []byte) error { 9069 var m map[string]*json.RawMessage 9070 err := json.Unmarshal(body, &m) 9071 if err != nil { 9072 return err 9073 } 9074 for k, v := range m { 9075 switch k { 9076 case "properties": 9077 if v != nil { 9078 var rollingUpgradeStatusInfoProperties RollingUpgradeStatusInfoProperties 9079 err = json.Unmarshal(*v, &rollingUpgradeStatusInfoProperties) 9080 if err != nil { 9081 return err 9082 } 9083 rusi.RollingUpgradeStatusInfoProperties = &rollingUpgradeStatusInfoProperties 9084 } 9085 case "id": 9086 if v != nil { 9087 var ID string 9088 err = json.Unmarshal(*v, &ID) 9089 if err != nil { 9090 return err 9091 } 9092 rusi.ID = &ID 9093 } 9094 case "name": 9095 if v != nil { 9096 var name string 9097 err = json.Unmarshal(*v, &name) 9098 if err != nil { 9099 return err 9100 } 9101 rusi.Name = &name 9102 } 9103 case "type": 9104 if v != nil { 9105 var typeVar string 9106 err = json.Unmarshal(*v, &typeVar) 9107 if err != nil { 9108 return err 9109 } 9110 rusi.Type = &typeVar 9111 } 9112 case "location": 9113 if v != nil { 9114 var location string 9115 err = json.Unmarshal(*v, &location) 9116 if err != nil { 9117 return err 9118 } 9119 rusi.Location = &location 9120 } 9121 case "tags": 9122 if v != nil { 9123 var tags map[string]*string 9124 err = json.Unmarshal(*v, &tags) 9125 if err != nil { 9126 return err 9127 } 9128 rusi.Tags = tags 9129 } 9130 } 9131 } 9132 9133 return nil 9134} 9135 9136// RollingUpgradeStatusInfoProperties the status of the latest virtual machine scale set rolling upgrade. 9137type RollingUpgradeStatusInfoProperties struct { 9138 // Policy - READ-ONLY; The rolling upgrade policies applied for this upgrade. 9139 Policy *RollingUpgradePolicy `json:"policy,omitempty"` 9140 // RunningStatus - READ-ONLY; Information about the current running state of the overall upgrade. 9141 RunningStatus *RollingUpgradeRunningStatus `json:"runningStatus,omitempty"` 9142 // Progress - READ-ONLY; Information about the number of virtual machine instances in each upgrade state. 9143 Progress *RollingUpgradeProgressInfo `json:"progress,omitempty"` 9144 // Error - READ-ONLY; Error details for this upgrade, if there are any. 9145 Error *APIError `json:"error,omitempty"` 9146} 9147 9148// MarshalJSON is the custom marshaler for RollingUpgradeStatusInfoProperties. 9149func (rusip RollingUpgradeStatusInfoProperties) MarshalJSON() ([]byte, error) { 9150 objectMap := make(map[string]interface{}) 9151 return json.Marshal(objectMap) 9152} 9153 9154// RunCommandDocument describes the properties of a Run Command. 9155type RunCommandDocument struct { 9156 autorest.Response `json:"-"` 9157 // Script - The script to be executed. 9158 Script *[]string `json:"script,omitempty"` 9159 // Parameters - The parameters used by the script. 9160 Parameters *[]RunCommandParameterDefinition `json:"parameters,omitempty"` 9161 // Schema - The VM run command schema. 9162 Schema *string `json:"$schema,omitempty"` 9163 // ID - The VM run command id. 9164 ID *string `json:"id,omitempty"` 9165 // OsType - The Operating System type. Possible values include: 'Windows', 'Linux' 9166 OsType OperatingSystemTypes `json:"osType,omitempty"` 9167 // Label - The VM run command label. 9168 Label *string `json:"label,omitempty"` 9169 // Description - The VM run command description. 9170 Description *string `json:"description,omitempty"` 9171} 9172 9173// RunCommandDocumentBase describes the properties of a Run Command metadata. 9174type RunCommandDocumentBase struct { 9175 // Schema - The VM run command schema. 9176 Schema *string `json:"$schema,omitempty"` 9177 // ID - The VM run command id. 9178 ID *string `json:"id,omitempty"` 9179 // OsType - The Operating System type. Possible values include: 'Windows', 'Linux' 9180 OsType OperatingSystemTypes `json:"osType,omitempty"` 9181 // Label - The VM run command label. 9182 Label *string `json:"label,omitempty"` 9183 // Description - The VM run command description. 9184 Description *string `json:"description,omitempty"` 9185} 9186 9187// RunCommandInput capture Virtual Machine parameters. 9188type RunCommandInput struct { 9189 // CommandID - The run command id. 9190 CommandID *string `json:"commandId,omitempty"` 9191 // Script - Optional. The script to be executed. When this value is given, the given script will override the default script of the command. 9192 Script *[]string `json:"script,omitempty"` 9193 // Parameters - The run command parameters. 9194 Parameters *[]RunCommandInputParameter `json:"parameters,omitempty"` 9195} 9196 9197// RunCommandInputParameter describes the properties of a run command parameter. 9198type RunCommandInputParameter struct { 9199 // Name - The run command parameter name. 9200 Name *string `json:"name,omitempty"` 9201 // Value - The run command parameter value. 9202 Value *string `json:"value,omitempty"` 9203} 9204 9205// RunCommandListResult the List Virtual Machine operation response. 9206type RunCommandListResult struct { 9207 autorest.Response `json:"-"` 9208 // Value - The list of virtual machine run commands. 9209 Value *[]RunCommandDocumentBase `json:"value,omitempty"` 9210 // NextLink - The uri to fetch the next page of run commands. Call ListNext() with this to fetch the next page of run commands. 9211 NextLink *string `json:"nextLink,omitempty"` 9212} 9213 9214// RunCommandListResultIterator provides access to a complete listing of RunCommandDocumentBase values. 9215type RunCommandListResultIterator struct { 9216 i int 9217 page RunCommandListResultPage 9218} 9219 9220// NextWithContext advances to the next value. If there was an error making 9221// the request the iterator does not advance and the error is returned. 9222func (iter *RunCommandListResultIterator) NextWithContext(ctx context.Context) (err error) { 9223 if tracing.IsEnabled() { 9224 ctx = tracing.StartSpan(ctx, fqdn+"/RunCommandListResultIterator.NextWithContext") 9225 defer func() { 9226 sc := -1 9227 if iter.Response().Response.Response != nil { 9228 sc = iter.Response().Response.Response.StatusCode 9229 } 9230 tracing.EndSpan(ctx, sc, err) 9231 }() 9232 } 9233 iter.i++ 9234 if iter.i < len(iter.page.Values()) { 9235 return nil 9236 } 9237 err = iter.page.NextWithContext(ctx) 9238 if err != nil { 9239 iter.i-- 9240 return err 9241 } 9242 iter.i = 0 9243 return nil 9244} 9245 9246// Next advances to the next value. If there was an error making 9247// the request the iterator does not advance and the error is returned. 9248// Deprecated: Use NextWithContext() instead. 9249func (iter *RunCommandListResultIterator) Next() error { 9250 return iter.NextWithContext(context.Background()) 9251} 9252 9253// NotDone returns true if the enumeration should be started or is not yet complete. 9254func (iter RunCommandListResultIterator) NotDone() bool { 9255 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9256} 9257 9258// Response returns the raw server response from the last page request. 9259func (iter RunCommandListResultIterator) Response() RunCommandListResult { 9260 return iter.page.Response() 9261} 9262 9263// Value returns the current value or a zero-initialized value if the 9264// iterator has advanced beyond the end of the collection. 9265func (iter RunCommandListResultIterator) Value() RunCommandDocumentBase { 9266 if !iter.page.NotDone() { 9267 return RunCommandDocumentBase{} 9268 } 9269 return iter.page.Values()[iter.i] 9270} 9271 9272// Creates a new instance of the RunCommandListResultIterator type. 9273func NewRunCommandListResultIterator(page RunCommandListResultPage) RunCommandListResultIterator { 9274 return RunCommandListResultIterator{page: page} 9275} 9276 9277// IsEmpty returns true if the ListResult contains no values. 9278func (rclr RunCommandListResult) IsEmpty() bool { 9279 return rclr.Value == nil || len(*rclr.Value) == 0 9280} 9281 9282// hasNextLink returns true if the NextLink is not empty. 9283func (rclr RunCommandListResult) hasNextLink() bool { 9284 return rclr.NextLink != nil && len(*rclr.NextLink) != 0 9285} 9286 9287// runCommandListResultPreparer prepares a request to retrieve the next set of results. 9288// It returns nil if no more results exist. 9289func (rclr RunCommandListResult) runCommandListResultPreparer(ctx context.Context) (*http.Request, error) { 9290 if !rclr.hasNextLink() { 9291 return nil, nil 9292 } 9293 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9294 autorest.AsJSON(), 9295 autorest.AsGet(), 9296 autorest.WithBaseURL(to.String(rclr.NextLink))) 9297} 9298 9299// RunCommandListResultPage contains a page of RunCommandDocumentBase values. 9300type RunCommandListResultPage struct { 9301 fn func(context.Context, RunCommandListResult) (RunCommandListResult, error) 9302 rclr RunCommandListResult 9303} 9304 9305// NextWithContext advances to the next page of values. If there was an error making 9306// the request the page does not advance and the error is returned. 9307func (page *RunCommandListResultPage) NextWithContext(ctx context.Context) (err error) { 9308 if tracing.IsEnabled() { 9309 ctx = tracing.StartSpan(ctx, fqdn+"/RunCommandListResultPage.NextWithContext") 9310 defer func() { 9311 sc := -1 9312 if page.Response().Response.Response != nil { 9313 sc = page.Response().Response.Response.StatusCode 9314 } 9315 tracing.EndSpan(ctx, sc, err) 9316 }() 9317 } 9318 for { 9319 next, err := page.fn(ctx, page.rclr) 9320 if err != nil { 9321 return err 9322 } 9323 page.rclr = next 9324 if !next.hasNextLink() || !next.IsEmpty() { 9325 break 9326 } 9327 } 9328 return nil 9329} 9330 9331// Next advances to the next page of values. If there was an error making 9332// the request the page does not advance and the error is returned. 9333// Deprecated: Use NextWithContext() instead. 9334func (page *RunCommandListResultPage) Next() error { 9335 return page.NextWithContext(context.Background()) 9336} 9337 9338// NotDone returns true if the page enumeration should be started or is not yet complete. 9339func (page RunCommandListResultPage) NotDone() bool { 9340 return !page.rclr.IsEmpty() 9341} 9342 9343// Response returns the raw server response from the last page request. 9344func (page RunCommandListResultPage) Response() RunCommandListResult { 9345 return page.rclr 9346} 9347 9348// Values returns the slice of values for the current page or nil if there are no values. 9349func (page RunCommandListResultPage) Values() []RunCommandDocumentBase { 9350 if page.rclr.IsEmpty() { 9351 return nil 9352 } 9353 return *page.rclr.Value 9354} 9355 9356// Creates a new instance of the RunCommandListResultPage type. 9357func NewRunCommandListResultPage(cur RunCommandListResult, getNextPage func(context.Context, RunCommandListResult) (RunCommandListResult, error)) RunCommandListResultPage { 9358 return RunCommandListResultPage{ 9359 fn: getNextPage, 9360 rclr: cur, 9361 } 9362} 9363 9364// RunCommandParameterDefinition describes the properties of a run command parameter. 9365type RunCommandParameterDefinition struct { 9366 // Name - The run command parameter name. 9367 Name *string `json:"name,omitempty"` 9368 // Type - The run command parameter type. 9369 Type *string `json:"type,omitempty"` 9370 // DefaultValue - The run command parameter default value. 9371 DefaultValue *string `json:"defaultValue,omitempty"` 9372 // Required - The run command parameter required. 9373 Required *bool `json:"required,omitempty"` 9374} 9375 9376// RunCommandResult ... 9377type RunCommandResult struct { 9378 autorest.Response `json:"-"` 9379 // Value - Run command operation response. 9380 Value *[]InstanceViewStatus `json:"value,omitempty"` 9381} 9382 9383// ScaleInPolicy describes a scale-in policy for a virtual machine scale set. 9384type ScaleInPolicy struct { 9385 // 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> 9386 Rules *[]VirtualMachineScaleSetScaleInRules `json:"rules,omitempty"` 9387} 9388 9389// ScheduledEventsProfile ... 9390type ScheduledEventsProfile struct { 9391 // TerminateNotificationProfile - Specifies Terminate Scheduled Event related configurations. 9392 TerminateNotificationProfile *TerminateNotificationProfile `json:"terminateNotificationProfile,omitempty"` 9393} 9394 9395// SecurityProfile specifies the Security profile settings for the virtual machine or virtual machine scale 9396// set. 9397type SecurityProfile struct { 9398 // 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. 9399 EncryptionAtHost *bool `json:"encryptionAtHost,omitempty"` 9400} 9401 9402// ShareInfoElement ... 9403type ShareInfoElement struct { 9404 // VMURI - READ-ONLY; A relative URI containing the ID of the VM that has the disk attached. 9405 VMURI *string `json:"vmUri,omitempty"` 9406} 9407 9408// MarshalJSON is the custom marshaler for ShareInfoElement. 9409func (sie ShareInfoElement) MarshalJSON() ([]byte, error) { 9410 objectMap := make(map[string]interface{}) 9411 return json.Marshal(objectMap) 9412} 9413 9414// Sku describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware 9415// the scale set is currently on, you need to deallocate the VMs in the scale set before you modify the SKU 9416// name. 9417type Sku struct { 9418 // Name - The sku name. 9419 Name *string `json:"name,omitempty"` 9420 // Tier - Specifies the tier of virtual machines in a scale set.<br /><br /> Possible Values:<br /><br /> **Standard**<br /><br /> **Basic** 9421 Tier *string `json:"tier,omitempty"` 9422 // Capacity - Specifies the number of virtual machines in the scale set. 9423 Capacity *int64 `json:"capacity,omitempty"` 9424} 9425 9426// Snapshot snapshot resource. 9427type Snapshot struct { 9428 autorest.Response `json:"-"` 9429 // ManagedBy - READ-ONLY; Unused. Always Null. 9430 ManagedBy *string `json:"managedBy,omitempty"` 9431 Sku *SnapshotSku `json:"sku,omitempty"` 9432 *SnapshotProperties `json:"properties,omitempty"` 9433 // ID - READ-ONLY; Resource Id 9434 ID *string `json:"id,omitempty"` 9435 // Name - READ-ONLY; Resource name 9436 Name *string `json:"name,omitempty"` 9437 // Type - READ-ONLY; Resource type 9438 Type *string `json:"type,omitempty"` 9439 // Location - Resource location 9440 Location *string `json:"location,omitempty"` 9441 // Tags - Resource tags 9442 Tags map[string]*string `json:"tags"` 9443} 9444 9445// MarshalJSON is the custom marshaler for Snapshot. 9446func (s Snapshot) MarshalJSON() ([]byte, error) { 9447 objectMap := make(map[string]interface{}) 9448 if s.Sku != nil { 9449 objectMap["sku"] = s.Sku 9450 } 9451 if s.SnapshotProperties != nil { 9452 objectMap["properties"] = s.SnapshotProperties 9453 } 9454 if s.Location != nil { 9455 objectMap["location"] = s.Location 9456 } 9457 if s.Tags != nil { 9458 objectMap["tags"] = s.Tags 9459 } 9460 return json.Marshal(objectMap) 9461} 9462 9463// UnmarshalJSON is the custom unmarshaler for Snapshot struct. 9464func (s *Snapshot) UnmarshalJSON(body []byte) error { 9465 var m map[string]*json.RawMessage 9466 err := json.Unmarshal(body, &m) 9467 if err != nil { 9468 return err 9469 } 9470 for k, v := range m { 9471 switch k { 9472 case "managedBy": 9473 if v != nil { 9474 var managedBy string 9475 err = json.Unmarshal(*v, &managedBy) 9476 if err != nil { 9477 return err 9478 } 9479 s.ManagedBy = &managedBy 9480 } 9481 case "sku": 9482 if v != nil { 9483 var sku SnapshotSku 9484 err = json.Unmarshal(*v, &sku) 9485 if err != nil { 9486 return err 9487 } 9488 s.Sku = &sku 9489 } 9490 case "properties": 9491 if v != nil { 9492 var snapshotProperties SnapshotProperties 9493 err = json.Unmarshal(*v, &snapshotProperties) 9494 if err != nil { 9495 return err 9496 } 9497 s.SnapshotProperties = &snapshotProperties 9498 } 9499 case "id": 9500 if v != nil { 9501 var ID string 9502 err = json.Unmarshal(*v, &ID) 9503 if err != nil { 9504 return err 9505 } 9506 s.ID = &ID 9507 } 9508 case "name": 9509 if v != nil { 9510 var name string 9511 err = json.Unmarshal(*v, &name) 9512 if err != nil { 9513 return err 9514 } 9515 s.Name = &name 9516 } 9517 case "type": 9518 if v != nil { 9519 var typeVar string 9520 err = json.Unmarshal(*v, &typeVar) 9521 if err != nil { 9522 return err 9523 } 9524 s.Type = &typeVar 9525 } 9526 case "location": 9527 if v != nil { 9528 var location string 9529 err = json.Unmarshal(*v, &location) 9530 if err != nil { 9531 return err 9532 } 9533 s.Location = &location 9534 } 9535 case "tags": 9536 if v != nil { 9537 var tags map[string]*string 9538 err = json.Unmarshal(*v, &tags) 9539 if err != nil { 9540 return err 9541 } 9542 s.Tags = tags 9543 } 9544 } 9545 } 9546 9547 return nil 9548} 9549 9550// SnapshotList the List Snapshots operation response. 9551type SnapshotList struct { 9552 autorest.Response `json:"-"` 9553 // Value - A list of snapshots. 9554 Value *[]Snapshot `json:"value,omitempty"` 9555 // NextLink - The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the next page of snapshots. 9556 NextLink *string `json:"nextLink,omitempty"` 9557} 9558 9559// SnapshotListIterator provides access to a complete listing of Snapshot values. 9560type SnapshotListIterator struct { 9561 i int 9562 page SnapshotListPage 9563} 9564 9565// NextWithContext advances to the next value. If there was an error making 9566// the request the iterator does not advance and the error is returned. 9567func (iter *SnapshotListIterator) NextWithContext(ctx context.Context) (err error) { 9568 if tracing.IsEnabled() { 9569 ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotListIterator.NextWithContext") 9570 defer func() { 9571 sc := -1 9572 if iter.Response().Response.Response != nil { 9573 sc = iter.Response().Response.Response.StatusCode 9574 } 9575 tracing.EndSpan(ctx, sc, err) 9576 }() 9577 } 9578 iter.i++ 9579 if iter.i < len(iter.page.Values()) { 9580 return nil 9581 } 9582 err = iter.page.NextWithContext(ctx) 9583 if err != nil { 9584 iter.i-- 9585 return err 9586 } 9587 iter.i = 0 9588 return nil 9589} 9590 9591// Next advances to the next value. If there was an error making 9592// the request the iterator does not advance and the error is returned. 9593// Deprecated: Use NextWithContext() instead. 9594func (iter *SnapshotListIterator) Next() error { 9595 return iter.NextWithContext(context.Background()) 9596} 9597 9598// NotDone returns true if the enumeration should be started or is not yet complete. 9599func (iter SnapshotListIterator) NotDone() bool { 9600 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9601} 9602 9603// Response returns the raw server response from the last page request. 9604func (iter SnapshotListIterator) Response() SnapshotList { 9605 return iter.page.Response() 9606} 9607 9608// Value returns the current value or a zero-initialized value if the 9609// iterator has advanced beyond the end of the collection. 9610func (iter SnapshotListIterator) Value() Snapshot { 9611 if !iter.page.NotDone() { 9612 return Snapshot{} 9613 } 9614 return iter.page.Values()[iter.i] 9615} 9616 9617// Creates a new instance of the SnapshotListIterator type. 9618func NewSnapshotListIterator(page SnapshotListPage) SnapshotListIterator { 9619 return SnapshotListIterator{page: page} 9620} 9621 9622// IsEmpty returns true if the ListResult contains no values. 9623func (sl SnapshotList) IsEmpty() bool { 9624 return sl.Value == nil || len(*sl.Value) == 0 9625} 9626 9627// hasNextLink returns true if the NextLink is not empty. 9628func (sl SnapshotList) hasNextLink() bool { 9629 return sl.NextLink != nil && len(*sl.NextLink) != 0 9630} 9631 9632// snapshotListPreparer prepares a request to retrieve the next set of results. 9633// It returns nil if no more results exist. 9634func (sl SnapshotList) snapshotListPreparer(ctx context.Context) (*http.Request, error) { 9635 if !sl.hasNextLink() { 9636 return nil, nil 9637 } 9638 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9639 autorest.AsJSON(), 9640 autorest.AsGet(), 9641 autorest.WithBaseURL(to.String(sl.NextLink))) 9642} 9643 9644// SnapshotListPage contains a page of Snapshot values. 9645type SnapshotListPage struct { 9646 fn func(context.Context, SnapshotList) (SnapshotList, error) 9647 sl SnapshotList 9648} 9649 9650// NextWithContext advances to the next page of values. If there was an error making 9651// the request the page does not advance and the error is returned. 9652func (page *SnapshotListPage) NextWithContext(ctx context.Context) (err error) { 9653 if tracing.IsEnabled() { 9654 ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotListPage.NextWithContext") 9655 defer func() { 9656 sc := -1 9657 if page.Response().Response.Response != nil { 9658 sc = page.Response().Response.Response.StatusCode 9659 } 9660 tracing.EndSpan(ctx, sc, err) 9661 }() 9662 } 9663 for { 9664 next, err := page.fn(ctx, page.sl) 9665 if err != nil { 9666 return err 9667 } 9668 page.sl = next 9669 if !next.hasNextLink() || !next.IsEmpty() { 9670 break 9671 } 9672 } 9673 return nil 9674} 9675 9676// Next advances to the next page of values. If there was an error making 9677// the request the page does not advance and the error is returned. 9678// Deprecated: Use NextWithContext() instead. 9679func (page *SnapshotListPage) Next() error { 9680 return page.NextWithContext(context.Background()) 9681} 9682 9683// NotDone returns true if the page enumeration should be started or is not yet complete. 9684func (page SnapshotListPage) NotDone() bool { 9685 return !page.sl.IsEmpty() 9686} 9687 9688// Response returns the raw server response from the last page request. 9689func (page SnapshotListPage) Response() SnapshotList { 9690 return page.sl 9691} 9692 9693// Values returns the slice of values for the current page or nil if there are no values. 9694func (page SnapshotListPage) Values() []Snapshot { 9695 if page.sl.IsEmpty() { 9696 return nil 9697 } 9698 return *page.sl.Value 9699} 9700 9701// Creates a new instance of the SnapshotListPage type. 9702func NewSnapshotListPage(cur SnapshotList, getNextPage func(context.Context, SnapshotList) (SnapshotList, error)) SnapshotListPage { 9703 return SnapshotListPage{ 9704 fn: getNextPage, 9705 sl: cur, 9706 } 9707} 9708 9709// SnapshotProperties snapshot resource properties. 9710type SnapshotProperties struct { 9711 // TimeCreated - READ-ONLY; The time when the snapshot was created. 9712 TimeCreated *date.Time `json:"timeCreated,omitempty"` 9713 // OsType - The Operating System type. Possible values include: 'Windows', 'Linux' 9714 OsType OperatingSystemTypes `json:"osType,omitempty"` 9715 // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'V1', 'V2' 9716 HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` 9717 // CreationData - Disk source information. CreationData information cannot be changed after the disk has been created. 9718 CreationData *CreationData `json:"creationData,omitempty"` 9719 // 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. 9720 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 9721 // DiskSizeBytes - READ-ONLY; The size of the disk in bytes. This field is read only. 9722 DiskSizeBytes *int64 `json:"diskSizeBytes,omitempty"` 9723 // DiskState - The state of the snapshot. Possible values include: 'Unattached', 'Attached', 'Reserved', 'ActiveSAS', 'ReadyToUpload', 'ActiveUpload' 9724 DiskState DiskState `json:"diskState,omitempty"` 9725 // UniqueID - READ-ONLY; Unique Guid identifying the resource. 9726 UniqueID *string `json:"uniqueId,omitempty"` 9727 // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. 9728 EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` 9729 // ProvisioningState - READ-ONLY; The disk provisioning state. 9730 ProvisioningState *string `json:"provisioningState,omitempty"` 9731 // Incremental - Whether a snapshot is incremental. Incremental snapshots on the same disk occupy less space than full snapshots and can be diffed. 9732 Incremental *bool `json:"incremental,omitempty"` 9733 // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 9734 Encryption *Encryption `json:"encryption,omitempty"` 9735 // NetworkAccessPolicy - Possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll' 9736 NetworkAccessPolicy NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` 9737 // DiskAccessID - ARM id of the DiskAccess resource for using private endpoints on disks. 9738 DiskAccessID *string `json:"diskAccessId,omitempty"` 9739} 9740 9741// MarshalJSON is the custom marshaler for SnapshotProperties. 9742func (sp SnapshotProperties) MarshalJSON() ([]byte, error) { 9743 objectMap := make(map[string]interface{}) 9744 if sp.OsType != "" { 9745 objectMap["osType"] = sp.OsType 9746 } 9747 if sp.HyperVGeneration != "" { 9748 objectMap["hyperVGeneration"] = sp.HyperVGeneration 9749 } 9750 if sp.CreationData != nil { 9751 objectMap["creationData"] = sp.CreationData 9752 } 9753 if sp.DiskSizeGB != nil { 9754 objectMap["diskSizeGB"] = sp.DiskSizeGB 9755 } 9756 if sp.DiskState != "" { 9757 objectMap["diskState"] = sp.DiskState 9758 } 9759 if sp.EncryptionSettingsCollection != nil { 9760 objectMap["encryptionSettingsCollection"] = sp.EncryptionSettingsCollection 9761 } 9762 if sp.Incremental != nil { 9763 objectMap["incremental"] = sp.Incremental 9764 } 9765 if sp.Encryption != nil { 9766 objectMap["encryption"] = sp.Encryption 9767 } 9768 if sp.NetworkAccessPolicy != "" { 9769 objectMap["networkAccessPolicy"] = sp.NetworkAccessPolicy 9770 } 9771 if sp.DiskAccessID != nil { 9772 objectMap["diskAccessId"] = sp.DiskAccessID 9773 } 9774 return json.Marshal(objectMap) 9775} 9776 9777// SnapshotsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 9778// operation. 9779type SnapshotsCreateOrUpdateFuture struct { 9780 azure.FutureAPI 9781 // Result returns the result of the asynchronous operation. 9782 // If the operation has not completed it will return an error. 9783 Result func(SnapshotsClient) (Snapshot, error) 9784} 9785 9786// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9787func (future *SnapshotsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 9788 var azFuture azure.Future 9789 if err := json.Unmarshal(body, &azFuture); err != nil { 9790 return err 9791 } 9792 future.FutureAPI = &azFuture 9793 future.Result = future.result 9794 return nil 9795} 9796 9797// result is the default implementation for SnapshotsCreateOrUpdateFuture.Result. 9798func (future *SnapshotsCreateOrUpdateFuture) result(client SnapshotsClient) (s Snapshot, err error) { 9799 var done bool 9800 done, err = future.DoneWithContext(context.Background(), client) 9801 if err != nil { 9802 err = autorest.NewErrorWithError(err, "compute.SnapshotsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 9803 return 9804 } 9805 if !done { 9806 s.Response.Response = future.Response() 9807 err = azure.NewAsyncOpIncompleteError("compute.SnapshotsCreateOrUpdateFuture") 9808 return 9809 } 9810 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9811 if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { 9812 s, err = client.CreateOrUpdateResponder(s.Response.Response) 9813 if err != nil { 9814 err = autorest.NewErrorWithError(err, "compute.SnapshotsCreateOrUpdateFuture", "Result", s.Response.Response, "Failure responding to request") 9815 } 9816 } 9817 return 9818} 9819 9820// SnapshotsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 9821// operation. 9822type SnapshotsDeleteFuture struct { 9823 azure.FutureAPI 9824 // Result returns the result of the asynchronous operation. 9825 // If the operation has not completed it will return an error. 9826 Result func(SnapshotsClient) (autorest.Response, error) 9827} 9828 9829// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9830func (future *SnapshotsDeleteFuture) UnmarshalJSON(body []byte) error { 9831 var azFuture azure.Future 9832 if err := json.Unmarshal(body, &azFuture); err != nil { 9833 return err 9834 } 9835 future.FutureAPI = &azFuture 9836 future.Result = future.result 9837 return nil 9838} 9839 9840// result is the default implementation for SnapshotsDeleteFuture.Result. 9841func (future *SnapshotsDeleteFuture) result(client SnapshotsClient) (ar autorest.Response, err error) { 9842 var done bool 9843 done, err = future.DoneWithContext(context.Background(), client) 9844 if err != nil { 9845 err = autorest.NewErrorWithError(err, "compute.SnapshotsDeleteFuture", "Result", future.Response(), "Polling failure") 9846 return 9847 } 9848 if !done { 9849 ar.Response = future.Response() 9850 err = azure.NewAsyncOpIncompleteError("compute.SnapshotsDeleteFuture") 9851 return 9852 } 9853 ar.Response = future.Response() 9854 return 9855} 9856 9857// SnapshotsGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running 9858// operation. 9859type SnapshotsGrantAccessFuture struct { 9860 azure.FutureAPI 9861 // Result returns the result of the asynchronous operation. 9862 // If the operation has not completed it will return an error. 9863 Result func(SnapshotsClient) (AccessURI, error) 9864} 9865 9866// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9867func (future *SnapshotsGrantAccessFuture) UnmarshalJSON(body []byte) error { 9868 var azFuture azure.Future 9869 if err := json.Unmarshal(body, &azFuture); err != nil { 9870 return err 9871 } 9872 future.FutureAPI = &azFuture 9873 future.Result = future.result 9874 return nil 9875} 9876 9877// result is the default implementation for SnapshotsGrantAccessFuture.Result. 9878func (future *SnapshotsGrantAccessFuture) result(client SnapshotsClient) (au AccessURI, err error) { 9879 var done bool 9880 done, err = future.DoneWithContext(context.Background(), client) 9881 if err != nil { 9882 err = autorest.NewErrorWithError(err, "compute.SnapshotsGrantAccessFuture", "Result", future.Response(), "Polling failure") 9883 return 9884 } 9885 if !done { 9886 au.Response.Response = future.Response() 9887 err = azure.NewAsyncOpIncompleteError("compute.SnapshotsGrantAccessFuture") 9888 return 9889 } 9890 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9891 if au.Response.Response, err = future.GetResult(sender); err == nil && au.Response.Response.StatusCode != http.StatusNoContent { 9892 au, err = client.GrantAccessResponder(au.Response.Response) 9893 if err != nil { 9894 err = autorest.NewErrorWithError(err, "compute.SnapshotsGrantAccessFuture", "Result", au.Response.Response, "Failure responding to request") 9895 } 9896 } 9897 return 9898} 9899 9900// SnapshotSku the snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. 9901type SnapshotSku struct { 9902 // Name - The sku name. Possible values include: 'SnapshotStorageAccountTypesStandardLRS', 'SnapshotStorageAccountTypesPremiumLRS', 'SnapshotStorageAccountTypesStandardZRS' 9903 Name SnapshotStorageAccountTypes `json:"name,omitempty"` 9904 // Tier - READ-ONLY; The sku tier. 9905 Tier *string `json:"tier,omitempty"` 9906} 9907 9908// MarshalJSON is the custom marshaler for SnapshotSku. 9909func (ss SnapshotSku) MarshalJSON() ([]byte, error) { 9910 objectMap := make(map[string]interface{}) 9911 if ss.Name != "" { 9912 objectMap["name"] = ss.Name 9913 } 9914 return json.Marshal(objectMap) 9915} 9916 9917// SnapshotsRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running 9918// operation. 9919type SnapshotsRevokeAccessFuture struct { 9920 azure.FutureAPI 9921 // Result returns the result of the asynchronous operation. 9922 // If the operation has not completed it will return an error. 9923 Result func(SnapshotsClient) (autorest.Response, error) 9924} 9925 9926// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9927func (future *SnapshotsRevokeAccessFuture) UnmarshalJSON(body []byte) error { 9928 var azFuture azure.Future 9929 if err := json.Unmarshal(body, &azFuture); err != nil { 9930 return err 9931 } 9932 future.FutureAPI = &azFuture 9933 future.Result = future.result 9934 return nil 9935} 9936 9937// result is the default implementation for SnapshotsRevokeAccessFuture.Result. 9938func (future *SnapshotsRevokeAccessFuture) result(client SnapshotsClient) (ar autorest.Response, err error) { 9939 var done bool 9940 done, err = future.DoneWithContext(context.Background(), client) 9941 if err != nil { 9942 err = autorest.NewErrorWithError(err, "compute.SnapshotsRevokeAccessFuture", "Result", future.Response(), "Polling failure") 9943 return 9944 } 9945 if !done { 9946 ar.Response = future.Response() 9947 err = azure.NewAsyncOpIncompleteError("compute.SnapshotsRevokeAccessFuture") 9948 return 9949 } 9950 ar.Response = future.Response() 9951 return 9952} 9953 9954// SnapshotsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 9955// operation. 9956type SnapshotsUpdateFuture struct { 9957 azure.FutureAPI 9958 // Result returns the result of the asynchronous operation. 9959 // If the operation has not completed it will return an error. 9960 Result func(SnapshotsClient) (Snapshot, error) 9961} 9962 9963// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9964func (future *SnapshotsUpdateFuture) UnmarshalJSON(body []byte) error { 9965 var azFuture azure.Future 9966 if err := json.Unmarshal(body, &azFuture); err != nil { 9967 return err 9968 } 9969 future.FutureAPI = &azFuture 9970 future.Result = future.result 9971 return nil 9972} 9973 9974// result is the default implementation for SnapshotsUpdateFuture.Result. 9975func (future *SnapshotsUpdateFuture) result(client SnapshotsClient) (s Snapshot, err error) { 9976 var done bool 9977 done, err = future.DoneWithContext(context.Background(), client) 9978 if err != nil { 9979 err = autorest.NewErrorWithError(err, "compute.SnapshotsUpdateFuture", "Result", future.Response(), "Polling failure") 9980 return 9981 } 9982 if !done { 9983 s.Response.Response = future.Response() 9984 err = azure.NewAsyncOpIncompleteError("compute.SnapshotsUpdateFuture") 9985 return 9986 } 9987 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9988 if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { 9989 s, err = client.UpdateResponder(s.Response.Response) 9990 if err != nil { 9991 err = autorest.NewErrorWithError(err, "compute.SnapshotsUpdateFuture", "Result", s.Response.Response, "Failure responding to request") 9992 } 9993 } 9994 return 9995} 9996 9997// SnapshotUpdate snapshot update resource. 9998type SnapshotUpdate struct { 9999 *SnapshotUpdateProperties `json:"properties,omitempty"` 10000 // Tags - Resource tags 10001 Tags map[string]*string `json:"tags"` 10002 Sku *SnapshotSku `json:"sku,omitempty"` 10003} 10004 10005// MarshalJSON is the custom marshaler for SnapshotUpdate. 10006func (su SnapshotUpdate) MarshalJSON() ([]byte, error) { 10007 objectMap := make(map[string]interface{}) 10008 if su.SnapshotUpdateProperties != nil { 10009 objectMap["properties"] = su.SnapshotUpdateProperties 10010 } 10011 if su.Tags != nil { 10012 objectMap["tags"] = su.Tags 10013 } 10014 if su.Sku != nil { 10015 objectMap["sku"] = su.Sku 10016 } 10017 return json.Marshal(objectMap) 10018} 10019 10020// UnmarshalJSON is the custom unmarshaler for SnapshotUpdate struct. 10021func (su *SnapshotUpdate) UnmarshalJSON(body []byte) error { 10022 var m map[string]*json.RawMessage 10023 err := json.Unmarshal(body, &m) 10024 if err != nil { 10025 return err 10026 } 10027 for k, v := range m { 10028 switch k { 10029 case "properties": 10030 if v != nil { 10031 var snapshotUpdateProperties SnapshotUpdateProperties 10032 err = json.Unmarshal(*v, &snapshotUpdateProperties) 10033 if err != nil { 10034 return err 10035 } 10036 su.SnapshotUpdateProperties = &snapshotUpdateProperties 10037 } 10038 case "tags": 10039 if v != nil { 10040 var tags map[string]*string 10041 err = json.Unmarshal(*v, &tags) 10042 if err != nil { 10043 return err 10044 } 10045 su.Tags = tags 10046 } 10047 case "sku": 10048 if v != nil { 10049 var sku SnapshotSku 10050 err = json.Unmarshal(*v, &sku) 10051 if err != nil { 10052 return err 10053 } 10054 su.Sku = &sku 10055 } 10056 } 10057 } 10058 10059 return nil 10060} 10061 10062// SnapshotUpdateProperties snapshot resource update properties. 10063type SnapshotUpdateProperties struct { 10064 // OsType - the Operating System type. Possible values include: 'Windows', 'Linux' 10065 OsType OperatingSystemTypes `json:"osType,omitempty"` 10066 // 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. 10067 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 10068 // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. 10069 EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` 10070 // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 10071 Encryption *Encryption `json:"encryption,omitempty"` 10072 // NetworkAccessPolicy - Possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll' 10073 NetworkAccessPolicy NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` 10074 // DiskAccessID - ARM id of the DiskAccess resource for using private endpoints on disks. 10075 DiskAccessID *string `json:"diskAccessId,omitempty"` 10076} 10077 10078// SourceVault the vault id is an Azure Resource Manager Resource id in the form 10079// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName} 10080type SourceVault struct { 10081 // ID - Resource Id 10082 ID *string `json:"id,omitempty"` 10083} 10084 10085// SSHConfiguration SSH configuration for Linux based VMs running on Azure 10086type SSHConfiguration struct { 10087 // PublicKeys - The list of SSH public keys used to authenticate with linux based VMs. 10088 PublicKeys *[]SSHPublicKey `json:"publicKeys,omitempty"` 10089} 10090 10091// SSHPublicKey contains information about SSH certificate public key and the path on the Linux VM where 10092// the public key is placed. 10093type SSHPublicKey struct { 10094 // 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 10095 Path *string `json:"path,omitempty"` 10096 // KeyData - SSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit and in ssh-rsa format. <br><br> For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). 10097 KeyData *string `json:"keyData,omitempty"` 10098} 10099 10100// SSHPublicKeyGenerateKeyPairResult response from generation of an SSH key pair. 10101type SSHPublicKeyGenerateKeyPairResult struct { 10102 autorest.Response `json:"-"` 10103 // 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. 10104 PrivateKey *string `json:"privateKey,omitempty"` 10105 // 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. 10106 PublicKey *string `json:"publicKey,omitempty"` 10107 // ID - The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{SshPublicKeyName} 10108 ID *string `json:"id,omitempty"` 10109} 10110 10111// SSHPublicKeyResource specifies information about the SSH public key. 10112type SSHPublicKeyResource struct { 10113 autorest.Response `json:"-"` 10114 // SSHPublicKeyResourceProperties - Properties of the SSH public key. 10115 *SSHPublicKeyResourceProperties `json:"properties,omitempty"` 10116 // ID - READ-ONLY; Resource Id 10117 ID *string `json:"id,omitempty"` 10118 // Name - READ-ONLY; Resource name 10119 Name *string `json:"name,omitempty"` 10120 // Type - READ-ONLY; Resource type 10121 Type *string `json:"type,omitempty"` 10122 // Location - Resource location 10123 Location *string `json:"location,omitempty"` 10124 // Tags - Resource tags 10125 Tags map[string]*string `json:"tags"` 10126} 10127 10128// MarshalJSON is the custom marshaler for SSHPublicKeyResource. 10129func (spkr SSHPublicKeyResource) MarshalJSON() ([]byte, error) { 10130 objectMap := make(map[string]interface{}) 10131 if spkr.SSHPublicKeyResourceProperties != nil { 10132 objectMap["properties"] = spkr.SSHPublicKeyResourceProperties 10133 } 10134 if spkr.Location != nil { 10135 objectMap["location"] = spkr.Location 10136 } 10137 if spkr.Tags != nil { 10138 objectMap["tags"] = spkr.Tags 10139 } 10140 return json.Marshal(objectMap) 10141} 10142 10143// UnmarshalJSON is the custom unmarshaler for SSHPublicKeyResource struct. 10144func (spkr *SSHPublicKeyResource) UnmarshalJSON(body []byte) error { 10145 var m map[string]*json.RawMessage 10146 err := json.Unmarshal(body, &m) 10147 if err != nil { 10148 return err 10149 } 10150 for k, v := range m { 10151 switch k { 10152 case "properties": 10153 if v != nil { 10154 var SSHPublicKeyResourceProperties SSHPublicKeyResourceProperties 10155 err = json.Unmarshal(*v, &SSHPublicKeyResourceProperties) 10156 if err != nil { 10157 return err 10158 } 10159 spkr.SSHPublicKeyResourceProperties = &SSHPublicKeyResourceProperties 10160 } 10161 case "id": 10162 if v != nil { 10163 var ID string 10164 err = json.Unmarshal(*v, &ID) 10165 if err != nil { 10166 return err 10167 } 10168 spkr.ID = &ID 10169 } 10170 case "name": 10171 if v != nil { 10172 var name string 10173 err = json.Unmarshal(*v, &name) 10174 if err != nil { 10175 return err 10176 } 10177 spkr.Name = &name 10178 } 10179 case "type": 10180 if v != nil { 10181 var typeVar string 10182 err = json.Unmarshal(*v, &typeVar) 10183 if err != nil { 10184 return err 10185 } 10186 spkr.Type = &typeVar 10187 } 10188 case "location": 10189 if v != nil { 10190 var location string 10191 err = json.Unmarshal(*v, &location) 10192 if err != nil { 10193 return err 10194 } 10195 spkr.Location = &location 10196 } 10197 case "tags": 10198 if v != nil { 10199 var tags map[string]*string 10200 err = json.Unmarshal(*v, &tags) 10201 if err != nil { 10202 return err 10203 } 10204 spkr.Tags = tags 10205 } 10206 } 10207 } 10208 10209 return nil 10210} 10211 10212// SSHPublicKeyResourceProperties properties of the SSH public key. 10213type SSHPublicKeyResourceProperties struct { 10214 // 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. 10215 PublicKey *string `json:"publicKey,omitempty"` 10216} 10217 10218// SSHPublicKeysGroupListResult the list SSH public keys operation response. 10219type SSHPublicKeysGroupListResult struct { 10220 autorest.Response `json:"-"` 10221 // Value - The list of SSH public keys 10222 Value *[]SSHPublicKeyResource `json:"value,omitempty"` 10223 // 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. 10224 NextLink *string `json:"nextLink,omitempty"` 10225} 10226 10227// SSHPublicKeysGroupListResultIterator provides access to a complete listing of SSHPublicKeyResource 10228// values. 10229type SSHPublicKeysGroupListResultIterator struct { 10230 i int 10231 page SSHPublicKeysGroupListResultPage 10232} 10233 10234// NextWithContext advances to the next value. If there was an error making 10235// the request the iterator does not advance and the error is returned. 10236func (iter *SSHPublicKeysGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { 10237 if tracing.IsEnabled() { 10238 ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysGroupListResultIterator.NextWithContext") 10239 defer func() { 10240 sc := -1 10241 if iter.Response().Response.Response != nil { 10242 sc = iter.Response().Response.Response.StatusCode 10243 } 10244 tracing.EndSpan(ctx, sc, err) 10245 }() 10246 } 10247 iter.i++ 10248 if iter.i < len(iter.page.Values()) { 10249 return nil 10250 } 10251 err = iter.page.NextWithContext(ctx) 10252 if err != nil { 10253 iter.i-- 10254 return err 10255 } 10256 iter.i = 0 10257 return nil 10258} 10259 10260// Next advances to the next value. If there was an error making 10261// the request the iterator does not advance and the error is returned. 10262// Deprecated: Use NextWithContext() instead. 10263func (iter *SSHPublicKeysGroupListResultIterator) Next() error { 10264 return iter.NextWithContext(context.Background()) 10265} 10266 10267// NotDone returns true if the enumeration should be started or is not yet complete. 10268func (iter SSHPublicKeysGroupListResultIterator) NotDone() bool { 10269 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10270} 10271 10272// Response returns the raw server response from the last page request. 10273func (iter SSHPublicKeysGroupListResultIterator) Response() SSHPublicKeysGroupListResult { 10274 return iter.page.Response() 10275} 10276 10277// Value returns the current value or a zero-initialized value if the 10278// iterator has advanced beyond the end of the collection. 10279func (iter SSHPublicKeysGroupListResultIterator) Value() SSHPublicKeyResource { 10280 if !iter.page.NotDone() { 10281 return SSHPublicKeyResource{} 10282 } 10283 return iter.page.Values()[iter.i] 10284} 10285 10286// Creates a new instance of the SSHPublicKeysGroupListResultIterator type. 10287func NewSSHPublicKeysGroupListResultIterator(page SSHPublicKeysGroupListResultPage) SSHPublicKeysGroupListResultIterator { 10288 return SSHPublicKeysGroupListResultIterator{page: page} 10289} 10290 10291// IsEmpty returns true if the ListResult contains no values. 10292func (spkglr SSHPublicKeysGroupListResult) IsEmpty() bool { 10293 return spkglr.Value == nil || len(*spkglr.Value) == 0 10294} 10295 10296// hasNextLink returns true if the NextLink is not empty. 10297func (spkglr SSHPublicKeysGroupListResult) hasNextLink() bool { 10298 return spkglr.NextLink != nil && len(*spkglr.NextLink) != 0 10299} 10300 10301// sSHPublicKeysGroupListResultPreparer prepares a request to retrieve the next set of results. 10302// It returns nil if no more results exist. 10303func (spkglr SSHPublicKeysGroupListResult) sSHPublicKeysGroupListResultPreparer(ctx context.Context) (*http.Request, error) { 10304 if !spkglr.hasNextLink() { 10305 return nil, nil 10306 } 10307 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10308 autorest.AsJSON(), 10309 autorest.AsGet(), 10310 autorest.WithBaseURL(to.String(spkglr.NextLink))) 10311} 10312 10313// SSHPublicKeysGroupListResultPage contains a page of SSHPublicKeyResource values. 10314type SSHPublicKeysGroupListResultPage struct { 10315 fn func(context.Context, SSHPublicKeysGroupListResult) (SSHPublicKeysGroupListResult, error) 10316 spkglr SSHPublicKeysGroupListResult 10317} 10318 10319// NextWithContext advances to the next page of values. If there was an error making 10320// the request the page does not advance and the error is returned. 10321func (page *SSHPublicKeysGroupListResultPage) NextWithContext(ctx context.Context) (err error) { 10322 if tracing.IsEnabled() { 10323 ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysGroupListResultPage.NextWithContext") 10324 defer func() { 10325 sc := -1 10326 if page.Response().Response.Response != nil { 10327 sc = page.Response().Response.Response.StatusCode 10328 } 10329 tracing.EndSpan(ctx, sc, err) 10330 }() 10331 } 10332 for { 10333 next, err := page.fn(ctx, page.spkglr) 10334 if err != nil { 10335 return err 10336 } 10337 page.spkglr = next 10338 if !next.hasNextLink() || !next.IsEmpty() { 10339 break 10340 } 10341 } 10342 return nil 10343} 10344 10345// Next advances to the next page of values. If there was an error making 10346// the request the page does not advance and the error is returned. 10347// Deprecated: Use NextWithContext() instead. 10348func (page *SSHPublicKeysGroupListResultPage) Next() error { 10349 return page.NextWithContext(context.Background()) 10350} 10351 10352// NotDone returns true if the page enumeration should be started or is not yet complete. 10353func (page SSHPublicKeysGroupListResultPage) NotDone() bool { 10354 return !page.spkglr.IsEmpty() 10355} 10356 10357// Response returns the raw server response from the last page request. 10358func (page SSHPublicKeysGroupListResultPage) Response() SSHPublicKeysGroupListResult { 10359 return page.spkglr 10360} 10361 10362// Values returns the slice of values for the current page or nil if there are no values. 10363func (page SSHPublicKeysGroupListResultPage) Values() []SSHPublicKeyResource { 10364 if page.spkglr.IsEmpty() { 10365 return nil 10366 } 10367 return *page.spkglr.Value 10368} 10369 10370// Creates a new instance of the SSHPublicKeysGroupListResultPage type. 10371func NewSSHPublicKeysGroupListResultPage(cur SSHPublicKeysGroupListResult, getNextPage func(context.Context, SSHPublicKeysGroupListResult) (SSHPublicKeysGroupListResult, error)) SSHPublicKeysGroupListResultPage { 10372 return SSHPublicKeysGroupListResultPage{ 10373 fn: getNextPage, 10374 spkglr: cur, 10375 } 10376} 10377 10378// SSHPublicKeyUpdateResource specifies information about the SSH public key. 10379type SSHPublicKeyUpdateResource struct { 10380 // SSHPublicKeyResourceProperties - Properties of the SSH public key. 10381 *SSHPublicKeyResourceProperties `json:"properties,omitempty"` 10382 // Tags - Resource tags 10383 Tags map[string]*string `json:"tags"` 10384} 10385 10386// MarshalJSON is the custom marshaler for SSHPublicKeyUpdateResource. 10387func (spkur SSHPublicKeyUpdateResource) MarshalJSON() ([]byte, error) { 10388 objectMap := make(map[string]interface{}) 10389 if spkur.SSHPublicKeyResourceProperties != nil { 10390 objectMap["properties"] = spkur.SSHPublicKeyResourceProperties 10391 } 10392 if spkur.Tags != nil { 10393 objectMap["tags"] = spkur.Tags 10394 } 10395 return json.Marshal(objectMap) 10396} 10397 10398// UnmarshalJSON is the custom unmarshaler for SSHPublicKeyUpdateResource struct. 10399func (spkur *SSHPublicKeyUpdateResource) UnmarshalJSON(body []byte) error { 10400 var m map[string]*json.RawMessage 10401 err := json.Unmarshal(body, &m) 10402 if err != nil { 10403 return err 10404 } 10405 for k, v := range m { 10406 switch k { 10407 case "properties": 10408 if v != nil { 10409 var SSHPublicKeyResourceProperties SSHPublicKeyResourceProperties 10410 err = json.Unmarshal(*v, &SSHPublicKeyResourceProperties) 10411 if err != nil { 10412 return err 10413 } 10414 spkur.SSHPublicKeyResourceProperties = &SSHPublicKeyResourceProperties 10415 } 10416 case "tags": 10417 if v != nil { 10418 var tags map[string]*string 10419 err = json.Unmarshal(*v, &tags) 10420 if err != nil { 10421 return err 10422 } 10423 spkur.Tags = tags 10424 } 10425 } 10426 } 10427 10428 return nil 10429} 10430 10431// StorageProfile specifies the storage settings for the virtual machine disks. 10432type StorageProfile struct { 10433 // 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. 10434 ImageReference *ImageReference `json:"imageReference,omitempty"` 10435 // OsDisk - Specifies information about the operating system disk used by the virtual machine. <br><br> For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). 10436 OsDisk *OSDisk `json:"osDisk,omitempty"` 10437 // DataDisks - Specifies the parameters that are used to add a data disk to a virtual machine. <br><br> For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). 10438 DataDisks *[]DataDisk `json:"dataDisks,omitempty"` 10439} 10440 10441// SubResource ... 10442type SubResource struct { 10443 // ID - Resource Id 10444 ID *string `json:"id,omitempty"` 10445} 10446 10447// SubResourceReadOnly ... 10448type SubResourceReadOnly struct { 10449 // ID - READ-ONLY; Resource Id 10450 ID *string `json:"id,omitempty"` 10451} 10452 10453// MarshalJSON is the custom marshaler for SubResourceReadOnly. 10454func (srro SubResourceReadOnly) MarshalJSON() ([]byte, error) { 10455 objectMap := make(map[string]interface{}) 10456 return json.Marshal(objectMap) 10457} 10458 10459// SubResourceWithColocationStatus ... 10460type SubResourceWithColocationStatus struct { 10461 // ColocationStatus - Describes colocation status of a resource in the Proximity Placement Group. 10462 ColocationStatus *InstanceViewStatus `json:"colocationStatus,omitempty"` 10463 // ID - Resource Id 10464 ID *string `json:"id,omitempty"` 10465} 10466 10467// TargetRegion describes the target region information. 10468type TargetRegion struct { 10469 // Name - The name of the region. 10470 Name *string `json:"name,omitempty"` 10471 // RegionalReplicaCount - The number of replicas of the Image Version to be created per region. This property is updatable. 10472 RegionalReplicaCount *int32 `json:"regionalReplicaCount,omitempty"` 10473 // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' 10474 StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` 10475 Encryption *EncryptionImages `json:"encryption,omitempty"` 10476} 10477 10478// TerminateNotificationProfile ... 10479type TerminateNotificationProfile struct { 10480 // 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) 10481 NotBeforeTimeout *string `json:"notBeforeTimeout,omitempty"` 10482 // Enable - Specifies whether the Terminate Scheduled event is enabled or disabled. 10483 Enable *bool `json:"enable,omitempty"` 10484} 10485 10486// ThrottledRequestsInput api request input for LogAnalytics getThrottledRequests Api. 10487type ThrottledRequestsInput struct { 10488 // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. 10489 BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` 10490 // FromTime - From time of the query 10491 FromTime *date.Time `json:"fromTime,omitempty"` 10492 // ToTime - To time of the query 10493 ToTime *date.Time `json:"toTime,omitempty"` 10494 // GroupByThrottlePolicy - Group query result by Throttle Policy applied. 10495 GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` 10496 // GroupByOperationName - Group query result by Operation Name. 10497 GroupByOperationName *bool `json:"groupByOperationName,omitempty"` 10498 // GroupByResourceName - Group query result by Resource Name. 10499 GroupByResourceName *bool `json:"groupByResourceName,omitempty"` 10500} 10501 10502// UpdateResource the Update Resource model definition. 10503type UpdateResource struct { 10504 // Tags - Resource tags 10505 Tags map[string]*string `json:"tags"` 10506} 10507 10508// MarshalJSON is the custom marshaler for UpdateResource. 10509func (ur UpdateResource) MarshalJSON() ([]byte, error) { 10510 objectMap := make(map[string]interface{}) 10511 if ur.Tags != nil { 10512 objectMap["tags"] = ur.Tags 10513 } 10514 return json.Marshal(objectMap) 10515} 10516 10517// UpdateResourceDefinition the Update Resource model definition. 10518type UpdateResourceDefinition struct { 10519 // ID - READ-ONLY; Resource Id 10520 ID *string `json:"id,omitempty"` 10521 // Name - READ-ONLY; Resource name 10522 Name *string `json:"name,omitempty"` 10523 // Type - READ-ONLY; Resource type 10524 Type *string `json:"type,omitempty"` 10525 // Tags - Resource tags 10526 Tags map[string]*string `json:"tags"` 10527} 10528 10529// MarshalJSON is the custom marshaler for UpdateResourceDefinition. 10530func (urd UpdateResourceDefinition) MarshalJSON() ([]byte, error) { 10531 objectMap := make(map[string]interface{}) 10532 if urd.Tags != nil { 10533 objectMap["tags"] = urd.Tags 10534 } 10535 return json.Marshal(objectMap) 10536} 10537 10538// UpgradeOperationHistoricalStatusInfo virtual Machine Scale Set OS Upgrade History operation response. 10539type UpgradeOperationHistoricalStatusInfo struct { 10540 // Properties - READ-ONLY; Information about the properties of the upgrade operation. 10541 Properties *UpgradeOperationHistoricalStatusInfoProperties `json:"properties,omitempty"` 10542 // Type - READ-ONLY; Resource type 10543 Type *string `json:"type,omitempty"` 10544 // Location - READ-ONLY; Resource location 10545 Location *string `json:"location,omitempty"` 10546} 10547 10548// MarshalJSON is the custom marshaler for UpgradeOperationHistoricalStatusInfo. 10549func (uohsi UpgradeOperationHistoricalStatusInfo) MarshalJSON() ([]byte, error) { 10550 objectMap := make(map[string]interface{}) 10551 return json.Marshal(objectMap) 10552} 10553 10554// UpgradeOperationHistoricalStatusInfoProperties describes each OS upgrade on the Virtual Machine Scale 10555// Set. 10556type UpgradeOperationHistoricalStatusInfoProperties struct { 10557 // RunningStatus - READ-ONLY; Information about the overall status of the upgrade operation. 10558 RunningStatus *UpgradeOperationHistoryStatus `json:"runningStatus,omitempty"` 10559 // Progress - READ-ONLY; Counts of the VMs in each state. 10560 Progress *RollingUpgradeProgressInfo `json:"progress,omitempty"` 10561 // Error - READ-ONLY; Error Details for this upgrade if there are any. 10562 Error *APIError `json:"error,omitempty"` 10563 // StartedBy - READ-ONLY; Invoker of the Upgrade Operation. Possible values include: 'UpgradeOperationInvokerUnknown', 'UpgradeOperationInvokerUser', 'UpgradeOperationInvokerPlatform' 10564 StartedBy UpgradeOperationInvoker `json:"startedBy,omitempty"` 10565 // TargetImageReference - READ-ONLY; Image Reference details 10566 TargetImageReference *ImageReference `json:"targetImageReference,omitempty"` 10567 // RollbackInfo - READ-ONLY; Information about OS rollback if performed 10568 RollbackInfo *RollbackStatusInfo `json:"rollbackInfo,omitempty"` 10569} 10570 10571// MarshalJSON is the custom marshaler for UpgradeOperationHistoricalStatusInfoProperties. 10572func (uohsip UpgradeOperationHistoricalStatusInfoProperties) MarshalJSON() ([]byte, error) { 10573 objectMap := make(map[string]interface{}) 10574 return json.Marshal(objectMap) 10575} 10576 10577// UpgradeOperationHistoryStatus information about the current running state of the overall upgrade. 10578type UpgradeOperationHistoryStatus struct { 10579 // Code - READ-ONLY; Code indicating the current status of the upgrade. Possible values include: 'UpgradeStateRollingForward', 'UpgradeStateCancelled', 'UpgradeStateCompleted', 'UpgradeStateFaulted' 10580 Code UpgradeState `json:"code,omitempty"` 10581 // StartTime - READ-ONLY; Start time of the upgrade. 10582 StartTime *date.Time `json:"startTime,omitempty"` 10583 // EndTime - READ-ONLY; End time of the upgrade. 10584 EndTime *date.Time `json:"endTime,omitempty"` 10585} 10586 10587// MarshalJSON is the custom marshaler for UpgradeOperationHistoryStatus. 10588func (uohs UpgradeOperationHistoryStatus) MarshalJSON() ([]byte, error) { 10589 objectMap := make(map[string]interface{}) 10590 return json.Marshal(objectMap) 10591} 10592 10593// UpgradePolicy describes an upgrade policy - automatic, manual, or rolling. 10594type UpgradePolicy struct { 10595 // 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' 10596 Mode UpgradeMode `json:"mode,omitempty"` 10597 // RollingUpgradePolicy - The configuration parameters used while performing a rolling upgrade. 10598 RollingUpgradePolicy *RollingUpgradePolicy `json:"rollingUpgradePolicy,omitempty"` 10599 // AutomaticOSUpgradePolicy - Configuration parameters used for performing automatic OS Upgrade. 10600 AutomaticOSUpgradePolicy *AutomaticOSUpgradePolicy `json:"automaticOSUpgradePolicy,omitempty"` 10601} 10602 10603// Usage describes Compute Resource Usage. 10604type Usage struct { 10605 // Unit - An enum describing the unit of usage measurement. 10606 Unit *string `json:"unit,omitempty"` 10607 // CurrentValue - The current usage of the resource. 10608 CurrentValue *int32 `json:"currentValue,omitempty"` 10609 // Limit - The maximum permitted usage of the resource. 10610 Limit *int64 `json:"limit,omitempty"` 10611 // Name - The name of the type of usage. 10612 Name *UsageName `json:"name,omitempty"` 10613} 10614 10615// UsageName the Usage Names. 10616type UsageName struct { 10617 // Value - The name of the resource. 10618 Value *string `json:"value,omitempty"` 10619 // LocalizedValue - The localized name of the resource. 10620 LocalizedValue *string `json:"localizedValue,omitempty"` 10621} 10622 10623// UserArtifactSource the source image from which the Image Version is going to be created. 10624type UserArtifactSource struct { 10625 // FileName - Required. The fileName of the artifact. 10626 FileName *string `json:"fileName,omitempty"` 10627 // MediaLink - Required. The mediaLink of the artifact, must be a readable storage blob. 10628 MediaLink *string `json:"mediaLink,omitempty"` 10629} 10630 10631// VaultCertificate describes a single certificate reference in a Key Vault, and where the certificate 10632// should reside on the VM. 10633type VaultCertificate struct { 10634 // 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>} 10635 CertificateURL *string `json:"certificateUrl,omitempty"` 10636 // 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. 10637 CertificateStore *string `json:"certificateStore,omitempty"` 10638} 10639 10640// VaultSecretGroup describes a set of certificates which are all in the same Key Vault. 10641type VaultSecretGroup struct { 10642 // SourceVault - The relative URL of the Key Vault containing all of the certificates in VaultCertificates. 10643 SourceVault *SubResource `json:"sourceVault,omitempty"` 10644 // VaultCertificates - The list of key vault references in SourceVault which contain certificates. 10645 VaultCertificates *[]VaultCertificate `json:"vaultCertificates,omitempty"` 10646} 10647 10648// VirtualHardDisk describes the uri of a disk. 10649type VirtualHardDisk struct { 10650 // URI - Specifies the virtual hard disk's uri. 10651 URI *string `json:"uri,omitempty"` 10652} 10653 10654// VirtualMachine describes a Virtual Machine. 10655type VirtualMachine struct { 10656 autorest.Response `json:"-"` 10657 // 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**. 10658 Plan *Plan `json:"plan,omitempty"` 10659 *VirtualMachineProperties `json:"properties,omitempty"` 10660 // Resources - READ-ONLY; The virtual machine child extension resources. 10661 Resources *[]VirtualMachineExtension `json:"resources,omitempty"` 10662 // Identity - The identity of the virtual machine, if configured. 10663 Identity *VirtualMachineIdentity `json:"identity,omitempty"` 10664 // Zones - The virtual machine zones. 10665 Zones *[]string `json:"zones,omitempty"` 10666 // ID - READ-ONLY; Resource Id 10667 ID *string `json:"id,omitempty"` 10668 // Name - READ-ONLY; Resource name 10669 Name *string `json:"name,omitempty"` 10670 // Type - READ-ONLY; Resource type 10671 Type *string `json:"type,omitempty"` 10672 // Location - Resource location 10673 Location *string `json:"location,omitempty"` 10674 // Tags - Resource tags 10675 Tags map[string]*string `json:"tags"` 10676} 10677 10678// MarshalJSON is the custom marshaler for VirtualMachine. 10679func (VM VirtualMachine) MarshalJSON() ([]byte, error) { 10680 objectMap := make(map[string]interface{}) 10681 if VM.Plan != nil { 10682 objectMap["plan"] = VM.Plan 10683 } 10684 if VM.VirtualMachineProperties != nil { 10685 objectMap["properties"] = VM.VirtualMachineProperties 10686 } 10687 if VM.Identity != nil { 10688 objectMap["identity"] = VM.Identity 10689 } 10690 if VM.Zones != nil { 10691 objectMap["zones"] = VM.Zones 10692 } 10693 if VM.Location != nil { 10694 objectMap["location"] = VM.Location 10695 } 10696 if VM.Tags != nil { 10697 objectMap["tags"] = VM.Tags 10698 } 10699 return json.Marshal(objectMap) 10700} 10701 10702// UnmarshalJSON is the custom unmarshaler for VirtualMachine struct. 10703func (VM *VirtualMachine) UnmarshalJSON(body []byte) error { 10704 var m map[string]*json.RawMessage 10705 err := json.Unmarshal(body, &m) 10706 if err != nil { 10707 return err 10708 } 10709 for k, v := range m { 10710 switch k { 10711 case "plan": 10712 if v != nil { 10713 var plan Plan 10714 err = json.Unmarshal(*v, &plan) 10715 if err != nil { 10716 return err 10717 } 10718 VM.Plan = &plan 10719 } 10720 case "properties": 10721 if v != nil { 10722 var virtualMachineProperties VirtualMachineProperties 10723 err = json.Unmarshal(*v, &virtualMachineProperties) 10724 if err != nil { 10725 return err 10726 } 10727 VM.VirtualMachineProperties = &virtualMachineProperties 10728 } 10729 case "resources": 10730 if v != nil { 10731 var resources []VirtualMachineExtension 10732 err = json.Unmarshal(*v, &resources) 10733 if err != nil { 10734 return err 10735 } 10736 VM.Resources = &resources 10737 } 10738 case "identity": 10739 if v != nil { 10740 var identity VirtualMachineIdentity 10741 err = json.Unmarshal(*v, &identity) 10742 if err != nil { 10743 return err 10744 } 10745 VM.Identity = &identity 10746 } 10747 case "zones": 10748 if v != nil { 10749 var zones []string 10750 err = json.Unmarshal(*v, &zones) 10751 if err != nil { 10752 return err 10753 } 10754 VM.Zones = &zones 10755 } 10756 case "id": 10757 if v != nil { 10758 var ID string 10759 err = json.Unmarshal(*v, &ID) 10760 if err != nil { 10761 return err 10762 } 10763 VM.ID = &ID 10764 } 10765 case "name": 10766 if v != nil { 10767 var name string 10768 err = json.Unmarshal(*v, &name) 10769 if err != nil { 10770 return err 10771 } 10772 VM.Name = &name 10773 } 10774 case "type": 10775 if v != nil { 10776 var typeVar string 10777 err = json.Unmarshal(*v, &typeVar) 10778 if err != nil { 10779 return err 10780 } 10781 VM.Type = &typeVar 10782 } 10783 case "location": 10784 if v != nil { 10785 var location string 10786 err = json.Unmarshal(*v, &location) 10787 if err != nil { 10788 return err 10789 } 10790 VM.Location = &location 10791 } 10792 case "tags": 10793 if v != nil { 10794 var tags map[string]*string 10795 err = json.Unmarshal(*v, &tags) 10796 if err != nil { 10797 return err 10798 } 10799 VM.Tags = tags 10800 } 10801 } 10802 } 10803 10804 return nil 10805} 10806 10807// VirtualMachineAgentInstanceView the instance view of the VM Agent running on the virtual machine. 10808type VirtualMachineAgentInstanceView struct { 10809 // VMAgentVersion - The VM Agent full version. 10810 VMAgentVersion *string `json:"vmAgentVersion,omitempty"` 10811 // ExtensionHandlers - The virtual machine extension handler instance view. 10812 ExtensionHandlers *[]VirtualMachineExtensionHandlerInstanceView `json:"extensionHandlers,omitempty"` 10813 // Statuses - The resource status information. 10814 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 10815} 10816 10817// VirtualMachineAssessPatchesResult describes the properties of an AssessPatches result. 10818type VirtualMachineAssessPatchesResult struct { 10819 autorest.Response `json:"-"` 10820 // Status - READ-ONLY; The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Failed", "Succeeded", or "CompletedWithWarnings.". Possible values include: 'PatchOperationStatusInProgress', 'PatchOperationStatusFailed', 'PatchOperationStatusSucceeded', 'PatchOperationStatusCompletedWithWarnings' 10821 Status PatchOperationStatus `json:"status,omitempty"` 10822 // AssessmentActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. 10823 AssessmentActivityID *string `json:"assessmentActivityId,omitempty"` 10824 // 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. 10825 RebootPending *bool `json:"rebootPending,omitempty"` 10826 // CriticalAndSecurityPatchCount - READ-ONLY; The number of critical or security patches that have been detected as available and not yet installed. 10827 CriticalAndSecurityPatchCount *int32 `json:"criticalAndSecurityPatchCount,omitempty"` 10828 // OtherPatchCount - READ-ONLY; The number of all available patches excluding critical and security. 10829 OtherPatchCount *int32 `json:"otherPatchCount,omitempty"` 10830 // StartDateTime - READ-ONLY; The UTC timestamp when the operation began. 10831 StartDateTime *date.Time `json:"startDateTime,omitempty"` 10832 // Patches - READ-ONLY; The list of patches that have been detected as available for installation. 10833 Patches *[]VirtualMachineSoftwarePatchProperties `json:"patches,omitempty"` 10834 // Error - READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. 10835 Error *APIError `json:"error,omitempty"` 10836} 10837 10838// MarshalJSON is the custom marshaler for VirtualMachineAssessPatchesResult. 10839func (vmapr VirtualMachineAssessPatchesResult) MarshalJSON() ([]byte, error) { 10840 objectMap := make(map[string]interface{}) 10841 return json.Marshal(objectMap) 10842} 10843 10844// VirtualMachineCaptureParameters capture Virtual Machine parameters. 10845type VirtualMachineCaptureParameters struct { 10846 // VhdPrefix - The captured virtual hard disk's name prefix. 10847 VhdPrefix *string `json:"vhdPrefix,omitempty"` 10848 // DestinationContainerName - The destination container name. 10849 DestinationContainerName *string `json:"destinationContainerName,omitempty"` 10850 // OverwriteVhds - Specifies whether to overwrite the destination virtual hard disk, in case of conflict. 10851 OverwriteVhds *bool `json:"overwriteVhds,omitempty"` 10852} 10853 10854// VirtualMachineCaptureResult output of virtual machine capture operation. 10855type VirtualMachineCaptureResult struct { 10856 autorest.Response `json:"-"` 10857 // Schema - READ-ONLY; the schema of the captured virtual machine 10858 Schema *string `json:"$schema,omitempty"` 10859 // ContentVersion - READ-ONLY; the version of the content 10860 ContentVersion *string `json:"contentVersion,omitempty"` 10861 // Parameters - READ-ONLY; parameters of the captured virtual machine 10862 Parameters interface{} `json:"parameters,omitempty"` 10863 // Resources - READ-ONLY; a list of resource items of the captured virtual machine 10864 Resources *[]interface{} `json:"resources,omitempty"` 10865 // ID - Resource Id 10866 ID *string `json:"id,omitempty"` 10867} 10868 10869// MarshalJSON is the custom marshaler for VirtualMachineCaptureResult. 10870func (vmcr VirtualMachineCaptureResult) MarshalJSON() ([]byte, error) { 10871 objectMap := make(map[string]interface{}) 10872 if vmcr.ID != nil { 10873 objectMap["id"] = vmcr.ID 10874 } 10875 return json.Marshal(objectMap) 10876} 10877 10878// VirtualMachineExtension describes a Virtual Machine Extension. 10879type VirtualMachineExtension struct { 10880 autorest.Response `json:"-"` 10881 *VirtualMachineExtensionProperties `json:"properties,omitempty"` 10882 // ID - READ-ONLY; Resource Id 10883 ID *string `json:"id,omitempty"` 10884 // Name - READ-ONLY; Resource name 10885 Name *string `json:"name,omitempty"` 10886 // Type - READ-ONLY; Resource type 10887 Type *string `json:"type,omitempty"` 10888 // Location - Resource location 10889 Location *string `json:"location,omitempty"` 10890 // Tags - Resource tags 10891 Tags map[string]*string `json:"tags"` 10892} 10893 10894// MarshalJSON is the custom marshaler for VirtualMachineExtension. 10895func (vme VirtualMachineExtension) MarshalJSON() ([]byte, error) { 10896 objectMap := make(map[string]interface{}) 10897 if vme.VirtualMachineExtensionProperties != nil { 10898 objectMap["properties"] = vme.VirtualMachineExtensionProperties 10899 } 10900 if vme.Location != nil { 10901 objectMap["location"] = vme.Location 10902 } 10903 if vme.Tags != nil { 10904 objectMap["tags"] = vme.Tags 10905 } 10906 return json.Marshal(objectMap) 10907} 10908 10909// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtension struct. 10910func (vme *VirtualMachineExtension) UnmarshalJSON(body []byte) error { 10911 var m map[string]*json.RawMessage 10912 err := json.Unmarshal(body, &m) 10913 if err != nil { 10914 return err 10915 } 10916 for k, v := range m { 10917 switch k { 10918 case "properties": 10919 if v != nil { 10920 var virtualMachineExtensionProperties VirtualMachineExtensionProperties 10921 err = json.Unmarshal(*v, &virtualMachineExtensionProperties) 10922 if err != nil { 10923 return err 10924 } 10925 vme.VirtualMachineExtensionProperties = &virtualMachineExtensionProperties 10926 } 10927 case "id": 10928 if v != nil { 10929 var ID string 10930 err = json.Unmarshal(*v, &ID) 10931 if err != nil { 10932 return err 10933 } 10934 vme.ID = &ID 10935 } 10936 case "name": 10937 if v != nil { 10938 var name string 10939 err = json.Unmarshal(*v, &name) 10940 if err != nil { 10941 return err 10942 } 10943 vme.Name = &name 10944 } 10945 case "type": 10946 if v != nil { 10947 var typeVar string 10948 err = json.Unmarshal(*v, &typeVar) 10949 if err != nil { 10950 return err 10951 } 10952 vme.Type = &typeVar 10953 } 10954 case "location": 10955 if v != nil { 10956 var location string 10957 err = json.Unmarshal(*v, &location) 10958 if err != nil { 10959 return err 10960 } 10961 vme.Location = &location 10962 } 10963 case "tags": 10964 if v != nil { 10965 var tags map[string]*string 10966 err = json.Unmarshal(*v, &tags) 10967 if err != nil { 10968 return err 10969 } 10970 vme.Tags = tags 10971 } 10972 } 10973 } 10974 10975 return nil 10976} 10977 10978// VirtualMachineExtensionHandlerInstanceView the instance view of a virtual machine extension handler. 10979type VirtualMachineExtensionHandlerInstanceView struct { 10980 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 10981 Type *string `json:"type,omitempty"` 10982 // TypeHandlerVersion - Specifies the version of the script handler. 10983 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 10984 // Status - The extension handler status. 10985 Status *InstanceViewStatus `json:"status,omitempty"` 10986} 10987 10988// VirtualMachineExtensionImage describes a Virtual Machine Extension Image. 10989type VirtualMachineExtensionImage struct { 10990 autorest.Response `json:"-"` 10991 *VirtualMachineExtensionImageProperties `json:"properties,omitempty"` 10992 // ID - READ-ONLY; Resource Id 10993 ID *string `json:"id,omitempty"` 10994 // Name - READ-ONLY; Resource name 10995 Name *string `json:"name,omitempty"` 10996 // Type - READ-ONLY; Resource type 10997 Type *string `json:"type,omitempty"` 10998 // Location - Resource location 10999 Location *string `json:"location,omitempty"` 11000 // Tags - Resource tags 11001 Tags map[string]*string `json:"tags"` 11002} 11003 11004// MarshalJSON is the custom marshaler for VirtualMachineExtensionImage. 11005func (vmei VirtualMachineExtensionImage) MarshalJSON() ([]byte, error) { 11006 objectMap := make(map[string]interface{}) 11007 if vmei.VirtualMachineExtensionImageProperties != nil { 11008 objectMap["properties"] = vmei.VirtualMachineExtensionImageProperties 11009 } 11010 if vmei.Location != nil { 11011 objectMap["location"] = vmei.Location 11012 } 11013 if vmei.Tags != nil { 11014 objectMap["tags"] = vmei.Tags 11015 } 11016 return json.Marshal(objectMap) 11017} 11018 11019// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtensionImage struct. 11020func (vmei *VirtualMachineExtensionImage) UnmarshalJSON(body []byte) error { 11021 var m map[string]*json.RawMessage 11022 err := json.Unmarshal(body, &m) 11023 if err != nil { 11024 return err 11025 } 11026 for k, v := range m { 11027 switch k { 11028 case "properties": 11029 if v != nil { 11030 var virtualMachineExtensionImageProperties VirtualMachineExtensionImageProperties 11031 err = json.Unmarshal(*v, &virtualMachineExtensionImageProperties) 11032 if err != nil { 11033 return err 11034 } 11035 vmei.VirtualMachineExtensionImageProperties = &virtualMachineExtensionImageProperties 11036 } 11037 case "id": 11038 if v != nil { 11039 var ID string 11040 err = json.Unmarshal(*v, &ID) 11041 if err != nil { 11042 return err 11043 } 11044 vmei.ID = &ID 11045 } 11046 case "name": 11047 if v != nil { 11048 var name string 11049 err = json.Unmarshal(*v, &name) 11050 if err != nil { 11051 return err 11052 } 11053 vmei.Name = &name 11054 } 11055 case "type": 11056 if v != nil { 11057 var typeVar string 11058 err = json.Unmarshal(*v, &typeVar) 11059 if err != nil { 11060 return err 11061 } 11062 vmei.Type = &typeVar 11063 } 11064 case "location": 11065 if v != nil { 11066 var location string 11067 err = json.Unmarshal(*v, &location) 11068 if err != nil { 11069 return err 11070 } 11071 vmei.Location = &location 11072 } 11073 case "tags": 11074 if v != nil { 11075 var tags map[string]*string 11076 err = json.Unmarshal(*v, &tags) 11077 if err != nil { 11078 return err 11079 } 11080 vmei.Tags = tags 11081 } 11082 } 11083 } 11084 11085 return nil 11086} 11087 11088// VirtualMachineExtensionImageProperties describes the properties of a Virtual Machine Extension Image. 11089type VirtualMachineExtensionImageProperties struct { 11090 // OperatingSystem - The operating system this extension supports. 11091 OperatingSystem *string `json:"operatingSystem,omitempty"` 11092 // ComputeRole - The type of role (IaaS or PaaS) this extension supports. 11093 ComputeRole *string `json:"computeRole,omitempty"` 11094 // HandlerSchema - The schema defined by publisher, where extension consumers should provide settings in a matching schema. 11095 HandlerSchema *string `json:"handlerSchema,omitempty"` 11096 // 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. 11097 VMScaleSetEnabled *bool `json:"vmScaleSetEnabled,omitempty"` 11098 // SupportsMultipleExtensions - Whether the handler can support multiple extensions. 11099 SupportsMultipleExtensions *bool `json:"supportsMultipleExtensions,omitempty"` 11100} 11101 11102// VirtualMachineExtensionInstanceView the instance view of a virtual machine extension. 11103type VirtualMachineExtensionInstanceView struct { 11104 // Name - The virtual machine extension name. 11105 Name *string `json:"name,omitempty"` 11106 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 11107 Type *string `json:"type,omitempty"` 11108 // TypeHandlerVersion - Specifies the version of the script handler. 11109 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 11110 // Substatuses - The resource status information. 11111 Substatuses *[]InstanceViewStatus `json:"substatuses,omitempty"` 11112 // Statuses - The resource status information. 11113 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 11114} 11115 11116// VirtualMachineExtensionProperties describes the properties of a Virtual Machine Extension. 11117type VirtualMachineExtensionProperties struct { 11118 // ForceUpdateTag - How the extension handler should be forced to update even if the extension configuration has not changed. 11119 ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` 11120 // Publisher - The name of the extension handler publisher. 11121 Publisher *string `json:"publisher,omitempty"` 11122 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 11123 Type *string `json:"type,omitempty"` 11124 // TypeHandlerVersion - Specifies the version of the script handler. 11125 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 11126 // 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. 11127 AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` 11128 // EnableAutomaticUpgrade - Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. 11129 EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` 11130 // Settings - Json formatted public settings for the extension. 11131 Settings interface{} `json:"settings,omitempty"` 11132 // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. 11133 ProtectedSettings interface{} `json:"protectedSettings,omitempty"` 11134 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 11135 ProvisioningState *string `json:"provisioningState,omitempty"` 11136 // InstanceView - The virtual machine extension instance view. 11137 InstanceView *VirtualMachineExtensionInstanceView `json:"instanceView,omitempty"` 11138} 11139 11140// MarshalJSON is the custom marshaler for VirtualMachineExtensionProperties. 11141func (vmep VirtualMachineExtensionProperties) MarshalJSON() ([]byte, error) { 11142 objectMap := make(map[string]interface{}) 11143 if vmep.ForceUpdateTag != nil { 11144 objectMap["forceUpdateTag"] = vmep.ForceUpdateTag 11145 } 11146 if vmep.Publisher != nil { 11147 objectMap["publisher"] = vmep.Publisher 11148 } 11149 if vmep.Type != nil { 11150 objectMap["type"] = vmep.Type 11151 } 11152 if vmep.TypeHandlerVersion != nil { 11153 objectMap["typeHandlerVersion"] = vmep.TypeHandlerVersion 11154 } 11155 if vmep.AutoUpgradeMinorVersion != nil { 11156 objectMap["autoUpgradeMinorVersion"] = vmep.AutoUpgradeMinorVersion 11157 } 11158 if vmep.EnableAutomaticUpgrade != nil { 11159 objectMap["enableAutomaticUpgrade"] = vmep.EnableAutomaticUpgrade 11160 } 11161 if vmep.Settings != nil { 11162 objectMap["settings"] = vmep.Settings 11163 } 11164 if vmep.ProtectedSettings != nil { 11165 objectMap["protectedSettings"] = vmep.ProtectedSettings 11166 } 11167 if vmep.InstanceView != nil { 11168 objectMap["instanceView"] = vmep.InstanceView 11169 } 11170 return json.Marshal(objectMap) 11171} 11172 11173// VirtualMachineExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of 11174// a long-running operation. 11175type VirtualMachineExtensionsCreateOrUpdateFuture struct { 11176 azure.FutureAPI 11177 // Result returns the result of the asynchronous operation. 11178 // If the operation has not completed it will return an error. 11179 Result func(VirtualMachineExtensionsClient) (VirtualMachineExtension, error) 11180} 11181 11182// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11183func (future *VirtualMachineExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 11184 var azFuture azure.Future 11185 if err := json.Unmarshal(body, &azFuture); err != nil { 11186 return err 11187 } 11188 future.FutureAPI = &azFuture 11189 future.Result = future.result 11190 return nil 11191} 11192 11193// result is the default implementation for VirtualMachineExtensionsCreateOrUpdateFuture.Result. 11194func (future *VirtualMachineExtensionsCreateOrUpdateFuture) result(client VirtualMachineExtensionsClient) (vme VirtualMachineExtension, err error) { 11195 var done bool 11196 done, err = future.DoneWithContext(context.Background(), client) 11197 if err != nil { 11198 err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 11199 return 11200 } 11201 if !done { 11202 vme.Response.Response = future.Response() 11203 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsCreateOrUpdateFuture") 11204 return 11205 } 11206 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11207 if vme.Response.Response, err = future.GetResult(sender); err == nil && vme.Response.Response.StatusCode != http.StatusNoContent { 11208 vme, err = client.CreateOrUpdateResponder(vme.Response.Response) 11209 if err != nil { 11210 err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsCreateOrUpdateFuture", "Result", vme.Response.Response, "Failure responding to request") 11211 } 11212 } 11213 return 11214} 11215 11216// VirtualMachineExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of a 11217// long-running operation. 11218type VirtualMachineExtensionsDeleteFuture struct { 11219 azure.FutureAPI 11220 // Result returns the result of the asynchronous operation. 11221 // If the operation has not completed it will return an error. 11222 Result func(VirtualMachineExtensionsClient) (autorest.Response, error) 11223} 11224 11225// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11226func (future *VirtualMachineExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { 11227 var azFuture azure.Future 11228 if err := json.Unmarshal(body, &azFuture); err != nil { 11229 return err 11230 } 11231 future.FutureAPI = &azFuture 11232 future.Result = future.result 11233 return nil 11234} 11235 11236// result is the default implementation for VirtualMachineExtensionsDeleteFuture.Result. 11237func (future *VirtualMachineExtensionsDeleteFuture) result(client VirtualMachineExtensionsClient) (ar autorest.Response, err error) { 11238 var done bool 11239 done, err = future.DoneWithContext(context.Background(), client) 11240 if err != nil { 11241 err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") 11242 return 11243 } 11244 if !done { 11245 ar.Response = future.Response() 11246 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsDeleteFuture") 11247 return 11248 } 11249 ar.Response = future.Response() 11250 return 11251} 11252 11253// VirtualMachineExtensionsListResult the List Extension operation response 11254type VirtualMachineExtensionsListResult struct { 11255 autorest.Response `json:"-"` 11256 // Value - The list of extensions 11257 Value *[]VirtualMachineExtension `json:"value,omitempty"` 11258} 11259 11260// VirtualMachineExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of a 11261// long-running operation. 11262type VirtualMachineExtensionsUpdateFuture struct { 11263 azure.FutureAPI 11264 // Result returns the result of the asynchronous operation. 11265 // If the operation has not completed it will return an error. 11266 Result func(VirtualMachineExtensionsClient) (VirtualMachineExtension, error) 11267} 11268 11269// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11270func (future *VirtualMachineExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { 11271 var azFuture azure.Future 11272 if err := json.Unmarshal(body, &azFuture); err != nil { 11273 return err 11274 } 11275 future.FutureAPI = &azFuture 11276 future.Result = future.result 11277 return nil 11278} 11279 11280// result is the default implementation for VirtualMachineExtensionsUpdateFuture.Result. 11281func (future *VirtualMachineExtensionsUpdateFuture) result(client VirtualMachineExtensionsClient) (vme VirtualMachineExtension, err error) { 11282 var done bool 11283 done, err = future.DoneWithContext(context.Background(), client) 11284 if err != nil { 11285 err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsUpdateFuture", "Result", future.Response(), "Polling failure") 11286 return 11287 } 11288 if !done { 11289 vme.Response.Response = future.Response() 11290 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsUpdateFuture") 11291 return 11292 } 11293 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11294 if vme.Response.Response, err = future.GetResult(sender); err == nil && vme.Response.Response.StatusCode != http.StatusNoContent { 11295 vme, err = client.UpdateResponder(vme.Response.Response) 11296 if err != nil { 11297 err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsUpdateFuture", "Result", vme.Response.Response, "Failure responding to request") 11298 } 11299 } 11300 return 11301} 11302 11303// VirtualMachineExtensionUpdate describes a Virtual Machine Extension. 11304type VirtualMachineExtensionUpdate struct { 11305 *VirtualMachineExtensionUpdateProperties `json:"properties,omitempty"` 11306 // Tags - Resource tags 11307 Tags map[string]*string `json:"tags"` 11308} 11309 11310// MarshalJSON is the custom marshaler for VirtualMachineExtensionUpdate. 11311func (vmeu VirtualMachineExtensionUpdate) MarshalJSON() ([]byte, error) { 11312 objectMap := make(map[string]interface{}) 11313 if vmeu.VirtualMachineExtensionUpdateProperties != nil { 11314 objectMap["properties"] = vmeu.VirtualMachineExtensionUpdateProperties 11315 } 11316 if vmeu.Tags != nil { 11317 objectMap["tags"] = vmeu.Tags 11318 } 11319 return json.Marshal(objectMap) 11320} 11321 11322// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtensionUpdate struct. 11323func (vmeu *VirtualMachineExtensionUpdate) UnmarshalJSON(body []byte) error { 11324 var m map[string]*json.RawMessage 11325 err := json.Unmarshal(body, &m) 11326 if err != nil { 11327 return err 11328 } 11329 for k, v := range m { 11330 switch k { 11331 case "properties": 11332 if v != nil { 11333 var virtualMachineExtensionUpdateProperties VirtualMachineExtensionUpdateProperties 11334 err = json.Unmarshal(*v, &virtualMachineExtensionUpdateProperties) 11335 if err != nil { 11336 return err 11337 } 11338 vmeu.VirtualMachineExtensionUpdateProperties = &virtualMachineExtensionUpdateProperties 11339 } 11340 case "tags": 11341 if v != nil { 11342 var tags map[string]*string 11343 err = json.Unmarshal(*v, &tags) 11344 if err != nil { 11345 return err 11346 } 11347 vmeu.Tags = tags 11348 } 11349 } 11350 } 11351 11352 return nil 11353} 11354 11355// VirtualMachineExtensionUpdateProperties describes the properties of a Virtual Machine Extension. 11356type VirtualMachineExtensionUpdateProperties struct { 11357 // ForceUpdateTag - How the extension handler should be forced to update even if the extension configuration has not changed. 11358 ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` 11359 // Publisher - The name of the extension handler publisher. 11360 Publisher *string `json:"publisher,omitempty"` 11361 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 11362 Type *string `json:"type,omitempty"` 11363 // TypeHandlerVersion - Specifies the version of the script handler. 11364 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 11365 // 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. 11366 AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` 11367 // EnableAutomaticUpgrade - Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. 11368 EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` 11369 // Settings - Json formatted public settings for the extension. 11370 Settings interface{} `json:"settings,omitempty"` 11371 // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. 11372 ProtectedSettings interface{} `json:"protectedSettings,omitempty"` 11373} 11374 11375// VirtualMachineHealthStatus the health status of the VM. 11376type VirtualMachineHealthStatus struct { 11377 // Status - READ-ONLY; The health status information for the VM. 11378 Status *InstanceViewStatus `json:"status,omitempty"` 11379} 11380 11381// MarshalJSON is the custom marshaler for VirtualMachineHealthStatus. 11382func (vmhs VirtualMachineHealthStatus) MarshalJSON() ([]byte, error) { 11383 objectMap := make(map[string]interface{}) 11384 return json.Marshal(objectMap) 11385} 11386 11387// VirtualMachineIdentity identity for the virtual machine. 11388type VirtualMachineIdentity struct { 11389 // PrincipalID - READ-ONLY; The principal id of virtual machine identity. This property will only be provided for a system assigned identity. 11390 PrincipalID *string `json:"principalId,omitempty"` 11391 // TenantID - READ-ONLY; The tenant id associated with the virtual machine. This property will only be provided for a system assigned identity. 11392 TenantID *string `json:"tenantId,omitempty"` 11393 // 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' 11394 Type ResourceIdentityType `json:"type,omitempty"` 11395 // 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}'. 11396 UserAssignedIdentities map[string]*VirtualMachineIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` 11397} 11398 11399// MarshalJSON is the custom marshaler for VirtualMachineIdentity. 11400func (vmi VirtualMachineIdentity) MarshalJSON() ([]byte, error) { 11401 objectMap := make(map[string]interface{}) 11402 if vmi.Type != "" { 11403 objectMap["type"] = vmi.Type 11404 } 11405 if vmi.UserAssignedIdentities != nil { 11406 objectMap["userAssignedIdentities"] = vmi.UserAssignedIdentities 11407 } 11408 return json.Marshal(objectMap) 11409} 11410 11411// VirtualMachineIdentityUserAssignedIdentitiesValue ... 11412type VirtualMachineIdentityUserAssignedIdentitiesValue struct { 11413 // PrincipalID - READ-ONLY; The principal id of user assigned identity. 11414 PrincipalID *string `json:"principalId,omitempty"` 11415 // ClientID - READ-ONLY; The client id of user assigned identity. 11416 ClientID *string `json:"clientId,omitempty"` 11417} 11418 11419// MarshalJSON is the custom marshaler for VirtualMachineIdentityUserAssignedIdentitiesValue. 11420func (vmiAiv VirtualMachineIdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) { 11421 objectMap := make(map[string]interface{}) 11422 return json.Marshal(objectMap) 11423} 11424 11425// VirtualMachineImage describes a Virtual Machine Image. 11426type VirtualMachineImage struct { 11427 autorest.Response `json:"-"` 11428 *VirtualMachineImageProperties `json:"properties,omitempty"` 11429 // Name - The name of the resource. 11430 Name *string `json:"name,omitempty"` 11431 // Location - The supported Azure location of the resource. 11432 Location *string `json:"location,omitempty"` 11433 // 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). 11434 Tags map[string]*string `json:"tags"` 11435 // ID - Resource Id 11436 ID *string `json:"id,omitempty"` 11437} 11438 11439// MarshalJSON is the custom marshaler for VirtualMachineImage. 11440func (vmi VirtualMachineImage) MarshalJSON() ([]byte, error) { 11441 objectMap := make(map[string]interface{}) 11442 if vmi.VirtualMachineImageProperties != nil { 11443 objectMap["properties"] = vmi.VirtualMachineImageProperties 11444 } 11445 if vmi.Name != nil { 11446 objectMap["name"] = vmi.Name 11447 } 11448 if vmi.Location != nil { 11449 objectMap["location"] = vmi.Location 11450 } 11451 if vmi.Tags != nil { 11452 objectMap["tags"] = vmi.Tags 11453 } 11454 if vmi.ID != nil { 11455 objectMap["id"] = vmi.ID 11456 } 11457 return json.Marshal(objectMap) 11458} 11459 11460// UnmarshalJSON is the custom unmarshaler for VirtualMachineImage struct. 11461func (vmi *VirtualMachineImage) UnmarshalJSON(body []byte) error { 11462 var m map[string]*json.RawMessage 11463 err := json.Unmarshal(body, &m) 11464 if err != nil { 11465 return err 11466 } 11467 for k, v := range m { 11468 switch k { 11469 case "properties": 11470 if v != nil { 11471 var virtualMachineImageProperties VirtualMachineImageProperties 11472 err = json.Unmarshal(*v, &virtualMachineImageProperties) 11473 if err != nil { 11474 return err 11475 } 11476 vmi.VirtualMachineImageProperties = &virtualMachineImageProperties 11477 } 11478 case "name": 11479 if v != nil { 11480 var name string 11481 err = json.Unmarshal(*v, &name) 11482 if err != nil { 11483 return err 11484 } 11485 vmi.Name = &name 11486 } 11487 case "location": 11488 if v != nil { 11489 var location string 11490 err = json.Unmarshal(*v, &location) 11491 if err != nil { 11492 return err 11493 } 11494 vmi.Location = &location 11495 } 11496 case "tags": 11497 if v != nil { 11498 var tags map[string]*string 11499 err = json.Unmarshal(*v, &tags) 11500 if err != nil { 11501 return err 11502 } 11503 vmi.Tags = tags 11504 } 11505 case "id": 11506 if v != nil { 11507 var ID string 11508 err = json.Unmarshal(*v, &ID) 11509 if err != nil { 11510 return err 11511 } 11512 vmi.ID = &ID 11513 } 11514 } 11515 } 11516 11517 return nil 11518} 11519 11520// VirtualMachineImageProperties describes the properties of a Virtual Machine Image. 11521type VirtualMachineImageProperties struct { 11522 Plan *PurchasePlan `json:"plan,omitempty"` 11523 OsDiskImage *OSDiskImage `json:"osDiskImage,omitempty"` 11524 DataDiskImages *[]DataDiskImage `json:"dataDiskImages,omitempty"` 11525 AutomaticOSUpgradeProperties *AutomaticOSUpgradeProperties `json:"automaticOSUpgradeProperties,omitempty"` 11526 // HyperVGeneration - Possible values include: 'HyperVGenerationTypesV1', 'HyperVGenerationTypesV2' 11527 HyperVGeneration HyperVGenerationTypes `json:"hyperVGeneration,omitempty"` 11528 // Disallowed - Specifies disallowed configuration for the VirtualMachine created from the image 11529 Disallowed *DisallowedConfiguration `json:"disallowed,omitempty"` 11530} 11531 11532// VirtualMachineImageResource virtual machine image resource information. 11533type VirtualMachineImageResource struct { 11534 // Name - The name of the resource. 11535 Name *string `json:"name,omitempty"` 11536 // Location - The supported Azure location of the resource. 11537 Location *string `json:"location,omitempty"` 11538 // 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). 11539 Tags map[string]*string `json:"tags"` 11540 // ID - Resource Id 11541 ID *string `json:"id,omitempty"` 11542} 11543 11544// MarshalJSON is the custom marshaler for VirtualMachineImageResource. 11545func (vmir VirtualMachineImageResource) MarshalJSON() ([]byte, error) { 11546 objectMap := make(map[string]interface{}) 11547 if vmir.Name != nil { 11548 objectMap["name"] = vmir.Name 11549 } 11550 if vmir.Location != nil { 11551 objectMap["location"] = vmir.Location 11552 } 11553 if vmir.Tags != nil { 11554 objectMap["tags"] = vmir.Tags 11555 } 11556 if vmir.ID != nil { 11557 objectMap["id"] = vmir.ID 11558 } 11559 return json.Marshal(objectMap) 11560} 11561 11562// VirtualMachineInstanceView the instance view of a virtual machine. 11563type VirtualMachineInstanceView struct { 11564 autorest.Response `json:"-"` 11565 // PlatformUpdateDomain - Specifies the update domain of the virtual machine. 11566 PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` 11567 // PlatformFaultDomain - Specifies the fault domain of the virtual machine. 11568 PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` 11569 // ComputerName - The computer name assigned to the virtual machine. 11570 ComputerName *string `json:"computerName,omitempty"` 11571 // OsName - The Operating System running on the virtual machine. 11572 OsName *string `json:"osName,omitempty"` 11573 // OsVersion - The version of Operating System running on the virtual machine. 11574 OsVersion *string `json:"osVersion,omitempty"` 11575 // HyperVGeneration - Specifies the HyperVGeneration Type associated with a resource. Possible values include: 'HyperVGenerationTypeV1', 'HyperVGenerationTypeV2' 11576 HyperVGeneration HyperVGenerationType `json:"hyperVGeneration,omitempty"` 11577 // RdpThumbPrint - The Remote desktop certificate thumbprint. 11578 RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"` 11579 // VMAgent - The VM Agent running on the virtual machine. 11580 VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"` 11581 // MaintenanceRedeployStatus - The Maintenance Operation status on the virtual machine. 11582 MaintenanceRedeployStatus *MaintenanceRedeployStatus `json:"maintenanceRedeployStatus,omitempty"` 11583 // Disks - The virtual machine disk information. 11584 Disks *[]DiskInstanceView `json:"disks,omitempty"` 11585 // Extensions - The extensions information. 11586 Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` 11587 // VMHealth - READ-ONLY; The health status for the VM. 11588 VMHealth *VirtualMachineHealthStatus `json:"vmHealth,omitempty"` 11589 // 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. 11590 BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` 11591 // 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. 11592 AssignedHost *string `json:"assignedHost,omitempty"` 11593 // Statuses - The resource status information. 11594 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 11595 // PatchStatus - The status of virtual machine patch operations. 11596 PatchStatus *VirtualMachinePatchStatus `json:"patchStatus,omitempty"` 11597} 11598 11599// MarshalJSON is the custom marshaler for VirtualMachineInstanceView. 11600func (vmiv VirtualMachineInstanceView) MarshalJSON() ([]byte, error) { 11601 objectMap := make(map[string]interface{}) 11602 if vmiv.PlatformUpdateDomain != nil { 11603 objectMap["platformUpdateDomain"] = vmiv.PlatformUpdateDomain 11604 } 11605 if vmiv.PlatformFaultDomain != nil { 11606 objectMap["platformFaultDomain"] = vmiv.PlatformFaultDomain 11607 } 11608 if vmiv.ComputerName != nil { 11609 objectMap["computerName"] = vmiv.ComputerName 11610 } 11611 if vmiv.OsName != nil { 11612 objectMap["osName"] = vmiv.OsName 11613 } 11614 if vmiv.OsVersion != nil { 11615 objectMap["osVersion"] = vmiv.OsVersion 11616 } 11617 if vmiv.HyperVGeneration != "" { 11618 objectMap["hyperVGeneration"] = vmiv.HyperVGeneration 11619 } 11620 if vmiv.RdpThumbPrint != nil { 11621 objectMap["rdpThumbPrint"] = vmiv.RdpThumbPrint 11622 } 11623 if vmiv.VMAgent != nil { 11624 objectMap["vmAgent"] = vmiv.VMAgent 11625 } 11626 if vmiv.MaintenanceRedeployStatus != nil { 11627 objectMap["maintenanceRedeployStatus"] = vmiv.MaintenanceRedeployStatus 11628 } 11629 if vmiv.Disks != nil { 11630 objectMap["disks"] = vmiv.Disks 11631 } 11632 if vmiv.Extensions != nil { 11633 objectMap["extensions"] = vmiv.Extensions 11634 } 11635 if vmiv.BootDiagnostics != nil { 11636 objectMap["bootDiagnostics"] = vmiv.BootDiagnostics 11637 } 11638 if vmiv.Statuses != nil { 11639 objectMap["statuses"] = vmiv.Statuses 11640 } 11641 if vmiv.PatchStatus != nil { 11642 objectMap["patchStatus"] = vmiv.PatchStatus 11643 } 11644 return json.Marshal(objectMap) 11645} 11646 11647// VirtualMachineListResult the List Virtual Machine operation response. 11648type VirtualMachineListResult struct { 11649 autorest.Response `json:"-"` 11650 // Value - The list of virtual machines. 11651 Value *[]VirtualMachine `json:"value,omitempty"` 11652 // NextLink - The URI to fetch the next page of VMs. Call ListNext() with this URI to fetch the next page of Virtual Machines. 11653 NextLink *string `json:"nextLink,omitempty"` 11654} 11655 11656// VirtualMachineListResultIterator provides access to a complete listing of VirtualMachine values. 11657type VirtualMachineListResultIterator struct { 11658 i int 11659 page VirtualMachineListResultPage 11660} 11661 11662// NextWithContext advances to the next value. If there was an error making 11663// the request the iterator does not advance and the error is returned. 11664func (iter *VirtualMachineListResultIterator) NextWithContext(ctx context.Context) (err error) { 11665 if tracing.IsEnabled() { 11666 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineListResultIterator.NextWithContext") 11667 defer func() { 11668 sc := -1 11669 if iter.Response().Response.Response != nil { 11670 sc = iter.Response().Response.Response.StatusCode 11671 } 11672 tracing.EndSpan(ctx, sc, err) 11673 }() 11674 } 11675 iter.i++ 11676 if iter.i < len(iter.page.Values()) { 11677 return nil 11678 } 11679 err = iter.page.NextWithContext(ctx) 11680 if err != nil { 11681 iter.i-- 11682 return err 11683 } 11684 iter.i = 0 11685 return nil 11686} 11687 11688// Next advances to the next value. If there was an error making 11689// the request the iterator does not advance and the error is returned. 11690// Deprecated: Use NextWithContext() instead. 11691func (iter *VirtualMachineListResultIterator) Next() error { 11692 return iter.NextWithContext(context.Background()) 11693} 11694 11695// NotDone returns true if the enumeration should be started or is not yet complete. 11696func (iter VirtualMachineListResultIterator) NotDone() bool { 11697 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11698} 11699 11700// Response returns the raw server response from the last page request. 11701func (iter VirtualMachineListResultIterator) Response() VirtualMachineListResult { 11702 return iter.page.Response() 11703} 11704 11705// Value returns the current value or a zero-initialized value if the 11706// iterator has advanced beyond the end of the collection. 11707func (iter VirtualMachineListResultIterator) Value() VirtualMachine { 11708 if !iter.page.NotDone() { 11709 return VirtualMachine{} 11710 } 11711 return iter.page.Values()[iter.i] 11712} 11713 11714// Creates a new instance of the VirtualMachineListResultIterator type. 11715func NewVirtualMachineListResultIterator(page VirtualMachineListResultPage) VirtualMachineListResultIterator { 11716 return VirtualMachineListResultIterator{page: page} 11717} 11718 11719// IsEmpty returns true if the ListResult contains no values. 11720func (vmlr VirtualMachineListResult) IsEmpty() bool { 11721 return vmlr.Value == nil || len(*vmlr.Value) == 0 11722} 11723 11724// hasNextLink returns true if the NextLink is not empty. 11725func (vmlr VirtualMachineListResult) hasNextLink() bool { 11726 return vmlr.NextLink != nil && len(*vmlr.NextLink) != 0 11727} 11728 11729// virtualMachineListResultPreparer prepares a request to retrieve the next set of results. 11730// It returns nil if no more results exist. 11731func (vmlr VirtualMachineListResult) virtualMachineListResultPreparer(ctx context.Context) (*http.Request, error) { 11732 if !vmlr.hasNextLink() { 11733 return nil, nil 11734 } 11735 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11736 autorest.AsJSON(), 11737 autorest.AsGet(), 11738 autorest.WithBaseURL(to.String(vmlr.NextLink))) 11739} 11740 11741// VirtualMachineListResultPage contains a page of VirtualMachine values. 11742type VirtualMachineListResultPage struct { 11743 fn func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error) 11744 vmlr VirtualMachineListResult 11745} 11746 11747// NextWithContext advances to the next page of values. If there was an error making 11748// the request the page does not advance and the error is returned. 11749func (page *VirtualMachineListResultPage) NextWithContext(ctx context.Context) (err error) { 11750 if tracing.IsEnabled() { 11751 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineListResultPage.NextWithContext") 11752 defer func() { 11753 sc := -1 11754 if page.Response().Response.Response != nil { 11755 sc = page.Response().Response.Response.StatusCode 11756 } 11757 tracing.EndSpan(ctx, sc, err) 11758 }() 11759 } 11760 for { 11761 next, err := page.fn(ctx, page.vmlr) 11762 if err != nil { 11763 return err 11764 } 11765 page.vmlr = next 11766 if !next.hasNextLink() || !next.IsEmpty() { 11767 break 11768 } 11769 } 11770 return nil 11771} 11772 11773// Next advances to the next page of values. If there was an error making 11774// the request the page does not advance and the error is returned. 11775// Deprecated: Use NextWithContext() instead. 11776func (page *VirtualMachineListResultPage) Next() error { 11777 return page.NextWithContext(context.Background()) 11778} 11779 11780// NotDone returns true if the page enumeration should be started or is not yet complete. 11781func (page VirtualMachineListResultPage) NotDone() bool { 11782 return !page.vmlr.IsEmpty() 11783} 11784 11785// Response returns the raw server response from the last page request. 11786func (page VirtualMachineListResultPage) Response() VirtualMachineListResult { 11787 return page.vmlr 11788} 11789 11790// Values returns the slice of values for the current page or nil if there are no values. 11791func (page VirtualMachineListResultPage) Values() []VirtualMachine { 11792 if page.vmlr.IsEmpty() { 11793 return nil 11794 } 11795 return *page.vmlr.Value 11796} 11797 11798// Creates a new instance of the VirtualMachineListResultPage type. 11799func NewVirtualMachineListResultPage(cur VirtualMachineListResult, getNextPage func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error)) VirtualMachineListResultPage { 11800 return VirtualMachineListResultPage{ 11801 fn: getNextPage, 11802 vmlr: cur, 11803 } 11804} 11805 11806// VirtualMachinePatchStatus the status of virtual machine patch operations. 11807type VirtualMachinePatchStatus struct { 11808 // AvailablePatchSummary - The available patch summary of the latest assessment operation for the virtual machine. 11809 AvailablePatchSummary *AvailablePatchSummary `json:"availablePatchSummary,omitempty"` 11810 // LastPatchInstallationSummary - The installation summary of the latest installation operation for the virtual machine. 11811 LastPatchInstallationSummary *LastPatchInstallationSummary `json:"lastPatchInstallationSummary,omitempty"` 11812} 11813 11814// VirtualMachineProperties describes the properties of a Virtual Machine. 11815type VirtualMachineProperties struct { 11816 // HardwareProfile - Specifies the hardware settings for the virtual machine. 11817 HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` 11818 // StorageProfile - Specifies the storage settings for the virtual machine disks. 11819 StorageProfile *StorageProfile `json:"storageProfile,omitempty"` 11820 // AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the virtual machine. 11821 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 11822 // OsProfile - Specifies the operating system settings used while creating the virtual machine. Some of the settings cannot be changed once VM is provisioned. 11823 OsProfile *OSProfile `json:"osProfile,omitempty"` 11824 // NetworkProfile - Specifies the network interfaces of the virtual machine. 11825 NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` 11826 // SecurityProfile - Specifies the Security related profile settings for the virtual machine. 11827 SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` 11828 // DiagnosticsProfile - Specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. 11829 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 11830 // AvailabilitySet - Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see [Manage the availability of virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). <br><br> For more information on Azure planned maintenance, see [Planned maintenance for virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) <br><br> Currently, a VM can only be added to availability set at creation time. The availability set to which the VM is being added should be under the same resource group as the availability set resource. An existing VM cannot be added to an availability set. <br><br>This property cannot exist along with a non-null properties.virtualMachineScaleSet reference. 11831 AvailabilitySet *SubResource `json:"availabilitySet,omitempty"` 11832 // 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 11833 VirtualMachineScaleSet *SubResource `json:"virtualMachineScaleSet,omitempty"` 11834 // ProximityPlacementGroup - Specifies information about the proximity placement group that the virtual machine should be assigned to. <br><br>Minimum api-version: 2018-04-01. 11835 ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` 11836 // Priority - Specifies the priority for the virtual machine. <br><br>Minimum api-version: 2019-03-01. Possible values include: 'Regular', 'Low', 'Spot' 11837 Priority VirtualMachinePriorityTypes `json:"priority,omitempty"` 11838 // EvictionPolicy - Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set. <br><br>For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01. <br><br>For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. Possible values include: 'Deallocate', 'Delete' 11839 EvictionPolicy VirtualMachineEvictionPolicyTypes `json:"evictionPolicy,omitempty"` 11840 // BillingProfile - Specifies the billing related details of a Azure Spot virtual machine. <br><br>Minimum api-version: 2019-03-01. 11841 BillingProfile *BillingProfile `json:"billingProfile,omitempty"` 11842 // Host - Specifies information about the dedicated host that the virtual machine resides in. <br><br>Minimum api-version: 2018-10-01. 11843 Host *SubResource `json:"host,omitempty"` 11844 // 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. 11845 HostGroup *SubResource `json:"hostGroup,omitempty"` 11846 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 11847 ProvisioningState *string `json:"provisioningState,omitempty"` 11848 // InstanceView - READ-ONLY; The virtual machine instance view. 11849 InstanceView *VirtualMachineInstanceView `json:"instanceView,omitempty"` 11850 // 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 11851 LicenseType *string `json:"licenseType,omitempty"` 11852 // 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. 11853 VMID *string `json:"vmId,omitempty"` 11854 // 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 11855 ExtensionsTimeBudget *string `json:"extensionsTimeBudget,omitempty"` 11856} 11857 11858// MarshalJSON is the custom marshaler for VirtualMachineProperties. 11859func (vmp VirtualMachineProperties) MarshalJSON() ([]byte, error) { 11860 objectMap := make(map[string]interface{}) 11861 if vmp.HardwareProfile != nil { 11862 objectMap["hardwareProfile"] = vmp.HardwareProfile 11863 } 11864 if vmp.StorageProfile != nil { 11865 objectMap["storageProfile"] = vmp.StorageProfile 11866 } 11867 if vmp.AdditionalCapabilities != nil { 11868 objectMap["additionalCapabilities"] = vmp.AdditionalCapabilities 11869 } 11870 if vmp.OsProfile != nil { 11871 objectMap["osProfile"] = vmp.OsProfile 11872 } 11873 if vmp.NetworkProfile != nil { 11874 objectMap["networkProfile"] = vmp.NetworkProfile 11875 } 11876 if vmp.SecurityProfile != nil { 11877 objectMap["securityProfile"] = vmp.SecurityProfile 11878 } 11879 if vmp.DiagnosticsProfile != nil { 11880 objectMap["diagnosticsProfile"] = vmp.DiagnosticsProfile 11881 } 11882 if vmp.AvailabilitySet != nil { 11883 objectMap["availabilitySet"] = vmp.AvailabilitySet 11884 } 11885 if vmp.VirtualMachineScaleSet != nil { 11886 objectMap["virtualMachineScaleSet"] = vmp.VirtualMachineScaleSet 11887 } 11888 if vmp.ProximityPlacementGroup != nil { 11889 objectMap["proximityPlacementGroup"] = vmp.ProximityPlacementGroup 11890 } 11891 if vmp.Priority != "" { 11892 objectMap["priority"] = vmp.Priority 11893 } 11894 if vmp.EvictionPolicy != "" { 11895 objectMap["evictionPolicy"] = vmp.EvictionPolicy 11896 } 11897 if vmp.BillingProfile != nil { 11898 objectMap["billingProfile"] = vmp.BillingProfile 11899 } 11900 if vmp.Host != nil { 11901 objectMap["host"] = vmp.Host 11902 } 11903 if vmp.HostGroup != nil { 11904 objectMap["hostGroup"] = vmp.HostGroup 11905 } 11906 if vmp.LicenseType != nil { 11907 objectMap["licenseType"] = vmp.LicenseType 11908 } 11909 if vmp.ExtensionsTimeBudget != nil { 11910 objectMap["extensionsTimeBudget"] = vmp.ExtensionsTimeBudget 11911 } 11912 return json.Marshal(objectMap) 11913} 11914 11915// VirtualMachineReimageParameters parameters for Reimaging Virtual Machine. NOTE: Virtual Machine OS disk 11916// will always be reimaged 11917type VirtualMachineReimageParameters struct { 11918 // 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. 11919 TempDisk *bool `json:"tempDisk,omitempty"` 11920} 11921 11922// VirtualMachineRunCommand describes a Virtual Machine run command. 11923type VirtualMachineRunCommand struct { 11924 autorest.Response `json:"-"` 11925 *VirtualMachineRunCommandProperties `json:"properties,omitempty"` 11926 // ID - READ-ONLY; Resource Id 11927 ID *string `json:"id,omitempty"` 11928 // Name - READ-ONLY; Resource name 11929 Name *string `json:"name,omitempty"` 11930 // Type - READ-ONLY; Resource type 11931 Type *string `json:"type,omitempty"` 11932 // Location - Resource location 11933 Location *string `json:"location,omitempty"` 11934 // Tags - Resource tags 11935 Tags map[string]*string `json:"tags"` 11936} 11937 11938// MarshalJSON is the custom marshaler for VirtualMachineRunCommand. 11939func (vmrc VirtualMachineRunCommand) MarshalJSON() ([]byte, error) { 11940 objectMap := make(map[string]interface{}) 11941 if vmrc.VirtualMachineRunCommandProperties != nil { 11942 objectMap["properties"] = vmrc.VirtualMachineRunCommandProperties 11943 } 11944 if vmrc.Location != nil { 11945 objectMap["location"] = vmrc.Location 11946 } 11947 if vmrc.Tags != nil { 11948 objectMap["tags"] = vmrc.Tags 11949 } 11950 return json.Marshal(objectMap) 11951} 11952 11953// UnmarshalJSON is the custom unmarshaler for VirtualMachineRunCommand struct. 11954func (vmrc *VirtualMachineRunCommand) UnmarshalJSON(body []byte) error { 11955 var m map[string]*json.RawMessage 11956 err := json.Unmarshal(body, &m) 11957 if err != nil { 11958 return err 11959 } 11960 for k, v := range m { 11961 switch k { 11962 case "properties": 11963 if v != nil { 11964 var virtualMachineRunCommandProperties VirtualMachineRunCommandProperties 11965 err = json.Unmarshal(*v, &virtualMachineRunCommandProperties) 11966 if err != nil { 11967 return err 11968 } 11969 vmrc.VirtualMachineRunCommandProperties = &virtualMachineRunCommandProperties 11970 } 11971 case "id": 11972 if v != nil { 11973 var ID string 11974 err = json.Unmarshal(*v, &ID) 11975 if err != nil { 11976 return err 11977 } 11978 vmrc.ID = &ID 11979 } 11980 case "name": 11981 if v != nil { 11982 var name string 11983 err = json.Unmarshal(*v, &name) 11984 if err != nil { 11985 return err 11986 } 11987 vmrc.Name = &name 11988 } 11989 case "type": 11990 if v != nil { 11991 var typeVar string 11992 err = json.Unmarshal(*v, &typeVar) 11993 if err != nil { 11994 return err 11995 } 11996 vmrc.Type = &typeVar 11997 } 11998 case "location": 11999 if v != nil { 12000 var location string 12001 err = json.Unmarshal(*v, &location) 12002 if err != nil { 12003 return err 12004 } 12005 vmrc.Location = &location 12006 } 12007 case "tags": 12008 if v != nil { 12009 var tags map[string]*string 12010 err = json.Unmarshal(*v, &tags) 12011 if err != nil { 12012 return err 12013 } 12014 vmrc.Tags = tags 12015 } 12016 } 12017 } 12018 12019 return nil 12020} 12021 12022// VirtualMachineRunCommandInstanceView the instance view of a virtual machine run command. 12023type VirtualMachineRunCommandInstanceView struct { 12024 // ExecutionState - Script execution status. Possible values include: 'ExecutionStateUnknown', 'ExecutionStatePending', 'ExecutionStateRunning', 'ExecutionStateFailed', 'ExecutionStateSucceeded', 'ExecutionStateTimedOut', 'ExecutionStateCanceled' 12025 ExecutionState ExecutionState `json:"executionState,omitempty"` 12026 // ExecutionMessage - Communicate script configuration errors or execution messages. 12027 ExecutionMessage *string `json:"executionMessage,omitempty"` 12028 // ExitCode - Exit code returned from script execution. 12029 ExitCode *int32 `json:"exitCode,omitempty"` 12030 // Output - Script output stream. 12031 Output *string `json:"output,omitempty"` 12032 // Error - Script error stream. 12033 Error *string `json:"error,omitempty"` 12034 // StartTime - Script start time. 12035 StartTime *date.Time `json:"startTime,omitempty"` 12036 // EndTime - Script end time. 12037 EndTime *date.Time `json:"endTime,omitempty"` 12038 // Statuses - The resource status information. 12039 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 12040} 12041 12042// VirtualMachineRunCommandProperties describes the properties of a Virtual Machine run command. 12043type VirtualMachineRunCommandProperties struct { 12044 // Source - The source of the run command script. 12045 Source *VirtualMachineRunCommandScriptSource `json:"source,omitempty"` 12046 // Parameters - The parameters used by the script. 12047 Parameters *[]RunCommandInputParameter `json:"parameters,omitempty"` 12048 // ProtectedParameters - The parameters used by the script. 12049 ProtectedParameters *[]RunCommandInputParameter `json:"protectedParameters,omitempty"` 12050 // AsyncExecution - Optional. If set to true, provisioning will complete as soon as the script starts and will not wait for script to complete. 12051 AsyncExecution *bool `json:"asyncExecution,omitempty"` 12052 // RunAsUser - Specifies the user account on the VM when executing the run command. 12053 RunAsUser *string `json:"runAsUser,omitempty"` 12054 // RunAsPassword - Specifies the user account password on the VM when executing the run command. 12055 RunAsPassword *string `json:"runAsPassword,omitempty"` 12056 // TimeoutInSeconds - The timeout in seconds to execute the run command. 12057 TimeoutInSeconds *int32 `json:"timeoutInSeconds,omitempty"` 12058 // OutputBlobURI - Specifies the Azure storage blob where script output stream will be uploaded. 12059 OutputBlobURI *string `json:"outputBlobUri,omitempty"` 12060 // ErrorBlobURI - Specifies the Azure storage blob where script error stream will be uploaded. 12061 ErrorBlobURI *string `json:"errorBlobUri,omitempty"` 12062 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 12063 ProvisioningState *string `json:"provisioningState,omitempty"` 12064 // InstanceView - READ-ONLY; The virtual machine run command instance view. 12065 InstanceView *VirtualMachineRunCommandInstanceView `json:"instanceView,omitempty"` 12066} 12067 12068// MarshalJSON is the custom marshaler for VirtualMachineRunCommandProperties. 12069func (vmrcp VirtualMachineRunCommandProperties) MarshalJSON() ([]byte, error) { 12070 objectMap := make(map[string]interface{}) 12071 if vmrcp.Source != nil { 12072 objectMap["source"] = vmrcp.Source 12073 } 12074 if vmrcp.Parameters != nil { 12075 objectMap["parameters"] = vmrcp.Parameters 12076 } 12077 if vmrcp.ProtectedParameters != nil { 12078 objectMap["protectedParameters"] = vmrcp.ProtectedParameters 12079 } 12080 if vmrcp.AsyncExecution != nil { 12081 objectMap["asyncExecution"] = vmrcp.AsyncExecution 12082 } 12083 if vmrcp.RunAsUser != nil { 12084 objectMap["runAsUser"] = vmrcp.RunAsUser 12085 } 12086 if vmrcp.RunAsPassword != nil { 12087 objectMap["runAsPassword"] = vmrcp.RunAsPassword 12088 } 12089 if vmrcp.TimeoutInSeconds != nil { 12090 objectMap["timeoutInSeconds"] = vmrcp.TimeoutInSeconds 12091 } 12092 if vmrcp.OutputBlobURI != nil { 12093 objectMap["outputBlobUri"] = vmrcp.OutputBlobURI 12094 } 12095 if vmrcp.ErrorBlobURI != nil { 12096 objectMap["errorBlobUri"] = vmrcp.ErrorBlobURI 12097 } 12098 return json.Marshal(objectMap) 12099} 12100 12101// VirtualMachineRunCommandsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results 12102// of a long-running operation. 12103type VirtualMachineRunCommandsCreateOrUpdateFuture struct { 12104 azure.FutureAPI 12105 // Result returns the result of the asynchronous operation. 12106 // If the operation has not completed it will return an error. 12107 Result func(VirtualMachineRunCommandsClient) (VirtualMachineRunCommand, error) 12108} 12109 12110// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12111func (future *VirtualMachineRunCommandsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 12112 var azFuture azure.Future 12113 if err := json.Unmarshal(body, &azFuture); err != nil { 12114 return err 12115 } 12116 future.FutureAPI = &azFuture 12117 future.Result = future.result 12118 return nil 12119} 12120 12121// result is the default implementation for VirtualMachineRunCommandsCreateOrUpdateFuture.Result. 12122func (future *VirtualMachineRunCommandsCreateOrUpdateFuture) result(client VirtualMachineRunCommandsClient) (vmrc VirtualMachineRunCommand, err error) { 12123 var done bool 12124 done, err = future.DoneWithContext(context.Background(), client) 12125 if err != nil { 12126 err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 12127 return 12128 } 12129 if !done { 12130 vmrc.Response.Response = future.Response() 12131 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineRunCommandsCreateOrUpdateFuture") 12132 return 12133 } 12134 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 12135 if vmrc.Response.Response, err = future.GetResult(sender); err == nil && vmrc.Response.Response.StatusCode != http.StatusNoContent { 12136 vmrc, err = client.CreateOrUpdateResponder(vmrc.Response.Response) 12137 if err != nil { 12138 err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsCreateOrUpdateFuture", "Result", vmrc.Response.Response, "Failure responding to request") 12139 } 12140 } 12141 return 12142} 12143 12144// VirtualMachineRunCommandScriptSource describes the script sources for run command. 12145type VirtualMachineRunCommandScriptSource struct { 12146 // Script - Specifies the script content to be executed on the VM. 12147 Script *string `json:"script,omitempty"` 12148 // ScriptURI - Specifies the script download location. 12149 ScriptURI *string `json:"scriptUri,omitempty"` 12150 // CommandID - Specifies a commandId of predefined built-in script. 12151 CommandID *string `json:"commandId,omitempty"` 12152} 12153 12154// VirtualMachineRunCommandsDeleteFuture an abstraction for monitoring and retrieving the results of a 12155// long-running operation. 12156type VirtualMachineRunCommandsDeleteFuture struct { 12157 azure.FutureAPI 12158 // Result returns the result of the asynchronous operation. 12159 // If the operation has not completed it will return an error. 12160 Result func(VirtualMachineRunCommandsClient) (autorest.Response, error) 12161} 12162 12163// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12164func (future *VirtualMachineRunCommandsDeleteFuture) UnmarshalJSON(body []byte) error { 12165 var azFuture azure.Future 12166 if err := json.Unmarshal(body, &azFuture); err != nil { 12167 return err 12168 } 12169 future.FutureAPI = &azFuture 12170 future.Result = future.result 12171 return nil 12172} 12173 12174// result is the default implementation for VirtualMachineRunCommandsDeleteFuture.Result. 12175func (future *VirtualMachineRunCommandsDeleteFuture) result(client VirtualMachineRunCommandsClient) (ar autorest.Response, err error) { 12176 var done bool 12177 done, err = future.DoneWithContext(context.Background(), client) 12178 if err != nil { 12179 err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsDeleteFuture", "Result", future.Response(), "Polling failure") 12180 return 12181 } 12182 if !done { 12183 ar.Response = future.Response() 12184 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineRunCommandsDeleteFuture") 12185 return 12186 } 12187 ar.Response = future.Response() 12188 return 12189} 12190 12191// VirtualMachineRunCommandsListResult the List run command operation response 12192type VirtualMachineRunCommandsListResult struct { 12193 autorest.Response `json:"-"` 12194 // Value - The list of run commands 12195 Value *[]VirtualMachineRunCommand `json:"value,omitempty"` 12196 // NextLink - The uri to fetch the next page of run commands. 12197 NextLink *string `json:"nextLink,omitempty"` 12198} 12199 12200// VirtualMachineRunCommandsListResultIterator provides access to a complete listing of 12201// VirtualMachineRunCommand values. 12202type VirtualMachineRunCommandsListResultIterator struct { 12203 i int 12204 page VirtualMachineRunCommandsListResultPage 12205} 12206 12207// NextWithContext advances to the next value. If there was an error making 12208// the request the iterator does not advance and the error is returned. 12209func (iter *VirtualMachineRunCommandsListResultIterator) NextWithContext(ctx context.Context) (err error) { 12210 if tracing.IsEnabled() { 12211 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsListResultIterator.NextWithContext") 12212 defer func() { 12213 sc := -1 12214 if iter.Response().Response.Response != nil { 12215 sc = iter.Response().Response.Response.StatusCode 12216 } 12217 tracing.EndSpan(ctx, sc, err) 12218 }() 12219 } 12220 iter.i++ 12221 if iter.i < len(iter.page.Values()) { 12222 return nil 12223 } 12224 err = iter.page.NextWithContext(ctx) 12225 if err != nil { 12226 iter.i-- 12227 return err 12228 } 12229 iter.i = 0 12230 return nil 12231} 12232 12233// Next advances to the next value. If there was an error making 12234// the request the iterator does not advance and the error is returned. 12235// Deprecated: Use NextWithContext() instead. 12236func (iter *VirtualMachineRunCommandsListResultIterator) Next() error { 12237 return iter.NextWithContext(context.Background()) 12238} 12239 12240// NotDone returns true if the enumeration should be started or is not yet complete. 12241func (iter VirtualMachineRunCommandsListResultIterator) NotDone() bool { 12242 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 12243} 12244 12245// Response returns the raw server response from the last page request. 12246func (iter VirtualMachineRunCommandsListResultIterator) Response() VirtualMachineRunCommandsListResult { 12247 return iter.page.Response() 12248} 12249 12250// Value returns the current value or a zero-initialized value if the 12251// iterator has advanced beyond the end of the collection. 12252func (iter VirtualMachineRunCommandsListResultIterator) Value() VirtualMachineRunCommand { 12253 if !iter.page.NotDone() { 12254 return VirtualMachineRunCommand{} 12255 } 12256 return iter.page.Values()[iter.i] 12257} 12258 12259// Creates a new instance of the VirtualMachineRunCommandsListResultIterator type. 12260func NewVirtualMachineRunCommandsListResultIterator(page VirtualMachineRunCommandsListResultPage) VirtualMachineRunCommandsListResultIterator { 12261 return VirtualMachineRunCommandsListResultIterator{page: page} 12262} 12263 12264// IsEmpty returns true if the ListResult contains no values. 12265func (vmrclr VirtualMachineRunCommandsListResult) IsEmpty() bool { 12266 return vmrclr.Value == nil || len(*vmrclr.Value) == 0 12267} 12268 12269// hasNextLink returns true if the NextLink is not empty. 12270func (vmrclr VirtualMachineRunCommandsListResult) hasNextLink() bool { 12271 return vmrclr.NextLink != nil && len(*vmrclr.NextLink) != 0 12272} 12273 12274// virtualMachineRunCommandsListResultPreparer prepares a request to retrieve the next set of results. 12275// It returns nil if no more results exist. 12276func (vmrclr VirtualMachineRunCommandsListResult) virtualMachineRunCommandsListResultPreparer(ctx context.Context) (*http.Request, error) { 12277 if !vmrclr.hasNextLink() { 12278 return nil, nil 12279 } 12280 return autorest.Prepare((&http.Request{}).WithContext(ctx), 12281 autorest.AsJSON(), 12282 autorest.AsGet(), 12283 autorest.WithBaseURL(to.String(vmrclr.NextLink))) 12284} 12285 12286// VirtualMachineRunCommandsListResultPage contains a page of VirtualMachineRunCommand values. 12287type VirtualMachineRunCommandsListResultPage struct { 12288 fn func(context.Context, VirtualMachineRunCommandsListResult) (VirtualMachineRunCommandsListResult, error) 12289 vmrclr VirtualMachineRunCommandsListResult 12290} 12291 12292// NextWithContext advances to the next page of values. If there was an error making 12293// the request the page does not advance and the error is returned. 12294func (page *VirtualMachineRunCommandsListResultPage) NextWithContext(ctx context.Context) (err error) { 12295 if tracing.IsEnabled() { 12296 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsListResultPage.NextWithContext") 12297 defer func() { 12298 sc := -1 12299 if page.Response().Response.Response != nil { 12300 sc = page.Response().Response.Response.StatusCode 12301 } 12302 tracing.EndSpan(ctx, sc, err) 12303 }() 12304 } 12305 for { 12306 next, err := page.fn(ctx, page.vmrclr) 12307 if err != nil { 12308 return err 12309 } 12310 page.vmrclr = next 12311 if !next.hasNextLink() || !next.IsEmpty() { 12312 break 12313 } 12314 } 12315 return nil 12316} 12317 12318// Next advances to the next page of values. If there was an error making 12319// the request the page does not advance and the error is returned. 12320// Deprecated: Use NextWithContext() instead. 12321func (page *VirtualMachineRunCommandsListResultPage) Next() error { 12322 return page.NextWithContext(context.Background()) 12323} 12324 12325// NotDone returns true if the page enumeration should be started or is not yet complete. 12326func (page VirtualMachineRunCommandsListResultPage) NotDone() bool { 12327 return !page.vmrclr.IsEmpty() 12328} 12329 12330// Response returns the raw server response from the last page request. 12331func (page VirtualMachineRunCommandsListResultPage) Response() VirtualMachineRunCommandsListResult { 12332 return page.vmrclr 12333} 12334 12335// Values returns the slice of values for the current page or nil if there are no values. 12336func (page VirtualMachineRunCommandsListResultPage) Values() []VirtualMachineRunCommand { 12337 if page.vmrclr.IsEmpty() { 12338 return nil 12339 } 12340 return *page.vmrclr.Value 12341} 12342 12343// Creates a new instance of the VirtualMachineRunCommandsListResultPage type. 12344func NewVirtualMachineRunCommandsListResultPage(cur VirtualMachineRunCommandsListResult, getNextPage func(context.Context, VirtualMachineRunCommandsListResult) (VirtualMachineRunCommandsListResult, error)) VirtualMachineRunCommandsListResultPage { 12345 return VirtualMachineRunCommandsListResultPage{ 12346 fn: getNextPage, 12347 vmrclr: cur, 12348 } 12349} 12350 12351// VirtualMachineRunCommandsUpdateFuture an abstraction for monitoring and retrieving the results of a 12352// long-running operation. 12353type VirtualMachineRunCommandsUpdateFuture struct { 12354 azure.FutureAPI 12355 // Result returns the result of the asynchronous operation. 12356 // If the operation has not completed it will return an error. 12357 Result func(VirtualMachineRunCommandsClient) (VirtualMachineRunCommand, error) 12358} 12359 12360// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12361func (future *VirtualMachineRunCommandsUpdateFuture) UnmarshalJSON(body []byte) error { 12362 var azFuture azure.Future 12363 if err := json.Unmarshal(body, &azFuture); err != nil { 12364 return err 12365 } 12366 future.FutureAPI = &azFuture 12367 future.Result = future.result 12368 return nil 12369} 12370 12371// result is the default implementation for VirtualMachineRunCommandsUpdateFuture.Result. 12372func (future *VirtualMachineRunCommandsUpdateFuture) result(client VirtualMachineRunCommandsClient) (vmrc VirtualMachineRunCommand, err error) { 12373 var done bool 12374 done, err = future.DoneWithContext(context.Background(), client) 12375 if err != nil { 12376 err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsUpdateFuture", "Result", future.Response(), "Polling failure") 12377 return 12378 } 12379 if !done { 12380 vmrc.Response.Response = future.Response() 12381 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineRunCommandsUpdateFuture") 12382 return 12383 } 12384 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 12385 if vmrc.Response.Response, err = future.GetResult(sender); err == nil && vmrc.Response.Response.StatusCode != http.StatusNoContent { 12386 vmrc, err = client.UpdateResponder(vmrc.Response.Response) 12387 if err != nil { 12388 err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsUpdateFuture", "Result", vmrc.Response.Response, "Failure responding to request") 12389 } 12390 } 12391 return 12392} 12393 12394// VirtualMachineRunCommandUpdate describes a Virtual Machine run command. 12395type VirtualMachineRunCommandUpdate struct { 12396 *VirtualMachineRunCommandProperties `json:"properties,omitempty"` 12397 // Tags - Resource tags 12398 Tags map[string]*string `json:"tags"` 12399} 12400 12401// MarshalJSON is the custom marshaler for VirtualMachineRunCommandUpdate. 12402func (vmrcu VirtualMachineRunCommandUpdate) MarshalJSON() ([]byte, error) { 12403 objectMap := make(map[string]interface{}) 12404 if vmrcu.VirtualMachineRunCommandProperties != nil { 12405 objectMap["properties"] = vmrcu.VirtualMachineRunCommandProperties 12406 } 12407 if vmrcu.Tags != nil { 12408 objectMap["tags"] = vmrcu.Tags 12409 } 12410 return json.Marshal(objectMap) 12411} 12412 12413// UnmarshalJSON is the custom unmarshaler for VirtualMachineRunCommandUpdate struct. 12414func (vmrcu *VirtualMachineRunCommandUpdate) UnmarshalJSON(body []byte) error { 12415 var m map[string]*json.RawMessage 12416 err := json.Unmarshal(body, &m) 12417 if err != nil { 12418 return err 12419 } 12420 for k, v := range m { 12421 switch k { 12422 case "properties": 12423 if v != nil { 12424 var virtualMachineRunCommandProperties VirtualMachineRunCommandProperties 12425 err = json.Unmarshal(*v, &virtualMachineRunCommandProperties) 12426 if err != nil { 12427 return err 12428 } 12429 vmrcu.VirtualMachineRunCommandProperties = &virtualMachineRunCommandProperties 12430 } 12431 case "tags": 12432 if v != nil { 12433 var tags map[string]*string 12434 err = json.Unmarshal(*v, &tags) 12435 if err != nil { 12436 return err 12437 } 12438 vmrcu.Tags = tags 12439 } 12440 } 12441 } 12442 12443 return nil 12444} 12445 12446// VirtualMachinesAssessPatchesFuture an abstraction for monitoring and retrieving the results of a 12447// long-running operation. 12448type VirtualMachinesAssessPatchesFuture struct { 12449 azure.FutureAPI 12450 // Result returns the result of the asynchronous operation. 12451 // If the operation has not completed it will return an error. 12452 Result func(VirtualMachinesClient) (VirtualMachineAssessPatchesResult, error) 12453} 12454 12455// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12456func (future *VirtualMachinesAssessPatchesFuture) UnmarshalJSON(body []byte) error { 12457 var azFuture azure.Future 12458 if err := json.Unmarshal(body, &azFuture); err != nil { 12459 return err 12460 } 12461 future.FutureAPI = &azFuture 12462 future.Result = future.result 12463 return nil 12464} 12465 12466// result is the default implementation for VirtualMachinesAssessPatchesFuture.Result. 12467func (future *VirtualMachinesAssessPatchesFuture) result(client VirtualMachinesClient) (vmapr VirtualMachineAssessPatchesResult, err error) { 12468 var done bool 12469 done, err = future.DoneWithContext(context.Background(), client) 12470 if err != nil { 12471 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesAssessPatchesFuture", "Result", future.Response(), "Polling failure") 12472 return 12473 } 12474 if !done { 12475 vmapr.Response.Response = future.Response() 12476 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesAssessPatchesFuture") 12477 return 12478 } 12479 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 12480 if vmapr.Response.Response, err = future.GetResult(sender); err == nil && vmapr.Response.Response.StatusCode != http.StatusNoContent { 12481 vmapr, err = client.AssessPatchesResponder(vmapr.Response.Response) 12482 if err != nil { 12483 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesAssessPatchesFuture", "Result", vmapr.Response.Response, "Failure responding to request") 12484 } 12485 } 12486 return 12487} 12488 12489// VirtualMachineScaleSet describes a Virtual Machine Scale Set. 12490type VirtualMachineScaleSet struct { 12491 autorest.Response `json:"-"` 12492 // Sku - The virtual machine scale set sku. 12493 Sku *Sku `json:"sku,omitempty"` 12494 // 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**. 12495 Plan *Plan `json:"plan,omitempty"` 12496 *VirtualMachineScaleSetProperties `json:"properties,omitempty"` 12497 // Identity - The identity of the virtual machine scale set, if configured. 12498 Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"` 12499 // Zones - The virtual machine scale set zones. NOTE: Availability zones can only be set when you create the scale set 12500 Zones *[]string `json:"zones,omitempty"` 12501 // ID - READ-ONLY; Resource Id 12502 ID *string `json:"id,omitempty"` 12503 // Name - READ-ONLY; Resource name 12504 Name *string `json:"name,omitempty"` 12505 // Type - READ-ONLY; Resource type 12506 Type *string `json:"type,omitempty"` 12507 // Location - Resource location 12508 Location *string `json:"location,omitempty"` 12509 // Tags - Resource tags 12510 Tags map[string]*string `json:"tags"` 12511} 12512 12513// MarshalJSON is the custom marshaler for VirtualMachineScaleSet. 12514func (vmss VirtualMachineScaleSet) MarshalJSON() ([]byte, error) { 12515 objectMap := make(map[string]interface{}) 12516 if vmss.Sku != nil { 12517 objectMap["sku"] = vmss.Sku 12518 } 12519 if vmss.Plan != nil { 12520 objectMap["plan"] = vmss.Plan 12521 } 12522 if vmss.VirtualMachineScaleSetProperties != nil { 12523 objectMap["properties"] = vmss.VirtualMachineScaleSetProperties 12524 } 12525 if vmss.Identity != nil { 12526 objectMap["identity"] = vmss.Identity 12527 } 12528 if vmss.Zones != nil { 12529 objectMap["zones"] = vmss.Zones 12530 } 12531 if vmss.Location != nil { 12532 objectMap["location"] = vmss.Location 12533 } 12534 if vmss.Tags != nil { 12535 objectMap["tags"] = vmss.Tags 12536 } 12537 return json.Marshal(objectMap) 12538} 12539 12540// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSet struct. 12541func (vmss *VirtualMachineScaleSet) UnmarshalJSON(body []byte) error { 12542 var m map[string]*json.RawMessage 12543 err := json.Unmarshal(body, &m) 12544 if err != nil { 12545 return err 12546 } 12547 for k, v := range m { 12548 switch k { 12549 case "sku": 12550 if v != nil { 12551 var sku Sku 12552 err = json.Unmarshal(*v, &sku) 12553 if err != nil { 12554 return err 12555 } 12556 vmss.Sku = &sku 12557 } 12558 case "plan": 12559 if v != nil { 12560 var plan Plan 12561 err = json.Unmarshal(*v, &plan) 12562 if err != nil { 12563 return err 12564 } 12565 vmss.Plan = &plan 12566 } 12567 case "properties": 12568 if v != nil { 12569 var virtualMachineScaleSetProperties VirtualMachineScaleSetProperties 12570 err = json.Unmarshal(*v, &virtualMachineScaleSetProperties) 12571 if err != nil { 12572 return err 12573 } 12574 vmss.VirtualMachineScaleSetProperties = &virtualMachineScaleSetProperties 12575 } 12576 case "identity": 12577 if v != nil { 12578 var identity VirtualMachineScaleSetIdentity 12579 err = json.Unmarshal(*v, &identity) 12580 if err != nil { 12581 return err 12582 } 12583 vmss.Identity = &identity 12584 } 12585 case "zones": 12586 if v != nil { 12587 var zones []string 12588 err = json.Unmarshal(*v, &zones) 12589 if err != nil { 12590 return err 12591 } 12592 vmss.Zones = &zones 12593 } 12594 case "id": 12595 if v != nil { 12596 var ID string 12597 err = json.Unmarshal(*v, &ID) 12598 if err != nil { 12599 return err 12600 } 12601 vmss.ID = &ID 12602 } 12603 case "name": 12604 if v != nil { 12605 var name string 12606 err = json.Unmarshal(*v, &name) 12607 if err != nil { 12608 return err 12609 } 12610 vmss.Name = &name 12611 } 12612 case "type": 12613 if v != nil { 12614 var typeVar string 12615 err = json.Unmarshal(*v, &typeVar) 12616 if err != nil { 12617 return err 12618 } 12619 vmss.Type = &typeVar 12620 } 12621 case "location": 12622 if v != nil { 12623 var location string 12624 err = json.Unmarshal(*v, &location) 12625 if err != nil { 12626 return err 12627 } 12628 vmss.Location = &location 12629 } 12630 case "tags": 12631 if v != nil { 12632 var tags map[string]*string 12633 err = json.Unmarshal(*v, &tags) 12634 if err != nil { 12635 return err 12636 } 12637 vmss.Tags = tags 12638 } 12639 } 12640 } 12641 12642 return nil 12643} 12644 12645// VirtualMachineScaleSetDataDisk describes a virtual machine scale set data disk. 12646type VirtualMachineScaleSetDataDisk struct { 12647 // Name - The disk name. 12648 Name *string `json:"name,omitempty"` 12649 // 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. 12650 Lun *int32 `json:"lun,omitempty"` 12651 // 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' 12652 Caching CachingTypes `json:"caching,omitempty"` 12653 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 12654 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 12655 // CreateOption - The create option. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' 12656 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 12657 // 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 12658 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 12659 // ManagedDisk - The managed disk parameters. 12660 ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` 12661 // 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. 12662 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 12663 // 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. 12664 DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` 12665} 12666 12667// VirtualMachineScaleSetExtension describes a Virtual Machine Scale Set Extension. 12668type VirtualMachineScaleSetExtension struct { 12669 autorest.Response `json:"-"` 12670 // Name - The name of the extension. 12671 Name *string `json:"name,omitempty"` 12672 // Type - READ-ONLY; Resource type 12673 Type *string `json:"type,omitempty"` 12674 *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"` 12675 // ID - READ-ONLY; Resource Id 12676 ID *string `json:"id,omitempty"` 12677} 12678 12679// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtension. 12680func (vmsse VirtualMachineScaleSetExtension) MarshalJSON() ([]byte, error) { 12681 objectMap := make(map[string]interface{}) 12682 if vmsse.Name != nil { 12683 objectMap["name"] = vmsse.Name 12684 } 12685 if vmsse.VirtualMachineScaleSetExtensionProperties != nil { 12686 objectMap["properties"] = vmsse.VirtualMachineScaleSetExtensionProperties 12687 } 12688 return json.Marshal(objectMap) 12689} 12690 12691// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetExtension struct. 12692func (vmsse *VirtualMachineScaleSetExtension) UnmarshalJSON(body []byte) error { 12693 var m map[string]*json.RawMessage 12694 err := json.Unmarshal(body, &m) 12695 if err != nil { 12696 return err 12697 } 12698 for k, v := range m { 12699 switch k { 12700 case "name": 12701 if v != nil { 12702 var name string 12703 err = json.Unmarshal(*v, &name) 12704 if err != nil { 12705 return err 12706 } 12707 vmsse.Name = &name 12708 } 12709 case "type": 12710 if v != nil { 12711 var typeVar string 12712 err = json.Unmarshal(*v, &typeVar) 12713 if err != nil { 12714 return err 12715 } 12716 vmsse.Type = &typeVar 12717 } 12718 case "properties": 12719 if v != nil { 12720 var virtualMachineScaleSetExtensionProperties VirtualMachineScaleSetExtensionProperties 12721 err = json.Unmarshal(*v, &virtualMachineScaleSetExtensionProperties) 12722 if err != nil { 12723 return err 12724 } 12725 vmsse.VirtualMachineScaleSetExtensionProperties = &virtualMachineScaleSetExtensionProperties 12726 } 12727 case "id": 12728 if v != nil { 12729 var ID string 12730 err = json.Unmarshal(*v, &ID) 12731 if err != nil { 12732 return err 12733 } 12734 vmsse.ID = &ID 12735 } 12736 } 12737 } 12738 12739 return nil 12740} 12741 12742// VirtualMachineScaleSetExtensionListResult the List VM scale set extension operation response. 12743type VirtualMachineScaleSetExtensionListResult struct { 12744 autorest.Response `json:"-"` 12745 // Value - The list of VM scale set extensions. 12746 Value *[]VirtualMachineScaleSetExtension `json:"value,omitempty"` 12747 // 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. 12748 NextLink *string `json:"nextLink,omitempty"` 12749} 12750 12751// VirtualMachineScaleSetExtensionListResultIterator provides access to a complete listing of 12752// VirtualMachineScaleSetExtension values. 12753type VirtualMachineScaleSetExtensionListResultIterator struct { 12754 i int 12755 page VirtualMachineScaleSetExtensionListResultPage 12756} 12757 12758// NextWithContext advances to the next value. If there was an error making 12759// the request the iterator does not advance and the error is returned. 12760func (iter *VirtualMachineScaleSetExtensionListResultIterator) NextWithContext(ctx context.Context) (err error) { 12761 if tracing.IsEnabled() { 12762 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionListResultIterator.NextWithContext") 12763 defer func() { 12764 sc := -1 12765 if iter.Response().Response.Response != nil { 12766 sc = iter.Response().Response.Response.StatusCode 12767 } 12768 tracing.EndSpan(ctx, sc, err) 12769 }() 12770 } 12771 iter.i++ 12772 if iter.i < len(iter.page.Values()) { 12773 return nil 12774 } 12775 err = iter.page.NextWithContext(ctx) 12776 if err != nil { 12777 iter.i-- 12778 return err 12779 } 12780 iter.i = 0 12781 return nil 12782} 12783 12784// Next advances to the next value. If there was an error making 12785// the request the iterator does not advance and the error is returned. 12786// Deprecated: Use NextWithContext() instead. 12787func (iter *VirtualMachineScaleSetExtensionListResultIterator) Next() error { 12788 return iter.NextWithContext(context.Background()) 12789} 12790 12791// NotDone returns true if the enumeration should be started or is not yet complete. 12792func (iter VirtualMachineScaleSetExtensionListResultIterator) NotDone() bool { 12793 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 12794} 12795 12796// Response returns the raw server response from the last page request. 12797func (iter VirtualMachineScaleSetExtensionListResultIterator) Response() VirtualMachineScaleSetExtensionListResult { 12798 return iter.page.Response() 12799} 12800 12801// Value returns the current value or a zero-initialized value if the 12802// iterator has advanced beyond the end of the collection. 12803func (iter VirtualMachineScaleSetExtensionListResultIterator) Value() VirtualMachineScaleSetExtension { 12804 if !iter.page.NotDone() { 12805 return VirtualMachineScaleSetExtension{} 12806 } 12807 return iter.page.Values()[iter.i] 12808} 12809 12810// Creates a new instance of the VirtualMachineScaleSetExtensionListResultIterator type. 12811func NewVirtualMachineScaleSetExtensionListResultIterator(page VirtualMachineScaleSetExtensionListResultPage) VirtualMachineScaleSetExtensionListResultIterator { 12812 return VirtualMachineScaleSetExtensionListResultIterator{page: page} 12813} 12814 12815// IsEmpty returns true if the ListResult contains no values. 12816func (vmsselr VirtualMachineScaleSetExtensionListResult) IsEmpty() bool { 12817 return vmsselr.Value == nil || len(*vmsselr.Value) == 0 12818} 12819 12820// hasNextLink returns true if the NextLink is not empty. 12821func (vmsselr VirtualMachineScaleSetExtensionListResult) hasNextLink() bool { 12822 return vmsselr.NextLink != nil && len(*vmsselr.NextLink) != 0 12823} 12824 12825// virtualMachineScaleSetExtensionListResultPreparer prepares a request to retrieve the next set of results. 12826// It returns nil if no more results exist. 12827func (vmsselr VirtualMachineScaleSetExtensionListResult) virtualMachineScaleSetExtensionListResultPreparer(ctx context.Context) (*http.Request, error) { 12828 if !vmsselr.hasNextLink() { 12829 return nil, nil 12830 } 12831 return autorest.Prepare((&http.Request{}).WithContext(ctx), 12832 autorest.AsJSON(), 12833 autorest.AsGet(), 12834 autorest.WithBaseURL(to.String(vmsselr.NextLink))) 12835} 12836 12837// VirtualMachineScaleSetExtensionListResultPage contains a page of VirtualMachineScaleSetExtension values. 12838type VirtualMachineScaleSetExtensionListResultPage struct { 12839 fn func(context.Context, VirtualMachineScaleSetExtensionListResult) (VirtualMachineScaleSetExtensionListResult, error) 12840 vmsselr VirtualMachineScaleSetExtensionListResult 12841} 12842 12843// NextWithContext advances to the next page of values. If there was an error making 12844// the request the page does not advance and the error is returned. 12845func (page *VirtualMachineScaleSetExtensionListResultPage) NextWithContext(ctx context.Context) (err error) { 12846 if tracing.IsEnabled() { 12847 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionListResultPage.NextWithContext") 12848 defer func() { 12849 sc := -1 12850 if page.Response().Response.Response != nil { 12851 sc = page.Response().Response.Response.StatusCode 12852 } 12853 tracing.EndSpan(ctx, sc, err) 12854 }() 12855 } 12856 for { 12857 next, err := page.fn(ctx, page.vmsselr) 12858 if err != nil { 12859 return err 12860 } 12861 page.vmsselr = next 12862 if !next.hasNextLink() || !next.IsEmpty() { 12863 break 12864 } 12865 } 12866 return nil 12867} 12868 12869// Next advances to the next page of values. If there was an error making 12870// the request the page does not advance and the error is returned. 12871// Deprecated: Use NextWithContext() instead. 12872func (page *VirtualMachineScaleSetExtensionListResultPage) Next() error { 12873 return page.NextWithContext(context.Background()) 12874} 12875 12876// NotDone returns true if the page enumeration should be started or is not yet complete. 12877func (page VirtualMachineScaleSetExtensionListResultPage) NotDone() bool { 12878 return !page.vmsselr.IsEmpty() 12879} 12880 12881// Response returns the raw server response from the last page request. 12882func (page VirtualMachineScaleSetExtensionListResultPage) Response() VirtualMachineScaleSetExtensionListResult { 12883 return page.vmsselr 12884} 12885 12886// Values returns the slice of values for the current page or nil if there are no values. 12887func (page VirtualMachineScaleSetExtensionListResultPage) Values() []VirtualMachineScaleSetExtension { 12888 if page.vmsselr.IsEmpty() { 12889 return nil 12890 } 12891 return *page.vmsselr.Value 12892} 12893 12894// Creates a new instance of the VirtualMachineScaleSetExtensionListResultPage type. 12895func NewVirtualMachineScaleSetExtensionListResultPage(cur VirtualMachineScaleSetExtensionListResult, getNextPage func(context.Context, VirtualMachineScaleSetExtensionListResult) (VirtualMachineScaleSetExtensionListResult, error)) VirtualMachineScaleSetExtensionListResultPage { 12896 return VirtualMachineScaleSetExtensionListResultPage{ 12897 fn: getNextPage, 12898 vmsselr: cur, 12899 } 12900} 12901 12902// VirtualMachineScaleSetExtensionProfile describes a virtual machine scale set extension profile. 12903type VirtualMachineScaleSetExtensionProfile struct { 12904 // Extensions - The virtual machine scale set child extension resources. 12905 Extensions *[]VirtualMachineScaleSetExtension `json:"extensions,omitempty"` 12906 // 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 12907 ExtensionsTimeBudget *string `json:"extensionsTimeBudget,omitempty"` 12908} 12909 12910// VirtualMachineScaleSetExtensionProperties describes the properties of a Virtual Machine Scale Set 12911// Extension. 12912type VirtualMachineScaleSetExtensionProperties struct { 12913 // 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. 12914 ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` 12915 // Publisher - The name of the extension handler publisher. 12916 Publisher *string `json:"publisher,omitempty"` 12917 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 12918 Type *string `json:"type,omitempty"` 12919 // TypeHandlerVersion - Specifies the version of the script handler. 12920 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 12921 // 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. 12922 AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` 12923 // EnableAutomaticUpgrade - Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. 12924 EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` 12925 // Settings - Json formatted public settings for the extension. 12926 Settings interface{} `json:"settings,omitempty"` 12927 // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. 12928 ProtectedSettings interface{} `json:"protectedSettings,omitempty"` 12929 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 12930 ProvisioningState *string `json:"provisioningState,omitempty"` 12931 // ProvisionAfterExtensions - Collection of extension names after which this extension needs to be provisioned. 12932 ProvisionAfterExtensions *[]string `json:"provisionAfterExtensions,omitempty"` 12933} 12934 12935// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtensionProperties. 12936func (vmssep VirtualMachineScaleSetExtensionProperties) MarshalJSON() ([]byte, error) { 12937 objectMap := make(map[string]interface{}) 12938 if vmssep.ForceUpdateTag != nil { 12939 objectMap["forceUpdateTag"] = vmssep.ForceUpdateTag 12940 } 12941 if vmssep.Publisher != nil { 12942 objectMap["publisher"] = vmssep.Publisher 12943 } 12944 if vmssep.Type != nil { 12945 objectMap["type"] = vmssep.Type 12946 } 12947 if vmssep.TypeHandlerVersion != nil { 12948 objectMap["typeHandlerVersion"] = vmssep.TypeHandlerVersion 12949 } 12950 if vmssep.AutoUpgradeMinorVersion != nil { 12951 objectMap["autoUpgradeMinorVersion"] = vmssep.AutoUpgradeMinorVersion 12952 } 12953 if vmssep.EnableAutomaticUpgrade != nil { 12954 objectMap["enableAutomaticUpgrade"] = vmssep.EnableAutomaticUpgrade 12955 } 12956 if vmssep.Settings != nil { 12957 objectMap["settings"] = vmssep.Settings 12958 } 12959 if vmssep.ProtectedSettings != nil { 12960 objectMap["protectedSettings"] = vmssep.ProtectedSettings 12961 } 12962 if vmssep.ProvisionAfterExtensions != nil { 12963 objectMap["provisionAfterExtensions"] = vmssep.ProvisionAfterExtensions 12964 } 12965 return json.Marshal(objectMap) 12966} 12967 12968// VirtualMachineScaleSetExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the 12969// results of a long-running operation. 12970type VirtualMachineScaleSetExtensionsCreateOrUpdateFuture struct { 12971 azure.FutureAPI 12972 // Result returns the result of the asynchronous operation. 12973 // If the operation has not completed it will return an error. 12974 Result func(VirtualMachineScaleSetExtensionsClient) (VirtualMachineScaleSetExtension, error) 12975} 12976 12977// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12978func (future *VirtualMachineScaleSetExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 12979 var azFuture azure.Future 12980 if err := json.Unmarshal(body, &azFuture); err != nil { 12981 return err 12982 } 12983 future.FutureAPI = &azFuture 12984 future.Result = future.result 12985 return nil 12986} 12987 12988// result is the default implementation for VirtualMachineScaleSetExtensionsCreateOrUpdateFuture.Result. 12989func (future *VirtualMachineScaleSetExtensionsCreateOrUpdateFuture) result(client VirtualMachineScaleSetExtensionsClient) (vmsse VirtualMachineScaleSetExtension, err error) { 12990 var done bool 12991 done, err = future.DoneWithContext(context.Background(), client) 12992 if err != nil { 12993 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 12994 return 12995 } 12996 if !done { 12997 vmsse.Response.Response = future.Response() 12998 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture") 12999 return 13000 } 13001 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13002 if vmsse.Response.Response, err = future.GetResult(sender); err == nil && vmsse.Response.Response.StatusCode != http.StatusNoContent { 13003 vmsse, err = client.CreateOrUpdateResponder(vmsse.Response.Response) 13004 if err != nil { 13005 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture", "Result", vmsse.Response.Response, "Failure responding to request") 13006 } 13007 } 13008 return 13009} 13010 13011// VirtualMachineScaleSetExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of 13012// a long-running operation. 13013type VirtualMachineScaleSetExtensionsDeleteFuture struct { 13014 azure.FutureAPI 13015 // Result returns the result of the asynchronous operation. 13016 // If the operation has not completed it will return an error. 13017 Result func(VirtualMachineScaleSetExtensionsClient) (autorest.Response, error) 13018} 13019 13020// UnmarshalJSON is the custom unmarshaller for CreateFuture. 13021func (future *VirtualMachineScaleSetExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { 13022 var azFuture azure.Future 13023 if err := json.Unmarshal(body, &azFuture); err != nil { 13024 return err 13025 } 13026 future.FutureAPI = &azFuture 13027 future.Result = future.result 13028 return nil 13029} 13030 13031// result is the default implementation for VirtualMachineScaleSetExtensionsDeleteFuture.Result. 13032func (future *VirtualMachineScaleSetExtensionsDeleteFuture) result(client VirtualMachineScaleSetExtensionsClient) (ar autorest.Response, err error) { 13033 var done bool 13034 done, err = future.DoneWithContext(context.Background(), client) 13035 if err != nil { 13036 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") 13037 return 13038 } 13039 if !done { 13040 ar.Response = future.Response() 13041 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsDeleteFuture") 13042 return 13043 } 13044 ar.Response = future.Response() 13045 return 13046} 13047 13048// VirtualMachineScaleSetExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of 13049// a long-running operation. 13050type VirtualMachineScaleSetExtensionsUpdateFuture struct { 13051 azure.FutureAPI 13052 // Result returns the result of the asynchronous operation. 13053 // If the operation has not completed it will return an error. 13054 Result func(VirtualMachineScaleSetExtensionsClient) (VirtualMachineScaleSetExtension, error) 13055} 13056 13057// UnmarshalJSON is the custom unmarshaller for CreateFuture. 13058func (future *VirtualMachineScaleSetExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { 13059 var azFuture azure.Future 13060 if err := json.Unmarshal(body, &azFuture); err != nil { 13061 return err 13062 } 13063 future.FutureAPI = &azFuture 13064 future.Result = future.result 13065 return nil 13066} 13067 13068// result is the default implementation for VirtualMachineScaleSetExtensionsUpdateFuture.Result. 13069func (future *VirtualMachineScaleSetExtensionsUpdateFuture) result(client VirtualMachineScaleSetExtensionsClient) (vmsse VirtualMachineScaleSetExtension, err error) { 13070 var done bool 13071 done, err = future.DoneWithContext(context.Background(), client) 13072 if err != nil { 13073 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsUpdateFuture", "Result", future.Response(), "Polling failure") 13074 return 13075 } 13076 if !done { 13077 vmsse.Response.Response = future.Response() 13078 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsUpdateFuture") 13079 return 13080 } 13081 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13082 if vmsse.Response.Response, err = future.GetResult(sender); err == nil && vmsse.Response.Response.StatusCode != http.StatusNoContent { 13083 vmsse, err = client.UpdateResponder(vmsse.Response.Response) 13084 if err != nil { 13085 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsUpdateFuture", "Result", vmsse.Response.Response, "Failure responding to request") 13086 } 13087 } 13088 return 13089} 13090 13091// VirtualMachineScaleSetExtensionUpdate describes a Virtual Machine Scale Set Extension. 13092type VirtualMachineScaleSetExtensionUpdate struct { 13093 // Name - READ-ONLY; The name of the extension. 13094 Name *string `json:"name,omitempty"` 13095 // Type - READ-ONLY; Resource type 13096 Type *string `json:"type,omitempty"` 13097 *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"` 13098 // ID - READ-ONLY; Resource Id 13099 ID *string `json:"id,omitempty"` 13100} 13101 13102// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtensionUpdate. 13103func (vmsseu VirtualMachineScaleSetExtensionUpdate) MarshalJSON() ([]byte, error) { 13104 objectMap := make(map[string]interface{}) 13105 if vmsseu.VirtualMachineScaleSetExtensionProperties != nil { 13106 objectMap["properties"] = vmsseu.VirtualMachineScaleSetExtensionProperties 13107 } 13108 return json.Marshal(objectMap) 13109} 13110 13111// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetExtensionUpdate struct. 13112func (vmsseu *VirtualMachineScaleSetExtensionUpdate) UnmarshalJSON(body []byte) error { 13113 var m map[string]*json.RawMessage 13114 err := json.Unmarshal(body, &m) 13115 if err != nil { 13116 return err 13117 } 13118 for k, v := range m { 13119 switch k { 13120 case "name": 13121 if v != nil { 13122 var name string 13123 err = json.Unmarshal(*v, &name) 13124 if err != nil { 13125 return err 13126 } 13127 vmsseu.Name = &name 13128 } 13129 case "type": 13130 if v != nil { 13131 var typeVar string 13132 err = json.Unmarshal(*v, &typeVar) 13133 if err != nil { 13134 return err 13135 } 13136 vmsseu.Type = &typeVar 13137 } 13138 case "properties": 13139 if v != nil { 13140 var virtualMachineScaleSetExtensionProperties VirtualMachineScaleSetExtensionProperties 13141 err = json.Unmarshal(*v, &virtualMachineScaleSetExtensionProperties) 13142 if err != nil { 13143 return err 13144 } 13145 vmsseu.VirtualMachineScaleSetExtensionProperties = &virtualMachineScaleSetExtensionProperties 13146 } 13147 case "id": 13148 if v != nil { 13149 var ID string 13150 err = json.Unmarshal(*v, &ID) 13151 if err != nil { 13152 return err 13153 } 13154 vmsseu.ID = &ID 13155 } 13156 } 13157 } 13158 13159 return nil 13160} 13161 13162// VirtualMachineScaleSetIdentity identity for the virtual machine scale set. 13163type VirtualMachineScaleSetIdentity struct { 13164 // PrincipalID - READ-ONLY; The principal id of virtual machine scale set identity. This property will only be provided for a system assigned identity. 13165 PrincipalID *string `json:"principalId,omitempty"` 13166 // TenantID - READ-ONLY; The tenant id associated with the virtual machine scale set. This property will only be provided for a system assigned identity. 13167 TenantID *string `json:"tenantId,omitempty"` 13168 // 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' 13169 Type ResourceIdentityType `json:"type,omitempty"` 13170 // 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}'. 13171 UserAssignedIdentities map[string]*VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` 13172} 13173 13174// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIdentity. 13175func (vmssi VirtualMachineScaleSetIdentity) MarshalJSON() ([]byte, error) { 13176 objectMap := make(map[string]interface{}) 13177 if vmssi.Type != "" { 13178 objectMap["type"] = vmssi.Type 13179 } 13180 if vmssi.UserAssignedIdentities != nil { 13181 objectMap["userAssignedIdentities"] = vmssi.UserAssignedIdentities 13182 } 13183 return json.Marshal(objectMap) 13184} 13185 13186// VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue ... 13187type VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue struct { 13188 // PrincipalID - READ-ONLY; The principal id of user assigned identity. 13189 PrincipalID *string `json:"principalId,omitempty"` 13190 // ClientID - READ-ONLY; The client id of user assigned identity. 13191 ClientID *string `json:"clientId,omitempty"` 13192} 13193 13194// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue. 13195func (vmssiAiv VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) { 13196 objectMap := make(map[string]interface{}) 13197 return json.Marshal(objectMap) 13198} 13199 13200// VirtualMachineScaleSetInstanceView the instance view of a virtual machine scale set. 13201type VirtualMachineScaleSetInstanceView struct { 13202 autorest.Response `json:"-"` 13203 // VirtualMachine - READ-ONLY; The instance view status summary for the virtual machine scale set. 13204 VirtualMachine *VirtualMachineScaleSetInstanceViewStatusesSummary `json:"virtualMachine,omitempty"` 13205 // Extensions - READ-ONLY; The extensions information. 13206 Extensions *[]VirtualMachineScaleSetVMExtensionsSummary `json:"extensions,omitempty"` 13207 // Statuses - The resource status information. 13208 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 13209 // OrchestrationServices - READ-ONLY; The orchestration services information. 13210 OrchestrationServices *[]OrchestrationServiceSummary `json:"orchestrationServices,omitempty"` 13211} 13212 13213// MarshalJSON is the custom marshaler for VirtualMachineScaleSetInstanceView. 13214func (vmssiv VirtualMachineScaleSetInstanceView) MarshalJSON() ([]byte, error) { 13215 objectMap := make(map[string]interface{}) 13216 if vmssiv.Statuses != nil { 13217 objectMap["statuses"] = vmssiv.Statuses 13218 } 13219 return json.Marshal(objectMap) 13220} 13221 13222// VirtualMachineScaleSetInstanceViewStatusesSummary instance view statuses summary for virtual machines of 13223// a virtual machine scale set. 13224type VirtualMachineScaleSetInstanceViewStatusesSummary struct { 13225 // StatusesSummary - READ-ONLY; The extensions information. 13226 StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` 13227} 13228 13229// MarshalJSON is the custom marshaler for VirtualMachineScaleSetInstanceViewStatusesSummary. 13230func (vmssivss VirtualMachineScaleSetInstanceViewStatusesSummary) MarshalJSON() ([]byte, error) { 13231 objectMap := make(map[string]interface{}) 13232 return json.Marshal(objectMap) 13233} 13234 13235// VirtualMachineScaleSetIPConfiguration describes a virtual machine scale set network profile's IP 13236// configuration. 13237type VirtualMachineScaleSetIPConfiguration struct { 13238 // Name - The IP configuration name. 13239 Name *string `json:"name,omitempty"` 13240 *VirtualMachineScaleSetIPConfigurationProperties `json:"properties,omitempty"` 13241 // ID - Resource Id 13242 ID *string `json:"id,omitempty"` 13243} 13244 13245// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIPConfiguration. 13246func (vmssic VirtualMachineScaleSetIPConfiguration) MarshalJSON() ([]byte, error) { 13247 objectMap := make(map[string]interface{}) 13248 if vmssic.Name != nil { 13249 objectMap["name"] = vmssic.Name 13250 } 13251 if vmssic.VirtualMachineScaleSetIPConfigurationProperties != nil { 13252 objectMap["properties"] = vmssic.VirtualMachineScaleSetIPConfigurationProperties 13253 } 13254 if vmssic.ID != nil { 13255 objectMap["id"] = vmssic.ID 13256 } 13257 return json.Marshal(objectMap) 13258} 13259 13260// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetIPConfiguration struct. 13261func (vmssic *VirtualMachineScaleSetIPConfiguration) UnmarshalJSON(body []byte) error { 13262 var m map[string]*json.RawMessage 13263 err := json.Unmarshal(body, &m) 13264 if err != nil { 13265 return err 13266 } 13267 for k, v := range m { 13268 switch k { 13269 case "name": 13270 if v != nil { 13271 var name string 13272 err = json.Unmarshal(*v, &name) 13273 if err != nil { 13274 return err 13275 } 13276 vmssic.Name = &name 13277 } 13278 case "properties": 13279 if v != nil { 13280 var virtualMachineScaleSetIPConfigurationProperties VirtualMachineScaleSetIPConfigurationProperties 13281 err = json.Unmarshal(*v, &virtualMachineScaleSetIPConfigurationProperties) 13282 if err != nil { 13283 return err 13284 } 13285 vmssic.VirtualMachineScaleSetIPConfigurationProperties = &virtualMachineScaleSetIPConfigurationProperties 13286 } 13287 case "id": 13288 if v != nil { 13289 var ID string 13290 err = json.Unmarshal(*v, &ID) 13291 if err != nil { 13292 return err 13293 } 13294 vmssic.ID = &ID 13295 } 13296 } 13297 } 13298 13299 return nil 13300} 13301 13302// VirtualMachineScaleSetIPConfigurationProperties describes a virtual machine scale set network profile's 13303// IP configuration properties. 13304type VirtualMachineScaleSetIPConfigurationProperties struct { 13305 // Subnet - Specifies the identifier of the subnet. 13306 Subnet *APIEntityReference `json:"subnet,omitempty"` 13307 // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. 13308 Primary *bool `json:"primary,omitempty"` 13309 // PublicIPAddressConfiguration - The publicIPAddressConfiguration. 13310 PublicIPAddressConfiguration *VirtualMachineScaleSetPublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` 13311 // PrivateIPAddressVersion - Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' 13312 PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` 13313 // 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. 13314 ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` 13315 // ApplicationSecurityGroups - Specifies an array of references to application security group. 13316 ApplicationSecurityGroups *[]SubResource `json:"applicationSecurityGroups,omitempty"` 13317 // 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. 13318 LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` 13319 // 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. 13320 LoadBalancerInboundNatPools *[]SubResource `json:"loadBalancerInboundNatPools,omitempty"` 13321} 13322 13323// VirtualMachineScaleSetIPTag contains the IP tag associated with the public IP address. 13324type VirtualMachineScaleSetIPTag struct { 13325 // IPTagType - IP tag type. Example: FirstPartyUsage. 13326 IPTagType *string `json:"ipTagType,omitempty"` 13327 // Tag - IP tag associated with the public IP. Example: SQL, Storage etc. 13328 Tag *string `json:"tag,omitempty"` 13329} 13330 13331// VirtualMachineScaleSetListOSUpgradeHistory list of Virtual Machine Scale Set OS Upgrade History 13332// operation response. 13333type VirtualMachineScaleSetListOSUpgradeHistory struct { 13334 autorest.Response `json:"-"` 13335 // Value - The list of OS upgrades performed on the virtual machine scale set. 13336 Value *[]UpgradeOperationHistoricalStatusInfo `json:"value,omitempty"` 13337 // 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. 13338 NextLink *string `json:"nextLink,omitempty"` 13339} 13340 13341// VirtualMachineScaleSetListOSUpgradeHistoryIterator provides access to a complete listing of 13342// UpgradeOperationHistoricalStatusInfo values. 13343type VirtualMachineScaleSetListOSUpgradeHistoryIterator struct { 13344 i int 13345 page VirtualMachineScaleSetListOSUpgradeHistoryPage 13346} 13347 13348// NextWithContext advances to the next value. If there was an error making 13349// the request the iterator does not advance and the error is returned. 13350func (iter *VirtualMachineScaleSetListOSUpgradeHistoryIterator) NextWithContext(ctx context.Context) (err error) { 13351 if tracing.IsEnabled() { 13352 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListOSUpgradeHistoryIterator.NextWithContext") 13353 defer func() { 13354 sc := -1 13355 if iter.Response().Response.Response != nil { 13356 sc = iter.Response().Response.Response.StatusCode 13357 } 13358 tracing.EndSpan(ctx, sc, err) 13359 }() 13360 } 13361 iter.i++ 13362 if iter.i < len(iter.page.Values()) { 13363 return nil 13364 } 13365 err = iter.page.NextWithContext(ctx) 13366 if err != nil { 13367 iter.i-- 13368 return err 13369 } 13370 iter.i = 0 13371 return nil 13372} 13373 13374// Next advances to the next value. If there was an error making 13375// the request the iterator does not advance and the error is returned. 13376// Deprecated: Use NextWithContext() instead. 13377func (iter *VirtualMachineScaleSetListOSUpgradeHistoryIterator) Next() error { 13378 return iter.NextWithContext(context.Background()) 13379} 13380 13381// NotDone returns true if the enumeration should be started or is not yet complete. 13382func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) NotDone() bool { 13383 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 13384} 13385 13386// Response returns the raw server response from the last page request. 13387func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) Response() VirtualMachineScaleSetListOSUpgradeHistory { 13388 return iter.page.Response() 13389} 13390 13391// Value returns the current value or a zero-initialized value if the 13392// iterator has advanced beyond the end of the collection. 13393func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) Value() UpgradeOperationHistoricalStatusInfo { 13394 if !iter.page.NotDone() { 13395 return UpgradeOperationHistoricalStatusInfo{} 13396 } 13397 return iter.page.Values()[iter.i] 13398} 13399 13400// Creates a new instance of the VirtualMachineScaleSetListOSUpgradeHistoryIterator type. 13401func NewVirtualMachineScaleSetListOSUpgradeHistoryIterator(page VirtualMachineScaleSetListOSUpgradeHistoryPage) VirtualMachineScaleSetListOSUpgradeHistoryIterator { 13402 return VirtualMachineScaleSetListOSUpgradeHistoryIterator{page: page} 13403} 13404 13405// IsEmpty returns true if the ListResult contains no values. 13406func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) IsEmpty() bool { 13407 return vmsslouh.Value == nil || len(*vmsslouh.Value) == 0 13408} 13409 13410// hasNextLink returns true if the NextLink is not empty. 13411func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) hasNextLink() bool { 13412 return vmsslouh.NextLink != nil && len(*vmsslouh.NextLink) != 0 13413} 13414 13415// virtualMachineScaleSetListOSUpgradeHistoryPreparer prepares a request to retrieve the next set of results. 13416// It returns nil if no more results exist. 13417func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) virtualMachineScaleSetListOSUpgradeHistoryPreparer(ctx context.Context) (*http.Request, error) { 13418 if !vmsslouh.hasNextLink() { 13419 return nil, nil 13420 } 13421 return autorest.Prepare((&http.Request{}).WithContext(ctx), 13422 autorest.AsJSON(), 13423 autorest.AsGet(), 13424 autorest.WithBaseURL(to.String(vmsslouh.NextLink))) 13425} 13426 13427// VirtualMachineScaleSetListOSUpgradeHistoryPage contains a page of UpgradeOperationHistoricalStatusInfo 13428// values. 13429type VirtualMachineScaleSetListOSUpgradeHistoryPage struct { 13430 fn func(context.Context, VirtualMachineScaleSetListOSUpgradeHistory) (VirtualMachineScaleSetListOSUpgradeHistory, error) 13431 vmsslouh VirtualMachineScaleSetListOSUpgradeHistory 13432} 13433 13434// NextWithContext advances to the next page of values. If there was an error making 13435// the request the page does not advance and the error is returned. 13436func (page *VirtualMachineScaleSetListOSUpgradeHistoryPage) NextWithContext(ctx context.Context) (err error) { 13437 if tracing.IsEnabled() { 13438 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListOSUpgradeHistoryPage.NextWithContext") 13439 defer func() { 13440 sc := -1 13441 if page.Response().Response.Response != nil { 13442 sc = page.Response().Response.Response.StatusCode 13443 } 13444 tracing.EndSpan(ctx, sc, err) 13445 }() 13446 } 13447 for { 13448 next, err := page.fn(ctx, page.vmsslouh) 13449 if err != nil { 13450 return err 13451 } 13452 page.vmsslouh = next 13453 if !next.hasNextLink() || !next.IsEmpty() { 13454 break 13455 } 13456 } 13457 return nil 13458} 13459 13460// Next advances to the next page of values. If there was an error making 13461// the request the page does not advance and the error is returned. 13462// Deprecated: Use NextWithContext() instead. 13463func (page *VirtualMachineScaleSetListOSUpgradeHistoryPage) Next() error { 13464 return page.NextWithContext(context.Background()) 13465} 13466 13467// NotDone returns true if the page enumeration should be started or is not yet complete. 13468func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) NotDone() bool { 13469 return !page.vmsslouh.IsEmpty() 13470} 13471 13472// Response returns the raw server response from the last page request. 13473func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) Response() VirtualMachineScaleSetListOSUpgradeHistory { 13474 return page.vmsslouh 13475} 13476 13477// Values returns the slice of values for the current page or nil if there are no values. 13478func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) Values() []UpgradeOperationHistoricalStatusInfo { 13479 if page.vmsslouh.IsEmpty() { 13480 return nil 13481 } 13482 return *page.vmsslouh.Value 13483} 13484 13485// Creates a new instance of the VirtualMachineScaleSetListOSUpgradeHistoryPage type. 13486func NewVirtualMachineScaleSetListOSUpgradeHistoryPage(cur VirtualMachineScaleSetListOSUpgradeHistory, getNextPage func(context.Context, VirtualMachineScaleSetListOSUpgradeHistory) (VirtualMachineScaleSetListOSUpgradeHistory, error)) VirtualMachineScaleSetListOSUpgradeHistoryPage { 13487 return VirtualMachineScaleSetListOSUpgradeHistoryPage{ 13488 fn: getNextPage, 13489 vmsslouh: cur, 13490 } 13491} 13492 13493// VirtualMachineScaleSetListResult the List Virtual Machine operation response. 13494type VirtualMachineScaleSetListResult struct { 13495 autorest.Response `json:"-"` 13496 // Value - The list of virtual machine scale sets. 13497 Value *[]VirtualMachineScaleSet `json:"value,omitempty"` 13498 // NextLink - The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with this to fetch the next page of VMSS. 13499 NextLink *string `json:"nextLink,omitempty"` 13500} 13501 13502// VirtualMachineScaleSetListResultIterator provides access to a complete listing of VirtualMachineScaleSet 13503// values. 13504type VirtualMachineScaleSetListResultIterator struct { 13505 i int 13506 page VirtualMachineScaleSetListResultPage 13507} 13508 13509// NextWithContext advances to the next value. If there was an error making 13510// the request the iterator does not advance and the error is returned. 13511func (iter *VirtualMachineScaleSetListResultIterator) NextWithContext(ctx context.Context) (err error) { 13512 if tracing.IsEnabled() { 13513 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListResultIterator.NextWithContext") 13514 defer func() { 13515 sc := -1 13516 if iter.Response().Response.Response != nil { 13517 sc = iter.Response().Response.Response.StatusCode 13518 } 13519 tracing.EndSpan(ctx, sc, err) 13520 }() 13521 } 13522 iter.i++ 13523 if iter.i < len(iter.page.Values()) { 13524 return nil 13525 } 13526 err = iter.page.NextWithContext(ctx) 13527 if err != nil { 13528 iter.i-- 13529 return err 13530 } 13531 iter.i = 0 13532 return nil 13533} 13534 13535// Next advances to the next value. If there was an error making 13536// the request the iterator does not advance and the error is returned. 13537// Deprecated: Use NextWithContext() instead. 13538func (iter *VirtualMachineScaleSetListResultIterator) Next() error { 13539 return iter.NextWithContext(context.Background()) 13540} 13541 13542// NotDone returns true if the enumeration should be started or is not yet complete. 13543func (iter VirtualMachineScaleSetListResultIterator) NotDone() bool { 13544 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 13545} 13546 13547// Response returns the raw server response from the last page request. 13548func (iter VirtualMachineScaleSetListResultIterator) Response() VirtualMachineScaleSetListResult { 13549 return iter.page.Response() 13550} 13551 13552// Value returns the current value or a zero-initialized value if the 13553// iterator has advanced beyond the end of the collection. 13554func (iter VirtualMachineScaleSetListResultIterator) Value() VirtualMachineScaleSet { 13555 if !iter.page.NotDone() { 13556 return VirtualMachineScaleSet{} 13557 } 13558 return iter.page.Values()[iter.i] 13559} 13560 13561// Creates a new instance of the VirtualMachineScaleSetListResultIterator type. 13562func NewVirtualMachineScaleSetListResultIterator(page VirtualMachineScaleSetListResultPage) VirtualMachineScaleSetListResultIterator { 13563 return VirtualMachineScaleSetListResultIterator{page: page} 13564} 13565 13566// IsEmpty returns true if the ListResult contains no values. 13567func (vmsslr VirtualMachineScaleSetListResult) IsEmpty() bool { 13568 return vmsslr.Value == nil || len(*vmsslr.Value) == 0 13569} 13570 13571// hasNextLink returns true if the NextLink is not empty. 13572func (vmsslr VirtualMachineScaleSetListResult) hasNextLink() bool { 13573 return vmsslr.NextLink != nil && len(*vmsslr.NextLink) != 0 13574} 13575 13576// virtualMachineScaleSetListResultPreparer prepares a request to retrieve the next set of results. 13577// It returns nil if no more results exist. 13578func (vmsslr VirtualMachineScaleSetListResult) virtualMachineScaleSetListResultPreparer(ctx context.Context) (*http.Request, error) { 13579 if !vmsslr.hasNextLink() { 13580 return nil, nil 13581 } 13582 return autorest.Prepare((&http.Request{}).WithContext(ctx), 13583 autorest.AsJSON(), 13584 autorest.AsGet(), 13585 autorest.WithBaseURL(to.String(vmsslr.NextLink))) 13586} 13587 13588// VirtualMachineScaleSetListResultPage contains a page of VirtualMachineScaleSet values. 13589type VirtualMachineScaleSetListResultPage struct { 13590 fn func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error) 13591 vmsslr VirtualMachineScaleSetListResult 13592} 13593 13594// NextWithContext advances to the next page of values. If there was an error making 13595// the request the page does not advance and the error is returned. 13596func (page *VirtualMachineScaleSetListResultPage) NextWithContext(ctx context.Context) (err error) { 13597 if tracing.IsEnabled() { 13598 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListResultPage.NextWithContext") 13599 defer func() { 13600 sc := -1 13601 if page.Response().Response.Response != nil { 13602 sc = page.Response().Response.Response.StatusCode 13603 } 13604 tracing.EndSpan(ctx, sc, err) 13605 }() 13606 } 13607 for { 13608 next, err := page.fn(ctx, page.vmsslr) 13609 if err != nil { 13610 return err 13611 } 13612 page.vmsslr = next 13613 if !next.hasNextLink() || !next.IsEmpty() { 13614 break 13615 } 13616 } 13617 return nil 13618} 13619 13620// Next advances to the next page of values. If there was an error making 13621// the request the page does not advance and the error is returned. 13622// Deprecated: Use NextWithContext() instead. 13623func (page *VirtualMachineScaleSetListResultPage) Next() error { 13624 return page.NextWithContext(context.Background()) 13625} 13626 13627// NotDone returns true if the page enumeration should be started or is not yet complete. 13628func (page VirtualMachineScaleSetListResultPage) NotDone() bool { 13629 return !page.vmsslr.IsEmpty() 13630} 13631 13632// Response returns the raw server response from the last page request. 13633func (page VirtualMachineScaleSetListResultPage) Response() VirtualMachineScaleSetListResult { 13634 return page.vmsslr 13635} 13636 13637// Values returns the slice of values for the current page or nil if there are no values. 13638func (page VirtualMachineScaleSetListResultPage) Values() []VirtualMachineScaleSet { 13639 if page.vmsslr.IsEmpty() { 13640 return nil 13641 } 13642 return *page.vmsslr.Value 13643} 13644 13645// Creates a new instance of the VirtualMachineScaleSetListResultPage type. 13646func NewVirtualMachineScaleSetListResultPage(cur VirtualMachineScaleSetListResult, getNextPage func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error)) VirtualMachineScaleSetListResultPage { 13647 return VirtualMachineScaleSetListResultPage{ 13648 fn: getNextPage, 13649 vmsslr: cur, 13650 } 13651} 13652 13653// VirtualMachineScaleSetListSkusResult the Virtual Machine Scale Set List Skus operation response. 13654type VirtualMachineScaleSetListSkusResult struct { 13655 autorest.Response `json:"-"` 13656 // Value - The list of skus available for the virtual machine scale set. 13657 Value *[]VirtualMachineScaleSetSku `json:"value,omitempty"` 13658 // 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. 13659 NextLink *string `json:"nextLink,omitempty"` 13660} 13661 13662// VirtualMachineScaleSetListSkusResultIterator provides access to a complete listing of 13663// VirtualMachineScaleSetSku values. 13664type VirtualMachineScaleSetListSkusResultIterator struct { 13665 i int 13666 page VirtualMachineScaleSetListSkusResultPage 13667} 13668 13669// NextWithContext advances to the next value. If there was an error making 13670// the request the iterator does not advance and the error is returned. 13671func (iter *VirtualMachineScaleSetListSkusResultIterator) NextWithContext(ctx context.Context) (err error) { 13672 if tracing.IsEnabled() { 13673 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListSkusResultIterator.NextWithContext") 13674 defer func() { 13675 sc := -1 13676 if iter.Response().Response.Response != nil { 13677 sc = iter.Response().Response.Response.StatusCode 13678 } 13679 tracing.EndSpan(ctx, sc, err) 13680 }() 13681 } 13682 iter.i++ 13683 if iter.i < len(iter.page.Values()) { 13684 return nil 13685 } 13686 err = iter.page.NextWithContext(ctx) 13687 if err != nil { 13688 iter.i-- 13689 return err 13690 } 13691 iter.i = 0 13692 return nil 13693} 13694 13695// Next advances to the next value. If there was an error making 13696// the request the iterator does not advance and the error is returned. 13697// Deprecated: Use NextWithContext() instead. 13698func (iter *VirtualMachineScaleSetListSkusResultIterator) Next() error { 13699 return iter.NextWithContext(context.Background()) 13700} 13701 13702// NotDone returns true if the enumeration should be started or is not yet complete. 13703func (iter VirtualMachineScaleSetListSkusResultIterator) NotDone() bool { 13704 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 13705} 13706 13707// Response returns the raw server response from the last page request. 13708func (iter VirtualMachineScaleSetListSkusResultIterator) Response() VirtualMachineScaleSetListSkusResult { 13709 return iter.page.Response() 13710} 13711 13712// Value returns the current value or a zero-initialized value if the 13713// iterator has advanced beyond the end of the collection. 13714func (iter VirtualMachineScaleSetListSkusResultIterator) Value() VirtualMachineScaleSetSku { 13715 if !iter.page.NotDone() { 13716 return VirtualMachineScaleSetSku{} 13717 } 13718 return iter.page.Values()[iter.i] 13719} 13720 13721// Creates a new instance of the VirtualMachineScaleSetListSkusResultIterator type. 13722func NewVirtualMachineScaleSetListSkusResultIterator(page VirtualMachineScaleSetListSkusResultPage) VirtualMachineScaleSetListSkusResultIterator { 13723 return VirtualMachineScaleSetListSkusResultIterator{page: page} 13724} 13725 13726// IsEmpty returns true if the ListResult contains no values. 13727func (vmsslsr VirtualMachineScaleSetListSkusResult) IsEmpty() bool { 13728 return vmsslsr.Value == nil || len(*vmsslsr.Value) == 0 13729} 13730 13731// hasNextLink returns true if the NextLink is not empty. 13732func (vmsslsr VirtualMachineScaleSetListSkusResult) hasNextLink() bool { 13733 return vmsslsr.NextLink != nil && len(*vmsslsr.NextLink) != 0 13734} 13735 13736// virtualMachineScaleSetListSkusResultPreparer prepares a request to retrieve the next set of results. 13737// It returns nil if no more results exist. 13738func (vmsslsr VirtualMachineScaleSetListSkusResult) virtualMachineScaleSetListSkusResultPreparer(ctx context.Context) (*http.Request, error) { 13739 if !vmsslsr.hasNextLink() { 13740 return nil, nil 13741 } 13742 return autorest.Prepare((&http.Request{}).WithContext(ctx), 13743 autorest.AsJSON(), 13744 autorest.AsGet(), 13745 autorest.WithBaseURL(to.String(vmsslsr.NextLink))) 13746} 13747 13748// VirtualMachineScaleSetListSkusResultPage contains a page of VirtualMachineScaleSetSku values. 13749type VirtualMachineScaleSetListSkusResultPage struct { 13750 fn func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error) 13751 vmsslsr VirtualMachineScaleSetListSkusResult 13752} 13753 13754// NextWithContext advances to the next page of values. If there was an error making 13755// the request the page does not advance and the error is returned. 13756func (page *VirtualMachineScaleSetListSkusResultPage) NextWithContext(ctx context.Context) (err error) { 13757 if tracing.IsEnabled() { 13758 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListSkusResultPage.NextWithContext") 13759 defer func() { 13760 sc := -1 13761 if page.Response().Response.Response != nil { 13762 sc = page.Response().Response.Response.StatusCode 13763 } 13764 tracing.EndSpan(ctx, sc, err) 13765 }() 13766 } 13767 for { 13768 next, err := page.fn(ctx, page.vmsslsr) 13769 if err != nil { 13770 return err 13771 } 13772 page.vmsslsr = next 13773 if !next.hasNextLink() || !next.IsEmpty() { 13774 break 13775 } 13776 } 13777 return nil 13778} 13779 13780// Next advances to the next page of values. If there was an error making 13781// the request the page does not advance and the error is returned. 13782// Deprecated: Use NextWithContext() instead. 13783func (page *VirtualMachineScaleSetListSkusResultPage) Next() error { 13784 return page.NextWithContext(context.Background()) 13785} 13786 13787// NotDone returns true if the page enumeration should be started or is not yet complete. 13788func (page VirtualMachineScaleSetListSkusResultPage) NotDone() bool { 13789 return !page.vmsslsr.IsEmpty() 13790} 13791 13792// Response returns the raw server response from the last page request. 13793func (page VirtualMachineScaleSetListSkusResultPage) Response() VirtualMachineScaleSetListSkusResult { 13794 return page.vmsslsr 13795} 13796 13797// Values returns the slice of values for the current page or nil if there are no values. 13798func (page VirtualMachineScaleSetListSkusResultPage) Values() []VirtualMachineScaleSetSku { 13799 if page.vmsslsr.IsEmpty() { 13800 return nil 13801 } 13802 return *page.vmsslsr.Value 13803} 13804 13805// Creates a new instance of the VirtualMachineScaleSetListSkusResultPage type. 13806func NewVirtualMachineScaleSetListSkusResultPage(cur VirtualMachineScaleSetListSkusResult, getNextPage func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error)) VirtualMachineScaleSetListSkusResultPage { 13807 return VirtualMachineScaleSetListSkusResultPage{ 13808 fn: getNextPage, 13809 vmsslsr: cur, 13810 } 13811} 13812 13813// VirtualMachineScaleSetListWithLinkResult the List Virtual Machine operation response. 13814type VirtualMachineScaleSetListWithLinkResult struct { 13815 autorest.Response `json:"-"` 13816 // Value - The list of virtual machine scale sets. 13817 Value *[]VirtualMachineScaleSet `json:"value,omitempty"` 13818 // 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. 13819 NextLink *string `json:"nextLink,omitempty"` 13820} 13821 13822// VirtualMachineScaleSetListWithLinkResultIterator provides access to a complete listing of 13823// VirtualMachineScaleSet values. 13824type VirtualMachineScaleSetListWithLinkResultIterator struct { 13825 i int 13826 page VirtualMachineScaleSetListWithLinkResultPage 13827} 13828 13829// NextWithContext advances to the next value. If there was an error making 13830// the request the iterator does not advance and the error is returned. 13831func (iter *VirtualMachineScaleSetListWithLinkResultIterator) NextWithContext(ctx context.Context) (err error) { 13832 if tracing.IsEnabled() { 13833 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListWithLinkResultIterator.NextWithContext") 13834 defer func() { 13835 sc := -1 13836 if iter.Response().Response.Response != nil { 13837 sc = iter.Response().Response.Response.StatusCode 13838 } 13839 tracing.EndSpan(ctx, sc, err) 13840 }() 13841 } 13842 iter.i++ 13843 if iter.i < len(iter.page.Values()) { 13844 return nil 13845 } 13846 err = iter.page.NextWithContext(ctx) 13847 if err != nil { 13848 iter.i-- 13849 return err 13850 } 13851 iter.i = 0 13852 return nil 13853} 13854 13855// Next advances to the next value. If there was an error making 13856// the request the iterator does not advance and the error is returned. 13857// Deprecated: Use NextWithContext() instead. 13858func (iter *VirtualMachineScaleSetListWithLinkResultIterator) Next() error { 13859 return iter.NextWithContext(context.Background()) 13860} 13861 13862// NotDone returns true if the enumeration should be started or is not yet complete. 13863func (iter VirtualMachineScaleSetListWithLinkResultIterator) NotDone() bool { 13864 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 13865} 13866 13867// Response returns the raw server response from the last page request. 13868func (iter VirtualMachineScaleSetListWithLinkResultIterator) Response() VirtualMachineScaleSetListWithLinkResult { 13869 return iter.page.Response() 13870} 13871 13872// Value returns the current value or a zero-initialized value if the 13873// iterator has advanced beyond the end of the collection. 13874func (iter VirtualMachineScaleSetListWithLinkResultIterator) Value() VirtualMachineScaleSet { 13875 if !iter.page.NotDone() { 13876 return VirtualMachineScaleSet{} 13877 } 13878 return iter.page.Values()[iter.i] 13879} 13880 13881// Creates a new instance of the VirtualMachineScaleSetListWithLinkResultIterator type. 13882func NewVirtualMachineScaleSetListWithLinkResultIterator(page VirtualMachineScaleSetListWithLinkResultPage) VirtualMachineScaleSetListWithLinkResultIterator { 13883 return VirtualMachineScaleSetListWithLinkResultIterator{page: page} 13884} 13885 13886// IsEmpty returns true if the ListResult contains no values. 13887func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) IsEmpty() bool { 13888 return vmsslwlr.Value == nil || len(*vmsslwlr.Value) == 0 13889} 13890 13891// hasNextLink returns true if the NextLink is not empty. 13892func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) hasNextLink() bool { 13893 return vmsslwlr.NextLink != nil && len(*vmsslwlr.NextLink) != 0 13894} 13895 13896// virtualMachineScaleSetListWithLinkResultPreparer prepares a request to retrieve the next set of results. 13897// It returns nil if no more results exist. 13898func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) virtualMachineScaleSetListWithLinkResultPreparer(ctx context.Context) (*http.Request, error) { 13899 if !vmsslwlr.hasNextLink() { 13900 return nil, nil 13901 } 13902 return autorest.Prepare((&http.Request{}).WithContext(ctx), 13903 autorest.AsJSON(), 13904 autorest.AsGet(), 13905 autorest.WithBaseURL(to.String(vmsslwlr.NextLink))) 13906} 13907 13908// VirtualMachineScaleSetListWithLinkResultPage contains a page of VirtualMachineScaleSet values. 13909type VirtualMachineScaleSetListWithLinkResultPage struct { 13910 fn func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error) 13911 vmsslwlr VirtualMachineScaleSetListWithLinkResult 13912} 13913 13914// NextWithContext advances to the next page of values. If there was an error making 13915// the request the page does not advance and the error is returned. 13916func (page *VirtualMachineScaleSetListWithLinkResultPage) NextWithContext(ctx context.Context) (err error) { 13917 if tracing.IsEnabled() { 13918 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListWithLinkResultPage.NextWithContext") 13919 defer func() { 13920 sc := -1 13921 if page.Response().Response.Response != nil { 13922 sc = page.Response().Response.Response.StatusCode 13923 } 13924 tracing.EndSpan(ctx, sc, err) 13925 }() 13926 } 13927 for { 13928 next, err := page.fn(ctx, page.vmsslwlr) 13929 if err != nil { 13930 return err 13931 } 13932 page.vmsslwlr = next 13933 if !next.hasNextLink() || !next.IsEmpty() { 13934 break 13935 } 13936 } 13937 return nil 13938} 13939 13940// Next advances to the next page of values. If there was an error making 13941// the request the page does not advance and the error is returned. 13942// Deprecated: Use NextWithContext() instead. 13943func (page *VirtualMachineScaleSetListWithLinkResultPage) Next() error { 13944 return page.NextWithContext(context.Background()) 13945} 13946 13947// NotDone returns true if the page enumeration should be started or is not yet complete. 13948func (page VirtualMachineScaleSetListWithLinkResultPage) NotDone() bool { 13949 return !page.vmsslwlr.IsEmpty() 13950} 13951 13952// Response returns the raw server response from the last page request. 13953func (page VirtualMachineScaleSetListWithLinkResultPage) Response() VirtualMachineScaleSetListWithLinkResult { 13954 return page.vmsslwlr 13955} 13956 13957// Values returns the slice of values for the current page or nil if there are no values. 13958func (page VirtualMachineScaleSetListWithLinkResultPage) Values() []VirtualMachineScaleSet { 13959 if page.vmsslwlr.IsEmpty() { 13960 return nil 13961 } 13962 return *page.vmsslwlr.Value 13963} 13964 13965// Creates a new instance of the VirtualMachineScaleSetListWithLinkResultPage type. 13966func NewVirtualMachineScaleSetListWithLinkResultPage(cur VirtualMachineScaleSetListWithLinkResult, getNextPage func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error)) VirtualMachineScaleSetListWithLinkResultPage { 13967 return VirtualMachineScaleSetListWithLinkResultPage{ 13968 fn: getNextPage, 13969 vmsslwlr: cur, 13970 } 13971} 13972 13973// VirtualMachineScaleSetManagedDiskParameters describes the parameters of a ScaleSet managed disk. 13974type VirtualMachineScaleSetManagedDiskParameters struct { 13975 // 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' 13976 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 13977 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed disk. 13978 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 13979} 13980 13981// VirtualMachineScaleSetNetworkConfiguration describes a virtual machine scale set network profile's 13982// network configurations. 13983type VirtualMachineScaleSetNetworkConfiguration struct { 13984 // Name - The network configuration name. 13985 Name *string `json:"name,omitempty"` 13986 *VirtualMachineScaleSetNetworkConfigurationProperties `json:"properties,omitempty"` 13987 // ID - Resource Id 13988 ID *string `json:"id,omitempty"` 13989} 13990 13991// MarshalJSON is the custom marshaler for VirtualMachineScaleSetNetworkConfiguration. 13992func (vmssnc VirtualMachineScaleSetNetworkConfiguration) MarshalJSON() ([]byte, error) { 13993 objectMap := make(map[string]interface{}) 13994 if vmssnc.Name != nil { 13995 objectMap["name"] = vmssnc.Name 13996 } 13997 if vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties != nil { 13998 objectMap["properties"] = vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties 13999 } 14000 if vmssnc.ID != nil { 14001 objectMap["id"] = vmssnc.ID 14002 } 14003 return json.Marshal(objectMap) 14004} 14005 14006// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetNetworkConfiguration struct. 14007func (vmssnc *VirtualMachineScaleSetNetworkConfiguration) UnmarshalJSON(body []byte) error { 14008 var m map[string]*json.RawMessage 14009 err := json.Unmarshal(body, &m) 14010 if err != nil { 14011 return err 14012 } 14013 for k, v := range m { 14014 switch k { 14015 case "name": 14016 if v != nil { 14017 var name string 14018 err = json.Unmarshal(*v, &name) 14019 if err != nil { 14020 return err 14021 } 14022 vmssnc.Name = &name 14023 } 14024 case "properties": 14025 if v != nil { 14026 var virtualMachineScaleSetNetworkConfigurationProperties VirtualMachineScaleSetNetworkConfigurationProperties 14027 err = json.Unmarshal(*v, &virtualMachineScaleSetNetworkConfigurationProperties) 14028 if err != nil { 14029 return err 14030 } 14031 vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties = &virtualMachineScaleSetNetworkConfigurationProperties 14032 } 14033 case "id": 14034 if v != nil { 14035 var ID string 14036 err = json.Unmarshal(*v, &ID) 14037 if err != nil { 14038 return err 14039 } 14040 vmssnc.ID = &ID 14041 } 14042 } 14043 } 14044 14045 return nil 14046} 14047 14048// VirtualMachineScaleSetNetworkConfigurationDNSSettings describes a virtual machines scale sets network 14049// configuration's DNS settings. 14050type VirtualMachineScaleSetNetworkConfigurationDNSSettings struct { 14051 // DNSServers - List of DNS servers IP addresses 14052 DNSServers *[]string `json:"dnsServers,omitempty"` 14053} 14054 14055// VirtualMachineScaleSetNetworkConfigurationProperties describes a virtual machine scale set network 14056// profile's IP configuration. 14057type VirtualMachineScaleSetNetworkConfigurationProperties struct { 14058 // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. 14059 Primary *bool `json:"primary,omitempty"` 14060 // EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled. 14061 EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` 14062 // NetworkSecurityGroup - The network security group. 14063 NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` 14064 // DNSSettings - The dns settings to be applied on the network interfaces. 14065 DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings `json:"dnsSettings,omitempty"` 14066 // IPConfigurations - Specifies the IP configurations of the network interface. 14067 IPConfigurations *[]VirtualMachineScaleSetIPConfiguration `json:"ipConfigurations,omitempty"` 14068 // EnableIPForwarding - Whether IP forwarding enabled on this NIC. 14069 EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` 14070} 14071 14072// VirtualMachineScaleSetNetworkProfile describes a virtual machine scale set network profile. 14073type VirtualMachineScaleSetNetworkProfile struct { 14074 // 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}'. 14075 HealthProbe *APIEntityReference `json:"healthProbe,omitempty"` 14076 // NetworkInterfaceConfigurations - The list of network configurations. 14077 NetworkInterfaceConfigurations *[]VirtualMachineScaleSetNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` 14078} 14079 14080// VirtualMachineScaleSetOSDisk describes a virtual machine scale set operating system disk. 14081type VirtualMachineScaleSetOSDisk struct { 14082 // Name - The disk name. 14083 Name *string `json:"name,omitempty"` 14084 // 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' 14085 Caching CachingTypes `json:"caching,omitempty"` 14086 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 14087 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 14088 // 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' 14089 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 14090 // DiffDiskSettings - Specifies the ephemeral disk Settings for the operating system disk used by the virtual machine scale set. 14091 DiffDiskSettings *DiffDiskSettings `json:"diffDiskSettings,omitempty"` 14092 // 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 14093 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 14094 // OsType - This property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD. <br><br> Possible values are: <br><br> **Windows** <br><br> **Linux**. Possible values include: 'Windows', 'Linux' 14095 OsType OperatingSystemTypes `json:"osType,omitempty"` 14096 // Image - Specifies information about the unmanaged user image to base the scale set on. 14097 Image *VirtualHardDisk `json:"image,omitempty"` 14098 // VhdContainers - Specifies the container urls that are used to store operating system disks for the scale set. 14099 VhdContainers *[]string `json:"vhdContainers,omitempty"` 14100 // ManagedDisk - The managed disk parameters. 14101 ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` 14102} 14103 14104// VirtualMachineScaleSetOSProfile describes a virtual machine scale set OS profile. 14105type VirtualMachineScaleSetOSProfile struct { 14106 // 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. 14107 ComputerNamePrefix *string `json:"computerNamePrefix,omitempty"` 14108 // AdminUsername - Specifies the name of the administrator account. <br><br> **Windows-only restriction:** Cannot end in "." <br><br> **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". <br><br> **Minimum-length (Linux):** 1 character <br><br> **Max-length (Linux):** 64 characters <br><br> **Max-length (Windows):** 20 characters <br><br><li> For root access to the Linux VM, see [Using root privileges on Linux virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)<br><li> For a list of built-in system users on Linux that should not be used in this field, see [Selecting User Names for Linux on Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) 14109 AdminUsername *string `json:"adminUsername,omitempty"` 14110 // AdminPassword - Specifies the password of the administrator account. <br><br> **Minimum-length (Windows):** 8 characters <br><br> **Minimum-length (Linux):** 6 characters <br><br> **Max-length (Windows):** 123 characters <br><br> **Max-length (Linux):** 72 characters <br><br> **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled <br> Has lower characters <br>Has upper characters <br> Has a digit <br> Has a special character (Regex match [\W_]) <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" <br><br> For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) <br><br> For resetting root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) 14111 AdminPassword *string `json:"adminPassword,omitempty"` 14112 // CustomData - Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array is 65535 bytes. <br><br> For using cloud-init for your VM, see [Using cloud-init to customize a Linux VM during creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) 14113 CustomData *string `json:"customData,omitempty"` 14114 // WindowsConfiguration - Specifies Windows operating system settings on the virtual machine. 14115 WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` 14116 // LinuxConfiguration - Specifies the Linux operating system settings on the virtual machine. <br><br>For a list of supported Linux distributions, see [Linux on Azure-Endorsed Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) <br><br> For running non-endorsed distributions, see [Information for Non-Endorsed Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). 14117 LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` 14118 // Secrets - Specifies set of certificates that should be installed onto the virtual machines in the scale set. 14119 Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` 14120} 14121 14122// VirtualMachineScaleSetProperties describes the properties of a Virtual Machine Scale Set. 14123type VirtualMachineScaleSetProperties struct { 14124 // UpgradePolicy - The upgrade policy. 14125 UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` 14126 // AutomaticRepairsPolicy - Policy for automatic repairs. 14127 AutomaticRepairsPolicy *AutomaticRepairsPolicy `json:"automaticRepairsPolicy,omitempty"` 14128 // VirtualMachineProfile - The virtual machine profile. 14129 VirtualMachineProfile *VirtualMachineScaleSetVMProfile `json:"virtualMachineProfile,omitempty"` 14130 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 14131 ProvisioningState *string `json:"provisioningState,omitempty"` 14132 // Overprovision - Specifies whether the Virtual Machine Scale Set should be overprovisioned. 14133 Overprovision *bool `json:"overprovision,omitempty"` 14134 // 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. 14135 DoNotRunExtensionsOnOverprovisionedVMs *bool `json:"doNotRunExtensionsOnOverprovisionedVMs,omitempty"` 14136 // UniqueID - READ-ONLY; Specifies the ID which uniquely identifies a Virtual Machine Scale Set. 14137 UniqueID *string `json:"uniqueId,omitempty"` 14138 // 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. 14139 SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"` 14140 // ZoneBalance - Whether to force strictly even Virtual Machine distribution cross x-zones in case there is zone outage. 14141 ZoneBalance *bool `json:"zoneBalance,omitempty"` 14142 // PlatformFaultDomainCount - Fault Domain count for each placement group. 14143 PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` 14144 // 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. 14145 ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` 14146 // HostGroup - Specifies information about the dedicated host group that the virtual machine scale set resides in. <br><br>Minimum api-version: 2020-06-01. 14147 HostGroup *SubResource `json:"hostGroup,omitempty"` 14148 // 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. 14149 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 14150 // ScaleInPolicy - Specifies the scale-in policy that decides which virtual machines are chosen for removal when a Virtual Machine Scale Set is scaled-in. 14151 ScaleInPolicy *ScaleInPolicy `json:"scaleInPolicy,omitempty"` 14152} 14153 14154// MarshalJSON is the custom marshaler for VirtualMachineScaleSetProperties. 14155func (vmssp VirtualMachineScaleSetProperties) MarshalJSON() ([]byte, error) { 14156 objectMap := make(map[string]interface{}) 14157 if vmssp.UpgradePolicy != nil { 14158 objectMap["upgradePolicy"] = vmssp.UpgradePolicy 14159 } 14160 if vmssp.AutomaticRepairsPolicy != nil { 14161 objectMap["automaticRepairsPolicy"] = vmssp.AutomaticRepairsPolicy 14162 } 14163 if vmssp.VirtualMachineProfile != nil { 14164 objectMap["virtualMachineProfile"] = vmssp.VirtualMachineProfile 14165 } 14166 if vmssp.Overprovision != nil { 14167 objectMap["overprovision"] = vmssp.Overprovision 14168 } 14169 if vmssp.DoNotRunExtensionsOnOverprovisionedVMs != nil { 14170 objectMap["doNotRunExtensionsOnOverprovisionedVMs"] = vmssp.DoNotRunExtensionsOnOverprovisionedVMs 14171 } 14172 if vmssp.SinglePlacementGroup != nil { 14173 objectMap["singlePlacementGroup"] = vmssp.SinglePlacementGroup 14174 } 14175 if vmssp.ZoneBalance != nil { 14176 objectMap["zoneBalance"] = vmssp.ZoneBalance 14177 } 14178 if vmssp.PlatformFaultDomainCount != nil { 14179 objectMap["platformFaultDomainCount"] = vmssp.PlatformFaultDomainCount 14180 } 14181 if vmssp.ProximityPlacementGroup != nil { 14182 objectMap["proximityPlacementGroup"] = vmssp.ProximityPlacementGroup 14183 } 14184 if vmssp.HostGroup != nil { 14185 objectMap["hostGroup"] = vmssp.HostGroup 14186 } 14187 if vmssp.AdditionalCapabilities != nil { 14188 objectMap["additionalCapabilities"] = vmssp.AdditionalCapabilities 14189 } 14190 if vmssp.ScaleInPolicy != nil { 14191 objectMap["scaleInPolicy"] = vmssp.ScaleInPolicy 14192 } 14193 return json.Marshal(objectMap) 14194} 14195 14196// VirtualMachineScaleSetPublicIPAddressConfiguration describes a virtual machines scale set IP 14197// Configuration's PublicIPAddress configuration 14198type VirtualMachineScaleSetPublicIPAddressConfiguration struct { 14199 // Name - The publicIP address configuration name. 14200 Name *string `json:"name,omitempty"` 14201 *VirtualMachineScaleSetPublicIPAddressConfigurationProperties `json:"properties,omitempty"` 14202} 14203 14204// MarshalJSON is the custom marshaler for VirtualMachineScaleSetPublicIPAddressConfiguration. 14205func (vmsspiac VirtualMachineScaleSetPublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { 14206 objectMap := make(map[string]interface{}) 14207 if vmsspiac.Name != nil { 14208 objectMap["name"] = vmsspiac.Name 14209 } 14210 if vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties != nil { 14211 objectMap["properties"] = vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties 14212 } 14213 return json.Marshal(objectMap) 14214} 14215 14216// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetPublicIPAddressConfiguration struct. 14217func (vmsspiac *VirtualMachineScaleSetPublicIPAddressConfiguration) UnmarshalJSON(body []byte) error { 14218 var m map[string]*json.RawMessage 14219 err := json.Unmarshal(body, &m) 14220 if err != nil { 14221 return err 14222 } 14223 for k, v := range m { 14224 switch k { 14225 case "name": 14226 if v != nil { 14227 var name string 14228 err = json.Unmarshal(*v, &name) 14229 if err != nil { 14230 return err 14231 } 14232 vmsspiac.Name = &name 14233 } 14234 case "properties": 14235 if v != nil { 14236 var virtualMachineScaleSetPublicIPAddressConfigurationProperties VirtualMachineScaleSetPublicIPAddressConfigurationProperties 14237 err = json.Unmarshal(*v, &virtualMachineScaleSetPublicIPAddressConfigurationProperties) 14238 if err != nil { 14239 return err 14240 } 14241 vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties = &virtualMachineScaleSetPublicIPAddressConfigurationProperties 14242 } 14243 } 14244 } 14245 14246 return nil 14247} 14248 14249// VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings describes a virtual machines scale sets 14250// network configuration's DNS settings. 14251type VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings struct { 14252 // 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 14253 DomainNameLabel *string `json:"domainNameLabel,omitempty"` 14254} 14255 14256// VirtualMachineScaleSetPublicIPAddressConfigurationProperties describes a virtual machines scale set IP 14257// Configuration's PublicIPAddress configuration 14258type VirtualMachineScaleSetPublicIPAddressConfigurationProperties struct { 14259 // IdleTimeoutInMinutes - The idle timeout of the public IP address. 14260 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` 14261 // DNSSettings - The dns settings to be applied on the publicIP addresses . 14262 DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings `json:"dnsSettings,omitempty"` 14263 // IPTags - The list of IP tags associated with the public IP address. 14264 IPTags *[]VirtualMachineScaleSetIPTag `json:"ipTags,omitempty"` 14265 // PublicIPPrefix - The PublicIPPrefix from which to allocate publicIP addresses. 14266 PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` 14267 // PublicIPAddressVersion - Available from Api-Version 2019-07-01 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' 14268 PublicIPAddressVersion IPVersion `json:"publicIPAddressVersion,omitempty"` 14269} 14270 14271// VirtualMachineScaleSetReimageParameters describes a Virtual Machine Scale Set VM Reimage Parameters. 14272type VirtualMachineScaleSetReimageParameters struct { 14273 // 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. 14274 InstanceIds *[]string `json:"instanceIds,omitempty"` 14275 // 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. 14276 TempDisk *bool `json:"tempDisk,omitempty"` 14277} 14278 14279// VirtualMachineScaleSetRollingUpgradesCancelFuture an abstraction for monitoring and retrieving the 14280// results of a long-running operation. 14281type VirtualMachineScaleSetRollingUpgradesCancelFuture struct { 14282 azure.FutureAPI 14283 // Result returns the result of the asynchronous operation. 14284 // If the operation has not completed it will return an error. 14285 Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) 14286} 14287 14288// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14289func (future *VirtualMachineScaleSetRollingUpgradesCancelFuture) UnmarshalJSON(body []byte) error { 14290 var azFuture azure.Future 14291 if err := json.Unmarshal(body, &azFuture); err != nil { 14292 return err 14293 } 14294 future.FutureAPI = &azFuture 14295 future.Result = future.result 14296 return nil 14297} 14298 14299// result is the default implementation for VirtualMachineScaleSetRollingUpgradesCancelFuture.Result. 14300func (future *VirtualMachineScaleSetRollingUpgradesCancelFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { 14301 var done bool 14302 done, err = future.DoneWithContext(context.Background(), client) 14303 if err != nil { 14304 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesCancelFuture", "Result", future.Response(), "Polling failure") 14305 return 14306 } 14307 if !done { 14308 ar.Response = future.Response() 14309 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesCancelFuture") 14310 return 14311 } 14312 ar.Response = future.Response() 14313 return 14314} 14315 14316// VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture an abstraction for monitoring and 14317// retrieving the results of a long-running operation. 14318type VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture struct { 14319 azure.FutureAPI 14320 // Result returns the result of the asynchronous operation. 14321 // If the operation has not completed it will return an error. 14322 Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) 14323} 14324 14325// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14326func (future *VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture) UnmarshalJSON(body []byte) error { 14327 var azFuture azure.Future 14328 if err := json.Unmarshal(body, &azFuture); err != nil { 14329 return err 14330 } 14331 future.FutureAPI = &azFuture 14332 future.Result = future.result 14333 return nil 14334} 14335 14336// result is the default implementation for VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture.Result. 14337func (future *VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { 14338 var done bool 14339 done, err = future.DoneWithContext(context.Background(), client) 14340 if err != nil { 14341 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture", "Result", future.Response(), "Polling failure") 14342 return 14343 } 14344 if !done { 14345 ar.Response = future.Response() 14346 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture") 14347 return 14348 } 14349 ar.Response = future.Response() 14350 return 14351} 14352 14353// VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture an abstraction for monitoring and retrieving 14354// the results of a long-running operation. 14355type VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture struct { 14356 azure.FutureAPI 14357 // Result returns the result of the asynchronous operation. 14358 // If the operation has not completed it will return an error. 14359 Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) 14360} 14361 14362// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14363func (future *VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture) UnmarshalJSON(body []byte) error { 14364 var azFuture azure.Future 14365 if err := json.Unmarshal(body, &azFuture); err != nil { 14366 return err 14367 } 14368 future.FutureAPI = &azFuture 14369 future.Result = future.result 14370 return nil 14371} 14372 14373// result is the default implementation for VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture.Result. 14374func (future *VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { 14375 var done bool 14376 done, err = future.DoneWithContext(context.Background(), client) 14377 if err != nil { 14378 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture", "Result", future.Response(), "Polling failure") 14379 return 14380 } 14381 if !done { 14382 ar.Response = future.Response() 14383 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture") 14384 return 14385 } 14386 ar.Response = future.Response() 14387 return 14388} 14389 14390// VirtualMachineScaleSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of 14391// a long-running operation. 14392type VirtualMachineScaleSetsCreateOrUpdateFuture struct { 14393 azure.FutureAPI 14394 // Result returns the result of the asynchronous operation. 14395 // If the operation has not completed it will return an error. 14396 Result func(VirtualMachineScaleSetsClient) (VirtualMachineScaleSet, error) 14397} 14398 14399// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14400func (future *VirtualMachineScaleSetsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 14401 var azFuture azure.Future 14402 if err := json.Unmarshal(body, &azFuture); err != nil { 14403 return err 14404 } 14405 future.FutureAPI = &azFuture 14406 future.Result = future.result 14407 return nil 14408} 14409 14410// result is the default implementation for VirtualMachineScaleSetsCreateOrUpdateFuture.Result. 14411func (future *VirtualMachineScaleSetsCreateOrUpdateFuture) result(client VirtualMachineScaleSetsClient) (vmss VirtualMachineScaleSet, err error) { 14412 var done bool 14413 done, err = future.DoneWithContext(context.Background(), client) 14414 if err != nil { 14415 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 14416 return 14417 } 14418 if !done { 14419 vmss.Response.Response = future.Response() 14420 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsCreateOrUpdateFuture") 14421 return 14422 } 14423 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 14424 if vmss.Response.Response, err = future.GetResult(sender); err == nil && vmss.Response.Response.StatusCode != http.StatusNoContent { 14425 vmss, err = client.CreateOrUpdateResponder(vmss.Response.Response) 14426 if err != nil { 14427 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsCreateOrUpdateFuture", "Result", vmss.Response.Response, "Failure responding to request") 14428 } 14429 } 14430 return 14431} 14432 14433// VirtualMachineScaleSetsDeallocateFuture an abstraction for monitoring and retrieving the results of a 14434// long-running operation. 14435type VirtualMachineScaleSetsDeallocateFuture struct { 14436 azure.FutureAPI 14437 // Result returns the result of the asynchronous operation. 14438 // If the operation has not completed it will return an error. 14439 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 14440} 14441 14442// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14443func (future *VirtualMachineScaleSetsDeallocateFuture) UnmarshalJSON(body []byte) error { 14444 var azFuture azure.Future 14445 if err := json.Unmarshal(body, &azFuture); err != nil { 14446 return err 14447 } 14448 future.FutureAPI = &azFuture 14449 future.Result = future.result 14450 return nil 14451} 14452 14453// result is the default implementation for VirtualMachineScaleSetsDeallocateFuture.Result. 14454func (future *VirtualMachineScaleSetsDeallocateFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 14455 var done bool 14456 done, err = future.DoneWithContext(context.Background(), client) 14457 if err != nil { 14458 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeallocateFuture", "Result", future.Response(), "Polling failure") 14459 return 14460 } 14461 if !done { 14462 ar.Response = future.Response() 14463 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeallocateFuture") 14464 return 14465 } 14466 ar.Response = future.Response() 14467 return 14468} 14469 14470// VirtualMachineScaleSetsDeleteFuture an abstraction for monitoring and retrieving the results of a 14471// long-running operation. 14472type VirtualMachineScaleSetsDeleteFuture struct { 14473 azure.FutureAPI 14474 // Result returns the result of the asynchronous operation. 14475 // If the operation has not completed it will return an error. 14476 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 14477} 14478 14479// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14480func (future *VirtualMachineScaleSetsDeleteFuture) UnmarshalJSON(body []byte) error { 14481 var azFuture azure.Future 14482 if err := json.Unmarshal(body, &azFuture); err != nil { 14483 return err 14484 } 14485 future.FutureAPI = &azFuture 14486 future.Result = future.result 14487 return nil 14488} 14489 14490// result is the default implementation for VirtualMachineScaleSetsDeleteFuture.Result. 14491func (future *VirtualMachineScaleSetsDeleteFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 14492 var done bool 14493 done, err = future.DoneWithContext(context.Background(), client) 14494 if err != nil { 14495 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeleteFuture", "Result", future.Response(), "Polling failure") 14496 return 14497 } 14498 if !done { 14499 ar.Response = future.Response() 14500 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeleteFuture") 14501 return 14502 } 14503 ar.Response = future.Response() 14504 return 14505} 14506 14507// VirtualMachineScaleSetsDeleteInstancesFuture an abstraction for monitoring and retrieving the results of 14508// a long-running operation. 14509type VirtualMachineScaleSetsDeleteInstancesFuture struct { 14510 azure.FutureAPI 14511 // Result returns the result of the asynchronous operation. 14512 // If the operation has not completed it will return an error. 14513 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 14514} 14515 14516// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14517func (future *VirtualMachineScaleSetsDeleteInstancesFuture) UnmarshalJSON(body []byte) error { 14518 var azFuture azure.Future 14519 if err := json.Unmarshal(body, &azFuture); err != nil { 14520 return err 14521 } 14522 future.FutureAPI = &azFuture 14523 future.Result = future.result 14524 return nil 14525} 14526 14527// result is the default implementation for VirtualMachineScaleSetsDeleteInstancesFuture.Result. 14528func (future *VirtualMachineScaleSetsDeleteInstancesFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 14529 var done bool 14530 done, err = future.DoneWithContext(context.Background(), client) 14531 if err != nil { 14532 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeleteInstancesFuture", "Result", future.Response(), "Polling failure") 14533 return 14534 } 14535 if !done { 14536 ar.Response = future.Response() 14537 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeleteInstancesFuture") 14538 return 14539 } 14540 ar.Response = future.Response() 14541 return 14542} 14543 14544// VirtualMachineScaleSetSku describes an available virtual machine scale set sku. 14545type VirtualMachineScaleSetSku struct { 14546 // ResourceType - READ-ONLY; The type of resource the sku applies to. 14547 ResourceType *string `json:"resourceType,omitempty"` 14548 // Sku - READ-ONLY; The Sku. 14549 Sku *Sku `json:"sku,omitempty"` 14550 // Capacity - READ-ONLY; Specifies the number of virtual machines in the scale set. 14551 Capacity *VirtualMachineScaleSetSkuCapacity `json:"capacity,omitempty"` 14552} 14553 14554// MarshalJSON is the custom marshaler for VirtualMachineScaleSetSku. 14555func (vmsss VirtualMachineScaleSetSku) MarshalJSON() ([]byte, error) { 14556 objectMap := make(map[string]interface{}) 14557 return json.Marshal(objectMap) 14558} 14559 14560// VirtualMachineScaleSetSkuCapacity describes scaling information of a sku. 14561type VirtualMachineScaleSetSkuCapacity struct { 14562 // Minimum - READ-ONLY; The minimum capacity. 14563 Minimum *int64 `json:"minimum,omitempty"` 14564 // Maximum - READ-ONLY; The maximum capacity that can be set. 14565 Maximum *int64 `json:"maximum,omitempty"` 14566 // DefaultCapacity - READ-ONLY; The default capacity. 14567 DefaultCapacity *int64 `json:"defaultCapacity,omitempty"` 14568 // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'VirtualMachineScaleSetSkuScaleTypeAutomatic', 'VirtualMachineScaleSetSkuScaleTypeNone' 14569 ScaleType VirtualMachineScaleSetSkuScaleType `json:"scaleType,omitempty"` 14570} 14571 14572// MarshalJSON is the custom marshaler for VirtualMachineScaleSetSkuCapacity. 14573func (vmsssc VirtualMachineScaleSetSkuCapacity) MarshalJSON() ([]byte, error) { 14574 objectMap := make(map[string]interface{}) 14575 return json.Marshal(objectMap) 14576} 14577 14578// VirtualMachineScaleSetsPerformMaintenanceFuture an abstraction for monitoring and retrieving the results 14579// of a long-running operation. 14580type VirtualMachineScaleSetsPerformMaintenanceFuture struct { 14581 azure.FutureAPI 14582 // Result returns the result of the asynchronous operation. 14583 // If the operation has not completed it will return an error. 14584 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 14585} 14586 14587// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14588func (future *VirtualMachineScaleSetsPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { 14589 var azFuture azure.Future 14590 if err := json.Unmarshal(body, &azFuture); err != nil { 14591 return err 14592 } 14593 future.FutureAPI = &azFuture 14594 future.Result = future.result 14595 return nil 14596} 14597 14598// result is the default implementation for VirtualMachineScaleSetsPerformMaintenanceFuture.Result. 14599func (future *VirtualMachineScaleSetsPerformMaintenanceFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 14600 var done bool 14601 done, err = future.DoneWithContext(context.Background(), client) 14602 if err != nil { 14603 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsPerformMaintenanceFuture", "Result", future.Response(), "Polling failure") 14604 return 14605 } 14606 if !done { 14607 ar.Response = future.Response() 14608 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsPerformMaintenanceFuture") 14609 return 14610 } 14611 ar.Response = future.Response() 14612 return 14613} 14614 14615// VirtualMachineScaleSetsPowerOffFuture an abstraction for monitoring and retrieving the results of a 14616// long-running operation. 14617type VirtualMachineScaleSetsPowerOffFuture struct { 14618 azure.FutureAPI 14619 // Result returns the result of the asynchronous operation. 14620 // If the operation has not completed it will return an error. 14621 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 14622} 14623 14624// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14625func (future *VirtualMachineScaleSetsPowerOffFuture) UnmarshalJSON(body []byte) error { 14626 var azFuture azure.Future 14627 if err := json.Unmarshal(body, &azFuture); err != nil { 14628 return err 14629 } 14630 future.FutureAPI = &azFuture 14631 future.Result = future.result 14632 return nil 14633} 14634 14635// result is the default implementation for VirtualMachineScaleSetsPowerOffFuture.Result. 14636func (future *VirtualMachineScaleSetsPowerOffFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 14637 var done bool 14638 done, err = future.DoneWithContext(context.Background(), client) 14639 if err != nil { 14640 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsPowerOffFuture", "Result", future.Response(), "Polling failure") 14641 return 14642 } 14643 if !done { 14644 ar.Response = future.Response() 14645 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsPowerOffFuture") 14646 return 14647 } 14648 ar.Response = future.Response() 14649 return 14650} 14651 14652// VirtualMachineScaleSetsRedeployFuture an abstraction for monitoring and retrieving the results of a 14653// long-running operation. 14654type VirtualMachineScaleSetsRedeployFuture struct { 14655 azure.FutureAPI 14656 // Result returns the result of the asynchronous operation. 14657 // If the operation has not completed it will return an error. 14658 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 14659} 14660 14661// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14662func (future *VirtualMachineScaleSetsRedeployFuture) UnmarshalJSON(body []byte) error { 14663 var azFuture azure.Future 14664 if err := json.Unmarshal(body, &azFuture); err != nil { 14665 return err 14666 } 14667 future.FutureAPI = &azFuture 14668 future.Result = future.result 14669 return nil 14670} 14671 14672// result is the default implementation for VirtualMachineScaleSetsRedeployFuture.Result. 14673func (future *VirtualMachineScaleSetsRedeployFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 14674 var done bool 14675 done, err = future.DoneWithContext(context.Background(), client) 14676 if err != nil { 14677 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsRedeployFuture", "Result", future.Response(), "Polling failure") 14678 return 14679 } 14680 if !done { 14681 ar.Response = future.Response() 14682 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsRedeployFuture") 14683 return 14684 } 14685 ar.Response = future.Response() 14686 return 14687} 14688 14689// VirtualMachineScaleSetsReimageAllFuture an abstraction for monitoring and retrieving the results of a 14690// long-running operation. 14691type VirtualMachineScaleSetsReimageAllFuture struct { 14692 azure.FutureAPI 14693 // Result returns the result of the asynchronous operation. 14694 // If the operation has not completed it will return an error. 14695 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 14696} 14697 14698// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14699func (future *VirtualMachineScaleSetsReimageAllFuture) UnmarshalJSON(body []byte) error { 14700 var azFuture azure.Future 14701 if err := json.Unmarshal(body, &azFuture); err != nil { 14702 return err 14703 } 14704 future.FutureAPI = &azFuture 14705 future.Result = future.result 14706 return nil 14707} 14708 14709// result is the default implementation for VirtualMachineScaleSetsReimageAllFuture.Result. 14710func (future *VirtualMachineScaleSetsReimageAllFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 14711 var done bool 14712 done, err = future.DoneWithContext(context.Background(), client) 14713 if err != nil { 14714 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsReimageAllFuture", "Result", future.Response(), "Polling failure") 14715 return 14716 } 14717 if !done { 14718 ar.Response = future.Response() 14719 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsReimageAllFuture") 14720 return 14721 } 14722 ar.Response = future.Response() 14723 return 14724} 14725 14726// VirtualMachineScaleSetsReimageFuture an abstraction for monitoring and retrieving the results of a 14727// long-running operation. 14728type VirtualMachineScaleSetsReimageFuture struct { 14729 azure.FutureAPI 14730 // Result returns the result of the asynchronous operation. 14731 // If the operation has not completed it will return an error. 14732 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 14733} 14734 14735// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14736func (future *VirtualMachineScaleSetsReimageFuture) UnmarshalJSON(body []byte) error { 14737 var azFuture azure.Future 14738 if err := json.Unmarshal(body, &azFuture); err != nil { 14739 return err 14740 } 14741 future.FutureAPI = &azFuture 14742 future.Result = future.result 14743 return nil 14744} 14745 14746// result is the default implementation for VirtualMachineScaleSetsReimageFuture.Result. 14747func (future *VirtualMachineScaleSetsReimageFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 14748 var done bool 14749 done, err = future.DoneWithContext(context.Background(), client) 14750 if err != nil { 14751 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsReimageFuture", "Result", future.Response(), "Polling failure") 14752 return 14753 } 14754 if !done { 14755 ar.Response = future.Response() 14756 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsReimageFuture") 14757 return 14758 } 14759 ar.Response = future.Response() 14760 return 14761} 14762 14763// VirtualMachineScaleSetsRestartFuture an abstraction for monitoring and retrieving the results of a 14764// long-running operation. 14765type VirtualMachineScaleSetsRestartFuture struct { 14766 azure.FutureAPI 14767 // Result returns the result of the asynchronous operation. 14768 // If the operation has not completed it will return an error. 14769 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 14770} 14771 14772// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14773func (future *VirtualMachineScaleSetsRestartFuture) UnmarshalJSON(body []byte) error { 14774 var azFuture azure.Future 14775 if err := json.Unmarshal(body, &azFuture); err != nil { 14776 return err 14777 } 14778 future.FutureAPI = &azFuture 14779 future.Result = future.result 14780 return nil 14781} 14782 14783// result is the default implementation for VirtualMachineScaleSetsRestartFuture.Result. 14784func (future *VirtualMachineScaleSetsRestartFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 14785 var done bool 14786 done, err = future.DoneWithContext(context.Background(), client) 14787 if err != nil { 14788 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsRestartFuture", "Result", future.Response(), "Polling failure") 14789 return 14790 } 14791 if !done { 14792 ar.Response = future.Response() 14793 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsRestartFuture") 14794 return 14795 } 14796 ar.Response = future.Response() 14797 return 14798} 14799 14800// VirtualMachineScaleSetsSetOrchestrationServiceStateFuture an abstraction for monitoring and retrieving 14801// the results of a long-running operation. 14802type VirtualMachineScaleSetsSetOrchestrationServiceStateFuture struct { 14803 azure.FutureAPI 14804 // Result returns the result of the asynchronous operation. 14805 // If the operation has not completed it will return an error. 14806 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 14807} 14808 14809// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14810func (future *VirtualMachineScaleSetsSetOrchestrationServiceStateFuture) UnmarshalJSON(body []byte) error { 14811 var azFuture azure.Future 14812 if err := json.Unmarshal(body, &azFuture); err != nil { 14813 return err 14814 } 14815 future.FutureAPI = &azFuture 14816 future.Result = future.result 14817 return nil 14818} 14819 14820// result is the default implementation for VirtualMachineScaleSetsSetOrchestrationServiceStateFuture.Result. 14821func (future *VirtualMachineScaleSetsSetOrchestrationServiceStateFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 14822 var done bool 14823 done, err = future.DoneWithContext(context.Background(), client) 14824 if err != nil { 14825 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsSetOrchestrationServiceStateFuture", "Result", future.Response(), "Polling failure") 14826 return 14827 } 14828 if !done { 14829 ar.Response = future.Response() 14830 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsSetOrchestrationServiceStateFuture") 14831 return 14832 } 14833 ar.Response = future.Response() 14834 return 14835} 14836 14837// VirtualMachineScaleSetsStartFuture an abstraction for monitoring and retrieving the results of a 14838// long-running operation. 14839type VirtualMachineScaleSetsStartFuture struct { 14840 azure.FutureAPI 14841 // Result returns the result of the asynchronous operation. 14842 // If the operation has not completed it will return an error. 14843 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 14844} 14845 14846// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14847func (future *VirtualMachineScaleSetsStartFuture) UnmarshalJSON(body []byte) error { 14848 var azFuture azure.Future 14849 if err := json.Unmarshal(body, &azFuture); err != nil { 14850 return err 14851 } 14852 future.FutureAPI = &azFuture 14853 future.Result = future.result 14854 return nil 14855} 14856 14857// result is the default implementation for VirtualMachineScaleSetsStartFuture.Result. 14858func (future *VirtualMachineScaleSetsStartFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 14859 var done bool 14860 done, err = future.DoneWithContext(context.Background(), client) 14861 if err != nil { 14862 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsStartFuture", "Result", future.Response(), "Polling failure") 14863 return 14864 } 14865 if !done { 14866 ar.Response = future.Response() 14867 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsStartFuture") 14868 return 14869 } 14870 ar.Response = future.Response() 14871 return 14872} 14873 14874// VirtualMachineScaleSetStorageProfile describes a virtual machine scale set storage profile. 14875type VirtualMachineScaleSetStorageProfile struct { 14876 // 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. 14877 ImageReference *ImageReference `json:"imageReference,omitempty"` 14878 // OsDisk - Specifies information about the operating system disk used by the virtual machines in the scale set. <br><br> For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). 14879 OsDisk *VirtualMachineScaleSetOSDisk `json:"osDisk,omitempty"` 14880 // DataDisks - Specifies the parameters that are used to add data disks to the virtual machines in the scale set. <br><br> For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). 14881 DataDisks *[]VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"` 14882} 14883 14884// VirtualMachineScaleSetsUpdateFuture an abstraction for monitoring and retrieving the results of a 14885// long-running operation. 14886type VirtualMachineScaleSetsUpdateFuture struct { 14887 azure.FutureAPI 14888 // Result returns the result of the asynchronous operation. 14889 // If the operation has not completed it will return an error. 14890 Result func(VirtualMachineScaleSetsClient) (VirtualMachineScaleSet, error) 14891} 14892 14893// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14894func (future *VirtualMachineScaleSetsUpdateFuture) UnmarshalJSON(body []byte) error { 14895 var azFuture azure.Future 14896 if err := json.Unmarshal(body, &azFuture); err != nil { 14897 return err 14898 } 14899 future.FutureAPI = &azFuture 14900 future.Result = future.result 14901 return nil 14902} 14903 14904// result is the default implementation for VirtualMachineScaleSetsUpdateFuture.Result. 14905func (future *VirtualMachineScaleSetsUpdateFuture) result(client VirtualMachineScaleSetsClient) (vmss VirtualMachineScaleSet, err error) { 14906 var done bool 14907 done, err = future.DoneWithContext(context.Background(), client) 14908 if err != nil { 14909 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateFuture", "Result", future.Response(), "Polling failure") 14910 return 14911 } 14912 if !done { 14913 vmss.Response.Response = future.Response() 14914 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsUpdateFuture") 14915 return 14916 } 14917 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 14918 if vmss.Response.Response, err = future.GetResult(sender); err == nil && vmss.Response.Response.StatusCode != http.StatusNoContent { 14919 vmss, err = client.UpdateResponder(vmss.Response.Response) 14920 if err != nil { 14921 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateFuture", "Result", vmss.Response.Response, "Failure responding to request") 14922 } 14923 } 14924 return 14925} 14926 14927// VirtualMachineScaleSetsUpdateInstancesFuture an abstraction for monitoring and retrieving the results of 14928// a long-running operation. 14929type VirtualMachineScaleSetsUpdateInstancesFuture struct { 14930 azure.FutureAPI 14931 // Result returns the result of the asynchronous operation. 14932 // If the operation has not completed it will return an error. 14933 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 14934} 14935 14936// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14937func (future *VirtualMachineScaleSetsUpdateInstancesFuture) UnmarshalJSON(body []byte) error { 14938 var azFuture azure.Future 14939 if err := json.Unmarshal(body, &azFuture); err != nil { 14940 return err 14941 } 14942 future.FutureAPI = &azFuture 14943 future.Result = future.result 14944 return nil 14945} 14946 14947// result is the default implementation for VirtualMachineScaleSetsUpdateInstancesFuture.Result. 14948func (future *VirtualMachineScaleSetsUpdateInstancesFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { 14949 var done bool 14950 done, err = future.DoneWithContext(context.Background(), client) 14951 if err != nil { 14952 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateInstancesFuture", "Result", future.Response(), "Polling failure") 14953 return 14954 } 14955 if !done { 14956 ar.Response = future.Response() 14957 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsUpdateInstancesFuture") 14958 return 14959 } 14960 ar.Response = future.Response() 14961 return 14962} 14963 14964// VirtualMachineScaleSetUpdate describes a Virtual Machine Scale Set. 14965type VirtualMachineScaleSetUpdate struct { 14966 // Sku - The virtual machine scale set sku. 14967 Sku *Sku `json:"sku,omitempty"` 14968 // Plan - The purchase plan when deploying a virtual machine scale set from VM Marketplace images. 14969 Plan *Plan `json:"plan,omitempty"` 14970 *VirtualMachineScaleSetUpdateProperties `json:"properties,omitempty"` 14971 // Identity - The identity of the virtual machine scale set, if configured. 14972 Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"` 14973 // Tags - Resource tags 14974 Tags map[string]*string `json:"tags"` 14975} 14976 14977// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdate. 14978func (vmssu VirtualMachineScaleSetUpdate) MarshalJSON() ([]byte, error) { 14979 objectMap := make(map[string]interface{}) 14980 if vmssu.Sku != nil { 14981 objectMap["sku"] = vmssu.Sku 14982 } 14983 if vmssu.Plan != nil { 14984 objectMap["plan"] = vmssu.Plan 14985 } 14986 if vmssu.VirtualMachineScaleSetUpdateProperties != nil { 14987 objectMap["properties"] = vmssu.VirtualMachineScaleSetUpdateProperties 14988 } 14989 if vmssu.Identity != nil { 14990 objectMap["identity"] = vmssu.Identity 14991 } 14992 if vmssu.Tags != nil { 14993 objectMap["tags"] = vmssu.Tags 14994 } 14995 return json.Marshal(objectMap) 14996} 14997 14998// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdate struct. 14999func (vmssu *VirtualMachineScaleSetUpdate) UnmarshalJSON(body []byte) error { 15000 var m map[string]*json.RawMessage 15001 err := json.Unmarshal(body, &m) 15002 if err != nil { 15003 return err 15004 } 15005 for k, v := range m { 15006 switch k { 15007 case "sku": 15008 if v != nil { 15009 var sku Sku 15010 err = json.Unmarshal(*v, &sku) 15011 if err != nil { 15012 return err 15013 } 15014 vmssu.Sku = &sku 15015 } 15016 case "plan": 15017 if v != nil { 15018 var plan Plan 15019 err = json.Unmarshal(*v, &plan) 15020 if err != nil { 15021 return err 15022 } 15023 vmssu.Plan = &plan 15024 } 15025 case "properties": 15026 if v != nil { 15027 var virtualMachineScaleSetUpdateProperties VirtualMachineScaleSetUpdateProperties 15028 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateProperties) 15029 if err != nil { 15030 return err 15031 } 15032 vmssu.VirtualMachineScaleSetUpdateProperties = &virtualMachineScaleSetUpdateProperties 15033 } 15034 case "identity": 15035 if v != nil { 15036 var identity VirtualMachineScaleSetIdentity 15037 err = json.Unmarshal(*v, &identity) 15038 if err != nil { 15039 return err 15040 } 15041 vmssu.Identity = &identity 15042 } 15043 case "tags": 15044 if v != nil { 15045 var tags map[string]*string 15046 err = json.Unmarshal(*v, &tags) 15047 if err != nil { 15048 return err 15049 } 15050 vmssu.Tags = tags 15051 } 15052 } 15053 } 15054 15055 return nil 15056} 15057 15058// VirtualMachineScaleSetUpdateIPConfiguration describes a virtual machine scale set network profile's IP 15059// configuration. NOTE: The subnet of a scale set may be modified as long as the original subnet and the 15060// new subnet are in the same virtual network 15061type VirtualMachineScaleSetUpdateIPConfiguration struct { 15062 // Name - The IP configuration name. 15063 Name *string `json:"name,omitempty"` 15064 *VirtualMachineScaleSetUpdateIPConfigurationProperties `json:"properties,omitempty"` 15065 // ID - Resource Id 15066 ID *string `json:"id,omitempty"` 15067} 15068 15069// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdateIPConfiguration. 15070func (vmssuic VirtualMachineScaleSetUpdateIPConfiguration) MarshalJSON() ([]byte, error) { 15071 objectMap := make(map[string]interface{}) 15072 if vmssuic.Name != nil { 15073 objectMap["name"] = vmssuic.Name 15074 } 15075 if vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties != nil { 15076 objectMap["properties"] = vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties 15077 } 15078 if vmssuic.ID != nil { 15079 objectMap["id"] = vmssuic.ID 15080 } 15081 return json.Marshal(objectMap) 15082} 15083 15084// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdateIPConfiguration struct. 15085func (vmssuic *VirtualMachineScaleSetUpdateIPConfiguration) UnmarshalJSON(body []byte) error { 15086 var m map[string]*json.RawMessage 15087 err := json.Unmarshal(body, &m) 15088 if err != nil { 15089 return err 15090 } 15091 for k, v := range m { 15092 switch k { 15093 case "name": 15094 if v != nil { 15095 var name string 15096 err = json.Unmarshal(*v, &name) 15097 if err != nil { 15098 return err 15099 } 15100 vmssuic.Name = &name 15101 } 15102 case "properties": 15103 if v != nil { 15104 var virtualMachineScaleSetUpdateIPConfigurationProperties VirtualMachineScaleSetUpdateIPConfigurationProperties 15105 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateIPConfigurationProperties) 15106 if err != nil { 15107 return err 15108 } 15109 vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties = &virtualMachineScaleSetUpdateIPConfigurationProperties 15110 } 15111 case "id": 15112 if v != nil { 15113 var ID string 15114 err = json.Unmarshal(*v, &ID) 15115 if err != nil { 15116 return err 15117 } 15118 vmssuic.ID = &ID 15119 } 15120 } 15121 } 15122 15123 return nil 15124} 15125 15126// VirtualMachineScaleSetUpdateIPConfigurationProperties describes a virtual machine scale set network 15127// profile's IP configuration properties. 15128type VirtualMachineScaleSetUpdateIPConfigurationProperties struct { 15129 // Subnet - The subnet. 15130 Subnet *APIEntityReference `json:"subnet,omitempty"` 15131 // Primary - Specifies the primary IP Configuration in case the network interface has more than one IP Configuration. 15132 Primary *bool `json:"primary,omitempty"` 15133 // PublicIPAddressConfiguration - The publicIPAddressConfiguration. 15134 PublicIPAddressConfiguration *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` 15135 // PrivateIPAddressVersion - Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' 15136 PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` 15137 // ApplicationGatewayBackendAddressPools - The application gateway backend address pools. 15138 ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` 15139 // ApplicationSecurityGroups - Specifies an array of references to application security group. 15140 ApplicationSecurityGroups *[]SubResource `json:"applicationSecurityGroups,omitempty"` 15141 // LoadBalancerBackendAddressPools - The load balancer backend address pools. 15142 LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` 15143 // LoadBalancerInboundNatPools - The load balancer inbound nat pools. 15144 LoadBalancerInboundNatPools *[]SubResource `json:"loadBalancerInboundNatPools,omitempty"` 15145} 15146 15147// VirtualMachineScaleSetUpdateNetworkConfiguration describes a virtual machine scale set network profile's 15148// network configurations. 15149type VirtualMachineScaleSetUpdateNetworkConfiguration struct { 15150 // Name - The network configuration name. 15151 Name *string `json:"name,omitempty"` 15152 *VirtualMachineScaleSetUpdateNetworkConfigurationProperties `json:"properties,omitempty"` 15153 // ID - Resource Id 15154 ID *string `json:"id,omitempty"` 15155} 15156 15157// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdateNetworkConfiguration. 15158func (vmssunc VirtualMachineScaleSetUpdateNetworkConfiguration) MarshalJSON() ([]byte, error) { 15159 objectMap := make(map[string]interface{}) 15160 if vmssunc.Name != nil { 15161 objectMap["name"] = vmssunc.Name 15162 } 15163 if vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties != nil { 15164 objectMap["properties"] = vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties 15165 } 15166 if vmssunc.ID != nil { 15167 objectMap["id"] = vmssunc.ID 15168 } 15169 return json.Marshal(objectMap) 15170} 15171 15172// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdateNetworkConfiguration struct. 15173func (vmssunc *VirtualMachineScaleSetUpdateNetworkConfiguration) UnmarshalJSON(body []byte) error { 15174 var m map[string]*json.RawMessage 15175 err := json.Unmarshal(body, &m) 15176 if err != nil { 15177 return err 15178 } 15179 for k, v := range m { 15180 switch k { 15181 case "name": 15182 if v != nil { 15183 var name string 15184 err = json.Unmarshal(*v, &name) 15185 if err != nil { 15186 return err 15187 } 15188 vmssunc.Name = &name 15189 } 15190 case "properties": 15191 if v != nil { 15192 var virtualMachineScaleSetUpdateNetworkConfigurationProperties VirtualMachineScaleSetUpdateNetworkConfigurationProperties 15193 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateNetworkConfigurationProperties) 15194 if err != nil { 15195 return err 15196 } 15197 vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties = &virtualMachineScaleSetUpdateNetworkConfigurationProperties 15198 } 15199 case "id": 15200 if v != nil { 15201 var ID string 15202 err = json.Unmarshal(*v, &ID) 15203 if err != nil { 15204 return err 15205 } 15206 vmssunc.ID = &ID 15207 } 15208 } 15209 } 15210 15211 return nil 15212} 15213 15214// VirtualMachineScaleSetUpdateNetworkConfigurationProperties describes a virtual machine scale set 15215// updatable network profile's IP configuration.Use this object for updating network profile's IP 15216// Configuration. 15217type VirtualMachineScaleSetUpdateNetworkConfigurationProperties struct { 15218 // Primary - Whether this is a primary NIC on a virtual machine. 15219 Primary *bool `json:"primary,omitempty"` 15220 // EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled. 15221 EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` 15222 // NetworkSecurityGroup - The network security group. 15223 NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` 15224 // DNSSettings - The dns settings to be applied on the network interfaces. 15225 DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings `json:"dnsSettings,omitempty"` 15226 // IPConfigurations - The virtual machine scale set IP Configuration. 15227 IPConfigurations *[]VirtualMachineScaleSetUpdateIPConfiguration `json:"ipConfigurations,omitempty"` 15228 // EnableIPForwarding - Whether IP forwarding enabled on this NIC. 15229 EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` 15230} 15231 15232// VirtualMachineScaleSetUpdateNetworkProfile describes a virtual machine scale set network profile. 15233type VirtualMachineScaleSetUpdateNetworkProfile struct { 15234 // 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}'. 15235 HealthProbe *APIEntityReference `json:"healthProbe,omitempty"` 15236 // NetworkInterfaceConfigurations - The list of network configurations. 15237 NetworkInterfaceConfigurations *[]VirtualMachineScaleSetUpdateNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` 15238} 15239 15240// VirtualMachineScaleSetUpdateOSDisk describes virtual machine scale set operating system disk Update 15241// Object. This should be used for Updating VMSS OS Disk. 15242type VirtualMachineScaleSetUpdateOSDisk struct { 15243 // Caching - The caching type. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' 15244 Caching CachingTypes `json:"caching,omitempty"` 15245 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 15246 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 15247 // 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 15248 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 15249 // 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. 15250 Image *VirtualHardDisk `json:"image,omitempty"` 15251 // VhdContainers - The list of virtual hard disk container uris. 15252 VhdContainers *[]string `json:"vhdContainers,omitempty"` 15253 // ManagedDisk - The managed disk parameters. 15254 ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` 15255} 15256 15257// VirtualMachineScaleSetUpdateOSProfile describes a virtual machine scale set OS profile. 15258type VirtualMachineScaleSetUpdateOSProfile struct { 15259 // CustomData - A base-64 encoded string of custom data. 15260 CustomData *string `json:"customData,omitempty"` 15261 // WindowsConfiguration - The Windows Configuration of the OS profile. 15262 WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` 15263 // LinuxConfiguration - The Linux Configuration of the OS profile. 15264 LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` 15265 // Secrets - The List of certificates for addition to the VM. 15266 Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` 15267} 15268 15269// VirtualMachineScaleSetUpdateProperties describes the properties of a Virtual Machine Scale Set. 15270type VirtualMachineScaleSetUpdateProperties struct { 15271 // UpgradePolicy - The upgrade policy. 15272 UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` 15273 // AutomaticRepairsPolicy - Policy for automatic repairs. 15274 AutomaticRepairsPolicy *AutomaticRepairsPolicy `json:"automaticRepairsPolicy,omitempty"` 15275 // VirtualMachineProfile - The virtual machine profile. 15276 VirtualMachineProfile *VirtualMachineScaleSetUpdateVMProfile `json:"virtualMachineProfile,omitempty"` 15277 // Overprovision - Specifies whether the Virtual Machine Scale Set should be overprovisioned. 15278 Overprovision *bool `json:"overprovision,omitempty"` 15279 // 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. 15280 DoNotRunExtensionsOnOverprovisionedVMs *bool `json:"doNotRunExtensionsOnOverprovisionedVMs,omitempty"` 15281 // 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. 15282 SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"` 15283 // 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. 15284 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 15285 // ScaleInPolicy - Specifies the scale-in policy that decides which virtual machines are chosen for removal when a Virtual Machine Scale Set is scaled-in. 15286 ScaleInPolicy *ScaleInPolicy `json:"scaleInPolicy,omitempty"` 15287 // 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. 15288 ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` 15289} 15290 15291// VirtualMachineScaleSetUpdatePublicIPAddressConfiguration describes a virtual machines scale set IP 15292// Configuration's PublicIPAddress configuration 15293type VirtualMachineScaleSetUpdatePublicIPAddressConfiguration struct { 15294 // Name - The publicIP address configuration name. 15295 Name *string `json:"name,omitempty"` 15296 *VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties `json:"properties,omitempty"` 15297} 15298 15299// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdatePublicIPAddressConfiguration. 15300func (vmssupiac VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { 15301 objectMap := make(map[string]interface{}) 15302 if vmssupiac.Name != nil { 15303 objectMap["name"] = vmssupiac.Name 15304 } 15305 if vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties != nil { 15306 objectMap["properties"] = vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties 15307 } 15308 return json.Marshal(objectMap) 15309} 15310 15311// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdatePublicIPAddressConfiguration struct. 15312func (vmssupiac *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) UnmarshalJSON(body []byte) error { 15313 var m map[string]*json.RawMessage 15314 err := json.Unmarshal(body, &m) 15315 if err != nil { 15316 return err 15317 } 15318 for k, v := range m { 15319 switch k { 15320 case "name": 15321 if v != nil { 15322 var name string 15323 err = json.Unmarshal(*v, &name) 15324 if err != nil { 15325 return err 15326 } 15327 vmssupiac.Name = &name 15328 } 15329 case "properties": 15330 if v != nil { 15331 var virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties 15332 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties) 15333 if err != nil { 15334 return err 15335 } 15336 vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties = &virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties 15337 } 15338 } 15339 } 15340 15341 return nil 15342} 15343 15344// VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties describes a virtual machines scale 15345// set IP Configuration's PublicIPAddress configuration 15346type VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties struct { 15347 // IdleTimeoutInMinutes - The idle timeout of the public IP address. 15348 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` 15349 // DNSSettings - The dns settings to be applied on the publicIP addresses . 15350 DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings `json:"dnsSettings,omitempty"` 15351} 15352 15353// VirtualMachineScaleSetUpdateStorageProfile describes a virtual machine scale set storage profile. 15354type VirtualMachineScaleSetUpdateStorageProfile struct { 15355 // ImageReference - The image reference. 15356 ImageReference *ImageReference `json:"imageReference,omitempty"` 15357 // OsDisk - The OS disk. 15358 OsDisk *VirtualMachineScaleSetUpdateOSDisk `json:"osDisk,omitempty"` 15359 // DataDisks - The data disks. 15360 DataDisks *[]VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"` 15361} 15362 15363// VirtualMachineScaleSetUpdateVMProfile describes a virtual machine scale set virtual machine profile. 15364type VirtualMachineScaleSetUpdateVMProfile struct { 15365 // OsProfile - The virtual machine scale set OS profile. 15366 OsProfile *VirtualMachineScaleSetUpdateOSProfile `json:"osProfile,omitempty"` 15367 // StorageProfile - The virtual machine scale set storage profile. 15368 StorageProfile *VirtualMachineScaleSetUpdateStorageProfile `json:"storageProfile,omitempty"` 15369 // NetworkProfile - The virtual machine scale set network profile. 15370 NetworkProfile *VirtualMachineScaleSetUpdateNetworkProfile `json:"networkProfile,omitempty"` 15371 // SecurityProfile - The virtual machine scale set Security profile 15372 SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` 15373 // DiagnosticsProfile - The virtual machine scale set diagnostics profile. 15374 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 15375 // ExtensionProfile - The virtual machine scale set extension profile. 15376 ExtensionProfile *VirtualMachineScaleSetExtensionProfile `json:"extensionProfile,omitempty"` 15377 // LicenseType - The license type, which is for bring your own license scenario. 15378 LicenseType *string `json:"licenseType,omitempty"` 15379 // BillingProfile - Specifies the billing related details of a Azure Spot VMSS. <br><br>Minimum api-version: 2019-03-01. 15380 BillingProfile *BillingProfile `json:"billingProfile,omitempty"` 15381 // ScheduledEventsProfile - Specifies Scheduled Event related configurations. 15382 ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` 15383} 15384 15385// VirtualMachineScaleSetVM describes a virtual machine scale set virtual machine. 15386type VirtualMachineScaleSetVM struct { 15387 autorest.Response `json:"-"` 15388 // InstanceID - READ-ONLY; The virtual machine instance ID. 15389 InstanceID *string `json:"instanceId,omitempty"` 15390 // Sku - READ-ONLY; The virtual machine SKU. 15391 Sku *Sku `json:"sku,omitempty"` 15392 *VirtualMachineScaleSetVMProperties `json:"properties,omitempty"` 15393 // 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**. 15394 Plan *Plan `json:"plan,omitempty"` 15395 // Resources - READ-ONLY; The virtual machine child extension resources. 15396 Resources *[]VirtualMachineExtension `json:"resources,omitempty"` 15397 // Zones - READ-ONLY; The virtual machine zones. 15398 Zones *[]string `json:"zones,omitempty"` 15399 // ID - READ-ONLY; Resource Id 15400 ID *string `json:"id,omitempty"` 15401 // Name - READ-ONLY; Resource name 15402 Name *string `json:"name,omitempty"` 15403 // Type - READ-ONLY; Resource type 15404 Type *string `json:"type,omitempty"` 15405 // Location - Resource location 15406 Location *string `json:"location,omitempty"` 15407 // Tags - Resource tags 15408 Tags map[string]*string `json:"tags"` 15409} 15410 15411// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVM. 15412func (vmssv VirtualMachineScaleSetVM) MarshalJSON() ([]byte, error) { 15413 objectMap := make(map[string]interface{}) 15414 if vmssv.VirtualMachineScaleSetVMProperties != nil { 15415 objectMap["properties"] = vmssv.VirtualMachineScaleSetVMProperties 15416 } 15417 if vmssv.Plan != nil { 15418 objectMap["plan"] = vmssv.Plan 15419 } 15420 if vmssv.Location != nil { 15421 objectMap["location"] = vmssv.Location 15422 } 15423 if vmssv.Tags != nil { 15424 objectMap["tags"] = vmssv.Tags 15425 } 15426 return json.Marshal(objectMap) 15427} 15428 15429// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetVM struct. 15430func (vmssv *VirtualMachineScaleSetVM) UnmarshalJSON(body []byte) error { 15431 var m map[string]*json.RawMessage 15432 err := json.Unmarshal(body, &m) 15433 if err != nil { 15434 return err 15435 } 15436 for k, v := range m { 15437 switch k { 15438 case "instanceId": 15439 if v != nil { 15440 var instanceID string 15441 err = json.Unmarshal(*v, &instanceID) 15442 if err != nil { 15443 return err 15444 } 15445 vmssv.InstanceID = &instanceID 15446 } 15447 case "sku": 15448 if v != nil { 15449 var sku Sku 15450 err = json.Unmarshal(*v, &sku) 15451 if err != nil { 15452 return err 15453 } 15454 vmssv.Sku = &sku 15455 } 15456 case "properties": 15457 if v != nil { 15458 var virtualMachineScaleSetVMProperties VirtualMachineScaleSetVMProperties 15459 err = json.Unmarshal(*v, &virtualMachineScaleSetVMProperties) 15460 if err != nil { 15461 return err 15462 } 15463 vmssv.VirtualMachineScaleSetVMProperties = &virtualMachineScaleSetVMProperties 15464 } 15465 case "plan": 15466 if v != nil { 15467 var plan Plan 15468 err = json.Unmarshal(*v, &plan) 15469 if err != nil { 15470 return err 15471 } 15472 vmssv.Plan = &plan 15473 } 15474 case "resources": 15475 if v != nil { 15476 var resources []VirtualMachineExtension 15477 err = json.Unmarshal(*v, &resources) 15478 if err != nil { 15479 return err 15480 } 15481 vmssv.Resources = &resources 15482 } 15483 case "zones": 15484 if v != nil { 15485 var zones []string 15486 err = json.Unmarshal(*v, &zones) 15487 if err != nil { 15488 return err 15489 } 15490 vmssv.Zones = &zones 15491 } 15492 case "id": 15493 if v != nil { 15494 var ID string 15495 err = json.Unmarshal(*v, &ID) 15496 if err != nil { 15497 return err 15498 } 15499 vmssv.ID = &ID 15500 } 15501 case "name": 15502 if v != nil { 15503 var name string 15504 err = json.Unmarshal(*v, &name) 15505 if err != nil { 15506 return err 15507 } 15508 vmssv.Name = &name 15509 } 15510 case "type": 15511 if v != nil { 15512 var typeVar string 15513 err = json.Unmarshal(*v, &typeVar) 15514 if err != nil { 15515 return err 15516 } 15517 vmssv.Type = &typeVar 15518 } 15519 case "location": 15520 if v != nil { 15521 var location string 15522 err = json.Unmarshal(*v, &location) 15523 if err != nil { 15524 return err 15525 } 15526 vmssv.Location = &location 15527 } 15528 case "tags": 15529 if v != nil { 15530 var tags map[string]*string 15531 err = json.Unmarshal(*v, &tags) 15532 if err != nil { 15533 return err 15534 } 15535 vmssv.Tags = tags 15536 } 15537 } 15538 } 15539 15540 return nil 15541} 15542 15543// VirtualMachineScaleSetVMExtension describes a VMSS VM Extension. 15544type VirtualMachineScaleSetVMExtension struct { 15545 autorest.Response `json:"-"` 15546 // Name - READ-ONLY; The name of the extension. 15547 Name *string `json:"name,omitempty"` 15548 // Type - READ-ONLY; Resource type 15549 Type *string `json:"type,omitempty"` 15550 *VirtualMachineExtensionProperties `json:"properties,omitempty"` 15551 // ID - READ-ONLY; Resource Id 15552 ID *string `json:"id,omitempty"` 15553} 15554 15555// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMExtension. 15556func (vmssve VirtualMachineScaleSetVMExtension) MarshalJSON() ([]byte, error) { 15557 objectMap := make(map[string]interface{}) 15558 if vmssve.VirtualMachineExtensionProperties != nil { 15559 objectMap["properties"] = vmssve.VirtualMachineExtensionProperties 15560 } 15561 return json.Marshal(objectMap) 15562} 15563 15564// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetVMExtension struct. 15565func (vmssve *VirtualMachineScaleSetVMExtension) UnmarshalJSON(body []byte) error { 15566 var m map[string]*json.RawMessage 15567 err := json.Unmarshal(body, &m) 15568 if err != nil { 15569 return err 15570 } 15571 for k, v := range m { 15572 switch k { 15573 case "name": 15574 if v != nil { 15575 var name string 15576 err = json.Unmarshal(*v, &name) 15577 if err != nil { 15578 return err 15579 } 15580 vmssve.Name = &name 15581 } 15582 case "type": 15583 if v != nil { 15584 var typeVar string 15585 err = json.Unmarshal(*v, &typeVar) 15586 if err != nil { 15587 return err 15588 } 15589 vmssve.Type = &typeVar 15590 } 15591 case "properties": 15592 if v != nil { 15593 var virtualMachineExtensionProperties VirtualMachineExtensionProperties 15594 err = json.Unmarshal(*v, &virtualMachineExtensionProperties) 15595 if err != nil { 15596 return err 15597 } 15598 vmssve.VirtualMachineExtensionProperties = &virtualMachineExtensionProperties 15599 } 15600 case "id": 15601 if v != nil { 15602 var ID string 15603 err = json.Unmarshal(*v, &ID) 15604 if err != nil { 15605 return err 15606 } 15607 vmssve.ID = &ID 15608 } 15609 } 15610 } 15611 15612 return nil 15613} 15614 15615// VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the 15616// results of a long-running operation. 15617type VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture struct { 15618 azure.FutureAPI 15619 // Result returns the result of the asynchronous operation. 15620 // If the operation has not completed it will return an error. 15621 Result func(VirtualMachineScaleSetVMExtensionsClient) (VirtualMachineScaleSetVMExtension, error) 15622} 15623 15624// UnmarshalJSON is the custom unmarshaller for CreateFuture. 15625func (future *VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 15626 var azFuture azure.Future 15627 if err := json.Unmarshal(body, &azFuture); err != nil { 15628 return err 15629 } 15630 future.FutureAPI = &azFuture 15631 future.Result = future.result 15632 return nil 15633} 15634 15635// result is the default implementation for VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture.Result. 15636func (future *VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture) result(client VirtualMachineScaleSetVMExtensionsClient) (vmssve VirtualMachineScaleSetVMExtension, err error) { 15637 var done bool 15638 done, err = future.DoneWithContext(context.Background(), client) 15639 if err != nil { 15640 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 15641 return 15642 } 15643 if !done { 15644 vmssve.Response.Response = future.Response() 15645 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture") 15646 return 15647 } 15648 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 15649 if vmssve.Response.Response, err = future.GetResult(sender); err == nil && vmssve.Response.Response.StatusCode != http.StatusNoContent { 15650 vmssve, err = client.CreateOrUpdateResponder(vmssve.Response.Response) 15651 if err != nil { 15652 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture", "Result", vmssve.Response.Response, "Failure responding to request") 15653 } 15654 } 15655 return 15656} 15657 15658// VirtualMachineScaleSetVMExtensionsDeleteFuture an abstraction for monitoring and retrieving the results 15659// of a long-running operation. 15660type VirtualMachineScaleSetVMExtensionsDeleteFuture struct { 15661 azure.FutureAPI 15662 // Result returns the result of the asynchronous operation. 15663 // If the operation has not completed it will return an error. 15664 Result func(VirtualMachineScaleSetVMExtensionsClient) (autorest.Response, error) 15665} 15666 15667// UnmarshalJSON is the custom unmarshaller for CreateFuture. 15668func (future *VirtualMachineScaleSetVMExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { 15669 var azFuture azure.Future 15670 if err := json.Unmarshal(body, &azFuture); err != nil { 15671 return err 15672 } 15673 future.FutureAPI = &azFuture 15674 future.Result = future.result 15675 return nil 15676} 15677 15678// result is the default implementation for VirtualMachineScaleSetVMExtensionsDeleteFuture.Result. 15679func (future *VirtualMachineScaleSetVMExtensionsDeleteFuture) result(client VirtualMachineScaleSetVMExtensionsClient) (ar autorest.Response, err error) { 15680 var done bool 15681 done, err = future.DoneWithContext(context.Background(), client) 15682 if err != nil { 15683 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") 15684 return 15685 } 15686 if !done { 15687 ar.Response = future.Response() 15688 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsDeleteFuture") 15689 return 15690 } 15691 ar.Response = future.Response() 15692 return 15693} 15694 15695// VirtualMachineScaleSetVMExtensionsListResult the List VMSS VM Extension operation response 15696type VirtualMachineScaleSetVMExtensionsListResult struct { 15697 autorest.Response `json:"-"` 15698 // Value - The list of VMSS VM extensions 15699 Value *[]VirtualMachineScaleSetVMExtension `json:"value,omitempty"` 15700} 15701 15702// VirtualMachineScaleSetVMExtensionsSummary extensions summary for virtual machines of a virtual machine 15703// scale set. 15704type VirtualMachineScaleSetVMExtensionsSummary struct { 15705 // Name - READ-ONLY; The extension name. 15706 Name *string `json:"name,omitempty"` 15707 // StatusesSummary - READ-ONLY; The extensions information. 15708 StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` 15709} 15710 15711// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMExtensionsSummary. 15712func (vmssves VirtualMachineScaleSetVMExtensionsSummary) MarshalJSON() ([]byte, error) { 15713 objectMap := make(map[string]interface{}) 15714 return json.Marshal(objectMap) 15715} 15716 15717// VirtualMachineScaleSetVMExtensionsUpdateFuture an abstraction for monitoring and retrieving the results 15718// of a long-running operation. 15719type VirtualMachineScaleSetVMExtensionsUpdateFuture struct { 15720 azure.FutureAPI 15721 // Result returns the result of the asynchronous operation. 15722 // If the operation has not completed it will return an error. 15723 Result func(VirtualMachineScaleSetVMExtensionsClient) (VirtualMachineScaleSetVMExtension, error) 15724} 15725 15726// UnmarshalJSON is the custom unmarshaller for CreateFuture. 15727func (future *VirtualMachineScaleSetVMExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { 15728 var azFuture azure.Future 15729 if err := json.Unmarshal(body, &azFuture); err != nil { 15730 return err 15731 } 15732 future.FutureAPI = &azFuture 15733 future.Result = future.result 15734 return nil 15735} 15736 15737// result is the default implementation for VirtualMachineScaleSetVMExtensionsUpdateFuture.Result. 15738func (future *VirtualMachineScaleSetVMExtensionsUpdateFuture) result(client VirtualMachineScaleSetVMExtensionsClient) (vmssve VirtualMachineScaleSetVMExtension, err error) { 15739 var done bool 15740 done, err = future.DoneWithContext(context.Background(), client) 15741 if err != nil { 15742 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsUpdateFuture", "Result", future.Response(), "Polling failure") 15743 return 15744 } 15745 if !done { 15746 vmssve.Response.Response = future.Response() 15747 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsUpdateFuture") 15748 return 15749 } 15750 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 15751 if vmssve.Response.Response, err = future.GetResult(sender); err == nil && vmssve.Response.Response.StatusCode != http.StatusNoContent { 15752 vmssve, err = client.UpdateResponder(vmssve.Response.Response) 15753 if err != nil { 15754 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsUpdateFuture", "Result", vmssve.Response.Response, "Failure responding to request") 15755 } 15756 } 15757 return 15758} 15759 15760// VirtualMachineScaleSetVMExtensionUpdate describes a VMSS VM Extension. 15761type VirtualMachineScaleSetVMExtensionUpdate struct { 15762 // Name - READ-ONLY; The name of the extension. 15763 Name *string `json:"name,omitempty"` 15764 // Type - READ-ONLY; Resource type 15765 Type *string `json:"type,omitempty"` 15766 *VirtualMachineExtensionUpdateProperties `json:"properties,omitempty"` 15767 // ID - READ-ONLY; Resource Id 15768 ID *string `json:"id,omitempty"` 15769} 15770 15771// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMExtensionUpdate. 15772func (vmssveu VirtualMachineScaleSetVMExtensionUpdate) MarshalJSON() ([]byte, error) { 15773 objectMap := make(map[string]interface{}) 15774 if vmssveu.VirtualMachineExtensionUpdateProperties != nil { 15775 objectMap["properties"] = vmssveu.VirtualMachineExtensionUpdateProperties 15776 } 15777 return json.Marshal(objectMap) 15778} 15779 15780// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetVMExtensionUpdate struct. 15781func (vmssveu *VirtualMachineScaleSetVMExtensionUpdate) UnmarshalJSON(body []byte) error { 15782 var m map[string]*json.RawMessage 15783 err := json.Unmarshal(body, &m) 15784 if err != nil { 15785 return err 15786 } 15787 for k, v := range m { 15788 switch k { 15789 case "name": 15790 if v != nil { 15791 var name string 15792 err = json.Unmarshal(*v, &name) 15793 if err != nil { 15794 return err 15795 } 15796 vmssveu.Name = &name 15797 } 15798 case "type": 15799 if v != nil { 15800 var typeVar string 15801 err = json.Unmarshal(*v, &typeVar) 15802 if err != nil { 15803 return err 15804 } 15805 vmssveu.Type = &typeVar 15806 } 15807 case "properties": 15808 if v != nil { 15809 var virtualMachineExtensionUpdateProperties VirtualMachineExtensionUpdateProperties 15810 err = json.Unmarshal(*v, &virtualMachineExtensionUpdateProperties) 15811 if err != nil { 15812 return err 15813 } 15814 vmssveu.VirtualMachineExtensionUpdateProperties = &virtualMachineExtensionUpdateProperties 15815 } 15816 case "id": 15817 if v != nil { 15818 var ID string 15819 err = json.Unmarshal(*v, &ID) 15820 if err != nil { 15821 return err 15822 } 15823 vmssveu.ID = &ID 15824 } 15825 } 15826 } 15827 15828 return nil 15829} 15830 15831// VirtualMachineScaleSetVMInstanceIDs specifies a list of virtual machine instance IDs from the VM scale 15832// set. 15833type VirtualMachineScaleSetVMInstanceIDs struct { 15834 // 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. 15835 InstanceIds *[]string `json:"instanceIds,omitempty"` 15836} 15837 15838// VirtualMachineScaleSetVMInstanceRequiredIDs specifies a list of virtual machine instance IDs from the VM 15839// scale set. 15840type VirtualMachineScaleSetVMInstanceRequiredIDs struct { 15841 // InstanceIds - The virtual machine scale set instance ids. 15842 InstanceIds *[]string `json:"instanceIds,omitempty"` 15843} 15844 15845// VirtualMachineScaleSetVMInstanceView the instance view of a virtual machine scale set VM. 15846type VirtualMachineScaleSetVMInstanceView struct { 15847 autorest.Response `json:"-"` 15848 // PlatformUpdateDomain - The Update Domain count. 15849 PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` 15850 // PlatformFaultDomain - The Fault Domain count. 15851 PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` 15852 // RdpThumbPrint - The Remote desktop certificate thumbprint. 15853 RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"` 15854 // VMAgent - The VM Agent running on the virtual machine. 15855 VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"` 15856 // MaintenanceRedeployStatus - The Maintenance Operation status on the virtual machine. 15857 MaintenanceRedeployStatus *MaintenanceRedeployStatus `json:"maintenanceRedeployStatus,omitempty"` 15858 // Disks - The disks information. 15859 Disks *[]DiskInstanceView `json:"disks,omitempty"` 15860 // Extensions - The extensions information. 15861 Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` 15862 // VMHealth - READ-ONLY; The health status for the VM. 15863 VMHealth *VirtualMachineHealthStatus `json:"vmHealth,omitempty"` 15864 // 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. 15865 BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` 15866 // Statuses - The resource status information. 15867 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 15868 // 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. 15869 AssignedHost *string `json:"assignedHost,omitempty"` 15870 // PlacementGroupID - The placement group in which the VM is running. If the VM is deallocated it will not have a placementGroupId. 15871 PlacementGroupID *string `json:"placementGroupId,omitempty"` 15872} 15873 15874// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMInstanceView. 15875func (vmssviv VirtualMachineScaleSetVMInstanceView) MarshalJSON() ([]byte, error) { 15876 objectMap := make(map[string]interface{}) 15877 if vmssviv.PlatformUpdateDomain != nil { 15878 objectMap["platformUpdateDomain"] = vmssviv.PlatformUpdateDomain 15879 } 15880 if vmssviv.PlatformFaultDomain != nil { 15881 objectMap["platformFaultDomain"] = vmssviv.PlatformFaultDomain 15882 } 15883 if vmssviv.RdpThumbPrint != nil { 15884 objectMap["rdpThumbPrint"] = vmssviv.RdpThumbPrint 15885 } 15886 if vmssviv.VMAgent != nil { 15887 objectMap["vmAgent"] = vmssviv.VMAgent 15888 } 15889 if vmssviv.MaintenanceRedeployStatus != nil { 15890 objectMap["maintenanceRedeployStatus"] = vmssviv.MaintenanceRedeployStatus 15891 } 15892 if vmssviv.Disks != nil { 15893 objectMap["disks"] = vmssviv.Disks 15894 } 15895 if vmssviv.Extensions != nil { 15896 objectMap["extensions"] = vmssviv.Extensions 15897 } 15898 if vmssviv.BootDiagnostics != nil { 15899 objectMap["bootDiagnostics"] = vmssviv.BootDiagnostics 15900 } 15901 if vmssviv.Statuses != nil { 15902 objectMap["statuses"] = vmssviv.Statuses 15903 } 15904 if vmssviv.PlacementGroupID != nil { 15905 objectMap["placementGroupId"] = vmssviv.PlacementGroupID 15906 } 15907 return json.Marshal(objectMap) 15908} 15909 15910// VirtualMachineScaleSetVMListResult the List Virtual Machine Scale Set VMs operation response. 15911type VirtualMachineScaleSetVMListResult struct { 15912 autorest.Response `json:"-"` 15913 // Value - The list of virtual machine scale sets VMs. 15914 Value *[]VirtualMachineScaleSetVM `json:"value,omitempty"` 15915 // 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 15916 NextLink *string `json:"nextLink,omitempty"` 15917} 15918 15919// VirtualMachineScaleSetVMListResultIterator provides access to a complete listing of 15920// VirtualMachineScaleSetVM values. 15921type VirtualMachineScaleSetVMListResultIterator struct { 15922 i int 15923 page VirtualMachineScaleSetVMListResultPage 15924} 15925 15926// NextWithContext advances to the next value. If there was an error making 15927// the request the iterator does not advance and the error is returned. 15928func (iter *VirtualMachineScaleSetVMListResultIterator) NextWithContext(ctx context.Context) (err error) { 15929 if tracing.IsEnabled() { 15930 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMListResultIterator.NextWithContext") 15931 defer func() { 15932 sc := -1 15933 if iter.Response().Response.Response != nil { 15934 sc = iter.Response().Response.Response.StatusCode 15935 } 15936 tracing.EndSpan(ctx, sc, err) 15937 }() 15938 } 15939 iter.i++ 15940 if iter.i < len(iter.page.Values()) { 15941 return nil 15942 } 15943 err = iter.page.NextWithContext(ctx) 15944 if err != nil { 15945 iter.i-- 15946 return err 15947 } 15948 iter.i = 0 15949 return nil 15950} 15951 15952// Next advances to the next value. If there was an error making 15953// the request the iterator does not advance and the error is returned. 15954// Deprecated: Use NextWithContext() instead. 15955func (iter *VirtualMachineScaleSetVMListResultIterator) Next() error { 15956 return iter.NextWithContext(context.Background()) 15957} 15958 15959// NotDone returns true if the enumeration should be started or is not yet complete. 15960func (iter VirtualMachineScaleSetVMListResultIterator) NotDone() bool { 15961 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 15962} 15963 15964// Response returns the raw server response from the last page request. 15965func (iter VirtualMachineScaleSetVMListResultIterator) Response() VirtualMachineScaleSetVMListResult { 15966 return iter.page.Response() 15967} 15968 15969// Value returns the current value or a zero-initialized value if the 15970// iterator has advanced beyond the end of the collection. 15971func (iter VirtualMachineScaleSetVMListResultIterator) Value() VirtualMachineScaleSetVM { 15972 if !iter.page.NotDone() { 15973 return VirtualMachineScaleSetVM{} 15974 } 15975 return iter.page.Values()[iter.i] 15976} 15977 15978// Creates a new instance of the VirtualMachineScaleSetVMListResultIterator type. 15979func NewVirtualMachineScaleSetVMListResultIterator(page VirtualMachineScaleSetVMListResultPage) VirtualMachineScaleSetVMListResultIterator { 15980 return VirtualMachineScaleSetVMListResultIterator{page: page} 15981} 15982 15983// IsEmpty returns true if the ListResult contains no values. 15984func (vmssvlr VirtualMachineScaleSetVMListResult) IsEmpty() bool { 15985 return vmssvlr.Value == nil || len(*vmssvlr.Value) == 0 15986} 15987 15988// hasNextLink returns true if the NextLink is not empty. 15989func (vmssvlr VirtualMachineScaleSetVMListResult) hasNextLink() bool { 15990 return vmssvlr.NextLink != nil && len(*vmssvlr.NextLink) != 0 15991} 15992 15993// virtualMachineScaleSetVMListResultPreparer prepares a request to retrieve the next set of results. 15994// It returns nil if no more results exist. 15995func (vmssvlr VirtualMachineScaleSetVMListResult) virtualMachineScaleSetVMListResultPreparer(ctx context.Context) (*http.Request, error) { 15996 if !vmssvlr.hasNextLink() { 15997 return nil, nil 15998 } 15999 return autorest.Prepare((&http.Request{}).WithContext(ctx), 16000 autorest.AsJSON(), 16001 autorest.AsGet(), 16002 autorest.WithBaseURL(to.String(vmssvlr.NextLink))) 16003} 16004 16005// VirtualMachineScaleSetVMListResultPage contains a page of VirtualMachineScaleSetVM values. 16006type VirtualMachineScaleSetVMListResultPage struct { 16007 fn func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error) 16008 vmssvlr VirtualMachineScaleSetVMListResult 16009} 16010 16011// NextWithContext advances to the next page of values. If there was an error making 16012// the request the page does not advance and the error is returned. 16013func (page *VirtualMachineScaleSetVMListResultPage) NextWithContext(ctx context.Context) (err error) { 16014 if tracing.IsEnabled() { 16015 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMListResultPage.NextWithContext") 16016 defer func() { 16017 sc := -1 16018 if page.Response().Response.Response != nil { 16019 sc = page.Response().Response.Response.StatusCode 16020 } 16021 tracing.EndSpan(ctx, sc, err) 16022 }() 16023 } 16024 for { 16025 next, err := page.fn(ctx, page.vmssvlr) 16026 if err != nil { 16027 return err 16028 } 16029 page.vmssvlr = next 16030 if !next.hasNextLink() || !next.IsEmpty() { 16031 break 16032 } 16033 } 16034 return nil 16035} 16036 16037// Next advances to the next page of values. If there was an error making 16038// the request the page does not advance and the error is returned. 16039// Deprecated: Use NextWithContext() instead. 16040func (page *VirtualMachineScaleSetVMListResultPage) Next() error { 16041 return page.NextWithContext(context.Background()) 16042} 16043 16044// NotDone returns true if the page enumeration should be started or is not yet complete. 16045func (page VirtualMachineScaleSetVMListResultPage) NotDone() bool { 16046 return !page.vmssvlr.IsEmpty() 16047} 16048 16049// Response returns the raw server response from the last page request. 16050func (page VirtualMachineScaleSetVMListResultPage) Response() VirtualMachineScaleSetVMListResult { 16051 return page.vmssvlr 16052} 16053 16054// Values returns the slice of values for the current page or nil if there are no values. 16055func (page VirtualMachineScaleSetVMListResultPage) Values() []VirtualMachineScaleSetVM { 16056 if page.vmssvlr.IsEmpty() { 16057 return nil 16058 } 16059 return *page.vmssvlr.Value 16060} 16061 16062// Creates a new instance of the VirtualMachineScaleSetVMListResultPage type. 16063func NewVirtualMachineScaleSetVMListResultPage(cur VirtualMachineScaleSetVMListResult, getNextPage func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error)) VirtualMachineScaleSetVMListResultPage { 16064 return VirtualMachineScaleSetVMListResultPage{ 16065 fn: getNextPage, 16066 vmssvlr: cur, 16067 } 16068} 16069 16070// VirtualMachineScaleSetVMNetworkProfileConfiguration describes a virtual machine scale set VM network 16071// profile. 16072type VirtualMachineScaleSetVMNetworkProfileConfiguration struct { 16073 // NetworkInterfaceConfigurations - The list of network configurations. 16074 NetworkInterfaceConfigurations *[]VirtualMachineScaleSetNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` 16075} 16076 16077// VirtualMachineScaleSetVMProfile describes a virtual machine scale set virtual machine profile. 16078type VirtualMachineScaleSetVMProfile struct { 16079 // OsProfile - Specifies the operating system settings for the virtual machines in the scale set. 16080 OsProfile *VirtualMachineScaleSetOSProfile `json:"osProfile,omitempty"` 16081 // StorageProfile - Specifies the storage settings for the virtual machine disks. 16082 StorageProfile *VirtualMachineScaleSetStorageProfile `json:"storageProfile,omitempty"` 16083 // NetworkProfile - Specifies properties of the network interfaces of the virtual machines in the scale set. 16084 NetworkProfile *VirtualMachineScaleSetNetworkProfile `json:"networkProfile,omitempty"` 16085 // SecurityProfile - Specifies the Security related profile settings for the virtual machines in the scale set. 16086 SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` 16087 // DiagnosticsProfile - Specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. 16088 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 16089 // ExtensionProfile - Specifies a collection of settings for extensions installed on virtual machines in the scale set. 16090 ExtensionProfile *VirtualMachineScaleSetExtensionProfile `json:"extensionProfile,omitempty"` 16091 // 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 16092 LicenseType *string `json:"licenseType,omitempty"` 16093 // Priority - Specifies the priority for the virtual machines in the scale set. <br><br>Minimum api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low', 'Spot' 16094 Priority VirtualMachinePriorityTypes `json:"priority,omitempty"` 16095 // EvictionPolicy - Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set. <br><br>For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01. <br><br>For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. Possible values include: 'Deallocate', 'Delete' 16096 EvictionPolicy VirtualMachineEvictionPolicyTypes `json:"evictionPolicy,omitempty"` 16097 // BillingProfile - Specifies the billing related details of a Azure Spot VMSS. <br><br>Minimum api-version: 2019-03-01. 16098 BillingProfile *BillingProfile `json:"billingProfile,omitempty"` 16099 // ScheduledEventsProfile - Specifies Scheduled Event related configurations. 16100 ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` 16101} 16102 16103// VirtualMachineScaleSetVMProperties describes the properties of a virtual machine scale set virtual 16104// machine. 16105type VirtualMachineScaleSetVMProperties struct { 16106 // LatestModelApplied - READ-ONLY; Specifies whether the latest model has been applied to the virtual machine. 16107 LatestModelApplied *bool `json:"latestModelApplied,omitempty"` 16108 // VMID - READ-ONLY; Azure VM unique ID. 16109 VMID *string `json:"vmId,omitempty"` 16110 // InstanceView - READ-ONLY; The virtual machine instance view. 16111 InstanceView *VirtualMachineScaleSetVMInstanceView `json:"instanceView,omitempty"` 16112 // HardwareProfile - Specifies the hardware settings for the virtual machine. 16113 HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` 16114 // StorageProfile - Specifies the storage settings for the virtual machine disks. 16115 StorageProfile *StorageProfile `json:"storageProfile,omitempty"` 16116 // 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. 16117 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 16118 // OsProfile - Specifies the operating system settings for the virtual machine. 16119 OsProfile *OSProfile `json:"osProfile,omitempty"` 16120 // SecurityProfile - Specifies the Security related profile settings for the virtual machine. 16121 SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` 16122 // NetworkProfile - Specifies the network interfaces of the virtual machine. 16123 NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` 16124 // NetworkProfileConfiguration - Specifies the network profile configuration of the virtual machine. 16125 NetworkProfileConfiguration *VirtualMachineScaleSetVMNetworkProfileConfiguration `json:"networkProfileConfiguration,omitempty"` 16126 // DiagnosticsProfile - Specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. 16127 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 16128 // AvailabilitySet - Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see [Manage the availability of virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). <br><br> For more information on Azure planned maintenance, see [Planned maintenance for virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) <br><br> Currently, a VM can only be added to availability set at creation time. An existing VM cannot be added to an availability set. 16129 AvailabilitySet *SubResource `json:"availabilitySet,omitempty"` 16130 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 16131 ProvisioningState *string `json:"provisioningState,omitempty"` 16132 // 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 16133 LicenseType *string `json:"licenseType,omitempty"` 16134 // 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. 16135 ModelDefinitionApplied *string `json:"modelDefinitionApplied,omitempty"` 16136 // ProtectionPolicy - Specifies the protection policy of the virtual machine. 16137 ProtectionPolicy *VirtualMachineScaleSetVMProtectionPolicy `json:"protectionPolicy,omitempty"` 16138} 16139 16140// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMProperties. 16141func (vmssvp VirtualMachineScaleSetVMProperties) MarshalJSON() ([]byte, error) { 16142 objectMap := make(map[string]interface{}) 16143 if vmssvp.HardwareProfile != nil { 16144 objectMap["hardwareProfile"] = vmssvp.HardwareProfile 16145 } 16146 if vmssvp.StorageProfile != nil { 16147 objectMap["storageProfile"] = vmssvp.StorageProfile 16148 } 16149 if vmssvp.AdditionalCapabilities != nil { 16150 objectMap["additionalCapabilities"] = vmssvp.AdditionalCapabilities 16151 } 16152 if vmssvp.OsProfile != nil { 16153 objectMap["osProfile"] = vmssvp.OsProfile 16154 } 16155 if vmssvp.SecurityProfile != nil { 16156 objectMap["securityProfile"] = vmssvp.SecurityProfile 16157 } 16158 if vmssvp.NetworkProfile != nil { 16159 objectMap["networkProfile"] = vmssvp.NetworkProfile 16160 } 16161 if vmssvp.NetworkProfileConfiguration != nil { 16162 objectMap["networkProfileConfiguration"] = vmssvp.NetworkProfileConfiguration 16163 } 16164 if vmssvp.DiagnosticsProfile != nil { 16165 objectMap["diagnosticsProfile"] = vmssvp.DiagnosticsProfile 16166 } 16167 if vmssvp.AvailabilitySet != nil { 16168 objectMap["availabilitySet"] = vmssvp.AvailabilitySet 16169 } 16170 if vmssvp.LicenseType != nil { 16171 objectMap["licenseType"] = vmssvp.LicenseType 16172 } 16173 if vmssvp.ProtectionPolicy != nil { 16174 objectMap["protectionPolicy"] = vmssvp.ProtectionPolicy 16175 } 16176 return json.Marshal(objectMap) 16177} 16178 16179// VirtualMachineScaleSetVMProtectionPolicy the protection policy of a virtual machine scale set VM. 16180type VirtualMachineScaleSetVMProtectionPolicy struct { 16181 // ProtectFromScaleIn - Indicates that the virtual machine scale set VM shouldn't be considered for deletion during a scale-in operation. 16182 ProtectFromScaleIn *bool `json:"protectFromScaleIn,omitempty"` 16183 // 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. 16184 ProtectFromScaleSetActions *bool `json:"protectFromScaleSetActions,omitempty"` 16185} 16186 16187// VirtualMachineScaleSetVMReimageParameters describes a Virtual Machine Scale Set VM Reimage Parameters. 16188type VirtualMachineScaleSetVMReimageParameters struct { 16189 // 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. 16190 TempDisk *bool `json:"tempDisk,omitempty"` 16191} 16192 16193// VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture an abstraction for monitoring and retrieving the 16194// results of a long-running operation. 16195type VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture struct { 16196 azure.FutureAPI 16197 // Result returns the result of the asynchronous operation. 16198 // If the operation has not completed it will return an error. 16199 Result func(VirtualMachineScaleSetVMRunCommandsClient) (VirtualMachineRunCommand, error) 16200} 16201 16202// UnmarshalJSON is the custom unmarshaller for CreateFuture. 16203func (future *VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 16204 var azFuture azure.Future 16205 if err := json.Unmarshal(body, &azFuture); err != nil { 16206 return err 16207 } 16208 future.FutureAPI = &azFuture 16209 future.Result = future.result 16210 return nil 16211} 16212 16213// result is the default implementation for VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture.Result. 16214func (future *VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture) result(client VirtualMachineScaleSetVMRunCommandsClient) (vmrc VirtualMachineRunCommand, err error) { 16215 var done bool 16216 done, err = future.DoneWithContext(context.Background(), client) 16217 if err != nil { 16218 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 16219 return 16220 } 16221 if !done { 16222 vmrc.Response.Response = future.Response() 16223 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture") 16224 return 16225 } 16226 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 16227 if vmrc.Response.Response, err = future.GetResult(sender); err == nil && vmrc.Response.Response.StatusCode != http.StatusNoContent { 16228 vmrc, err = client.CreateOrUpdateResponder(vmrc.Response.Response) 16229 if err != nil { 16230 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture", "Result", vmrc.Response.Response, "Failure responding to request") 16231 } 16232 } 16233 return 16234} 16235 16236// VirtualMachineScaleSetVMRunCommandsDeleteFuture an abstraction for monitoring and retrieving the results 16237// of a long-running operation. 16238type VirtualMachineScaleSetVMRunCommandsDeleteFuture struct { 16239 azure.FutureAPI 16240 // Result returns the result of the asynchronous operation. 16241 // If the operation has not completed it will return an error. 16242 Result func(VirtualMachineScaleSetVMRunCommandsClient) (autorest.Response, error) 16243} 16244 16245// UnmarshalJSON is the custom unmarshaller for CreateFuture. 16246func (future *VirtualMachineScaleSetVMRunCommandsDeleteFuture) UnmarshalJSON(body []byte) error { 16247 var azFuture azure.Future 16248 if err := json.Unmarshal(body, &azFuture); err != nil { 16249 return err 16250 } 16251 future.FutureAPI = &azFuture 16252 future.Result = future.result 16253 return nil 16254} 16255 16256// result is the default implementation for VirtualMachineScaleSetVMRunCommandsDeleteFuture.Result. 16257func (future *VirtualMachineScaleSetVMRunCommandsDeleteFuture) result(client VirtualMachineScaleSetVMRunCommandsClient) (ar autorest.Response, err error) { 16258 var done bool 16259 done, err = future.DoneWithContext(context.Background(), client) 16260 if err != nil { 16261 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsDeleteFuture", "Result", future.Response(), "Polling failure") 16262 return 16263 } 16264 if !done { 16265 ar.Response = future.Response() 16266 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMRunCommandsDeleteFuture") 16267 return 16268 } 16269 ar.Response = future.Response() 16270 return 16271} 16272 16273// VirtualMachineScaleSetVMRunCommandsUpdateFuture an abstraction for monitoring and retrieving the results 16274// of a long-running operation. 16275type VirtualMachineScaleSetVMRunCommandsUpdateFuture struct { 16276 azure.FutureAPI 16277 // Result returns the result of the asynchronous operation. 16278 // If the operation has not completed it will return an error. 16279 Result func(VirtualMachineScaleSetVMRunCommandsClient) (VirtualMachineRunCommand, error) 16280} 16281 16282// UnmarshalJSON is the custom unmarshaller for CreateFuture. 16283func (future *VirtualMachineScaleSetVMRunCommandsUpdateFuture) UnmarshalJSON(body []byte) error { 16284 var azFuture azure.Future 16285 if err := json.Unmarshal(body, &azFuture); err != nil { 16286 return err 16287 } 16288 future.FutureAPI = &azFuture 16289 future.Result = future.result 16290 return nil 16291} 16292 16293// result is the default implementation for VirtualMachineScaleSetVMRunCommandsUpdateFuture.Result. 16294func (future *VirtualMachineScaleSetVMRunCommandsUpdateFuture) result(client VirtualMachineScaleSetVMRunCommandsClient) (vmrc VirtualMachineRunCommand, err error) { 16295 var done bool 16296 done, err = future.DoneWithContext(context.Background(), client) 16297 if err != nil { 16298 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsUpdateFuture", "Result", future.Response(), "Polling failure") 16299 return 16300 } 16301 if !done { 16302 vmrc.Response.Response = future.Response() 16303 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMRunCommandsUpdateFuture") 16304 return 16305 } 16306 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 16307 if vmrc.Response.Response, err = future.GetResult(sender); err == nil && vmrc.Response.Response.StatusCode != http.StatusNoContent { 16308 vmrc, err = client.UpdateResponder(vmrc.Response.Response) 16309 if err != nil { 16310 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsUpdateFuture", "Result", vmrc.Response.Response, "Failure responding to request") 16311 } 16312 } 16313 return 16314} 16315 16316// VirtualMachineScaleSetVMsDeallocateFuture an abstraction for monitoring and retrieving the results of a 16317// long-running operation. 16318type VirtualMachineScaleSetVMsDeallocateFuture struct { 16319 azure.FutureAPI 16320 // Result returns the result of the asynchronous operation. 16321 // If the operation has not completed it will return an error. 16322 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 16323} 16324 16325// UnmarshalJSON is the custom unmarshaller for CreateFuture. 16326func (future *VirtualMachineScaleSetVMsDeallocateFuture) UnmarshalJSON(body []byte) error { 16327 var azFuture azure.Future 16328 if err := json.Unmarshal(body, &azFuture); err != nil { 16329 return err 16330 } 16331 future.FutureAPI = &azFuture 16332 future.Result = future.result 16333 return nil 16334} 16335 16336// result is the default implementation for VirtualMachineScaleSetVMsDeallocateFuture.Result. 16337func (future *VirtualMachineScaleSetVMsDeallocateFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 16338 var done bool 16339 done, err = future.DoneWithContext(context.Background(), client) 16340 if err != nil { 16341 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsDeallocateFuture", "Result", future.Response(), "Polling failure") 16342 return 16343 } 16344 if !done { 16345 ar.Response = future.Response() 16346 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsDeallocateFuture") 16347 return 16348 } 16349 ar.Response = future.Response() 16350 return 16351} 16352 16353// VirtualMachineScaleSetVMsDeleteFuture an abstraction for monitoring and retrieving the results of a 16354// long-running operation. 16355type VirtualMachineScaleSetVMsDeleteFuture struct { 16356 azure.FutureAPI 16357 // Result returns the result of the asynchronous operation. 16358 // If the operation has not completed it will return an error. 16359 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 16360} 16361 16362// UnmarshalJSON is the custom unmarshaller for CreateFuture. 16363func (future *VirtualMachineScaleSetVMsDeleteFuture) UnmarshalJSON(body []byte) error { 16364 var azFuture azure.Future 16365 if err := json.Unmarshal(body, &azFuture); err != nil { 16366 return err 16367 } 16368 future.FutureAPI = &azFuture 16369 future.Result = future.result 16370 return nil 16371} 16372 16373// result is the default implementation for VirtualMachineScaleSetVMsDeleteFuture.Result. 16374func (future *VirtualMachineScaleSetVMsDeleteFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 16375 var done bool 16376 done, err = future.DoneWithContext(context.Background(), client) 16377 if err != nil { 16378 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsDeleteFuture", "Result", future.Response(), "Polling failure") 16379 return 16380 } 16381 if !done { 16382 ar.Response = future.Response() 16383 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsDeleteFuture") 16384 return 16385 } 16386 ar.Response = future.Response() 16387 return 16388} 16389 16390// VirtualMachineScaleSetVMsPerformMaintenanceFuture an abstraction for monitoring and retrieving the 16391// results of a long-running operation. 16392type VirtualMachineScaleSetVMsPerformMaintenanceFuture struct { 16393 azure.FutureAPI 16394 // Result returns the result of the asynchronous operation. 16395 // If the operation has not completed it will return an error. 16396 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 16397} 16398 16399// UnmarshalJSON is the custom unmarshaller for CreateFuture. 16400func (future *VirtualMachineScaleSetVMsPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { 16401 var azFuture azure.Future 16402 if err := json.Unmarshal(body, &azFuture); err != nil { 16403 return err 16404 } 16405 future.FutureAPI = &azFuture 16406 future.Result = future.result 16407 return nil 16408} 16409 16410// result is the default implementation for VirtualMachineScaleSetVMsPerformMaintenanceFuture.Result. 16411func (future *VirtualMachineScaleSetVMsPerformMaintenanceFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 16412 var done bool 16413 done, err = future.DoneWithContext(context.Background(), client) 16414 if err != nil { 16415 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsPerformMaintenanceFuture", "Result", future.Response(), "Polling failure") 16416 return 16417 } 16418 if !done { 16419 ar.Response = future.Response() 16420 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsPerformMaintenanceFuture") 16421 return 16422 } 16423 ar.Response = future.Response() 16424 return 16425} 16426 16427// VirtualMachineScaleSetVMsPowerOffFuture an abstraction for monitoring and retrieving the results of a 16428// long-running operation. 16429type VirtualMachineScaleSetVMsPowerOffFuture struct { 16430 azure.FutureAPI 16431 // Result returns the result of the asynchronous operation. 16432 // If the operation has not completed it will return an error. 16433 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 16434} 16435 16436// UnmarshalJSON is the custom unmarshaller for CreateFuture. 16437func (future *VirtualMachineScaleSetVMsPowerOffFuture) UnmarshalJSON(body []byte) error { 16438 var azFuture azure.Future 16439 if err := json.Unmarshal(body, &azFuture); err != nil { 16440 return err 16441 } 16442 future.FutureAPI = &azFuture 16443 future.Result = future.result 16444 return nil 16445} 16446 16447// result is the default implementation for VirtualMachineScaleSetVMsPowerOffFuture.Result. 16448func (future *VirtualMachineScaleSetVMsPowerOffFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 16449 var done bool 16450 done, err = future.DoneWithContext(context.Background(), client) 16451 if err != nil { 16452 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsPowerOffFuture", "Result", future.Response(), "Polling failure") 16453 return 16454 } 16455 if !done { 16456 ar.Response = future.Response() 16457 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsPowerOffFuture") 16458 return 16459 } 16460 ar.Response = future.Response() 16461 return 16462} 16463 16464// VirtualMachineScaleSetVMsRedeployFuture an abstraction for monitoring and retrieving the results of a 16465// long-running operation. 16466type VirtualMachineScaleSetVMsRedeployFuture struct { 16467 azure.FutureAPI 16468 // Result returns the result of the asynchronous operation. 16469 // If the operation has not completed it will return an error. 16470 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 16471} 16472 16473// UnmarshalJSON is the custom unmarshaller for CreateFuture. 16474func (future *VirtualMachineScaleSetVMsRedeployFuture) UnmarshalJSON(body []byte) error { 16475 var azFuture azure.Future 16476 if err := json.Unmarshal(body, &azFuture); err != nil { 16477 return err 16478 } 16479 future.FutureAPI = &azFuture 16480 future.Result = future.result 16481 return nil 16482} 16483 16484// result is the default implementation for VirtualMachineScaleSetVMsRedeployFuture.Result. 16485func (future *VirtualMachineScaleSetVMsRedeployFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 16486 var done bool 16487 done, err = future.DoneWithContext(context.Background(), client) 16488 if err != nil { 16489 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRedeployFuture", "Result", future.Response(), "Polling failure") 16490 return 16491 } 16492 if !done { 16493 ar.Response = future.Response() 16494 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRedeployFuture") 16495 return 16496 } 16497 ar.Response = future.Response() 16498 return 16499} 16500 16501// VirtualMachineScaleSetVMsReimageAllFuture an abstraction for monitoring and retrieving the results of a 16502// long-running operation. 16503type VirtualMachineScaleSetVMsReimageAllFuture struct { 16504 azure.FutureAPI 16505 // Result returns the result of the asynchronous operation. 16506 // If the operation has not completed it will return an error. 16507 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 16508} 16509 16510// UnmarshalJSON is the custom unmarshaller for CreateFuture. 16511func (future *VirtualMachineScaleSetVMsReimageAllFuture) UnmarshalJSON(body []byte) error { 16512 var azFuture azure.Future 16513 if err := json.Unmarshal(body, &azFuture); err != nil { 16514 return err 16515 } 16516 future.FutureAPI = &azFuture 16517 future.Result = future.result 16518 return nil 16519} 16520 16521// result is the default implementation for VirtualMachineScaleSetVMsReimageAllFuture.Result. 16522func (future *VirtualMachineScaleSetVMsReimageAllFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 16523 var done bool 16524 done, err = future.DoneWithContext(context.Background(), client) 16525 if err != nil { 16526 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsReimageAllFuture", "Result", future.Response(), "Polling failure") 16527 return 16528 } 16529 if !done { 16530 ar.Response = future.Response() 16531 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsReimageAllFuture") 16532 return 16533 } 16534 ar.Response = future.Response() 16535 return 16536} 16537 16538// VirtualMachineScaleSetVMsReimageFuture an abstraction for monitoring and retrieving the results of a 16539// long-running operation. 16540type VirtualMachineScaleSetVMsReimageFuture struct { 16541 azure.FutureAPI 16542 // Result returns the result of the asynchronous operation. 16543 // If the operation has not completed it will return an error. 16544 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 16545} 16546 16547// UnmarshalJSON is the custom unmarshaller for CreateFuture. 16548func (future *VirtualMachineScaleSetVMsReimageFuture) UnmarshalJSON(body []byte) error { 16549 var azFuture azure.Future 16550 if err := json.Unmarshal(body, &azFuture); err != nil { 16551 return err 16552 } 16553 future.FutureAPI = &azFuture 16554 future.Result = future.result 16555 return nil 16556} 16557 16558// result is the default implementation for VirtualMachineScaleSetVMsReimageFuture.Result. 16559func (future *VirtualMachineScaleSetVMsReimageFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 16560 var done bool 16561 done, err = future.DoneWithContext(context.Background(), client) 16562 if err != nil { 16563 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsReimageFuture", "Result", future.Response(), "Polling failure") 16564 return 16565 } 16566 if !done { 16567 ar.Response = future.Response() 16568 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsReimageFuture") 16569 return 16570 } 16571 ar.Response = future.Response() 16572 return 16573} 16574 16575// VirtualMachineScaleSetVMsRestartFuture an abstraction for monitoring and retrieving the results of a 16576// long-running operation. 16577type VirtualMachineScaleSetVMsRestartFuture struct { 16578 azure.FutureAPI 16579 // Result returns the result of the asynchronous operation. 16580 // If the operation has not completed it will return an error. 16581 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 16582} 16583 16584// UnmarshalJSON is the custom unmarshaller for CreateFuture. 16585func (future *VirtualMachineScaleSetVMsRestartFuture) UnmarshalJSON(body []byte) error { 16586 var azFuture azure.Future 16587 if err := json.Unmarshal(body, &azFuture); err != nil { 16588 return err 16589 } 16590 future.FutureAPI = &azFuture 16591 future.Result = future.result 16592 return nil 16593} 16594 16595// result is the default implementation for VirtualMachineScaleSetVMsRestartFuture.Result. 16596func (future *VirtualMachineScaleSetVMsRestartFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 16597 var done bool 16598 done, err = future.DoneWithContext(context.Background(), client) 16599 if err != nil { 16600 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRestartFuture", "Result", future.Response(), "Polling failure") 16601 return 16602 } 16603 if !done { 16604 ar.Response = future.Response() 16605 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRestartFuture") 16606 return 16607 } 16608 ar.Response = future.Response() 16609 return 16610} 16611 16612// VirtualMachineScaleSetVMsRunCommandFuture an abstraction for monitoring and retrieving the results of a 16613// long-running operation. 16614type VirtualMachineScaleSetVMsRunCommandFuture struct { 16615 azure.FutureAPI 16616 // Result returns the result of the asynchronous operation. 16617 // If the operation has not completed it will return an error. 16618 Result func(VirtualMachineScaleSetVMsClient) (RunCommandResult, error) 16619} 16620 16621// UnmarshalJSON is the custom unmarshaller for CreateFuture. 16622func (future *VirtualMachineScaleSetVMsRunCommandFuture) UnmarshalJSON(body []byte) error { 16623 var azFuture azure.Future 16624 if err := json.Unmarshal(body, &azFuture); err != nil { 16625 return err 16626 } 16627 future.FutureAPI = &azFuture 16628 future.Result = future.result 16629 return nil 16630} 16631 16632// result is the default implementation for VirtualMachineScaleSetVMsRunCommandFuture.Result. 16633func (future *VirtualMachineScaleSetVMsRunCommandFuture) result(client VirtualMachineScaleSetVMsClient) (rcr RunCommandResult, err error) { 16634 var done bool 16635 done, err = future.DoneWithContext(context.Background(), client) 16636 if err != nil { 16637 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRunCommandFuture", "Result", future.Response(), "Polling failure") 16638 return 16639 } 16640 if !done { 16641 rcr.Response.Response = future.Response() 16642 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRunCommandFuture") 16643 return 16644 } 16645 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 16646 if rcr.Response.Response, err = future.GetResult(sender); err == nil && rcr.Response.Response.StatusCode != http.StatusNoContent { 16647 rcr, err = client.RunCommandResponder(rcr.Response.Response) 16648 if err != nil { 16649 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRunCommandFuture", "Result", rcr.Response.Response, "Failure responding to request") 16650 } 16651 } 16652 return 16653} 16654 16655// VirtualMachineScaleSetVMsStartFuture an abstraction for monitoring and retrieving the results of a 16656// long-running operation. 16657type VirtualMachineScaleSetVMsStartFuture struct { 16658 azure.FutureAPI 16659 // Result returns the result of the asynchronous operation. 16660 // If the operation has not completed it will return an error. 16661 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 16662} 16663 16664// UnmarshalJSON is the custom unmarshaller for CreateFuture. 16665func (future *VirtualMachineScaleSetVMsStartFuture) UnmarshalJSON(body []byte) error { 16666 var azFuture azure.Future 16667 if err := json.Unmarshal(body, &azFuture); err != nil { 16668 return err 16669 } 16670 future.FutureAPI = &azFuture 16671 future.Result = future.result 16672 return nil 16673} 16674 16675// result is the default implementation for VirtualMachineScaleSetVMsStartFuture.Result. 16676func (future *VirtualMachineScaleSetVMsStartFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { 16677 var done bool 16678 done, err = future.DoneWithContext(context.Background(), client) 16679 if err != nil { 16680 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsStartFuture", "Result", future.Response(), "Polling failure") 16681 return 16682 } 16683 if !done { 16684 ar.Response = future.Response() 16685 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsStartFuture") 16686 return 16687 } 16688 ar.Response = future.Response() 16689 return 16690} 16691 16692// VirtualMachineScaleSetVMsUpdateFuture an abstraction for monitoring and retrieving the results of a 16693// long-running operation. 16694type VirtualMachineScaleSetVMsUpdateFuture struct { 16695 azure.FutureAPI 16696 // Result returns the result of the asynchronous operation. 16697 // If the operation has not completed it will return an error. 16698 Result func(VirtualMachineScaleSetVMsClient) (VirtualMachineScaleSetVM, error) 16699} 16700 16701// UnmarshalJSON is the custom unmarshaller for CreateFuture. 16702func (future *VirtualMachineScaleSetVMsUpdateFuture) UnmarshalJSON(body []byte) error { 16703 var azFuture azure.Future 16704 if err := json.Unmarshal(body, &azFuture); err != nil { 16705 return err 16706 } 16707 future.FutureAPI = &azFuture 16708 future.Result = future.result 16709 return nil 16710} 16711 16712// result is the default implementation for VirtualMachineScaleSetVMsUpdateFuture.Result. 16713func (future *VirtualMachineScaleSetVMsUpdateFuture) result(client VirtualMachineScaleSetVMsClient) (vmssv VirtualMachineScaleSetVM, err error) { 16714 var done bool 16715 done, err = future.DoneWithContext(context.Background(), client) 16716 if err != nil { 16717 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsUpdateFuture", "Result", future.Response(), "Polling failure") 16718 return 16719 } 16720 if !done { 16721 vmssv.Response.Response = future.Response() 16722 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsUpdateFuture") 16723 return 16724 } 16725 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 16726 if vmssv.Response.Response, err = future.GetResult(sender); err == nil && vmssv.Response.Response.StatusCode != http.StatusNoContent { 16727 vmssv, err = client.UpdateResponder(vmssv.Response.Response) 16728 if err != nil { 16729 err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsUpdateFuture", "Result", vmssv.Response.Response, "Failure responding to request") 16730 } 16731 } 16732 return 16733} 16734 16735// VirtualMachinesCaptureFuture an abstraction for monitoring and retrieving the results of a long-running 16736// operation. 16737type VirtualMachinesCaptureFuture struct { 16738 azure.FutureAPI 16739 // Result returns the result of the asynchronous operation. 16740 // If the operation has not completed it will return an error. 16741 Result func(VirtualMachinesClient) (VirtualMachineCaptureResult, error) 16742} 16743 16744// UnmarshalJSON is the custom unmarshaller for CreateFuture. 16745func (future *VirtualMachinesCaptureFuture) UnmarshalJSON(body []byte) error { 16746 var azFuture azure.Future 16747 if err := json.Unmarshal(body, &azFuture); err != nil { 16748 return err 16749 } 16750 future.FutureAPI = &azFuture 16751 future.Result = future.result 16752 return nil 16753} 16754 16755// result is the default implementation for VirtualMachinesCaptureFuture.Result. 16756func (future *VirtualMachinesCaptureFuture) result(client VirtualMachinesClient) (vmcr VirtualMachineCaptureResult, err error) { 16757 var done bool 16758 done, err = future.DoneWithContext(context.Background(), client) 16759 if err != nil { 16760 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCaptureFuture", "Result", future.Response(), "Polling failure") 16761 return 16762 } 16763 if !done { 16764 vmcr.Response.Response = future.Response() 16765 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesCaptureFuture") 16766 return 16767 } 16768 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 16769 if vmcr.Response.Response, err = future.GetResult(sender); err == nil && vmcr.Response.Response.StatusCode != http.StatusNoContent { 16770 vmcr, err = client.CaptureResponder(vmcr.Response.Response) 16771 if err != nil { 16772 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCaptureFuture", "Result", vmcr.Response.Response, "Failure responding to request") 16773 } 16774 } 16775 return 16776} 16777 16778// VirtualMachinesConvertToManagedDisksFuture an abstraction for monitoring and retrieving the results of a 16779// long-running operation. 16780type VirtualMachinesConvertToManagedDisksFuture struct { 16781 azure.FutureAPI 16782 // Result returns the result of the asynchronous operation. 16783 // If the operation has not completed it will return an error. 16784 Result func(VirtualMachinesClient) (autorest.Response, error) 16785} 16786 16787// UnmarshalJSON is the custom unmarshaller for CreateFuture. 16788func (future *VirtualMachinesConvertToManagedDisksFuture) UnmarshalJSON(body []byte) error { 16789 var azFuture azure.Future 16790 if err := json.Unmarshal(body, &azFuture); err != nil { 16791 return err 16792 } 16793 future.FutureAPI = &azFuture 16794 future.Result = future.result 16795 return nil 16796} 16797 16798// result is the default implementation for VirtualMachinesConvertToManagedDisksFuture.Result. 16799func (future *VirtualMachinesConvertToManagedDisksFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 16800 var done bool 16801 done, err = future.DoneWithContext(context.Background(), client) 16802 if err != nil { 16803 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesConvertToManagedDisksFuture", "Result", future.Response(), "Polling failure") 16804 return 16805 } 16806 if !done { 16807 ar.Response = future.Response() 16808 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesConvertToManagedDisksFuture") 16809 return 16810 } 16811 ar.Response = future.Response() 16812 return 16813} 16814 16815// VirtualMachinesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 16816// long-running operation. 16817type VirtualMachinesCreateOrUpdateFuture struct { 16818 azure.FutureAPI 16819 // Result returns the result of the asynchronous operation. 16820 // If the operation has not completed it will return an error. 16821 Result func(VirtualMachinesClient) (VirtualMachine, error) 16822} 16823 16824// UnmarshalJSON is the custom unmarshaller for CreateFuture. 16825func (future *VirtualMachinesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 16826 var azFuture azure.Future 16827 if err := json.Unmarshal(body, &azFuture); err != nil { 16828 return err 16829 } 16830 future.FutureAPI = &azFuture 16831 future.Result = future.result 16832 return nil 16833} 16834 16835// result is the default implementation for VirtualMachinesCreateOrUpdateFuture.Result. 16836func (future *VirtualMachinesCreateOrUpdateFuture) result(client VirtualMachinesClient) (VM VirtualMachine, err error) { 16837 var done bool 16838 done, err = future.DoneWithContext(context.Background(), client) 16839 if err != nil { 16840 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 16841 return 16842 } 16843 if !done { 16844 VM.Response.Response = future.Response() 16845 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesCreateOrUpdateFuture") 16846 return 16847 } 16848 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 16849 if VM.Response.Response, err = future.GetResult(sender); err == nil && VM.Response.Response.StatusCode != http.StatusNoContent { 16850 VM, err = client.CreateOrUpdateResponder(VM.Response.Response) 16851 if err != nil { 16852 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCreateOrUpdateFuture", "Result", VM.Response.Response, "Failure responding to request") 16853 } 16854 } 16855 return 16856} 16857 16858// VirtualMachinesDeallocateFuture an abstraction for monitoring and retrieving the results of a 16859// long-running operation. 16860type VirtualMachinesDeallocateFuture struct { 16861 azure.FutureAPI 16862 // Result returns the result of the asynchronous operation. 16863 // If the operation has not completed it will return an error. 16864 Result func(VirtualMachinesClient) (autorest.Response, error) 16865} 16866 16867// UnmarshalJSON is the custom unmarshaller for CreateFuture. 16868func (future *VirtualMachinesDeallocateFuture) UnmarshalJSON(body []byte) error { 16869 var azFuture azure.Future 16870 if err := json.Unmarshal(body, &azFuture); err != nil { 16871 return err 16872 } 16873 future.FutureAPI = &azFuture 16874 future.Result = future.result 16875 return nil 16876} 16877 16878// result is the default implementation for VirtualMachinesDeallocateFuture.Result. 16879func (future *VirtualMachinesDeallocateFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 16880 var done bool 16881 done, err = future.DoneWithContext(context.Background(), client) 16882 if err != nil { 16883 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesDeallocateFuture", "Result", future.Response(), "Polling failure") 16884 return 16885 } 16886 if !done { 16887 ar.Response = future.Response() 16888 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesDeallocateFuture") 16889 return 16890 } 16891 ar.Response = future.Response() 16892 return 16893} 16894 16895// VirtualMachinesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 16896// operation. 16897type VirtualMachinesDeleteFuture struct { 16898 azure.FutureAPI 16899 // Result returns the result of the asynchronous operation. 16900 // If the operation has not completed it will return an error. 16901 Result func(VirtualMachinesClient) (autorest.Response, error) 16902} 16903 16904// UnmarshalJSON is the custom unmarshaller for CreateFuture. 16905func (future *VirtualMachinesDeleteFuture) UnmarshalJSON(body []byte) error { 16906 var azFuture azure.Future 16907 if err := json.Unmarshal(body, &azFuture); err != nil { 16908 return err 16909 } 16910 future.FutureAPI = &azFuture 16911 future.Result = future.result 16912 return nil 16913} 16914 16915// result is the default implementation for VirtualMachinesDeleteFuture.Result. 16916func (future *VirtualMachinesDeleteFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 16917 var done bool 16918 done, err = future.DoneWithContext(context.Background(), client) 16919 if err != nil { 16920 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesDeleteFuture", "Result", future.Response(), "Polling failure") 16921 return 16922 } 16923 if !done { 16924 ar.Response = future.Response() 16925 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesDeleteFuture") 16926 return 16927 } 16928 ar.Response = future.Response() 16929 return 16930} 16931 16932// VirtualMachineSize describes the properties of a VM size. 16933type VirtualMachineSize struct { 16934 // Name - The name of the virtual machine size. 16935 Name *string `json:"name,omitempty"` 16936 // NumberOfCores - The number of cores supported by the virtual machine size. 16937 NumberOfCores *int32 `json:"numberOfCores,omitempty"` 16938 // OsDiskSizeInMB - The OS disk size, in MB, allowed by the virtual machine size. 16939 OsDiskSizeInMB *int32 `json:"osDiskSizeInMB,omitempty"` 16940 // ResourceDiskSizeInMB - The resource disk size, in MB, allowed by the virtual machine size. 16941 ResourceDiskSizeInMB *int32 `json:"resourceDiskSizeInMB,omitempty"` 16942 // MemoryInMB - The amount of memory, in MB, supported by the virtual machine size. 16943 MemoryInMB *int32 `json:"memoryInMB,omitempty"` 16944 // MaxDataDiskCount - The maximum number of data disks that can be attached to the virtual machine size. 16945 MaxDataDiskCount *int32 `json:"maxDataDiskCount,omitempty"` 16946} 16947 16948// VirtualMachineSizeListResult the List Virtual Machine operation response. 16949type VirtualMachineSizeListResult struct { 16950 autorest.Response `json:"-"` 16951 // Value - The list of virtual machine sizes. 16952 Value *[]VirtualMachineSize `json:"value,omitempty"` 16953} 16954 16955// VirtualMachineSoftwarePatchProperties describes the properties of a Virtual Machine software patch. 16956type VirtualMachineSoftwarePatchProperties struct { 16957 // PatchID - READ-ONLY; A unique identifier for the patch. 16958 PatchID *string `json:"patchId,omitempty"` 16959 // Name - READ-ONLY; The friendly name of the patch. 16960 Name *string `json:"name,omitempty"` 16961 // Version - READ-ONLY; The version number of the patch. This property applies only to Linux patches. 16962 Version *string `json:"version,omitempty"` 16963 // Kbid - READ-ONLY; The KBID of the patch. Only applies to Windows patches. 16964 Kbid *string `json:"kbid,omitempty"` 16965 // Classifications - READ-ONLY; The classification(s) of the patch as provided by the patch publisher. 16966 Classifications *[]string `json:"classifications,omitempty"` 16967 // RebootBehavior - READ-ONLY; Describes the reboot requirements of the patch. Possible values include: 'NeverReboots', 'AlwaysRequiresReboot', 'CanRequestReboot' 16968 RebootBehavior SoftwareUpdateRebootBehavior `json:"rebootBehavior,omitempty"` 16969 // ActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. 16970 ActivityID *string `json:"activityId,omitempty"` 16971 // PublishedDate - READ-ONLY; The UTC timestamp when the repository published this patch. 16972 PublishedDate *date.Time `json:"publishedDate,omitempty"` 16973 // LastModifiedDateTime - READ-ONLY; The UTC timestamp of the last update to this patch record. 16974 LastModifiedDateTime *date.Time `json:"lastModifiedDateTime,omitempty"` 16975 // AssessmentState - READ-ONLY; Describes the outcome of an install operation for a given patch. Possible values include: 'PatchAssessmentStateInstalled', 'PatchAssessmentStateFailed', 'PatchAssessmentStateExcluded', 'PatchAssessmentStateNotSelected', 'PatchAssessmentStatePending', 'PatchAssessmentStateAvailable' 16976 AssessmentState PatchAssessmentState `json:"assessmentState,omitempty"` 16977} 16978 16979// MarshalJSON is the custom marshaler for VirtualMachineSoftwarePatchProperties. 16980func (vmspp VirtualMachineSoftwarePatchProperties) MarshalJSON() ([]byte, error) { 16981 objectMap := make(map[string]interface{}) 16982 return json.Marshal(objectMap) 16983} 16984 16985// VirtualMachinesPerformMaintenanceFuture an abstraction for monitoring and retrieving the results of a 16986// long-running operation. 16987type VirtualMachinesPerformMaintenanceFuture struct { 16988 azure.FutureAPI 16989 // Result returns the result of the asynchronous operation. 16990 // If the operation has not completed it will return an error. 16991 Result func(VirtualMachinesClient) (autorest.Response, error) 16992} 16993 16994// UnmarshalJSON is the custom unmarshaller for CreateFuture. 16995func (future *VirtualMachinesPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { 16996 var azFuture azure.Future 16997 if err := json.Unmarshal(body, &azFuture); err != nil { 16998 return err 16999 } 17000 future.FutureAPI = &azFuture 17001 future.Result = future.result 17002 return nil 17003} 17004 17005// result is the default implementation for VirtualMachinesPerformMaintenanceFuture.Result. 17006func (future *VirtualMachinesPerformMaintenanceFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 17007 var done bool 17008 done, err = future.DoneWithContext(context.Background(), client) 17009 if err != nil { 17010 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesPerformMaintenanceFuture", "Result", future.Response(), "Polling failure") 17011 return 17012 } 17013 if !done { 17014 ar.Response = future.Response() 17015 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesPerformMaintenanceFuture") 17016 return 17017 } 17018 ar.Response = future.Response() 17019 return 17020} 17021 17022// VirtualMachinesPowerOffFuture an abstraction for monitoring and retrieving the results of a long-running 17023// operation. 17024type VirtualMachinesPowerOffFuture struct { 17025 azure.FutureAPI 17026 // Result returns the result of the asynchronous operation. 17027 // If the operation has not completed it will return an error. 17028 Result func(VirtualMachinesClient) (autorest.Response, error) 17029} 17030 17031// UnmarshalJSON is the custom unmarshaller for CreateFuture. 17032func (future *VirtualMachinesPowerOffFuture) UnmarshalJSON(body []byte) error { 17033 var azFuture azure.Future 17034 if err := json.Unmarshal(body, &azFuture); err != nil { 17035 return err 17036 } 17037 future.FutureAPI = &azFuture 17038 future.Result = future.result 17039 return nil 17040} 17041 17042// result is the default implementation for VirtualMachinesPowerOffFuture.Result. 17043func (future *VirtualMachinesPowerOffFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 17044 var done bool 17045 done, err = future.DoneWithContext(context.Background(), client) 17046 if err != nil { 17047 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesPowerOffFuture", "Result", future.Response(), "Polling failure") 17048 return 17049 } 17050 if !done { 17051 ar.Response = future.Response() 17052 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesPowerOffFuture") 17053 return 17054 } 17055 ar.Response = future.Response() 17056 return 17057} 17058 17059// VirtualMachinesReapplyFuture an abstraction for monitoring and retrieving the results of a long-running 17060// operation. 17061type VirtualMachinesReapplyFuture struct { 17062 azure.FutureAPI 17063 // Result returns the result of the asynchronous operation. 17064 // If the operation has not completed it will return an error. 17065 Result func(VirtualMachinesClient) (autorest.Response, error) 17066} 17067 17068// UnmarshalJSON is the custom unmarshaller for CreateFuture. 17069func (future *VirtualMachinesReapplyFuture) UnmarshalJSON(body []byte) error { 17070 var azFuture azure.Future 17071 if err := json.Unmarshal(body, &azFuture); err != nil { 17072 return err 17073 } 17074 future.FutureAPI = &azFuture 17075 future.Result = future.result 17076 return nil 17077} 17078 17079// result is the default implementation for VirtualMachinesReapplyFuture.Result. 17080func (future *VirtualMachinesReapplyFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 17081 var done bool 17082 done, err = future.DoneWithContext(context.Background(), client) 17083 if err != nil { 17084 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesReapplyFuture", "Result", future.Response(), "Polling failure") 17085 return 17086 } 17087 if !done { 17088 ar.Response = future.Response() 17089 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesReapplyFuture") 17090 return 17091 } 17092 ar.Response = future.Response() 17093 return 17094} 17095 17096// VirtualMachinesRedeployFuture an abstraction for monitoring and retrieving the results of a long-running 17097// operation. 17098type VirtualMachinesRedeployFuture struct { 17099 azure.FutureAPI 17100 // Result returns the result of the asynchronous operation. 17101 // If the operation has not completed it will return an error. 17102 Result func(VirtualMachinesClient) (autorest.Response, error) 17103} 17104 17105// UnmarshalJSON is the custom unmarshaller for CreateFuture. 17106func (future *VirtualMachinesRedeployFuture) UnmarshalJSON(body []byte) error { 17107 var azFuture azure.Future 17108 if err := json.Unmarshal(body, &azFuture); err != nil { 17109 return err 17110 } 17111 future.FutureAPI = &azFuture 17112 future.Result = future.result 17113 return nil 17114} 17115 17116// result is the default implementation for VirtualMachinesRedeployFuture.Result. 17117func (future *VirtualMachinesRedeployFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 17118 var done bool 17119 done, err = future.DoneWithContext(context.Background(), client) 17120 if err != nil { 17121 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRedeployFuture", "Result", future.Response(), "Polling failure") 17122 return 17123 } 17124 if !done { 17125 ar.Response = future.Response() 17126 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRedeployFuture") 17127 return 17128 } 17129 ar.Response = future.Response() 17130 return 17131} 17132 17133// VirtualMachinesReimageFuture an abstraction for monitoring and retrieving the results of a long-running 17134// operation. 17135type VirtualMachinesReimageFuture struct { 17136 azure.FutureAPI 17137 // Result returns the result of the asynchronous operation. 17138 // If the operation has not completed it will return an error. 17139 Result func(VirtualMachinesClient) (autorest.Response, error) 17140} 17141 17142// UnmarshalJSON is the custom unmarshaller for CreateFuture. 17143func (future *VirtualMachinesReimageFuture) UnmarshalJSON(body []byte) error { 17144 var azFuture azure.Future 17145 if err := json.Unmarshal(body, &azFuture); err != nil { 17146 return err 17147 } 17148 future.FutureAPI = &azFuture 17149 future.Result = future.result 17150 return nil 17151} 17152 17153// result is the default implementation for VirtualMachinesReimageFuture.Result. 17154func (future *VirtualMachinesReimageFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 17155 var done bool 17156 done, err = future.DoneWithContext(context.Background(), client) 17157 if err != nil { 17158 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesReimageFuture", "Result", future.Response(), "Polling failure") 17159 return 17160 } 17161 if !done { 17162 ar.Response = future.Response() 17163 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesReimageFuture") 17164 return 17165 } 17166 ar.Response = future.Response() 17167 return 17168} 17169 17170// VirtualMachinesRestartFuture an abstraction for monitoring and retrieving the results of a long-running 17171// operation. 17172type VirtualMachinesRestartFuture struct { 17173 azure.FutureAPI 17174 // Result returns the result of the asynchronous operation. 17175 // If the operation has not completed it will return an error. 17176 Result func(VirtualMachinesClient) (autorest.Response, error) 17177} 17178 17179// UnmarshalJSON is the custom unmarshaller for CreateFuture. 17180func (future *VirtualMachinesRestartFuture) UnmarshalJSON(body []byte) error { 17181 var azFuture azure.Future 17182 if err := json.Unmarshal(body, &azFuture); err != nil { 17183 return err 17184 } 17185 future.FutureAPI = &azFuture 17186 future.Result = future.result 17187 return nil 17188} 17189 17190// result is the default implementation for VirtualMachinesRestartFuture.Result. 17191func (future *VirtualMachinesRestartFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 17192 var done bool 17193 done, err = future.DoneWithContext(context.Background(), client) 17194 if err != nil { 17195 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRestartFuture", "Result", future.Response(), "Polling failure") 17196 return 17197 } 17198 if !done { 17199 ar.Response = future.Response() 17200 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRestartFuture") 17201 return 17202 } 17203 ar.Response = future.Response() 17204 return 17205} 17206 17207// VirtualMachinesRunCommandFuture an abstraction for monitoring and retrieving the results of a 17208// long-running operation. 17209type VirtualMachinesRunCommandFuture struct { 17210 azure.FutureAPI 17211 // Result returns the result of the asynchronous operation. 17212 // If the operation has not completed it will return an error. 17213 Result func(VirtualMachinesClient) (RunCommandResult, error) 17214} 17215 17216// UnmarshalJSON is the custom unmarshaller for CreateFuture. 17217func (future *VirtualMachinesRunCommandFuture) UnmarshalJSON(body []byte) error { 17218 var azFuture azure.Future 17219 if err := json.Unmarshal(body, &azFuture); err != nil { 17220 return err 17221 } 17222 future.FutureAPI = &azFuture 17223 future.Result = future.result 17224 return nil 17225} 17226 17227// result is the default implementation for VirtualMachinesRunCommandFuture.Result. 17228func (future *VirtualMachinesRunCommandFuture) result(client VirtualMachinesClient) (rcr RunCommandResult, err error) { 17229 var done bool 17230 done, err = future.DoneWithContext(context.Background(), client) 17231 if err != nil { 17232 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRunCommandFuture", "Result", future.Response(), "Polling failure") 17233 return 17234 } 17235 if !done { 17236 rcr.Response.Response = future.Response() 17237 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRunCommandFuture") 17238 return 17239 } 17240 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 17241 if rcr.Response.Response, err = future.GetResult(sender); err == nil && rcr.Response.Response.StatusCode != http.StatusNoContent { 17242 rcr, err = client.RunCommandResponder(rcr.Response.Response) 17243 if err != nil { 17244 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRunCommandFuture", "Result", rcr.Response.Response, "Failure responding to request") 17245 } 17246 } 17247 return 17248} 17249 17250// VirtualMachinesStartFuture an abstraction for monitoring and retrieving the results of a long-running 17251// operation. 17252type VirtualMachinesStartFuture struct { 17253 azure.FutureAPI 17254 // Result returns the result of the asynchronous operation. 17255 // If the operation has not completed it will return an error. 17256 Result func(VirtualMachinesClient) (autorest.Response, error) 17257} 17258 17259// UnmarshalJSON is the custom unmarshaller for CreateFuture. 17260func (future *VirtualMachinesStartFuture) UnmarshalJSON(body []byte) error { 17261 var azFuture azure.Future 17262 if err := json.Unmarshal(body, &azFuture); err != nil { 17263 return err 17264 } 17265 future.FutureAPI = &azFuture 17266 future.Result = future.result 17267 return nil 17268} 17269 17270// result is the default implementation for VirtualMachinesStartFuture.Result. 17271func (future *VirtualMachinesStartFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { 17272 var done bool 17273 done, err = future.DoneWithContext(context.Background(), client) 17274 if err != nil { 17275 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesStartFuture", "Result", future.Response(), "Polling failure") 17276 return 17277 } 17278 if !done { 17279 ar.Response = future.Response() 17280 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesStartFuture") 17281 return 17282 } 17283 ar.Response = future.Response() 17284 return 17285} 17286 17287// VirtualMachineStatusCodeCount the status code and count of the virtual machine scale set instance view 17288// status summary. 17289type VirtualMachineStatusCodeCount struct { 17290 // Code - READ-ONLY; The instance view status code. 17291 Code *string `json:"code,omitempty"` 17292 // Count - READ-ONLY; The number of instances having a particular status code. 17293 Count *int32 `json:"count,omitempty"` 17294} 17295 17296// MarshalJSON is the custom marshaler for VirtualMachineStatusCodeCount. 17297func (vmscc VirtualMachineStatusCodeCount) MarshalJSON() ([]byte, error) { 17298 objectMap := make(map[string]interface{}) 17299 return json.Marshal(objectMap) 17300} 17301 17302// VirtualMachinesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 17303// operation. 17304type VirtualMachinesUpdateFuture struct { 17305 azure.FutureAPI 17306 // Result returns the result of the asynchronous operation. 17307 // If the operation has not completed it will return an error. 17308 Result func(VirtualMachinesClient) (VirtualMachine, error) 17309} 17310 17311// UnmarshalJSON is the custom unmarshaller for CreateFuture. 17312func (future *VirtualMachinesUpdateFuture) UnmarshalJSON(body []byte) error { 17313 var azFuture azure.Future 17314 if err := json.Unmarshal(body, &azFuture); err != nil { 17315 return err 17316 } 17317 future.FutureAPI = &azFuture 17318 future.Result = future.result 17319 return nil 17320} 17321 17322// result is the default implementation for VirtualMachinesUpdateFuture.Result. 17323func (future *VirtualMachinesUpdateFuture) result(client VirtualMachinesClient) (VM VirtualMachine, err error) { 17324 var done bool 17325 done, err = future.DoneWithContext(context.Background(), client) 17326 if err != nil { 17327 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesUpdateFuture", "Result", future.Response(), "Polling failure") 17328 return 17329 } 17330 if !done { 17331 VM.Response.Response = future.Response() 17332 err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesUpdateFuture") 17333 return 17334 } 17335 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 17336 if VM.Response.Response, err = future.GetResult(sender); err == nil && VM.Response.Response.StatusCode != http.StatusNoContent { 17337 VM, err = client.UpdateResponder(VM.Response.Response) 17338 if err != nil { 17339 err = autorest.NewErrorWithError(err, "compute.VirtualMachinesUpdateFuture", "Result", VM.Response.Response, "Failure responding to request") 17340 } 17341 } 17342 return 17343} 17344 17345// VirtualMachineUpdate describes a Virtual Machine Update. 17346type VirtualMachineUpdate struct { 17347 // 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**. 17348 Plan *Plan `json:"plan,omitempty"` 17349 *VirtualMachineProperties `json:"properties,omitempty"` 17350 // Identity - The identity of the virtual machine, if configured. 17351 Identity *VirtualMachineIdentity `json:"identity,omitempty"` 17352 // Zones - The virtual machine zones. 17353 Zones *[]string `json:"zones,omitempty"` 17354 // Tags - Resource tags 17355 Tags map[string]*string `json:"tags"` 17356} 17357 17358// MarshalJSON is the custom marshaler for VirtualMachineUpdate. 17359func (vmu VirtualMachineUpdate) MarshalJSON() ([]byte, error) { 17360 objectMap := make(map[string]interface{}) 17361 if vmu.Plan != nil { 17362 objectMap["plan"] = vmu.Plan 17363 } 17364 if vmu.VirtualMachineProperties != nil { 17365 objectMap["properties"] = vmu.VirtualMachineProperties 17366 } 17367 if vmu.Identity != nil { 17368 objectMap["identity"] = vmu.Identity 17369 } 17370 if vmu.Zones != nil { 17371 objectMap["zones"] = vmu.Zones 17372 } 17373 if vmu.Tags != nil { 17374 objectMap["tags"] = vmu.Tags 17375 } 17376 return json.Marshal(objectMap) 17377} 17378 17379// UnmarshalJSON is the custom unmarshaler for VirtualMachineUpdate struct. 17380func (vmu *VirtualMachineUpdate) UnmarshalJSON(body []byte) error { 17381 var m map[string]*json.RawMessage 17382 err := json.Unmarshal(body, &m) 17383 if err != nil { 17384 return err 17385 } 17386 for k, v := range m { 17387 switch k { 17388 case "plan": 17389 if v != nil { 17390 var plan Plan 17391 err = json.Unmarshal(*v, &plan) 17392 if err != nil { 17393 return err 17394 } 17395 vmu.Plan = &plan 17396 } 17397 case "properties": 17398 if v != nil { 17399 var virtualMachineProperties VirtualMachineProperties 17400 err = json.Unmarshal(*v, &virtualMachineProperties) 17401 if err != nil { 17402 return err 17403 } 17404 vmu.VirtualMachineProperties = &virtualMachineProperties 17405 } 17406 case "identity": 17407 if v != nil { 17408 var identity VirtualMachineIdentity 17409 err = json.Unmarshal(*v, &identity) 17410 if err != nil { 17411 return err 17412 } 17413 vmu.Identity = &identity 17414 } 17415 case "zones": 17416 if v != nil { 17417 var zones []string 17418 err = json.Unmarshal(*v, &zones) 17419 if err != nil { 17420 return err 17421 } 17422 vmu.Zones = &zones 17423 } 17424 case "tags": 17425 if v != nil { 17426 var tags map[string]*string 17427 err = json.Unmarshal(*v, &tags) 17428 if err != nil { 17429 return err 17430 } 17431 vmu.Tags = tags 17432 } 17433 } 17434 } 17435 17436 return nil 17437} 17438 17439// VMScaleSetConvertToSinglePlacementGroupInput ... 17440type VMScaleSetConvertToSinglePlacementGroupInput struct { 17441 // 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. 17442 ActivePlacementGroupID *string `json:"activePlacementGroupId,omitempty"` 17443} 17444 17445// WindowsConfiguration specifies Windows operating system settings on the virtual machine. 17446type WindowsConfiguration struct { 17447 // 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. 17448 ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` 17449 // 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. 17450 EnableAutomaticUpdates *bool `json:"enableAutomaticUpdates,omitempty"` 17451 // TimeZone - Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time". <br><br> Possible values can be [TimeZoneInfo.Id](https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id) value from time zones returned by [TimeZoneInfo.GetSystemTimeZones](https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.getsystemtimezones). 17452 TimeZone *string `json:"timeZone,omitempty"` 17453 // AdditionalUnattendContent - Specifies additional base-64 encoded XML formatted information that can be included in the Unattend.xml file, which is used by Windows Setup. 17454 AdditionalUnattendContent *[]AdditionalUnattendContent `json:"additionalUnattendContent,omitempty"` 17455 // PatchSettings - Specifies settings related to in-guest patching (KBs). 17456 PatchSettings *PatchSettings `json:"patchSettings,omitempty"` 17457 // WinRM - Specifies the Windows Remote Management listeners. This enables remote Windows PowerShell. 17458 WinRM *WinRMConfiguration `json:"winRM,omitempty"` 17459} 17460 17461// WinRMConfiguration describes Windows Remote Management configuration of the VM 17462type WinRMConfiguration struct { 17463 // Listeners - The list of Windows Remote Management listeners 17464 Listeners *[]WinRMListener `json:"listeners,omitempty"` 17465} 17466 17467// WinRMListener describes Protocol and thumbprint of Windows Remote Management listener 17468type WinRMListener struct { 17469 // Protocol - Specifies the protocol of WinRM listener. <br><br> Possible values are: <br>**http** <br><br> **https**. Possible values include: 'HTTP', 'HTTPS' 17470 Protocol ProtocolTypes `json:"protocol,omitempty"` 17471 // 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>} 17472 CertificateURL *string `json:"certificateUrl,omitempty"` 17473} 17474