1package compute 2 3// Copyright (c) Microsoft and contributors. All rights reserved. 4// 5// Licensed under the Apache License, Version 2.0 (the "License"); 6// you may not use this file except in compliance with the License. 7// You may obtain a copy of the License at 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// 14// See the License for the specific language governing permissions and 15// limitations under the License. 16// 17// Code generated by Microsoft (R) AutoRest Code Generator. 18// Changes may cause incorrect behavior and will be lost if the code is regenerated. 19 20import ( 21 "context" 22 "encoding/json" 23 "github.com/Azure/go-autorest/autorest" 24 "github.com/Azure/go-autorest/autorest/azure" 25 "github.com/Azure/go-autorest/autorest/date" 26 "github.com/Azure/go-autorest/autorest/to" 27 "github.com/Azure/go-autorest/tracing" 28 "net/http" 29) 30 31// The package's fully qualified name. 32const fqdn = "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute" 33 34// AccessURI a disk access SAS uri. 35type AccessURI struct { 36 autorest.Response `json:"-"` 37 // AccessSAS - READ-ONLY; A SAS uri for accessing a disk. 38 AccessSAS *string `json:"accessSAS,omitempty"` 39} 40 41// AdditionalCapabilities enables or disables a capability on the virtual machine or virtual machine scale 42// set. 43type AdditionalCapabilities struct { 44 // 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. 45 UltraSSDEnabled *bool `json:"ultraSSDEnabled,omitempty"` 46} 47 48// AdditionalUnattendContent specifies additional XML formatted information that can be included in the 49// Unattend.xml file, which is used by Windows Setup. Contents are defined by setting name, component name, 50// and the pass in which the content is applied. 51type AdditionalUnattendContent struct { 52 // PassName - The pass name. Currently, the only allowable value is OobeSystem. Possible values include: 'OobeSystem' 53 PassName PassNames `json:"passName,omitempty"` 54 // ComponentName - The component name. Currently, the only allowable value is Microsoft-Windows-Shell-Setup. Possible values include: 'MicrosoftWindowsShellSetup' 55 ComponentName ComponentNames `json:"componentName,omitempty"` 56 // SettingName - Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon. Possible values include: 'AutoLogon', 'FirstLogonCommands' 57 SettingName SettingNames `json:"settingName,omitempty"` 58 // 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. 59 Content *string `json:"content,omitempty"` 60} 61 62// APIEntityReference the API entity reference. 63type APIEntityReference struct { 64 // ID - The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... 65 ID *string `json:"id,omitempty"` 66} 67 68// APIError api error. 69type APIError struct { 70 // Details - The Api error details 71 Details *[]APIErrorBase `json:"details,omitempty"` 72 // Innererror - The Api inner error 73 Innererror *InnerError `json:"innererror,omitempty"` 74 // Code - The error code. 75 Code *string `json:"code,omitempty"` 76 // Target - The target of the particular error. 77 Target *string `json:"target,omitempty"` 78 // Message - The error message. 79 Message *string `json:"message,omitempty"` 80} 81 82// APIErrorBase api error base. 83type APIErrorBase struct { 84 // Code - The error code. 85 Code *string `json:"code,omitempty"` 86 // Target - The target of the particular error. 87 Target *string `json:"target,omitempty"` 88 // Message - The error message. 89 Message *string `json:"message,omitempty"` 90} 91 92// AutomaticOSUpgradePolicy the configuration parameters used for performing automatic OS upgrade. 93type AutomaticOSUpgradePolicy struct { 94 // 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. 95 EnableAutomaticOSUpgrade *bool `json:"enableAutomaticOSUpgrade,omitempty"` 96 // DisableAutomaticRollback - Whether OS image rollback feature should be disabled. Default value is false. 97 DisableAutomaticRollback *bool `json:"disableAutomaticRollback,omitempty"` 98} 99 100// AutomaticOSUpgradeProperties describes automatic OS upgrade properties on the image. 101type AutomaticOSUpgradeProperties struct { 102 // AutomaticOSUpgradeSupported - Specifies whether automatic OS upgrade is supported on the image. 103 AutomaticOSUpgradeSupported *bool `json:"automaticOSUpgradeSupported,omitempty"` 104} 105 106// AutomaticRepairsPolicy specifies the configuration parameters for automatic repairs on the virtual 107// machine scale set. 108type AutomaticRepairsPolicy struct { 109 // Enabled - Specifies whether automatic repairs should be enabled on the virtual machine scale set. The default value is false. 110 Enabled *bool `json:"enabled,omitempty"` 111 // 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). 112 GracePeriod *string `json:"gracePeriod,omitempty"` 113} 114 115// AvailabilitySet specifies information about the availability set that the virtual machine should be 116// assigned to. Virtual machines specified in the same availability set are allocated to different nodes to 117// maximize availability. For more information about availability sets, see [Manage the availability of 118// virtual 119// machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). 120// <br><br> For more information on Azure planned maintenance, see [Planned maintenance for virtual 121// machines in 122// Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) 123// <br><br> Currently, a VM can only be added to availability set at creation time. An existing VM cannot 124// be added to an availability set. 125type AvailabilitySet struct { 126 autorest.Response `json:"-"` 127 *AvailabilitySetProperties `json:"properties,omitempty"` 128 // 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'. 129 Sku *Sku `json:"sku,omitempty"` 130 // ID - READ-ONLY; Resource Id 131 ID *string `json:"id,omitempty"` 132 // Name - READ-ONLY; Resource name 133 Name *string `json:"name,omitempty"` 134 // Type - READ-ONLY; Resource type 135 Type *string `json:"type,omitempty"` 136 // Location - Resource location 137 Location *string `json:"location,omitempty"` 138 // Tags - Resource tags 139 Tags map[string]*string `json:"tags"` 140} 141 142// MarshalJSON is the custom marshaler for AvailabilitySet. 143func (as AvailabilitySet) MarshalJSON() ([]byte, error) { 144 objectMap := make(map[string]interface{}) 145 if as.AvailabilitySetProperties != nil { 146 objectMap["properties"] = as.AvailabilitySetProperties 147 } 148 if as.Sku != nil { 149 objectMap["sku"] = as.Sku 150 } 151 if as.Location != nil { 152 objectMap["location"] = as.Location 153 } 154 if as.Tags != nil { 155 objectMap["tags"] = as.Tags 156 } 157 return json.Marshal(objectMap) 158} 159 160// UnmarshalJSON is the custom unmarshaler for AvailabilitySet struct. 161func (as *AvailabilitySet) UnmarshalJSON(body []byte) error { 162 var m map[string]*json.RawMessage 163 err := json.Unmarshal(body, &m) 164 if err != nil { 165 return err 166 } 167 for k, v := range m { 168 switch k { 169 case "properties": 170 if v != nil { 171 var availabilitySetProperties AvailabilitySetProperties 172 err = json.Unmarshal(*v, &availabilitySetProperties) 173 if err != nil { 174 return err 175 } 176 as.AvailabilitySetProperties = &availabilitySetProperties 177 } 178 case "sku": 179 if v != nil { 180 var sku Sku 181 err = json.Unmarshal(*v, &sku) 182 if err != nil { 183 return err 184 } 185 as.Sku = &sku 186 } 187 case "id": 188 if v != nil { 189 var ID string 190 err = json.Unmarshal(*v, &ID) 191 if err != nil { 192 return err 193 } 194 as.ID = &ID 195 } 196 case "name": 197 if v != nil { 198 var name string 199 err = json.Unmarshal(*v, &name) 200 if err != nil { 201 return err 202 } 203 as.Name = &name 204 } 205 case "type": 206 if v != nil { 207 var typeVar string 208 err = json.Unmarshal(*v, &typeVar) 209 if err != nil { 210 return err 211 } 212 as.Type = &typeVar 213 } 214 case "location": 215 if v != nil { 216 var location string 217 err = json.Unmarshal(*v, &location) 218 if err != nil { 219 return err 220 } 221 as.Location = &location 222 } 223 case "tags": 224 if v != nil { 225 var tags map[string]*string 226 err = json.Unmarshal(*v, &tags) 227 if err != nil { 228 return err 229 } 230 as.Tags = tags 231 } 232 } 233 } 234 235 return nil 236} 237 238// AvailabilitySetListResult the List Availability Set operation response. 239type AvailabilitySetListResult struct { 240 autorest.Response `json:"-"` 241 // Value - The list of availability sets 242 Value *[]AvailabilitySet `json:"value,omitempty"` 243 // NextLink - The URI to fetch the next page of AvailabilitySets. Call ListNext() with this URI to fetch the next page of AvailabilitySets. 244 NextLink *string `json:"nextLink,omitempty"` 245} 246 247// AvailabilitySetListResultIterator provides access to a complete listing of AvailabilitySet values. 248type AvailabilitySetListResultIterator struct { 249 i int 250 page AvailabilitySetListResultPage 251} 252 253// NextWithContext advances to the next value. If there was an error making 254// the request the iterator does not advance and the error is returned. 255func (iter *AvailabilitySetListResultIterator) NextWithContext(ctx context.Context) (err error) { 256 if tracing.IsEnabled() { 257 ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetListResultIterator.NextWithContext") 258 defer func() { 259 sc := -1 260 if iter.Response().Response.Response != nil { 261 sc = iter.Response().Response.Response.StatusCode 262 } 263 tracing.EndSpan(ctx, sc, err) 264 }() 265 } 266 iter.i++ 267 if iter.i < len(iter.page.Values()) { 268 return nil 269 } 270 err = iter.page.NextWithContext(ctx) 271 if err != nil { 272 iter.i-- 273 return err 274 } 275 iter.i = 0 276 return nil 277} 278 279// Next advances to the next value. If there was an error making 280// the request the iterator does not advance and the error is returned. 281// Deprecated: Use NextWithContext() instead. 282func (iter *AvailabilitySetListResultIterator) Next() error { 283 return iter.NextWithContext(context.Background()) 284} 285 286// NotDone returns true if the enumeration should be started or is not yet complete. 287func (iter AvailabilitySetListResultIterator) NotDone() bool { 288 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 289} 290 291// Response returns the raw server response from the last page request. 292func (iter AvailabilitySetListResultIterator) Response() AvailabilitySetListResult { 293 return iter.page.Response() 294} 295 296// Value returns the current value or a zero-initialized value if the 297// iterator has advanced beyond the end of the collection. 298func (iter AvailabilitySetListResultIterator) Value() AvailabilitySet { 299 if !iter.page.NotDone() { 300 return AvailabilitySet{} 301 } 302 return iter.page.Values()[iter.i] 303} 304 305// Creates a new instance of the AvailabilitySetListResultIterator type. 306func NewAvailabilitySetListResultIterator(page AvailabilitySetListResultPage) AvailabilitySetListResultIterator { 307 return AvailabilitySetListResultIterator{page: page} 308} 309 310// IsEmpty returns true if the ListResult contains no values. 311func (aslr AvailabilitySetListResult) IsEmpty() bool { 312 return aslr.Value == nil || len(*aslr.Value) == 0 313} 314 315// hasNextLink returns true if the NextLink is not empty. 316func (aslr AvailabilitySetListResult) hasNextLink() bool { 317 return aslr.NextLink != nil && len(*aslr.NextLink) != 0 318} 319 320// availabilitySetListResultPreparer prepares a request to retrieve the next set of results. 321// It returns nil if no more results exist. 322func (aslr AvailabilitySetListResult) availabilitySetListResultPreparer(ctx context.Context) (*http.Request, error) { 323 if !aslr.hasNextLink() { 324 return nil, nil 325 } 326 return autorest.Prepare((&http.Request{}).WithContext(ctx), 327 autorest.AsJSON(), 328 autorest.AsGet(), 329 autorest.WithBaseURL(to.String(aslr.NextLink))) 330} 331 332// AvailabilitySetListResultPage contains a page of AvailabilitySet values. 333type AvailabilitySetListResultPage struct { 334 fn func(context.Context, AvailabilitySetListResult) (AvailabilitySetListResult, error) 335 aslr AvailabilitySetListResult 336} 337 338// NextWithContext advances to the next page of values. If there was an error making 339// the request the page does not advance and the error is returned. 340func (page *AvailabilitySetListResultPage) NextWithContext(ctx context.Context) (err error) { 341 if tracing.IsEnabled() { 342 ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetListResultPage.NextWithContext") 343 defer func() { 344 sc := -1 345 if page.Response().Response.Response != nil { 346 sc = page.Response().Response.Response.StatusCode 347 } 348 tracing.EndSpan(ctx, sc, err) 349 }() 350 } 351 for { 352 next, err := page.fn(ctx, page.aslr) 353 if err != nil { 354 return err 355 } 356 page.aslr = next 357 if !next.hasNextLink() || !next.IsEmpty() { 358 break 359 } 360 } 361 return nil 362} 363 364// Next advances to the next page of values. If there was an error making 365// the request the page does not advance and the error is returned. 366// Deprecated: Use NextWithContext() instead. 367func (page *AvailabilitySetListResultPage) Next() error { 368 return page.NextWithContext(context.Background()) 369} 370 371// NotDone returns true if the page enumeration should be started or is not yet complete. 372func (page AvailabilitySetListResultPage) NotDone() bool { 373 return !page.aslr.IsEmpty() 374} 375 376// Response returns the raw server response from the last page request. 377func (page AvailabilitySetListResultPage) Response() AvailabilitySetListResult { 378 return page.aslr 379} 380 381// Values returns the slice of values for the current page or nil if there are no values. 382func (page AvailabilitySetListResultPage) Values() []AvailabilitySet { 383 if page.aslr.IsEmpty() { 384 return nil 385 } 386 return *page.aslr.Value 387} 388 389// Creates a new instance of the AvailabilitySetListResultPage type. 390func NewAvailabilitySetListResultPage(cur AvailabilitySetListResult, getNextPage func(context.Context, AvailabilitySetListResult) (AvailabilitySetListResult, error)) AvailabilitySetListResultPage { 391 return AvailabilitySetListResultPage{ 392 fn: getNextPage, 393 aslr: cur, 394 } 395} 396 397// AvailabilitySetProperties the instance view of a resource. 398type AvailabilitySetProperties struct { 399 // PlatformUpdateDomainCount - Update Domain count. 400 PlatformUpdateDomainCount *int32 `json:"platformUpdateDomainCount,omitempty"` 401 // PlatformFaultDomainCount - Fault Domain count. 402 PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` 403 // VirtualMachines - A list of references to all virtual machines in the availability set. 404 VirtualMachines *[]SubResource `json:"virtualMachines,omitempty"` 405 // ProximityPlacementGroup - Specifies information about the proximity placement group that the availability set should be assigned to. <br><br>Minimum api-version: 2018-04-01. 406 ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` 407 // Statuses - READ-ONLY; The resource status information. 408 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 409} 410 411// MarshalJSON is the custom marshaler for AvailabilitySetProperties. 412func (asp AvailabilitySetProperties) MarshalJSON() ([]byte, error) { 413 objectMap := make(map[string]interface{}) 414 if asp.PlatformUpdateDomainCount != nil { 415 objectMap["platformUpdateDomainCount"] = asp.PlatformUpdateDomainCount 416 } 417 if asp.PlatformFaultDomainCount != nil { 418 objectMap["platformFaultDomainCount"] = asp.PlatformFaultDomainCount 419 } 420 if asp.VirtualMachines != nil { 421 objectMap["virtualMachines"] = asp.VirtualMachines 422 } 423 if asp.ProximityPlacementGroup != nil { 424 objectMap["proximityPlacementGroup"] = asp.ProximityPlacementGroup 425 } 426 return json.Marshal(objectMap) 427} 428 429// AvailabilitySetUpdate specifies information about the availability set that the virtual machine should 430// be assigned to. Only tags may be updated. 431type AvailabilitySetUpdate struct { 432 *AvailabilitySetProperties `json:"properties,omitempty"` 433 // Sku - Sku of the availability set 434 Sku *Sku `json:"sku,omitempty"` 435 // Tags - Resource tags 436 Tags map[string]*string `json:"tags"` 437} 438 439// MarshalJSON is the custom marshaler for AvailabilitySetUpdate. 440func (asu AvailabilitySetUpdate) MarshalJSON() ([]byte, error) { 441 objectMap := make(map[string]interface{}) 442 if asu.AvailabilitySetProperties != nil { 443 objectMap["properties"] = asu.AvailabilitySetProperties 444 } 445 if asu.Sku != nil { 446 objectMap["sku"] = asu.Sku 447 } 448 if asu.Tags != nil { 449 objectMap["tags"] = asu.Tags 450 } 451 return json.Marshal(objectMap) 452} 453 454// UnmarshalJSON is the custom unmarshaler for AvailabilitySetUpdate struct. 455func (asu *AvailabilitySetUpdate) UnmarshalJSON(body []byte) error { 456 var m map[string]*json.RawMessage 457 err := json.Unmarshal(body, &m) 458 if err != nil { 459 return err 460 } 461 for k, v := range m { 462 switch k { 463 case "properties": 464 if v != nil { 465 var availabilitySetProperties AvailabilitySetProperties 466 err = json.Unmarshal(*v, &availabilitySetProperties) 467 if err != nil { 468 return err 469 } 470 asu.AvailabilitySetProperties = &availabilitySetProperties 471 } 472 case "sku": 473 if v != nil { 474 var sku Sku 475 err = json.Unmarshal(*v, &sku) 476 if err != nil { 477 return err 478 } 479 asu.Sku = &sku 480 } 481 case "tags": 482 if v != nil { 483 var tags map[string]*string 484 err = json.Unmarshal(*v, &tags) 485 if err != nil { 486 return err 487 } 488 asu.Tags = tags 489 } 490 } 491 } 492 493 return nil 494} 495 496// BillingProfile specifies the billing related details of a Azure Spot VM or VMSS. <br><br>Minimum 497// api-version: 2019-03-01. 498type BillingProfile struct { 499 // 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. 500 MaxPrice *float64 `json:"maxPrice,omitempty"` 501} 502 503// BootDiagnostics boot Diagnostics is a debugging feature which allows you to view Console Output and 504// Screenshot to diagnose VM status. <br><br> You can easily view the output of your console log. <br><br> 505// Azure also enables you to see a screenshot of the VM from the hypervisor. 506type BootDiagnostics struct { 507 // Enabled - Whether boot diagnostics should be enabled on the Virtual Machine. 508 Enabled *bool `json:"enabled,omitempty"` 509 // StorageURI - Uri of the storage account to use for placing the console output and screenshot. 510 StorageURI *string `json:"storageUri,omitempty"` 511} 512 513// BootDiagnosticsInstanceView the instance view of a virtual machine boot diagnostics. 514type BootDiagnosticsInstanceView struct { 515 // ConsoleScreenshotBlobURI - READ-ONLY; The console screenshot blob URI. 516 ConsoleScreenshotBlobURI *string `json:"consoleScreenshotBlobUri,omitempty"` 517 // SerialConsoleLogBlobURI - READ-ONLY; The Linux serial console log blob Uri. 518 SerialConsoleLogBlobURI *string `json:"serialConsoleLogBlobUri,omitempty"` 519 // 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. 520 Status *InstanceViewStatus `json:"status,omitempty"` 521} 522 523// CloudError an error response from the Compute service. 524type CloudError struct { 525 Error *APIError `json:"error,omitempty"` 526} 527 528// ContainerService container service. 529type ContainerService struct { 530 autorest.Response `json:"-"` 531 *ContainerServiceProperties `json:"properties,omitempty"` 532 // ID - READ-ONLY; Resource Id 533 ID *string `json:"id,omitempty"` 534 // Name - READ-ONLY; Resource name 535 Name *string `json:"name,omitempty"` 536 // Type - READ-ONLY; Resource type 537 Type *string `json:"type,omitempty"` 538 // Location - Resource location 539 Location *string `json:"location,omitempty"` 540 // Tags - Resource tags 541 Tags map[string]*string `json:"tags"` 542} 543 544// MarshalJSON is the custom marshaler for ContainerService. 545func (cs ContainerService) MarshalJSON() ([]byte, error) { 546 objectMap := make(map[string]interface{}) 547 if cs.ContainerServiceProperties != nil { 548 objectMap["properties"] = cs.ContainerServiceProperties 549 } 550 if cs.Location != nil { 551 objectMap["location"] = cs.Location 552 } 553 if cs.Tags != nil { 554 objectMap["tags"] = cs.Tags 555 } 556 return json.Marshal(objectMap) 557} 558 559// UnmarshalJSON is the custom unmarshaler for ContainerService struct. 560func (cs *ContainerService) UnmarshalJSON(body []byte) error { 561 var m map[string]*json.RawMessage 562 err := json.Unmarshal(body, &m) 563 if err != nil { 564 return err 565 } 566 for k, v := range m { 567 switch k { 568 case "properties": 569 if v != nil { 570 var containerServiceProperties ContainerServiceProperties 571 err = json.Unmarshal(*v, &containerServiceProperties) 572 if err != nil { 573 return err 574 } 575 cs.ContainerServiceProperties = &containerServiceProperties 576 } 577 case "id": 578 if v != nil { 579 var ID string 580 err = json.Unmarshal(*v, &ID) 581 if err != nil { 582 return err 583 } 584 cs.ID = &ID 585 } 586 case "name": 587 if v != nil { 588 var name string 589 err = json.Unmarshal(*v, &name) 590 if err != nil { 591 return err 592 } 593 cs.Name = &name 594 } 595 case "type": 596 if v != nil { 597 var typeVar string 598 err = json.Unmarshal(*v, &typeVar) 599 if err != nil { 600 return err 601 } 602 cs.Type = &typeVar 603 } 604 case "location": 605 if v != nil { 606 var location string 607 err = json.Unmarshal(*v, &location) 608 if err != nil { 609 return err 610 } 611 cs.Location = &location 612 } 613 case "tags": 614 if v != nil { 615 var tags map[string]*string 616 err = json.Unmarshal(*v, &tags) 617 if err != nil { 618 return err 619 } 620 cs.Tags = tags 621 } 622 } 623 } 624 625 return nil 626} 627 628// ContainerServiceAgentPoolProfile profile for the container service agent pool. 629type ContainerServiceAgentPoolProfile struct { 630 // Name - Unique name of the agent pool profile in the context of the subscription and resource group. 631 Name *string `json:"name,omitempty"` 632 // 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. 633 Count *int32 `json:"count,omitempty"` 634 // 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' 635 VMSize ContainerServiceVMSizeTypes `json:"vmSize,omitempty"` 636 // DNSPrefix - DNS prefix to be used to create the FQDN for the agent pool. 637 DNSPrefix *string `json:"dnsPrefix,omitempty"` 638 // Fqdn - READ-ONLY; FQDN for the agent pool. 639 Fqdn *string `json:"fqdn,omitempty"` 640} 641 642// MarshalJSON is the custom marshaler for ContainerServiceAgentPoolProfile. 643func (csapp ContainerServiceAgentPoolProfile) MarshalJSON() ([]byte, error) { 644 objectMap := make(map[string]interface{}) 645 if csapp.Name != nil { 646 objectMap["name"] = csapp.Name 647 } 648 if csapp.Count != nil { 649 objectMap["count"] = csapp.Count 650 } 651 if csapp.VMSize != "" { 652 objectMap["vmSize"] = csapp.VMSize 653 } 654 if csapp.DNSPrefix != nil { 655 objectMap["dnsPrefix"] = csapp.DNSPrefix 656 } 657 return json.Marshal(objectMap) 658} 659 660// ContainerServiceCustomProfile properties to configure a custom container service cluster. 661type ContainerServiceCustomProfile struct { 662 // Orchestrator - The name of the custom orchestrator to use. 663 Orchestrator *string `json:"orchestrator,omitempty"` 664} 665 666// ContainerServiceDiagnosticsProfile ... 667type ContainerServiceDiagnosticsProfile struct { 668 // VMDiagnostics - Profile for the container service VM diagnostic agent. 669 VMDiagnostics *ContainerServiceVMDiagnostics `json:"vmDiagnostics,omitempty"` 670} 671 672// ContainerServiceLinuxProfile profile for Linux VMs in the container service cluster. 673type ContainerServiceLinuxProfile struct { 674 // AdminUsername - The administrator username to use for Linux VMs. 675 AdminUsername *string `json:"adminUsername,omitempty"` 676 // SSH - The ssh key configuration for Linux VMs. 677 SSH *ContainerServiceSSHConfiguration `json:"ssh,omitempty"` 678} 679 680// ContainerServiceListResult the response from the List Container Services operation. 681type ContainerServiceListResult struct { 682 autorest.Response `json:"-"` 683 // Value - the list of container services. 684 Value *[]ContainerService `json:"value,omitempty"` 685 // NextLink - The URL to get the next set of container service results. 686 NextLink *string `json:"nextLink,omitempty"` 687} 688 689// ContainerServiceListResultIterator provides access to a complete listing of ContainerService values. 690type ContainerServiceListResultIterator struct { 691 i int 692 page ContainerServiceListResultPage 693} 694 695// NextWithContext advances to the next value. If there was an error making 696// the request the iterator does not advance and the error is returned. 697func (iter *ContainerServiceListResultIterator) NextWithContext(ctx context.Context) (err error) { 698 if tracing.IsEnabled() { 699 ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServiceListResultIterator.NextWithContext") 700 defer func() { 701 sc := -1 702 if iter.Response().Response.Response != nil { 703 sc = iter.Response().Response.Response.StatusCode 704 } 705 tracing.EndSpan(ctx, sc, err) 706 }() 707 } 708 iter.i++ 709 if iter.i < len(iter.page.Values()) { 710 return nil 711 } 712 err = iter.page.NextWithContext(ctx) 713 if err != nil { 714 iter.i-- 715 return err 716 } 717 iter.i = 0 718 return nil 719} 720 721// Next advances to the next value. If there was an error making 722// the request the iterator does not advance and the error is returned. 723// Deprecated: Use NextWithContext() instead. 724func (iter *ContainerServiceListResultIterator) Next() error { 725 return iter.NextWithContext(context.Background()) 726} 727 728// NotDone returns true if the enumeration should be started or is not yet complete. 729func (iter ContainerServiceListResultIterator) NotDone() bool { 730 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 731} 732 733// Response returns the raw server response from the last page request. 734func (iter ContainerServiceListResultIterator) Response() ContainerServiceListResult { 735 return iter.page.Response() 736} 737 738// Value returns the current value or a zero-initialized value if the 739// iterator has advanced beyond the end of the collection. 740func (iter ContainerServiceListResultIterator) Value() ContainerService { 741 if !iter.page.NotDone() { 742 return ContainerService{} 743 } 744 return iter.page.Values()[iter.i] 745} 746 747// Creates a new instance of the ContainerServiceListResultIterator type. 748func NewContainerServiceListResultIterator(page ContainerServiceListResultPage) ContainerServiceListResultIterator { 749 return ContainerServiceListResultIterator{page: page} 750} 751 752// IsEmpty returns true if the ListResult contains no values. 753func (cslr ContainerServiceListResult) IsEmpty() bool { 754 return cslr.Value == nil || len(*cslr.Value) == 0 755} 756 757// hasNextLink returns true if the NextLink is not empty. 758func (cslr ContainerServiceListResult) hasNextLink() bool { 759 return cslr.NextLink != nil && len(*cslr.NextLink) != 0 760} 761 762// containerServiceListResultPreparer prepares a request to retrieve the next set of results. 763// It returns nil if no more results exist. 764func (cslr ContainerServiceListResult) containerServiceListResultPreparer(ctx context.Context) (*http.Request, error) { 765 if !cslr.hasNextLink() { 766 return nil, nil 767 } 768 return autorest.Prepare((&http.Request{}).WithContext(ctx), 769 autorest.AsJSON(), 770 autorest.AsGet(), 771 autorest.WithBaseURL(to.String(cslr.NextLink))) 772} 773 774// ContainerServiceListResultPage contains a page of ContainerService values. 775type ContainerServiceListResultPage struct { 776 fn func(context.Context, ContainerServiceListResult) (ContainerServiceListResult, error) 777 cslr ContainerServiceListResult 778} 779 780// NextWithContext advances to the next page of values. If there was an error making 781// the request the page does not advance and the error is returned. 782func (page *ContainerServiceListResultPage) NextWithContext(ctx context.Context) (err error) { 783 if tracing.IsEnabled() { 784 ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServiceListResultPage.NextWithContext") 785 defer func() { 786 sc := -1 787 if page.Response().Response.Response != nil { 788 sc = page.Response().Response.Response.StatusCode 789 } 790 tracing.EndSpan(ctx, sc, err) 791 }() 792 } 793 for { 794 next, err := page.fn(ctx, page.cslr) 795 if err != nil { 796 return err 797 } 798 page.cslr = next 799 if !next.hasNextLink() || !next.IsEmpty() { 800 break 801 } 802 } 803 return nil 804} 805 806// Next advances to the next page of values. If there was an error making 807// the request the page does not advance and the error is returned. 808// Deprecated: Use NextWithContext() instead. 809func (page *ContainerServiceListResultPage) Next() error { 810 return page.NextWithContext(context.Background()) 811} 812 813// NotDone returns true if the page enumeration should be started or is not yet complete. 814func (page ContainerServiceListResultPage) NotDone() bool { 815 return !page.cslr.IsEmpty() 816} 817 818// Response returns the raw server response from the last page request. 819func (page ContainerServiceListResultPage) Response() ContainerServiceListResult { 820 return page.cslr 821} 822 823// Values returns the slice of values for the current page or nil if there are no values. 824func (page ContainerServiceListResultPage) Values() []ContainerService { 825 if page.cslr.IsEmpty() { 826 return nil 827 } 828 return *page.cslr.Value 829} 830 831// Creates a new instance of the ContainerServiceListResultPage type. 832func NewContainerServiceListResultPage(cur ContainerServiceListResult, getNextPage func(context.Context, ContainerServiceListResult) (ContainerServiceListResult, error)) ContainerServiceListResultPage { 833 return ContainerServiceListResultPage{ 834 fn: getNextPage, 835 cslr: cur, 836 } 837} 838 839// ContainerServiceMasterProfile profile for the container service master. 840type ContainerServiceMasterProfile struct { 841 // Count - Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. 842 Count *int32 `json:"count,omitempty"` 843 // DNSPrefix - DNS prefix to be used to create the FQDN for master. 844 DNSPrefix *string `json:"dnsPrefix,omitempty"` 845 // Fqdn - READ-ONLY; FQDN for the master. 846 Fqdn *string `json:"fqdn,omitempty"` 847} 848 849// MarshalJSON is the custom marshaler for ContainerServiceMasterProfile. 850func (csmp ContainerServiceMasterProfile) MarshalJSON() ([]byte, error) { 851 objectMap := make(map[string]interface{}) 852 if csmp.Count != nil { 853 objectMap["count"] = csmp.Count 854 } 855 if csmp.DNSPrefix != nil { 856 objectMap["dnsPrefix"] = csmp.DNSPrefix 857 } 858 return json.Marshal(objectMap) 859} 860 861// ContainerServiceOrchestratorProfile profile for the container service orchestrator. 862type ContainerServiceOrchestratorProfile struct { 863 // 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' 864 OrchestratorType ContainerServiceOrchestratorTypes `json:"orchestratorType,omitempty"` 865} 866 867// ContainerServiceProperties properties of the container service. 868type ContainerServiceProperties struct { 869 // ProvisioningState - READ-ONLY; the current deployment or provisioning state, which only appears in the response. 870 ProvisioningState *string `json:"provisioningState,omitempty"` 871 // OrchestratorProfile - Properties of the orchestrator. 872 OrchestratorProfile *ContainerServiceOrchestratorProfile `json:"orchestratorProfile,omitempty"` 873 // CustomProfile - Properties for custom clusters. 874 CustomProfile *ContainerServiceCustomProfile `json:"customProfile,omitempty"` 875 // ServicePrincipalProfile - Properties for cluster service principals. 876 ServicePrincipalProfile *ContainerServiceServicePrincipalProfile `json:"servicePrincipalProfile,omitempty"` 877 // MasterProfile - Properties of master agents. 878 MasterProfile *ContainerServiceMasterProfile `json:"masterProfile,omitempty"` 879 // AgentPoolProfiles - Properties of the agent pool. 880 AgentPoolProfiles *[]ContainerServiceAgentPoolProfile `json:"agentPoolProfiles,omitempty"` 881 // WindowsProfile - Properties of Windows VMs. 882 WindowsProfile *ContainerServiceWindowsProfile `json:"windowsProfile,omitempty"` 883 // LinuxProfile - Properties of Linux VMs. 884 LinuxProfile *ContainerServiceLinuxProfile `json:"linuxProfile,omitempty"` 885 // DiagnosticsProfile - Properties of the diagnostic agent. 886 DiagnosticsProfile *ContainerServiceDiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 887} 888 889// MarshalJSON is the custom marshaler for ContainerServiceProperties. 890func (csp ContainerServiceProperties) MarshalJSON() ([]byte, error) { 891 objectMap := make(map[string]interface{}) 892 if csp.OrchestratorProfile != nil { 893 objectMap["orchestratorProfile"] = csp.OrchestratorProfile 894 } 895 if csp.CustomProfile != nil { 896 objectMap["customProfile"] = csp.CustomProfile 897 } 898 if csp.ServicePrincipalProfile != nil { 899 objectMap["servicePrincipalProfile"] = csp.ServicePrincipalProfile 900 } 901 if csp.MasterProfile != nil { 902 objectMap["masterProfile"] = csp.MasterProfile 903 } 904 if csp.AgentPoolProfiles != nil { 905 objectMap["agentPoolProfiles"] = csp.AgentPoolProfiles 906 } 907 if csp.WindowsProfile != nil { 908 objectMap["windowsProfile"] = csp.WindowsProfile 909 } 910 if csp.LinuxProfile != nil { 911 objectMap["linuxProfile"] = csp.LinuxProfile 912 } 913 if csp.DiagnosticsProfile != nil { 914 objectMap["diagnosticsProfile"] = csp.DiagnosticsProfile 915 } 916 return json.Marshal(objectMap) 917} 918 919// ContainerServicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 920// long-running operation. 921type ContainerServicesCreateOrUpdateFuture struct { 922 azure.FutureAPI 923 // Result returns the result of the asynchronous operation. 924 // If the operation has not completed it will return an error. 925 Result func(ContainerServicesClient) (ContainerService, error) 926} 927 928// ContainerServicesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 929// operation. 930type ContainerServicesDeleteFuture struct { 931 azure.FutureAPI 932 // Result returns the result of the asynchronous operation. 933 // If the operation has not completed it will return an error. 934 Result func(ContainerServicesClient) (autorest.Response, error) 935} 936 937// ContainerServiceServicePrincipalProfile information about a service principal identity for the cluster 938// to use for manipulating Azure APIs. 939type ContainerServiceServicePrincipalProfile struct { 940 // ClientID - The ID for the service principal. 941 ClientID *string `json:"clientId,omitempty"` 942 // Secret - The secret password associated with the service principal. 943 Secret *string `json:"secret,omitempty"` 944} 945 946// ContainerServiceSSHConfiguration SSH configuration for Linux-based VMs running on Azure. 947type ContainerServiceSSHConfiguration struct { 948 // PublicKeys - the list of SSH public keys used to authenticate with Linux-based VMs. 949 PublicKeys *[]ContainerServiceSSHPublicKey `json:"publicKeys,omitempty"` 950} 951 952// ContainerServiceSSHPublicKey contains information about SSH certificate public key data. 953type ContainerServiceSSHPublicKey struct { 954 // KeyData - Certificate public key used to authenticate with VMs through SSH. The certificate must be in PEM format with or without headers. 955 KeyData *string `json:"keyData,omitempty"` 956} 957 958// ContainerServiceVMDiagnostics profile for diagnostics on the container service VMs. 959type ContainerServiceVMDiagnostics struct { 960 // Enabled - Whether the VM diagnostic agent is provisioned on the VM. 961 Enabled *bool `json:"enabled,omitempty"` 962 // StorageURI - READ-ONLY; The URI of the storage account where diagnostics are stored. 963 StorageURI *string `json:"storageUri,omitempty"` 964} 965 966// MarshalJSON is the custom marshaler for ContainerServiceVMDiagnostics. 967func (csvd ContainerServiceVMDiagnostics) MarshalJSON() ([]byte, error) { 968 objectMap := make(map[string]interface{}) 969 if csvd.Enabled != nil { 970 objectMap["enabled"] = csvd.Enabled 971 } 972 return json.Marshal(objectMap) 973} 974 975// ContainerServiceWindowsProfile profile for Windows VMs in the container service cluster. 976type ContainerServiceWindowsProfile struct { 977 // AdminUsername - The administrator username to use for Windows VMs. 978 AdminUsername *string `json:"adminUsername,omitempty"` 979 // AdminPassword - The administrator password to use for Windows VMs. 980 AdminPassword *string `json:"adminPassword,omitempty"` 981} 982 983// CreationData data used when creating a disk. 984type CreationData struct { 985 // CreateOption - This enumerates the possible sources of a disk's creation. Possible values include: 'Empty', 'Attach', 'FromImage', 'Import', 'Copy', 'Restore', 'Upload' 986 CreateOption DiskCreateOption `json:"createOption,omitempty"` 987 // StorageAccountID - Required if createOption is Import. The Azure Resource Manager identifier of the storage account containing the blob to import as a disk. 988 StorageAccountID *string `json:"storageAccountId,omitempty"` 989 // ImageReference - Disk source information. 990 ImageReference *ImageDiskReference `json:"imageReference,omitempty"` 991 // SourceURI - If createOption is Import, this is the URI of a blob to be imported into a managed disk. 992 SourceURI *string `json:"sourceUri,omitempty"` 993 // SourceResourceID - If createOption is Copy, this is the ARM id of the source snapshot or disk. 994 SourceResourceID *string `json:"sourceResourceId,omitempty"` 995 // SourceUniqueID - READ-ONLY; If this field is set, this is the unique id identifying the source of this resource. 996 SourceUniqueID *string `json:"sourceUniqueId,omitempty"` 997 // 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). 998 UploadSizeBytes *int64 `json:"uploadSizeBytes,omitempty"` 999} 1000 1001// MarshalJSON is the custom marshaler for CreationData. 1002func (cd CreationData) MarshalJSON() ([]byte, error) { 1003 objectMap := make(map[string]interface{}) 1004 if cd.CreateOption != "" { 1005 objectMap["createOption"] = cd.CreateOption 1006 } 1007 if cd.StorageAccountID != nil { 1008 objectMap["storageAccountId"] = cd.StorageAccountID 1009 } 1010 if cd.ImageReference != nil { 1011 objectMap["imageReference"] = cd.ImageReference 1012 } 1013 if cd.SourceURI != nil { 1014 objectMap["sourceUri"] = cd.SourceURI 1015 } 1016 if cd.SourceResourceID != nil { 1017 objectMap["sourceResourceId"] = cd.SourceResourceID 1018 } 1019 if cd.UploadSizeBytes != nil { 1020 objectMap["uploadSizeBytes"] = cd.UploadSizeBytes 1021 } 1022 return json.Marshal(objectMap) 1023} 1024 1025// DataDisk describes a data disk. 1026type DataDisk struct { 1027 // 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. 1028 Lun *int32 `json:"lun,omitempty"` 1029 // Name - The disk name. 1030 Name *string `json:"name,omitempty"` 1031 // Vhd - The virtual hard disk. 1032 Vhd *VirtualHardDisk `json:"vhd,omitempty"` 1033 // 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. 1034 Image *VirtualHardDisk `json:"image,omitempty"` 1035 // 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' 1036 Caching CachingTypes `json:"caching,omitempty"` 1037 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 1038 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 1039 // 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' 1040 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 1041 // 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 1042 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 1043 // ManagedDisk - The managed disk parameters. 1044 ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` 1045 // ToBeDetached - Specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset 1046 ToBeDetached *bool `json:"toBeDetached,omitempty"` 1047 // 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. 1048 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 1049 // 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. 1050 DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` 1051} 1052 1053// MarshalJSON is the custom marshaler for DataDisk. 1054func (dd DataDisk) MarshalJSON() ([]byte, error) { 1055 objectMap := make(map[string]interface{}) 1056 if dd.Lun != nil { 1057 objectMap["lun"] = dd.Lun 1058 } 1059 if dd.Name != nil { 1060 objectMap["name"] = dd.Name 1061 } 1062 if dd.Vhd != nil { 1063 objectMap["vhd"] = dd.Vhd 1064 } 1065 if dd.Image != nil { 1066 objectMap["image"] = dd.Image 1067 } 1068 if dd.Caching != "" { 1069 objectMap["caching"] = dd.Caching 1070 } 1071 if dd.WriteAcceleratorEnabled != nil { 1072 objectMap["writeAcceleratorEnabled"] = dd.WriteAcceleratorEnabled 1073 } 1074 if dd.CreateOption != "" { 1075 objectMap["createOption"] = dd.CreateOption 1076 } 1077 if dd.DiskSizeGB != nil { 1078 objectMap["diskSizeGB"] = dd.DiskSizeGB 1079 } 1080 if dd.ManagedDisk != nil { 1081 objectMap["managedDisk"] = dd.ManagedDisk 1082 } 1083 if dd.ToBeDetached != nil { 1084 objectMap["toBeDetached"] = dd.ToBeDetached 1085 } 1086 return json.Marshal(objectMap) 1087} 1088 1089// DataDiskImage contains the data disk images information. 1090type DataDiskImage struct { 1091 // 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. 1092 Lun *int32 `json:"lun,omitempty"` 1093} 1094 1095// DedicatedHost specifies information about the Dedicated host. 1096type DedicatedHost struct { 1097 autorest.Response `json:"-"` 1098 *DedicatedHostProperties `json:"properties,omitempty"` 1099 // 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. 1100 Sku *Sku `json:"sku,omitempty"` 1101 // ID - READ-ONLY; Resource Id 1102 ID *string `json:"id,omitempty"` 1103 // Name - READ-ONLY; Resource name 1104 Name *string `json:"name,omitempty"` 1105 // Type - READ-ONLY; Resource type 1106 Type *string `json:"type,omitempty"` 1107 // Location - Resource location 1108 Location *string `json:"location,omitempty"` 1109 // Tags - Resource tags 1110 Tags map[string]*string `json:"tags"` 1111} 1112 1113// MarshalJSON is the custom marshaler for DedicatedHost. 1114func (dh DedicatedHost) MarshalJSON() ([]byte, error) { 1115 objectMap := make(map[string]interface{}) 1116 if dh.DedicatedHostProperties != nil { 1117 objectMap["properties"] = dh.DedicatedHostProperties 1118 } 1119 if dh.Sku != nil { 1120 objectMap["sku"] = dh.Sku 1121 } 1122 if dh.Location != nil { 1123 objectMap["location"] = dh.Location 1124 } 1125 if dh.Tags != nil { 1126 objectMap["tags"] = dh.Tags 1127 } 1128 return json.Marshal(objectMap) 1129} 1130 1131// UnmarshalJSON is the custom unmarshaler for DedicatedHost struct. 1132func (dh *DedicatedHost) UnmarshalJSON(body []byte) error { 1133 var m map[string]*json.RawMessage 1134 err := json.Unmarshal(body, &m) 1135 if err != nil { 1136 return err 1137 } 1138 for k, v := range m { 1139 switch k { 1140 case "properties": 1141 if v != nil { 1142 var dedicatedHostProperties DedicatedHostProperties 1143 err = json.Unmarshal(*v, &dedicatedHostProperties) 1144 if err != nil { 1145 return err 1146 } 1147 dh.DedicatedHostProperties = &dedicatedHostProperties 1148 } 1149 case "sku": 1150 if v != nil { 1151 var sku Sku 1152 err = json.Unmarshal(*v, &sku) 1153 if err != nil { 1154 return err 1155 } 1156 dh.Sku = &sku 1157 } 1158 case "id": 1159 if v != nil { 1160 var ID string 1161 err = json.Unmarshal(*v, &ID) 1162 if err != nil { 1163 return err 1164 } 1165 dh.ID = &ID 1166 } 1167 case "name": 1168 if v != nil { 1169 var name string 1170 err = json.Unmarshal(*v, &name) 1171 if err != nil { 1172 return err 1173 } 1174 dh.Name = &name 1175 } 1176 case "type": 1177 if v != nil { 1178 var typeVar string 1179 err = json.Unmarshal(*v, &typeVar) 1180 if err != nil { 1181 return err 1182 } 1183 dh.Type = &typeVar 1184 } 1185 case "location": 1186 if v != nil { 1187 var location string 1188 err = json.Unmarshal(*v, &location) 1189 if err != nil { 1190 return err 1191 } 1192 dh.Location = &location 1193 } 1194 case "tags": 1195 if v != nil { 1196 var tags map[string]*string 1197 err = json.Unmarshal(*v, &tags) 1198 if err != nil { 1199 return err 1200 } 1201 dh.Tags = tags 1202 } 1203 } 1204 } 1205 1206 return nil 1207} 1208 1209// DedicatedHostAllocatableVM represents the dedicated host unutilized capacity in terms of a specific VM 1210// size. 1211type DedicatedHostAllocatableVM struct { 1212 // VMSize - VM size in terms of which the unutilized capacity is represented. 1213 VMSize *string `json:"vmSize,omitempty"` 1214 // Count - Maximum number of VMs of size vmSize that can fit in the dedicated host's remaining capacity. 1215 Count *float64 `json:"count,omitempty"` 1216} 1217 1218// DedicatedHostAvailableCapacity dedicated host unutilized capacity. 1219type DedicatedHostAvailableCapacity struct { 1220 // 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. 1221 AllocatableVMs *[]DedicatedHostAllocatableVM `json:"allocatableVMs,omitempty"` 1222} 1223 1224// DedicatedHostGroup specifies information about the dedicated host group that the dedicated hosts should 1225// be assigned to. <br><br> Currently, a dedicated host can only be added to a dedicated host group at 1226// creation time. An existing dedicated host cannot be added to another dedicated host group. 1227type DedicatedHostGroup struct { 1228 autorest.Response `json:"-"` 1229 *DedicatedHostGroupProperties `json:"properties,omitempty"` 1230 // 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. 1231 Zones *[]string `json:"zones,omitempty"` 1232 // ID - READ-ONLY; Resource Id 1233 ID *string `json:"id,omitempty"` 1234 // Name - READ-ONLY; Resource name 1235 Name *string `json:"name,omitempty"` 1236 // Type - READ-ONLY; Resource type 1237 Type *string `json:"type,omitempty"` 1238 // Location - Resource location 1239 Location *string `json:"location,omitempty"` 1240 // Tags - Resource tags 1241 Tags map[string]*string `json:"tags"` 1242} 1243 1244// MarshalJSON is the custom marshaler for DedicatedHostGroup. 1245func (dhg DedicatedHostGroup) MarshalJSON() ([]byte, error) { 1246 objectMap := make(map[string]interface{}) 1247 if dhg.DedicatedHostGroupProperties != nil { 1248 objectMap["properties"] = dhg.DedicatedHostGroupProperties 1249 } 1250 if dhg.Zones != nil { 1251 objectMap["zones"] = dhg.Zones 1252 } 1253 if dhg.Location != nil { 1254 objectMap["location"] = dhg.Location 1255 } 1256 if dhg.Tags != nil { 1257 objectMap["tags"] = dhg.Tags 1258 } 1259 return json.Marshal(objectMap) 1260} 1261 1262// UnmarshalJSON is the custom unmarshaler for DedicatedHostGroup struct. 1263func (dhg *DedicatedHostGroup) UnmarshalJSON(body []byte) error { 1264 var m map[string]*json.RawMessage 1265 err := json.Unmarshal(body, &m) 1266 if err != nil { 1267 return err 1268 } 1269 for k, v := range m { 1270 switch k { 1271 case "properties": 1272 if v != nil { 1273 var dedicatedHostGroupProperties DedicatedHostGroupProperties 1274 err = json.Unmarshal(*v, &dedicatedHostGroupProperties) 1275 if err != nil { 1276 return err 1277 } 1278 dhg.DedicatedHostGroupProperties = &dedicatedHostGroupProperties 1279 } 1280 case "zones": 1281 if v != nil { 1282 var zones []string 1283 err = json.Unmarshal(*v, &zones) 1284 if err != nil { 1285 return err 1286 } 1287 dhg.Zones = &zones 1288 } 1289 case "id": 1290 if v != nil { 1291 var ID string 1292 err = json.Unmarshal(*v, &ID) 1293 if err != nil { 1294 return err 1295 } 1296 dhg.ID = &ID 1297 } 1298 case "name": 1299 if v != nil { 1300 var name string 1301 err = json.Unmarshal(*v, &name) 1302 if err != nil { 1303 return err 1304 } 1305 dhg.Name = &name 1306 } 1307 case "type": 1308 if v != nil { 1309 var typeVar string 1310 err = json.Unmarshal(*v, &typeVar) 1311 if err != nil { 1312 return err 1313 } 1314 dhg.Type = &typeVar 1315 } 1316 case "location": 1317 if v != nil { 1318 var location string 1319 err = json.Unmarshal(*v, &location) 1320 if err != nil { 1321 return err 1322 } 1323 dhg.Location = &location 1324 } 1325 case "tags": 1326 if v != nil { 1327 var tags map[string]*string 1328 err = json.Unmarshal(*v, &tags) 1329 if err != nil { 1330 return err 1331 } 1332 dhg.Tags = tags 1333 } 1334 } 1335 } 1336 1337 return nil 1338} 1339 1340// DedicatedHostGroupListResult the List Dedicated Host Group with resource group response. 1341type DedicatedHostGroupListResult struct { 1342 autorest.Response `json:"-"` 1343 // Value - The list of dedicated host groups 1344 Value *[]DedicatedHostGroup `json:"value,omitempty"` 1345 // 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. 1346 NextLink *string `json:"nextLink,omitempty"` 1347} 1348 1349// DedicatedHostGroupListResultIterator provides access to a complete listing of DedicatedHostGroup values. 1350type DedicatedHostGroupListResultIterator struct { 1351 i int 1352 page DedicatedHostGroupListResultPage 1353} 1354 1355// NextWithContext advances to the next value. If there was an error making 1356// the request the iterator does not advance and the error is returned. 1357func (iter *DedicatedHostGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { 1358 if tracing.IsEnabled() { 1359 ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupListResultIterator.NextWithContext") 1360 defer func() { 1361 sc := -1 1362 if iter.Response().Response.Response != nil { 1363 sc = iter.Response().Response.Response.StatusCode 1364 } 1365 tracing.EndSpan(ctx, sc, err) 1366 }() 1367 } 1368 iter.i++ 1369 if iter.i < len(iter.page.Values()) { 1370 return nil 1371 } 1372 err = iter.page.NextWithContext(ctx) 1373 if err != nil { 1374 iter.i-- 1375 return err 1376 } 1377 iter.i = 0 1378 return nil 1379} 1380 1381// Next advances to the next value. If there was an error making 1382// the request the iterator does not advance and the error is returned. 1383// Deprecated: Use NextWithContext() instead. 1384func (iter *DedicatedHostGroupListResultIterator) Next() error { 1385 return iter.NextWithContext(context.Background()) 1386} 1387 1388// NotDone returns true if the enumeration should be started or is not yet complete. 1389func (iter DedicatedHostGroupListResultIterator) NotDone() bool { 1390 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1391} 1392 1393// Response returns the raw server response from the last page request. 1394func (iter DedicatedHostGroupListResultIterator) Response() DedicatedHostGroupListResult { 1395 return iter.page.Response() 1396} 1397 1398// Value returns the current value or a zero-initialized value if the 1399// iterator has advanced beyond the end of the collection. 1400func (iter DedicatedHostGroupListResultIterator) Value() DedicatedHostGroup { 1401 if !iter.page.NotDone() { 1402 return DedicatedHostGroup{} 1403 } 1404 return iter.page.Values()[iter.i] 1405} 1406 1407// Creates a new instance of the DedicatedHostGroupListResultIterator type. 1408func NewDedicatedHostGroupListResultIterator(page DedicatedHostGroupListResultPage) DedicatedHostGroupListResultIterator { 1409 return DedicatedHostGroupListResultIterator{page: page} 1410} 1411 1412// IsEmpty returns true if the ListResult contains no values. 1413func (dhglr DedicatedHostGroupListResult) IsEmpty() bool { 1414 return dhglr.Value == nil || len(*dhglr.Value) == 0 1415} 1416 1417// hasNextLink returns true if the NextLink is not empty. 1418func (dhglr DedicatedHostGroupListResult) hasNextLink() bool { 1419 return dhglr.NextLink != nil && len(*dhglr.NextLink) != 0 1420} 1421 1422// dedicatedHostGroupListResultPreparer prepares a request to retrieve the next set of results. 1423// It returns nil if no more results exist. 1424func (dhglr DedicatedHostGroupListResult) dedicatedHostGroupListResultPreparer(ctx context.Context) (*http.Request, error) { 1425 if !dhglr.hasNextLink() { 1426 return nil, nil 1427 } 1428 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1429 autorest.AsJSON(), 1430 autorest.AsGet(), 1431 autorest.WithBaseURL(to.String(dhglr.NextLink))) 1432} 1433 1434// DedicatedHostGroupListResultPage contains a page of DedicatedHostGroup values. 1435type DedicatedHostGroupListResultPage struct { 1436 fn func(context.Context, DedicatedHostGroupListResult) (DedicatedHostGroupListResult, error) 1437 dhglr DedicatedHostGroupListResult 1438} 1439 1440// NextWithContext advances to the next page of values. If there was an error making 1441// the request the page does not advance and the error is returned. 1442func (page *DedicatedHostGroupListResultPage) NextWithContext(ctx context.Context) (err error) { 1443 if tracing.IsEnabled() { 1444 ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupListResultPage.NextWithContext") 1445 defer func() { 1446 sc := -1 1447 if page.Response().Response.Response != nil { 1448 sc = page.Response().Response.Response.StatusCode 1449 } 1450 tracing.EndSpan(ctx, sc, err) 1451 }() 1452 } 1453 for { 1454 next, err := page.fn(ctx, page.dhglr) 1455 if err != nil { 1456 return err 1457 } 1458 page.dhglr = next 1459 if !next.hasNextLink() || !next.IsEmpty() { 1460 break 1461 } 1462 } 1463 return nil 1464} 1465 1466// Next advances to the next page of values. If there was an error making 1467// the request the page does not advance and the error is returned. 1468// Deprecated: Use NextWithContext() instead. 1469func (page *DedicatedHostGroupListResultPage) Next() error { 1470 return page.NextWithContext(context.Background()) 1471} 1472 1473// NotDone returns true if the page enumeration should be started or is not yet complete. 1474func (page DedicatedHostGroupListResultPage) NotDone() bool { 1475 return !page.dhglr.IsEmpty() 1476} 1477 1478// Response returns the raw server response from the last page request. 1479func (page DedicatedHostGroupListResultPage) Response() DedicatedHostGroupListResult { 1480 return page.dhglr 1481} 1482 1483// Values returns the slice of values for the current page or nil if there are no values. 1484func (page DedicatedHostGroupListResultPage) Values() []DedicatedHostGroup { 1485 if page.dhglr.IsEmpty() { 1486 return nil 1487 } 1488 return *page.dhglr.Value 1489} 1490 1491// Creates a new instance of the DedicatedHostGroupListResultPage type. 1492func NewDedicatedHostGroupListResultPage(cur DedicatedHostGroupListResult, getNextPage func(context.Context, DedicatedHostGroupListResult) (DedicatedHostGroupListResult, error)) DedicatedHostGroupListResultPage { 1493 return DedicatedHostGroupListResultPage{ 1494 fn: getNextPage, 1495 dhglr: cur, 1496 } 1497} 1498 1499// DedicatedHostGroupProperties dedicated Host Group Properties. 1500type DedicatedHostGroupProperties struct { 1501 // PlatformFaultDomainCount - Number of fault domains that the host group can span. 1502 PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` 1503 // Hosts - READ-ONLY; A list of references to all dedicated hosts in the dedicated host group. 1504 Hosts *[]SubResourceReadOnly `json:"hosts,omitempty"` 1505} 1506 1507// MarshalJSON is the custom marshaler for DedicatedHostGroupProperties. 1508func (dhgp DedicatedHostGroupProperties) MarshalJSON() ([]byte, error) { 1509 objectMap := make(map[string]interface{}) 1510 if dhgp.PlatformFaultDomainCount != nil { 1511 objectMap["platformFaultDomainCount"] = dhgp.PlatformFaultDomainCount 1512 } 1513 return json.Marshal(objectMap) 1514} 1515 1516// DedicatedHostGroupUpdate specifies information about the dedicated host group that the dedicated host 1517// should be assigned to. Only tags may be updated. 1518type DedicatedHostGroupUpdate struct { 1519 *DedicatedHostGroupProperties `json:"properties,omitempty"` 1520 // 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. 1521 Zones *[]string `json:"zones,omitempty"` 1522 // Tags - Resource tags 1523 Tags map[string]*string `json:"tags"` 1524} 1525 1526// MarshalJSON is the custom marshaler for DedicatedHostGroupUpdate. 1527func (dhgu DedicatedHostGroupUpdate) MarshalJSON() ([]byte, error) { 1528 objectMap := make(map[string]interface{}) 1529 if dhgu.DedicatedHostGroupProperties != nil { 1530 objectMap["properties"] = dhgu.DedicatedHostGroupProperties 1531 } 1532 if dhgu.Zones != nil { 1533 objectMap["zones"] = dhgu.Zones 1534 } 1535 if dhgu.Tags != nil { 1536 objectMap["tags"] = dhgu.Tags 1537 } 1538 return json.Marshal(objectMap) 1539} 1540 1541// UnmarshalJSON is the custom unmarshaler for DedicatedHostGroupUpdate struct. 1542func (dhgu *DedicatedHostGroupUpdate) UnmarshalJSON(body []byte) error { 1543 var m map[string]*json.RawMessage 1544 err := json.Unmarshal(body, &m) 1545 if err != nil { 1546 return err 1547 } 1548 for k, v := range m { 1549 switch k { 1550 case "properties": 1551 if v != nil { 1552 var dedicatedHostGroupProperties DedicatedHostGroupProperties 1553 err = json.Unmarshal(*v, &dedicatedHostGroupProperties) 1554 if err != nil { 1555 return err 1556 } 1557 dhgu.DedicatedHostGroupProperties = &dedicatedHostGroupProperties 1558 } 1559 case "zones": 1560 if v != nil { 1561 var zones []string 1562 err = json.Unmarshal(*v, &zones) 1563 if err != nil { 1564 return err 1565 } 1566 dhgu.Zones = &zones 1567 } 1568 case "tags": 1569 if v != nil { 1570 var tags map[string]*string 1571 err = json.Unmarshal(*v, &tags) 1572 if err != nil { 1573 return err 1574 } 1575 dhgu.Tags = tags 1576 } 1577 } 1578 } 1579 1580 return nil 1581} 1582 1583// DedicatedHostInstanceView the instance view of a dedicated host. 1584type DedicatedHostInstanceView struct { 1585 // AssetID - READ-ONLY; Specifies the unique id of the dedicated physical machine on which the dedicated host resides. 1586 AssetID *string `json:"assetId,omitempty"` 1587 // AvailableCapacity - Unutilized capacity of the dedicated host. 1588 AvailableCapacity *DedicatedHostAvailableCapacity `json:"availableCapacity,omitempty"` 1589 // Statuses - The resource status information. 1590 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 1591} 1592 1593// MarshalJSON is the custom marshaler for DedicatedHostInstanceView. 1594func (dhiv DedicatedHostInstanceView) MarshalJSON() ([]byte, error) { 1595 objectMap := make(map[string]interface{}) 1596 if dhiv.AvailableCapacity != nil { 1597 objectMap["availableCapacity"] = dhiv.AvailableCapacity 1598 } 1599 if dhiv.Statuses != nil { 1600 objectMap["statuses"] = dhiv.Statuses 1601 } 1602 return json.Marshal(objectMap) 1603} 1604 1605// DedicatedHostListResult the list dedicated host operation response. 1606type DedicatedHostListResult struct { 1607 autorest.Response `json:"-"` 1608 // Value - The list of dedicated hosts 1609 Value *[]DedicatedHost `json:"value,omitempty"` 1610 // NextLink - The URI to fetch the next page of dedicated hosts. Call ListNext() with this URI to fetch the next page of dedicated hosts. 1611 NextLink *string `json:"nextLink,omitempty"` 1612} 1613 1614// DedicatedHostListResultIterator provides access to a complete listing of DedicatedHost values. 1615type DedicatedHostListResultIterator struct { 1616 i int 1617 page DedicatedHostListResultPage 1618} 1619 1620// NextWithContext advances to the next value. If there was an error making 1621// the request the iterator does not advance and the error is returned. 1622func (iter *DedicatedHostListResultIterator) NextWithContext(ctx context.Context) (err error) { 1623 if tracing.IsEnabled() { 1624 ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostListResultIterator.NextWithContext") 1625 defer func() { 1626 sc := -1 1627 if iter.Response().Response.Response != nil { 1628 sc = iter.Response().Response.Response.StatusCode 1629 } 1630 tracing.EndSpan(ctx, sc, err) 1631 }() 1632 } 1633 iter.i++ 1634 if iter.i < len(iter.page.Values()) { 1635 return nil 1636 } 1637 err = iter.page.NextWithContext(ctx) 1638 if err != nil { 1639 iter.i-- 1640 return err 1641 } 1642 iter.i = 0 1643 return nil 1644} 1645 1646// Next advances to the next value. If there was an error making 1647// the request the iterator does not advance and the error is returned. 1648// Deprecated: Use NextWithContext() instead. 1649func (iter *DedicatedHostListResultIterator) Next() error { 1650 return iter.NextWithContext(context.Background()) 1651} 1652 1653// NotDone returns true if the enumeration should be started or is not yet complete. 1654func (iter DedicatedHostListResultIterator) NotDone() bool { 1655 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1656} 1657 1658// Response returns the raw server response from the last page request. 1659func (iter DedicatedHostListResultIterator) Response() DedicatedHostListResult { 1660 return iter.page.Response() 1661} 1662 1663// Value returns the current value or a zero-initialized value if the 1664// iterator has advanced beyond the end of the collection. 1665func (iter DedicatedHostListResultIterator) Value() DedicatedHost { 1666 if !iter.page.NotDone() { 1667 return DedicatedHost{} 1668 } 1669 return iter.page.Values()[iter.i] 1670} 1671 1672// Creates a new instance of the DedicatedHostListResultIterator type. 1673func NewDedicatedHostListResultIterator(page DedicatedHostListResultPage) DedicatedHostListResultIterator { 1674 return DedicatedHostListResultIterator{page: page} 1675} 1676 1677// IsEmpty returns true if the ListResult contains no values. 1678func (dhlr DedicatedHostListResult) IsEmpty() bool { 1679 return dhlr.Value == nil || len(*dhlr.Value) == 0 1680} 1681 1682// hasNextLink returns true if the NextLink is not empty. 1683func (dhlr DedicatedHostListResult) hasNextLink() bool { 1684 return dhlr.NextLink != nil && len(*dhlr.NextLink) != 0 1685} 1686 1687// dedicatedHostListResultPreparer prepares a request to retrieve the next set of results. 1688// It returns nil if no more results exist. 1689func (dhlr DedicatedHostListResult) dedicatedHostListResultPreparer(ctx context.Context) (*http.Request, error) { 1690 if !dhlr.hasNextLink() { 1691 return nil, nil 1692 } 1693 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1694 autorest.AsJSON(), 1695 autorest.AsGet(), 1696 autorest.WithBaseURL(to.String(dhlr.NextLink))) 1697} 1698 1699// DedicatedHostListResultPage contains a page of DedicatedHost values. 1700type DedicatedHostListResultPage struct { 1701 fn func(context.Context, DedicatedHostListResult) (DedicatedHostListResult, error) 1702 dhlr DedicatedHostListResult 1703} 1704 1705// NextWithContext advances to the next page of values. If there was an error making 1706// the request the page does not advance and the error is returned. 1707func (page *DedicatedHostListResultPage) NextWithContext(ctx context.Context) (err error) { 1708 if tracing.IsEnabled() { 1709 ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostListResultPage.NextWithContext") 1710 defer func() { 1711 sc := -1 1712 if page.Response().Response.Response != nil { 1713 sc = page.Response().Response.Response.StatusCode 1714 } 1715 tracing.EndSpan(ctx, sc, err) 1716 }() 1717 } 1718 for { 1719 next, err := page.fn(ctx, page.dhlr) 1720 if err != nil { 1721 return err 1722 } 1723 page.dhlr = next 1724 if !next.hasNextLink() || !next.IsEmpty() { 1725 break 1726 } 1727 } 1728 return nil 1729} 1730 1731// Next advances to the next page of values. If there was an error making 1732// the request the page does not advance and the error is returned. 1733// Deprecated: Use NextWithContext() instead. 1734func (page *DedicatedHostListResultPage) Next() error { 1735 return page.NextWithContext(context.Background()) 1736} 1737 1738// NotDone returns true if the page enumeration should be started or is not yet complete. 1739func (page DedicatedHostListResultPage) NotDone() bool { 1740 return !page.dhlr.IsEmpty() 1741} 1742 1743// Response returns the raw server response from the last page request. 1744func (page DedicatedHostListResultPage) Response() DedicatedHostListResult { 1745 return page.dhlr 1746} 1747 1748// Values returns the slice of values for the current page or nil if there are no values. 1749func (page DedicatedHostListResultPage) Values() []DedicatedHost { 1750 if page.dhlr.IsEmpty() { 1751 return nil 1752 } 1753 return *page.dhlr.Value 1754} 1755 1756// Creates a new instance of the DedicatedHostListResultPage type. 1757func NewDedicatedHostListResultPage(cur DedicatedHostListResult, getNextPage func(context.Context, DedicatedHostListResult) (DedicatedHostListResult, error)) DedicatedHostListResultPage { 1758 return DedicatedHostListResultPage{ 1759 fn: getNextPage, 1760 dhlr: cur, 1761 } 1762} 1763 1764// DedicatedHostProperties properties of the dedicated host. 1765type DedicatedHostProperties struct { 1766 // PlatformFaultDomain - Fault domain of the dedicated host within a dedicated host group. 1767 PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` 1768 // AutoReplaceOnFailure - Specifies whether the dedicated host should be replaced automatically in case of a failure. The value is defaulted to 'true' when not provided. 1769 AutoReplaceOnFailure *bool `json:"autoReplaceOnFailure,omitempty"` 1770 // 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. 1771 HostID *string `json:"hostId,omitempty"` 1772 // VirtualMachines - READ-ONLY; A list of references to all virtual machines in the Dedicated Host. 1773 VirtualMachines *[]SubResourceReadOnly `json:"virtualMachines,omitempty"` 1774 // 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' 1775 LicenseType DedicatedHostLicenseTypes `json:"licenseType,omitempty"` 1776 // ProvisioningTime - READ-ONLY; The date when the host was first provisioned. 1777 ProvisioningTime *date.Time `json:"provisioningTime,omitempty"` 1778 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 1779 ProvisioningState *string `json:"provisioningState,omitempty"` 1780 // InstanceView - READ-ONLY; The dedicated host instance view. 1781 InstanceView *DedicatedHostInstanceView `json:"instanceView,omitempty"` 1782} 1783 1784// MarshalJSON is the custom marshaler for DedicatedHostProperties. 1785func (dhp DedicatedHostProperties) MarshalJSON() ([]byte, error) { 1786 objectMap := make(map[string]interface{}) 1787 if dhp.PlatformFaultDomain != nil { 1788 objectMap["platformFaultDomain"] = dhp.PlatformFaultDomain 1789 } 1790 if dhp.AutoReplaceOnFailure != nil { 1791 objectMap["autoReplaceOnFailure"] = dhp.AutoReplaceOnFailure 1792 } 1793 if dhp.LicenseType != "" { 1794 objectMap["licenseType"] = dhp.LicenseType 1795 } 1796 return json.Marshal(objectMap) 1797} 1798 1799// DedicatedHostsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 1800// long-running operation. 1801type DedicatedHostsCreateOrUpdateFuture struct { 1802 azure.FutureAPI 1803 // Result returns the result of the asynchronous operation. 1804 // If the operation has not completed it will return an error. 1805 Result func(DedicatedHostsClient) (DedicatedHost, error) 1806} 1807 1808// DedicatedHostsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 1809// operation. 1810type DedicatedHostsDeleteFuture struct { 1811 azure.FutureAPI 1812 // Result returns the result of the asynchronous operation. 1813 // If the operation has not completed it will return an error. 1814 Result func(DedicatedHostsClient) (autorest.Response, error) 1815} 1816 1817// DedicatedHostsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 1818// operation. 1819type DedicatedHostsUpdateFuture struct { 1820 azure.FutureAPI 1821 // Result returns the result of the asynchronous operation. 1822 // If the operation has not completed it will return an error. 1823 Result func(DedicatedHostsClient) (DedicatedHost, error) 1824} 1825 1826// DedicatedHostUpdate specifies information about the dedicated host. Only tags, autoReplaceOnFailure and 1827// licenseType may be updated. 1828type DedicatedHostUpdate struct { 1829 *DedicatedHostProperties `json:"properties,omitempty"` 1830 // Tags - Resource tags 1831 Tags map[string]*string `json:"tags"` 1832} 1833 1834// MarshalJSON is the custom marshaler for DedicatedHostUpdate. 1835func (dhu DedicatedHostUpdate) MarshalJSON() ([]byte, error) { 1836 objectMap := make(map[string]interface{}) 1837 if dhu.DedicatedHostProperties != nil { 1838 objectMap["properties"] = dhu.DedicatedHostProperties 1839 } 1840 if dhu.Tags != nil { 1841 objectMap["tags"] = dhu.Tags 1842 } 1843 return json.Marshal(objectMap) 1844} 1845 1846// UnmarshalJSON is the custom unmarshaler for DedicatedHostUpdate struct. 1847func (dhu *DedicatedHostUpdate) UnmarshalJSON(body []byte) error { 1848 var m map[string]*json.RawMessage 1849 err := json.Unmarshal(body, &m) 1850 if err != nil { 1851 return err 1852 } 1853 for k, v := range m { 1854 switch k { 1855 case "properties": 1856 if v != nil { 1857 var dedicatedHostProperties DedicatedHostProperties 1858 err = json.Unmarshal(*v, &dedicatedHostProperties) 1859 if err != nil { 1860 return err 1861 } 1862 dhu.DedicatedHostProperties = &dedicatedHostProperties 1863 } 1864 case "tags": 1865 if v != nil { 1866 var tags map[string]*string 1867 err = json.Unmarshal(*v, &tags) 1868 if err != nil { 1869 return err 1870 } 1871 dhu.Tags = tags 1872 } 1873 } 1874 } 1875 1876 return nil 1877} 1878 1879// DiagnosticsProfile specifies the boot diagnostic settings state. <br><br>Minimum api-version: 1880// 2015-06-15. 1881type DiagnosticsProfile struct { 1882 // 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. 1883 BootDiagnostics *BootDiagnostics `json:"bootDiagnostics,omitempty"` 1884} 1885 1886// DiffDiskSettings describes the parameters of ephemeral disk settings that can be specified for operating 1887// system disk. <br><br> NOTE: The ephemeral disk settings can only be specified for managed disk. 1888type DiffDiskSettings struct { 1889 // Option - Specifies the ephemeral disk settings for operating system disk. Possible values include: 'Local' 1890 Option DiffDiskOptions `json:"option,omitempty"` 1891} 1892 1893// Disallowed describes the disallowed disk types. 1894type Disallowed struct { 1895 // DiskTypes - A list of disk types. 1896 DiskTypes *[]string `json:"diskTypes,omitempty"` 1897} 1898 1899// Disk disk resource. 1900type Disk struct { 1901 autorest.Response `json:"-"` 1902 // ManagedBy - READ-ONLY; A relative URI containing the ID of the VM that has the disk attached. 1903 ManagedBy *string `json:"managedBy,omitempty"` 1904 Sku *DiskSku `json:"sku,omitempty"` 1905 // Zones - The Logical zone list for Disk. 1906 Zones *[]string `json:"zones,omitempty"` 1907 *DiskProperties `json:"properties,omitempty"` 1908 // ID - READ-ONLY; Resource Id 1909 ID *string `json:"id,omitempty"` 1910 // Name - READ-ONLY; Resource name 1911 Name *string `json:"name,omitempty"` 1912 // Type - READ-ONLY; Resource type 1913 Type *string `json:"type,omitempty"` 1914 // Location - Resource location 1915 Location *string `json:"location,omitempty"` 1916 // Tags - Resource tags 1917 Tags map[string]*string `json:"tags"` 1918} 1919 1920// MarshalJSON is the custom marshaler for Disk. 1921func (d Disk) MarshalJSON() ([]byte, error) { 1922 objectMap := make(map[string]interface{}) 1923 if d.Sku != nil { 1924 objectMap["sku"] = d.Sku 1925 } 1926 if d.Zones != nil { 1927 objectMap["zones"] = d.Zones 1928 } 1929 if d.DiskProperties != nil { 1930 objectMap["properties"] = d.DiskProperties 1931 } 1932 if d.Location != nil { 1933 objectMap["location"] = d.Location 1934 } 1935 if d.Tags != nil { 1936 objectMap["tags"] = d.Tags 1937 } 1938 return json.Marshal(objectMap) 1939} 1940 1941// UnmarshalJSON is the custom unmarshaler for Disk struct. 1942func (d *Disk) UnmarshalJSON(body []byte) error { 1943 var m map[string]*json.RawMessage 1944 err := json.Unmarshal(body, &m) 1945 if err != nil { 1946 return err 1947 } 1948 for k, v := range m { 1949 switch k { 1950 case "managedBy": 1951 if v != nil { 1952 var managedBy string 1953 err = json.Unmarshal(*v, &managedBy) 1954 if err != nil { 1955 return err 1956 } 1957 d.ManagedBy = &managedBy 1958 } 1959 case "sku": 1960 if v != nil { 1961 var sku DiskSku 1962 err = json.Unmarshal(*v, &sku) 1963 if err != nil { 1964 return err 1965 } 1966 d.Sku = &sku 1967 } 1968 case "zones": 1969 if v != nil { 1970 var zones []string 1971 err = json.Unmarshal(*v, &zones) 1972 if err != nil { 1973 return err 1974 } 1975 d.Zones = &zones 1976 } 1977 case "properties": 1978 if v != nil { 1979 var diskProperties DiskProperties 1980 err = json.Unmarshal(*v, &diskProperties) 1981 if err != nil { 1982 return err 1983 } 1984 d.DiskProperties = &diskProperties 1985 } 1986 case "id": 1987 if v != nil { 1988 var ID string 1989 err = json.Unmarshal(*v, &ID) 1990 if err != nil { 1991 return err 1992 } 1993 d.ID = &ID 1994 } 1995 case "name": 1996 if v != nil { 1997 var name string 1998 err = json.Unmarshal(*v, &name) 1999 if err != nil { 2000 return err 2001 } 2002 d.Name = &name 2003 } 2004 case "type": 2005 if v != nil { 2006 var typeVar string 2007 err = json.Unmarshal(*v, &typeVar) 2008 if err != nil { 2009 return err 2010 } 2011 d.Type = &typeVar 2012 } 2013 case "location": 2014 if v != nil { 2015 var location string 2016 err = json.Unmarshal(*v, &location) 2017 if err != nil { 2018 return err 2019 } 2020 d.Location = &location 2021 } 2022 case "tags": 2023 if v != nil { 2024 var tags map[string]*string 2025 err = json.Unmarshal(*v, &tags) 2026 if err != nil { 2027 return err 2028 } 2029 d.Tags = tags 2030 } 2031 } 2032 } 2033 2034 return nil 2035} 2036 2037// DiskEncryptionSet disk encryption set resource. 2038type DiskEncryptionSet struct { 2039 autorest.Response `json:"-"` 2040 Identity *EncryptionSetIdentity `json:"identity,omitempty"` 2041 *EncryptionSetProperties `json:"properties,omitempty"` 2042 // ID - READ-ONLY; Resource Id 2043 ID *string `json:"id,omitempty"` 2044 // Name - READ-ONLY; Resource name 2045 Name *string `json:"name,omitempty"` 2046 // Type - READ-ONLY; Resource type 2047 Type *string `json:"type,omitempty"` 2048 // Location - Resource location 2049 Location *string `json:"location,omitempty"` 2050 // Tags - Resource tags 2051 Tags map[string]*string `json:"tags"` 2052} 2053 2054// MarshalJSON is the custom marshaler for DiskEncryptionSet. 2055func (desVar DiskEncryptionSet) MarshalJSON() ([]byte, error) { 2056 objectMap := make(map[string]interface{}) 2057 if desVar.Identity != nil { 2058 objectMap["identity"] = desVar.Identity 2059 } 2060 if desVar.EncryptionSetProperties != nil { 2061 objectMap["properties"] = desVar.EncryptionSetProperties 2062 } 2063 if desVar.Location != nil { 2064 objectMap["location"] = desVar.Location 2065 } 2066 if desVar.Tags != nil { 2067 objectMap["tags"] = desVar.Tags 2068 } 2069 return json.Marshal(objectMap) 2070} 2071 2072// UnmarshalJSON is the custom unmarshaler for DiskEncryptionSet struct. 2073func (desVar *DiskEncryptionSet) UnmarshalJSON(body []byte) error { 2074 var m map[string]*json.RawMessage 2075 err := json.Unmarshal(body, &m) 2076 if err != nil { 2077 return err 2078 } 2079 for k, v := range m { 2080 switch k { 2081 case "identity": 2082 if v != nil { 2083 var identity EncryptionSetIdentity 2084 err = json.Unmarshal(*v, &identity) 2085 if err != nil { 2086 return err 2087 } 2088 desVar.Identity = &identity 2089 } 2090 case "properties": 2091 if v != nil { 2092 var encryptionSetProperties EncryptionSetProperties 2093 err = json.Unmarshal(*v, &encryptionSetProperties) 2094 if err != nil { 2095 return err 2096 } 2097 desVar.EncryptionSetProperties = &encryptionSetProperties 2098 } 2099 case "id": 2100 if v != nil { 2101 var ID string 2102 err = json.Unmarshal(*v, &ID) 2103 if err != nil { 2104 return err 2105 } 2106 desVar.ID = &ID 2107 } 2108 case "name": 2109 if v != nil { 2110 var name string 2111 err = json.Unmarshal(*v, &name) 2112 if err != nil { 2113 return err 2114 } 2115 desVar.Name = &name 2116 } 2117 case "type": 2118 if v != nil { 2119 var typeVar string 2120 err = json.Unmarshal(*v, &typeVar) 2121 if err != nil { 2122 return err 2123 } 2124 desVar.Type = &typeVar 2125 } 2126 case "location": 2127 if v != nil { 2128 var location string 2129 err = json.Unmarshal(*v, &location) 2130 if err != nil { 2131 return err 2132 } 2133 desVar.Location = &location 2134 } 2135 case "tags": 2136 if v != nil { 2137 var tags map[string]*string 2138 err = json.Unmarshal(*v, &tags) 2139 if err != nil { 2140 return err 2141 } 2142 desVar.Tags = tags 2143 } 2144 } 2145 } 2146 2147 return nil 2148} 2149 2150// DiskEncryptionSetList the List disk encryption set operation response. 2151type DiskEncryptionSetList struct { 2152 autorest.Response `json:"-"` 2153 // Value - A list of disk encryption sets. 2154 Value *[]DiskEncryptionSet `json:"value,omitempty"` 2155 // 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. 2156 NextLink *string `json:"nextLink,omitempty"` 2157} 2158 2159// DiskEncryptionSetListIterator provides access to a complete listing of DiskEncryptionSet values. 2160type DiskEncryptionSetListIterator struct { 2161 i int 2162 page DiskEncryptionSetListPage 2163} 2164 2165// NextWithContext advances to the next value. If there was an error making 2166// the request the iterator does not advance and the error is returned. 2167func (iter *DiskEncryptionSetListIterator) NextWithContext(ctx context.Context) (err error) { 2168 if tracing.IsEnabled() { 2169 ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetListIterator.NextWithContext") 2170 defer func() { 2171 sc := -1 2172 if iter.Response().Response.Response != nil { 2173 sc = iter.Response().Response.Response.StatusCode 2174 } 2175 tracing.EndSpan(ctx, sc, err) 2176 }() 2177 } 2178 iter.i++ 2179 if iter.i < len(iter.page.Values()) { 2180 return nil 2181 } 2182 err = iter.page.NextWithContext(ctx) 2183 if err != nil { 2184 iter.i-- 2185 return err 2186 } 2187 iter.i = 0 2188 return nil 2189} 2190 2191// Next advances to the next value. If there was an error making 2192// the request the iterator does not advance and the error is returned. 2193// Deprecated: Use NextWithContext() instead. 2194func (iter *DiskEncryptionSetListIterator) Next() error { 2195 return iter.NextWithContext(context.Background()) 2196} 2197 2198// NotDone returns true if the enumeration should be started or is not yet complete. 2199func (iter DiskEncryptionSetListIterator) NotDone() bool { 2200 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2201} 2202 2203// Response returns the raw server response from the last page request. 2204func (iter DiskEncryptionSetListIterator) Response() DiskEncryptionSetList { 2205 return iter.page.Response() 2206} 2207 2208// Value returns the current value or a zero-initialized value if the 2209// iterator has advanced beyond the end of the collection. 2210func (iter DiskEncryptionSetListIterator) Value() DiskEncryptionSet { 2211 if !iter.page.NotDone() { 2212 return DiskEncryptionSet{} 2213 } 2214 return iter.page.Values()[iter.i] 2215} 2216 2217// Creates a new instance of the DiskEncryptionSetListIterator type. 2218func NewDiskEncryptionSetListIterator(page DiskEncryptionSetListPage) DiskEncryptionSetListIterator { 2219 return DiskEncryptionSetListIterator{page: page} 2220} 2221 2222// IsEmpty returns true if the ListResult contains no values. 2223func (desl DiskEncryptionSetList) IsEmpty() bool { 2224 return desl.Value == nil || len(*desl.Value) == 0 2225} 2226 2227// hasNextLink returns true if the NextLink is not empty. 2228func (desl DiskEncryptionSetList) hasNextLink() bool { 2229 return desl.NextLink != nil && len(*desl.NextLink) != 0 2230} 2231 2232// diskEncryptionSetListPreparer prepares a request to retrieve the next set of results. 2233// It returns nil if no more results exist. 2234func (desl DiskEncryptionSetList) diskEncryptionSetListPreparer(ctx context.Context) (*http.Request, error) { 2235 if !desl.hasNextLink() { 2236 return nil, nil 2237 } 2238 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2239 autorest.AsJSON(), 2240 autorest.AsGet(), 2241 autorest.WithBaseURL(to.String(desl.NextLink))) 2242} 2243 2244// DiskEncryptionSetListPage contains a page of DiskEncryptionSet values. 2245type DiskEncryptionSetListPage struct { 2246 fn func(context.Context, DiskEncryptionSetList) (DiskEncryptionSetList, error) 2247 desl DiskEncryptionSetList 2248} 2249 2250// NextWithContext advances to the next page of values. If there was an error making 2251// the request the page does not advance and the error is returned. 2252func (page *DiskEncryptionSetListPage) NextWithContext(ctx context.Context) (err error) { 2253 if tracing.IsEnabled() { 2254 ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetListPage.NextWithContext") 2255 defer func() { 2256 sc := -1 2257 if page.Response().Response.Response != nil { 2258 sc = page.Response().Response.Response.StatusCode 2259 } 2260 tracing.EndSpan(ctx, sc, err) 2261 }() 2262 } 2263 for { 2264 next, err := page.fn(ctx, page.desl) 2265 if err != nil { 2266 return err 2267 } 2268 page.desl = next 2269 if !next.hasNextLink() || !next.IsEmpty() { 2270 break 2271 } 2272 } 2273 return nil 2274} 2275 2276// Next advances to the next page of values. If there was an error making 2277// the request the page does not advance and the error is returned. 2278// Deprecated: Use NextWithContext() instead. 2279func (page *DiskEncryptionSetListPage) Next() error { 2280 return page.NextWithContext(context.Background()) 2281} 2282 2283// NotDone returns true if the page enumeration should be started or is not yet complete. 2284func (page DiskEncryptionSetListPage) NotDone() bool { 2285 return !page.desl.IsEmpty() 2286} 2287 2288// Response returns the raw server response from the last page request. 2289func (page DiskEncryptionSetListPage) Response() DiskEncryptionSetList { 2290 return page.desl 2291} 2292 2293// Values returns the slice of values for the current page or nil if there are no values. 2294func (page DiskEncryptionSetListPage) Values() []DiskEncryptionSet { 2295 if page.desl.IsEmpty() { 2296 return nil 2297 } 2298 return *page.desl.Value 2299} 2300 2301// Creates a new instance of the DiskEncryptionSetListPage type. 2302func NewDiskEncryptionSetListPage(cur DiskEncryptionSetList, getNextPage func(context.Context, DiskEncryptionSetList) (DiskEncryptionSetList, error)) DiskEncryptionSetListPage { 2303 return DiskEncryptionSetListPage{ 2304 fn: getNextPage, 2305 desl: cur, 2306 } 2307} 2308 2309// DiskEncryptionSetParameters describes the parameter of customer managed disk encryption set resource id 2310// that can be specified for disk. <br><br> NOTE: The disk encryption set resource id can only be specified 2311// for managed disk. Please refer https://aka.ms/mdssewithcmkoverview for more details. 2312type DiskEncryptionSetParameters struct { 2313 // ID - Resource Id 2314 ID *string `json:"id,omitempty"` 2315} 2316 2317// DiskEncryptionSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 2318// long-running operation. 2319type DiskEncryptionSetsCreateOrUpdateFuture struct { 2320 azure.FutureAPI 2321 // Result returns the result of the asynchronous operation. 2322 // If the operation has not completed it will return an error. 2323 Result func(DiskEncryptionSetsClient) (DiskEncryptionSet, error) 2324} 2325 2326// DiskEncryptionSetsDeleteFuture an abstraction for monitoring and retrieving the results of a 2327// long-running operation. 2328type DiskEncryptionSetsDeleteFuture struct { 2329 azure.FutureAPI 2330 // Result returns the result of the asynchronous operation. 2331 // If the operation has not completed it will return an error. 2332 Result func(DiskEncryptionSetsClient) (autorest.Response, error) 2333} 2334 2335// DiskEncryptionSetsUpdateFuture an abstraction for monitoring and retrieving the results of a 2336// long-running operation. 2337type DiskEncryptionSetsUpdateFuture struct { 2338 azure.FutureAPI 2339 // Result returns the result of the asynchronous operation. 2340 // If the operation has not completed it will return an error. 2341 Result func(DiskEncryptionSetsClient) (DiskEncryptionSet, error) 2342} 2343 2344// DiskEncryptionSettings describes a Encryption Settings for a Disk 2345type DiskEncryptionSettings struct { 2346 // DiskEncryptionKey - Specifies the location of the disk encryption key, which is a Key Vault Secret. 2347 DiskEncryptionKey *KeyVaultSecretReference `json:"diskEncryptionKey,omitempty"` 2348 // KeyEncryptionKey - Specifies the location of the key encryption key in Key Vault. 2349 KeyEncryptionKey *KeyVaultKeyReference `json:"keyEncryptionKey,omitempty"` 2350 // Enabled - Specifies whether disk encryption should be enabled on the virtual machine. 2351 Enabled *bool `json:"enabled,omitempty"` 2352} 2353 2354// DiskEncryptionSetUpdate disk encryption set update resource. 2355type DiskEncryptionSetUpdate struct { 2356 *DiskEncryptionSetUpdateProperties `json:"properties,omitempty"` 2357 // Tags - Resource tags 2358 Tags map[string]*string `json:"tags"` 2359} 2360 2361// MarshalJSON is the custom marshaler for DiskEncryptionSetUpdate. 2362func (desu DiskEncryptionSetUpdate) MarshalJSON() ([]byte, error) { 2363 objectMap := make(map[string]interface{}) 2364 if desu.DiskEncryptionSetUpdateProperties != nil { 2365 objectMap["properties"] = desu.DiskEncryptionSetUpdateProperties 2366 } 2367 if desu.Tags != nil { 2368 objectMap["tags"] = desu.Tags 2369 } 2370 return json.Marshal(objectMap) 2371} 2372 2373// UnmarshalJSON is the custom unmarshaler for DiskEncryptionSetUpdate struct. 2374func (desu *DiskEncryptionSetUpdate) UnmarshalJSON(body []byte) error { 2375 var m map[string]*json.RawMessage 2376 err := json.Unmarshal(body, &m) 2377 if err != nil { 2378 return err 2379 } 2380 for k, v := range m { 2381 switch k { 2382 case "properties": 2383 if v != nil { 2384 var diskEncryptionSetUpdateProperties DiskEncryptionSetUpdateProperties 2385 err = json.Unmarshal(*v, &diskEncryptionSetUpdateProperties) 2386 if err != nil { 2387 return err 2388 } 2389 desu.DiskEncryptionSetUpdateProperties = &diskEncryptionSetUpdateProperties 2390 } 2391 case "tags": 2392 if v != nil { 2393 var tags map[string]*string 2394 err = json.Unmarshal(*v, &tags) 2395 if err != nil { 2396 return err 2397 } 2398 desu.Tags = tags 2399 } 2400 } 2401 } 2402 2403 return nil 2404} 2405 2406// DiskEncryptionSetUpdateProperties disk encryption set resource update properties. 2407type DiskEncryptionSetUpdateProperties struct { 2408 ActiveKey *KeyVaultAndKeyReference `json:"activeKey,omitempty"` 2409} 2410 2411// DiskInstanceView the instance view of the disk. 2412type DiskInstanceView struct { 2413 // Name - The disk name. 2414 Name *string `json:"name,omitempty"` 2415 // EncryptionSettings - Specifies the encryption settings for the OS Disk. <br><br> Minimum api-version: 2015-06-15 2416 EncryptionSettings *[]DiskEncryptionSettings `json:"encryptionSettings,omitempty"` 2417 // Statuses - The resource status information. 2418 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 2419} 2420 2421// DiskList the List Disks operation response. 2422type DiskList struct { 2423 autorest.Response `json:"-"` 2424 // Value - A list of disks. 2425 Value *[]Disk `json:"value,omitempty"` 2426 // NextLink - The uri to fetch the next page of disks. Call ListNext() with this to fetch the next page of disks. 2427 NextLink *string `json:"nextLink,omitempty"` 2428} 2429 2430// DiskListIterator provides access to a complete listing of Disk values. 2431type DiskListIterator struct { 2432 i int 2433 page DiskListPage 2434} 2435 2436// NextWithContext advances to the next value. If there was an error making 2437// the request the iterator does not advance and the error is returned. 2438func (iter *DiskListIterator) NextWithContext(ctx context.Context) (err error) { 2439 if tracing.IsEnabled() { 2440 ctx = tracing.StartSpan(ctx, fqdn+"/DiskListIterator.NextWithContext") 2441 defer func() { 2442 sc := -1 2443 if iter.Response().Response.Response != nil { 2444 sc = iter.Response().Response.Response.StatusCode 2445 } 2446 tracing.EndSpan(ctx, sc, err) 2447 }() 2448 } 2449 iter.i++ 2450 if iter.i < len(iter.page.Values()) { 2451 return nil 2452 } 2453 err = iter.page.NextWithContext(ctx) 2454 if err != nil { 2455 iter.i-- 2456 return err 2457 } 2458 iter.i = 0 2459 return nil 2460} 2461 2462// Next advances to the next value. If there was an error making 2463// the request the iterator does not advance and the error is returned. 2464// Deprecated: Use NextWithContext() instead. 2465func (iter *DiskListIterator) Next() error { 2466 return iter.NextWithContext(context.Background()) 2467} 2468 2469// NotDone returns true if the enumeration should be started or is not yet complete. 2470func (iter DiskListIterator) NotDone() bool { 2471 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2472} 2473 2474// Response returns the raw server response from the last page request. 2475func (iter DiskListIterator) Response() DiskList { 2476 return iter.page.Response() 2477} 2478 2479// Value returns the current value or a zero-initialized value if the 2480// iterator has advanced beyond the end of the collection. 2481func (iter DiskListIterator) Value() Disk { 2482 if !iter.page.NotDone() { 2483 return Disk{} 2484 } 2485 return iter.page.Values()[iter.i] 2486} 2487 2488// Creates a new instance of the DiskListIterator type. 2489func NewDiskListIterator(page DiskListPage) DiskListIterator { 2490 return DiskListIterator{page: page} 2491} 2492 2493// IsEmpty returns true if the ListResult contains no values. 2494func (dl DiskList) IsEmpty() bool { 2495 return dl.Value == nil || len(*dl.Value) == 0 2496} 2497 2498// hasNextLink returns true if the NextLink is not empty. 2499func (dl DiskList) hasNextLink() bool { 2500 return dl.NextLink != nil && len(*dl.NextLink) != 0 2501} 2502 2503// diskListPreparer prepares a request to retrieve the next set of results. 2504// It returns nil if no more results exist. 2505func (dl DiskList) diskListPreparer(ctx context.Context) (*http.Request, error) { 2506 if !dl.hasNextLink() { 2507 return nil, nil 2508 } 2509 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2510 autorest.AsJSON(), 2511 autorest.AsGet(), 2512 autorest.WithBaseURL(to.String(dl.NextLink))) 2513} 2514 2515// DiskListPage contains a page of Disk values. 2516type DiskListPage struct { 2517 fn func(context.Context, DiskList) (DiskList, error) 2518 dl DiskList 2519} 2520 2521// NextWithContext advances to the next page of values. If there was an error making 2522// the request the page does not advance and the error is returned. 2523func (page *DiskListPage) NextWithContext(ctx context.Context) (err error) { 2524 if tracing.IsEnabled() { 2525 ctx = tracing.StartSpan(ctx, fqdn+"/DiskListPage.NextWithContext") 2526 defer func() { 2527 sc := -1 2528 if page.Response().Response.Response != nil { 2529 sc = page.Response().Response.Response.StatusCode 2530 } 2531 tracing.EndSpan(ctx, sc, err) 2532 }() 2533 } 2534 for { 2535 next, err := page.fn(ctx, page.dl) 2536 if err != nil { 2537 return err 2538 } 2539 page.dl = next 2540 if !next.hasNextLink() || !next.IsEmpty() { 2541 break 2542 } 2543 } 2544 return nil 2545} 2546 2547// Next advances to the next page of values. If there was an error making 2548// the request the page does not advance and the error is returned. 2549// Deprecated: Use NextWithContext() instead. 2550func (page *DiskListPage) Next() error { 2551 return page.NextWithContext(context.Background()) 2552} 2553 2554// NotDone returns true if the page enumeration should be started or is not yet complete. 2555func (page DiskListPage) NotDone() bool { 2556 return !page.dl.IsEmpty() 2557} 2558 2559// Response returns the raw server response from the last page request. 2560func (page DiskListPage) Response() DiskList { 2561 return page.dl 2562} 2563 2564// Values returns the slice of values for the current page or nil if there are no values. 2565func (page DiskListPage) Values() []Disk { 2566 if page.dl.IsEmpty() { 2567 return nil 2568 } 2569 return *page.dl.Value 2570} 2571 2572// Creates a new instance of the DiskListPage type. 2573func NewDiskListPage(cur DiskList, getNextPage func(context.Context, DiskList) (DiskList, error)) DiskListPage { 2574 return DiskListPage{ 2575 fn: getNextPage, 2576 dl: cur, 2577 } 2578} 2579 2580// DiskProperties disk resource properties. 2581type DiskProperties struct { 2582 // TimeCreated - READ-ONLY; The time when the disk was created. 2583 TimeCreated *date.Time `json:"timeCreated,omitempty"` 2584 // OsType - The Operating System type. Possible values include: 'Windows', 'Linux' 2585 OsType OperatingSystemTypes `json:"osType,omitempty"` 2586 // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'V1', 'V2' 2587 HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` 2588 // CreationData - Disk source information. CreationData information cannot be changed after the disk has been created. 2589 CreationData *CreationData `json:"creationData,omitempty"` 2590 // 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. 2591 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 2592 // DiskSizeBytes - READ-ONLY; The size of the disk in bytes. This field is read only. 2593 DiskSizeBytes *int64 `json:"diskSizeBytes,omitempty"` 2594 // UniqueID - READ-ONLY; Unique Guid identifying the resource. 2595 UniqueID *string `json:"uniqueId,omitempty"` 2596 // EncryptionSettingsCollection - Encryption settings collection used for Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. 2597 EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` 2598 // ProvisioningState - READ-ONLY; The disk provisioning state. 2599 ProvisioningState *string `json:"provisioningState,omitempty"` 2600 // DiskIOPSReadWrite - The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. 2601 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 2602 // 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. 2603 DiskMBpsReadWrite *int32 `json:"diskMBpsReadWrite,omitempty"` 2604 // DiskState - READ-ONLY; The state of the disk. Possible values include: 'Unattached', 'Attached', 'Reserved', 'ActiveSAS', 'ReadyToUpload', 'ActiveUpload' 2605 DiskState DiskState `json:"diskState,omitempty"` 2606 // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 2607 Encryption *Encryption `json:"encryption,omitempty"` 2608} 2609 2610// MarshalJSON is the custom marshaler for DiskProperties. 2611func (dp DiskProperties) MarshalJSON() ([]byte, error) { 2612 objectMap := make(map[string]interface{}) 2613 if dp.OsType != "" { 2614 objectMap["osType"] = dp.OsType 2615 } 2616 if dp.HyperVGeneration != "" { 2617 objectMap["hyperVGeneration"] = dp.HyperVGeneration 2618 } 2619 if dp.CreationData != nil { 2620 objectMap["creationData"] = dp.CreationData 2621 } 2622 if dp.DiskSizeGB != nil { 2623 objectMap["diskSizeGB"] = dp.DiskSizeGB 2624 } 2625 if dp.EncryptionSettingsCollection != nil { 2626 objectMap["encryptionSettingsCollection"] = dp.EncryptionSettingsCollection 2627 } 2628 if dp.DiskIOPSReadWrite != nil { 2629 objectMap["diskIOPSReadWrite"] = dp.DiskIOPSReadWrite 2630 } 2631 if dp.DiskMBpsReadWrite != nil { 2632 objectMap["diskMBpsReadWrite"] = dp.DiskMBpsReadWrite 2633 } 2634 if dp.Encryption != nil { 2635 objectMap["encryption"] = dp.Encryption 2636 } 2637 return json.Marshal(objectMap) 2638} 2639 2640// DisksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 2641// operation. 2642type DisksCreateOrUpdateFuture struct { 2643 azure.FutureAPI 2644 // Result returns the result of the asynchronous operation. 2645 // If the operation has not completed it will return an error. 2646 Result func(DisksClient) (Disk, error) 2647} 2648 2649// DisksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 2650type DisksDeleteFuture struct { 2651 azure.FutureAPI 2652 // Result returns the result of the asynchronous operation. 2653 // If the operation has not completed it will return an error. 2654 Result func(DisksClient) (autorest.Response, error) 2655} 2656 2657// DisksGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running 2658// operation. 2659type DisksGrantAccessFuture struct { 2660 azure.FutureAPI 2661 // Result returns the result of the asynchronous operation. 2662 // If the operation has not completed it will return an error. 2663 Result func(DisksClient) (AccessURI, error) 2664} 2665 2666// DiskSku the disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, or UltraSSD_LRS. 2667type DiskSku struct { 2668 // Name - The sku name. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS', 'UltraSSDLRS' 2669 Name DiskStorageAccountTypes `json:"name,omitempty"` 2670 // Tier - READ-ONLY; The sku tier. 2671 Tier *string `json:"tier,omitempty"` 2672} 2673 2674// MarshalJSON is the custom marshaler for DiskSku. 2675func (ds DiskSku) MarshalJSON() ([]byte, error) { 2676 objectMap := make(map[string]interface{}) 2677 if ds.Name != "" { 2678 objectMap["name"] = ds.Name 2679 } 2680 return json.Marshal(objectMap) 2681} 2682 2683// DisksRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running 2684// operation. 2685type DisksRevokeAccessFuture struct { 2686 azure.FutureAPI 2687 // Result returns the result of the asynchronous operation. 2688 // If the operation has not completed it will return an error. 2689 Result func(DisksClient) (autorest.Response, error) 2690} 2691 2692// DisksUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. 2693type DisksUpdateFuture struct { 2694 azure.FutureAPI 2695 // Result returns the result of the asynchronous operation. 2696 // If the operation has not completed it will return an error. 2697 Result func(DisksClient) (Disk, error) 2698} 2699 2700// DiskUpdate disk update resource. 2701type DiskUpdate struct { 2702 *DiskUpdateProperties `json:"properties,omitempty"` 2703 // Tags - Resource tags 2704 Tags map[string]*string `json:"tags"` 2705 Sku *DiskSku `json:"sku,omitempty"` 2706} 2707 2708// MarshalJSON is the custom marshaler for DiskUpdate. 2709func (du DiskUpdate) MarshalJSON() ([]byte, error) { 2710 objectMap := make(map[string]interface{}) 2711 if du.DiskUpdateProperties != nil { 2712 objectMap["properties"] = du.DiskUpdateProperties 2713 } 2714 if du.Tags != nil { 2715 objectMap["tags"] = du.Tags 2716 } 2717 if du.Sku != nil { 2718 objectMap["sku"] = du.Sku 2719 } 2720 return json.Marshal(objectMap) 2721} 2722 2723// UnmarshalJSON is the custom unmarshaler for DiskUpdate struct. 2724func (du *DiskUpdate) UnmarshalJSON(body []byte) error { 2725 var m map[string]*json.RawMessage 2726 err := json.Unmarshal(body, &m) 2727 if err != nil { 2728 return err 2729 } 2730 for k, v := range m { 2731 switch k { 2732 case "properties": 2733 if v != nil { 2734 var diskUpdateProperties DiskUpdateProperties 2735 err = json.Unmarshal(*v, &diskUpdateProperties) 2736 if err != nil { 2737 return err 2738 } 2739 du.DiskUpdateProperties = &diskUpdateProperties 2740 } 2741 case "tags": 2742 if v != nil { 2743 var tags map[string]*string 2744 err = json.Unmarshal(*v, &tags) 2745 if err != nil { 2746 return err 2747 } 2748 du.Tags = tags 2749 } 2750 case "sku": 2751 if v != nil { 2752 var sku DiskSku 2753 err = json.Unmarshal(*v, &sku) 2754 if err != nil { 2755 return err 2756 } 2757 du.Sku = &sku 2758 } 2759 } 2760 } 2761 2762 return nil 2763} 2764 2765// DiskUpdateProperties disk resource update properties. 2766type DiskUpdateProperties struct { 2767 // OsType - the Operating System type. Possible values include: 'Windows', 'Linux' 2768 OsType OperatingSystemTypes `json:"osType,omitempty"` 2769 // 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. 2770 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 2771 // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. 2772 EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` 2773 // DiskIOPSReadWrite - The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. 2774 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 2775 // 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. 2776 DiskMBpsReadWrite *int32 `json:"diskMBpsReadWrite,omitempty"` 2777 // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 2778 Encryption *Encryption `json:"encryption,omitempty"` 2779} 2780 2781// Encryption encryption at rest settings for disk or snapshot 2782type Encryption struct { 2783 // DiskEncryptionSetID - ResourceId of the disk encryption set to use for enabling encryption at rest. 2784 DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` 2785 // Type - The type of key used to encrypt the data of the disk. Possible values include: 'EncryptionAtRestWithPlatformKey', 'EncryptionAtRestWithCustomerKey' 2786 Type EncryptionType `json:"type,omitempty"` 2787} 2788 2789// EncryptionSetIdentity the managed identity for the disk encryption set. It should be given permission on 2790// the key vault before it can be used to encrypt disks. 2791type EncryptionSetIdentity struct { 2792 // Type - The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is supported. Possible values include: 'SystemAssigned' 2793 Type DiskEncryptionSetIdentityType `json:"type,omitempty"` 2794 // 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 2795 PrincipalID *string `json:"principalId,omitempty"` 2796 // 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 2797 TenantID *string `json:"tenantId,omitempty"` 2798} 2799 2800// MarshalJSON is the custom marshaler for EncryptionSetIdentity. 2801func (esi EncryptionSetIdentity) MarshalJSON() ([]byte, error) { 2802 objectMap := make(map[string]interface{}) 2803 if esi.Type != "" { 2804 objectMap["type"] = esi.Type 2805 } 2806 return json.Marshal(objectMap) 2807} 2808 2809// EncryptionSetProperties ... 2810type EncryptionSetProperties struct { 2811 // ActiveKey - The key vault key which is currently used by this disk encryption set. 2812 ActiveKey *KeyVaultAndKeyReference `json:"activeKey,omitempty"` 2813 // 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. 2814 PreviousKeys *[]KeyVaultAndKeyReference `json:"previousKeys,omitempty"` 2815 // ProvisioningState - READ-ONLY; The disk encryption set provisioning state. 2816 ProvisioningState *string `json:"provisioningState,omitempty"` 2817} 2818 2819// MarshalJSON is the custom marshaler for EncryptionSetProperties. 2820func (esp EncryptionSetProperties) MarshalJSON() ([]byte, error) { 2821 objectMap := make(map[string]interface{}) 2822 if esp.ActiveKey != nil { 2823 objectMap["activeKey"] = esp.ActiveKey 2824 } 2825 return json.Marshal(objectMap) 2826} 2827 2828// EncryptionSettingsCollection encryption settings for disk or snapshot 2829type EncryptionSettingsCollection struct { 2830 // 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. 2831 Enabled *bool `json:"enabled,omitempty"` 2832 // EncryptionSettings - A collection of encryption settings, one for each disk volume. 2833 EncryptionSettings *[]EncryptionSettingsElement `json:"encryptionSettings,omitempty"` 2834 // 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. 2835 EncryptionSettingsVersion *string `json:"encryptionSettingsVersion,omitempty"` 2836} 2837 2838// EncryptionSettingsElement encryption settings for one disk volume. 2839type EncryptionSettingsElement struct { 2840 // DiskEncryptionKey - Key Vault Secret Url and vault id of the disk encryption key 2841 DiskEncryptionKey *KeyVaultAndSecretReference `json:"diskEncryptionKey,omitempty"` 2842 // 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. 2843 KeyEncryptionKey *KeyVaultAndKeyReference `json:"keyEncryptionKey,omitempty"` 2844} 2845 2846// GalleriesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 2847// operation. 2848type GalleriesCreateOrUpdateFuture struct { 2849 azure.FutureAPI 2850 // Result returns the result of the asynchronous operation. 2851 // If the operation has not completed it will return an error. 2852 Result func(GalleriesClient) (Gallery, error) 2853} 2854 2855// GalleriesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 2856// operation. 2857type GalleriesDeleteFuture struct { 2858 azure.FutureAPI 2859 // Result returns the result of the asynchronous operation. 2860 // If the operation has not completed it will return an error. 2861 Result func(GalleriesClient) (autorest.Response, error) 2862} 2863 2864// GalleriesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 2865// operation. 2866type GalleriesUpdateFuture struct { 2867 azure.FutureAPI 2868 // Result returns the result of the asynchronous operation. 2869 // If the operation has not completed it will return an error. 2870 Result func(GalleriesClient) (Gallery, error) 2871} 2872 2873// Gallery specifies information about the Shared Image Gallery that you want to create or update. 2874type Gallery struct { 2875 autorest.Response `json:"-"` 2876 *GalleryProperties `json:"properties,omitempty"` 2877 // ID - READ-ONLY; Resource Id 2878 ID *string `json:"id,omitempty"` 2879 // Name - READ-ONLY; Resource name 2880 Name *string `json:"name,omitempty"` 2881 // Type - READ-ONLY; Resource type 2882 Type *string `json:"type,omitempty"` 2883 // Location - Resource location 2884 Location *string `json:"location,omitempty"` 2885 // Tags - Resource tags 2886 Tags map[string]*string `json:"tags"` 2887} 2888 2889// MarshalJSON is the custom marshaler for Gallery. 2890func (g Gallery) MarshalJSON() ([]byte, error) { 2891 objectMap := make(map[string]interface{}) 2892 if g.GalleryProperties != nil { 2893 objectMap["properties"] = g.GalleryProperties 2894 } 2895 if g.Location != nil { 2896 objectMap["location"] = g.Location 2897 } 2898 if g.Tags != nil { 2899 objectMap["tags"] = g.Tags 2900 } 2901 return json.Marshal(objectMap) 2902} 2903 2904// UnmarshalJSON is the custom unmarshaler for Gallery struct. 2905func (g *Gallery) UnmarshalJSON(body []byte) error { 2906 var m map[string]*json.RawMessage 2907 err := json.Unmarshal(body, &m) 2908 if err != nil { 2909 return err 2910 } 2911 for k, v := range m { 2912 switch k { 2913 case "properties": 2914 if v != nil { 2915 var galleryProperties GalleryProperties 2916 err = json.Unmarshal(*v, &galleryProperties) 2917 if err != nil { 2918 return err 2919 } 2920 g.GalleryProperties = &galleryProperties 2921 } 2922 case "id": 2923 if v != nil { 2924 var ID string 2925 err = json.Unmarshal(*v, &ID) 2926 if err != nil { 2927 return err 2928 } 2929 g.ID = &ID 2930 } 2931 case "name": 2932 if v != nil { 2933 var name string 2934 err = json.Unmarshal(*v, &name) 2935 if err != nil { 2936 return err 2937 } 2938 g.Name = &name 2939 } 2940 case "type": 2941 if v != nil { 2942 var typeVar string 2943 err = json.Unmarshal(*v, &typeVar) 2944 if err != nil { 2945 return err 2946 } 2947 g.Type = &typeVar 2948 } 2949 case "location": 2950 if v != nil { 2951 var location string 2952 err = json.Unmarshal(*v, &location) 2953 if err != nil { 2954 return err 2955 } 2956 g.Location = &location 2957 } 2958 case "tags": 2959 if v != nil { 2960 var tags map[string]*string 2961 err = json.Unmarshal(*v, &tags) 2962 if err != nil { 2963 return err 2964 } 2965 g.Tags = tags 2966 } 2967 } 2968 } 2969 2970 return nil 2971} 2972 2973// GalleryApplication specifies information about the gallery Application Definition that you want to 2974// create or update. 2975type GalleryApplication struct { 2976 autorest.Response `json:"-"` 2977 *GalleryApplicationProperties `json:"properties,omitempty"` 2978 // ID - READ-ONLY; Resource Id 2979 ID *string `json:"id,omitempty"` 2980 // Name - READ-ONLY; Resource name 2981 Name *string `json:"name,omitempty"` 2982 // Type - READ-ONLY; Resource type 2983 Type *string `json:"type,omitempty"` 2984 // Location - Resource location 2985 Location *string `json:"location,omitempty"` 2986 // Tags - Resource tags 2987 Tags map[string]*string `json:"tags"` 2988} 2989 2990// MarshalJSON is the custom marshaler for GalleryApplication. 2991func (ga GalleryApplication) MarshalJSON() ([]byte, error) { 2992 objectMap := make(map[string]interface{}) 2993 if ga.GalleryApplicationProperties != nil { 2994 objectMap["properties"] = ga.GalleryApplicationProperties 2995 } 2996 if ga.Location != nil { 2997 objectMap["location"] = ga.Location 2998 } 2999 if ga.Tags != nil { 3000 objectMap["tags"] = ga.Tags 3001 } 3002 return json.Marshal(objectMap) 3003} 3004 3005// UnmarshalJSON is the custom unmarshaler for GalleryApplication struct. 3006func (ga *GalleryApplication) UnmarshalJSON(body []byte) error { 3007 var m map[string]*json.RawMessage 3008 err := json.Unmarshal(body, &m) 3009 if err != nil { 3010 return err 3011 } 3012 for k, v := range m { 3013 switch k { 3014 case "properties": 3015 if v != nil { 3016 var galleryApplicationProperties GalleryApplicationProperties 3017 err = json.Unmarshal(*v, &galleryApplicationProperties) 3018 if err != nil { 3019 return err 3020 } 3021 ga.GalleryApplicationProperties = &galleryApplicationProperties 3022 } 3023 case "id": 3024 if v != nil { 3025 var ID string 3026 err = json.Unmarshal(*v, &ID) 3027 if err != nil { 3028 return err 3029 } 3030 ga.ID = &ID 3031 } 3032 case "name": 3033 if v != nil { 3034 var name string 3035 err = json.Unmarshal(*v, &name) 3036 if err != nil { 3037 return err 3038 } 3039 ga.Name = &name 3040 } 3041 case "type": 3042 if v != nil { 3043 var typeVar string 3044 err = json.Unmarshal(*v, &typeVar) 3045 if err != nil { 3046 return err 3047 } 3048 ga.Type = &typeVar 3049 } 3050 case "location": 3051 if v != nil { 3052 var location string 3053 err = json.Unmarshal(*v, &location) 3054 if err != nil { 3055 return err 3056 } 3057 ga.Location = &location 3058 } 3059 case "tags": 3060 if v != nil { 3061 var tags map[string]*string 3062 err = json.Unmarshal(*v, &tags) 3063 if err != nil { 3064 return err 3065 } 3066 ga.Tags = tags 3067 } 3068 } 3069 } 3070 3071 return nil 3072} 3073 3074// GalleryApplicationList the List Gallery Applications operation response. 3075type GalleryApplicationList struct { 3076 autorest.Response `json:"-"` 3077 // Value - A list of Gallery Applications. 3078 Value *[]GalleryApplication `json:"value,omitempty"` 3079 // 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. 3080 NextLink *string `json:"nextLink,omitempty"` 3081} 3082 3083// GalleryApplicationListIterator provides access to a complete listing of GalleryApplication values. 3084type GalleryApplicationListIterator struct { 3085 i int 3086 page GalleryApplicationListPage 3087} 3088 3089// NextWithContext advances to the next value. If there was an error making 3090// the request the iterator does not advance and the error is returned. 3091func (iter *GalleryApplicationListIterator) NextWithContext(ctx context.Context) (err error) { 3092 if tracing.IsEnabled() { 3093 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationListIterator.NextWithContext") 3094 defer func() { 3095 sc := -1 3096 if iter.Response().Response.Response != nil { 3097 sc = iter.Response().Response.Response.StatusCode 3098 } 3099 tracing.EndSpan(ctx, sc, err) 3100 }() 3101 } 3102 iter.i++ 3103 if iter.i < len(iter.page.Values()) { 3104 return nil 3105 } 3106 err = iter.page.NextWithContext(ctx) 3107 if err != nil { 3108 iter.i-- 3109 return err 3110 } 3111 iter.i = 0 3112 return nil 3113} 3114 3115// Next advances to the next value. If there was an error making 3116// the request the iterator does not advance and the error is returned. 3117// Deprecated: Use NextWithContext() instead. 3118func (iter *GalleryApplicationListIterator) Next() error { 3119 return iter.NextWithContext(context.Background()) 3120} 3121 3122// NotDone returns true if the enumeration should be started or is not yet complete. 3123func (iter GalleryApplicationListIterator) NotDone() bool { 3124 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3125} 3126 3127// Response returns the raw server response from the last page request. 3128func (iter GalleryApplicationListIterator) Response() GalleryApplicationList { 3129 return iter.page.Response() 3130} 3131 3132// Value returns the current value or a zero-initialized value if the 3133// iterator has advanced beyond the end of the collection. 3134func (iter GalleryApplicationListIterator) Value() GalleryApplication { 3135 if !iter.page.NotDone() { 3136 return GalleryApplication{} 3137 } 3138 return iter.page.Values()[iter.i] 3139} 3140 3141// Creates a new instance of the GalleryApplicationListIterator type. 3142func NewGalleryApplicationListIterator(page GalleryApplicationListPage) GalleryApplicationListIterator { 3143 return GalleryApplicationListIterator{page: page} 3144} 3145 3146// IsEmpty returns true if the ListResult contains no values. 3147func (gal GalleryApplicationList) IsEmpty() bool { 3148 return gal.Value == nil || len(*gal.Value) == 0 3149} 3150 3151// hasNextLink returns true if the NextLink is not empty. 3152func (gal GalleryApplicationList) hasNextLink() bool { 3153 return gal.NextLink != nil && len(*gal.NextLink) != 0 3154} 3155 3156// galleryApplicationListPreparer prepares a request to retrieve the next set of results. 3157// It returns nil if no more results exist. 3158func (gal GalleryApplicationList) galleryApplicationListPreparer(ctx context.Context) (*http.Request, error) { 3159 if !gal.hasNextLink() { 3160 return nil, nil 3161 } 3162 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3163 autorest.AsJSON(), 3164 autorest.AsGet(), 3165 autorest.WithBaseURL(to.String(gal.NextLink))) 3166} 3167 3168// GalleryApplicationListPage contains a page of GalleryApplication values. 3169type GalleryApplicationListPage struct { 3170 fn func(context.Context, GalleryApplicationList) (GalleryApplicationList, error) 3171 gal GalleryApplicationList 3172} 3173 3174// NextWithContext advances to the next page of values. If there was an error making 3175// the request the page does not advance and the error is returned. 3176func (page *GalleryApplicationListPage) NextWithContext(ctx context.Context) (err error) { 3177 if tracing.IsEnabled() { 3178 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationListPage.NextWithContext") 3179 defer func() { 3180 sc := -1 3181 if page.Response().Response.Response != nil { 3182 sc = page.Response().Response.Response.StatusCode 3183 } 3184 tracing.EndSpan(ctx, sc, err) 3185 }() 3186 } 3187 for { 3188 next, err := page.fn(ctx, page.gal) 3189 if err != nil { 3190 return err 3191 } 3192 page.gal = next 3193 if !next.hasNextLink() || !next.IsEmpty() { 3194 break 3195 } 3196 } 3197 return nil 3198} 3199 3200// Next advances to the next page of values. If there was an error making 3201// the request the page does not advance and the error is returned. 3202// Deprecated: Use NextWithContext() instead. 3203func (page *GalleryApplicationListPage) Next() error { 3204 return page.NextWithContext(context.Background()) 3205} 3206 3207// NotDone returns true if the page enumeration should be started or is not yet complete. 3208func (page GalleryApplicationListPage) NotDone() bool { 3209 return !page.gal.IsEmpty() 3210} 3211 3212// Response returns the raw server response from the last page request. 3213func (page GalleryApplicationListPage) Response() GalleryApplicationList { 3214 return page.gal 3215} 3216 3217// Values returns the slice of values for the current page or nil if there are no values. 3218func (page GalleryApplicationListPage) Values() []GalleryApplication { 3219 if page.gal.IsEmpty() { 3220 return nil 3221 } 3222 return *page.gal.Value 3223} 3224 3225// Creates a new instance of the GalleryApplicationListPage type. 3226func NewGalleryApplicationListPage(cur GalleryApplicationList, getNextPage func(context.Context, GalleryApplicationList) (GalleryApplicationList, error)) GalleryApplicationListPage { 3227 return GalleryApplicationListPage{ 3228 fn: getNextPage, 3229 gal: cur, 3230 } 3231} 3232 3233// GalleryApplicationProperties describes the properties of a gallery Application Definition. 3234type GalleryApplicationProperties struct { 3235 // Description - The description of this gallery Application Definition resource. This property is updatable. 3236 Description *string `json:"description,omitempty"` 3237 // Eula - The Eula agreement for the gallery Application Definition. 3238 Eula *string `json:"eula,omitempty"` 3239 // PrivacyStatementURI - The privacy statement uri. 3240 PrivacyStatementURI *string `json:"privacyStatementUri,omitempty"` 3241 // ReleaseNoteURI - The release note uri. 3242 ReleaseNoteURI *string `json:"releaseNoteUri,omitempty"` 3243 // EndOfLifeDate - The end of life date of the gallery Application Definition. This property can be used for decommissioning purposes. This property is updatable. 3244 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 3245 // 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' 3246 SupportedOSType OperatingSystemTypes `json:"supportedOSType,omitempty"` 3247} 3248 3249// GalleryApplicationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 3250// long-running operation. 3251type GalleryApplicationsCreateOrUpdateFuture struct { 3252 azure.FutureAPI 3253 // Result returns the result of the asynchronous operation. 3254 // If the operation has not completed it will return an error. 3255 Result func(GalleryApplicationsClient) (GalleryApplication, error) 3256} 3257 3258// GalleryApplicationsDeleteFuture an abstraction for monitoring and retrieving the results of a 3259// long-running operation. 3260type GalleryApplicationsDeleteFuture struct { 3261 azure.FutureAPI 3262 // Result returns the result of the asynchronous operation. 3263 // If the operation has not completed it will return an error. 3264 Result func(GalleryApplicationsClient) (autorest.Response, error) 3265} 3266 3267// GalleryApplicationsUpdateFuture an abstraction for monitoring and retrieving the results of a 3268// long-running operation. 3269type GalleryApplicationsUpdateFuture struct { 3270 azure.FutureAPI 3271 // Result returns the result of the asynchronous operation. 3272 // If the operation has not completed it will return an error. 3273 Result func(GalleryApplicationsClient) (GalleryApplication, error) 3274} 3275 3276// GalleryApplicationUpdate specifies information about the gallery Application Definition that you want to 3277// update. 3278type GalleryApplicationUpdate struct { 3279 *GalleryApplicationProperties `json:"properties,omitempty"` 3280 // Tags - Resource tags 3281 Tags map[string]*string `json:"tags"` 3282} 3283 3284// MarshalJSON is the custom marshaler for GalleryApplicationUpdate. 3285func (gau GalleryApplicationUpdate) MarshalJSON() ([]byte, error) { 3286 objectMap := make(map[string]interface{}) 3287 if gau.GalleryApplicationProperties != nil { 3288 objectMap["properties"] = gau.GalleryApplicationProperties 3289 } 3290 if gau.Tags != nil { 3291 objectMap["tags"] = gau.Tags 3292 } 3293 return json.Marshal(objectMap) 3294} 3295 3296// UnmarshalJSON is the custom unmarshaler for GalleryApplicationUpdate struct. 3297func (gau *GalleryApplicationUpdate) UnmarshalJSON(body []byte) error { 3298 var m map[string]*json.RawMessage 3299 err := json.Unmarshal(body, &m) 3300 if err != nil { 3301 return err 3302 } 3303 for k, v := range m { 3304 switch k { 3305 case "properties": 3306 if v != nil { 3307 var galleryApplicationProperties GalleryApplicationProperties 3308 err = json.Unmarshal(*v, &galleryApplicationProperties) 3309 if err != nil { 3310 return err 3311 } 3312 gau.GalleryApplicationProperties = &galleryApplicationProperties 3313 } 3314 case "tags": 3315 if v != nil { 3316 var tags map[string]*string 3317 err = json.Unmarshal(*v, &tags) 3318 if err != nil { 3319 return err 3320 } 3321 gau.Tags = tags 3322 } 3323 } 3324 } 3325 3326 return nil 3327} 3328 3329// GalleryApplicationVersion specifies information about the gallery Application Version that you want to 3330// create or update. 3331type GalleryApplicationVersion struct { 3332 autorest.Response `json:"-"` 3333 *GalleryApplicationVersionProperties `json:"properties,omitempty"` 3334 // ID - READ-ONLY; Resource Id 3335 ID *string `json:"id,omitempty"` 3336 // Name - READ-ONLY; Resource name 3337 Name *string `json:"name,omitempty"` 3338 // Type - READ-ONLY; Resource type 3339 Type *string `json:"type,omitempty"` 3340 // Location - Resource location 3341 Location *string `json:"location,omitempty"` 3342 // Tags - Resource tags 3343 Tags map[string]*string `json:"tags"` 3344} 3345 3346// MarshalJSON is the custom marshaler for GalleryApplicationVersion. 3347func (gav GalleryApplicationVersion) MarshalJSON() ([]byte, error) { 3348 objectMap := make(map[string]interface{}) 3349 if gav.GalleryApplicationVersionProperties != nil { 3350 objectMap["properties"] = gav.GalleryApplicationVersionProperties 3351 } 3352 if gav.Location != nil { 3353 objectMap["location"] = gav.Location 3354 } 3355 if gav.Tags != nil { 3356 objectMap["tags"] = gav.Tags 3357 } 3358 return json.Marshal(objectMap) 3359} 3360 3361// UnmarshalJSON is the custom unmarshaler for GalleryApplicationVersion struct. 3362func (gav *GalleryApplicationVersion) UnmarshalJSON(body []byte) error { 3363 var m map[string]*json.RawMessage 3364 err := json.Unmarshal(body, &m) 3365 if err != nil { 3366 return err 3367 } 3368 for k, v := range m { 3369 switch k { 3370 case "properties": 3371 if v != nil { 3372 var galleryApplicationVersionProperties GalleryApplicationVersionProperties 3373 err = json.Unmarshal(*v, &galleryApplicationVersionProperties) 3374 if err != nil { 3375 return err 3376 } 3377 gav.GalleryApplicationVersionProperties = &galleryApplicationVersionProperties 3378 } 3379 case "id": 3380 if v != nil { 3381 var ID string 3382 err = json.Unmarshal(*v, &ID) 3383 if err != nil { 3384 return err 3385 } 3386 gav.ID = &ID 3387 } 3388 case "name": 3389 if v != nil { 3390 var name string 3391 err = json.Unmarshal(*v, &name) 3392 if err != nil { 3393 return err 3394 } 3395 gav.Name = &name 3396 } 3397 case "type": 3398 if v != nil { 3399 var typeVar string 3400 err = json.Unmarshal(*v, &typeVar) 3401 if err != nil { 3402 return err 3403 } 3404 gav.Type = &typeVar 3405 } 3406 case "location": 3407 if v != nil { 3408 var location string 3409 err = json.Unmarshal(*v, &location) 3410 if err != nil { 3411 return err 3412 } 3413 gav.Location = &location 3414 } 3415 case "tags": 3416 if v != nil { 3417 var tags map[string]*string 3418 err = json.Unmarshal(*v, &tags) 3419 if err != nil { 3420 return err 3421 } 3422 gav.Tags = tags 3423 } 3424 } 3425 } 3426 3427 return nil 3428} 3429 3430// GalleryApplicationVersionList the List Gallery Application version operation response. 3431type GalleryApplicationVersionList struct { 3432 autorest.Response `json:"-"` 3433 // Value - A list of gallery Application Versions. 3434 Value *[]GalleryApplicationVersion `json:"value,omitempty"` 3435 // 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. 3436 NextLink *string `json:"nextLink,omitempty"` 3437} 3438 3439// GalleryApplicationVersionListIterator provides access to a complete listing of GalleryApplicationVersion 3440// values. 3441type GalleryApplicationVersionListIterator struct { 3442 i int 3443 page GalleryApplicationVersionListPage 3444} 3445 3446// NextWithContext advances to the next value. If there was an error making 3447// the request the iterator does not advance and the error is returned. 3448func (iter *GalleryApplicationVersionListIterator) NextWithContext(ctx context.Context) (err error) { 3449 if tracing.IsEnabled() { 3450 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionListIterator.NextWithContext") 3451 defer func() { 3452 sc := -1 3453 if iter.Response().Response.Response != nil { 3454 sc = iter.Response().Response.Response.StatusCode 3455 } 3456 tracing.EndSpan(ctx, sc, err) 3457 }() 3458 } 3459 iter.i++ 3460 if iter.i < len(iter.page.Values()) { 3461 return nil 3462 } 3463 err = iter.page.NextWithContext(ctx) 3464 if err != nil { 3465 iter.i-- 3466 return err 3467 } 3468 iter.i = 0 3469 return nil 3470} 3471 3472// Next advances to the next value. If there was an error making 3473// the request the iterator does not advance and the error is returned. 3474// Deprecated: Use NextWithContext() instead. 3475func (iter *GalleryApplicationVersionListIterator) Next() error { 3476 return iter.NextWithContext(context.Background()) 3477} 3478 3479// NotDone returns true if the enumeration should be started or is not yet complete. 3480func (iter GalleryApplicationVersionListIterator) NotDone() bool { 3481 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3482} 3483 3484// Response returns the raw server response from the last page request. 3485func (iter GalleryApplicationVersionListIterator) Response() GalleryApplicationVersionList { 3486 return iter.page.Response() 3487} 3488 3489// Value returns the current value or a zero-initialized value if the 3490// iterator has advanced beyond the end of the collection. 3491func (iter GalleryApplicationVersionListIterator) Value() GalleryApplicationVersion { 3492 if !iter.page.NotDone() { 3493 return GalleryApplicationVersion{} 3494 } 3495 return iter.page.Values()[iter.i] 3496} 3497 3498// Creates a new instance of the GalleryApplicationVersionListIterator type. 3499func NewGalleryApplicationVersionListIterator(page GalleryApplicationVersionListPage) GalleryApplicationVersionListIterator { 3500 return GalleryApplicationVersionListIterator{page: page} 3501} 3502 3503// IsEmpty returns true if the ListResult contains no values. 3504func (gavl GalleryApplicationVersionList) IsEmpty() bool { 3505 return gavl.Value == nil || len(*gavl.Value) == 0 3506} 3507 3508// hasNextLink returns true if the NextLink is not empty. 3509func (gavl GalleryApplicationVersionList) hasNextLink() bool { 3510 return gavl.NextLink != nil && len(*gavl.NextLink) != 0 3511} 3512 3513// galleryApplicationVersionListPreparer prepares a request to retrieve the next set of results. 3514// It returns nil if no more results exist. 3515func (gavl GalleryApplicationVersionList) galleryApplicationVersionListPreparer(ctx context.Context) (*http.Request, error) { 3516 if !gavl.hasNextLink() { 3517 return nil, nil 3518 } 3519 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3520 autorest.AsJSON(), 3521 autorest.AsGet(), 3522 autorest.WithBaseURL(to.String(gavl.NextLink))) 3523} 3524 3525// GalleryApplicationVersionListPage contains a page of GalleryApplicationVersion values. 3526type GalleryApplicationVersionListPage struct { 3527 fn func(context.Context, GalleryApplicationVersionList) (GalleryApplicationVersionList, error) 3528 gavl GalleryApplicationVersionList 3529} 3530 3531// NextWithContext advances to the next page of values. If there was an error making 3532// the request the page does not advance and the error is returned. 3533func (page *GalleryApplicationVersionListPage) NextWithContext(ctx context.Context) (err error) { 3534 if tracing.IsEnabled() { 3535 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionListPage.NextWithContext") 3536 defer func() { 3537 sc := -1 3538 if page.Response().Response.Response != nil { 3539 sc = page.Response().Response.Response.StatusCode 3540 } 3541 tracing.EndSpan(ctx, sc, err) 3542 }() 3543 } 3544 for { 3545 next, err := page.fn(ctx, page.gavl) 3546 if err != nil { 3547 return err 3548 } 3549 page.gavl = next 3550 if !next.hasNextLink() || !next.IsEmpty() { 3551 break 3552 } 3553 } 3554 return nil 3555} 3556 3557// Next advances to the next page of values. If there was an error making 3558// the request the page does not advance and the error is returned. 3559// Deprecated: Use NextWithContext() instead. 3560func (page *GalleryApplicationVersionListPage) Next() error { 3561 return page.NextWithContext(context.Background()) 3562} 3563 3564// NotDone returns true if the page enumeration should be started or is not yet complete. 3565func (page GalleryApplicationVersionListPage) NotDone() bool { 3566 return !page.gavl.IsEmpty() 3567} 3568 3569// Response returns the raw server response from the last page request. 3570func (page GalleryApplicationVersionListPage) Response() GalleryApplicationVersionList { 3571 return page.gavl 3572} 3573 3574// Values returns the slice of values for the current page or nil if there are no values. 3575func (page GalleryApplicationVersionListPage) Values() []GalleryApplicationVersion { 3576 if page.gavl.IsEmpty() { 3577 return nil 3578 } 3579 return *page.gavl.Value 3580} 3581 3582// Creates a new instance of the GalleryApplicationVersionListPage type. 3583func NewGalleryApplicationVersionListPage(cur GalleryApplicationVersionList, getNextPage func(context.Context, GalleryApplicationVersionList) (GalleryApplicationVersionList, error)) GalleryApplicationVersionListPage { 3584 return GalleryApplicationVersionListPage{ 3585 fn: getNextPage, 3586 gavl: cur, 3587 } 3588} 3589 3590// GalleryApplicationVersionProperties describes the properties of a gallery Image Version. 3591type GalleryApplicationVersionProperties struct { 3592 PublishingProfile *GalleryApplicationVersionPublishingProfile `json:"publishingProfile,omitempty"` 3593 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningState1Creating', 'ProvisioningState1Updating', 'ProvisioningState1Failed', 'ProvisioningState1Succeeded', 'ProvisioningState1Deleting', 'ProvisioningState1Migrating' 3594 ProvisioningState ProvisioningState1 `json:"provisioningState,omitempty"` 3595 // ReplicationStatus - READ-ONLY 3596 ReplicationStatus *ReplicationStatus `json:"replicationStatus,omitempty"` 3597} 3598 3599// MarshalJSON is the custom marshaler for GalleryApplicationVersionProperties. 3600func (gavp GalleryApplicationVersionProperties) MarshalJSON() ([]byte, error) { 3601 objectMap := make(map[string]interface{}) 3602 if gavp.PublishingProfile != nil { 3603 objectMap["publishingProfile"] = gavp.PublishingProfile 3604 } 3605 return json.Marshal(objectMap) 3606} 3607 3608// GalleryApplicationVersionPublishingProfile the publishing profile of a gallery Image Version. 3609type GalleryApplicationVersionPublishingProfile struct { 3610 Source *UserArtifactSource `json:"source,omitempty"` 3611 // ContentType - Optional. May be used to help process this file. The type of file contained in the source, e.g. zip, json, etc. 3612 ContentType *string `json:"contentType,omitempty"` 3613 // EnableHealthCheck - Optional. Whether or not this application reports health. 3614 EnableHealthCheck *bool `json:"enableHealthCheck,omitempty"` 3615 // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. 3616 TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` 3617 // 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. 3618 ReplicaCount *int32 `json:"replicaCount,omitempty"` 3619 // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. 3620 ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` 3621 // PublishedDate - READ-ONLY; The timestamp for when the gallery Image Version is published. 3622 PublishedDate *date.Time `json:"publishedDate,omitempty"` 3623 // EndOfLifeDate - The end of life date of the gallery Image Version. This property can be used for decommissioning purposes. This property is updatable. 3624 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 3625 // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS' 3626 StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` 3627} 3628 3629// MarshalJSON is the custom marshaler for GalleryApplicationVersionPublishingProfile. 3630func (gavpp GalleryApplicationVersionPublishingProfile) MarshalJSON() ([]byte, error) { 3631 objectMap := make(map[string]interface{}) 3632 if gavpp.Source != nil { 3633 objectMap["source"] = gavpp.Source 3634 } 3635 if gavpp.ContentType != nil { 3636 objectMap["contentType"] = gavpp.ContentType 3637 } 3638 if gavpp.EnableHealthCheck != nil { 3639 objectMap["enableHealthCheck"] = gavpp.EnableHealthCheck 3640 } 3641 if gavpp.TargetRegions != nil { 3642 objectMap["targetRegions"] = gavpp.TargetRegions 3643 } 3644 if gavpp.ReplicaCount != nil { 3645 objectMap["replicaCount"] = gavpp.ReplicaCount 3646 } 3647 if gavpp.ExcludeFromLatest != nil { 3648 objectMap["excludeFromLatest"] = gavpp.ExcludeFromLatest 3649 } 3650 if gavpp.EndOfLifeDate != nil { 3651 objectMap["endOfLifeDate"] = gavpp.EndOfLifeDate 3652 } 3653 if gavpp.StorageAccountType != "" { 3654 objectMap["storageAccountType"] = gavpp.StorageAccountType 3655 } 3656 return json.Marshal(objectMap) 3657} 3658 3659// GalleryApplicationVersionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results 3660// of a long-running operation. 3661type GalleryApplicationVersionsCreateOrUpdateFuture struct { 3662 azure.FutureAPI 3663 // Result returns the result of the asynchronous operation. 3664 // If the operation has not completed it will return an error. 3665 Result func(GalleryApplicationVersionsClient) (GalleryApplicationVersion, error) 3666} 3667 3668// GalleryApplicationVersionsDeleteFuture an abstraction for monitoring and retrieving the results of a 3669// long-running operation. 3670type GalleryApplicationVersionsDeleteFuture struct { 3671 azure.FutureAPI 3672 // Result returns the result of the asynchronous operation. 3673 // If the operation has not completed it will return an error. 3674 Result func(GalleryApplicationVersionsClient) (autorest.Response, error) 3675} 3676 3677// GalleryApplicationVersionsUpdateFuture an abstraction for monitoring and retrieving the results of a 3678// long-running operation. 3679type GalleryApplicationVersionsUpdateFuture struct { 3680 azure.FutureAPI 3681 // Result returns the result of the asynchronous operation. 3682 // If the operation has not completed it will return an error. 3683 Result func(GalleryApplicationVersionsClient) (GalleryApplicationVersion, error) 3684} 3685 3686// GalleryApplicationVersionUpdate specifies information about the gallery Application Version that you 3687// want to update. 3688type GalleryApplicationVersionUpdate struct { 3689 *GalleryApplicationVersionProperties `json:"properties,omitempty"` 3690 // Tags - Resource tags 3691 Tags map[string]*string `json:"tags"` 3692} 3693 3694// MarshalJSON is the custom marshaler for GalleryApplicationVersionUpdate. 3695func (gavu GalleryApplicationVersionUpdate) MarshalJSON() ([]byte, error) { 3696 objectMap := make(map[string]interface{}) 3697 if gavu.GalleryApplicationVersionProperties != nil { 3698 objectMap["properties"] = gavu.GalleryApplicationVersionProperties 3699 } 3700 if gavu.Tags != nil { 3701 objectMap["tags"] = gavu.Tags 3702 } 3703 return json.Marshal(objectMap) 3704} 3705 3706// UnmarshalJSON is the custom unmarshaler for GalleryApplicationVersionUpdate struct. 3707func (gavu *GalleryApplicationVersionUpdate) UnmarshalJSON(body []byte) error { 3708 var m map[string]*json.RawMessage 3709 err := json.Unmarshal(body, &m) 3710 if err != nil { 3711 return err 3712 } 3713 for k, v := range m { 3714 switch k { 3715 case "properties": 3716 if v != nil { 3717 var galleryApplicationVersionProperties GalleryApplicationVersionProperties 3718 err = json.Unmarshal(*v, &galleryApplicationVersionProperties) 3719 if err != nil { 3720 return err 3721 } 3722 gavu.GalleryApplicationVersionProperties = &galleryApplicationVersionProperties 3723 } 3724 case "tags": 3725 if v != nil { 3726 var tags map[string]*string 3727 err = json.Unmarshal(*v, &tags) 3728 if err != nil { 3729 return err 3730 } 3731 gavu.Tags = tags 3732 } 3733 } 3734 } 3735 3736 return nil 3737} 3738 3739// GalleryArtifactPublishingProfileBase describes the basic gallery artifact publishing profile. 3740type GalleryArtifactPublishingProfileBase struct { 3741 // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. 3742 TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` 3743 // 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. 3744 ReplicaCount *int32 `json:"replicaCount,omitempty"` 3745 // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. 3746 ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` 3747 // PublishedDate - READ-ONLY; The timestamp for when the gallery Image Version is published. 3748 PublishedDate *date.Time `json:"publishedDate,omitempty"` 3749 // EndOfLifeDate - The end of life date of the gallery Image Version. This property can be used for decommissioning purposes. This property is updatable. 3750 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 3751 // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS' 3752 StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` 3753} 3754 3755// MarshalJSON is the custom marshaler for GalleryArtifactPublishingProfileBase. 3756func (gappb GalleryArtifactPublishingProfileBase) MarshalJSON() ([]byte, error) { 3757 objectMap := make(map[string]interface{}) 3758 if gappb.TargetRegions != nil { 3759 objectMap["targetRegions"] = gappb.TargetRegions 3760 } 3761 if gappb.ReplicaCount != nil { 3762 objectMap["replicaCount"] = gappb.ReplicaCount 3763 } 3764 if gappb.ExcludeFromLatest != nil { 3765 objectMap["excludeFromLatest"] = gappb.ExcludeFromLatest 3766 } 3767 if gappb.EndOfLifeDate != nil { 3768 objectMap["endOfLifeDate"] = gappb.EndOfLifeDate 3769 } 3770 if gappb.StorageAccountType != "" { 3771 objectMap["storageAccountType"] = gappb.StorageAccountType 3772 } 3773 return json.Marshal(objectMap) 3774} 3775 3776// GalleryArtifactSource the source image from which the Image Version is going to be created. 3777type GalleryArtifactSource struct { 3778 ManagedImage *ManagedArtifact `json:"managedImage,omitempty"` 3779} 3780 3781// GalleryArtifactVersionSource the gallery artifact version source. 3782type GalleryArtifactVersionSource struct { 3783 // ID - The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, or user image. 3784 ID *string `json:"id,omitempty"` 3785} 3786 3787// GalleryDataDiskImage this is the data disk image. 3788type GalleryDataDiskImage struct { 3789 // 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. 3790 Lun *int32 `json:"lun,omitempty"` 3791 // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. 3792 SizeInGB *int32 `json:"sizeInGB,omitempty"` 3793 // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' 3794 HostCaching HostCaching `json:"hostCaching,omitempty"` 3795 Source *GalleryArtifactVersionSource `json:"source,omitempty"` 3796} 3797 3798// MarshalJSON is the custom marshaler for GalleryDataDiskImage. 3799func (gddi GalleryDataDiskImage) MarshalJSON() ([]byte, error) { 3800 objectMap := make(map[string]interface{}) 3801 if gddi.Lun != nil { 3802 objectMap["lun"] = gddi.Lun 3803 } 3804 if gddi.HostCaching != "" { 3805 objectMap["hostCaching"] = gddi.HostCaching 3806 } 3807 if gddi.Source != nil { 3808 objectMap["source"] = gddi.Source 3809 } 3810 return json.Marshal(objectMap) 3811} 3812 3813// GalleryDiskImage this is the disk image base class. 3814type GalleryDiskImage struct { 3815 // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. 3816 SizeInGB *int32 `json:"sizeInGB,omitempty"` 3817 // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' 3818 HostCaching HostCaching `json:"hostCaching,omitempty"` 3819 Source *GalleryArtifactVersionSource `json:"source,omitempty"` 3820} 3821 3822// MarshalJSON is the custom marshaler for GalleryDiskImage. 3823func (gdi GalleryDiskImage) MarshalJSON() ([]byte, error) { 3824 objectMap := make(map[string]interface{}) 3825 if gdi.HostCaching != "" { 3826 objectMap["hostCaching"] = gdi.HostCaching 3827 } 3828 if gdi.Source != nil { 3829 objectMap["source"] = gdi.Source 3830 } 3831 return json.Marshal(objectMap) 3832} 3833 3834// GalleryIdentifier describes the gallery unique name. 3835type GalleryIdentifier struct { 3836 // UniqueName - READ-ONLY; The unique name of the Shared Image Gallery. This name is generated automatically by Azure. 3837 UniqueName *string `json:"uniqueName,omitempty"` 3838} 3839 3840// GalleryImage specifies information about the gallery Image Definition that you want to create or update. 3841type GalleryImage struct { 3842 autorest.Response `json:"-"` 3843 *GalleryImageProperties `json:"properties,omitempty"` 3844 // ID - READ-ONLY; Resource Id 3845 ID *string `json:"id,omitempty"` 3846 // Name - READ-ONLY; Resource name 3847 Name *string `json:"name,omitempty"` 3848 // Type - READ-ONLY; Resource type 3849 Type *string `json:"type,omitempty"` 3850 // Location - Resource location 3851 Location *string `json:"location,omitempty"` 3852 // Tags - Resource tags 3853 Tags map[string]*string `json:"tags"` 3854} 3855 3856// MarshalJSON is the custom marshaler for GalleryImage. 3857func (gi GalleryImage) MarshalJSON() ([]byte, error) { 3858 objectMap := make(map[string]interface{}) 3859 if gi.GalleryImageProperties != nil { 3860 objectMap["properties"] = gi.GalleryImageProperties 3861 } 3862 if gi.Location != nil { 3863 objectMap["location"] = gi.Location 3864 } 3865 if gi.Tags != nil { 3866 objectMap["tags"] = gi.Tags 3867 } 3868 return json.Marshal(objectMap) 3869} 3870 3871// UnmarshalJSON is the custom unmarshaler for GalleryImage struct. 3872func (gi *GalleryImage) UnmarshalJSON(body []byte) error { 3873 var m map[string]*json.RawMessage 3874 err := json.Unmarshal(body, &m) 3875 if err != nil { 3876 return err 3877 } 3878 for k, v := range m { 3879 switch k { 3880 case "properties": 3881 if v != nil { 3882 var galleryImageProperties GalleryImageProperties 3883 err = json.Unmarshal(*v, &galleryImageProperties) 3884 if err != nil { 3885 return err 3886 } 3887 gi.GalleryImageProperties = &galleryImageProperties 3888 } 3889 case "id": 3890 if v != nil { 3891 var ID string 3892 err = json.Unmarshal(*v, &ID) 3893 if err != nil { 3894 return err 3895 } 3896 gi.ID = &ID 3897 } 3898 case "name": 3899 if v != nil { 3900 var name string 3901 err = json.Unmarshal(*v, &name) 3902 if err != nil { 3903 return err 3904 } 3905 gi.Name = &name 3906 } 3907 case "type": 3908 if v != nil { 3909 var typeVar string 3910 err = json.Unmarshal(*v, &typeVar) 3911 if err != nil { 3912 return err 3913 } 3914 gi.Type = &typeVar 3915 } 3916 case "location": 3917 if v != nil { 3918 var location string 3919 err = json.Unmarshal(*v, &location) 3920 if err != nil { 3921 return err 3922 } 3923 gi.Location = &location 3924 } 3925 case "tags": 3926 if v != nil { 3927 var tags map[string]*string 3928 err = json.Unmarshal(*v, &tags) 3929 if err != nil { 3930 return err 3931 } 3932 gi.Tags = tags 3933 } 3934 } 3935 } 3936 3937 return nil 3938} 3939 3940// GalleryImageIdentifier this is the gallery Image Definition identifier. 3941type GalleryImageIdentifier struct { 3942 // Publisher - The name of the gallery Image Definition publisher. 3943 Publisher *string `json:"publisher,omitempty"` 3944 // Offer - The name of the gallery Image Definition offer. 3945 Offer *string `json:"offer,omitempty"` 3946 // Sku - The name of the gallery Image Definition SKU. 3947 Sku *string `json:"sku,omitempty"` 3948} 3949 3950// GalleryImageList the List Gallery Images operation response. 3951type GalleryImageList struct { 3952 autorest.Response `json:"-"` 3953 // Value - A list of Shared Image Gallery images. 3954 Value *[]GalleryImage `json:"value,omitempty"` 3955 // 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. 3956 NextLink *string `json:"nextLink,omitempty"` 3957} 3958 3959// GalleryImageListIterator provides access to a complete listing of GalleryImage values. 3960type GalleryImageListIterator struct { 3961 i int 3962 page GalleryImageListPage 3963} 3964 3965// NextWithContext advances to the next value. If there was an error making 3966// the request the iterator does not advance and the error is returned. 3967func (iter *GalleryImageListIterator) NextWithContext(ctx context.Context) (err error) { 3968 if tracing.IsEnabled() { 3969 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageListIterator.NextWithContext") 3970 defer func() { 3971 sc := -1 3972 if iter.Response().Response.Response != nil { 3973 sc = iter.Response().Response.Response.StatusCode 3974 } 3975 tracing.EndSpan(ctx, sc, err) 3976 }() 3977 } 3978 iter.i++ 3979 if iter.i < len(iter.page.Values()) { 3980 return nil 3981 } 3982 err = iter.page.NextWithContext(ctx) 3983 if err != nil { 3984 iter.i-- 3985 return err 3986 } 3987 iter.i = 0 3988 return nil 3989} 3990 3991// Next advances to the next value. If there was an error making 3992// the request the iterator does not advance and the error is returned. 3993// Deprecated: Use NextWithContext() instead. 3994func (iter *GalleryImageListIterator) Next() error { 3995 return iter.NextWithContext(context.Background()) 3996} 3997 3998// NotDone returns true if the enumeration should be started or is not yet complete. 3999func (iter GalleryImageListIterator) NotDone() bool { 4000 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4001} 4002 4003// Response returns the raw server response from the last page request. 4004func (iter GalleryImageListIterator) Response() GalleryImageList { 4005 return iter.page.Response() 4006} 4007 4008// Value returns the current value or a zero-initialized value if the 4009// iterator has advanced beyond the end of the collection. 4010func (iter GalleryImageListIterator) Value() GalleryImage { 4011 if !iter.page.NotDone() { 4012 return GalleryImage{} 4013 } 4014 return iter.page.Values()[iter.i] 4015} 4016 4017// Creates a new instance of the GalleryImageListIterator type. 4018func NewGalleryImageListIterator(page GalleryImageListPage) GalleryImageListIterator { 4019 return GalleryImageListIterator{page: page} 4020} 4021 4022// IsEmpty returns true if the ListResult contains no values. 4023func (gil GalleryImageList) IsEmpty() bool { 4024 return gil.Value == nil || len(*gil.Value) == 0 4025} 4026 4027// hasNextLink returns true if the NextLink is not empty. 4028func (gil GalleryImageList) hasNextLink() bool { 4029 return gil.NextLink != nil && len(*gil.NextLink) != 0 4030} 4031 4032// galleryImageListPreparer prepares a request to retrieve the next set of results. 4033// It returns nil if no more results exist. 4034func (gil GalleryImageList) galleryImageListPreparer(ctx context.Context) (*http.Request, error) { 4035 if !gil.hasNextLink() { 4036 return nil, nil 4037 } 4038 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4039 autorest.AsJSON(), 4040 autorest.AsGet(), 4041 autorest.WithBaseURL(to.String(gil.NextLink))) 4042} 4043 4044// GalleryImageListPage contains a page of GalleryImage values. 4045type GalleryImageListPage struct { 4046 fn func(context.Context, GalleryImageList) (GalleryImageList, error) 4047 gil GalleryImageList 4048} 4049 4050// NextWithContext advances to the next page of values. If there was an error making 4051// the request the page does not advance and the error is returned. 4052func (page *GalleryImageListPage) NextWithContext(ctx context.Context) (err error) { 4053 if tracing.IsEnabled() { 4054 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageListPage.NextWithContext") 4055 defer func() { 4056 sc := -1 4057 if page.Response().Response.Response != nil { 4058 sc = page.Response().Response.Response.StatusCode 4059 } 4060 tracing.EndSpan(ctx, sc, err) 4061 }() 4062 } 4063 for { 4064 next, err := page.fn(ctx, page.gil) 4065 if err != nil { 4066 return err 4067 } 4068 page.gil = next 4069 if !next.hasNextLink() || !next.IsEmpty() { 4070 break 4071 } 4072 } 4073 return nil 4074} 4075 4076// Next advances to the next page of values. If there was an error making 4077// the request the page does not advance and the error is returned. 4078// Deprecated: Use NextWithContext() instead. 4079func (page *GalleryImageListPage) Next() error { 4080 return page.NextWithContext(context.Background()) 4081} 4082 4083// NotDone returns true if the page enumeration should be started or is not yet complete. 4084func (page GalleryImageListPage) NotDone() bool { 4085 return !page.gil.IsEmpty() 4086} 4087 4088// Response returns the raw server response from the last page request. 4089func (page GalleryImageListPage) Response() GalleryImageList { 4090 return page.gil 4091} 4092 4093// Values returns the slice of values for the current page or nil if there are no values. 4094func (page GalleryImageListPage) Values() []GalleryImage { 4095 if page.gil.IsEmpty() { 4096 return nil 4097 } 4098 return *page.gil.Value 4099} 4100 4101// Creates a new instance of the GalleryImageListPage type. 4102func NewGalleryImageListPage(cur GalleryImageList, getNextPage func(context.Context, GalleryImageList) (GalleryImageList, error)) GalleryImageListPage { 4103 return GalleryImageListPage{ 4104 fn: getNextPage, 4105 gil: cur, 4106 } 4107} 4108 4109// GalleryImageProperties describes the properties of a gallery Image Definition. 4110type GalleryImageProperties struct { 4111 // Description - The description of this gallery Image Definition resource. This property is updatable. 4112 Description *string `json:"description,omitempty"` 4113 // Eula - The Eula agreement for the gallery Image Definition. 4114 Eula *string `json:"eula,omitempty"` 4115 // PrivacyStatementURI - The privacy statement uri. 4116 PrivacyStatementURI *string `json:"privacyStatementUri,omitempty"` 4117 // ReleaseNoteURI - The release note uri. 4118 ReleaseNoteURI *string `json:"releaseNoteUri,omitempty"` 4119 // 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' 4120 OsType OperatingSystemTypes `json:"osType,omitempty"` 4121 // 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' 4122 OsState OperatingSystemStateTypes `json:"osState,omitempty"` 4123 // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'V1', 'V2' 4124 HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` 4125 // EndOfLifeDate - The end of life date of the gallery Image Definition. This property can be used for decommissioning purposes. This property is updatable. 4126 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 4127 Identifier *GalleryImageIdentifier `json:"identifier,omitempty"` 4128 Recommended *RecommendedMachineConfiguration `json:"recommended,omitempty"` 4129 Disallowed *Disallowed `json:"disallowed,omitempty"` 4130 PurchasePlan *ImagePurchasePlan `json:"purchasePlan,omitempty"` 4131 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningState2Creating', 'ProvisioningState2Updating', 'ProvisioningState2Failed', 'ProvisioningState2Succeeded', 'ProvisioningState2Deleting', 'ProvisioningState2Migrating' 4132 ProvisioningState ProvisioningState2 `json:"provisioningState,omitempty"` 4133} 4134 4135// MarshalJSON is the custom marshaler for GalleryImageProperties. 4136func (gip GalleryImageProperties) MarshalJSON() ([]byte, error) { 4137 objectMap := make(map[string]interface{}) 4138 if gip.Description != nil { 4139 objectMap["description"] = gip.Description 4140 } 4141 if gip.Eula != nil { 4142 objectMap["eula"] = gip.Eula 4143 } 4144 if gip.PrivacyStatementURI != nil { 4145 objectMap["privacyStatementUri"] = gip.PrivacyStatementURI 4146 } 4147 if gip.ReleaseNoteURI != nil { 4148 objectMap["releaseNoteUri"] = gip.ReleaseNoteURI 4149 } 4150 if gip.OsType != "" { 4151 objectMap["osType"] = gip.OsType 4152 } 4153 if gip.OsState != "" { 4154 objectMap["osState"] = gip.OsState 4155 } 4156 if gip.HyperVGeneration != "" { 4157 objectMap["hyperVGeneration"] = gip.HyperVGeneration 4158 } 4159 if gip.EndOfLifeDate != nil { 4160 objectMap["endOfLifeDate"] = gip.EndOfLifeDate 4161 } 4162 if gip.Identifier != nil { 4163 objectMap["identifier"] = gip.Identifier 4164 } 4165 if gip.Recommended != nil { 4166 objectMap["recommended"] = gip.Recommended 4167 } 4168 if gip.Disallowed != nil { 4169 objectMap["disallowed"] = gip.Disallowed 4170 } 4171 if gip.PurchasePlan != nil { 4172 objectMap["purchasePlan"] = gip.PurchasePlan 4173 } 4174 return json.Marshal(objectMap) 4175} 4176 4177// GalleryImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 4178// long-running operation. 4179type GalleryImagesCreateOrUpdateFuture struct { 4180 azure.FutureAPI 4181 // Result returns the result of the asynchronous operation. 4182 // If the operation has not completed it will return an error. 4183 Result func(GalleryImagesClient) (GalleryImage, error) 4184} 4185 4186// GalleryImagesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 4187// operation. 4188type GalleryImagesDeleteFuture struct { 4189 azure.FutureAPI 4190 // Result returns the result of the asynchronous operation. 4191 // If the operation has not completed it will return an error. 4192 Result func(GalleryImagesClient) (autorest.Response, error) 4193} 4194 4195// GalleryImagesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 4196// operation. 4197type GalleryImagesUpdateFuture struct { 4198 azure.FutureAPI 4199 // Result returns the result of the asynchronous operation. 4200 // If the operation has not completed it will return an error. 4201 Result func(GalleryImagesClient) (GalleryImage, error) 4202} 4203 4204// GalleryImageUpdate specifies information about the gallery Image Definition that you want to update. 4205type GalleryImageUpdate struct { 4206 *GalleryImageProperties `json:"properties,omitempty"` 4207 // Tags - Resource tags 4208 Tags map[string]*string `json:"tags"` 4209} 4210 4211// MarshalJSON is the custom marshaler for GalleryImageUpdate. 4212func (giu GalleryImageUpdate) MarshalJSON() ([]byte, error) { 4213 objectMap := make(map[string]interface{}) 4214 if giu.GalleryImageProperties != nil { 4215 objectMap["properties"] = giu.GalleryImageProperties 4216 } 4217 if giu.Tags != nil { 4218 objectMap["tags"] = giu.Tags 4219 } 4220 return json.Marshal(objectMap) 4221} 4222 4223// UnmarshalJSON is the custom unmarshaler for GalleryImageUpdate struct. 4224func (giu *GalleryImageUpdate) UnmarshalJSON(body []byte) error { 4225 var m map[string]*json.RawMessage 4226 err := json.Unmarshal(body, &m) 4227 if err != nil { 4228 return err 4229 } 4230 for k, v := range m { 4231 switch k { 4232 case "properties": 4233 if v != nil { 4234 var galleryImageProperties GalleryImageProperties 4235 err = json.Unmarshal(*v, &galleryImageProperties) 4236 if err != nil { 4237 return err 4238 } 4239 giu.GalleryImageProperties = &galleryImageProperties 4240 } 4241 case "tags": 4242 if v != nil { 4243 var tags map[string]*string 4244 err = json.Unmarshal(*v, &tags) 4245 if err != nil { 4246 return err 4247 } 4248 giu.Tags = tags 4249 } 4250 } 4251 } 4252 4253 return nil 4254} 4255 4256// GalleryImageVersion specifies information about the gallery Image Version that you want to create or 4257// update. 4258type GalleryImageVersion struct { 4259 autorest.Response `json:"-"` 4260 *GalleryImageVersionProperties `json:"properties,omitempty"` 4261 // ID - READ-ONLY; Resource Id 4262 ID *string `json:"id,omitempty"` 4263 // Name - READ-ONLY; Resource name 4264 Name *string `json:"name,omitempty"` 4265 // Type - READ-ONLY; Resource type 4266 Type *string `json:"type,omitempty"` 4267 // Location - Resource location 4268 Location *string `json:"location,omitempty"` 4269 // Tags - Resource tags 4270 Tags map[string]*string `json:"tags"` 4271} 4272 4273// MarshalJSON is the custom marshaler for GalleryImageVersion. 4274func (giv GalleryImageVersion) MarshalJSON() ([]byte, error) { 4275 objectMap := make(map[string]interface{}) 4276 if giv.GalleryImageVersionProperties != nil { 4277 objectMap["properties"] = giv.GalleryImageVersionProperties 4278 } 4279 if giv.Location != nil { 4280 objectMap["location"] = giv.Location 4281 } 4282 if giv.Tags != nil { 4283 objectMap["tags"] = giv.Tags 4284 } 4285 return json.Marshal(objectMap) 4286} 4287 4288// UnmarshalJSON is the custom unmarshaler for GalleryImageVersion struct. 4289func (giv *GalleryImageVersion) UnmarshalJSON(body []byte) error { 4290 var m map[string]*json.RawMessage 4291 err := json.Unmarshal(body, &m) 4292 if err != nil { 4293 return err 4294 } 4295 for k, v := range m { 4296 switch k { 4297 case "properties": 4298 if v != nil { 4299 var galleryImageVersionProperties GalleryImageVersionProperties 4300 err = json.Unmarshal(*v, &galleryImageVersionProperties) 4301 if err != nil { 4302 return err 4303 } 4304 giv.GalleryImageVersionProperties = &galleryImageVersionProperties 4305 } 4306 case "id": 4307 if v != nil { 4308 var ID string 4309 err = json.Unmarshal(*v, &ID) 4310 if err != nil { 4311 return err 4312 } 4313 giv.ID = &ID 4314 } 4315 case "name": 4316 if v != nil { 4317 var name string 4318 err = json.Unmarshal(*v, &name) 4319 if err != nil { 4320 return err 4321 } 4322 giv.Name = &name 4323 } 4324 case "type": 4325 if v != nil { 4326 var typeVar string 4327 err = json.Unmarshal(*v, &typeVar) 4328 if err != nil { 4329 return err 4330 } 4331 giv.Type = &typeVar 4332 } 4333 case "location": 4334 if v != nil { 4335 var location string 4336 err = json.Unmarshal(*v, &location) 4337 if err != nil { 4338 return err 4339 } 4340 giv.Location = &location 4341 } 4342 case "tags": 4343 if v != nil { 4344 var tags map[string]*string 4345 err = json.Unmarshal(*v, &tags) 4346 if err != nil { 4347 return err 4348 } 4349 giv.Tags = tags 4350 } 4351 } 4352 } 4353 4354 return nil 4355} 4356 4357// GalleryImageVersionList the List Gallery Image version operation response. 4358type GalleryImageVersionList struct { 4359 autorest.Response `json:"-"` 4360 // Value - A list of gallery Image Versions. 4361 Value *[]GalleryImageVersion `json:"value,omitempty"` 4362 // 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. 4363 NextLink *string `json:"nextLink,omitempty"` 4364} 4365 4366// GalleryImageVersionListIterator provides access to a complete listing of GalleryImageVersion values. 4367type GalleryImageVersionListIterator struct { 4368 i int 4369 page GalleryImageVersionListPage 4370} 4371 4372// NextWithContext advances to the next value. If there was an error making 4373// the request the iterator does not advance and the error is returned. 4374func (iter *GalleryImageVersionListIterator) NextWithContext(ctx context.Context) (err error) { 4375 if tracing.IsEnabled() { 4376 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionListIterator.NextWithContext") 4377 defer func() { 4378 sc := -1 4379 if iter.Response().Response.Response != nil { 4380 sc = iter.Response().Response.Response.StatusCode 4381 } 4382 tracing.EndSpan(ctx, sc, err) 4383 }() 4384 } 4385 iter.i++ 4386 if iter.i < len(iter.page.Values()) { 4387 return nil 4388 } 4389 err = iter.page.NextWithContext(ctx) 4390 if err != nil { 4391 iter.i-- 4392 return err 4393 } 4394 iter.i = 0 4395 return nil 4396} 4397 4398// Next advances to the next value. If there was an error making 4399// the request the iterator does not advance and the error is returned. 4400// Deprecated: Use NextWithContext() instead. 4401func (iter *GalleryImageVersionListIterator) Next() error { 4402 return iter.NextWithContext(context.Background()) 4403} 4404 4405// NotDone returns true if the enumeration should be started or is not yet complete. 4406func (iter GalleryImageVersionListIterator) NotDone() bool { 4407 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4408} 4409 4410// Response returns the raw server response from the last page request. 4411func (iter GalleryImageVersionListIterator) Response() GalleryImageVersionList { 4412 return iter.page.Response() 4413} 4414 4415// Value returns the current value or a zero-initialized value if the 4416// iterator has advanced beyond the end of the collection. 4417func (iter GalleryImageVersionListIterator) Value() GalleryImageVersion { 4418 if !iter.page.NotDone() { 4419 return GalleryImageVersion{} 4420 } 4421 return iter.page.Values()[iter.i] 4422} 4423 4424// Creates a new instance of the GalleryImageVersionListIterator type. 4425func NewGalleryImageVersionListIterator(page GalleryImageVersionListPage) GalleryImageVersionListIterator { 4426 return GalleryImageVersionListIterator{page: page} 4427} 4428 4429// IsEmpty returns true if the ListResult contains no values. 4430func (givl GalleryImageVersionList) IsEmpty() bool { 4431 return givl.Value == nil || len(*givl.Value) == 0 4432} 4433 4434// hasNextLink returns true if the NextLink is not empty. 4435func (givl GalleryImageVersionList) hasNextLink() bool { 4436 return givl.NextLink != nil && len(*givl.NextLink) != 0 4437} 4438 4439// galleryImageVersionListPreparer prepares a request to retrieve the next set of results. 4440// It returns nil if no more results exist. 4441func (givl GalleryImageVersionList) galleryImageVersionListPreparer(ctx context.Context) (*http.Request, error) { 4442 if !givl.hasNextLink() { 4443 return nil, nil 4444 } 4445 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4446 autorest.AsJSON(), 4447 autorest.AsGet(), 4448 autorest.WithBaseURL(to.String(givl.NextLink))) 4449} 4450 4451// GalleryImageVersionListPage contains a page of GalleryImageVersion values. 4452type GalleryImageVersionListPage struct { 4453 fn func(context.Context, GalleryImageVersionList) (GalleryImageVersionList, error) 4454 givl GalleryImageVersionList 4455} 4456 4457// NextWithContext advances to the next page of values. If there was an error making 4458// the request the page does not advance and the error is returned. 4459func (page *GalleryImageVersionListPage) NextWithContext(ctx context.Context) (err error) { 4460 if tracing.IsEnabled() { 4461 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionListPage.NextWithContext") 4462 defer func() { 4463 sc := -1 4464 if page.Response().Response.Response != nil { 4465 sc = page.Response().Response.Response.StatusCode 4466 } 4467 tracing.EndSpan(ctx, sc, err) 4468 }() 4469 } 4470 for { 4471 next, err := page.fn(ctx, page.givl) 4472 if err != nil { 4473 return err 4474 } 4475 page.givl = next 4476 if !next.hasNextLink() || !next.IsEmpty() { 4477 break 4478 } 4479 } 4480 return nil 4481} 4482 4483// Next advances to the next page of values. If there was an error making 4484// the request the page does not advance and the error is returned. 4485// Deprecated: Use NextWithContext() instead. 4486func (page *GalleryImageVersionListPage) Next() error { 4487 return page.NextWithContext(context.Background()) 4488} 4489 4490// NotDone returns true if the page enumeration should be started or is not yet complete. 4491func (page GalleryImageVersionListPage) NotDone() bool { 4492 return !page.givl.IsEmpty() 4493} 4494 4495// Response returns the raw server response from the last page request. 4496func (page GalleryImageVersionListPage) Response() GalleryImageVersionList { 4497 return page.givl 4498} 4499 4500// Values returns the slice of values for the current page or nil if there are no values. 4501func (page GalleryImageVersionListPage) Values() []GalleryImageVersion { 4502 if page.givl.IsEmpty() { 4503 return nil 4504 } 4505 return *page.givl.Value 4506} 4507 4508// Creates a new instance of the GalleryImageVersionListPage type. 4509func NewGalleryImageVersionListPage(cur GalleryImageVersionList, getNextPage func(context.Context, GalleryImageVersionList) (GalleryImageVersionList, error)) GalleryImageVersionListPage { 4510 return GalleryImageVersionListPage{ 4511 fn: getNextPage, 4512 givl: cur, 4513 } 4514} 4515 4516// GalleryImageVersionProperties describes the properties of a gallery Image Version. 4517type GalleryImageVersionProperties struct { 4518 PublishingProfile *GalleryImageVersionPublishingProfile `json:"publishingProfile,omitempty"` 4519 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningState3Creating', 'ProvisioningState3Updating', 'ProvisioningState3Failed', 'ProvisioningState3Succeeded', 'ProvisioningState3Deleting', 'ProvisioningState3Migrating' 4520 ProvisioningState ProvisioningState3 `json:"provisioningState,omitempty"` 4521 StorageProfile *GalleryImageVersionStorageProfile `json:"storageProfile,omitempty"` 4522 // ReplicationStatus - READ-ONLY 4523 ReplicationStatus *ReplicationStatus `json:"replicationStatus,omitempty"` 4524} 4525 4526// MarshalJSON is the custom marshaler for GalleryImageVersionProperties. 4527func (givp GalleryImageVersionProperties) MarshalJSON() ([]byte, error) { 4528 objectMap := make(map[string]interface{}) 4529 if givp.PublishingProfile != nil { 4530 objectMap["publishingProfile"] = givp.PublishingProfile 4531 } 4532 if givp.StorageProfile != nil { 4533 objectMap["storageProfile"] = givp.StorageProfile 4534 } 4535 return json.Marshal(objectMap) 4536} 4537 4538// GalleryImageVersionPublishingProfile the publishing profile of a gallery Image Version. 4539type GalleryImageVersionPublishingProfile struct { 4540 // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. 4541 TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` 4542 // 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. 4543 ReplicaCount *int32 `json:"replicaCount,omitempty"` 4544 // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. 4545 ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` 4546 // PublishedDate - READ-ONLY; The timestamp for when the gallery Image Version is published. 4547 PublishedDate *date.Time `json:"publishedDate,omitempty"` 4548 // EndOfLifeDate - The end of life date of the gallery Image Version. This property can be used for decommissioning purposes. This property is updatable. 4549 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 4550 // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS' 4551 StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` 4552} 4553 4554// MarshalJSON is the custom marshaler for GalleryImageVersionPublishingProfile. 4555func (givpp GalleryImageVersionPublishingProfile) MarshalJSON() ([]byte, error) { 4556 objectMap := make(map[string]interface{}) 4557 if givpp.TargetRegions != nil { 4558 objectMap["targetRegions"] = givpp.TargetRegions 4559 } 4560 if givpp.ReplicaCount != nil { 4561 objectMap["replicaCount"] = givpp.ReplicaCount 4562 } 4563 if givpp.ExcludeFromLatest != nil { 4564 objectMap["excludeFromLatest"] = givpp.ExcludeFromLatest 4565 } 4566 if givpp.EndOfLifeDate != nil { 4567 objectMap["endOfLifeDate"] = givpp.EndOfLifeDate 4568 } 4569 if givpp.StorageAccountType != "" { 4570 objectMap["storageAccountType"] = givpp.StorageAccountType 4571 } 4572 return json.Marshal(objectMap) 4573} 4574 4575// GalleryImageVersionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 4576// long-running operation. 4577type GalleryImageVersionsCreateOrUpdateFuture struct { 4578 azure.FutureAPI 4579 // Result returns the result of the asynchronous operation. 4580 // If the operation has not completed it will return an error. 4581 Result func(GalleryImageVersionsClient) (GalleryImageVersion, error) 4582} 4583 4584// GalleryImageVersionsDeleteFuture an abstraction for monitoring and retrieving the results of a 4585// long-running operation. 4586type GalleryImageVersionsDeleteFuture struct { 4587 azure.FutureAPI 4588 // Result returns the result of the asynchronous operation. 4589 // If the operation has not completed it will return an error. 4590 Result func(GalleryImageVersionsClient) (autorest.Response, error) 4591} 4592 4593// GalleryImageVersionStorageProfile this is the storage profile of a Gallery Image Version. 4594type GalleryImageVersionStorageProfile struct { 4595 Source *GalleryArtifactVersionSource `json:"source,omitempty"` 4596 OsDiskImage *GalleryOSDiskImage `json:"osDiskImage,omitempty"` 4597 // DataDiskImages - A list of data disk images. 4598 DataDiskImages *[]GalleryDataDiskImage `json:"dataDiskImages,omitempty"` 4599} 4600 4601// GalleryImageVersionsUpdateFuture an abstraction for monitoring and retrieving the results of a 4602// long-running operation. 4603type GalleryImageVersionsUpdateFuture struct { 4604 azure.FutureAPI 4605 // Result returns the result of the asynchronous operation. 4606 // If the operation has not completed it will return an error. 4607 Result func(GalleryImageVersionsClient) (GalleryImageVersion, error) 4608} 4609 4610// GalleryImageVersionUpdate specifies information about the gallery Image Version that you want to update. 4611type GalleryImageVersionUpdate struct { 4612 *GalleryImageVersionProperties `json:"properties,omitempty"` 4613 // Tags - Resource tags 4614 Tags map[string]*string `json:"tags"` 4615} 4616 4617// MarshalJSON is the custom marshaler for GalleryImageVersionUpdate. 4618func (givu GalleryImageVersionUpdate) MarshalJSON() ([]byte, error) { 4619 objectMap := make(map[string]interface{}) 4620 if givu.GalleryImageVersionProperties != nil { 4621 objectMap["properties"] = givu.GalleryImageVersionProperties 4622 } 4623 if givu.Tags != nil { 4624 objectMap["tags"] = givu.Tags 4625 } 4626 return json.Marshal(objectMap) 4627} 4628 4629// UnmarshalJSON is the custom unmarshaler for GalleryImageVersionUpdate struct. 4630func (givu *GalleryImageVersionUpdate) UnmarshalJSON(body []byte) error { 4631 var m map[string]*json.RawMessage 4632 err := json.Unmarshal(body, &m) 4633 if err != nil { 4634 return err 4635 } 4636 for k, v := range m { 4637 switch k { 4638 case "properties": 4639 if v != nil { 4640 var galleryImageVersionProperties GalleryImageVersionProperties 4641 err = json.Unmarshal(*v, &galleryImageVersionProperties) 4642 if err != nil { 4643 return err 4644 } 4645 givu.GalleryImageVersionProperties = &galleryImageVersionProperties 4646 } 4647 case "tags": 4648 if v != nil { 4649 var tags map[string]*string 4650 err = json.Unmarshal(*v, &tags) 4651 if err != nil { 4652 return err 4653 } 4654 givu.Tags = tags 4655 } 4656 } 4657 } 4658 4659 return nil 4660} 4661 4662// GalleryList the List Galleries operation response. 4663type GalleryList struct { 4664 autorest.Response `json:"-"` 4665 // Value - A list of galleries. 4666 Value *[]Gallery `json:"value,omitempty"` 4667 // NextLink - The uri to fetch the next page of galleries. Call ListNext() with this to fetch the next page of galleries. 4668 NextLink *string `json:"nextLink,omitempty"` 4669} 4670 4671// GalleryListIterator provides access to a complete listing of Gallery values. 4672type GalleryListIterator struct { 4673 i int 4674 page GalleryListPage 4675} 4676 4677// NextWithContext advances to the next value. If there was an error making 4678// the request the iterator does not advance and the error is returned. 4679func (iter *GalleryListIterator) NextWithContext(ctx context.Context) (err error) { 4680 if tracing.IsEnabled() { 4681 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryListIterator.NextWithContext") 4682 defer func() { 4683 sc := -1 4684 if iter.Response().Response.Response != nil { 4685 sc = iter.Response().Response.Response.StatusCode 4686 } 4687 tracing.EndSpan(ctx, sc, err) 4688 }() 4689 } 4690 iter.i++ 4691 if iter.i < len(iter.page.Values()) { 4692 return nil 4693 } 4694 err = iter.page.NextWithContext(ctx) 4695 if err != nil { 4696 iter.i-- 4697 return err 4698 } 4699 iter.i = 0 4700 return nil 4701} 4702 4703// Next advances to the next value. If there was an error making 4704// the request the iterator does not advance and the error is returned. 4705// Deprecated: Use NextWithContext() instead. 4706func (iter *GalleryListIterator) Next() error { 4707 return iter.NextWithContext(context.Background()) 4708} 4709 4710// NotDone returns true if the enumeration should be started or is not yet complete. 4711func (iter GalleryListIterator) NotDone() bool { 4712 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4713} 4714 4715// Response returns the raw server response from the last page request. 4716func (iter GalleryListIterator) Response() GalleryList { 4717 return iter.page.Response() 4718} 4719 4720// Value returns the current value or a zero-initialized value if the 4721// iterator has advanced beyond the end of the collection. 4722func (iter GalleryListIterator) Value() Gallery { 4723 if !iter.page.NotDone() { 4724 return Gallery{} 4725 } 4726 return iter.page.Values()[iter.i] 4727} 4728 4729// Creates a new instance of the GalleryListIterator type. 4730func NewGalleryListIterator(page GalleryListPage) GalleryListIterator { 4731 return GalleryListIterator{page: page} 4732} 4733 4734// IsEmpty returns true if the ListResult contains no values. 4735func (gl GalleryList) IsEmpty() bool { 4736 return gl.Value == nil || len(*gl.Value) == 0 4737} 4738 4739// hasNextLink returns true if the NextLink is not empty. 4740func (gl GalleryList) hasNextLink() bool { 4741 return gl.NextLink != nil && len(*gl.NextLink) != 0 4742} 4743 4744// galleryListPreparer prepares a request to retrieve the next set of results. 4745// It returns nil if no more results exist. 4746func (gl GalleryList) galleryListPreparer(ctx context.Context) (*http.Request, error) { 4747 if !gl.hasNextLink() { 4748 return nil, nil 4749 } 4750 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4751 autorest.AsJSON(), 4752 autorest.AsGet(), 4753 autorest.WithBaseURL(to.String(gl.NextLink))) 4754} 4755 4756// GalleryListPage contains a page of Gallery values. 4757type GalleryListPage struct { 4758 fn func(context.Context, GalleryList) (GalleryList, error) 4759 gl GalleryList 4760} 4761 4762// NextWithContext advances to the next page of values. If there was an error making 4763// the request the page does not advance and the error is returned. 4764func (page *GalleryListPage) NextWithContext(ctx context.Context) (err error) { 4765 if tracing.IsEnabled() { 4766 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryListPage.NextWithContext") 4767 defer func() { 4768 sc := -1 4769 if page.Response().Response.Response != nil { 4770 sc = page.Response().Response.Response.StatusCode 4771 } 4772 tracing.EndSpan(ctx, sc, err) 4773 }() 4774 } 4775 for { 4776 next, err := page.fn(ctx, page.gl) 4777 if err != nil { 4778 return err 4779 } 4780 page.gl = next 4781 if !next.hasNextLink() || !next.IsEmpty() { 4782 break 4783 } 4784 } 4785 return nil 4786} 4787 4788// Next advances to the next page of values. If there was an error making 4789// the request the page does not advance and the error is returned. 4790// Deprecated: Use NextWithContext() instead. 4791func (page *GalleryListPage) Next() error { 4792 return page.NextWithContext(context.Background()) 4793} 4794 4795// NotDone returns true if the page enumeration should be started or is not yet complete. 4796func (page GalleryListPage) NotDone() bool { 4797 return !page.gl.IsEmpty() 4798} 4799 4800// Response returns the raw server response from the last page request. 4801func (page GalleryListPage) Response() GalleryList { 4802 return page.gl 4803} 4804 4805// Values returns the slice of values for the current page or nil if there are no values. 4806func (page GalleryListPage) Values() []Gallery { 4807 if page.gl.IsEmpty() { 4808 return nil 4809 } 4810 return *page.gl.Value 4811} 4812 4813// Creates a new instance of the GalleryListPage type. 4814func NewGalleryListPage(cur GalleryList, getNextPage func(context.Context, GalleryList) (GalleryList, error)) GalleryListPage { 4815 return GalleryListPage{ 4816 fn: getNextPage, 4817 gl: cur, 4818 } 4819} 4820 4821// GalleryOSDiskImage this is the OS disk image. 4822type GalleryOSDiskImage struct { 4823 // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. 4824 SizeInGB *int32 `json:"sizeInGB,omitempty"` 4825 // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' 4826 HostCaching HostCaching `json:"hostCaching,omitempty"` 4827 Source *GalleryArtifactVersionSource `json:"source,omitempty"` 4828} 4829 4830// MarshalJSON is the custom marshaler for GalleryOSDiskImage. 4831func (godi GalleryOSDiskImage) MarshalJSON() ([]byte, error) { 4832 objectMap := make(map[string]interface{}) 4833 if godi.HostCaching != "" { 4834 objectMap["hostCaching"] = godi.HostCaching 4835 } 4836 if godi.Source != nil { 4837 objectMap["source"] = godi.Source 4838 } 4839 return json.Marshal(objectMap) 4840} 4841 4842// GalleryProperties describes the properties of a Shared Image Gallery. 4843type GalleryProperties struct { 4844 // Description - The description of this Shared Image Gallery resource. This property is updatable. 4845 Description *string `json:"description,omitempty"` 4846 Identifier *GalleryIdentifier `json:"identifier,omitempty"` 4847 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningStateCreating', 'ProvisioningStateUpdating', 'ProvisioningStateFailed', 'ProvisioningStateSucceeded', 'ProvisioningStateDeleting', 'ProvisioningStateMigrating' 4848 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 4849} 4850 4851// MarshalJSON is the custom marshaler for GalleryProperties. 4852func (gp GalleryProperties) MarshalJSON() ([]byte, error) { 4853 objectMap := make(map[string]interface{}) 4854 if gp.Description != nil { 4855 objectMap["description"] = gp.Description 4856 } 4857 if gp.Identifier != nil { 4858 objectMap["identifier"] = gp.Identifier 4859 } 4860 return json.Marshal(objectMap) 4861} 4862 4863// GalleryUpdate specifies information about the Shared Image Gallery that you want to update. 4864type GalleryUpdate struct { 4865 *GalleryProperties `json:"properties,omitempty"` 4866 // Tags - Resource tags 4867 Tags map[string]*string `json:"tags"` 4868} 4869 4870// MarshalJSON is the custom marshaler for GalleryUpdate. 4871func (gu GalleryUpdate) MarshalJSON() ([]byte, error) { 4872 objectMap := make(map[string]interface{}) 4873 if gu.GalleryProperties != nil { 4874 objectMap["properties"] = gu.GalleryProperties 4875 } 4876 if gu.Tags != nil { 4877 objectMap["tags"] = gu.Tags 4878 } 4879 return json.Marshal(objectMap) 4880} 4881 4882// UnmarshalJSON is the custom unmarshaler for GalleryUpdate struct. 4883func (gu *GalleryUpdate) UnmarshalJSON(body []byte) error { 4884 var m map[string]*json.RawMessage 4885 err := json.Unmarshal(body, &m) 4886 if err != nil { 4887 return err 4888 } 4889 for k, v := range m { 4890 switch k { 4891 case "properties": 4892 if v != nil { 4893 var galleryProperties GalleryProperties 4894 err = json.Unmarshal(*v, &galleryProperties) 4895 if err != nil { 4896 return err 4897 } 4898 gu.GalleryProperties = &galleryProperties 4899 } 4900 case "tags": 4901 if v != nil { 4902 var tags map[string]*string 4903 err = json.Unmarshal(*v, &tags) 4904 if err != nil { 4905 return err 4906 } 4907 gu.Tags = tags 4908 } 4909 } 4910 } 4911 4912 return nil 4913} 4914 4915// GrantAccessData data used for requesting a SAS. 4916type GrantAccessData struct { 4917 // Access - Possible values include: 'None', 'Read', 'Write' 4918 Access AccessLevel `json:"access,omitempty"` 4919 // DurationInSeconds - Time duration in seconds until the SAS access expires. 4920 DurationInSeconds *int32 `json:"durationInSeconds,omitempty"` 4921} 4922 4923// HardwareProfile specifies the hardware settings for the virtual machine. 4924type HardwareProfile struct { 4925 // VMSize - Specifies the size of the virtual machine. For more information about virtual machine sizes, see [Sizes for virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). <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/rest/api/compute/virtualmachinesizes/list) <br><br> [List all available virtual machine sizes for resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). 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' 4926 VMSize VirtualMachineSizeTypes `json:"vmSize,omitempty"` 4927} 4928 4929// Image the source user image virtual hard disk. The virtual hard disk will be copied before being 4930// attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not 4931// exist. 4932type Image struct { 4933 autorest.Response `json:"-"` 4934 *ImageProperties `json:"properties,omitempty"` 4935 // ID - READ-ONLY; Resource Id 4936 ID *string `json:"id,omitempty"` 4937 // Name - READ-ONLY; Resource name 4938 Name *string `json:"name,omitempty"` 4939 // Type - READ-ONLY; Resource type 4940 Type *string `json:"type,omitempty"` 4941 // Location - Resource location 4942 Location *string `json:"location,omitempty"` 4943 // Tags - Resource tags 4944 Tags map[string]*string `json:"tags"` 4945} 4946 4947// MarshalJSON is the custom marshaler for Image. 4948func (i Image) MarshalJSON() ([]byte, error) { 4949 objectMap := make(map[string]interface{}) 4950 if i.ImageProperties != nil { 4951 objectMap["properties"] = i.ImageProperties 4952 } 4953 if i.Location != nil { 4954 objectMap["location"] = i.Location 4955 } 4956 if i.Tags != nil { 4957 objectMap["tags"] = i.Tags 4958 } 4959 return json.Marshal(objectMap) 4960} 4961 4962// UnmarshalJSON is the custom unmarshaler for Image struct. 4963func (i *Image) UnmarshalJSON(body []byte) error { 4964 var m map[string]*json.RawMessage 4965 err := json.Unmarshal(body, &m) 4966 if err != nil { 4967 return err 4968 } 4969 for k, v := range m { 4970 switch k { 4971 case "properties": 4972 if v != nil { 4973 var imageProperties ImageProperties 4974 err = json.Unmarshal(*v, &imageProperties) 4975 if err != nil { 4976 return err 4977 } 4978 i.ImageProperties = &imageProperties 4979 } 4980 case "id": 4981 if v != nil { 4982 var ID string 4983 err = json.Unmarshal(*v, &ID) 4984 if err != nil { 4985 return err 4986 } 4987 i.ID = &ID 4988 } 4989 case "name": 4990 if v != nil { 4991 var name string 4992 err = json.Unmarshal(*v, &name) 4993 if err != nil { 4994 return err 4995 } 4996 i.Name = &name 4997 } 4998 case "type": 4999 if v != nil { 5000 var typeVar string 5001 err = json.Unmarshal(*v, &typeVar) 5002 if err != nil { 5003 return err 5004 } 5005 i.Type = &typeVar 5006 } 5007 case "location": 5008 if v != nil { 5009 var location string 5010 err = json.Unmarshal(*v, &location) 5011 if err != nil { 5012 return err 5013 } 5014 i.Location = &location 5015 } 5016 case "tags": 5017 if v != nil { 5018 var tags map[string]*string 5019 err = json.Unmarshal(*v, &tags) 5020 if err != nil { 5021 return err 5022 } 5023 i.Tags = tags 5024 } 5025 } 5026 } 5027 5028 return nil 5029} 5030 5031// ImageDataDisk describes a data disk. 5032type ImageDataDisk struct { 5033 // 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. 5034 Lun *int32 `json:"lun,omitempty"` 5035 // Snapshot - The snapshot. 5036 Snapshot *SubResource `json:"snapshot,omitempty"` 5037 // ManagedDisk - The managedDisk. 5038 ManagedDisk *SubResource `json:"managedDisk,omitempty"` 5039 // BlobURI - The Virtual Hard Disk. 5040 BlobURI *string `json:"blobUri,omitempty"` 5041 // 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' 5042 Caching CachingTypes `json:"caching,omitempty"` 5043 // 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 5044 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 5045 // 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' 5046 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 5047 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. 5048 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 5049} 5050 5051// ImageDisk describes a image disk. 5052type ImageDisk struct { 5053 // Snapshot - The snapshot. 5054 Snapshot *SubResource `json:"snapshot,omitempty"` 5055 // ManagedDisk - The managedDisk. 5056 ManagedDisk *SubResource `json:"managedDisk,omitempty"` 5057 // BlobURI - The Virtual Hard Disk. 5058 BlobURI *string `json:"blobUri,omitempty"` 5059 // 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' 5060 Caching CachingTypes `json:"caching,omitempty"` 5061 // 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 5062 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 5063 // 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' 5064 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 5065 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. 5066 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 5067} 5068 5069// ImageDiskReference the source image used for creating the disk. 5070type ImageDiskReference struct { 5071 // ID - A relative uri containing either a Platform Image Repository or user image reference. 5072 ID *string `json:"id,omitempty"` 5073 // 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. 5074 Lun *int32 `json:"lun,omitempty"` 5075} 5076 5077// ImageListResult the List Image operation response. 5078type ImageListResult struct { 5079 autorest.Response `json:"-"` 5080 // Value - The list of Images. 5081 Value *[]Image `json:"value,omitempty"` 5082 // NextLink - The uri to fetch the next page of Images. Call ListNext() with this to fetch the next page of Images. 5083 NextLink *string `json:"nextLink,omitempty"` 5084} 5085 5086// ImageListResultIterator provides access to a complete listing of Image values. 5087type ImageListResultIterator struct { 5088 i int 5089 page ImageListResultPage 5090} 5091 5092// NextWithContext advances to the next value. If there was an error making 5093// the request the iterator does not advance and the error is returned. 5094func (iter *ImageListResultIterator) NextWithContext(ctx context.Context) (err error) { 5095 if tracing.IsEnabled() { 5096 ctx = tracing.StartSpan(ctx, fqdn+"/ImageListResultIterator.NextWithContext") 5097 defer func() { 5098 sc := -1 5099 if iter.Response().Response.Response != nil { 5100 sc = iter.Response().Response.Response.StatusCode 5101 } 5102 tracing.EndSpan(ctx, sc, err) 5103 }() 5104 } 5105 iter.i++ 5106 if iter.i < len(iter.page.Values()) { 5107 return nil 5108 } 5109 err = iter.page.NextWithContext(ctx) 5110 if err != nil { 5111 iter.i-- 5112 return err 5113 } 5114 iter.i = 0 5115 return nil 5116} 5117 5118// Next advances to the next value. If there was an error making 5119// the request the iterator does not advance and the error is returned. 5120// Deprecated: Use NextWithContext() instead. 5121func (iter *ImageListResultIterator) Next() error { 5122 return iter.NextWithContext(context.Background()) 5123} 5124 5125// NotDone returns true if the enumeration should be started or is not yet complete. 5126func (iter ImageListResultIterator) NotDone() bool { 5127 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5128} 5129 5130// Response returns the raw server response from the last page request. 5131func (iter ImageListResultIterator) Response() ImageListResult { 5132 return iter.page.Response() 5133} 5134 5135// Value returns the current value or a zero-initialized value if the 5136// iterator has advanced beyond the end of the collection. 5137func (iter ImageListResultIterator) Value() Image { 5138 if !iter.page.NotDone() { 5139 return Image{} 5140 } 5141 return iter.page.Values()[iter.i] 5142} 5143 5144// Creates a new instance of the ImageListResultIterator type. 5145func NewImageListResultIterator(page ImageListResultPage) ImageListResultIterator { 5146 return ImageListResultIterator{page: page} 5147} 5148 5149// IsEmpty returns true if the ListResult contains no values. 5150func (ilr ImageListResult) IsEmpty() bool { 5151 return ilr.Value == nil || len(*ilr.Value) == 0 5152} 5153 5154// hasNextLink returns true if the NextLink is not empty. 5155func (ilr ImageListResult) hasNextLink() bool { 5156 return ilr.NextLink != nil && len(*ilr.NextLink) != 0 5157} 5158 5159// imageListResultPreparer prepares a request to retrieve the next set of results. 5160// It returns nil if no more results exist. 5161func (ilr ImageListResult) imageListResultPreparer(ctx context.Context) (*http.Request, error) { 5162 if !ilr.hasNextLink() { 5163 return nil, nil 5164 } 5165 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5166 autorest.AsJSON(), 5167 autorest.AsGet(), 5168 autorest.WithBaseURL(to.String(ilr.NextLink))) 5169} 5170 5171// ImageListResultPage contains a page of Image values. 5172type ImageListResultPage struct { 5173 fn func(context.Context, ImageListResult) (ImageListResult, error) 5174 ilr ImageListResult 5175} 5176 5177// NextWithContext advances to the next page of values. If there was an error making 5178// the request the page does not advance and the error is returned. 5179func (page *ImageListResultPage) NextWithContext(ctx context.Context) (err error) { 5180 if tracing.IsEnabled() { 5181 ctx = tracing.StartSpan(ctx, fqdn+"/ImageListResultPage.NextWithContext") 5182 defer func() { 5183 sc := -1 5184 if page.Response().Response.Response != nil { 5185 sc = page.Response().Response.Response.StatusCode 5186 } 5187 tracing.EndSpan(ctx, sc, err) 5188 }() 5189 } 5190 for { 5191 next, err := page.fn(ctx, page.ilr) 5192 if err != nil { 5193 return err 5194 } 5195 page.ilr = next 5196 if !next.hasNextLink() || !next.IsEmpty() { 5197 break 5198 } 5199 } 5200 return nil 5201} 5202 5203// Next advances to the next page of values. If there was an error making 5204// the request the page does not advance and the error is returned. 5205// Deprecated: Use NextWithContext() instead. 5206func (page *ImageListResultPage) Next() error { 5207 return page.NextWithContext(context.Background()) 5208} 5209 5210// NotDone returns true if the page enumeration should be started or is not yet complete. 5211func (page ImageListResultPage) NotDone() bool { 5212 return !page.ilr.IsEmpty() 5213} 5214 5215// Response returns the raw server response from the last page request. 5216func (page ImageListResultPage) Response() ImageListResult { 5217 return page.ilr 5218} 5219 5220// Values returns the slice of values for the current page or nil if there are no values. 5221func (page ImageListResultPage) Values() []Image { 5222 if page.ilr.IsEmpty() { 5223 return nil 5224 } 5225 return *page.ilr.Value 5226} 5227 5228// Creates a new instance of the ImageListResultPage type. 5229func NewImageListResultPage(cur ImageListResult, getNextPage func(context.Context, ImageListResult) (ImageListResult, error)) ImageListResultPage { 5230 return ImageListResultPage{ 5231 fn: getNextPage, 5232 ilr: cur, 5233 } 5234} 5235 5236// ImageOSDisk describes an Operating System disk. 5237type ImageOSDisk struct { 5238 // 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' 5239 OsType OperatingSystemTypes `json:"osType,omitempty"` 5240 // OsState - The OS State. Possible values include: 'Generalized', 'Specialized' 5241 OsState OperatingSystemStateTypes `json:"osState,omitempty"` 5242 // Snapshot - The snapshot. 5243 Snapshot *SubResource `json:"snapshot,omitempty"` 5244 // ManagedDisk - The managedDisk. 5245 ManagedDisk *SubResource `json:"managedDisk,omitempty"` 5246 // BlobURI - The Virtual Hard Disk. 5247 BlobURI *string `json:"blobUri,omitempty"` 5248 // 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' 5249 Caching CachingTypes `json:"caching,omitempty"` 5250 // 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 5251 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 5252 // 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' 5253 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 5254 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. 5255 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 5256} 5257 5258// ImageProperties describes the properties of an Image. 5259type ImageProperties struct { 5260 // SourceVirtualMachine - The source virtual machine from which Image is created. 5261 SourceVirtualMachine *SubResource `json:"sourceVirtualMachine,omitempty"` 5262 // StorageProfile - Specifies the storage settings for the virtual machine disks. 5263 StorageProfile *ImageStorageProfile `json:"storageProfile,omitempty"` 5264 // ProvisioningState - READ-ONLY; The provisioning state. 5265 ProvisioningState *string `json:"provisioningState,omitempty"` 5266 // HyperVGeneration - Gets the HyperVGenerationType of the VirtualMachine created from the image. Possible values include: 'HyperVGenerationTypesV1', 'HyperVGenerationTypesV2' 5267 HyperVGeneration HyperVGenerationTypes `json:"hyperVGeneration,omitempty"` 5268} 5269 5270// MarshalJSON is the custom marshaler for ImageProperties. 5271func (IP ImageProperties) MarshalJSON() ([]byte, error) { 5272 objectMap := make(map[string]interface{}) 5273 if IP.SourceVirtualMachine != nil { 5274 objectMap["sourceVirtualMachine"] = IP.SourceVirtualMachine 5275 } 5276 if IP.StorageProfile != nil { 5277 objectMap["storageProfile"] = IP.StorageProfile 5278 } 5279 if IP.HyperVGeneration != "" { 5280 objectMap["hyperVGeneration"] = IP.HyperVGeneration 5281 } 5282 return json.Marshal(objectMap) 5283} 5284 5285// ImagePurchasePlan describes the gallery Image Definition purchase plan. This is used by marketplace 5286// images. 5287type ImagePurchasePlan struct { 5288 // Name - The plan ID. 5289 Name *string `json:"name,omitempty"` 5290 // Publisher - The publisher ID. 5291 Publisher *string `json:"publisher,omitempty"` 5292 // Product - The product ID. 5293 Product *string `json:"product,omitempty"` 5294} 5295 5296// ImageReference specifies information about the image to use. You can specify information about platform 5297// images, marketplace images, or virtual machine images. This element is required when you want to use a 5298// platform image, marketplace image, or virtual machine image, but is not used in other creation 5299// operations. NOTE: Image reference publisher and offer can only be set when you create the scale set 5300type ImageReference struct { 5301 // Publisher - The image publisher. 5302 Publisher *string `json:"publisher,omitempty"` 5303 // Offer - Specifies the offer of the platform image or marketplace image used to create the virtual machine. 5304 Offer *string `json:"offer,omitempty"` 5305 // Sku - The image SKU. 5306 Sku *string `json:"sku,omitempty"` 5307 // 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. 5308 Version *string `json:"version,omitempty"` 5309 // 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'. 5310 ExactVersion *string `json:"exactVersion,omitempty"` 5311 // ID - Resource Id 5312 ID *string `json:"id,omitempty"` 5313} 5314 5315// MarshalJSON is the custom marshaler for ImageReference. 5316func (ir ImageReference) MarshalJSON() ([]byte, error) { 5317 objectMap := make(map[string]interface{}) 5318 if ir.Publisher != nil { 5319 objectMap["publisher"] = ir.Publisher 5320 } 5321 if ir.Offer != nil { 5322 objectMap["offer"] = ir.Offer 5323 } 5324 if ir.Sku != nil { 5325 objectMap["sku"] = ir.Sku 5326 } 5327 if ir.Version != nil { 5328 objectMap["version"] = ir.Version 5329 } 5330 if ir.ID != nil { 5331 objectMap["id"] = ir.ID 5332 } 5333 return json.Marshal(objectMap) 5334} 5335 5336// ImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 5337// operation. 5338type ImagesCreateOrUpdateFuture struct { 5339 azure.FutureAPI 5340 // Result returns the result of the asynchronous operation. 5341 // If the operation has not completed it will return an error. 5342 Result func(ImagesClient) (Image, error) 5343} 5344 5345// ImagesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 5346type ImagesDeleteFuture struct { 5347 azure.FutureAPI 5348 // Result returns the result of the asynchronous operation. 5349 // If the operation has not completed it will return an error. 5350 Result func(ImagesClient) (autorest.Response, error) 5351} 5352 5353// ImageStorageProfile describes a storage profile. 5354type ImageStorageProfile struct { 5355 // 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). 5356 OsDisk *ImageOSDisk `json:"osDisk,omitempty"` 5357 // 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). 5358 DataDisks *[]ImageDataDisk `json:"dataDisks,omitempty"` 5359 // 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). 5360 ZoneResilient *bool `json:"zoneResilient,omitempty"` 5361} 5362 5363// ImagesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. 5364type ImagesUpdateFuture struct { 5365 azure.FutureAPI 5366 // Result returns the result of the asynchronous operation. 5367 // If the operation has not completed it will return an error. 5368 Result func(ImagesClient) (Image, error) 5369} 5370 5371// ImageUpdate the source user image virtual hard disk. Only tags may be updated. 5372type ImageUpdate struct { 5373 *ImageProperties `json:"properties,omitempty"` 5374 // Tags - Resource tags 5375 Tags map[string]*string `json:"tags"` 5376} 5377 5378// MarshalJSON is the custom marshaler for ImageUpdate. 5379func (iu ImageUpdate) MarshalJSON() ([]byte, error) { 5380 objectMap := make(map[string]interface{}) 5381 if iu.ImageProperties != nil { 5382 objectMap["properties"] = iu.ImageProperties 5383 } 5384 if iu.Tags != nil { 5385 objectMap["tags"] = iu.Tags 5386 } 5387 return json.Marshal(objectMap) 5388} 5389 5390// UnmarshalJSON is the custom unmarshaler for ImageUpdate struct. 5391func (iu *ImageUpdate) UnmarshalJSON(body []byte) error { 5392 var m map[string]*json.RawMessage 5393 err := json.Unmarshal(body, &m) 5394 if err != nil { 5395 return err 5396 } 5397 for k, v := range m { 5398 switch k { 5399 case "properties": 5400 if v != nil { 5401 var imageProperties ImageProperties 5402 err = json.Unmarshal(*v, &imageProperties) 5403 if err != nil { 5404 return err 5405 } 5406 iu.ImageProperties = &imageProperties 5407 } 5408 case "tags": 5409 if v != nil { 5410 var tags map[string]*string 5411 err = json.Unmarshal(*v, &tags) 5412 if err != nil { 5413 return err 5414 } 5415 iu.Tags = tags 5416 } 5417 } 5418 } 5419 5420 return nil 5421} 5422 5423// InnerError inner error details. 5424type InnerError struct { 5425 // Exceptiontype - The exception type. 5426 Exceptiontype *string `json:"exceptiontype,omitempty"` 5427 // Errordetail - The internal error message or exception dump. 5428 Errordetail *string `json:"errordetail,omitempty"` 5429} 5430 5431// InstanceViewStatus instance view status. 5432type InstanceViewStatus struct { 5433 // Code - The status code. 5434 Code *string `json:"code,omitempty"` 5435 // Level - The level code. Possible values include: 'Info', 'Warning', 'Error' 5436 Level StatusLevelTypes `json:"level,omitempty"` 5437 // DisplayStatus - The short localizable label for the status. 5438 DisplayStatus *string `json:"displayStatus,omitempty"` 5439 // Message - The detailed status message, including for alerts and error messages. 5440 Message *string `json:"message,omitempty"` 5441 // Time - The time of the status. 5442 Time *date.Time `json:"time,omitempty"` 5443} 5444 5445// KeyVaultAndKeyReference key Vault Key Url and vault id of KeK, KeK is optional and when provided is used 5446// to unwrap the encryptionKey 5447type KeyVaultAndKeyReference struct { 5448 // SourceVault - Resource id of the KeyVault containing the key or secret 5449 SourceVault *SourceVault `json:"sourceVault,omitempty"` 5450 // KeyURL - Url pointing to a key or secret in KeyVault 5451 KeyURL *string `json:"keyUrl,omitempty"` 5452} 5453 5454// KeyVaultAndSecretReference key Vault Secret Url and vault id of the encryption key 5455type KeyVaultAndSecretReference struct { 5456 // SourceVault - Resource id of the KeyVault containing the key or secret 5457 SourceVault *SourceVault `json:"sourceVault,omitempty"` 5458 // SecretURL - Url pointing to a key or secret in KeyVault 5459 SecretURL *string `json:"secretUrl,omitempty"` 5460} 5461 5462// KeyVaultKeyReference describes a reference to Key Vault Key 5463type KeyVaultKeyReference struct { 5464 // KeyURL - The URL referencing a key encryption key in Key Vault. 5465 KeyURL *string `json:"keyUrl,omitempty"` 5466 // SourceVault - The relative URL of the Key Vault containing the key. 5467 SourceVault *SubResource `json:"sourceVault,omitempty"` 5468} 5469 5470// KeyVaultSecretReference describes a reference to Key Vault Secret 5471type KeyVaultSecretReference struct { 5472 // SecretURL - The URL referencing a secret in a Key Vault. 5473 SecretURL *string `json:"secretUrl,omitempty"` 5474 // SourceVault - The relative URL of the Key Vault containing the secret. 5475 SourceVault *SubResource `json:"sourceVault,omitempty"` 5476} 5477 5478// LinuxConfiguration specifies the Linux operating system settings on the virtual machine. <br><br>For a 5479// list of supported Linux distributions, see [Linux on Azure-Endorsed 5480// Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) 5481// <br><br> For running non-endorsed distributions, see [Information for Non-Endorsed 5482// Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). 5483type LinuxConfiguration struct { 5484 // DisablePasswordAuthentication - Specifies whether password authentication should be disabled. 5485 DisablePasswordAuthentication *bool `json:"disablePasswordAuthentication,omitempty"` 5486 // SSH - Specifies the ssh key configuration for a Linux OS. 5487 SSH *SSHConfiguration `json:"ssh,omitempty"` 5488 // 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. 5489 ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` 5490} 5491 5492// ListUsagesResult the List Usages operation response. 5493type ListUsagesResult struct { 5494 autorest.Response `json:"-"` 5495 // Value - The list of compute resource usages. 5496 Value *[]Usage `json:"value,omitempty"` 5497 // 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. 5498 NextLink *string `json:"nextLink,omitempty"` 5499} 5500 5501// ListUsagesResultIterator provides access to a complete listing of Usage values. 5502type ListUsagesResultIterator struct { 5503 i int 5504 page ListUsagesResultPage 5505} 5506 5507// NextWithContext advances to the next value. If there was an error making 5508// the request the iterator does not advance and the error is returned. 5509func (iter *ListUsagesResultIterator) NextWithContext(ctx context.Context) (err error) { 5510 if tracing.IsEnabled() { 5511 ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultIterator.NextWithContext") 5512 defer func() { 5513 sc := -1 5514 if iter.Response().Response.Response != nil { 5515 sc = iter.Response().Response.Response.StatusCode 5516 } 5517 tracing.EndSpan(ctx, sc, err) 5518 }() 5519 } 5520 iter.i++ 5521 if iter.i < len(iter.page.Values()) { 5522 return nil 5523 } 5524 err = iter.page.NextWithContext(ctx) 5525 if err != nil { 5526 iter.i-- 5527 return err 5528 } 5529 iter.i = 0 5530 return nil 5531} 5532 5533// Next advances to the next value. If there was an error making 5534// the request the iterator does not advance and the error is returned. 5535// Deprecated: Use NextWithContext() instead. 5536func (iter *ListUsagesResultIterator) Next() error { 5537 return iter.NextWithContext(context.Background()) 5538} 5539 5540// NotDone returns true if the enumeration should be started or is not yet complete. 5541func (iter ListUsagesResultIterator) NotDone() bool { 5542 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5543} 5544 5545// Response returns the raw server response from the last page request. 5546func (iter ListUsagesResultIterator) Response() ListUsagesResult { 5547 return iter.page.Response() 5548} 5549 5550// Value returns the current value or a zero-initialized value if the 5551// iterator has advanced beyond the end of the collection. 5552func (iter ListUsagesResultIterator) Value() Usage { 5553 if !iter.page.NotDone() { 5554 return Usage{} 5555 } 5556 return iter.page.Values()[iter.i] 5557} 5558 5559// Creates a new instance of the ListUsagesResultIterator type. 5560func NewListUsagesResultIterator(page ListUsagesResultPage) ListUsagesResultIterator { 5561 return ListUsagesResultIterator{page: page} 5562} 5563 5564// IsEmpty returns true if the ListResult contains no values. 5565func (lur ListUsagesResult) IsEmpty() bool { 5566 return lur.Value == nil || len(*lur.Value) == 0 5567} 5568 5569// hasNextLink returns true if the NextLink is not empty. 5570func (lur ListUsagesResult) hasNextLink() bool { 5571 return lur.NextLink != nil && len(*lur.NextLink) != 0 5572} 5573 5574// listUsagesResultPreparer prepares a request to retrieve the next set of results. 5575// It returns nil if no more results exist. 5576func (lur ListUsagesResult) listUsagesResultPreparer(ctx context.Context) (*http.Request, error) { 5577 if !lur.hasNextLink() { 5578 return nil, nil 5579 } 5580 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5581 autorest.AsJSON(), 5582 autorest.AsGet(), 5583 autorest.WithBaseURL(to.String(lur.NextLink))) 5584} 5585 5586// ListUsagesResultPage contains a page of Usage values. 5587type ListUsagesResultPage struct { 5588 fn func(context.Context, ListUsagesResult) (ListUsagesResult, error) 5589 lur ListUsagesResult 5590} 5591 5592// NextWithContext advances to the next page of values. If there was an error making 5593// the request the page does not advance and the error is returned. 5594func (page *ListUsagesResultPage) NextWithContext(ctx context.Context) (err error) { 5595 if tracing.IsEnabled() { 5596 ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultPage.NextWithContext") 5597 defer func() { 5598 sc := -1 5599 if page.Response().Response.Response != nil { 5600 sc = page.Response().Response.Response.StatusCode 5601 } 5602 tracing.EndSpan(ctx, sc, err) 5603 }() 5604 } 5605 for { 5606 next, err := page.fn(ctx, page.lur) 5607 if err != nil { 5608 return err 5609 } 5610 page.lur = next 5611 if !next.hasNextLink() || !next.IsEmpty() { 5612 break 5613 } 5614 } 5615 return nil 5616} 5617 5618// Next advances to the next page of values. If there was an error making 5619// the request the page does not advance and the error is returned. 5620// Deprecated: Use NextWithContext() instead. 5621func (page *ListUsagesResultPage) Next() error { 5622 return page.NextWithContext(context.Background()) 5623} 5624 5625// NotDone returns true if the page enumeration should be started or is not yet complete. 5626func (page ListUsagesResultPage) NotDone() bool { 5627 return !page.lur.IsEmpty() 5628} 5629 5630// Response returns the raw server response from the last page request. 5631func (page ListUsagesResultPage) Response() ListUsagesResult { 5632 return page.lur 5633} 5634 5635// Values returns the slice of values for the current page or nil if there are no values. 5636func (page ListUsagesResultPage) Values() []Usage { 5637 if page.lur.IsEmpty() { 5638 return nil 5639 } 5640 return *page.lur.Value 5641} 5642 5643// Creates a new instance of the ListUsagesResultPage type. 5644func NewListUsagesResultPage(cur ListUsagesResult, getNextPage func(context.Context, ListUsagesResult) (ListUsagesResult, error)) ListUsagesResultPage { 5645 return ListUsagesResultPage{ 5646 fn: getNextPage, 5647 lur: cur, 5648 } 5649} 5650 5651// ListVirtualMachineExtensionImage ... 5652type ListVirtualMachineExtensionImage struct { 5653 autorest.Response `json:"-"` 5654 Value *[]VirtualMachineExtensionImage `json:"value,omitempty"` 5655} 5656 5657// ListVirtualMachineImageResource ... 5658type ListVirtualMachineImageResource struct { 5659 autorest.Response `json:"-"` 5660 Value *[]VirtualMachineImageResource `json:"value,omitempty"` 5661} 5662 5663// LogAnalyticsExportRequestRateByIntervalFuture an abstraction for monitoring and retrieving the results 5664// of a long-running operation. 5665type LogAnalyticsExportRequestRateByIntervalFuture struct { 5666 azure.FutureAPI 5667 // Result returns the result of the asynchronous operation. 5668 // If the operation has not completed it will return an error. 5669 Result func(LogAnalyticsClient) (LogAnalyticsOperationResult, error) 5670} 5671 5672// LogAnalyticsExportThrottledRequestsFuture an abstraction for monitoring and retrieving the results of a 5673// long-running operation. 5674type LogAnalyticsExportThrottledRequestsFuture struct { 5675 azure.FutureAPI 5676 // Result returns the result of the asynchronous operation. 5677 // If the operation has not completed it will return an error. 5678 Result func(LogAnalyticsClient) (LogAnalyticsOperationResult, error) 5679} 5680 5681// LogAnalyticsInputBase api input base class for LogAnalytics Api. 5682type LogAnalyticsInputBase struct { 5683 // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. 5684 BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` 5685 // FromTime - From time of the query 5686 FromTime *date.Time `json:"fromTime,omitempty"` 5687 // ToTime - To time of the query 5688 ToTime *date.Time `json:"toTime,omitempty"` 5689 // GroupByThrottlePolicy - Group query result by Throttle Policy applied. 5690 GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` 5691 // GroupByOperationName - Group query result by Operation Name. 5692 GroupByOperationName *bool `json:"groupByOperationName,omitempty"` 5693 // GroupByResourceName - Group query result by Resource Name. 5694 GroupByResourceName *bool `json:"groupByResourceName,omitempty"` 5695} 5696 5697// LogAnalyticsOperationResult logAnalytics operation status response 5698type LogAnalyticsOperationResult struct { 5699 autorest.Response `json:"-"` 5700 // Properties - READ-ONLY; LogAnalyticsOutput 5701 Properties *LogAnalyticsOutput `json:"properties,omitempty"` 5702} 5703 5704// LogAnalyticsOutput logAnalytics output properties 5705type LogAnalyticsOutput struct { 5706 // Output - READ-ONLY; Output file Uri path to blob container. 5707 Output *string `json:"output,omitempty"` 5708} 5709 5710// MaintenanceRedeployStatus maintenance Operation Status. 5711type MaintenanceRedeployStatus struct { 5712 // IsCustomerInitiatedMaintenanceAllowed - True, if customer is allowed to perform Maintenance. 5713 IsCustomerInitiatedMaintenanceAllowed *bool `json:"isCustomerInitiatedMaintenanceAllowed,omitempty"` 5714 // PreMaintenanceWindowStartTime - Start Time for the Pre Maintenance Window. 5715 PreMaintenanceWindowStartTime *date.Time `json:"preMaintenanceWindowStartTime,omitempty"` 5716 // PreMaintenanceWindowEndTime - End Time for the Pre Maintenance Window. 5717 PreMaintenanceWindowEndTime *date.Time `json:"preMaintenanceWindowEndTime,omitempty"` 5718 // MaintenanceWindowStartTime - Start Time for the Maintenance Window. 5719 MaintenanceWindowStartTime *date.Time `json:"maintenanceWindowStartTime,omitempty"` 5720 // MaintenanceWindowEndTime - End Time for the Maintenance Window. 5721 MaintenanceWindowEndTime *date.Time `json:"maintenanceWindowEndTime,omitempty"` 5722 // LastOperationResultCode - The Last Maintenance Operation Result Code. Possible values include: 'MaintenanceOperationResultCodeTypesNone', 'MaintenanceOperationResultCodeTypesRetryLater', 'MaintenanceOperationResultCodeTypesMaintenanceAborted', 'MaintenanceOperationResultCodeTypesMaintenanceCompleted' 5723 LastOperationResultCode MaintenanceOperationResultCodeTypes `json:"lastOperationResultCode,omitempty"` 5724 // LastOperationMessage - Message returned for the last Maintenance Operation. 5725 LastOperationMessage *string `json:"lastOperationMessage,omitempty"` 5726} 5727 5728// ManagedArtifact the managed artifact. 5729type ManagedArtifact struct { 5730 // ID - The managed artifact id. 5731 ID *string `json:"id,omitempty"` 5732} 5733 5734// ManagedDiskParameters the parameters of a managed disk. 5735type ManagedDiskParameters struct { 5736 // 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' 5737 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 5738 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed disk. 5739 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 5740 // ID - Resource Id 5741 ID *string `json:"id,omitempty"` 5742} 5743 5744// NetworkInterfaceReference describes a network interface reference. 5745type NetworkInterfaceReference struct { 5746 *NetworkInterfaceReferenceProperties `json:"properties,omitempty"` 5747 // ID - Resource Id 5748 ID *string `json:"id,omitempty"` 5749} 5750 5751// MarshalJSON is the custom marshaler for NetworkInterfaceReference. 5752func (nir NetworkInterfaceReference) MarshalJSON() ([]byte, error) { 5753 objectMap := make(map[string]interface{}) 5754 if nir.NetworkInterfaceReferenceProperties != nil { 5755 objectMap["properties"] = nir.NetworkInterfaceReferenceProperties 5756 } 5757 if nir.ID != nil { 5758 objectMap["id"] = nir.ID 5759 } 5760 return json.Marshal(objectMap) 5761} 5762 5763// UnmarshalJSON is the custom unmarshaler for NetworkInterfaceReference struct. 5764func (nir *NetworkInterfaceReference) UnmarshalJSON(body []byte) error { 5765 var m map[string]*json.RawMessage 5766 err := json.Unmarshal(body, &m) 5767 if err != nil { 5768 return err 5769 } 5770 for k, v := range m { 5771 switch k { 5772 case "properties": 5773 if v != nil { 5774 var networkInterfaceReferenceProperties NetworkInterfaceReferenceProperties 5775 err = json.Unmarshal(*v, &networkInterfaceReferenceProperties) 5776 if err != nil { 5777 return err 5778 } 5779 nir.NetworkInterfaceReferenceProperties = &networkInterfaceReferenceProperties 5780 } 5781 case "id": 5782 if v != nil { 5783 var ID string 5784 err = json.Unmarshal(*v, &ID) 5785 if err != nil { 5786 return err 5787 } 5788 nir.ID = &ID 5789 } 5790 } 5791 } 5792 5793 return nil 5794} 5795 5796// NetworkInterfaceReferenceProperties describes a network interface reference properties. 5797type NetworkInterfaceReferenceProperties struct { 5798 // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. 5799 Primary *bool `json:"primary,omitempty"` 5800} 5801 5802// NetworkProfile specifies the network interfaces of the virtual machine. 5803type NetworkProfile struct { 5804 // NetworkInterfaces - Specifies the list of resource Ids for the network interfaces associated with the virtual machine. 5805 NetworkInterfaces *[]NetworkInterfaceReference `json:"networkInterfaces,omitempty"` 5806} 5807 5808// OperationListResult the List Compute Operation operation response. 5809type OperationListResult struct { 5810 autorest.Response `json:"-"` 5811 // Value - READ-ONLY; The list of compute operations 5812 Value *[]OperationValue `json:"value,omitempty"` 5813} 5814 5815// OperationValue describes the properties of a Compute Operation value. 5816type OperationValue struct { 5817 // Origin - READ-ONLY; The origin of the compute operation. 5818 Origin *string `json:"origin,omitempty"` 5819 // Name - READ-ONLY; The name of the compute operation. 5820 Name *string `json:"name,omitempty"` 5821 *OperationValueDisplay `json:"display,omitempty"` 5822} 5823 5824// MarshalJSON is the custom marshaler for OperationValue. 5825func (ov OperationValue) MarshalJSON() ([]byte, error) { 5826 objectMap := make(map[string]interface{}) 5827 if ov.OperationValueDisplay != nil { 5828 objectMap["display"] = ov.OperationValueDisplay 5829 } 5830 return json.Marshal(objectMap) 5831} 5832 5833// UnmarshalJSON is the custom unmarshaler for OperationValue struct. 5834func (ov *OperationValue) UnmarshalJSON(body []byte) error { 5835 var m map[string]*json.RawMessage 5836 err := json.Unmarshal(body, &m) 5837 if err != nil { 5838 return err 5839 } 5840 for k, v := range m { 5841 switch k { 5842 case "origin": 5843 if v != nil { 5844 var origin string 5845 err = json.Unmarshal(*v, &origin) 5846 if err != nil { 5847 return err 5848 } 5849 ov.Origin = &origin 5850 } 5851 case "name": 5852 if v != nil { 5853 var name string 5854 err = json.Unmarshal(*v, &name) 5855 if err != nil { 5856 return err 5857 } 5858 ov.Name = &name 5859 } 5860 case "display": 5861 if v != nil { 5862 var operationValueDisplay OperationValueDisplay 5863 err = json.Unmarshal(*v, &operationValueDisplay) 5864 if err != nil { 5865 return err 5866 } 5867 ov.OperationValueDisplay = &operationValueDisplay 5868 } 5869 } 5870 } 5871 5872 return nil 5873} 5874 5875// OperationValueDisplay describes the properties of a Compute Operation Value Display. 5876type OperationValueDisplay struct { 5877 // Operation - READ-ONLY; The display name of the compute operation. 5878 Operation *string `json:"operation,omitempty"` 5879 // Resource - READ-ONLY; The display name of the resource the operation applies to. 5880 Resource *string `json:"resource,omitempty"` 5881 // Description - READ-ONLY; The description of the operation. 5882 Description *string `json:"description,omitempty"` 5883 // Provider - READ-ONLY; The resource provider for the operation. 5884 Provider *string `json:"provider,omitempty"` 5885} 5886 5887// OSDisk specifies information about the operating system disk used by the virtual machine. <br><br> For 5888// more information about disks, see [About disks and VHDs for Azure virtual 5889// machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). 5890type OSDisk struct { 5891 // 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' 5892 OsType OperatingSystemTypes `json:"osType,omitempty"` 5893 // EncryptionSettings - Specifies the encryption settings for the OS Disk. <br><br> Minimum api-version: 2015-06-15 5894 EncryptionSettings *DiskEncryptionSettings `json:"encryptionSettings,omitempty"` 5895 // Name - The disk name. 5896 Name *string `json:"name,omitempty"` 5897 // Vhd - The virtual hard disk. 5898 Vhd *VirtualHardDisk `json:"vhd,omitempty"` 5899 // 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. 5900 Image *VirtualHardDisk `json:"image,omitempty"` 5901 // 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' 5902 Caching CachingTypes `json:"caching,omitempty"` 5903 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 5904 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 5905 // DiffDiskSettings - Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine. 5906 DiffDiskSettings *DiffDiskSettings `json:"diffDiskSettings,omitempty"` 5907 // 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' 5908 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 5909 // 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 5910 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 5911 // ManagedDisk - The managed disk parameters. 5912 ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` 5913} 5914 5915// OSDiskImage contains the os disk image information. 5916type OSDiskImage struct { 5917 // OperatingSystem - The operating system of the osDiskImage. Possible values include: 'Windows', 'Linux' 5918 OperatingSystem OperatingSystemTypes `json:"operatingSystem,omitempty"` 5919} 5920 5921// OSProfile specifies the operating system settings for the virtual machine. Some of the settings cannot 5922// be changed once VM is provisioned. 5923type OSProfile struct { 5924 // 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). 5925 ComputerName *string `json:"computerName,omitempty"` 5926 // 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) 5927 AdminUsername *string `json:"adminUsername,omitempty"` 5928 // 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) 5929 AdminPassword *string `json:"adminPassword,omitempty"` 5930 // 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://docs.microsoft.com/azure/virtual-machines/custom-data) <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) 5931 CustomData *string `json:"customData,omitempty"` 5932 // WindowsConfiguration - Specifies Windows operating system settings on the virtual machine. 5933 WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` 5934 // 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). 5935 LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` 5936 // Secrets - Specifies set of certificates that should be installed onto the virtual machine. 5937 Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` 5938 // 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. 5939 AllowExtensionOperations *bool `json:"allowExtensionOperations,omitempty"` 5940 // RequireGuestProvisionSignal - Specifies whether the guest provision signal is required to infer provision success of the virtual machine. 5941 RequireGuestProvisionSignal *bool `json:"requireGuestProvisionSignal,omitempty"` 5942} 5943 5944// Plan specifies information about the marketplace image used to create the virtual machine. This element 5945// is only used for marketplace images. Before you can use a marketplace image from an API, you must enable 5946// the image for programmatic use. In the Azure portal, find the marketplace image that you want to use 5947// and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and 5948// then click **Save**. 5949type Plan struct { 5950 // Name - The plan ID. 5951 Name *string `json:"name,omitempty"` 5952 // Publisher - The publisher ID. 5953 Publisher *string `json:"publisher,omitempty"` 5954 // Product - Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. 5955 Product *string `json:"product,omitempty"` 5956 // PromotionCode - The promotion code. 5957 PromotionCode *string `json:"promotionCode,omitempty"` 5958} 5959 5960// ProximityPlacementGroup specifies information about the proximity placement group. 5961type ProximityPlacementGroup struct { 5962 autorest.Response `json:"-"` 5963 // ProximityPlacementGroupProperties - Describes the properties of a Proximity Placement Group. 5964 *ProximityPlacementGroupProperties `json:"properties,omitempty"` 5965 // ID - READ-ONLY; Resource Id 5966 ID *string `json:"id,omitempty"` 5967 // Name - READ-ONLY; Resource name 5968 Name *string `json:"name,omitempty"` 5969 // Type - READ-ONLY; Resource type 5970 Type *string `json:"type,omitempty"` 5971 // Location - Resource location 5972 Location *string `json:"location,omitempty"` 5973 // Tags - Resource tags 5974 Tags map[string]*string `json:"tags"` 5975} 5976 5977// MarshalJSON is the custom marshaler for ProximityPlacementGroup. 5978func (ppg ProximityPlacementGroup) MarshalJSON() ([]byte, error) { 5979 objectMap := make(map[string]interface{}) 5980 if ppg.ProximityPlacementGroupProperties != nil { 5981 objectMap["properties"] = ppg.ProximityPlacementGroupProperties 5982 } 5983 if ppg.Location != nil { 5984 objectMap["location"] = ppg.Location 5985 } 5986 if ppg.Tags != nil { 5987 objectMap["tags"] = ppg.Tags 5988 } 5989 return json.Marshal(objectMap) 5990} 5991 5992// UnmarshalJSON is the custom unmarshaler for ProximityPlacementGroup struct. 5993func (ppg *ProximityPlacementGroup) UnmarshalJSON(body []byte) error { 5994 var m map[string]*json.RawMessage 5995 err := json.Unmarshal(body, &m) 5996 if err != nil { 5997 return err 5998 } 5999 for k, v := range m { 6000 switch k { 6001 case "properties": 6002 if v != nil { 6003 var proximityPlacementGroupProperties ProximityPlacementGroupProperties 6004 err = json.Unmarshal(*v, &proximityPlacementGroupProperties) 6005 if err != nil { 6006 return err 6007 } 6008 ppg.ProximityPlacementGroupProperties = &proximityPlacementGroupProperties 6009 } 6010 case "id": 6011 if v != nil { 6012 var ID string 6013 err = json.Unmarshal(*v, &ID) 6014 if err != nil { 6015 return err 6016 } 6017 ppg.ID = &ID 6018 } 6019 case "name": 6020 if v != nil { 6021 var name string 6022 err = json.Unmarshal(*v, &name) 6023 if err != nil { 6024 return err 6025 } 6026 ppg.Name = &name 6027 } 6028 case "type": 6029 if v != nil { 6030 var typeVar string 6031 err = json.Unmarshal(*v, &typeVar) 6032 if err != nil { 6033 return err 6034 } 6035 ppg.Type = &typeVar 6036 } 6037 case "location": 6038 if v != nil { 6039 var location string 6040 err = json.Unmarshal(*v, &location) 6041 if err != nil { 6042 return err 6043 } 6044 ppg.Location = &location 6045 } 6046 case "tags": 6047 if v != nil { 6048 var tags map[string]*string 6049 err = json.Unmarshal(*v, &tags) 6050 if err != nil { 6051 return err 6052 } 6053 ppg.Tags = tags 6054 } 6055 } 6056 } 6057 6058 return nil 6059} 6060 6061// ProximityPlacementGroupListResult the List Proximity Placement Group operation response. 6062type ProximityPlacementGroupListResult struct { 6063 autorest.Response `json:"-"` 6064 // Value - The list of proximity placement groups 6065 Value *[]ProximityPlacementGroup `json:"value,omitempty"` 6066 // NextLink - The URI to fetch the next page of proximity placement groups. 6067 NextLink *string `json:"nextLink,omitempty"` 6068} 6069 6070// ProximityPlacementGroupListResultIterator provides access to a complete listing of 6071// ProximityPlacementGroup values. 6072type ProximityPlacementGroupListResultIterator struct { 6073 i int 6074 page ProximityPlacementGroupListResultPage 6075} 6076 6077// NextWithContext advances to the next value. If there was an error making 6078// the request the iterator does not advance and the error is returned. 6079func (iter *ProximityPlacementGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { 6080 if tracing.IsEnabled() { 6081 ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupListResultIterator.NextWithContext") 6082 defer func() { 6083 sc := -1 6084 if iter.Response().Response.Response != nil { 6085 sc = iter.Response().Response.Response.StatusCode 6086 } 6087 tracing.EndSpan(ctx, sc, err) 6088 }() 6089 } 6090 iter.i++ 6091 if iter.i < len(iter.page.Values()) { 6092 return nil 6093 } 6094 err = iter.page.NextWithContext(ctx) 6095 if err != nil { 6096 iter.i-- 6097 return err 6098 } 6099 iter.i = 0 6100 return nil 6101} 6102 6103// Next advances to the next value. If there was an error making 6104// the request the iterator does not advance and the error is returned. 6105// Deprecated: Use NextWithContext() instead. 6106func (iter *ProximityPlacementGroupListResultIterator) Next() error { 6107 return iter.NextWithContext(context.Background()) 6108} 6109 6110// NotDone returns true if the enumeration should be started or is not yet complete. 6111func (iter ProximityPlacementGroupListResultIterator) NotDone() bool { 6112 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6113} 6114 6115// Response returns the raw server response from the last page request. 6116func (iter ProximityPlacementGroupListResultIterator) Response() ProximityPlacementGroupListResult { 6117 return iter.page.Response() 6118} 6119 6120// Value returns the current value or a zero-initialized value if the 6121// iterator has advanced beyond the end of the collection. 6122func (iter ProximityPlacementGroupListResultIterator) Value() ProximityPlacementGroup { 6123 if !iter.page.NotDone() { 6124 return ProximityPlacementGroup{} 6125 } 6126 return iter.page.Values()[iter.i] 6127} 6128 6129// Creates a new instance of the ProximityPlacementGroupListResultIterator type. 6130func NewProximityPlacementGroupListResultIterator(page ProximityPlacementGroupListResultPage) ProximityPlacementGroupListResultIterator { 6131 return ProximityPlacementGroupListResultIterator{page: page} 6132} 6133 6134// IsEmpty returns true if the ListResult contains no values. 6135func (ppglr ProximityPlacementGroupListResult) IsEmpty() bool { 6136 return ppglr.Value == nil || len(*ppglr.Value) == 0 6137} 6138 6139// hasNextLink returns true if the NextLink is not empty. 6140func (ppglr ProximityPlacementGroupListResult) hasNextLink() bool { 6141 return ppglr.NextLink != nil && len(*ppglr.NextLink) != 0 6142} 6143 6144// proximityPlacementGroupListResultPreparer prepares a request to retrieve the next set of results. 6145// It returns nil if no more results exist. 6146func (ppglr ProximityPlacementGroupListResult) proximityPlacementGroupListResultPreparer(ctx context.Context) (*http.Request, error) { 6147 if !ppglr.hasNextLink() { 6148 return nil, nil 6149 } 6150 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6151 autorest.AsJSON(), 6152 autorest.AsGet(), 6153 autorest.WithBaseURL(to.String(ppglr.NextLink))) 6154} 6155 6156// ProximityPlacementGroupListResultPage contains a page of ProximityPlacementGroup values. 6157type ProximityPlacementGroupListResultPage struct { 6158 fn func(context.Context, ProximityPlacementGroupListResult) (ProximityPlacementGroupListResult, error) 6159 ppglr ProximityPlacementGroupListResult 6160} 6161 6162// NextWithContext advances to the next page of values. If there was an error making 6163// the request the page does not advance and the error is returned. 6164func (page *ProximityPlacementGroupListResultPage) NextWithContext(ctx context.Context) (err error) { 6165 if tracing.IsEnabled() { 6166 ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupListResultPage.NextWithContext") 6167 defer func() { 6168 sc := -1 6169 if page.Response().Response.Response != nil { 6170 sc = page.Response().Response.Response.StatusCode 6171 } 6172 tracing.EndSpan(ctx, sc, err) 6173 }() 6174 } 6175 for { 6176 next, err := page.fn(ctx, page.ppglr) 6177 if err != nil { 6178 return err 6179 } 6180 page.ppglr = next 6181 if !next.hasNextLink() || !next.IsEmpty() { 6182 break 6183 } 6184 } 6185 return nil 6186} 6187 6188// Next advances to the next page of values. If there was an error making 6189// the request the page does not advance and the error is returned. 6190// Deprecated: Use NextWithContext() instead. 6191func (page *ProximityPlacementGroupListResultPage) Next() error { 6192 return page.NextWithContext(context.Background()) 6193} 6194 6195// NotDone returns true if the page enumeration should be started or is not yet complete. 6196func (page ProximityPlacementGroupListResultPage) NotDone() bool { 6197 return !page.ppglr.IsEmpty() 6198} 6199 6200// Response returns the raw server response from the last page request. 6201func (page ProximityPlacementGroupListResultPage) Response() ProximityPlacementGroupListResult { 6202 return page.ppglr 6203} 6204 6205// Values returns the slice of values for the current page or nil if there are no values. 6206func (page ProximityPlacementGroupListResultPage) Values() []ProximityPlacementGroup { 6207 if page.ppglr.IsEmpty() { 6208 return nil 6209 } 6210 return *page.ppglr.Value 6211} 6212 6213// Creates a new instance of the ProximityPlacementGroupListResultPage type. 6214func NewProximityPlacementGroupListResultPage(cur ProximityPlacementGroupListResult, getNextPage func(context.Context, ProximityPlacementGroupListResult) (ProximityPlacementGroupListResult, error)) ProximityPlacementGroupListResultPage { 6215 return ProximityPlacementGroupListResultPage{ 6216 fn: getNextPage, 6217 ppglr: cur, 6218 } 6219} 6220 6221// ProximityPlacementGroupProperties describes the properties of a Proximity Placement Group. 6222type ProximityPlacementGroupProperties struct { 6223 // 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' 6224 ProximityPlacementGroupType ProximityPlacementGroupType `json:"proximityPlacementGroupType,omitempty"` 6225 // VirtualMachines - READ-ONLY; A list of references to all virtual machines in the proximity placement group. 6226 VirtualMachines *[]SubResourceWithColocationStatus `json:"virtualMachines,omitempty"` 6227 // VirtualMachineScaleSets - READ-ONLY; A list of references to all virtual machine scale sets in the proximity placement group. 6228 VirtualMachineScaleSets *[]SubResourceWithColocationStatus `json:"virtualMachineScaleSets,omitempty"` 6229 // AvailabilitySets - READ-ONLY; A list of references to all availability sets in the proximity placement group. 6230 AvailabilitySets *[]SubResourceWithColocationStatus `json:"availabilitySets,omitempty"` 6231 // ColocationStatus - Describes colocation status of the Proximity Placement Group. 6232 ColocationStatus *InstanceViewStatus `json:"colocationStatus,omitempty"` 6233} 6234 6235// MarshalJSON is the custom marshaler for ProximityPlacementGroupProperties. 6236func (ppgp ProximityPlacementGroupProperties) MarshalJSON() ([]byte, error) { 6237 objectMap := make(map[string]interface{}) 6238 if ppgp.ProximityPlacementGroupType != "" { 6239 objectMap["proximityPlacementGroupType"] = ppgp.ProximityPlacementGroupType 6240 } 6241 if ppgp.ColocationStatus != nil { 6242 objectMap["colocationStatus"] = ppgp.ColocationStatus 6243 } 6244 return json.Marshal(objectMap) 6245} 6246 6247// ProximityPlacementGroupUpdate specifies information about the proximity placement group. 6248type ProximityPlacementGroupUpdate struct { 6249 // Tags - Resource tags 6250 Tags map[string]*string `json:"tags"` 6251} 6252 6253// MarshalJSON is the custom marshaler for ProximityPlacementGroupUpdate. 6254func (ppgu ProximityPlacementGroupUpdate) MarshalJSON() ([]byte, error) { 6255 objectMap := make(map[string]interface{}) 6256 if ppgu.Tags != nil { 6257 objectMap["tags"] = ppgu.Tags 6258 } 6259 return json.Marshal(objectMap) 6260} 6261 6262// PurchasePlan used for establishing the purchase context of any 3rd Party artifact through MarketPlace. 6263type PurchasePlan struct { 6264 // Publisher - The publisher ID. 6265 Publisher *string `json:"publisher,omitempty"` 6266 // Name - The plan ID. 6267 Name *string `json:"name,omitempty"` 6268 // Product - Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. 6269 Product *string `json:"product,omitempty"` 6270} 6271 6272// RecommendedMachineConfiguration the properties describe the recommended machine configuration for this 6273// Image Definition. These properties are updatable. 6274type RecommendedMachineConfiguration struct { 6275 VCPUs *ResourceRange `json:"vCPUs,omitempty"` 6276 Memory *ResourceRange `json:"memory,omitempty"` 6277} 6278 6279// RecoveryWalkResponse response after calling a manual recovery walk 6280type RecoveryWalkResponse struct { 6281 autorest.Response `json:"-"` 6282 // WalkPerformed - READ-ONLY; Whether the recovery walk was performed 6283 WalkPerformed *bool `json:"walkPerformed,omitempty"` 6284 // NextPlatformUpdateDomain - READ-ONLY; The next update domain that needs to be walked. Null means walk spanning all update domains has been completed 6285 NextPlatformUpdateDomain *int32 `json:"nextPlatformUpdateDomain,omitempty"` 6286} 6287 6288// RegionalReplicationStatus this is the regional replication status. 6289type RegionalReplicationStatus struct { 6290 // Region - READ-ONLY; The region to which the gallery Image Version is being replicated to. 6291 Region *string `json:"region,omitempty"` 6292 // State - READ-ONLY; This is the regional replication state. Possible values include: 'ReplicationStateUnknown', 'ReplicationStateReplicating', 'ReplicationStateCompleted', 'ReplicationStateFailed' 6293 State ReplicationState `json:"state,omitempty"` 6294 // Details - READ-ONLY; The details of the replication status. 6295 Details *string `json:"details,omitempty"` 6296 // Progress - READ-ONLY; It indicates progress of the replication job. 6297 Progress *int32 `json:"progress,omitempty"` 6298} 6299 6300// ReplicationStatus this is the replication status of the gallery Image Version. 6301type ReplicationStatus struct { 6302 // AggregatedState - READ-ONLY; This is the aggregated replication status based on all the regional replication status flags. Possible values include: 'Unknown', 'InProgress', 'Completed', 'Failed' 6303 AggregatedState AggregatedReplicationState `json:"aggregatedState,omitempty"` 6304 // Summary - READ-ONLY; This is a summary of replication status for each region. 6305 Summary *[]RegionalReplicationStatus `json:"summary,omitempty"` 6306} 6307 6308// RequestRateByIntervalInput api request input for LogAnalytics getRequestRateByInterval Api. 6309type RequestRateByIntervalInput struct { 6310 // IntervalLength - Interval value in minutes used to create LogAnalytics call rate logs. Possible values include: 'ThreeMins', 'FiveMins', 'ThirtyMins', 'SixtyMins' 6311 IntervalLength IntervalInMins `json:"intervalLength,omitempty"` 6312 // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. 6313 BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` 6314 // FromTime - From time of the query 6315 FromTime *date.Time `json:"fromTime,omitempty"` 6316 // ToTime - To time of the query 6317 ToTime *date.Time `json:"toTime,omitempty"` 6318 // GroupByThrottlePolicy - Group query result by Throttle Policy applied. 6319 GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` 6320 // GroupByOperationName - Group query result by Operation Name. 6321 GroupByOperationName *bool `json:"groupByOperationName,omitempty"` 6322 // GroupByResourceName - Group query result by Resource Name. 6323 GroupByResourceName *bool `json:"groupByResourceName,omitempty"` 6324} 6325 6326// Resource the Resource model definition. 6327type Resource struct { 6328 // ID - READ-ONLY; Resource Id 6329 ID *string `json:"id,omitempty"` 6330 // Name - READ-ONLY; Resource name 6331 Name *string `json:"name,omitempty"` 6332 // Type - READ-ONLY; Resource type 6333 Type *string `json:"type,omitempty"` 6334 // Location - Resource location 6335 Location *string `json:"location,omitempty"` 6336 // Tags - Resource tags 6337 Tags map[string]*string `json:"tags"` 6338} 6339 6340// MarshalJSON is the custom marshaler for Resource. 6341func (r Resource) MarshalJSON() ([]byte, error) { 6342 objectMap := make(map[string]interface{}) 6343 if r.Location != nil { 6344 objectMap["location"] = r.Location 6345 } 6346 if r.Tags != nil { 6347 objectMap["tags"] = r.Tags 6348 } 6349 return json.Marshal(objectMap) 6350} 6351 6352// ResourceRange describes the resource range. 6353type ResourceRange struct { 6354 // Min - The minimum number of the resource. 6355 Min *int32 `json:"min,omitempty"` 6356 // Max - The maximum number of the resource. 6357 Max *int32 `json:"max,omitempty"` 6358} 6359 6360// ResourceSku describes an available Compute SKU. 6361type ResourceSku struct { 6362 // ResourceType - READ-ONLY; The type of resource the SKU applies to. 6363 ResourceType *string `json:"resourceType,omitempty"` 6364 // Name - READ-ONLY; The name of SKU. 6365 Name *string `json:"name,omitempty"` 6366 // Tier - READ-ONLY; Specifies the tier of virtual machines in a scale set.<br /><br /> Possible Values:<br /><br /> **Standard**<br /><br /> **Basic** 6367 Tier *string `json:"tier,omitempty"` 6368 // Size - READ-ONLY; The Size of the SKU. 6369 Size *string `json:"size,omitempty"` 6370 // Family - READ-ONLY; The Family of this particular SKU. 6371 Family *string `json:"family,omitempty"` 6372 // Kind - READ-ONLY; The Kind of resources that are supported in this SKU. 6373 Kind *string `json:"kind,omitempty"` 6374 // Capacity - READ-ONLY; Specifies the number of virtual machines in the scale set. 6375 Capacity *ResourceSkuCapacity `json:"capacity,omitempty"` 6376 // Locations - READ-ONLY; The set of locations that the SKU is available. 6377 Locations *[]string `json:"locations,omitempty"` 6378 // LocationInfo - READ-ONLY; A list of locations and availability zones in those locations where the SKU is available. 6379 LocationInfo *[]ResourceSkuLocationInfo `json:"locationInfo,omitempty"` 6380 // APIVersions - READ-ONLY; The api versions that support this SKU. 6381 APIVersions *[]string `json:"apiVersions,omitempty"` 6382 // Costs - READ-ONLY; Metadata for retrieving price info. 6383 Costs *[]ResourceSkuCosts `json:"costs,omitempty"` 6384 // Capabilities - READ-ONLY; A name value pair to describe the capability. 6385 Capabilities *[]ResourceSkuCapabilities `json:"capabilities,omitempty"` 6386 // Restrictions - READ-ONLY; The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. 6387 Restrictions *[]ResourceSkuRestrictions `json:"restrictions,omitempty"` 6388} 6389 6390// ResourceSkuCapabilities describes The SKU capabilities object. 6391type ResourceSkuCapabilities struct { 6392 // Name - READ-ONLY; An invariant to describe the feature. 6393 Name *string `json:"name,omitempty"` 6394 // Value - READ-ONLY; An invariant if the feature is measured by quantity. 6395 Value *string `json:"value,omitempty"` 6396} 6397 6398// ResourceSkuCapacity describes scaling information of a SKU. 6399type ResourceSkuCapacity struct { 6400 // Minimum - READ-ONLY; The minimum capacity. 6401 Minimum *int64 `json:"minimum,omitempty"` 6402 // Maximum - READ-ONLY; The maximum capacity that can be set. 6403 Maximum *int64 `json:"maximum,omitempty"` 6404 // Default - READ-ONLY; The default capacity. 6405 Default *int64 `json:"default,omitempty"` 6406 // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'ResourceSkuCapacityScaleTypeAutomatic', 'ResourceSkuCapacityScaleTypeManual', 'ResourceSkuCapacityScaleTypeNone' 6407 ScaleType ResourceSkuCapacityScaleType `json:"scaleType,omitempty"` 6408} 6409 6410// ResourceSkuCosts describes metadata for retrieving price info. 6411type ResourceSkuCosts struct { 6412 // MeterID - READ-ONLY; Used for querying price from commerce. 6413 MeterID *string `json:"meterID,omitempty"` 6414 // Quantity - READ-ONLY; The multiplier is needed to extend the base metered cost. 6415 Quantity *int64 `json:"quantity,omitempty"` 6416 // ExtendedUnit - READ-ONLY; An invariant to show the extended unit. 6417 ExtendedUnit *string `json:"extendedUnit,omitempty"` 6418} 6419 6420// ResourceSkuLocationInfo ... 6421type ResourceSkuLocationInfo struct { 6422 // Location - READ-ONLY; Location of the SKU 6423 Location *string `json:"location,omitempty"` 6424 // Zones - READ-ONLY; List of availability zones where the SKU is supported. 6425 Zones *[]string `json:"zones,omitempty"` 6426 // ZoneDetails - READ-ONLY; Details of capabilities available to a SKU in specific zones. 6427 ZoneDetails *[]ResourceSkuZoneDetails `json:"zoneDetails,omitempty"` 6428} 6429 6430// ResourceSkuRestrictionInfo ... 6431type ResourceSkuRestrictionInfo struct { 6432 // Locations - READ-ONLY; Locations where the SKU is restricted 6433 Locations *[]string `json:"locations,omitempty"` 6434 // Zones - READ-ONLY; List of availability zones where the SKU is restricted. 6435 Zones *[]string `json:"zones,omitempty"` 6436} 6437 6438// ResourceSkuRestrictions describes scaling information of a SKU. 6439type ResourceSkuRestrictions struct { 6440 // Type - READ-ONLY; The type of restrictions. Possible values include: 'Location', 'Zone' 6441 Type ResourceSkuRestrictionsType `json:"type,omitempty"` 6442 // 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. 6443 Values *[]string `json:"values,omitempty"` 6444 // RestrictionInfo - READ-ONLY; The information about the restriction where the SKU cannot be used. 6445 RestrictionInfo *ResourceSkuRestrictionInfo `json:"restrictionInfo,omitempty"` 6446 // ReasonCode - READ-ONLY; The reason for restriction. Possible values include: 'QuotaID', 'NotAvailableForSubscription' 6447 ReasonCode ResourceSkuRestrictionsReasonCode `json:"reasonCode,omitempty"` 6448} 6449 6450// ResourceSkusResult the List Resource Skus operation response. 6451type ResourceSkusResult struct { 6452 autorest.Response `json:"-"` 6453 // Value - The list of skus available for the subscription. 6454 Value *[]ResourceSku `json:"value,omitempty"` 6455 // NextLink - The URI to fetch the next page of Resource Skus. Call ListNext() with this URI to fetch the next page of Resource Skus 6456 NextLink *string `json:"nextLink,omitempty"` 6457} 6458 6459// ResourceSkusResultIterator provides access to a complete listing of ResourceSku values. 6460type ResourceSkusResultIterator struct { 6461 i int 6462 page ResourceSkusResultPage 6463} 6464 6465// NextWithContext advances to the next value. If there was an error making 6466// the request the iterator does not advance and the error is returned. 6467func (iter *ResourceSkusResultIterator) NextWithContext(ctx context.Context) (err error) { 6468 if tracing.IsEnabled() { 6469 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusResultIterator.NextWithContext") 6470 defer func() { 6471 sc := -1 6472 if iter.Response().Response.Response != nil { 6473 sc = iter.Response().Response.Response.StatusCode 6474 } 6475 tracing.EndSpan(ctx, sc, err) 6476 }() 6477 } 6478 iter.i++ 6479 if iter.i < len(iter.page.Values()) { 6480 return nil 6481 } 6482 err = iter.page.NextWithContext(ctx) 6483 if err != nil { 6484 iter.i-- 6485 return err 6486 } 6487 iter.i = 0 6488 return nil 6489} 6490 6491// Next advances to the next value. If there was an error making 6492// the request the iterator does not advance and the error is returned. 6493// Deprecated: Use NextWithContext() instead. 6494func (iter *ResourceSkusResultIterator) Next() error { 6495 return iter.NextWithContext(context.Background()) 6496} 6497 6498// NotDone returns true if the enumeration should be started or is not yet complete. 6499func (iter ResourceSkusResultIterator) NotDone() bool { 6500 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6501} 6502 6503// Response returns the raw server response from the last page request. 6504func (iter ResourceSkusResultIterator) Response() ResourceSkusResult { 6505 return iter.page.Response() 6506} 6507 6508// Value returns the current value or a zero-initialized value if the 6509// iterator has advanced beyond the end of the collection. 6510func (iter ResourceSkusResultIterator) Value() ResourceSku { 6511 if !iter.page.NotDone() { 6512 return ResourceSku{} 6513 } 6514 return iter.page.Values()[iter.i] 6515} 6516 6517// Creates a new instance of the ResourceSkusResultIterator type. 6518func NewResourceSkusResultIterator(page ResourceSkusResultPage) ResourceSkusResultIterator { 6519 return ResourceSkusResultIterator{page: page} 6520} 6521 6522// IsEmpty returns true if the ListResult contains no values. 6523func (rsr ResourceSkusResult) IsEmpty() bool { 6524 return rsr.Value == nil || len(*rsr.Value) == 0 6525} 6526 6527// hasNextLink returns true if the NextLink is not empty. 6528func (rsr ResourceSkusResult) hasNextLink() bool { 6529 return rsr.NextLink != nil && len(*rsr.NextLink) != 0 6530} 6531 6532// resourceSkusResultPreparer prepares a request to retrieve the next set of results. 6533// It returns nil if no more results exist. 6534func (rsr ResourceSkusResult) resourceSkusResultPreparer(ctx context.Context) (*http.Request, error) { 6535 if !rsr.hasNextLink() { 6536 return nil, nil 6537 } 6538 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6539 autorest.AsJSON(), 6540 autorest.AsGet(), 6541 autorest.WithBaseURL(to.String(rsr.NextLink))) 6542} 6543 6544// ResourceSkusResultPage contains a page of ResourceSku values. 6545type ResourceSkusResultPage struct { 6546 fn func(context.Context, ResourceSkusResult) (ResourceSkusResult, error) 6547 rsr ResourceSkusResult 6548} 6549 6550// NextWithContext advances to the next page of values. If there was an error making 6551// the request the page does not advance and the error is returned. 6552func (page *ResourceSkusResultPage) NextWithContext(ctx context.Context) (err error) { 6553 if tracing.IsEnabled() { 6554 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusResultPage.NextWithContext") 6555 defer func() { 6556 sc := -1 6557 if page.Response().Response.Response != nil { 6558 sc = page.Response().Response.Response.StatusCode 6559 } 6560 tracing.EndSpan(ctx, sc, err) 6561 }() 6562 } 6563 for { 6564 next, err := page.fn(ctx, page.rsr) 6565 if err != nil { 6566 return err 6567 } 6568 page.rsr = next 6569 if !next.hasNextLink() || !next.IsEmpty() { 6570 break 6571 } 6572 } 6573 return nil 6574} 6575 6576// Next advances to the next page of values. If there was an error making 6577// the request the page does not advance and the error is returned. 6578// Deprecated: Use NextWithContext() instead. 6579func (page *ResourceSkusResultPage) Next() error { 6580 return page.NextWithContext(context.Background()) 6581} 6582 6583// NotDone returns true if the page enumeration should be started or is not yet complete. 6584func (page ResourceSkusResultPage) NotDone() bool { 6585 return !page.rsr.IsEmpty() 6586} 6587 6588// Response returns the raw server response from the last page request. 6589func (page ResourceSkusResultPage) Response() ResourceSkusResult { 6590 return page.rsr 6591} 6592 6593// Values returns the slice of values for the current page or nil if there are no values. 6594func (page ResourceSkusResultPage) Values() []ResourceSku { 6595 if page.rsr.IsEmpty() { 6596 return nil 6597 } 6598 return *page.rsr.Value 6599} 6600 6601// Creates a new instance of the ResourceSkusResultPage type. 6602func NewResourceSkusResultPage(cur ResourceSkusResult, getNextPage func(context.Context, ResourceSkusResult) (ResourceSkusResult, error)) ResourceSkusResultPage { 6603 return ResourceSkusResultPage{ 6604 fn: getNextPage, 6605 rsr: cur, 6606 } 6607} 6608 6609// ResourceSkuZoneDetails describes The zonal capabilities of a SKU. 6610type ResourceSkuZoneDetails struct { 6611 // Name - READ-ONLY; The set of zones that the SKU is available in with the specified capabilities. 6612 Name *[]string `json:"name,omitempty"` 6613 // Capabilities - READ-ONLY; A list of capabilities that are available for the SKU in the specified list of zones. 6614 Capabilities *[]ResourceSkuCapabilities `json:"capabilities,omitempty"` 6615} 6616 6617// RollbackStatusInfo information about rollback on failed VM instances after a OS Upgrade operation. 6618type RollbackStatusInfo struct { 6619 // SuccessfullyRolledbackInstanceCount - READ-ONLY; The number of instances which have been successfully rolled back. 6620 SuccessfullyRolledbackInstanceCount *int32 `json:"successfullyRolledbackInstanceCount,omitempty"` 6621 // FailedRolledbackInstanceCount - READ-ONLY; The number of instances which failed to rollback. 6622 FailedRolledbackInstanceCount *int32 `json:"failedRolledbackInstanceCount,omitempty"` 6623 // RollbackError - READ-ONLY; Error details if OS rollback failed. 6624 RollbackError *APIError `json:"rollbackError,omitempty"` 6625} 6626 6627// RollingUpgradePolicy the configuration parameters used while performing a rolling upgrade. 6628type RollingUpgradePolicy struct { 6629 // 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%. 6630 MaxBatchInstancePercent *int32 `json:"maxBatchInstancePercent,omitempty"` 6631 // 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%. 6632 MaxUnhealthyInstancePercent *int32 `json:"maxUnhealthyInstancePercent,omitempty"` 6633 // 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%. 6634 MaxUnhealthyUpgradedInstancePercent *int32 `json:"maxUnhealthyUpgradedInstancePercent,omitempty"` 6635 // 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). 6636 PauseTimeBetweenBatches *string `json:"pauseTimeBetweenBatches,omitempty"` 6637} 6638 6639// RollingUpgradeProgressInfo information about the number of virtual machine instances in each upgrade 6640// state. 6641type RollingUpgradeProgressInfo struct { 6642 // SuccessfulInstanceCount - READ-ONLY; The number of instances that have been successfully upgraded. 6643 SuccessfulInstanceCount *int32 `json:"successfulInstanceCount,omitempty"` 6644 // FailedInstanceCount - READ-ONLY; The number of instances that have failed to be upgraded successfully. 6645 FailedInstanceCount *int32 `json:"failedInstanceCount,omitempty"` 6646 // InProgressInstanceCount - READ-ONLY; The number of instances that are currently being upgraded. 6647 InProgressInstanceCount *int32 `json:"inProgressInstanceCount,omitempty"` 6648 // PendingInstanceCount - READ-ONLY; The number of instances that have not yet begun to be upgraded. 6649 PendingInstanceCount *int32 `json:"pendingInstanceCount,omitempty"` 6650} 6651 6652// RollingUpgradeRunningStatus information about the current running state of the overall upgrade. 6653type RollingUpgradeRunningStatus struct { 6654 // Code - READ-ONLY; Code indicating the current status of the upgrade. Possible values include: 'RollingUpgradeStatusCodeRollingForward', 'RollingUpgradeStatusCodeCancelled', 'RollingUpgradeStatusCodeCompleted', 'RollingUpgradeStatusCodeFaulted' 6655 Code RollingUpgradeStatusCode `json:"code,omitempty"` 6656 // StartTime - READ-ONLY; Start time of the upgrade. 6657 StartTime *date.Time `json:"startTime,omitempty"` 6658 // LastAction - READ-ONLY; The last action performed on the rolling upgrade. Possible values include: 'Start', 'Cancel' 6659 LastAction RollingUpgradeActionType `json:"lastAction,omitempty"` 6660 // LastActionTime - READ-ONLY; Last action time of the upgrade. 6661 LastActionTime *date.Time `json:"lastActionTime,omitempty"` 6662} 6663 6664// RollingUpgradeStatusInfo the status of the latest virtual machine scale set rolling upgrade. 6665type RollingUpgradeStatusInfo struct { 6666 autorest.Response `json:"-"` 6667 *RollingUpgradeStatusInfoProperties `json:"properties,omitempty"` 6668 // ID - READ-ONLY; Resource Id 6669 ID *string `json:"id,omitempty"` 6670 // Name - READ-ONLY; Resource name 6671 Name *string `json:"name,omitempty"` 6672 // Type - READ-ONLY; Resource type 6673 Type *string `json:"type,omitempty"` 6674 // Location - Resource location 6675 Location *string `json:"location,omitempty"` 6676 // Tags - Resource tags 6677 Tags map[string]*string `json:"tags"` 6678} 6679 6680// MarshalJSON is the custom marshaler for RollingUpgradeStatusInfo. 6681func (rusi RollingUpgradeStatusInfo) MarshalJSON() ([]byte, error) { 6682 objectMap := make(map[string]interface{}) 6683 if rusi.RollingUpgradeStatusInfoProperties != nil { 6684 objectMap["properties"] = rusi.RollingUpgradeStatusInfoProperties 6685 } 6686 if rusi.Location != nil { 6687 objectMap["location"] = rusi.Location 6688 } 6689 if rusi.Tags != nil { 6690 objectMap["tags"] = rusi.Tags 6691 } 6692 return json.Marshal(objectMap) 6693} 6694 6695// UnmarshalJSON is the custom unmarshaler for RollingUpgradeStatusInfo struct. 6696func (rusi *RollingUpgradeStatusInfo) UnmarshalJSON(body []byte) error { 6697 var m map[string]*json.RawMessage 6698 err := json.Unmarshal(body, &m) 6699 if err != nil { 6700 return err 6701 } 6702 for k, v := range m { 6703 switch k { 6704 case "properties": 6705 if v != nil { 6706 var rollingUpgradeStatusInfoProperties RollingUpgradeStatusInfoProperties 6707 err = json.Unmarshal(*v, &rollingUpgradeStatusInfoProperties) 6708 if err != nil { 6709 return err 6710 } 6711 rusi.RollingUpgradeStatusInfoProperties = &rollingUpgradeStatusInfoProperties 6712 } 6713 case "id": 6714 if v != nil { 6715 var ID string 6716 err = json.Unmarshal(*v, &ID) 6717 if err != nil { 6718 return err 6719 } 6720 rusi.ID = &ID 6721 } 6722 case "name": 6723 if v != nil { 6724 var name string 6725 err = json.Unmarshal(*v, &name) 6726 if err != nil { 6727 return err 6728 } 6729 rusi.Name = &name 6730 } 6731 case "type": 6732 if v != nil { 6733 var typeVar string 6734 err = json.Unmarshal(*v, &typeVar) 6735 if err != nil { 6736 return err 6737 } 6738 rusi.Type = &typeVar 6739 } 6740 case "location": 6741 if v != nil { 6742 var location string 6743 err = json.Unmarshal(*v, &location) 6744 if err != nil { 6745 return err 6746 } 6747 rusi.Location = &location 6748 } 6749 case "tags": 6750 if v != nil { 6751 var tags map[string]*string 6752 err = json.Unmarshal(*v, &tags) 6753 if err != nil { 6754 return err 6755 } 6756 rusi.Tags = tags 6757 } 6758 } 6759 } 6760 6761 return nil 6762} 6763 6764// RollingUpgradeStatusInfoProperties the status of the latest virtual machine scale set rolling upgrade. 6765type RollingUpgradeStatusInfoProperties struct { 6766 // Policy - READ-ONLY; The rolling upgrade policies applied for this upgrade. 6767 Policy *RollingUpgradePolicy `json:"policy,omitempty"` 6768 // RunningStatus - READ-ONLY; Information about the current running state of the overall upgrade. 6769 RunningStatus *RollingUpgradeRunningStatus `json:"runningStatus,omitempty"` 6770 // Progress - READ-ONLY; Information about the number of virtual machine instances in each upgrade state. 6771 Progress *RollingUpgradeProgressInfo `json:"progress,omitempty"` 6772 // Error - READ-ONLY; Error details for this upgrade, if there are any. 6773 Error *APIError `json:"error,omitempty"` 6774} 6775 6776// RunCommandDocument describes the properties of a Run Command. 6777type RunCommandDocument struct { 6778 autorest.Response `json:"-"` 6779 // Script - The script to be executed. 6780 Script *[]string `json:"script,omitempty"` 6781 // Parameters - The parameters used by the script. 6782 Parameters *[]RunCommandParameterDefinition `json:"parameters,omitempty"` 6783 // Schema - The VM run command schema. 6784 Schema *string `json:"$schema,omitempty"` 6785 // ID - The VM run command id. 6786 ID *string `json:"id,omitempty"` 6787 // OsType - The Operating System type. Possible values include: 'Windows', 'Linux' 6788 OsType OperatingSystemTypes `json:"osType,omitempty"` 6789 // Label - The VM run command label. 6790 Label *string `json:"label,omitempty"` 6791 // Description - The VM run command description. 6792 Description *string `json:"description,omitempty"` 6793} 6794 6795// RunCommandDocumentBase describes the properties of a Run Command metadata. 6796type RunCommandDocumentBase struct { 6797 // Schema - The VM run command schema. 6798 Schema *string `json:"$schema,omitempty"` 6799 // ID - The VM run command id. 6800 ID *string `json:"id,omitempty"` 6801 // OsType - The Operating System type. Possible values include: 'Windows', 'Linux' 6802 OsType OperatingSystemTypes `json:"osType,omitempty"` 6803 // Label - The VM run command label. 6804 Label *string `json:"label,omitempty"` 6805 // Description - The VM run command description. 6806 Description *string `json:"description,omitempty"` 6807} 6808 6809// RunCommandInput capture Virtual Machine parameters. 6810type RunCommandInput struct { 6811 // CommandID - The run command id. 6812 CommandID *string `json:"commandId,omitempty"` 6813 // Script - Optional. The script to be executed. When this value is given, the given script will override the default script of the command. 6814 Script *[]string `json:"script,omitempty"` 6815 // Parameters - The run command parameters. 6816 Parameters *[]RunCommandInputParameter `json:"parameters,omitempty"` 6817} 6818 6819// RunCommandInputParameter describes the properties of a run command parameter. 6820type RunCommandInputParameter struct { 6821 // Name - The run command parameter name. 6822 Name *string `json:"name,omitempty"` 6823 // Value - The run command parameter value. 6824 Value *string `json:"value,omitempty"` 6825} 6826 6827// RunCommandListResult the List Virtual Machine operation response. 6828type RunCommandListResult struct { 6829 autorest.Response `json:"-"` 6830 // Value - The list of virtual machine run commands. 6831 Value *[]RunCommandDocumentBase `json:"value,omitempty"` 6832 // NextLink - The uri to fetch the next page of run commands. Call ListNext() with this to fetch the next page of run commands. 6833 NextLink *string `json:"nextLink,omitempty"` 6834} 6835 6836// RunCommandListResultIterator provides access to a complete listing of RunCommandDocumentBase values. 6837type RunCommandListResultIterator struct { 6838 i int 6839 page RunCommandListResultPage 6840} 6841 6842// NextWithContext advances to the next value. If there was an error making 6843// the request the iterator does not advance and the error is returned. 6844func (iter *RunCommandListResultIterator) NextWithContext(ctx context.Context) (err error) { 6845 if tracing.IsEnabled() { 6846 ctx = tracing.StartSpan(ctx, fqdn+"/RunCommandListResultIterator.NextWithContext") 6847 defer func() { 6848 sc := -1 6849 if iter.Response().Response.Response != nil { 6850 sc = iter.Response().Response.Response.StatusCode 6851 } 6852 tracing.EndSpan(ctx, sc, err) 6853 }() 6854 } 6855 iter.i++ 6856 if iter.i < len(iter.page.Values()) { 6857 return nil 6858 } 6859 err = iter.page.NextWithContext(ctx) 6860 if err != nil { 6861 iter.i-- 6862 return err 6863 } 6864 iter.i = 0 6865 return nil 6866} 6867 6868// Next advances to the next value. If there was an error making 6869// the request the iterator does not advance and the error is returned. 6870// Deprecated: Use NextWithContext() instead. 6871func (iter *RunCommandListResultIterator) Next() error { 6872 return iter.NextWithContext(context.Background()) 6873} 6874 6875// NotDone returns true if the enumeration should be started or is not yet complete. 6876func (iter RunCommandListResultIterator) NotDone() bool { 6877 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6878} 6879 6880// Response returns the raw server response from the last page request. 6881func (iter RunCommandListResultIterator) Response() RunCommandListResult { 6882 return iter.page.Response() 6883} 6884 6885// Value returns the current value or a zero-initialized value if the 6886// iterator has advanced beyond the end of the collection. 6887func (iter RunCommandListResultIterator) Value() RunCommandDocumentBase { 6888 if !iter.page.NotDone() { 6889 return RunCommandDocumentBase{} 6890 } 6891 return iter.page.Values()[iter.i] 6892} 6893 6894// Creates a new instance of the RunCommandListResultIterator type. 6895func NewRunCommandListResultIterator(page RunCommandListResultPage) RunCommandListResultIterator { 6896 return RunCommandListResultIterator{page: page} 6897} 6898 6899// IsEmpty returns true if the ListResult contains no values. 6900func (rclr RunCommandListResult) IsEmpty() bool { 6901 return rclr.Value == nil || len(*rclr.Value) == 0 6902} 6903 6904// hasNextLink returns true if the NextLink is not empty. 6905func (rclr RunCommandListResult) hasNextLink() bool { 6906 return rclr.NextLink != nil && len(*rclr.NextLink) != 0 6907} 6908 6909// runCommandListResultPreparer prepares a request to retrieve the next set of results. 6910// It returns nil if no more results exist. 6911func (rclr RunCommandListResult) runCommandListResultPreparer(ctx context.Context) (*http.Request, error) { 6912 if !rclr.hasNextLink() { 6913 return nil, nil 6914 } 6915 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6916 autorest.AsJSON(), 6917 autorest.AsGet(), 6918 autorest.WithBaseURL(to.String(rclr.NextLink))) 6919} 6920 6921// RunCommandListResultPage contains a page of RunCommandDocumentBase values. 6922type RunCommandListResultPage struct { 6923 fn func(context.Context, RunCommandListResult) (RunCommandListResult, error) 6924 rclr RunCommandListResult 6925} 6926 6927// NextWithContext advances to the next page of values. If there was an error making 6928// the request the page does not advance and the error is returned. 6929func (page *RunCommandListResultPage) NextWithContext(ctx context.Context) (err error) { 6930 if tracing.IsEnabled() { 6931 ctx = tracing.StartSpan(ctx, fqdn+"/RunCommandListResultPage.NextWithContext") 6932 defer func() { 6933 sc := -1 6934 if page.Response().Response.Response != nil { 6935 sc = page.Response().Response.Response.StatusCode 6936 } 6937 tracing.EndSpan(ctx, sc, err) 6938 }() 6939 } 6940 for { 6941 next, err := page.fn(ctx, page.rclr) 6942 if err != nil { 6943 return err 6944 } 6945 page.rclr = next 6946 if !next.hasNextLink() || !next.IsEmpty() { 6947 break 6948 } 6949 } 6950 return nil 6951} 6952 6953// Next advances to the next page of values. If there was an error making 6954// the request the page does not advance and the error is returned. 6955// Deprecated: Use NextWithContext() instead. 6956func (page *RunCommandListResultPage) Next() error { 6957 return page.NextWithContext(context.Background()) 6958} 6959 6960// NotDone returns true if the page enumeration should be started or is not yet complete. 6961func (page RunCommandListResultPage) NotDone() bool { 6962 return !page.rclr.IsEmpty() 6963} 6964 6965// Response returns the raw server response from the last page request. 6966func (page RunCommandListResultPage) Response() RunCommandListResult { 6967 return page.rclr 6968} 6969 6970// Values returns the slice of values for the current page or nil if there are no values. 6971func (page RunCommandListResultPage) Values() []RunCommandDocumentBase { 6972 if page.rclr.IsEmpty() { 6973 return nil 6974 } 6975 return *page.rclr.Value 6976} 6977 6978// Creates a new instance of the RunCommandListResultPage type. 6979func NewRunCommandListResultPage(cur RunCommandListResult, getNextPage func(context.Context, RunCommandListResult) (RunCommandListResult, error)) RunCommandListResultPage { 6980 return RunCommandListResultPage{ 6981 fn: getNextPage, 6982 rclr: cur, 6983 } 6984} 6985 6986// RunCommandParameterDefinition describes the properties of a run command parameter. 6987type RunCommandParameterDefinition struct { 6988 // Name - The run command parameter name. 6989 Name *string `json:"name,omitempty"` 6990 // Type - The run command parameter type. 6991 Type *string `json:"type,omitempty"` 6992 // DefaultValue - The run command parameter default value. 6993 DefaultValue *string `json:"defaultValue,omitempty"` 6994 // Required - The run command parameter required. 6995 Required *bool `json:"required,omitempty"` 6996} 6997 6998// RunCommandResult ... 6999type RunCommandResult struct { 7000 autorest.Response `json:"-"` 7001 // Value - Run command operation response. 7002 Value *[]InstanceViewStatus `json:"value,omitempty"` 7003} 7004 7005// ScaleInPolicy describes a scale-in policy for a virtual machine scale set. 7006type ScaleInPolicy struct { 7007 // 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> 7008 Rules *[]VirtualMachineScaleSetScaleInRules `json:"rules,omitempty"` 7009} 7010 7011// ScheduledEventsProfile ... 7012type ScheduledEventsProfile struct { 7013 // TerminateNotificationProfile - Specifies Terminate Scheduled Event related configurations. 7014 TerminateNotificationProfile *TerminateNotificationProfile `json:"terminateNotificationProfile,omitempty"` 7015} 7016 7017// Sku describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware 7018// the scale set is currently on, you need to deallocate the VMs in the scale set before you modify the SKU 7019// name. 7020type Sku struct { 7021 // Name - The sku name. 7022 Name *string `json:"name,omitempty"` 7023 // Tier - Specifies the tier of virtual machines in a scale set.<br /><br /> Possible Values:<br /><br /> **Standard**<br /><br /> **Basic** 7024 Tier *string `json:"tier,omitempty"` 7025 // Capacity - Specifies the number of virtual machines in the scale set. 7026 Capacity *int64 `json:"capacity,omitempty"` 7027} 7028 7029// Snapshot snapshot resource. 7030type Snapshot struct { 7031 autorest.Response `json:"-"` 7032 // ManagedBy - READ-ONLY; Unused. Always Null. 7033 ManagedBy *string `json:"managedBy,omitempty"` 7034 Sku *SnapshotSku `json:"sku,omitempty"` 7035 *SnapshotProperties `json:"properties,omitempty"` 7036 // ID - READ-ONLY; Resource Id 7037 ID *string `json:"id,omitempty"` 7038 // Name - READ-ONLY; Resource name 7039 Name *string `json:"name,omitempty"` 7040 // Type - READ-ONLY; Resource type 7041 Type *string `json:"type,omitempty"` 7042 // Location - Resource location 7043 Location *string `json:"location,omitempty"` 7044 // Tags - Resource tags 7045 Tags map[string]*string `json:"tags"` 7046} 7047 7048// MarshalJSON is the custom marshaler for Snapshot. 7049func (s Snapshot) MarshalJSON() ([]byte, error) { 7050 objectMap := make(map[string]interface{}) 7051 if s.Sku != nil { 7052 objectMap["sku"] = s.Sku 7053 } 7054 if s.SnapshotProperties != nil { 7055 objectMap["properties"] = s.SnapshotProperties 7056 } 7057 if s.Location != nil { 7058 objectMap["location"] = s.Location 7059 } 7060 if s.Tags != nil { 7061 objectMap["tags"] = s.Tags 7062 } 7063 return json.Marshal(objectMap) 7064} 7065 7066// UnmarshalJSON is the custom unmarshaler for Snapshot struct. 7067func (s *Snapshot) UnmarshalJSON(body []byte) error { 7068 var m map[string]*json.RawMessage 7069 err := json.Unmarshal(body, &m) 7070 if err != nil { 7071 return err 7072 } 7073 for k, v := range m { 7074 switch k { 7075 case "managedBy": 7076 if v != nil { 7077 var managedBy string 7078 err = json.Unmarshal(*v, &managedBy) 7079 if err != nil { 7080 return err 7081 } 7082 s.ManagedBy = &managedBy 7083 } 7084 case "sku": 7085 if v != nil { 7086 var sku SnapshotSku 7087 err = json.Unmarshal(*v, &sku) 7088 if err != nil { 7089 return err 7090 } 7091 s.Sku = &sku 7092 } 7093 case "properties": 7094 if v != nil { 7095 var snapshotProperties SnapshotProperties 7096 err = json.Unmarshal(*v, &snapshotProperties) 7097 if err != nil { 7098 return err 7099 } 7100 s.SnapshotProperties = &snapshotProperties 7101 } 7102 case "id": 7103 if v != nil { 7104 var ID string 7105 err = json.Unmarshal(*v, &ID) 7106 if err != nil { 7107 return err 7108 } 7109 s.ID = &ID 7110 } 7111 case "name": 7112 if v != nil { 7113 var name string 7114 err = json.Unmarshal(*v, &name) 7115 if err != nil { 7116 return err 7117 } 7118 s.Name = &name 7119 } 7120 case "type": 7121 if v != nil { 7122 var typeVar string 7123 err = json.Unmarshal(*v, &typeVar) 7124 if err != nil { 7125 return err 7126 } 7127 s.Type = &typeVar 7128 } 7129 case "location": 7130 if v != nil { 7131 var location string 7132 err = json.Unmarshal(*v, &location) 7133 if err != nil { 7134 return err 7135 } 7136 s.Location = &location 7137 } 7138 case "tags": 7139 if v != nil { 7140 var tags map[string]*string 7141 err = json.Unmarshal(*v, &tags) 7142 if err != nil { 7143 return err 7144 } 7145 s.Tags = tags 7146 } 7147 } 7148 } 7149 7150 return nil 7151} 7152 7153// SnapshotList the List Snapshots operation response. 7154type SnapshotList struct { 7155 autorest.Response `json:"-"` 7156 // Value - A list of snapshots. 7157 Value *[]Snapshot `json:"value,omitempty"` 7158 // NextLink - The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the next page of snapshots. 7159 NextLink *string `json:"nextLink,omitempty"` 7160} 7161 7162// SnapshotListIterator provides access to a complete listing of Snapshot values. 7163type SnapshotListIterator struct { 7164 i int 7165 page SnapshotListPage 7166} 7167 7168// NextWithContext advances to the next value. If there was an error making 7169// the request the iterator does not advance and the error is returned. 7170func (iter *SnapshotListIterator) NextWithContext(ctx context.Context) (err error) { 7171 if tracing.IsEnabled() { 7172 ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotListIterator.NextWithContext") 7173 defer func() { 7174 sc := -1 7175 if iter.Response().Response.Response != nil { 7176 sc = iter.Response().Response.Response.StatusCode 7177 } 7178 tracing.EndSpan(ctx, sc, err) 7179 }() 7180 } 7181 iter.i++ 7182 if iter.i < len(iter.page.Values()) { 7183 return nil 7184 } 7185 err = iter.page.NextWithContext(ctx) 7186 if err != nil { 7187 iter.i-- 7188 return err 7189 } 7190 iter.i = 0 7191 return nil 7192} 7193 7194// Next advances to the next value. If there was an error making 7195// the request the iterator does not advance and the error is returned. 7196// Deprecated: Use NextWithContext() instead. 7197func (iter *SnapshotListIterator) Next() error { 7198 return iter.NextWithContext(context.Background()) 7199} 7200 7201// NotDone returns true if the enumeration should be started or is not yet complete. 7202func (iter SnapshotListIterator) NotDone() bool { 7203 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7204} 7205 7206// Response returns the raw server response from the last page request. 7207func (iter SnapshotListIterator) Response() SnapshotList { 7208 return iter.page.Response() 7209} 7210 7211// Value returns the current value or a zero-initialized value if the 7212// iterator has advanced beyond the end of the collection. 7213func (iter SnapshotListIterator) Value() Snapshot { 7214 if !iter.page.NotDone() { 7215 return Snapshot{} 7216 } 7217 return iter.page.Values()[iter.i] 7218} 7219 7220// Creates a new instance of the SnapshotListIterator type. 7221func NewSnapshotListIterator(page SnapshotListPage) SnapshotListIterator { 7222 return SnapshotListIterator{page: page} 7223} 7224 7225// IsEmpty returns true if the ListResult contains no values. 7226func (sl SnapshotList) IsEmpty() bool { 7227 return sl.Value == nil || len(*sl.Value) == 0 7228} 7229 7230// hasNextLink returns true if the NextLink is not empty. 7231func (sl SnapshotList) hasNextLink() bool { 7232 return sl.NextLink != nil && len(*sl.NextLink) != 0 7233} 7234 7235// snapshotListPreparer prepares a request to retrieve the next set of results. 7236// It returns nil if no more results exist. 7237func (sl SnapshotList) snapshotListPreparer(ctx context.Context) (*http.Request, error) { 7238 if !sl.hasNextLink() { 7239 return nil, nil 7240 } 7241 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7242 autorest.AsJSON(), 7243 autorest.AsGet(), 7244 autorest.WithBaseURL(to.String(sl.NextLink))) 7245} 7246 7247// SnapshotListPage contains a page of Snapshot values. 7248type SnapshotListPage struct { 7249 fn func(context.Context, SnapshotList) (SnapshotList, error) 7250 sl SnapshotList 7251} 7252 7253// NextWithContext advances to the next page of values. If there was an error making 7254// the request the page does not advance and the error is returned. 7255func (page *SnapshotListPage) NextWithContext(ctx context.Context) (err error) { 7256 if tracing.IsEnabled() { 7257 ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotListPage.NextWithContext") 7258 defer func() { 7259 sc := -1 7260 if page.Response().Response.Response != nil { 7261 sc = page.Response().Response.Response.StatusCode 7262 } 7263 tracing.EndSpan(ctx, sc, err) 7264 }() 7265 } 7266 for { 7267 next, err := page.fn(ctx, page.sl) 7268 if err != nil { 7269 return err 7270 } 7271 page.sl = next 7272 if !next.hasNextLink() || !next.IsEmpty() { 7273 break 7274 } 7275 } 7276 return nil 7277} 7278 7279// Next advances to the next page of values. If there was an error making 7280// the request the page does not advance and the error is returned. 7281// Deprecated: Use NextWithContext() instead. 7282func (page *SnapshotListPage) Next() error { 7283 return page.NextWithContext(context.Background()) 7284} 7285 7286// NotDone returns true if the page enumeration should be started or is not yet complete. 7287func (page SnapshotListPage) NotDone() bool { 7288 return !page.sl.IsEmpty() 7289} 7290 7291// Response returns the raw server response from the last page request. 7292func (page SnapshotListPage) Response() SnapshotList { 7293 return page.sl 7294} 7295 7296// Values returns the slice of values for the current page or nil if there are no values. 7297func (page SnapshotListPage) Values() []Snapshot { 7298 if page.sl.IsEmpty() { 7299 return nil 7300 } 7301 return *page.sl.Value 7302} 7303 7304// Creates a new instance of the SnapshotListPage type. 7305func NewSnapshotListPage(cur SnapshotList, getNextPage func(context.Context, SnapshotList) (SnapshotList, error)) SnapshotListPage { 7306 return SnapshotListPage{ 7307 fn: getNextPage, 7308 sl: cur, 7309 } 7310} 7311 7312// SnapshotProperties snapshot resource properties. 7313type SnapshotProperties struct { 7314 // TimeCreated - READ-ONLY; The time when the disk was created. 7315 TimeCreated *date.Time `json:"timeCreated,omitempty"` 7316 // OsType - The Operating System type. Possible values include: 'Windows', 'Linux' 7317 OsType OperatingSystemTypes `json:"osType,omitempty"` 7318 // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'V1', 'V2' 7319 HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` 7320 // CreationData - Disk source information. CreationData information cannot be changed after the disk has been created. 7321 CreationData *CreationData `json:"creationData,omitempty"` 7322 // 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. 7323 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 7324 // DiskSizeBytes - READ-ONLY; The size of the disk in bytes. This field is read only. 7325 DiskSizeBytes *int64 `json:"diskSizeBytes,omitempty"` 7326 // UniqueID - READ-ONLY; Unique Guid identifying the resource. 7327 UniqueID *string `json:"uniqueId,omitempty"` 7328 // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. 7329 EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` 7330 // ProvisioningState - READ-ONLY; The disk provisioning state. 7331 ProvisioningState *string `json:"provisioningState,omitempty"` 7332 // Incremental - Whether a snapshot is incremental. Incremental snapshots on the same disk occupy less space than full snapshots and can be diffed. 7333 Incremental *bool `json:"incremental,omitempty"` 7334 // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 7335 Encryption *Encryption `json:"encryption,omitempty"` 7336} 7337 7338// MarshalJSON is the custom marshaler for SnapshotProperties. 7339func (sp SnapshotProperties) MarshalJSON() ([]byte, error) { 7340 objectMap := make(map[string]interface{}) 7341 if sp.OsType != "" { 7342 objectMap["osType"] = sp.OsType 7343 } 7344 if sp.HyperVGeneration != "" { 7345 objectMap["hyperVGeneration"] = sp.HyperVGeneration 7346 } 7347 if sp.CreationData != nil { 7348 objectMap["creationData"] = sp.CreationData 7349 } 7350 if sp.DiskSizeGB != nil { 7351 objectMap["diskSizeGB"] = sp.DiskSizeGB 7352 } 7353 if sp.EncryptionSettingsCollection != nil { 7354 objectMap["encryptionSettingsCollection"] = sp.EncryptionSettingsCollection 7355 } 7356 if sp.Incremental != nil { 7357 objectMap["incremental"] = sp.Incremental 7358 } 7359 if sp.Encryption != nil { 7360 objectMap["encryption"] = sp.Encryption 7361 } 7362 return json.Marshal(objectMap) 7363} 7364 7365// SnapshotsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 7366// operation. 7367type SnapshotsCreateOrUpdateFuture struct { 7368 azure.FutureAPI 7369 // Result returns the result of the asynchronous operation. 7370 // If the operation has not completed it will return an error. 7371 Result func(SnapshotsClient) (Snapshot, error) 7372} 7373 7374// SnapshotsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 7375// operation. 7376type SnapshotsDeleteFuture struct { 7377 azure.FutureAPI 7378 // Result returns the result of the asynchronous operation. 7379 // If the operation has not completed it will return an error. 7380 Result func(SnapshotsClient) (autorest.Response, error) 7381} 7382 7383// SnapshotsGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running 7384// operation. 7385type SnapshotsGrantAccessFuture struct { 7386 azure.FutureAPI 7387 // Result returns the result of the asynchronous operation. 7388 // If the operation has not completed it will return an error. 7389 Result func(SnapshotsClient) (AccessURI, error) 7390} 7391 7392// SnapshotSku the snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. 7393type SnapshotSku struct { 7394 // Name - The sku name. Possible values include: 'SnapshotStorageAccountTypesStandardLRS', 'SnapshotStorageAccountTypesPremiumLRS', 'SnapshotStorageAccountTypesStandardZRS' 7395 Name SnapshotStorageAccountTypes `json:"name,omitempty"` 7396 // Tier - READ-ONLY; The sku tier. 7397 Tier *string `json:"tier,omitempty"` 7398} 7399 7400// MarshalJSON is the custom marshaler for SnapshotSku. 7401func (ss SnapshotSku) MarshalJSON() ([]byte, error) { 7402 objectMap := make(map[string]interface{}) 7403 if ss.Name != "" { 7404 objectMap["name"] = ss.Name 7405 } 7406 return json.Marshal(objectMap) 7407} 7408 7409// SnapshotsRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running 7410// operation. 7411type SnapshotsRevokeAccessFuture struct { 7412 azure.FutureAPI 7413 // Result returns the result of the asynchronous operation. 7414 // If the operation has not completed it will return an error. 7415 Result func(SnapshotsClient) (autorest.Response, error) 7416} 7417 7418// SnapshotsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 7419// operation. 7420type SnapshotsUpdateFuture struct { 7421 azure.FutureAPI 7422 // Result returns the result of the asynchronous operation. 7423 // If the operation has not completed it will return an error. 7424 Result func(SnapshotsClient) (Snapshot, error) 7425} 7426 7427// SnapshotUpdate snapshot update resource. 7428type SnapshotUpdate struct { 7429 *SnapshotUpdateProperties `json:"properties,omitempty"` 7430 // Tags - Resource tags 7431 Tags map[string]*string `json:"tags"` 7432 Sku *SnapshotSku `json:"sku,omitempty"` 7433} 7434 7435// MarshalJSON is the custom marshaler for SnapshotUpdate. 7436func (su SnapshotUpdate) MarshalJSON() ([]byte, error) { 7437 objectMap := make(map[string]interface{}) 7438 if su.SnapshotUpdateProperties != nil { 7439 objectMap["properties"] = su.SnapshotUpdateProperties 7440 } 7441 if su.Tags != nil { 7442 objectMap["tags"] = su.Tags 7443 } 7444 if su.Sku != nil { 7445 objectMap["sku"] = su.Sku 7446 } 7447 return json.Marshal(objectMap) 7448} 7449 7450// UnmarshalJSON is the custom unmarshaler for SnapshotUpdate struct. 7451func (su *SnapshotUpdate) UnmarshalJSON(body []byte) error { 7452 var m map[string]*json.RawMessage 7453 err := json.Unmarshal(body, &m) 7454 if err != nil { 7455 return err 7456 } 7457 for k, v := range m { 7458 switch k { 7459 case "properties": 7460 if v != nil { 7461 var snapshotUpdateProperties SnapshotUpdateProperties 7462 err = json.Unmarshal(*v, &snapshotUpdateProperties) 7463 if err != nil { 7464 return err 7465 } 7466 su.SnapshotUpdateProperties = &snapshotUpdateProperties 7467 } 7468 case "tags": 7469 if v != nil { 7470 var tags map[string]*string 7471 err = json.Unmarshal(*v, &tags) 7472 if err != nil { 7473 return err 7474 } 7475 su.Tags = tags 7476 } 7477 case "sku": 7478 if v != nil { 7479 var sku SnapshotSku 7480 err = json.Unmarshal(*v, &sku) 7481 if err != nil { 7482 return err 7483 } 7484 su.Sku = &sku 7485 } 7486 } 7487 } 7488 7489 return nil 7490} 7491 7492// SnapshotUpdateProperties snapshot resource update properties. 7493type SnapshotUpdateProperties struct { 7494 // OsType - the Operating System type. Possible values include: 'Windows', 'Linux' 7495 OsType OperatingSystemTypes `json:"osType,omitempty"` 7496 // 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. 7497 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 7498 // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. 7499 EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` 7500 // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 7501 Encryption *Encryption `json:"encryption,omitempty"` 7502} 7503 7504// SourceVault the vault id is an Azure Resource Manager Resource id in the form 7505// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName} 7506type SourceVault struct { 7507 // ID - Resource Id 7508 ID *string `json:"id,omitempty"` 7509} 7510 7511// SSHConfiguration SSH configuration for Linux based VMs running on Azure 7512type SSHConfiguration struct { 7513 // PublicKeys - The list of SSH public keys used to authenticate with linux based VMs. 7514 PublicKeys *[]SSHPublicKey `json:"publicKeys,omitempty"` 7515} 7516 7517// SSHPublicKey contains information about SSH certificate public key and the path on the Linux VM where 7518// the public key is placed. 7519type SSHPublicKey struct { 7520 // 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 7521 Path *string `json:"path,omitempty"` 7522 // 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). 7523 KeyData *string `json:"keyData,omitempty"` 7524} 7525 7526// StorageProfile specifies the storage settings for the virtual machine disks. 7527type StorageProfile struct { 7528 // 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. 7529 ImageReference *ImageReference `json:"imageReference,omitempty"` 7530 // 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). 7531 OsDisk *OSDisk `json:"osDisk,omitempty"` 7532 // 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). 7533 DataDisks *[]DataDisk `json:"dataDisks,omitempty"` 7534} 7535 7536// SubResource ... 7537type SubResource struct { 7538 // ID - Resource Id 7539 ID *string `json:"id,omitempty"` 7540} 7541 7542// SubResourceReadOnly ... 7543type SubResourceReadOnly struct { 7544 // ID - READ-ONLY; Resource Id 7545 ID *string `json:"id,omitempty"` 7546} 7547 7548// SubResourceWithColocationStatus ... 7549type SubResourceWithColocationStatus struct { 7550 // ColocationStatus - Describes colocation status of a resource in the Proximity Placement Group. 7551 ColocationStatus *InstanceViewStatus `json:"colocationStatus,omitempty"` 7552 // ID - Resource Id 7553 ID *string `json:"id,omitempty"` 7554} 7555 7556// TargetRegion describes the target region information. 7557type TargetRegion struct { 7558 // Name - The name of the region. 7559 Name *string `json:"name,omitempty"` 7560 // RegionalReplicaCount - The number of replicas of the Image Version to be created per region. This property is updatable. 7561 RegionalReplicaCount *int32 `json:"regionalReplicaCount,omitempty"` 7562 // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS' 7563 StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` 7564} 7565 7566// TerminateNotificationProfile ... 7567type TerminateNotificationProfile struct { 7568 // 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) 7569 NotBeforeTimeout *string `json:"notBeforeTimeout,omitempty"` 7570 // Enable - Specifies whether the Terminate Scheduled event is enabled or disabled. 7571 Enable *bool `json:"enable,omitempty"` 7572} 7573 7574// ThrottledRequestsInput api request input for LogAnalytics getThrottledRequests Api. 7575type ThrottledRequestsInput struct { 7576 // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. 7577 BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` 7578 // FromTime - From time of the query 7579 FromTime *date.Time `json:"fromTime,omitempty"` 7580 // ToTime - To time of the query 7581 ToTime *date.Time `json:"toTime,omitempty"` 7582 // GroupByThrottlePolicy - Group query result by Throttle Policy applied. 7583 GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` 7584 // GroupByOperationName - Group query result by Operation Name. 7585 GroupByOperationName *bool `json:"groupByOperationName,omitempty"` 7586 // GroupByResourceName - Group query result by Resource Name. 7587 GroupByResourceName *bool `json:"groupByResourceName,omitempty"` 7588} 7589 7590// UpdateResource the Update Resource model definition. 7591type UpdateResource struct { 7592 // Tags - Resource tags 7593 Tags map[string]*string `json:"tags"` 7594} 7595 7596// MarshalJSON is the custom marshaler for UpdateResource. 7597func (ur UpdateResource) MarshalJSON() ([]byte, error) { 7598 objectMap := make(map[string]interface{}) 7599 if ur.Tags != nil { 7600 objectMap["tags"] = ur.Tags 7601 } 7602 return json.Marshal(objectMap) 7603} 7604 7605// UpgradeOperationHistoricalStatusInfo virtual Machine Scale Set OS Upgrade History operation response. 7606type UpgradeOperationHistoricalStatusInfo struct { 7607 // Properties - READ-ONLY; Information about the properties of the upgrade operation. 7608 Properties *UpgradeOperationHistoricalStatusInfoProperties `json:"properties,omitempty"` 7609 // Type - READ-ONLY; Resource type 7610 Type *string `json:"type,omitempty"` 7611 // Location - READ-ONLY; Resource location 7612 Location *string `json:"location,omitempty"` 7613} 7614 7615// UpgradeOperationHistoricalStatusInfoProperties describes each OS upgrade on the Virtual Machine Scale 7616// Set. 7617type UpgradeOperationHistoricalStatusInfoProperties struct { 7618 // RunningStatus - READ-ONLY; Information about the overall status of the upgrade operation. 7619 RunningStatus *UpgradeOperationHistoryStatus `json:"runningStatus,omitempty"` 7620 // Progress - READ-ONLY; Counts of the VMs in each state. 7621 Progress *RollingUpgradeProgressInfo `json:"progress,omitempty"` 7622 // Error - READ-ONLY; Error Details for this upgrade if there are any. 7623 Error *APIError `json:"error,omitempty"` 7624 // StartedBy - READ-ONLY; Invoker of the Upgrade Operation. Possible values include: 'UpgradeOperationInvokerUnknown', 'UpgradeOperationInvokerUser', 'UpgradeOperationInvokerPlatform' 7625 StartedBy UpgradeOperationInvoker `json:"startedBy,omitempty"` 7626 // TargetImageReference - READ-ONLY; Image Reference details 7627 TargetImageReference *ImageReference `json:"targetImageReference,omitempty"` 7628 // RollbackInfo - READ-ONLY; Information about OS rollback if performed 7629 RollbackInfo *RollbackStatusInfo `json:"rollbackInfo,omitempty"` 7630} 7631 7632// UpgradeOperationHistoryStatus information about the current running state of the overall upgrade. 7633type UpgradeOperationHistoryStatus struct { 7634 // Code - READ-ONLY; Code indicating the current status of the upgrade. Possible values include: 'UpgradeStateRollingForward', 'UpgradeStateCancelled', 'UpgradeStateCompleted', 'UpgradeStateFaulted' 7635 Code UpgradeState `json:"code,omitempty"` 7636 // StartTime - READ-ONLY; Start time of the upgrade. 7637 StartTime *date.Time `json:"startTime,omitempty"` 7638 // EndTime - READ-ONLY; End time of the upgrade. 7639 EndTime *date.Time `json:"endTime,omitempty"` 7640} 7641 7642// UpgradePolicy describes an upgrade policy - automatic, manual, or rolling. 7643type UpgradePolicy struct { 7644 // 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: 'Automatic', 'Manual', 'Rolling' 7645 Mode UpgradeMode `json:"mode,omitempty"` 7646 // RollingUpgradePolicy - The configuration parameters used while performing a rolling upgrade. 7647 RollingUpgradePolicy *RollingUpgradePolicy `json:"rollingUpgradePolicy,omitempty"` 7648 // AutomaticOSUpgradePolicy - Configuration parameters used for performing automatic OS Upgrade. 7649 AutomaticOSUpgradePolicy *AutomaticOSUpgradePolicy `json:"automaticOSUpgradePolicy,omitempty"` 7650} 7651 7652// Usage describes Compute Resource Usage. 7653type Usage struct { 7654 // Unit - An enum describing the unit of usage measurement. 7655 Unit *string `json:"unit,omitempty"` 7656 // CurrentValue - The current usage of the resource. 7657 CurrentValue *int32 `json:"currentValue,omitempty"` 7658 // Limit - The maximum permitted usage of the resource. 7659 Limit *int64 `json:"limit,omitempty"` 7660 // Name - The name of the type of usage. 7661 Name *UsageName `json:"name,omitempty"` 7662} 7663 7664// UsageName the Usage Names. 7665type UsageName struct { 7666 // Value - The name of the resource. 7667 Value *string `json:"value,omitempty"` 7668 // LocalizedValue - The localized name of the resource. 7669 LocalizedValue *string `json:"localizedValue,omitempty"` 7670} 7671 7672// UserArtifactSource the source image from which the Image Version is going to be created. 7673type UserArtifactSource struct { 7674 // FileName - Required. The fileName of the artifact. 7675 FileName *string `json:"fileName,omitempty"` 7676 // MediaLink - Required. The mediaLink of the artifact, must be a readable storage blob. 7677 MediaLink *string `json:"mediaLink,omitempty"` 7678} 7679 7680// VaultCertificate describes a single certificate reference in a Key Vault, and where the certificate 7681// should reside on the VM. 7682type VaultCertificate struct { 7683 // 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>} 7684 CertificateURL *string `json:"certificateUrl,omitempty"` 7685 // 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. 7686 CertificateStore *string `json:"certificateStore,omitempty"` 7687} 7688 7689// VaultSecretGroup describes a set of certificates which are all in the same Key Vault. 7690type VaultSecretGroup struct { 7691 // SourceVault - The relative URL of the Key Vault containing all of the certificates in VaultCertificates. 7692 SourceVault *SubResource `json:"sourceVault,omitempty"` 7693 // VaultCertificates - The list of key vault references in SourceVault which contain certificates. 7694 VaultCertificates *[]VaultCertificate `json:"vaultCertificates,omitempty"` 7695} 7696 7697// VirtualHardDisk describes the uri of a disk. 7698type VirtualHardDisk struct { 7699 // URI - Specifies the virtual hard disk's uri. 7700 URI *string `json:"uri,omitempty"` 7701} 7702 7703// VirtualMachine describes a Virtual Machine. 7704type VirtualMachine struct { 7705 autorest.Response `json:"-"` 7706 // 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**. 7707 Plan *Plan `json:"plan,omitempty"` 7708 *VirtualMachineProperties `json:"properties,omitempty"` 7709 // Resources - READ-ONLY; The virtual machine child extension resources. 7710 Resources *[]VirtualMachineExtension `json:"resources,omitempty"` 7711 // Identity - The identity of the virtual machine, if configured. 7712 Identity *VirtualMachineIdentity `json:"identity,omitempty"` 7713 // Zones - The virtual machine zones. 7714 Zones *[]string `json:"zones,omitempty"` 7715 // ID - READ-ONLY; Resource Id 7716 ID *string `json:"id,omitempty"` 7717 // Name - READ-ONLY; Resource name 7718 Name *string `json:"name,omitempty"` 7719 // Type - READ-ONLY; Resource type 7720 Type *string `json:"type,omitempty"` 7721 // Location - Resource location 7722 Location *string `json:"location,omitempty"` 7723 // Tags - Resource tags 7724 Tags map[string]*string `json:"tags"` 7725} 7726 7727// MarshalJSON is the custom marshaler for VirtualMachine. 7728func (VM VirtualMachine) MarshalJSON() ([]byte, error) { 7729 objectMap := make(map[string]interface{}) 7730 if VM.Plan != nil { 7731 objectMap["plan"] = VM.Plan 7732 } 7733 if VM.VirtualMachineProperties != nil { 7734 objectMap["properties"] = VM.VirtualMachineProperties 7735 } 7736 if VM.Identity != nil { 7737 objectMap["identity"] = VM.Identity 7738 } 7739 if VM.Zones != nil { 7740 objectMap["zones"] = VM.Zones 7741 } 7742 if VM.Location != nil { 7743 objectMap["location"] = VM.Location 7744 } 7745 if VM.Tags != nil { 7746 objectMap["tags"] = VM.Tags 7747 } 7748 return json.Marshal(objectMap) 7749} 7750 7751// UnmarshalJSON is the custom unmarshaler for VirtualMachine struct. 7752func (VM *VirtualMachine) UnmarshalJSON(body []byte) error { 7753 var m map[string]*json.RawMessage 7754 err := json.Unmarshal(body, &m) 7755 if err != nil { 7756 return err 7757 } 7758 for k, v := range m { 7759 switch k { 7760 case "plan": 7761 if v != nil { 7762 var plan Plan 7763 err = json.Unmarshal(*v, &plan) 7764 if err != nil { 7765 return err 7766 } 7767 VM.Plan = &plan 7768 } 7769 case "properties": 7770 if v != nil { 7771 var virtualMachineProperties VirtualMachineProperties 7772 err = json.Unmarshal(*v, &virtualMachineProperties) 7773 if err != nil { 7774 return err 7775 } 7776 VM.VirtualMachineProperties = &virtualMachineProperties 7777 } 7778 case "resources": 7779 if v != nil { 7780 var resources []VirtualMachineExtension 7781 err = json.Unmarshal(*v, &resources) 7782 if err != nil { 7783 return err 7784 } 7785 VM.Resources = &resources 7786 } 7787 case "identity": 7788 if v != nil { 7789 var identity VirtualMachineIdentity 7790 err = json.Unmarshal(*v, &identity) 7791 if err != nil { 7792 return err 7793 } 7794 VM.Identity = &identity 7795 } 7796 case "zones": 7797 if v != nil { 7798 var zones []string 7799 err = json.Unmarshal(*v, &zones) 7800 if err != nil { 7801 return err 7802 } 7803 VM.Zones = &zones 7804 } 7805 case "id": 7806 if v != nil { 7807 var ID string 7808 err = json.Unmarshal(*v, &ID) 7809 if err != nil { 7810 return err 7811 } 7812 VM.ID = &ID 7813 } 7814 case "name": 7815 if v != nil { 7816 var name string 7817 err = json.Unmarshal(*v, &name) 7818 if err != nil { 7819 return err 7820 } 7821 VM.Name = &name 7822 } 7823 case "type": 7824 if v != nil { 7825 var typeVar string 7826 err = json.Unmarshal(*v, &typeVar) 7827 if err != nil { 7828 return err 7829 } 7830 VM.Type = &typeVar 7831 } 7832 case "location": 7833 if v != nil { 7834 var location string 7835 err = json.Unmarshal(*v, &location) 7836 if err != nil { 7837 return err 7838 } 7839 VM.Location = &location 7840 } 7841 case "tags": 7842 if v != nil { 7843 var tags map[string]*string 7844 err = json.Unmarshal(*v, &tags) 7845 if err != nil { 7846 return err 7847 } 7848 VM.Tags = tags 7849 } 7850 } 7851 } 7852 7853 return nil 7854} 7855 7856// VirtualMachineAgentInstanceView the instance view of the VM Agent running on the virtual machine. 7857type VirtualMachineAgentInstanceView struct { 7858 // VMAgentVersion - The VM Agent full version. 7859 VMAgentVersion *string `json:"vmAgentVersion,omitempty"` 7860 // ExtensionHandlers - The virtual machine extension handler instance view. 7861 ExtensionHandlers *[]VirtualMachineExtensionHandlerInstanceView `json:"extensionHandlers,omitempty"` 7862 // Statuses - The resource status information. 7863 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 7864} 7865 7866// VirtualMachineCaptureParameters capture Virtual Machine parameters. 7867type VirtualMachineCaptureParameters struct { 7868 // VhdPrefix - The captured virtual hard disk's name prefix. 7869 VhdPrefix *string `json:"vhdPrefix,omitempty"` 7870 // DestinationContainerName - The destination container name. 7871 DestinationContainerName *string `json:"destinationContainerName,omitempty"` 7872 // OverwriteVhds - Specifies whether to overwrite the destination virtual hard disk, in case of conflict. 7873 OverwriteVhds *bool `json:"overwriteVhds,omitempty"` 7874} 7875 7876// VirtualMachineCaptureResult output of virtual machine capture operation. 7877type VirtualMachineCaptureResult struct { 7878 autorest.Response `json:"-"` 7879 // Schema - READ-ONLY; the schema of the captured virtual machine 7880 Schema *string `json:"$schema,omitempty"` 7881 // ContentVersion - READ-ONLY; the version of the content 7882 ContentVersion *string `json:"contentVersion,omitempty"` 7883 // Parameters - READ-ONLY; parameters of the captured virtual machine 7884 Parameters interface{} `json:"parameters,omitempty"` 7885 // Resources - READ-ONLY; a list of resource items of the captured virtual machine 7886 Resources *[]interface{} `json:"resources,omitempty"` 7887 // ID - Resource Id 7888 ID *string `json:"id,omitempty"` 7889} 7890 7891// MarshalJSON is the custom marshaler for VirtualMachineCaptureResult. 7892func (vmcr VirtualMachineCaptureResult) MarshalJSON() ([]byte, error) { 7893 objectMap := make(map[string]interface{}) 7894 if vmcr.ID != nil { 7895 objectMap["id"] = vmcr.ID 7896 } 7897 return json.Marshal(objectMap) 7898} 7899 7900// VirtualMachineExtension describes a Virtual Machine Extension. 7901type VirtualMachineExtension struct { 7902 autorest.Response `json:"-"` 7903 *VirtualMachineExtensionProperties `json:"properties,omitempty"` 7904 // ID - READ-ONLY; Resource Id 7905 ID *string `json:"id,omitempty"` 7906 // Name - READ-ONLY; Resource name 7907 Name *string `json:"name,omitempty"` 7908 // Type - READ-ONLY; Resource type 7909 Type *string `json:"type,omitempty"` 7910 // Location - Resource location 7911 Location *string `json:"location,omitempty"` 7912 // Tags - Resource tags 7913 Tags map[string]*string `json:"tags"` 7914} 7915 7916// MarshalJSON is the custom marshaler for VirtualMachineExtension. 7917func (vme VirtualMachineExtension) MarshalJSON() ([]byte, error) { 7918 objectMap := make(map[string]interface{}) 7919 if vme.VirtualMachineExtensionProperties != nil { 7920 objectMap["properties"] = vme.VirtualMachineExtensionProperties 7921 } 7922 if vme.Location != nil { 7923 objectMap["location"] = vme.Location 7924 } 7925 if vme.Tags != nil { 7926 objectMap["tags"] = vme.Tags 7927 } 7928 return json.Marshal(objectMap) 7929} 7930 7931// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtension struct. 7932func (vme *VirtualMachineExtension) UnmarshalJSON(body []byte) error { 7933 var m map[string]*json.RawMessage 7934 err := json.Unmarshal(body, &m) 7935 if err != nil { 7936 return err 7937 } 7938 for k, v := range m { 7939 switch k { 7940 case "properties": 7941 if v != nil { 7942 var virtualMachineExtensionProperties VirtualMachineExtensionProperties 7943 err = json.Unmarshal(*v, &virtualMachineExtensionProperties) 7944 if err != nil { 7945 return err 7946 } 7947 vme.VirtualMachineExtensionProperties = &virtualMachineExtensionProperties 7948 } 7949 case "id": 7950 if v != nil { 7951 var ID string 7952 err = json.Unmarshal(*v, &ID) 7953 if err != nil { 7954 return err 7955 } 7956 vme.ID = &ID 7957 } 7958 case "name": 7959 if v != nil { 7960 var name string 7961 err = json.Unmarshal(*v, &name) 7962 if err != nil { 7963 return err 7964 } 7965 vme.Name = &name 7966 } 7967 case "type": 7968 if v != nil { 7969 var typeVar string 7970 err = json.Unmarshal(*v, &typeVar) 7971 if err != nil { 7972 return err 7973 } 7974 vme.Type = &typeVar 7975 } 7976 case "location": 7977 if v != nil { 7978 var location string 7979 err = json.Unmarshal(*v, &location) 7980 if err != nil { 7981 return err 7982 } 7983 vme.Location = &location 7984 } 7985 case "tags": 7986 if v != nil { 7987 var tags map[string]*string 7988 err = json.Unmarshal(*v, &tags) 7989 if err != nil { 7990 return err 7991 } 7992 vme.Tags = tags 7993 } 7994 } 7995 } 7996 7997 return nil 7998} 7999 8000// VirtualMachineExtensionHandlerInstanceView the instance view of a virtual machine extension handler. 8001type VirtualMachineExtensionHandlerInstanceView struct { 8002 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 8003 Type *string `json:"type,omitempty"` 8004 // TypeHandlerVersion - Specifies the version of the script handler. 8005 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 8006 // Status - The extension handler status. 8007 Status *InstanceViewStatus `json:"status,omitempty"` 8008} 8009 8010// VirtualMachineExtensionImage describes a Virtual Machine Extension Image. 8011type VirtualMachineExtensionImage struct { 8012 autorest.Response `json:"-"` 8013 *VirtualMachineExtensionImageProperties `json:"properties,omitempty"` 8014 // ID - READ-ONLY; Resource Id 8015 ID *string `json:"id,omitempty"` 8016 // Name - READ-ONLY; Resource name 8017 Name *string `json:"name,omitempty"` 8018 // Type - READ-ONLY; Resource type 8019 Type *string `json:"type,omitempty"` 8020 // Location - Resource location 8021 Location *string `json:"location,omitempty"` 8022 // Tags - Resource tags 8023 Tags map[string]*string `json:"tags"` 8024} 8025 8026// MarshalJSON is the custom marshaler for VirtualMachineExtensionImage. 8027func (vmei VirtualMachineExtensionImage) MarshalJSON() ([]byte, error) { 8028 objectMap := make(map[string]interface{}) 8029 if vmei.VirtualMachineExtensionImageProperties != nil { 8030 objectMap["properties"] = vmei.VirtualMachineExtensionImageProperties 8031 } 8032 if vmei.Location != nil { 8033 objectMap["location"] = vmei.Location 8034 } 8035 if vmei.Tags != nil { 8036 objectMap["tags"] = vmei.Tags 8037 } 8038 return json.Marshal(objectMap) 8039} 8040 8041// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtensionImage struct. 8042func (vmei *VirtualMachineExtensionImage) UnmarshalJSON(body []byte) error { 8043 var m map[string]*json.RawMessage 8044 err := json.Unmarshal(body, &m) 8045 if err != nil { 8046 return err 8047 } 8048 for k, v := range m { 8049 switch k { 8050 case "properties": 8051 if v != nil { 8052 var virtualMachineExtensionImageProperties VirtualMachineExtensionImageProperties 8053 err = json.Unmarshal(*v, &virtualMachineExtensionImageProperties) 8054 if err != nil { 8055 return err 8056 } 8057 vmei.VirtualMachineExtensionImageProperties = &virtualMachineExtensionImageProperties 8058 } 8059 case "id": 8060 if v != nil { 8061 var ID string 8062 err = json.Unmarshal(*v, &ID) 8063 if err != nil { 8064 return err 8065 } 8066 vmei.ID = &ID 8067 } 8068 case "name": 8069 if v != nil { 8070 var name string 8071 err = json.Unmarshal(*v, &name) 8072 if err != nil { 8073 return err 8074 } 8075 vmei.Name = &name 8076 } 8077 case "type": 8078 if v != nil { 8079 var typeVar string 8080 err = json.Unmarshal(*v, &typeVar) 8081 if err != nil { 8082 return err 8083 } 8084 vmei.Type = &typeVar 8085 } 8086 case "location": 8087 if v != nil { 8088 var location string 8089 err = json.Unmarshal(*v, &location) 8090 if err != nil { 8091 return err 8092 } 8093 vmei.Location = &location 8094 } 8095 case "tags": 8096 if v != nil { 8097 var tags map[string]*string 8098 err = json.Unmarshal(*v, &tags) 8099 if err != nil { 8100 return err 8101 } 8102 vmei.Tags = tags 8103 } 8104 } 8105 } 8106 8107 return nil 8108} 8109 8110// VirtualMachineExtensionImageProperties describes the properties of a Virtual Machine Extension Image. 8111type VirtualMachineExtensionImageProperties struct { 8112 // OperatingSystem - The operating system this extension supports. 8113 OperatingSystem *string `json:"operatingSystem,omitempty"` 8114 // ComputeRole - The type of role (IaaS or PaaS) this extension supports. 8115 ComputeRole *string `json:"computeRole,omitempty"` 8116 // HandlerSchema - The schema defined by publisher, where extension consumers should provide settings in a matching schema. 8117 HandlerSchema *string `json:"handlerSchema,omitempty"` 8118 // 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. 8119 VMScaleSetEnabled *bool `json:"vmScaleSetEnabled,omitempty"` 8120 // SupportsMultipleExtensions - Whether the handler can support multiple extensions. 8121 SupportsMultipleExtensions *bool `json:"supportsMultipleExtensions,omitempty"` 8122} 8123 8124// VirtualMachineExtensionInstanceView the instance view of a virtual machine extension. 8125type VirtualMachineExtensionInstanceView struct { 8126 // Name - The virtual machine extension name. 8127 Name *string `json:"name,omitempty"` 8128 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 8129 Type *string `json:"type,omitempty"` 8130 // TypeHandlerVersion - Specifies the version of the script handler. 8131 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 8132 // Substatuses - The resource status information. 8133 Substatuses *[]InstanceViewStatus `json:"substatuses,omitempty"` 8134 // Statuses - The resource status information. 8135 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 8136} 8137 8138// VirtualMachineExtensionProperties describes the properties of a Virtual Machine Extension. 8139type VirtualMachineExtensionProperties struct { 8140 // ForceUpdateTag - How the extension handler should be forced to update even if the extension configuration has not changed. 8141 ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` 8142 // Publisher - The name of the extension handler publisher. 8143 Publisher *string `json:"publisher,omitempty"` 8144 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 8145 Type *string `json:"type,omitempty"` 8146 // TypeHandlerVersion - Specifies the version of the script handler. 8147 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 8148 // 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. 8149 AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` 8150 // Settings - Json formatted public settings for the extension. 8151 Settings interface{} `json:"settings,omitempty"` 8152 // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. 8153 ProtectedSettings interface{} `json:"protectedSettings,omitempty"` 8154 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 8155 ProvisioningState *string `json:"provisioningState,omitempty"` 8156 // InstanceView - The virtual machine extension instance view. 8157 InstanceView *VirtualMachineExtensionInstanceView `json:"instanceView,omitempty"` 8158} 8159 8160// MarshalJSON is the custom marshaler for VirtualMachineExtensionProperties. 8161func (vmep VirtualMachineExtensionProperties) MarshalJSON() ([]byte, error) { 8162 objectMap := make(map[string]interface{}) 8163 if vmep.ForceUpdateTag != nil { 8164 objectMap["forceUpdateTag"] = vmep.ForceUpdateTag 8165 } 8166 if vmep.Publisher != nil { 8167 objectMap["publisher"] = vmep.Publisher 8168 } 8169 if vmep.Type != nil { 8170 objectMap["type"] = vmep.Type 8171 } 8172 if vmep.TypeHandlerVersion != nil { 8173 objectMap["typeHandlerVersion"] = vmep.TypeHandlerVersion 8174 } 8175 if vmep.AutoUpgradeMinorVersion != nil { 8176 objectMap["autoUpgradeMinorVersion"] = vmep.AutoUpgradeMinorVersion 8177 } 8178 if vmep.Settings != nil { 8179 objectMap["settings"] = vmep.Settings 8180 } 8181 if vmep.ProtectedSettings != nil { 8182 objectMap["protectedSettings"] = vmep.ProtectedSettings 8183 } 8184 if vmep.InstanceView != nil { 8185 objectMap["instanceView"] = vmep.InstanceView 8186 } 8187 return json.Marshal(objectMap) 8188} 8189 8190// VirtualMachineExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of 8191// a long-running operation. 8192type VirtualMachineExtensionsCreateOrUpdateFuture struct { 8193 azure.FutureAPI 8194 // Result returns the result of the asynchronous operation. 8195 // If the operation has not completed it will return an error. 8196 Result func(VirtualMachineExtensionsClient) (VirtualMachineExtension, error) 8197} 8198 8199// VirtualMachineExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of a 8200// long-running operation. 8201type VirtualMachineExtensionsDeleteFuture struct { 8202 azure.FutureAPI 8203 // Result returns the result of the asynchronous operation. 8204 // If the operation has not completed it will return an error. 8205 Result func(VirtualMachineExtensionsClient) (autorest.Response, error) 8206} 8207 8208// VirtualMachineExtensionsListResult the List Extension operation response 8209type VirtualMachineExtensionsListResult struct { 8210 autorest.Response `json:"-"` 8211 // Value - The list of extensions 8212 Value *[]VirtualMachineExtension `json:"value,omitempty"` 8213} 8214 8215// VirtualMachineExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of a 8216// long-running operation. 8217type VirtualMachineExtensionsUpdateFuture struct { 8218 azure.FutureAPI 8219 // Result returns the result of the asynchronous operation. 8220 // If the operation has not completed it will return an error. 8221 Result func(VirtualMachineExtensionsClient) (VirtualMachineExtension, error) 8222} 8223 8224// VirtualMachineExtensionUpdate describes a Virtual Machine Extension. 8225type VirtualMachineExtensionUpdate struct { 8226 *VirtualMachineExtensionUpdateProperties `json:"properties,omitempty"` 8227 // Tags - Resource tags 8228 Tags map[string]*string `json:"tags"` 8229} 8230 8231// MarshalJSON is the custom marshaler for VirtualMachineExtensionUpdate. 8232func (vmeu VirtualMachineExtensionUpdate) MarshalJSON() ([]byte, error) { 8233 objectMap := make(map[string]interface{}) 8234 if vmeu.VirtualMachineExtensionUpdateProperties != nil { 8235 objectMap["properties"] = vmeu.VirtualMachineExtensionUpdateProperties 8236 } 8237 if vmeu.Tags != nil { 8238 objectMap["tags"] = vmeu.Tags 8239 } 8240 return json.Marshal(objectMap) 8241} 8242 8243// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtensionUpdate struct. 8244func (vmeu *VirtualMachineExtensionUpdate) UnmarshalJSON(body []byte) error { 8245 var m map[string]*json.RawMessage 8246 err := json.Unmarshal(body, &m) 8247 if err != nil { 8248 return err 8249 } 8250 for k, v := range m { 8251 switch k { 8252 case "properties": 8253 if v != nil { 8254 var virtualMachineExtensionUpdateProperties VirtualMachineExtensionUpdateProperties 8255 err = json.Unmarshal(*v, &virtualMachineExtensionUpdateProperties) 8256 if err != nil { 8257 return err 8258 } 8259 vmeu.VirtualMachineExtensionUpdateProperties = &virtualMachineExtensionUpdateProperties 8260 } 8261 case "tags": 8262 if v != nil { 8263 var tags map[string]*string 8264 err = json.Unmarshal(*v, &tags) 8265 if err != nil { 8266 return err 8267 } 8268 vmeu.Tags = tags 8269 } 8270 } 8271 } 8272 8273 return nil 8274} 8275 8276// VirtualMachineExtensionUpdateProperties describes the properties of a Virtual Machine Extension. 8277type VirtualMachineExtensionUpdateProperties struct { 8278 // ForceUpdateTag - How the extension handler should be forced to update even if the extension configuration has not changed. 8279 ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` 8280 // Publisher - The name of the extension handler publisher. 8281 Publisher *string `json:"publisher,omitempty"` 8282 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 8283 Type *string `json:"type,omitempty"` 8284 // TypeHandlerVersion - Specifies the version of the script handler. 8285 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 8286 // 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. 8287 AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` 8288 // Settings - Json formatted public settings for the extension. 8289 Settings interface{} `json:"settings,omitempty"` 8290 // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. 8291 ProtectedSettings interface{} `json:"protectedSettings,omitempty"` 8292} 8293 8294// VirtualMachineHealthStatus the health status of the VM. 8295type VirtualMachineHealthStatus struct { 8296 // Status - READ-ONLY; The health status information for the VM. 8297 Status *InstanceViewStatus `json:"status,omitempty"` 8298} 8299 8300// VirtualMachineIdentity identity for the virtual machine. 8301type VirtualMachineIdentity struct { 8302 // PrincipalID - READ-ONLY; The principal id of virtual machine identity. This property will only be provided for a system assigned identity. 8303 PrincipalID *string `json:"principalId,omitempty"` 8304 // TenantID - READ-ONLY; The tenant id associated with the virtual machine. This property will only be provided for a system assigned identity. 8305 TenantID *string `json:"tenantId,omitempty"` 8306 // 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' 8307 Type ResourceIdentityType `json:"type,omitempty"` 8308 // 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}'. 8309 UserAssignedIdentities map[string]*VirtualMachineIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` 8310} 8311 8312// MarshalJSON is the custom marshaler for VirtualMachineIdentity. 8313func (vmi VirtualMachineIdentity) MarshalJSON() ([]byte, error) { 8314 objectMap := make(map[string]interface{}) 8315 if vmi.Type != "" { 8316 objectMap["type"] = vmi.Type 8317 } 8318 if vmi.UserAssignedIdentities != nil { 8319 objectMap["userAssignedIdentities"] = vmi.UserAssignedIdentities 8320 } 8321 return json.Marshal(objectMap) 8322} 8323 8324// VirtualMachineIdentityUserAssignedIdentitiesValue ... 8325type VirtualMachineIdentityUserAssignedIdentitiesValue struct { 8326 // PrincipalID - READ-ONLY; The principal id of user assigned identity. 8327 PrincipalID *string `json:"principalId,omitempty"` 8328 // ClientID - READ-ONLY; The client id of user assigned identity. 8329 ClientID *string `json:"clientId,omitempty"` 8330} 8331 8332// VirtualMachineImage describes a Virtual Machine Image. 8333type VirtualMachineImage struct { 8334 autorest.Response `json:"-"` 8335 *VirtualMachineImageProperties `json:"properties,omitempty"` 8336 // Name - The name of the resource. 8337 Name *string `json:"name,omitempty"` 8338 // Location - The supported Azure location of the resource. 8339 Location *string `json:"location,omitempty"` 8340 // 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). 8341 Tags map[string]*string `json:"tags"` 8342 // ID - Resource Id 8343 ID *string `json:"id,omitempty"` 8344} 8345 8346// MarshalJSON is the custom marshaler for VirtualMachineImage. 8347func (vmi VirtualMachineImage) MarshalJSON() ([]byte, error) { 8348 objectMap := make(map[string]interface{}) 8349 if vmi.VirtualMachineImageProperties != nil { 8350 objectMap["properties"] = vmi.VirtualMachineImageProperties 8351 } 8352 if vmi.Name != nil { 8353 objectMap["name"] = vmi.Name 8354 } 8355 if vmi.Location != nil { 8356 objectMap["location"] = vmi.Location 8357 } 8358 if vmi.Tags != nil { 8359 objectMap["tags"] = vmi.Tags 8360 } 8361 if vmi.ID != nil { 8362 objectMap["id"] = vmi.ID 8363 } 8364 return json.Marshal(objectMap) 8365} 8366 8367// UnmarshalJSON is the custom unmarshaler for VirtualMachineImage struct. 8368func (vmi *VirtualMachineImage) UnmarshalJSON(body []byte) error { 8369 var m map[string]*json.RawMessage 8370 err := json.Unmarshal(body, &m) 8371 if err != nil { 8372 return err 8373 } 8374 for k, v := range m { 8375 switch k { 8376 case "properties": 8377 if v != nil { 8378 var virtualMachineImageProperties VirtualMachineImageProperties 8379 err = json.Unmarshal(*v, &virtualMachineImageProperties) 8380 if err != nil { 8381 return err 8382 } 8383 vmi.VirtualMachineImageProperties = &virtualMachineImageProperties 8384 } 8385 case "name": 8386 if v != nil { 8387 var name string 8388 err = json.Unmarshal(*v, &name) 8389 if err != nil { 8390 return err 8391 } 8392 vmi.Name = &name 8393 } 8394 case "location": 8395 if v != nil { 8396 var location string 8397 err = json.Unmarshal(*v, &location) 8398 if err != nil { 8399 return err 8400 } 8401 vmi.Location = &location 8402 } 8403 case "tags": 8404 if v != nil { 8405 var tags map[string]*string 8406 err = json.Unmarshal(*v, &tags) 8407 if err != nil { 8408 return err 8409 } 8410 vmi.Tags = tags 8411 } 8412 case "id": 8413 if v != nil { 8414 var ID string 8415 err = json.Unmarshal(*v, &ID) 8416 if err != nil { 8417 return err 8418 } 8419 vmi.ID = &ID 8420 } 8421 } 8422 } 8423 8424 return nil 8425} 8426 8427// VirtualMachineImageProperties describes the properties of a Virtual Machine Image. 8428type VirtualMachineImageProperties struct { 8429 Plan *PurchasePlan `json:"plan,omitempty"` 8430 OsDiskImage *OSDiskImage `json:"osDiskImage,omitempty"` 8431 DataDiskImages *[]DataDiskImage `json:"dataDiskImages,omitempty"` 8432 AutomaticOSUpgradeProperties *AutomaticOSUpgradeProperties `json:"automaticOSUpgradeProperties,omitempty"` 8433 // HyperVGeneration - Possible values include: 'HyperVGenerationTypesV1', 'HyperVGenerationTypesV2' 8434 HyperVGeneration HyperVGenerationTypes `json:"hyperVGeneration,omitempty"` 8435} 8436 8437// VirtualMachineImageResource virtual machine image resource information. 8438type VirtualMachineImageResource struct { 8439 // Name - The name of the resource. 8440 Name *string `json:"name,omitempty"` 8441 // Location - The supported Azure location of the resource. 8442 Location *string `json:"location,omitempty"` 8443 // 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). 8444 Tags map[string]*string `json:"tags"` 8445 // ID - Resource Id 8446 ID *string `json:"id,omitempty"` 8447} 8448 8449// MarshalJSON is the custom marshaler for VirtualMachineImageResource. 8450func (vmir VirtualMachineImageResource) MarshalJSON() ([]byte, error) { 8451 objectMap := make(map[string]interface{}) 8452 if vmir.Name != nil { 8453 objectMap["name"] = vmir.Name 8454 } 8455 if vmir.Location != nil { 8456 objectMap["location"] = vmir.Location 8457 } 8458 if vmir.Tags != nil { 8459 objectMap["tags"] = vmir.Tags 8460 } 8461 if vmir.ID != nil { 8462 objectMap["id"] = vmir.ID 8463 } 8464 return json.Marshal(objectMap) 8465} 8466 8467// VirtualMachineInstanceView the instance view of a virtual machine. 8468type VirtualMachineInstanceView struct { 8469 autorest.Response `json:"-"` 8470 // PlatformUpdateDomain - Specifies the update domain of the virtual machine. 8471 PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` 8472 // PlatformFaultDomain - Specifies the fault domain of the virtual machine. 8473 PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` 8474 // ComputerName - The computer name assigned to the virtual machine. 8475 ComputerName *string `json:"computerName,omitempty"` 8476 // OsName - The Operating System running on the virtual machine. 8477 OsName *string `json:"osName,omitempty"` 8478 // OsVersion - The version of Operating System running on the virtual machine. 8479 OsVersion *string `json:"osVersion,omitempty"` 8480 // HyperVGeneration - Specifies the HyperVGeneration Type associated with a resource. Possible values include: 'HyperVGenerationTypeV1', 'HyperVGenerationTypeV2' 8481 HyperVGeneration HyperVGenerationType `json:"hyperVGeneration,omitempty"` 8482 // RdpThumbPrint - The Remote desktop certificate thumbprint. 8483 RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"` 8484 // VMAgent - The VM Agent running on the virtual machine. 8485 VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"` 8486 // MaintenanceRedeployStatus - The Maintenance Operation status on the virtual machine. 8487 MaintenanceRedeployStatus *MaintenanceRedeployStatus `json:"maintenanceRedeployStatus,omitempty"` 8488 // Disks - The virtual machine disk information. 8489 Disks *[]DiskInstanceView `json:"disks,omitempty"` 8490 // Extensions - The extensions information. 8491 Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` 8492 // 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. 8493 BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` 8494 // Statuses - The resource status information. 8495 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 8496} 8497 8498// VirtualMachineListResult the List Virtual Machine operation response. 8499type VirtualMachineListResult struct { 8500 autorest.Response `json:"-"` 8501 // Value - The list of virtual machines. 8502 Value *[]VirtualMachine `json:"value,omitempty"` 8503 // NextLink - The URI to fetch the next page of VMs. Call ListNext() with this URI to fetch the next page of Virtual Machines. 8504 NextLink *string `json:"nextLink,omitempty"` 8505} 8506 8507// VirtualMachineListResultIterator provides access to a complete listing of VirtualMachine values. 8508type VirtualMachineListResultIterator struct { 8509 i int 8510 page VirtualMachineListResultPage 8511} 8512 8513// NextWithContext advances to the next value. If there was an error making 8514// the request the iterator does not advance and the error is returned. 8515func (iter *VirtualMachineListResultIterator) NextWithContext(ctx context.Context) (err error) { 8516 if tracing.IsEnabled() { 8517 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineListResultIterator.NextWithContext") 8518 defer func() { 8519 sc := -1 8520 if iter.Response().Response.Response != nil { 8521 sc = iter.Response().Response.Response.StatusCode 8522 } 8523 tracing.EndSpan(ctx, sc, err) 8524 }() 8525 } 8526 iter.i++ 8527 if iter.i < len(iter.page.Values()) { 8528 return nil 8529 } 8530 err = iter.page.NextWithContext(ctx) 8531 if err != nil { 8532 iter.i-- 8533 return err 8534 } 8535 iter.i = 0 8536 return nil 8537} 8538 8539// Next advances to the next value. If there was an error making 8540// the request the iterator does not advance and the error is returned. 8541// Deprecated: Use NextWithContext() instead. 8542func (iter *VirtualMachineListResultIterator) Next() error { 8543 return iter.NextWithContext(context.Background()) 8544} 8545 8546// NotDone returns true if the enumeration should be started or is not yet complete. 8547func (iter VirtualMachineListResultIterator) NotDone() bool { 8548 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8549} 8550 8551// Response returns the raw server response from the last page request. 8552func (iter VirtualMachineListResultIterator) Response() VirtualMachineListResult { 8553 return iter.page.Response() 8554} 8555 8556// Value returns the current value or a zero-initialized value if the 8557// iterator has advanced beyond the end of the collection. 8558func (iter VirtualMachineListResultIterator) Value() VirtualMachine { 8559 if !iter.page.NotDone() { 8560 return VirtualMachine{} 8561 } 8562 return iter.page.Values()[iter.i] 8563} 8564 8565// Creates a new instance of the VirtualMachineListResultIterator type. 8566func NewVirtualMachineListResultIterator(page VirtualMachineListResultPage) VirtualMachineListResultIterator { 8567 return VirtualMachineListResultIterator{page: page} 8568} 8569 8570// IsEmpty returns true if the ListResult contains no values. 8571func (vmlr VirtualMachineListResult) IsEmpty() bool { 8572 return vmlr.Value == nil || len(*vmlr.Value) == 0 8573} 8574 8575// hasNextLink returns true if the NextLink is not empty. 8576func (vmlr VirtualMachineListResult) hasNextLink() bool { 8577 return vmlr.NextLink != nil && len(*vmlr.NextLink) != 0 8578} 8579 8580// virtualMachineListResultPreparer prepares a request to retrieve the next set of results. 8581// It returns nil if no more results exist. 8582func (vmlr VirtualMachineListResult) virtualMachineListResultPreparer(ctx context.Context) (*http.Request, error) { 8583 if !vmlr.hasNextLink() { 8584 return nil, nil 8585 } 8586 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8587 autorest.AsJSON(), 8588 autorest.AsGet(), 8589 autorest.WithBaseURL(to.String(vmlr.NextLink))) 8590} 8591 8592// VirtualMachineListResultPage contains a page of VirtualMachine values. 8593type VirtualMachineListResultPage struct { 8594 fn func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error) 8595 vmlr VirtualMachineListResult 8596} 8597 8598// NextWithContext advances to the next page of values. If there was an error making 8599// the request the page does not advance and the error is returned. 8600func (page *VirtualMachineListResultPage) NextWithContext(ctx context.Context) (err error) { 8601 if tracing.IsEnabled() { 8602 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineListResultPage.NextWithContext") 8603 defer func() { 8604 sc := -1 8605 if page.Response().Response.Response != nil { 8606 sc = page.Response().Response.Response.StatusCode 8607 } 8608 tracing.EndSpan(ctx, sc, err) 8609 }() 8610 } 8611 for { 8612 next, err := page.fn(ctx, page.vmlr) 8613 if err != nil { 8614 return err 8615 } 8616 page.vmlr = next 8617 if !next.hasNextLink() || !next.IsEmpty() { 8618 break 8619 } 8620 } 8621 return nil 8622} 8623 8624// Next advances to the next page of values. If there was an error making 8625// the request the page does not advance and the error is returned. 8626// Deprecated: Use NextWithContext() instead. 8627func (page *VirtualMachineListResultPage) Next() error { 8628 return page.NextWithContext(context.Background()) 8629} 8630 8631// NotDone returns true if the page enumeration should be started or is not yet complete. 8632func (page VirtualMachineListResultPage) NotDone() bool { 8633 return !page.vmlr.IsEmpty() 8634} 8635 8636// Response returns the raw server response from the last page request. 8637func (page VirtualMachineListResultPage) Response() VirtualMachineListResult { 8638 return page.vmlr 8639} 8640 8641// Values returns the slice of values for the current page or nil if there are no values. 8642func (page VirtualMachineListResultPage) Values() []VirtualMachine { 8643 if page.vmlr.IsEmpty() { 8644 return nil 8645 } 8646 return *page.vmlr.Value 8647} 8648 8649// Creates a new instance of the VirtualMachineListResultPage type. 8650func NewVirtualMachineListResultPage(cur VirtualMachineListResult, getNextPage func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error)) VirtualMachineListResultPage { 8651 return VirtualMachineListResultPage{ 8652 fn: getNextPage, 8653 vmlr: cur, 8654 } 8655} 8656 8657// VirtualMachineProperties describes the properties of a Virtual Machine. 8658type VirtualMachineProperties struct { 8659 // HardwareProfile - Specifies the hardware settings for the virtual machine. 8660 HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` 8661 // StorageProfile - Specifies the storage settings for the virtual machine disks. 8662 StorageProfile *StorageProfile `json:"storageProfile,omitempty"` 8663 // AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the virtual machine. 8664 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 8665 // OsProfile - Specifies the operating system settings used while creating the virtual machine. Some of the settings cannot be changed once VM is provisioned. 8666 OsProfile *OSProfile `json:"osProfile,omitempty"` 8667 // NetworkProfile - Specifies the network interfaces of the virtual machine. 8668 NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` 8669 // DiagnosticsProfile - Specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. 8670 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 8671 // 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. 8672 AvailabilitySet *SubResource `json:"availabilitySet,omitempty"` 8673 // 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 8674 VirtualMachineScaleSet *SubResource `json:"virtualMachineScaleSet,omitempty"` 8675 // ProximityPlacementGroup - Specifies information about the proximity placement group that the virtual machine should be assigned to. <br><br>Minimum api-version: 2018-04-01. 8676 ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` 8677 // Priority - Specifies the priority for the virtual machine. <br><br>Minimum api-version: 2019-03-01. Possible values include: 'Regular', 'Low', 'Spot' 8678 Priority VirtualMachinePriorityTypes `json:"priority,omitempty"` 8679 // EvictionPolicy - Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set. <br><br>For Azure Spot virtual machines, the only supported value is 'Deallocate' 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' 8680 EvictionPolicy VirtualMachineEvictionPolicyTypes `json:"evictionPolicy,omitempty"` 8681 // BillingProfile - Specifies the billing related details of a Azure Spot virtual machine. <br><br>Minimum api-version: 2019-03-01. 8682 BillingProfile *BillingProfile `json:"billingProfile,omitempty"` 8683 // Host - Specifies information about the dedicated host that the virtual machine resides in. <br><br>Minimum api-version: 2018-10-01. 8684 Host *SubResource `json:"host,omitempty"` 8685 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 8686 ProvisioningState *string `json:"provisioningState,omitempty"` 8687 // InstanceView - READ-ONLY; The virtual machine instance view. 8688 InstanceView *VirtualMachineInstanceView `json:"instanceView,omitempty"` 8689 // LicenseType - Specifies that the image or disk that is being used was licensed on-premises. This element is only used for images that contain the Windows Server operating system. <br><br> Possible values are: <br><br> Windows_Client <br><br> Windows_Server <br><br> If this element is included in a request for an update, the value must match the initial value. This value cannot be updated. <br><br> For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) <br><br> Minimum api-version: 2015-06-15 8690 LicenseType *string `json:"licenseType,omitempty"` 8691 // 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. 8692 VMID *string `json:"vmId,omitempty"` 8693} 8694 8695// MarshalJSON is the custom marshaler for VirtualMachineProperties. 8696func (vmp VirtualMachineProperties) MarshalJSON() ([]byte, error) { 8697 objectMap := make(map[string]interface{}) 8698 if vmp.HardwareProfile != nil { 8699 objectMap["hardwareProfile"] = vmp.HardwareProfile 8700 } 8701 if vmp.StorageProfile != nil { 8702 objectMap["storageProfile"] = vmp.StorageProfile 8703 } 8704 if vmp.AdditionalCapabilities != nil { 8705 objectMap["additionalCapabilities"] = vmp.AdditionalCapabilities 8706 } 8707 if vmp.OsProfile != nil { 8708 objectMap["osProfile"] = vmp.OsProfile 8709 } 8710 if vmp.NetworkProfile != nil { 8711 objectMap["networkProfile"] = vmp.NetworkProfile 8712 } 8713 if vmp.DiagnosticsProfile != nil { 8714 objectMap["diagnosticsProfile"] = vmp.DiagnosticsProfile 8715 } 8716 if vmp.AvailabilitySet != nil { 8717 objectMap["availabilitySet"] = vmp.AvailabilitySet 8718 } 8719 if vmp.VirtualMachineScaleSet != nil { 8720 objectMap["virtualMachineScaleSet"] = vmp.VirtualMachineScaleSet 8721 } 8722 if vmp.ProximityPlacementGroup != nil { 8723 objectMap["proximityPlacementGroup"] = vmp.ProximityPlacementGroup 8724 } 8725 if vmp.Priority != "" { 8726 objectMap["priority"] = vmp.Priority 8727 } 8728 if vmp.EvictionPolicy != "" { 8729 objectMap["evictionPolicy"] = vmp.EvictionPolicy 8730 } 8731 if vmp.BillingProfile != nil { 8732 objectMap["billingProfile"] = vmp.BillingProfile 8733 } 8734 if vmp.Host != nil { 8735 objectMap["host"] = vmp.Host 8736 } 8737 if vmp.LicenseType != nil { 8738 objectMap["licenseType"] = vmp.LicenseType 8739 } 8740 return json.Marshal(objectMap) 8741} 8742 8743// VirtualMachineReimageParameters parameters for Reimaging Virtual Machine. NOTE: Virtual Machine OS disk 8744// will always be reimaged 8745type VirtualMachineReimageParameters struct { 8746 // 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. 8747 TempDisk *bool `json:"tempDisk,omitempty"` 8748} 8749 8750// VirtualMachineScaleSet describes a Virtual Machine Scale Set. 8751type VirtualMachineScaleSet struct { 8752 autorest.Response `json:"-"` 8753 // Sku - The virtual machine scale set sku. 8754 Sku *Sku `json:"sku,omitempty"` 8755 // 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**. 8756 Plan *Plan `json:"plan,omitempty"` 8757 *VirtualMachineScaleSetProperties `json:"properties,omitempty"` 8758 // Identity - The identity of the virtual machine scale set, if configured. 8759 Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"` 8760 // Zones - The virtual machine scale set zones. NOTE: Availability zones can only be set when you create the scale set. 8761 Zones *[]string `json:"zones,omitempty"` 8762 // ID - READ-ONLY; Resource Id 8763 ID *string `json:"id,omitempty"` 8764 // Name - READ-ONLY; Resource name 8765 Name *string `json:"name,omitempty"` 8766 // Type - READ-ONLY; Resource type 8767 Type *string `json:"type,omitempty"` 8768 // Location - Resource location 8769 Location *string `json:"location,omitempty"` 8770 // Tags - Resource tags 8771 Tags map[string]*string `json:"tags"` 8772} 8773 8774// MarshalJSON is the custom marshaler for VirtualMachineScaleSet. 8775func (vmss VirtualMachineScaleSet) MarshalJSON() ([]byte, error) { 8776 objectMap := make(map[string]interface{}) 8777 if vmss.Sku != nil { 8778 objectMap["sku"] = vmss.Sku 8779 } 8780 if vmss.Plan != nil { 8781 objectMap["plan"] = vmss.Plan 8782 } 8783 if vmss.VirtualMachineScaleSetProperties != nil { 8784 objectMap["properties"] = vmss.VirtualMachineScaleSetProperties 8785 } 8786 if vmss.Identity != nil { 8787 objectMap["identity"] = vmss.Identity 8788 } 8789 if vmss.Zones != nil { 8790 objectMap["zones"] = vmss.Zones 8791 } 8792 if vmss.Location != nil { 8793 objectMap["location"] = vmss.Location 8794 } 8795 if vmss.Tags != nil { 8796 objectMap["tags"] = vmss.Tags 8797 } 8798 return json.Marshal(objectMap) 8799} 8800 8801// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSet struct. 8802func (vmss *VirtualMachineScaleSet) UnmarshalJSON(body []byte) error { 8803 var m map[string]*json.RawMessage 8804 err := json.Unmarshal(body, &m) 8805 if err != nil { 8806 return err 8807 } 8808 for k, v := range m { 8809 switch k { 8810 case "sku": 8811 if v != nil { 8812 var sku Sku 8813 err = json.Unmarshal(*v, &sku) 8814 if err != nil { 8815 return err 8816 } 8817 vmss.Sku = &sku 8818 } 8819 case "plan": 8820 if v != nil { 8821 var plan Plan 8822 err = json.Unmarshal(*v, &plan) 8823 if err != nil { 8824 return err 8825 } 8826 vmss.Plan = &plan 8827 } 8828 case "properties": 8829 if v != nil { 8830 var virtualMachineScaleSetProperties VirtualMachineScaleSetProperties 8831 err = json.Unmarshal(*v, &virtualMachineScaleSetProperties) 8832 if err != nil { 8833 return err 8834 } 8835 vmss.VirtualMachineScaleSetProperties = &virtualMachineScaleSetProperties 8836 } 8837 case "identity": 8838 if v != nil { 8839 var identity VirtualMachineScaleSetIdentity 8840 err = json.Unmarshal(*v, &identity) 8841 if err != nil { 8842 return err 8843 } 8844 vmss.Identity = &identity 8845 } 8846 case "zones": 8847 if v != nil { 8848 var zones []string 8849 err = json.Unmarshal(*v, &zones) 8850 if err != nil { 8851 return err 8852 } 8853 vmss.Zones = &zones 8854 } 8855 case "id": 8856 if v != nil { 8857 var ID string 8858 err = json.Unmarshal(*v, &ID) 8859 if err != nil { 8860 return err 8861 } 8862 vmss.ID = &ID 8863 } 8864 case "name": 8865 if v != nil { 8866 var name string 8867 err = json.Unmarshal(*v, &name) 8868 if err != nil { 8869 return err 8870 } 8871 vmss.Name = &name 8872 } 8873 case "type": 8874 if v != nil { 8875 var typeVar string 8876 err = json.Unmarshal(*v, &typeVar) 8877 if err != nil { 8878 return err 8879 } 8880 vmss.Type = &typeVar 8881 } 8882 case "location": 8883 if v != nil { 8884 var location string 8885 err = json.Unmarshal(*v, &location) 8886 if err != nil { 8887 return err 8888 } 8889 vmss.Location = &location 8890 } 8891 case "tags": 8892 if v != nil { 8893 var tags map[string]*string 8894 err = json.Unmarshal(*v, &tags) 8895 if err != nil { 8896 return err 8897 } 8898 vmss.Tags = tags 8899 } 8900 } 8901 } 8902 8903 return nil 8904} 8905 8906// VirtualMachineScaleSetDataDisk describes a virtual machine scale set data disk. 8907type VirtualMachineScaleSetDataDisk struct { 8908 // Name - The disk name. 8909 Name *string `json:"name,omitempty"` 8910 // 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. 8911 Lun *int32 `json:"lun,omitempty"` 8912 // 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' 8913 Caching CachingTypes `json:"caching,omitempty"` 8914 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 8915 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 8916 // CreateOption - The create option. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' 8917 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 8918 // 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 8919 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 8920 // ManagedDisk - The managed disk parameters. 8921 ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` 8922 // 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. 8923 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 8924 // 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. 8925 DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` 8926} 8927 8928// VirtualMachineScaleSetExtension describes a Virtual Machine Scale Set Extension. 8929type VirtualMachineScaleSetExtension struct { 8930 autorest.Response `json:"-"` 8931 // Name - The name of the extension. 8932 Name *string `json:"name,omitempty"` 8933 // Type - READ-ONLY; Resource type 8934 Type *string `json:"type,omitempty"` 8935 *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"` 8936 // ID - READ-ONLY; Resource Id 8937 ID *string `json:"id,omitempty"` 8938} 8939 8940// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtension. 8941func (vmsse VirtualMachineScaleSetExtension) MarshalJSON() ([]byte, error) { 8942 objectMap := make(map[string]interface{}) 8943 if vmsse.Name != nil { 8944 objectMap["name"] = vmsse.Name 8945 } 8946 if vmsse.VirtualMachineScaleSetExtensionProperties != nil { 8947 objectMap["properties"] = vmsse.VirtualMachineScaleSetExtensionProperties 8948 } 8949 return json.Marshal(objectMap) 8950} 8951 8952// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetExtension struct. 8953func (vmsse *VirtualMachineScaleSetExtension) UnmarshalJSON(body []byte) error { 8954 var m map[string]*json.RawMessage 8955 err := json.Unmarshal(body, &m) 8956 if err != nil { 8957 return err 8958 } 8959 for k, v := range m { 8960 switch k { 8961 case "name": 8962 if v != nil { 8963 var name string 8964 err = json.Unmarshal(*v, &name) 8965 if err != nil { 8966 return err 8967 } 8968 vmsse.Name = &name 8969 } 8970 case "type": 8971 if v != nil { 8972 var typeVar string 8973 err = json.Unmarshal(*v, &typeVar) 8974 if err != nil { 8975 return err 8976 } 8977 vmsse.Type = &typeVar 8978 } 8979 case "properties": 8980 if v != nil { 8981 var virtualMachineScaleSetExtensionProperties VirtualMachineScaleSetExtensionProperties 8982 err = json.Unmarshal(*v, &virtualMachineScaleSetExtensionProperties) 8983 if err != nil { 8984 return err 8985 } 8986 vmsse.VirtualMachineScaleSetExtensionProperties = &virtualMachineScaleSetExtensionProperties 8987 } 8988 case "id": 8989 if v != nil { 8990 var ID string 8991 err = json.Unmarshal(*v, &ID) 8992 if err != nil { 8993 return err 8994 } 8995 vmsse.ID = &ID 8996 } 8997 } 8998 } 8999 9000 return nil 9001} 9002 9003// VirtualMachineScaleSetExtensionListResult the List VM scale set extension operation response. 9004type VirtualMachineScaleSetExtensionListResult struct { 9005 autorest.Response `json:"-"` 9006 // Value - The list of VM scale set extensions. 9007 Value *[]VirtualMachineScaleSetExtension `json:"value,omitempty"` 9008 // 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. 9009 NextLink *string `json:"nextLink,omitempty"` 9010} 9011 9012// VirtualMachineScaleSetExtensionListResultIterator provides access to a complete listing of 9013// VirtualMachineScaleSetExtension values. 9014type VirtualMachineScaleSetExtensionListResultIterator struct { 9015 i int 9016 page VirtualMachineScaleSetExtensionListResultPage 9017} 9018 9019// NextWithContext advances to the next value. If there was an error making 9020// the request the iterator does not advance and the error is returned. 9021func (iter *VirtualMachineScaleSetExtensionListResultIterator) NextWithContext(ctx context.Context) (err error) { 9022 if tracing.IsEnabled() { 9023 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionListResultIterator.NextWithContext") 9024 defer func() { 9025 sc := -1 9026 if iter.Response().Response.Response != nil { 9027 sc = iter.Response().Response.Response.StatusCode 9028 } 9029 tracing.EndSpan(ctx, sc, err) 9030 }() 9031 } 9032 iter.i++ 9033 if iter.i < len(iter.page.Values()) { 9034 return nil 9035 } 9036 err = iter.page.NextWithContext(ctx) 9037 if err != nil { 9038 iter.i-- 9039 return err 9040 } 9041 iter.i = 0 9042 return nil 9043} 9044 9045// Next advances to the next value. If there was an error making 9046// the request the iterator does not advance and the error is returned. 9047// Deprecated: Use NextWithContext() instead. 9048func (iter *VirtualMachineScaleSetExtensionListResultIterator) Next() error { 9049 return iter.NextWithContext(context.Background()) 9050} 9051 9052// NotDone returns true if the enumeration should be started or is not yet complete. 9053func (iter VirtualMachineScaleSetExtensionListResultIterator) NotDone() bool { 9054 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9055} 9056 9057// Response returns the raw server response from the last page request. 9058func (iter VirtualMachineScaleSetExtensionListResultIterator) Response() VirtualMachineScaleSetExtensionListResult { 9059 return iter.page.Response() 9060} 9061 9062// Value returns the current value or a zero-initialized value if the 9063// iterator has advanced beyond the end of the collection. 9064func (iter VirtualMachineScaleSetExtensionListResultIterator) Value() VirtualMachineScaleSetExtension { 9065 if !iter.page.NotDone() { 9066 return VirtualMachineScaleSetExtension{} 9067 } 9068 return iter.page.Values()[iter.i] 9069} 9070 9071// Creates a new instance of the VirtualMachineScaleSetExtensionListResultIterator type. 9072func NewVirtualMachineScaleSetExtensionListResultIterator(page VirtualMachineScaleSetExtensionListResultPage) VirtualMachineScaleSetExtensionListResultIterator { 9073 return VirtualMachineScaleSetExtensionListResultIterator{page: page} 9074} 9075 9076// IsEmpty returns true if the ListResult contains no values. 9077func (vmsselr VirtualMachineScaleSetExtensionListResult) IsEmpty() bool { 9078 return vmsselr.Value == nil || len(*vmsselr.Value) == 0 9079} 9080 9081// hasNextLink returns true if the NextLink is not empty. 9082func (vmsselr VirtualMachineScaleSetExtensionListResult) hasNextLink() bool { 9083 return vmsselr.NextLink != nil && len(*vmsselr.NextLink) != 0 9084} 9085 9086// virtualMachineScaleSetExtensionListResultPreparer prepares a request to retrieve the next set of results. 9087// It returns nil if no more results exist. 9088func (vmsselr VirtualMachineScaleSetExtensionListResult) virtualMachineScaleSetExtensionListResultPreparer(ctx context.Context) (*http.Request, error) { 9089 if !vmsselr.hasNextLink() { 9090 return nil, nil 9091 } 9092 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9093 autorest.AsJSON(), 9094 autorest.AsGet(), 9095 autorest.WithBaseURL(to.String(vmsselr.NextLink))) 9096} 9097 9098// VirtualMachineScaleSetExtensionListResultPage contains a page of VirtualMachineScaleSetExtension values. 9099type VirtualMachineScaleSetExtensionListResultPage struct { 9100 fn func(context.Context, VirtualMachineScaleSetExtensionListResult) (VirtualMachineScaleSetExtensionListResult, error) 9101 vmsselr VirtualMachineScaleSetExtensionListResult 9102} 9103 9104// NextWithContext advances to the next page of values. If there was an error making 9105// the request the page does not advance and the error is returned. 9106func (page *VirtualMachineScaleSetExtensionListResultPage) NextWithContext(ctx context.Context) (err error) { 9107 if tracing.IsEnabled() { 9108 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionListResultPage.NextWithContext") 9109 defer func() { 9110 sc := -1 9111 if page.Response().Response.Response != nil { 9112 sc = page.Response().Response.Response.StatusCode 9113 } 9114 tracing.EndSpan(ctx, sc, err) 9115 }() 9116 } 9117 for { 9118 next, err := page.fn(ctx, page.vmsselr) 9119 if err != nil { 9120 return err 9121 } 9122 page.vmsselr = next 9123 if !next.hasNextLink() || !next.IsEmpty() { 9124 break 9125 } 9126 } 9127 return nil 9128} 9129 9130// Next advances to the next page of values. If there was an error making 9131// the request the page does not advance and the error is returned. 9132// Deprecated: Use NextWithContext() instead. 9133func (page *VirtualMachineScaleSetExtensionListResultPage) Next() error { 9134 return page.NextWithContext(context.Background()) 9135} 9136 9137// NotDone returns true if the page enumeration should be started or is not yet complete. 9138func (page VirtualMachineScaleSetExtensionListResultPage) NotDone() bool { 9139 return !page.vmsselr.IsEmpty() 9140} 9141 9142// Response returns the raw server response from the last page request. 9143func (page VirtualMachineScaleSetExtensionListResultPage) Response() VirtualMachineScaleSetExtensionListResult { 9144 return page.vmsselr 9145} 9146 9147// Values returns the slice of values for the current page or nil if there are no values. 9148func (page VirtualMachineScaleSetExtensionListResultPage) Values() []VirtualMachineScaleSetExtension { 9149 if page.vmsselr.IsEmpty() { 9150 return nil 9151 } 9152 return *page.vmsselr.Value 9153} 9154 9155// Creates a new instance of the VirtualMachineScaleSetExtensionListResultPage type. 9156func NewVirtualMachineScaleSetExtensionListResultPage(cur VirtualMachineScaleSetExtensionListResult, getNextPage func(context.Context, VirtualMachineScaleSetExtensionListResult) (VirtualMachineScaleSetExtensionListResult, error)) VirtualMachineScaleSetExtensionListResultPage { 9157 return VirtualMachineScaleSetExtensionListResultPage{ 9158 fn: getNextPage, 9159 vmsselr: cur, 9160 } 9161} 9162 9163// VirtualMachineScaleSetExtensionProfile describes a virtual machine scale set extension profile. 9164type VirtualMachineScaleSetExtensionProfile struct { 9165 // Extensions - The virtual machine scale set child extension resources. 9166 Extensions *[]VirtualMachineScaleSetExtension `json:"extensions,omitempty"` 9167} 9168 9169// VirtualMachineScaleSetExtensionProperties describes the properties of a Virtual Machine Scale Set 9170// Extension. 9171type VirtualMachineScaleSetExtensionProperties struct { 9172 // 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. 9173 ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` 9174 // Publisher - The name of the extension handler publisher. 9175 Publisher *string `json:"publisher,omitempty"` 9176 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 9177 Type *string `json:"type,omitempty"` 9178 // TypeHandlerVersion - Specifies the version of the script handler. 9179 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 9180 // 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. 9181 AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` 9182 // Settings - Json formatted public settings for the extension. 9183 Settings interface{} `json:"settings,omitempty"` 9184 // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. 9185 ProtectedSettings interface{} `json:"protectedSettings,omitempty"` 9186 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 9187 ProvisioningState *string `json:"provisioningState,omitempty"` 9188 // ProvisionAfterExtensions - Collection of extension names after which this extension needs to be provisioned. 9189 ProvisionAfterExtensions *[]string `json:"provisionAfterExtensions,omitempty"` 9190} 9191 9192// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtensionProperties. 9193func (vmssep VirtualMachineScaleSetExtensionProperties) MarshalJSON() ([]byte, error) { 9194 objectMap := make(map[string]interface{}) 9195 if vmssep.ForceUpdateTag != nil { 9196 objectMap["forceUpdateTag"] = vmssep.ForceUpdateTag 9197 } 9198 if vmssep.Publisher != nil { 9199 objectMap["publisher"] = vmssep.Publisher 9200 } 9201 if vmssep.Type != nil { 9202 objectMap["type"] = vmssep.Type 9203 } 9204 if vmssep.TypeHandlerVersion != nil { 9205 objectMap["typeHandlerVersion"] = vmssep.TypeHandlerVersion 9206 } 9207 if vmssep.AutoUpgradeMinorVersion != nil { 9208 objectMap["autoUpgradeMinorVersion"] = vmssep.AutoUpgradeMinorVersion 9209 } 9210 if vmssep.Settings != nil { 9211 objectMap["settings"] = vmssep.Settings 9212 } 9213 if vmssep.ProtectedSettings != nil { 9214 objectMap["protectedSettings"] = vmssep.ProtectedSettings 9215 } 9216 if vmssep.ProvisionAfterExtensions != nil { 9217 objectMap["provisionAfterExtensions"] = vmssep.ProvisionAfterExtensions 9218 } 9219 return json.Marshal(objectMap) 9220} 9221 9222// VirtualMachineScaleSetExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the 9223// results of a long-running operation. 9224type VirtualMachineScaleSetExtensionsCreateOrUpdateFuture struct { 9225 azure.FutureAPI 9226 // Result returns the result of the asynchronous operation. 9227 // If the operation has not completed it will return an error. 9228 Result func(VirtualMachineScaleSetExtensionsClient) (VirtualMachineScaleSetExtension, error) 9229} 9230 9231// VirtualMachineScaleSetExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of 9232// a long-running operation. 9233type VirtualMachineScaleSetExtensionsDeleteFuture struct { 9234 azure.FutureAPI 9235 // Result returns the result of the asynchronous operation. 9236 // If the operation has not completed it will return an error. 9237 Result func(VirtualMachineScaleSetExtensionsClient) (autorest.Response, error) 9238} 9239 9240// VirtualMachineScaleSetExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of 9241// a long-running operation. 9242type VirtualMachineScaleSetExtensionsUpdateFuture struct { 9243 azure.FutureAPI 9244 // Result returns the result of the asynchronous operation. 9245 // If the operation has not completed it will return an error. 9246 Result func(VirtualMachineScaleSetExtensionsClient) (VirtualMachineScaleSetExtension, error) 9247} 9248 9249// VirtualMachineScaleSetExtensionUpdate describes a Virtual Machine Scale Set Extension. 9250type VirtualMachineScaleSetExtensionUpdate struct { 9251 // Name - READ-ONLY; The name of the extension. 9252 Name *string `json:"name,omitempty"` 9253 // Type - READ-ONLY; Resource type 9254 Type *string `json:"type,omitempty"` 9255 *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"` 9256 // ID - READ-ONLY; Resource Id 9257 ID *string `json:"id,omitempty"` 9258} 9259 9260// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtensionUpdate. 9261func (vmsseu VirtualMachineScaleSetExtensionUpdate) MarshalJSON() ([]byte, error) { 9262 objectMap := make(map[string]interface{}) 9263 if vmsseu.VirtualMachineScaleSetExtensionProperties != nil { 9264 objectMap["properties"] = vmsseu.VirtualMachineScaleSetExtensionProperties 9265 } 9266 return json.Marshal(objectMap) 9267} 9268 9269// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetExtensionUpdate struct. 9270func (vmsseu *VirtualMachineScaleSetExtensionUpdate) UnmarshalJSON(body []byte) error { 9271 var m map[string]*json.RawMessage 9272 err := json.Unmarshal(body, &m) 9273 if err != nil { 9274 return err 9275 } 9276 for k, v := range m { 9277 switch k { 9278 case "name": 9279 if v != nil { 9280 var name string 9281 err = json.Unmarshal(*v, &name) 9282 if err != nil { 9283 return err 9284 } 9285 vmsseu.Name = &name 9286 } 9287 case "type": 9288 if v != nil { 9289 var typeVar string 9290 err = json.Unmarshal(*v, &typeVar) 9291 if err != nil { 9292 return err 9293 } 9294 vmsseu.Type = &typeVar 9295 } 9296 case "properties": 9297 if v != nil { 9298 var virtualMachineScaleSetExtensionProperties VirtualMachineScaleSetExtensionProperties 9299 err = json.Unmarshal(*v, &virtualMachineScaleSetExtensionProperties) 9300 if err != nil { 9301 return err 9302 } 9303 vmsseu.VirtualMachineScaleSetExtensionProperties = &virtualMachineScaleSetExtensionProperties 9304 } 9305 case "id": 9306 if v != nil { 9307 var ID string 9308 err = json.Unmarshal(*v, &ID) 9309 if err != nil { 9310 return err 9311 } 9312 vmsseu.ID = &ID 9313 } 9314 } 9315 } 9316 9317 return nil 9318} 9319 9320// VirtualMachineScaleSetIdentity identity for the virtual machine scale set. 9321type VirtualMachineScaleSetIdentity struct { 9322 // PrincipalID - READ-ONLY; The principal id of virtual machine scale set identity. This property will only be provided for a system assigned identity. 9323 PrincipalID *string `json:"principalId,omitempty"` 9324 // TenantID - READ-ONLY; The tenant id associated with the virtual machine scale set. This property will only be provided for a system assigned identity. 9325 TenantID *string `json:"tenantId,omitempty"` 9326 // 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' 9327 Type ResourceIdentityType `json:"type,omitempty"` 9328 // 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}'. 9329 UserAssignedIdentities map[string]*VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` 9330} 9331 9332// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIdentity. 9333func (vmssi VirtualMachineScaleSetIdentity) MarshalJSON() ([]byte, error) { 9334 objectMap := make(map[string]interface{}) 9335 if vmssi.Type != "" { 9336 objectMap["type"] = vmssi.Type 9337 } 9338 if vmssi.UserAssignedIdentities != nil { 9339 objectMap["userAssignedIdentities"] = vmssi.UserAssignedIdentities 9340 } 9341 return json.Marshal(objectMap) 9342} 9343 9344// VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue ... 9345type VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue struct { 9346 // PrincipalID - READ-ONLY; The principal id of user assigned identity. 9347 PrincipalID *string `json:"principalId,omitempty"` 9348 // ClientID - READ-ONLY; The client id of user assigned identity. 9349 ClientID *string `json:"clientId,omitempty"` 9350} 9351 9352// VirtualMachineScaleSetInstanceView the instance view of a virtual machine scale set. 9353type VirtualMachineScaleSetInstanceView struct { 9354 autorest.Response `json:"-"` 9355 // VirtualMachine - READ-ONLY; The instance view status summary for the virtual machine scale set. 9356 VirtualMachine *VirtualMachineScaleSetInstanceViewStatusesSummary `json:"virtualMachine,omitempty"` 9357 // Extensions - READ-ONLY; The extensions information. 9358 Extensions *[]VirtualMachineScaleSetVMExtensionsSummary `json:"extensions,omitempty"` 9359 // Statuses - The resource status information. 9360 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 9361} 9362 9363// MarshalJSON is the custom marshaler for VirtualMachineScaleSetInstanceView. 9364func (vmssiv VirtualMachineScaleSetInstanceView) MarshalJSON() ([]byte, error) { 9365 objectMap := make(map[string]interface{}) 9366 if vmssiv.Statuses != nil { 9367 objectMap["statuses"] = vmssiv.Statuses 9368 } 9369 return json.Marshal(objectMap) 9370} 9371 9372// VirtualMachineScaleSetInstanceViewStatusesSummary instance view statuses summary for virtual machines of 9373// a virtual machine scale set. 9374type VirtualMachineScaleSetInstanceViewStatusesSummary struct { 9375 // StatusesSummary - READ-ONLY; The extensions information. 9376 StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` 9377} 9378 9379// VirtualMachineScaleSetIPConfiguration describes a virtual machine scale set network profile's IP 9380// configuration. 9381type VirtualMachineScaleSetIPConfiguration struct { 9382 // Name - The IP configuration name. 9383 Name *string `json:"name,omitempty"` 9384 *VirtualMachineScaleSetIPConfigurationProperties `json:"properties,omitempty"` 9385 // ID - Resource Id 9386 ID *string `json:"id,omitempty"` 9387} 9388 9389// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIPConfiguration. 9390func (vmssic VirtualMachineScaleSetIPConfiguration) MarshalJSON() ([]byte, error) { 9391 objectMap := make(map[string]interface{}) 9392 if vmssic.Name != nil { 9393 objectMap["name"] = vmssic.Name 9394 } 9395 if vmssic.VirtualMachineScaleSetIPConfigurationProperties != nil { 9396 objectMap["properties"] = vmssic.VirtualMachineScaleSetIPConfigurationProperties 9397 } 9398 if vmssic.ID != nil { 9399 objectMap["id"] = vmssic.ID 9400 } 9401 return json.Marshal(objectMap) 9402} 9403 9404// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetIPConfiguration struct. 9405func (vmssic *VirtualMachineScaleSetIPConfiguration) UnmarshalJSON(body []byte) error { 9406 var m map[string]*json.RawMessage 9407 err := json.Unmarshal(body, &m) 9408 if err != nil { 9409 return err 9410 } 9411 for k, v := range m { 9412 switch k { 9413 case "name": 9414 if v != nil { 9415 var name string 9416 err = json.Unmarshal(*v, &name) 9417 if err != nil { 9418 return err 9419 } 9420 vmssic.Name = &name 9421 } 9422 case "properties": 9423 if v != nil { 9424 var virtualMachineScaleSetIPConfigurationProperties VirtualMachineScaleSetIPConfigurationProperties 9425 err = json.Unmarshal(*v, &virtualMachineScaleSetIPConfigurationProperties) 9426 if err != nil { 9427 return err 9428 } 9429 vmssic.VirtualMachineScaleSetIPConfigurationProperties = &virtualMachineScaleSetIPConfigurationProperties 9430 } 9431 case "id": 9432 if v != nil { 9433 var ID string 9434 err = json.Unmarshal(*v, &ID) 9435 if err != nil { 9436 return err 9437 } 9438 vmssic.ID = &ID 9439 } 9440 } 9441 } 9442 9443 return nil 9444} 9445 9446// VirtualMachineScaleSetIPConfigurationProperties describes a virtual machine scale set network profile's 9447// IP configuration properties. 9448type VirtualMachineScaleSetIPConfigurationProperties struct { 9449 // Subnet - Specifies the identifier of the subnet. 9450 Subnet *APIEntityReference `json:"subnet,omitempty"` 9451 // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. 9452 Primary *bool `json:"primary,omitempty"` 9453 // PublicIPAddressConfiguration - The publicIPAddressConfiguration. 9454 PublicIPAddressConfiguration *VirtualMachineScaleSetPublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` 9455 // 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' 9456 PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` 9457 // 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. 9458 ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` 9459 // ApplicationSecurityGroups - Specifies an array of references to application security group. 9460 ApplicationSecurityGroups *[]SubResource `json:"applicationSecurityGroups,omitempty"` 9461 // 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 load balancer. 9462 LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` 9463 // 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 load balancer 9464 LoadBalancerInboundNatPools *[]SubResource `json:"loadBalancerInboundNatPools,omitempty"` 9465} 9466 9467// VirtualMachineScaleSetIPTag contains the IP tag associated with the public IP address. 9468type VirtualMachineScaleSetIPTag struct { 9469 // IPTagType - IP tag type. Example: FirstPartyUsage. 9470 IPTagType *string `json:"ipTagType,omitempty"` 9471 // Tag - IP tag associated with the public IP. Example: SQL, Storage etc. 9472 Tag *string `json:"tag,omitempty"` 9473} 9474 9475// VirtualMachineScaleSetListOSUpgradeHistory list of Virtual Machine Scale Set OS Upgrade History 9476// operation response. 9477type VirtualMachineScaleSetListOSUpgradeHistory struct { 9478 autorest.Response `json:"-"` 9479 // Value - The list of OS upgrades performed on the virtual machine scale set. 9480 Value *[]UpgradeOperationHistoricalStatusInfo `json:"value,omitempty"` 9481 // 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. 9482 NextLink *string `json:"nextLink,omitempty"` 9483} 9484 9485// VirtualMachineScaleSetListOSUpgradeHistoryIterator provides access to a complete listing of 9486// UpgradeOperationHistoricalStatusInfo values. 9487type VirtualMachineScaleSetListOSUpgradeHistoryIterator struct { 9488 i int 9489 page VirtualMachineScaleSetListOSUpgradeHistoryPage 9490} 9491 9492// NextWithContext advances to the next value. If there was an error making 9493// the request the iterator does not advance and the error is returned. 9494func (iter *VirtualMachineScaleSetListOSUpgradeHistoryIterator) NextWithContext(ctx context.Context) (err error) { 9495 if tracing.IsEnabled() { 9496 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListOSUpgradeHistoryIterator.NextWithContext") 9497 defer func() { 9498 sc := -1 9499 if iter.Response().Response.Response != nil { 9500 sc = iter.Response().Response.Response.StatusCode 9501 } 9502 tracing.EndSpan(ctx, sc, err) 9503 }() 9504 } 9505 iter.i++ 9506 if iter.i < len(iter.page.Values()) { 9507 return nil 9508 } 9509 err = iter.page.NextWithContext(ctx) 9510 if err != nil { 9511 iter.i-- 9512 return err 9513 } 9514 iter.i = 0 9515 return nil 9516} 9517 9518// Next advances to the next value. If there was an error making 9519// the request the iterator does not advance and the error is returned. 9520// Deprecated: Use NextWithContext() instead. 9521func (iter *VirtualMachineScaleSetListOSUpgradeHistoryIterator) Next() error { 9522 return iter.NextWithContext(context.Background()) 9523} 9524 9525// NotDone returns true if the enumeration should be started or is not yet complete. 9526func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) NotDone() bool { 9527 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9528} 9529 9530// Response returns the raw server response from the last page request. 9531func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) Response() VirtualMachineScaleSetListOSUpgradeHistory { 9532 return iter.page.Response() 9533} 9534 9535// Value returns the current value or a zero-initialized value if the 9536// iterator has advanced beyond the end of the collection. 9537func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) Value() UpgradeOperationHistoricalStatusInfo { 9538 if !iter.page.NotDone() { 9539 return UpgradeOperationHistoricalStatusInfo{} 9540 } 9541 return iter.page.Values()[iter.i] 9542} 9543 9544// Creates a new instance of the VirtualMachineScaleSetListOSUpgradeHistoryIterator type. 9545func NewVirtualMachineScaleSetListOSUpgradeHistoryIterator(page VirtualMachineScaleSetListOSUpgradeHistoryPage) VirtualMachineScaleSetListOSUpgradeHistoryIterator { 9546 return VirtualMachineScaleSetListOSUpgradeHistoryIterator{page: page} 9547} 9548 9549// IsEmpty returns true if the ListResult contains no values. 9550func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) IsEmpty() bool { 9551 return vmsslouh.Value == nil || len(*vmsslouh.Value) == 0 9552} 9553 9554// hasNextLink returns true if the NextLink is not empty. 9555func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) hasNextLink() bool { 9556 return vmsslouh.NextLink != nil && len(*vmsslouh.NextLink) != 0 9557} 9558 9559// virtualMachineScaleSetListOSUpgradeHistoryPreparer prepares a request to retrieve the next set of results. 9560// It returns nil if no more results exist. 9561func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) virtualMachineScaleSetListOSUpgradeHistoryPreparer(ctx context.Context) (*http.Request, error) { 9562 if !vmsslouh.hasNextLink() { 9563 return nil, nil 9564 } 9565 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9566 autorest.AsJSON(), 9567 autorest.AsGet(), 9568 autorest.WithBaseURL(to.String(vmsslouh.NextLink))) 9569} 9570 9571// VirtualMachineScaleSetListOSUpgradeHistoryPage contains a page of UpgradeOperationHistoricalStatusInfo 9572// values. 9573type VirtualMachineScaleSetListOSUpgradeHistoryPage struct { 9574 fn func(context.Context, VirtualMachineScaleSetListOSUpgradeHistory) (VirtualMachineScaleSetListOSUpgradeHistory, error) 9575 vmsslouh VirtualMachineScaleSetListOSUpgradeHistory 9576} 9577 9578// NextWithContext advances to the next page of values. If there was an error making 9579// the request the page does not advance and the error is returned. 9580func (page *VirtualMachineScaleSetListOSUpgradeHistoryPage) NextWithContext(ctx context.Context) (err error) { 9581 if tracing.IsEnabled() { 9582 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListOSUpgradeHistoryPage.NextWithContext") 9583 defer func() { 9584 sc := -1 9585 if page.Response().Response.Response != nil { 9586 sc = page.Response().Response.Response.StatusCode 9587 } 9588 tracing.EndSpan(ctx, sc, err) 9589 }() 9590 } 9591 for { 9592 next, err := page.fn(ctx, page.vmsslouh) 9593 if err != nil { 9594 return err 9595 } 9596 page.vmsslouh = next 9597 if !next.hasNextLink() || !next.IsEmpty() { 9598 break 9599 } 9600 } 9601 return nil 9602} 9603 9604// Next advances to the next page of values. If there was an error making 9605// the request the page does not advance and the error is returned. 9606// Deprecated: Use NextWithContext() instead. 9607func (page *VirtualMachineScaleSetListOSUpgradeHistoryPage) Next() error { 9608 return page.NextWithContext(context.Background()) 9609} 9610 9611// NotDone returns true if the page enumeration should be started or is not yet complete. 9612func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) NotDone() bool { 9613 return !page.vmsslouh.IsEmpty() 9614} 9615 9616// Response returns the raw server response from the last page request. 9617func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) Response() VirtualMachineScaleSetListOSUpgradeHistory { 9618 return page.vmsslouh 9619} 9620 9621// Values returns the slice of values for the current page or nil if there are no values. 9622func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) Values() []UpgradeOperationHistoricalStatusInfo { 9623 if page.vmsslouh.IsEmpty() { 9624 return nil 9625 } 9626 return *page.vmsslouh.Value 9627} 9628 9629// Creates a new instance of the VirtualMachineScaleSetListOSUpgradeHistoryPage type. 9630func NewVirtualMachineScaleSetListOSUpgradeHistoryPage(cur VirtualMachineScaleSetListOSUpgradeHistory, getNextPage func(context.Context, VirtualMachineScaleSetListOSUpgradeHistory) (VirtualMachineScaleSetListOSUpgradeHistory, error)) VirtualMachineScaleSetListOSUpgradeHistoryPage { 9631 return VirtualMachineScaleSetListOSUpgradeHistoryPage{ 9632 fn: getNextPage, 9633 vmsslouh: cur, 9634 } 9635} 9636 9637// VirtualMachineScaleSetListResult the List Virtual Machine operation response. 9638type VirtualMachineScaleSetListResult struct { 9639 autorest.Response `json:"-"` 9640 // Value - The list of virtual machine scale sets. 9641 Value *[]VirtualMachineScaleSet `json:"value,omitempty"` 9642 // NextLink - The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with this to fetch the next page of VMSS. 9643 NextLink *string `json:"nextLink,omitempty"` 9644} 9645 9646// VirtualMachineScaleSetListResultIterator provides access to a complete listing of VirtualMachineScaleSet 9647// values. 9648type VirtualMachineScaleSetListResultIterator struct { 9649 i int 9650 page VirtualMachineScaleSetListResultPage 9651} 9652 9653// NextWithContext advances to the next value. If there was an error making 9654// the request the iterator does not advance and the error is returned. 9655func (iter *VirtualMachineScaleSetListResultIterator) NextWithContext(ctx context.Context) (err error) { 9656 if tracing.IsEnabled() { 9657 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListResultIterator.NextWithContext") 9658 defer func() { 9659 sc := -1 9660 if iter.Response().Response.Response != nil { 9661 sc = iter.Response().Response.Response.StatusCode 9662 } 9663 tracing.EndSpan(ctx, sc, err) 9664 }() 9665 } 9666 iter.i++ 9667 if iter.i < len(iter.page.Values()) { 9668 return nil 9669 } 9670 err = iter.page.NextWithContext(ctx) 9671 if err != nil { 9672 iter.i-- 9673 return err 9674 } 9675 iter.i = 0 9676 return nil 9677} 9678 9679// Next advances to the next value. If there was an error making 9680// the request the iterator does not advance and the error is returned. 9681// Deprecated: Use NextWithContext() instead. 9682func (iter *VirtualMachineScaleSetListResultIterator) Next() error { 9683 return iter.NextWithContext(context.Background()) 9684} 9685 9686// NotDone returns true if the enumeration should be started or is not yet complete. 9687func (iter VirtualMachineScaleSetListResultIterator) NotDone() bool { 9688 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9689} 9690 9691// Response returns the raw server response from the last page request. 9692func (iter VirtualMachineScaleSetListResultIterator) Response() VirtualMachineScaleSetListResult { 9693 return iter.page.Response() 9694} 9695 9696// Value returns the current value or a zero-initialized value if the 9697// iterator has advanced beyond the end of the collection. 9698func (iter VirtualMachineScaleSetListResultIterator) Value() VirtualMachineScaleSet { 9699 if !iter.page.NotDone() { 9700 return VirtualMachineScaleSet{} 9701 } 9702 return iter.page.Values()[iter.i] 9703} 9704 9705// Creates a new instance of the VirtualMachineScaleSetListResultIterator type. 9706func NewVirtualMachineScaleSetListResultIterator(page VirtualMachineScaleSetListResultPage) VirtualMachineScaleSetListResultIterator { 9707 return VirtualMachineScaleSetListResultIterator{page: page} 9708} 9709 9710// IsEmpty returns true if the ListResult contains no values. 9711func (vmsslr VirtualMachineScaleSetListResult) IsEmpty() bool { 9712 return vmsslr.Value == nil || len(*vmsslr.Value) == 0 9713} 9714 9715// hasNextLink returns true if the NextLink is not empty. 9716func (vmsslr VirtualMachineScaleSetListResult) hasNextLink() bool { 9717 return vmsslr.NextLink != nil && len(*vmsslr.NextLink) != 0 9718} 9719 9720// virtualMachineScaleSetListResultPreparer prepares a request to retrieve the next set of results. 9721// It returns nil if no more results exist. 9722func (vmsslr VirtualMachineScaleSetListResult) virtualMachineScaleSetListResultPreparer(ctx context.Context) (*http.Request, error) { 9723 if !vmsslr.hasNextLink() { 9724 return nil, nil 9725 } 9726 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9727 autorest.AsJSON(), 9728 autorest.AsGet(), 9729 autorest.WithBaseURL(to.String(vmsslr.NextLink))) 9730} 9731 9732// VirtualMachineScaleSetListResultPage contains a page of VirtualMachineScaleSet values. 9733type VirtualMachineScaleSetListResultPage struct { 9734 fn func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error) 9735 vmsslr VirtualMachineScaleSetListResult 9736} 9737 9738// NextWithContext advances to the next page of values. If there was an error making 9739// the request the page does not advance and the error is returned. 9740func (page *VirtualMachineScaleSetListResultPage) NextWithContext(ctx context.Context) (err error) { 9741 if tracing.IsEnabled() { 9742 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListResultPage.NextWithContext") 9743 defer func() { 9744 sc := -1 9745 if page.Response().Response.Response != nil { 9746 sc = page.Response().Response.Response.StatusCode 9747 } 9748 tracing.EndSpan(ctx, sc, err) 9749 }() 9750 } 9751 for { 9752 next, err := page.fn(ctx, page.vmsslr) 9753 if err != nil { 9754 return err 9755 } 9756 page.vmsslr = next 9757 if !next.hasNextLink() || !next.IsEmpty() { 9758 break 9759 } 9760 } 9761 return nil 9762} 9763 9764// Next advances to the next page of values. If there was an error making 9765// the request the page does not advance and the error is returned. 9766// Deprecated: Use NextWithContext() instead. 9767func (page *VirtualMachineScaleSetListResultPage) Next() error { 9768 return page.NextWithContext(context.Background()) 9769} 9770 9771// NotDone returns true if the page enumeration should be started or is not yet complete. 9772func (page VirtualMachineScaleSetListResultPage) NotDone() bool { 9773 return !page.vmsslr.IsEmpty() 9774} 9775 9776// Response returns the raw server response from the last page request. 9777func (page VirtualMachineScaleSetListResultPage) Response() VirtualMachineScaleSetListResult { 9778 return page.vmsslr 9779} 9780 9781// Values returns the slice of values for the current page or nil if there are no values. 9782func (page VirtualMachineScaleSetListResultPage) Values() []VirtualMachineScaleSet { 9783 if page.vmsslr.IsEmpty() { 9784 return nil 9785 } 9786 return *page.vmsslr.Value 9787} 9788 9789// Creates a new instance of the VirtualMachineScaleSetListResultPage type. 9790func NewVirtualMachineScaleSetListResultPage(cur VirtualMachineScaleSetListResult, getNextPage func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error)) VirtualMachineScaleSetListResultPage { 9791 return VirtualMachineScaleSetListResultPage{ 9792 fn: getNextPage, 9793 vmsslr: cur, 9794 } 9795} 9796 9797// VirtualMachineScaleSetListSkusResult the Virtual Machine Scale Set List Skus operation response. 9798type VirtualMachineScaleSetListSkusResult struct { 9799 autorest.Response `json:"-"` 9800 // Value - The list of skus available for the virtual machine scale set. 9801 Value *[]VirtualMachineScaleSetSku `json:"value,omitempty"` 9802 // 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. 9803 NextLink *string `json:"nextLink,omitempty"` 9804} 9805 9806// VirtualMachineScaleSetListSkusResultIterator provides access to a complete listing of 9807// VirtualMachineScaleSetSku values. 9808type VirtualMachineScaleSetListSkusResultIterator struct { 9809 i int 9810 page VirtualMachineScaleSetListSkusResultPage 9811} 9812 9813// NextWithContext advances to the next value. If there was an error making 9814// the request the iterator does not advance and the error is returned. 9815func (iter *VirtualMachineScaleSetListSkusResultIterator) NextWithContext(ctx context.Context) (err error) { 9816 if tracing.IsEnabled() { 9817 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListSkusResultIterator.NextWithContext") 9818 defer func() { 9819 sc := -1 9820 if iter.Response().Response.Response != nil { 9821 sc = iter.Response().Response.Response.StatusCode 9822 } 9823 tracing.EndSpan(ctx, sc, err) 9824 }() 9825 } 9826 iter.i++ 9827 if iter.i < len(iter.page.Values()) { 9828 return nil 9829 } 9830 err = iter.page.NextWithContext(ctx) 9831 if err != nil { 9832 iter.i-- 9833 return err 9834 } 9835 iter.i = 0 9836 return nil 9837} 9838 9839// Next advances to the next value. If there was an error making 9840// the request the iterator does not advance and the error is returned. 9841// Deprecated: Use NextWithContext() instead. 9842func (iter *VirtualMachineScaleSetListSkusResultIterator) Next() error { 9843 return iter.NextWithContext(context.Background()) 9844} 9845 9846// NotDone returns true if the enumeration should be started or is not yet complete. 9847func (iter VirtualMachineScaleSetListSkusResultIterator) NotDone() bool { 9848 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9849} 9850 9851// Response returns the raw server response from the last page request. 9852func (iter VirtualMachineScaleSetListSkusResultIterator) Response() VirtualMachineScaleSetListSkusResult { 9853 return iter.page.Response() 9854} 9855 9856// Value returns the current value or a zero-initialized value if the 9857// iterator has advanced beyond the end of the collection. 9858func (iter VirtualMachineScaleSetListSkusResultIterator) Value() VirtualMachineScaleSetSku { 9859 if !iter.page.NotDone() { 9860 return VirtualMachineScaleSetSku{} 9861 } 9862 return iter.page.Values()[iter.i] 9863} 9864 9865// Creates a new instance of the VirtualMachineScaleSetListSkusResultIterator type. 9866func NewVirtualMachineScaleSetListSkusResultIterator(page VirtualMachineScaleSetListSkusResultPage) VirtualMachineScaleSetListSkusResultIterator { 9867 return VirtualMachineScaleSetListSkusResultIterator{page: page} 9868} 9869 9870// IsEmpty returns true if the ListResult contains no values. 9871func (vmsslsr VirtualMachineScaleSetListSkusResult) IsEmpty() bool { 9872 return vmsslsr.Value == nil || len(*vmsslsr.Value) == 0 9873} 9874 9875// hasNextLink returns true if the NextLink is not empty. 9876func (vmsslsr VirtualMachineScaleSetListSkusResult) hasNextLink() bool { 9877 return vmsslsr.NextLink != nil && len(*vmsslsr.NextLink) != 0 9878} 9879 9880// virtualMachineScaleSetListSkusResultPreparer prepares a request to retrieve the next set of results. 9881// It returns nil if no more results exist. 9882func (vmsslsr VirtualMachineScaleSetListSkusResult) virtualMachineScaleSetListSkusResultPreparer(ctx context.Context) (*http.Request, error) { 9883 if !vmsslsr.hasNextLink() { 9884 return nil, nil 9885 } 9886 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9887 autorest.AsJSON(), 9888 autorest.AsGet(), 9889 autorest.WithBaseURL(to.String(vmsslsr.NextLink))) 9890} 9891 9892// VirtualMachineScaleSetListSkusResultPage contains a page of VirtualMachineScaleSetSku values. 9893type VirtualMachineScaleSetListSkusResultPage struct { 9894 fn func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error) 9895 vmsslsr VirtualMachineScaleSetListSkusResult 9896} 9897 9898// NextWithContext advances to the next page of values. If there was an error making 9899// the request the page does not advance and the error is returned. 9900func (page *VirtualMachineScaleSetListSkusResultPage) NextWithContext(ctx context.Context) (err error) { 9901 if tracing.IsEnabled() { 9902 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListSkusResultPage.NextWithContext") 9903 defer func() { 9904 sc := -1 9905 if page.Response().Response.Response != nil { 9906 sc = page.Response().Response.Response.StatusCode 9907 } 9908 tracing.EndSpan(ctx, sc, err) 9909 }() 9910 } 9911 for { 9912 next, err := page.fn(ctx, page.vmsslsr) 9913 if err != nil { 9914 return err 9915 } 9916 page.vmsslsr = next 9917 if !next.hasNextLink() || !next.IsEmpty() { 9918 break 9919 } 9920 } 9921 return nil 9922} 9923 9924// Next advances to the next page of values. If there was an error making 9925// the request the page does not advance and the error is returned. 9926// Deprecated: Use NextWithContext() instead. 9927func (page *VirtualMachineScaleSetListSkusResultPage) Next() error { 9928 return page.NextWithContext(context.Background()) 9929} 9930 9931// NotDone returns true if the page enumeration should be started or is not yet complete. 9932func (page VirtualMachineScaleSetListSkusResultPage) NotDone() bool { 9933 return !page.vmsslsr.IsEmpty() 9934} 9935 9936// Response returns the raw server response from the last page request. 9937func (page VirtualMachineScaleSetListSkusResultPage) Response() VirtualMachineScaleSetListSkusResult { 9938 return page.vmsslsr 9939} 9940 9941// Values returns the slice of values for the current page or nil if there are no values. 9942func (page VirtualMachineScaleSetListSkusResultPage) Values() []VirtualMachineScaleSetSku { 9943 if page.vmsslsr.IsEmpty() { 9944 return nil 9945 } 9946 return *page.vmsslsr.Value 9947} 9948 9949// Creates a new instance of the VirtualMachineScaleSetListSkusResultPage type. 9950func NewVirtualMachineScaleSetListSkusResultPage(cur VirtualMachineScaleSetListSkusResult, getNextPage func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error)) VirtualMachineScaleSetListSkusResultPage { 9951 return VirtualMachineScaleSetListSkusResultPage{ 9952 fn: getNextPage, 9953 vmsslsr: cur, 9954 } 9955} 9956 9957// VirtualMachineScaleSetListWithLinkResult the List Virtual Machine operation response. 9958type VirtualMachineScaleSetListWithLinkResult struct { 9959 autorest.Response `json:"-"` 9960 // Value - The list of virtual machine scale sets. 9961 Value *[]VirtualMachineScaleSet `json:"value,omitempty"` 9962 // 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. 9963 NextLink *string `json:"nextLink,omitempty"` 9964} 9965 9966// VirtualMachineScaleSetListWithLinkResultIterator provides access to a complete listing of 9967// VirtualMachineScaleSet values. 9968type VirtualMachineScaleSetListWithLinkResultIterator struct { 9969 i int 9970 page VirtualMachineScaleSetListWithLinkResultPage 9971} 9972 9973// NextWithContext advances to the next value. If there was an error making 9974// the request the iterator does not advance and the error is returned. 9975func (iter *VirtualMachineScaleSetListWithLinkResultIterator) NextWithContext(ctx context.Context) (err error) { 9976 if tracing.IsEnabled() { 9977 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListWithLinkResultIterator.NextWithContext") 9978 defer func() { 9979 sc := -1 9980 if iter.Response().Response.Response != nil { 9981 sc = iter.Response().Response.Response.StatusCode 9982 } 9983 tracing.EndSpan(ctx, sc, err) 9984 }() 9985 } 9986 iter.i++ 9987 if iter.i < len(iter.page.Values()) { 9988 return nil 9989 } 9990 err = iter.page.NextWithContext(ctx) 9991 if err != nil { 9992 iter.i-- 9993 return err 9994 } 9995 iter.i = 0 9996 return nil 9997} 9998 9999// Next advances to the next value. If there was an error making 10000// the request the iterator does not advance and the error is returned. 10001// Deprecated: Use NextWithContext() instead. 10002func (iter *VirtualMachineScaleSetListWithLinkResultIterator) Next() error { 10003 return iter.NextWithContext(context.Background()) 10004} 10005 10006// NotDone returns true if the enumeration should be started or is not yet complete. 10007func (iter VirtualMachineScaleSetListWithLinkResultIterator) NotDone() bool { 10008 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10009} 10010 10011// Response returns the raw server response from the last page request. 10012func (iter VirtualMachineScaleSetListWithLinkResultIterator) Response() VirtualMachineScaleSetListWithLinkResult { 10013 return iter.page.Response() 10014} 10015 10016// Value returns the current value or a zero-initialized value if the 10017// iterator has advanced beyond the end of the collection. 10018func (iter VirtualMachineScaleSetListWithLinkResultIterator) Value() VirtualMachineScaleSet { 10019 if !iter.page.NotDone() { 10020 return VirtualMachineScaleSet{} 10021 } 10022 return iter.page.Values()[iter.i] 10023} 10024 10025// Creates a new instance of the VirtualMachineScaleSetListWithLinkResultIterator type. 10026func NewVirtualMachineScaleSetListWithLinkResultIterator(page VirtualMachineScaleSetListWithLinkResultPage) VirtualMachineScaleSetListWithLinkResultIterator { 10027 return VirtualMachineScaleSetListWithLinkResultIterator{page: page} 10028} 10029 10030// IsEmpty returns true if the ListResult contains no values. 10031func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) IsEmpty() bool { 10032 return vmsslwlr.Value == nil || len(*vmsslwlr.Value) == 0 10033} 10034 10035// hasNextLink returns true if the NextLink is not empty. 10036func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) hasNextLink() bool { 10037 return vmsslwlr.NextLink != nil && len(*vmsslwlr.NextLink) != 0 10038} 10039 10040// virtualMachineScaleSetListWithLinkResultPreparer prepares a request to retrieve the next set of results. 10041// It returns nil if no more results exist. 10042func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) virtualMachineScaleSetListWithLinkResultPreparer(ctx context.Context) (*http.Request, error) { 10043 if !vmsslwlr.hasNextLink() { 10044 return nil, nil 10045 } 10046 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10047 autorest.AsJSON(), 10048 autorest.AsGet(), 10049 autorest.WithBaseURL(to.String(vmsslwlr.NextLink))) 10050} 10051 10052// VirtualMachineScaleSetListWithLinkResultPage contains a page of VirtualMachineScaleSet values. 10053type VirtualMachineScaleSetListWithLinkResultPage struct { 10054 fn func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error) 10055 vmsslwlr VirtualMachineScaleSetListWithLinkResult 10056} 10057 10058// NextWithContext advances to the next page of values. If there was an error making 10059// the request the page does not advance and the error is returned. 10060func (page *VirtualMachineScaleSetListWithLinkResultPage) NextWithContext(ctx context.Context) (err error) { 10061 if tracing.IsEnabled() { 10062 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListWithLinkResultPage.NextWithContext") 10063 defer func() { 10064 sc := -1 10065 if page.Response().Response.Response != nil { 10066 sc = page.Response().Response.Response.StatusCode 10067 } 10068 tracing.EndSpan(ctx, sc, err) 10069 }() 10070 } 10071 for { 10072 next, err := page.fn(ctx, page.vmsslwlr) 10073 if err != nil { 10074 return err 10075 } 10076 page.vmsslwlr = next 10077 if !next.hasNextLink() || !next.IsEmpty() { 10078 break 10079 } 10080 } 10081 return nil 10082} 10083 10084// Next advances to the next page of values. If there was an error making 10085// the request the page does not advance and the error is returned. 10086// Deprecated: Use NextWithContext() instead. 10087func (page *VirtualMachineScaleSetListWithLinkResultPage) Next() error { 10088 return page.NextWithContext(context.Background()) 10089} 10090 10091// NotDone returns true if the page enumeration should be started or is not yet complete. 10092func (page VirtualMachineScaleSetListWithLinkResultPage) NotDone() bool { 10093 return !page.vmsslwlr.IsEmpty() 10094} 10095 10096// Response returns the raw server response from the last page request. 10097func (page VirtualMachineScaleSetListWithLinkResultPage) Response() VirtualMachineScaleSetListWithLinkResult { 10098 return page.vmsslwlr 10099} 10100 10101// Values returns the slice of values for the current page or nil if there are no values. 10102func (page VirtualMachineScaleSetListWithLinkResultPage) Values() []VirtualMachineScaleSet { 10103 if page.vmsslwlr.IsEmpty() { 10104 return nil 10105 } 10106 return *page.vmsslwlr.Value 10107} 10108 10109// Creates a new instance of the VirtualMachineScaleSetListWithLinkResultPage type. 10110func NewVirtualMachineScaleSetListWithLinkResultPage(cur VirtualMachineScaleSetListWithLinkResult, getNextPage func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error)) VirtualMachineScaleSetListWithLinkResultPage { 10111 return VirtualMachineScaleSetListWithLinkResultPage{ 10112 fn: getNextPage, 10113 vmsslwlr: cur, 10114 } 10115} 10116 10117// VirtualMachineScaleSetManagedDiskParameters describes the parameters of a ScaleSet managed disk. 10118type VirtualMachineScaleSetManagedDiskParameters struct { 10119 // 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' 10120 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 10121 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed disk. 10122 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 10123} 10124 10125// VirtualMachineScaleSetNetworkConfiguration describes a virtual machine scale set network profile's 10126// network configurations. 10127type VirtualMachineScaleSetNetworkConfiguration struct { 10128 // Name - The network configuration name. 10129 Name *string `json:"name,omitempty"` 10130 *VirtualMachineScaleSetNetworkConfigurationProperties `json:"properties,omitempty"` 10131 // ID - Resource Id 10132 ID *string `json:"id,omitempty"` 10133} 10134 10135// MarshalJSON is the custom marshaler for VirtualMachineScaleSetNetworkConfiguration. 10136func (vmssnc VirtualMachineScaleSetNetworkConfiguration) MarshalJSON() ([]byte, error) { 10137 objectMap := make(map[string]interface{}) 10138 if vmssnc.Name != nil { 10139 objectMap["name"] = vmssnc.Name 10140 } 10141 if vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties != nil { 10142 objectMap["properties"] = vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties 10143 } 10144 if vmssnc.ID != nil { 10145 objectMap["id"] = vmssnc.ID 10146 } 10147 return json.Marshal(objectMap) 10148} 10149 10150// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetNetworkConfiguration struct. 10151func (vmssnc *VirtualMachineScaleSetNetworkConfiguration) UnmarshalJSON(body []byte) error { 10152 var m map[string]*json.RawMessage 10153 err := json.Unmarshal(body, &m) 10154 if err != nil { 10155 return err 10156 } 10157 for k, v := range m { 10158 switch k { 10159 case "name": 10160 if v != nil { 10161 var name string 10162 err = json.Unmarshal(*v, &name) 10163 if err != nil { 10164 return err 10165 } 10166 vmssnc.Name = &name 10167 } 10168 case "properties": 10169 if v != nil { 10170 var virtualMachineScaleSetNetworkConfigurationProperties VirtualMachineScaleSetNetworkConfigurationProperties 10171 err = json.Unmarshal(*v, &virtualMachineScaleSetNetworkConfigurationProperties) 10172 if err != nil { 10173 return err 10174 } 10175 vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties = &virtualMachineScaleSetNetworkConfigurationProperties 10176 } 10177 case "id": 10178 if v != nil { 10179 var ID string 10180 err = json.Unmarshal(*v, &ID) 10181 if err != nil { 10182 return err 10183 } 10184 vmssnc.ID = &ID 10185 } 10186 } 10187 } 10188 10189 return nil 10190} 10191 10192// VirtualMachineScaleSetNetworkConfigurationDNSSettings describes a virtual machines scale sets network 10193// configuration's DNS settings. 10194type VirtualMachineScaleSetNetworkConfigurationDNSSettings struct { 10195 // DNSServers - List of DNS servers IP addresses 10196 DNSServers *[]string `json:"dnsServers,omitempty"` 10197} 10198 10199// VirtualMachineScaleSetNetworkConfigurationProperties describes a virtual machine scale set network 10200// profile's IP configuration. 10201type VirtualMachineScaleSetNetworkConfigurationProperties struct { 10202 // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. 10203 Primary *bool `json:"primary,omitempty"` 10204 // EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled. 10205 EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` 10206 // NetworkSecurityGroup - The network security group. 10207 NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` 10208 // DNSSettings - The dns settings to be applied on the network interfaces. 10209 DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings `json:"dnsSettings,omitempty"` 10210 // IPConfigurations - Specifies the IP configurations of the network interface. 10211 IPConfigurations *[]VirtualMachineScaleSetIPConfiguration `json:"ipConfigurations,omitempty"` 10212 // EnableIPForwarding - Whether IP forwarding enabled on this NIC. 10213 EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` 10214} 10215 10216// VirtualMachineScaleSetNetworkProfile describes a virtual machine scale set network profile. 10217type VirtualMachineScaleSetNetworkProfile struct { 10218 // 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}'. 10219 HealthProbe *APIEntityReference `json:"healthProbe,omitempty"` 10220 // NetworkInterfaceConfigurations - The list of network configurations. 10221 NetworkInterfaceConfigurations *[]VirtualMachineScaleSetNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` 10222} 10223 10224// VirtualMachineScaleSetOSDisk describes a virtual machine scale set operating system disk. 10225type VirtualMachineScaleSetOSDisk struct { 10226 // Name - The disk name. 10227 Name *string `json:"name,omitempty"` 10228 // 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' 10229 Caching CachingTypes `json:"caching,omitempty"` 10230 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 10231 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 10232 // 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' 10233 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 10234 // DiffDiskSettings - Specifies the ephemeral disk Settings for the operating system disk used by the virtual machine scale set. 10235 DiffDiskSettings *DiffDiskSettings `json:"diffDiskSettings,omitempty"` 10236 // 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 10237 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 10238 // 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' 10239 OsType OperatingSystemTypes `json:"osType,omitempty"` 10240 // Image - Specifies information about the unmanaged user image to base the scale set on. 10241 Image *VirtualHardDisk `json:"image,omitempty"` 10242 // VhdContainers - Specifies the container urls that are used to store operating system disks for the scale set. 10243 VhdContainers *[]string `json:"vhdContainers,omitempty"` 10244 // ManagedDisk - The managed disk parameters. 10245 ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` 10246} 10247 10248// VirtualMachineScaleSetOSProfile describes a virtual machine scale set OS profile. 10249type VirtualMachineScaleSetOSProfile struct { 10250 // 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. 10251 ComputerNamePrefix *string `json:"computerNamePrefix,omitempty"` 10252 // 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) 10253 AdminUsername *string `json:"adminUsername,omitempty"` 10254 // 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) 10255 AdminPassword *string `json:"adminPassword,omitempty"` 10256 // 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) 10257 CustomData *string `json:"customData,omitempty"` 10258 // WindowsConfiguration - Specifies Windows operating system settings on the virtual machine. 10259 WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` 10260 // 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). 10261 LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` 10262 // Secrets - Specifies set of certificates that should be installed onto the virtual machines in the scale set. 10263 Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` 10264} 10265 10266// VirtualMachineScaleSetProperties describes the properties of a Virtual Machine Scale Set. 10267type VirtualMachineScaleSetProperties struct { 10268 // UpgradePolicy - The upgrade policy. 10269 UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` 10270 // AutomaticRepairsPolicy - Policy for automatic repairs. 10271 AutomaticRepairsPolicy *AutomaticRepairsPolicy `json:"automaticRepairsPolicy,omitempty"` 10272 // VirtualMachineProfile - The virtual machine profile. 10273 VirtualMachineProfile *VirtualMachineScaleSetVMProfile `json:"virtualMachineProfile,omitempty"` 10274 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 10275 ProvisioningState *string `json:"provisioningState,omitempty"` 10276 // Overprovision - Specifies whether the Virtual Machine Scale Set should be overprovisioned. 10277 Overprovision *bool `json:"overprovision,omitempty"` 10278 // 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. 10279 DoNotRunExtensionsOnOverprovisionedVMs *bool `json:"doNotRunExtensionsOnOverprovisionedVMs,omitempty"` 10280 // UniqueID - READ-ONLY; Specifies the ID which uniquely identifies a Virtual Machine Scale Set. 10281 UniqueID *string `json:"uniqueId,omitempty"` 10282 // SinglePlacementGroup - When true this limits the scale set to a single placement group, of max size 100 virtual machines. 10283 SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"` 10284 // ZoneBalance - Whether to force strictly even Virtual Machine distribution cross x-zones in case there is zone outage. 10285 ZoneBalance *bool `json:"zoneBalance,omitempty"` 10286 // PlatformFaultDomainCount - Fault Domain count for each placement group. 10287 PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` 10288 // 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. 10289 ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` 10290 // 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. 10291 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 10292 // ScaleInPolicy - Specifies the scale-in policy that decides which virtual machines are chosen for removal when a Virtual Machine Scale Set is scaled-in. 10293 ScaleInPolicy *ScaleInPolicy `json:"scaleInPolicy,omitempty"` 10294} 10295 10296// MarshalJSON is the custom marshaler for VirtualMachineScaleSetProperties. 10297func (vmssp VirtualMachineScaleSetProperties) MarshalJSON() ([]byte, error) { 10298 objectMap := make(map[string]interface{}) 10299 if vmssp.UpgradePolicy != nil { 10300 objectMap["upgradePolicy"] = vmssp.UpgradePolicy 10301 } 10302 if vmssp.AutomaticRepairsPolicy != nil { 10303 objectMap["automaticRepairsPolicy"] = vmssp.AutomaticRepairsPolicy 10304 } 10305 if vmssp.VirtualMachineProfile != nil { 10306 objectMap["virtualMachineProfile"] = vmssp.VirtualMachineProfile 10307 } 10308 if vmssp.Overprovision != nil { 10309 objectMap["overprovision"] = vmssp.Overprovision 10310 } 10311 if vmssp.DoNotRunExtensionsOnOverprovisionedVMs != nil { 10312 objectMap["doNotRunExtensionsOnOverprovisionedVMs"] = vmssp.DoNotRunExtensionsOnOverprovisionedVMs 10313 } 10314 if vmssp.SinglePlacementGroup != nil { 10315 objectMap["singlePlacementGroup"] = vmssp.SinglePlacementGroup 10316 } 10317 if vmssp.ZoneBalance != nil { 10318 objectMap["zoneBalance"] = vmssp.ZoneBalance 10319 } 10320 if vmssp.PlatformFaultDomainCount != nil { 10321 objectMap["platformFaultDomainCount"] = vmssp.PlatformFaultDomainCount 10322 } 10323 if vmssp.ProximityPlacementGroup != nil { 10324 objectMap["proximityPlacementGroup"] = vmssp.ProximityPlacementGroup 10325 } 10326 if vmssp.AdditionalCapabilities != nil { 10327 objectMap["additionalCapabilities"] = vmssp.AdditionalCapabilities 10328 } 10329 if vmssp.ScaleInPolicy != nil { 10330 objectMap["scaleInPolicy"] = vmssp.ScaleInPolicy 10331 } 10332 return json.Marshal(objectMap) 10333} 10334 10335// VirtualMachineScaleSetPublicIPAddressConfiguration describes a virtual machines scale set IP 10336// Configuration's PublicIPAddress configuration 10337type VirtualMachineScaleSetPublicIPAddressConfiguration struct { 10338 // Name - The publicIP address configuration name. 10339 Name *string `json:"name,omitempty"` 10340 *VirtualMachineScaleSetPublicIPAddressConfigurationProperties `json:"properties,omitempty"` 10341} 10342 10343// MarshalJSON is the custom marshaler for VirtualMachineScaleSetPublicIPAddressConfiguration. 10344func (vmsspiac VirtualMachineScaleSetPublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { 10345 objectMap := make(map[string]interface{}) 10346 if vmsspiac.Name != nil { 10347 objectMap["name"] = vmsspiac.Name 10348 } 10349 if vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties != nil { 10350 objectMap["properties"] = vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties 10351 } 10352 return json.Marshal(objectMap) 10353} 10354 10355// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetPublicIPAddressConfiguration struct. 10356func (vmsspiac *VirtualMachineScaleSetPublicIPAddressConfiguration) UnmarshalJSON(body []byte) error { 10357 var m map[string]*json.RawMessage 10358 err := json.Unmarshal(body, &m) 10359 if err != nil { 10360 return err 10361 } 10362 for k, v := range m { 10363 switch k { 10364 case "name": 10365 if v != nil { 10366 var name string 10367 err = json.Unmarshal(*v, &name) 10368 if err != nil { 10369 return err 10370 } 10371 vmsspiac.Name = &name 10372 } 10373 case "properties": 10374 if v != nil { 10375 var virtualMachineScaleSetPublicIPAddressConfigurationProperties VirtualMachineScaleSetPublicIPAddressConfigurationProperties 10376 err = json.Unmarshal(*v, &virtualMachineScaleSetPublicIPAddressConfigurationProperties) 10377 if err != nil { 10378 return err 10379 } 10380 vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties = &virtualMachineScaleSetPublicIPAddressConfigurationProperties 10381 } 10382 } 10383 } 10384 10385 return nil 10386} 10387 10388// VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings describes a virtual machines scale sets 10389// network configuration's DNS settings. 10390type VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings struct { 10391 // 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 10392 DomainNameLabel *string `json:"domainNameLabel,omitempty"` 10393} 10394 10395// VirtualMachineScaleSetPublicIPAddressConfigurationProperties describes a virtual machines scale set IP 10396// Configuration's PublicIPAddress configuration 10397type VirtualMachineScaleSetPublicIPAddressConfigurationProperties struct { 10398 // IdleTimeoutInMinutes - The idle timeout of the public IP address. 10399 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` 10400 // DNSSettings - The dns settings to be applied on the publicIP addresses . 10401 DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings `json:"dnsSettings,omitempty"` 10402 // IPTags - The list of IP tags associated with the public IP address. 10403 IPTags *[]VirtualMachineScaleSetIPTag `json:"ipTags,omitempty"` 10404 // PublicIPPrefix - The PublicIPPrefix from which to allocate publicIP addresses. 10405 PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` 10406 // 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' 10407 PublicIPAddressVersion IPVersion `json:"publicIPAddressVersion,omitempty"` 10408} 10409 10410// VirtualMachineScaleSetReimageParameters describes a Virtual Machine Scale Set VM Reimage Parameters. 10411type VirtualMachineScaleSetReimageParameters struct { 10412 // 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. 10413 InstanceIds *[]string `json:"instanceIds,omitempty"` 10414 // 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. 10415 TempDisk *bool `json:"tempDisk,omitempty"` 10416} 10417 10418// VirtualMachineScaleSetRollingUpgradesCancelFuture an abstraction for monitoring and retrieving the 10419// results of a long-running operation. 10420type VirtualMachineScaleSetRollingUpgradesCancelFuture struct { 10421 azure.FutureAPI 10422 // Result returns the result of the asynchronous operation. 10423 // If the operation has not completed it will return an error. 10424 Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) 10425} 10426 10427// VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture an abstraction for monitoring and 10428// retrieving the results of a long-running operation. 10429type VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture struct { 10430 azure.FutureAPI 10431 // Result returns the result of the asynchronous operation. 10432 // If the operation has not completed it will return an error. 10433 Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) 10434} 10435 10436// VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture an abstraction for monitoring and retrieving 10437// the results of a long-running operation. 10438type VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture struct { 10439 azure.FutureAPI 10440 // Result returns the result of the asynchronous operation. 10441 // If the operation has not completed it will return an error. 10442 Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) 10443} 10444 10445// VirtualMachineScaleSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of 10446// a long-running operation. 10447type VirtualMachineScaleSetsCreateOrUpdateFuture struct { 10448 azure.FutureAPI 10449 // Result returns the result of the asynchronous operation. 10450 // If the operation has not completed it will return an error. 10451 Result func(VirtualMachineScaleSetsClient) (VirtualMachineScaleSet, error) 10452} 10453 10454// VirtualMachineScaleSetsDeallocateFuture an abstraction for monitoring and retrieving the results of a 10455// long-running operation. 10456type VirtualMachineScaleSetsDeallocateFuture struct { 10457 azure.FutureAPI 10458 // Result returns the result of the asynchronous operation. 10459 // If the operation has not completed it will return an error. 10460 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 10461} 10462 10463// VirtualMachineScaleSetsDeleteFuture an abstraction for monitoring and retrieving the results of a 10464// long-running operation. 10465type VirtualMachineScaleSetsDeleteFuture struct { 10466 azure.FutureAPI 10467 // Result returns the result of the asynchronous operation. 10468 // If the operation has not completed it will return an error. 10469 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 10470} 10471 10472// VirtualMachineScaleSetsDeleteInstancesFuture an abstraction for monitoring and retrieving the results of 10473// a long-running operation. 10474type VirtualMachineScaleSetsDeleteInstancesFuture struct { 10475 azure.FutureAPI 10476 // Result returns the result of the asynchronous operation. 10477 // If the operation has not completed it will return an error. 10478 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 10479} 10480 10481// VirtualMachineScaleSetSku describes an available virtual machine scale set sku. 10482type VirtualMachineScaleSetSku struct { 10483 // ResourceType - READ-ONLY; The type of resource the sku applies to. 10484 ResourceType *string `json:"resourceType,omitempty"` 10485 // Sku - READ-ONLY; The Sku. 10486 Sku *Sku `json:"sku,omitempty"` 10487 // Capacity - READ-ONLY; Specifies the number of virtual machines in the scale set. 10488 Capacity *VirtualMachineScaleSetSkuCapacity `json:"capacity,omitempty"` 10489} 10490 10491// VirtualMachineScaleSetSkuCapacity describes scaling information of a sku. 10492type VirtualMachineScaleSetSkuCapacity struct { 10493 // Minimum - READ-ONLY; The minimum capacity. 10494 Minimum *int64 `json:"minimum,omitempty"` 10495 // Maximum - READ-ONLY; The maximum capacity that can be set. 10496 Maximum *int64 `json:"maximum,omitempty"` 10497 // DefaultCapacity - READ-ONLY; The default capacity. 10498 DefaultCapacity *int64 `json:"defaultCapacity,omitempty"` 10499 // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'VirtualMachineScaleSetSkuScaleTypeAutomatic', 'VirtualMachineScaleSetSkuScaleTypeNone' 10500 ScaleType VirtualMachineScaleSetSkuScaleType `json:"scaleType,omitempty"` 10501} 10502 10503// VirtualMachineScaleSetsPerformMaintenanceFuture an abstraction for monitoring and retrieving the results 10504// of a long-running operation. 10505type VirtualMachineScaleSetsPerformMaintenanceFuture struct { 10506 azure.FutureAPI 10507 // Result returns the result of the asynchronous operation. 10508 // If the operation has not completed it will return an error. 10509 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 10510} 10511 10512// VirtualMachineScaleSetsPowerOffFuture an abstraction for monitoring and retrieving the results of a 10513// long-running operation. 10514type VirtualMachineScaleSetsPowerOffFuture struct { 10515 azure.FutureAPI 10516 // Result returns the result of the asynchronous operation. 10517 // If the operation has not completed it will return an error. 10518 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 10519} 10520 10521// VirtualMachineScaleSetsRedeployFuture an abstraction for monitoring and retrieving the results of a 10522// long-running operation. 10523type VirtualMachineScaleSetsRedeployFuture struct { 10524 azure.FutureAPI 10525 // Result returns the result of the asynchronous operation. 10526 // If the operation has not completed it will return an error. 10527 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 10528} 10529 10530// VirtualMachineScaleSetsReimageAllFuture an abstraction for monitoring and retrieving the results of a 10531// long-running operation. 10532type VirtualMachineScaleSetsReimageAllFuture struct { 10533 azure.FutureAPI 10534 // Result returns the result of the asynchronous operation. 10535 // If the operation has not completed it will return an error. 10536 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 10537} 10538 10539// VirtualMachineScaleSetsReimageFuture an abstraction for monitoring and retrieving the results of a 10540// long-running operation. 10541type VirtualMachineScaleSetsReimageFuture struct { 10542 azure.FutureAPI 10543 // Result returns the result of the asynchronous operation. 10544 // If the operation has not completed it will return an error. 10545 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 10546} 10547 10548// VirtualMachineScaleSetsRestartFuture an abstraction for monitoring and retrieving the results of a 10549// long-running operation. 10550type VirtualMachineScaleSetsRestartFuture struct { 10551 azure.FutureAPI 10552 // Result returns the result of the asynchronous operation. 10553 // If the operation has not completed it will return an error. 10554 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 10555} 10556 10557// VirtualMachineScaleSetsStartFuture an abstraction for monitoring and retrieving the results of a 10558// long-running operation. 10559type VirtualMachineScaleSetsStartFuture struct { 10560 azure.FutureAPI 10561 // Result returns the result of the asynchronous operation. 10562 // If the operation has not completed it will return an error. 10563 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 10564} 10565 10566// VirtualMachineScaleSetStorageProfile describes a virtual machine scale set storage profile. 10567type VirtualMachineScaleSetStorageProfile struct { 10568 // 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. 10569 ImageReference *ImageReference `json:"imageReference,omitempty"` 10570 // 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). 10571 OsDisk *VirtualMachineScaleSetOSDisk `json:"osDisk,omitempty"` 10572 // 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). 10573 DataDisks *[]VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"` 10574} 10575 10576// VirtualMachineScaleSetsUpdateFuture an abstraction for monitoring and retrieving the results of a 10577// long-running operation. 10578type VirtualMachineScaleSetsUpdateFuture struct { 10579 azure.FutureAPI 10580 // Result returns the result of the asynchronous operation. 10581 // If the operation has not completed it will return an error. 10582 Result func(VirtualMachineScaleSetsClient) (VirtualMachineScaleSet, error) 10583} 10584 10585// VirtualMachineScaleSetsUpdateInstancesFuture an abstraction for monitoring and retrieving the results of 10586// a long-running operation. 10587type VirtualMachineScaleSetsUpdateInstancesFuture struct { 10588 azure.FutureAPI 10589 // Result returns the result of the asynchronous operation. 10590 // If the operation has not completed it will return an error. 10591 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 10592} 10593 10594// VirtualMachineScaleSetUpdate describes a Virtual Machine Scale Set. 10595type VirtualMachineScaleSetUpdate struct { 10596 // Sku - The virtual machine scale set sku. 10597 Sku *Sku `json:"sku,omitempty"` 10598 // Plan - The purchase plan when deploying a virtual machine scale set from VM Marketplace images. 10599 Plan *Plan `json:"plan,omitempty"` 10600 *VirtualMachineScaleSetUpdateProperties `json:"properties,omitempty"` 10601 // Identity - The identity of the virtual machine scale set, if configured. 10602 Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"` 10603 // Tags - Resource tags 10604 Tags map[string]*string `json:"tags"` 10605} 10606 10607// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdate. 10608func (vmssu VirtualMachineScaleSetUpdate) MarshalJSON() ([]byte, error) { 10609 objectMap := make(map[string]interface{}) 10610 if vmssu.Sku != nil { 10611 objectMap["sku"] = vmssu.Sku 10612 } 10613 if vmssu.Plan != nil { 10614 objectMap["plan"] = vmssu.Plan 10615 } 10616 if vmssu.VirtualMachineScaleSetUpdateProperties != nil { 10617 objectMap["properties"] = vmssu.VirtualMachineScaleSetUpdateProperties 10618 } 10619 if vmssu.Identity != nil { 10620 objectMap["identity"] = vmssu.Identity 10621 } 10622 if vmssu.Tags != nil { 10623 objectMap["tags"] = vmssu.Tags 10624 } 10625 return json.Marshal(objectMap) 10626} 10627 10628// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdate struct. 10629func (vmssu *VirtualMachineScaleSetUpdate) UnmarshalJSON(body []byte) error { 10630 var m map[string]*json.RawMessage 10631 err := json.Unmarshal(body, &m) 10632 if err != nil { 10633 return err 10634 } 10635 for k, v := range m { 10636 switch k { 10637 case "sku": 10638 if v != nil { 10639 var sku Sku 10640 err = json.Unmarshal(*v, &sku) 10641 if err != nil { 10642 return err 10643 } 10644 vmssu.Sku = &sku 10645 } 10646 case "plan": 10647 if v != nil { 10648 var plan Plan 10649 err = json.Unmarshal(*v, &plan) 10650 if err != nil { 10651 return err 10652 } 10653 vmssu.Plan = &plan 10654 } 10655 case "properties": 10656 if v != nil { 10657 var virtualMachineScaleSetUpdateProperties VirtualMachineScaleSetUpdateProperties 10658 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateProperties) 10659 if err != nil { 10660 return err 10661 } 10662 vmssu.VirtualMachineScaleSetUpdateProperties = &virtualMachineScaleSetUpdateProperties 10663 } 10664 case "identity": 10665 if v != nil { 10666 var identity VirtualMachineScaleSetIdentity 10667 err = json.Unmarshal(*v, &identity) 10668 if err != nil { 10669 return err 10670 } 10671 vmssu.Identity = &identity 10672 } 10673 case "tags": 10674 if v != nil { 10675 var tags map[string]*string 10676 err = json.Unmarshal(*v, &tags) 10677 if err != nil { 10678 return err 10679 } 10680 vmssu.Tags = tags 10681 } 10682 } 10683 } 10684 10685 return nil 10686} 10687 10688// VirtualMachineScaleSetUpdateIPConfiguration describes a virtual machine scale set network profile's IP 10689// configuration. 10690type VirtualMachineScaleSetUpdateIPConfiguration struct { 10691 // Name - The IP configuration name. 10692 Name *string `json:"name,omitempty"` 10693 *VirtualMachineScaleSetUpdateIPConfigurationProperties `json:"properties,omitempty"` 10694 // ID - Resource Id 10695 ID *string `json:"id,omitempty"` 10696} 10697 10698// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdateIPConfiguration. 10699func (vmssuic VirtualMachineScaleSetUpdateIPConfiguration) MarshalJSON() ([]byte, error) { 10700 objectMap := make(map[string]interface{}) 10701 if vmssuic.Name != nil { 10702 objectMap["name"] = vmssuic.Name 10703 } 10704 if vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties != nil { 10705 objectMap["properties"] = vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties 10706 } 10707 if vmssuic.ID != nil { 10708 objectMap["id"] = vmssuic.ID 10709 } 10710 return json.Marshal(objectMap) 10711} 10712 10713// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdateIPConfiguration struct. 10714func (vmssuic *VirtualMachineScaleSetUpdateIPConfiguration) UnmarshalJSON(body []byte) error { 10715 var m map[string]*json.RawMessage 10716 err := json.Unmarshal(body, &m) 10717 if err != nil { 10718 return err 10719 } 10720 for k, v := range m { 10721 switch k { 10722 case "name": 10723 if v != nil { 10724 var name string 10725 err = json.Unmarshal(*v, &name) 10726 if err != nil { 10727 return err 10728 } 10729 vmssuic.Name = &name 10730 } 10731 case "properties": 10732 if v != nil { 10733 var virtualMachineScaleSetUpdateIPConfigurationProperties VirtualMachineScaleSetUpdateIPConfigurationProperties 10734 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateIPConfigurationProperties) 10735 if err != nil { 10736 return err 10737 } 10738 vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties = &virtualMachineScaleSetUpdateIPConfigurationProperties 10739 } 10740 case "id": 10741 if v != nil { 10742 var ID string 10743 err = json.Unmarshal(*v, &ID) 10744 if err != nil { 10745 return err 10746 } 10747 vmssuic.ID = &ID 10748 } 10749 } 10750 } 10751 10752 return nil 10753} 10754 10755// VirtualMachineScaleSetUpdateIPConfigurationProperties describes a virtual machine scale set network 10756// profile's IP configuration properties. NOTE: The subnet of a scale set may be modified as long as the 10757// original subnet and the new subnet are in the same virtual network. 10758type VirtualMachineScaleSetUpdateIPConfigurationProperties struct { 10759 // Subnet - The subnet. 10760 Subnet *APIEntityReference `json:"subnet,omitempty"` 10761 // Primary - Specifies the primary IP Configuration in case the network interface has more than one IP Configuration. 10762 Primary *bool `json:"primary,omitempty"` 10763 // PublicIPAddressConfiguration - The publicIPAddressConfiguration. 10764 PublicIPAddressConfiguration *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` 10765 // 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' 10766 PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` 10767 // ApplicationGatewayBackendAddressPools - The application gateway backend address pools. 10768 ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` 10769 // ApplicationSecurityGroups - Specifies an array of references to application security group. 10770 ApplicationSecurityGroups *[]SubResource `json:"applicationSecurityGroups,omitempty"` 10771 // LoadBalancerBackendAddressPools - The load balancer backend address pools. 10772 LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` 10773 // LoadBalancerInboundNatPools - The load balancer inbound nat pools. 10774 LoadBalancerInboundNatPools *[]SubResource `json:"loadBalancerInboundNatPools,omitempty"` 10775} 10776 10777// VirtualMachineScaleSetUpdateNetworkConfiguration describes a virtual machine scale set network profile's 10778// network configurations. 10779type VirtualMachineScaleSetUpdateNetworkConfiguration struct { 10780 // Name - The network configuration name. 10781 Name *string `json:"name,omitempty"` 10782 *VirtualMachineScaleSetUpdateNetworkConfigurationProperties `json:"properties,omitempty"` 10783 // ID - Resource Id 10784 ID *string `json:"id,omitempty"` 10785} 10786 10787// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdateNetworkConfiguration. 10788func (vmssunc VirtualMachineScaleSetUpdateNetworkConfiguration) MarshalJSON() ([]byte, error) { 10789 objectMap := make(map[string]interface{}) 10790 if vmssunc.Name != nil { 10791 objectMap["name"] = vmssunc.Name 10792 } 10793 if vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties != nil { 10794 objectMap["properties"] = vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties 10795 } 10796 if vmssunc.ID != nil { 10797 objectMap["id"] = vmssunc.ID 10798 } 10799 return json.Marshal(objectMap) 10800} 10801 10802// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdateNetworkConfiguration struct. 10803func (vmssunc *VirtualMachineScaleSetUpdateNetworkConfiguration) UnmarshalJSON(body []byte) error { 10804 var m map[string]*json.RawMessage 10805 err := json.Unmarshal(body, &m) 10806 if err != nil { 10807 return err 10808 } 10809 for k, v := range m { 10810 switch k { 10811 case "name": 10812 if v != nil { 10813 var name string 10814 err = json.Unmarshal(*v, &name) 10815 if err != nil { 10816 return err 10817 } 10818 vmssunc.Name = &name 10819 } 10820 case "properties": 10821 if v != nil { 10822 var virtualMachineScaleSetUpdateNetworkConfigurationProperties VirtualMachineScaleSetUpdateNetworkConfigurationProperties 10823 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateNetworkConfigurationProperties) 10824 if err != nil { 10825 return err 10826 } 10827 vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties = &virtualMachineScaleSetUpdateNetworkConfigurationProperties 10828 } 10829 case "id": 10830 if v != nil { 10831 var ID string 10832 err = json.Unmarshal(*v, &ID) 10833 if err != nil { 10834 return err 10835 } 10836 vmssunc.ID = &ID 10837 } 10838 } 10839 } 10840 10841 return nil 10842} 10843 10844// VirtualMachineScaleSetUpdateNetworkConfigurationProperties describes a virtual machine scale set 10845// updatable network profile's IP configuration.Use this object for updating network profile's IP 10846// Configuration. 10847type VirtualMachineScaleSetUpdateNetworkConfigurationProperties struct { 10848 // Primary - Whether this is a primary NIC on a virtual machine. 10849 Primary *bool `json:"primary,omitempty"` 10850 // EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled. 10851 EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` 10852 // NetworkSecurityGroup - The network security group. 10853 NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` 10854 // DNSSettings - The dns settings to be applied on the network interfaces. 10855 DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings `json:"dnsSettings,omitempty"` 10856 // IPConfigurations - The virtual machine scale set IP Configuration. 10857 IPConfigurations *[]VirtualMachineScaleSetUpdateIPConfiguration `json:"ipConfigurations,omitempty"` 10858 // EnableIPForwarding - Whether IP forwarding enabled on this NIC. 10859 EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` 10860} 10861 10862// VirtualMachineScaleSetUpdateNetworkProfile describes a virtual machine scale set network profile. 10863type VirtualMachineScaleSetUpdateNetworkProfile struct { 10864 // 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}'. 10865 HealthProbe *APIEntityReference `json:"healthProbe,omitempty"` 10866 // NetworkInterfaceConfigurations - The list of network configurations. 10867 NetworkInterfaceConfigurations *[]VirtualMachineScaleSetUpdateNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` 10868} 10869 10870// VirtualMachineScaleSetUpdateOSDisk describes virtual machine scale set operating system disk Update 10871// Object. This should be used for Updating VMSS OS Disk. 10872type VirtualMachineScaleSetUpdateOSDisk struct { 10873 // Caching - The caching type. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' 10874 Caching CachingTypes `json:"caching,omitempty"` 10875 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 10876 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 10877 // 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 10878 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 10879 // 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. 10880 Image *VirtualHardDisk `json:"image,omitempty"` 10881 // VhdContainers - The list of virtual hard disk container uris. 10882 VhdContainers *[]string `json:"vhdContainers,omitempty"` 10883 // ManagedDisk - The managed disk parameters. 10884 ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` 10885} 10886 10887// VirtualMachineScaleSetUpdateOSProfile describes a virtual machine scale set OS profile. 10888type VirtualMachineScaleSetUpdateOSProfile struct { 10889 // CustomData - A base-64 encoded string of custom data. 10890 CustomData *string `json:"customData,omitempty"` 10891 // WindowsConfiguration - The Windows Configuration of the OS profile. 10892 WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` 10893 // LinuxConfiguration - The Linux Configuration of the OS profile. 10894 LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` 10895 // Secrets - The List of certificates for addition to the VM. 10896 Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` 10897} 10898 10899// VirtualMachineScaleSetUpdateProperties describes the properties of a Virtual Machine Scale Set. 10900type VirtualMachineScaleSetUpdateProperties struct { 10901 // UpgradePolicy - The upgrade policy. 10902 UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` 10903 // AutomaticRepairsPolicy - Policy for automatic repairs. 10904 AutomaticRepairsPolicy *AutomaticRepairsPolicy `json:"automaticRepairsPolicy,omitempty"` 10905 // VirtualMachineProfile - The virtual machine profile. 10906 VirtualMachineProfile *VirtualMachineScaleSetUpdateVMProfile `json:"virtualMachineProfile,omitempty"` 10907 // Overprovision - Specifies whether the Virtual Machine Scale Set should be overprovisioned. 10908 Overprovision *bool `json:"overprovision,omitempty"` 10909 // 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. 10910 DoNotRunExtensionsOnOverprovisionedVMs *bool `json:"doNotRunExtensionsOnOverprovisionedVMs,omitempty"` 10911 // 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. 10912 SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"` 10913 // 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. 10914 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 10915 // ScaleInPolicy - Specifies the scale-in policy that decides which virtual machines are chosen for removal when a Virtual Machine Scale Set is scaled-in. 10916 ScaleInPolicy *ScaleInPolicy `json:"scaleInPolicy,omitempty"` 10917 // 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. 10918 ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` 10919} 10920 10921// VirtualMachineScaleSetUpdatePublicIPAddressConfiguration describes a virtual machines scale set IP 10922// Configuration's PublicIPAddress configuration 10923type VirtualMachineScaleSetUpdatePublicIPAddressConfiguration struct { 10924 // Name - The publicIP address configuration name. 10925 Name *string `json:"name,omitempty"` 10926 *VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties `json:"properties,omitempty"` 10927} 10928 10929// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdatePublicIPAddressConfiguration. 10930func (vmssupiac VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { 10931 objectMap := make(map[string]interface{}) 10932 if vmssupiac.Name != nil { 10933 objectMap["name"] = vmssupiac.Name 10934 } 10935 if vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties != nil { 10936 objectMap["properties"] = vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties 10937 } 10938 return json.Marshal(objectMap) 10939} 10940 10941// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdatePublicIPAddressConfiguration struct. 10942func (vmssupiac *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) UnmarshalJSON(body []byte) error { 10943 var m map[string]*json.RawMessage 10944 err := json.Unmarshal(body, &m) 10945 if err != nil { 10946 return err 10947 } 10948 for k, v := range m { 10949 switch k { 10950 case "name": 10951 if v != nil { 10952 var name string 10953 err = json.Unmarshal(*v, &name) 10954 if err != nil { 10955 return err 10956 } 10957 vmssupiac.Name = &name 10958 } 10959 case "properties": 10960 if v != nil { 10961 var virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties 10962 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties) 10963 if err != nil { 10964 return err 10965 } 10966 vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties = &virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties 10967 } 10968 } 10969 } 10970 10971 return nil 10972} 10973 10974// VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties describes a virtual machines scale 10975// set IP Configuration's PublicIPAddress configuration 10976type VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties struct { 10977 // IdleTimeoutInMinutes - The idle timeout of the public IP address. 10978 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` 10979 // DNSSettings - The dns settings to be applied on the publicIP addresses . 10980 DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings `json:"dnsSettings,omitempty"` 10981} 10982 10983// VirtualMachineScaleSetUpdateStorageProfile describes a virtual machine scale set storage profile. 10984type VirtualMachineScaleSetUpdateStorageProfile struct { 10985 // ImageReference - The image reference. 10986 ImageReference *ImageReference `json:"imageReference,omitempty"` 10987 // OsDisk - The OS disk. 10988 OsDisk *VirtualMachineScaleSetUpdateOSDisk `json:"osDisk,omitempty"` 10989 // DataDisks - The data disks. 10990 DataDisks *[]VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"` 10991} 10992 10993// VirtualMachineScaleSetUpdateVMProfile describes a virtual machine scale set virtual machine profile. 10994type VirtualMachineScaleSetUpdateVMProfile struct { 10995 // OsProfile - The virtual machine scale set OS profile. 10996 OsProfile *VirtualMachineScaleSetUpdateOSProfile `json:"osProfile,omitempty"` 10997 // StorageProfile - The virtual machine scale set storage profile. 10998 StorageProfile *VirtualMachineScaleSetUpdateStorageProfile `json:"storageProfile,omitempty"` 10999 // NetworkProfile - The virtual machine scale set network profile. 11000 NetworkProfile *VirtualMachineScaleSetUpdateNetworkProfile `json:"networkProfile,omitempty"` 11001 // DiagnosticsProfile - The virtual machine scale set diagnostics profile. 11002 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 11003 // ExtensionProfile - The virtual machine scale set extension profile. 11004 ExtensionProfile *VirtualMachineScaleSetExtensionProfile `json:"extensionProfile,omitempty"` 11005 // LicenseType - The license type, which is for bring your own license scenario. 11006 LicenseType *string `json:"licenseType,omitempty"` 11007 // BillingProfile - Specifies the billing related details of a Azure Spot VMSS. <br><br>Minimum api-version: 2019-03-01. 11008 BillingProfile *BillingProfile `json:"billingProfile,omitempty"` 11009 // ScheduledEventsProfile - Specifies Scheduled Event related configurations. 11010 ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` 11011} 11012 11013// VirtualMachineScaleSetVM describes a virtual machine scale set virtual machine. 11014type VirtualMachineScaleSetVM struct { 11015 autorest.Response `json:"-"` 11016 // InstanceID - READ-ONLY; The virtual machine instance ID. 11017 InstanceID *string `json:"instanceId,omitempty"` 11018 // Sku - READ-ONLY; The virtual machine SKU. 11019 Sku *Sku `json:"sku,omitempty"` 11020 *VirtualMachineScaleSetVMProperties `json:"properties,omitempty"` 11021 // 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**. 11022 Plan *Plan `json:"plan,omitempty"` 11023 // Resources - READ-ONLY; The virtual machine child extension resources. 11024 Resources *[]VirtualMachineExtension `json:"resources,omitempty"` 11025 // Zones - READ-ONLY; The virtual machine zones. 11026 Zones *[]string `json:"zones,omitempty"` 11027 // ID - READ-ONLY; Resource Id 11028 ID *string `json:"id,omitempty"` 11029 // Name - READ-ONLY; Resource name 11030 Name *string `json:"name,omitempty"` 11031 // Type - READ-ONLY; Resource type 11032 Type *string `json:"type,omitempty"` 11033 // Location - Resource location 11034 Location *string `json:"location,omitempty"` 11035 // Tags - Resource tags 11036 Tags map[string]*string `json:"tags"` 11037} 11038 11039// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVM. 11040func (vmssv VirtualMachineScaleSetVM) MarshalJSON() ([]byte, error) { 11041 objectMap := make(map[string]interface{}) 11042 if vmssv.VirtualMachineScaleSetVMProperties != nil { 11043 objectMap["properties"] = vmssv.VirtualMachineScaleSetVMProperties 11044 } 11045 if vmssv.Plan != nil { 11046 objectMap["plan"] = vmssv.Plan 11047 } 11048 if vmssv.Location != nil { 11049 objectMap["location"] = vmssv.Location 11050 } 11051 if vmssv.Tags != nil { 11052 objectMap["tags"] = vmssv.Tags 11053 } 11054 return json.Marshal(objectMap) 11055} 11056 11057// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetVM struct. 11058func (vmssv *VirtualMachineScaleSetVM) UnmarshalJSON(body []byte) error { 11059 var m map[string]*json.RawMessage 11060 err := json.Unmarshal(body, &m) 11061 if err != nil { 11062 return err 11063 } 11064 for k, v := range m { 11065 switch k { 11066 case "instanceId": 11067 if v != nil { 11068 var instanceID string 11069 err = json.Unmarshal(*v, &instanceID) 11070 if err != nil { 11071 return err 11072 } 11073 vmssv.InstanceID = &instanceID 11074 } 11075 case "sku": 11076 if v != nil { 11077 var sku Sku 11078 err = json.Unmarshal(*v, &sku) 11079 if err != nil { 11080 return err 11081 } 11082 vmssv.Sku = &sku 11083 } 11084 case "properties": 11085 if v != nil { 11086 var virtualMachineScaleSetVMProperties VirtualMachineScaleSetVMProperties 11087 err = json.Unmarshal(*v, &virtualMachineScaleSetVMProperties) 11088 if err != nil { 11089 return err 11090 } 11091 vmssv.VirtualMachineScaleSetVMProperties = &virtualMachineScaleSetVMProperties 11092 } 11093 case "plan": 11094 if v != nil { 11095 var plan Plan 11096 err = json.Unmarshal(*v, &plan) 11097 if err != nil { 11098 return err 11099 } 11100 vmssv.Plan = &plan 11101 } 11102 case "resources": 11103 if v != nil { 11104 var resources []VirtualMachineExtension 11105 err = json.Unmarshal(*v, &resources) 11106 if err != nil { 11107 return err 11108 } 11109 vmssv.Resources = &resources 11110 } 11111 case "zones": 11112 if v != nil { 11113 var zones []string 11114 err = json.Unmarshal(*v, &zones) 11115 if err != nil { 11116 return err 11117 } 11118 vmssv.Zones = &zones 11119 } 11120 case "id": 11121 if v != nil { 11122 var ID string 11123 err = json.Unmarshal(*v, &ID) 11124 if err != nil { 11125 return err 11126 } 11127 vmssv.ID = &ID 11128 } 11129 case "name": 11130 if v != nil { 11131 var name string 11132 err = json.Unmarshal(*v, &name) 11133 if err != nil { 11134 return err 11135 } 11136 vmssv.Name = &name 11137 } 11138 case "type": 11139 if v != nil { 11140 var typeVar string 11141 err = json.Unmarshal(*v, &typeVar) 11142 if err != nil { 11143 return err 11144 } 11145 vmssv.Type = &typeVar 11146 } 11147 case "location": 11148 if v != nil { 11149 var location string 11150 err = json.Unmarshal(*v, &location) 11151 if err != nil { 11152 return err 11153 } 11154 vmssv.Location = &location 11155 } 11156 case "tags": 11157 if v != nil { 11158 var tags map[string]*string 11159 err = json.Unmarshal(*v, &tags) 11160 if err != nil { 11161 return err 11162 } 11163 vmssv.Tags = tags 11164 } 11165 } 11166 } 11167 11168 return nil 11169} 11170 11171// VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the 11172// results of a long-running operation. 11173type VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture struct { 11174 azure.FutureAPI 11175 // Result returns the result of the asynchronous operation. 11176 // If the operation has not completed it will return an error. 11177 Result func(VirtualMachineScaleSetVMExtensionsClient) (VirtualMachineExtension, error) 11178} 11179 11180// VirtualMachineScaleSetVMExtensionsDeleteFuture an abstraction for monitoring and retrieving the results 11181// of a long-running operation. 11182type VirtualMachineScaleSetVMExtensionsDeleteFuture struct { 11183 azure.FutureAPI 11184 // Result returns the result of the asynchronous operation. 11185 // If the operation has not completed it will return an error. 11186 Result func(VirtualMachineScaleSetVMExtensionsClient) (autorest.Response, error) 11187} 11188 11189// VirtualMachineScaleSetVMExtensionsSummary extensions summary for virtual machines of a virtual machine 11190// scale set. 11191type VirtualMachineScaleSetVMExtensionsSummary struct { 11192 // Name - READ-ONLY; The extension name. 11193 Name *string `json:"name,omitempty"` 11194 // StatusesSummary - READ-ONLY; The extensions information. 11195 StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` 11196} 11197 11198// VirtualMachineScaleSetVMExtensionsUpdateFuture an abstraction for monitoring and retrieving the results 11199// of a long-running operation. 11200type VirtualMachineScaleSetVMExtensionsUpdateFuture struct { 11201 azure.FutureAPI 11202 // Result returns the result of the asynchronous operation. 11203 // If the operation has not completed it will return an error. 11204 Result func(VirtualMachineScaleSetVMExtensionsClient) (VirtualMachineExtension, error) 11205} 11206 11207// VirtualMachineScaleSetVMInstanceIDs specifies a list of virtual machine instance IDs from the VM scale 11208// set. 11209type VirtualMachineScaleSetVMInstanceIDs struct { 11210 // 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. 11211 InstanceIds *[]string `json:"instanceIds,omitempty"` 11212} 11213 11214// VirtualMachineScaleSetVMInstanceRequiredIDs specifies a list of virtual machine instance IDs from the VM 11215// scale set. 11216type VirtualMachineScaleSetVMInstanceRequiredIDs struct { 11217 // InstanceIds - The virtual machine scale set instance ids. 11218 InstanceIds *[]string `json:"instanceIds,omitempty"` 11219} 11220 11221// VirtualMachineScaleSetVMInstanceView the instance view of a virtual machine scale set VM. 11222type VirtualMachineScaleSetVMInstanceView struct { 11223 autorest.Response `json:"-"` 11224 // PlatformUpdateDomain - The Update Domain count. 11225 PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` 11226 // PlatformFaultDomain - The Fault Domain count. 11227 PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` 11228 // RdpThumbPrint - The Remote desktop certificate thumbprint. 11229 RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"` 11230 // VMAgent - The VM Agent running on the virtual machine. 11231 VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"` 11232 // MaintenanceRedeployStatus - The Maintenance Operation status on the virtual machine. 11233 MaintenanceRedeployStatus *MaintenanceRedeployStatus `json:"maintenanceRedeployStatus,omitempty"` 11234 // Disks - The disks information. 11235 Disks *[]DiskInstanceView `json:"disks,omitempty"` 11236 // Extensions - The extensions information. 11237 Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` 11238 // VMHealth - READ-ONLY; The health status for the VM. 11239 VMHealth *VirtualMachineHealthStatus `json:"vmHealth,omitempty"` 11240 // 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. 11241 BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` 11242 // Statuses - The resource status information. 11243 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 11244 // PlacementGroupID - The placement group in which the VM is running. If the VM is deallocated it will not have a placementGroupId. 11245 PlacementGroupID *string `json:"placementGroupId,omitempty"` 11246} 11247 11248// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMInstanceView. 11249func (vmssviv VirtualMachineScaleSetVMInstanceView) MarshalJSON() ([]byte, error) { 11250 objectMap := make(map[string]interface{}) 11251 if vmssviv.PlatformUpdateDomain != nil { 11252 objectMap["platformUpdateDomain"] = vmssviv.PlatformUpdateDomain 11253 } 11254 if vmssviv.PlatformFaultDomain != nil { 11255 objectMap["platformFaultDomain"] = vmssviv.PlatformFaultDomain 11256 } 11257 if vmssviv.RdpThumbPrint != nil { 11258 objectMap["rdpThumbPrint"] = vmssviv.RdpThumbPrint 11259 } 11260 if vmssviv.VMAgent != nil { 11261 objectMap["vmAgent"] = vmssviv.VMAgent 11262 } 11263 if vmssviv.MaintenanceRedeployStatus != nil { 11264 objectMap["maintenanceRedeployStatus"] = vmssviv.MaintenanceRedeployStatus 11265 } 11266 if vmssviv.Disks != nil { 11267 objectMap["disks"] = vmssviv.Disks 11268 } 11269 if vmssviv.Extensions != nil { 11270 objectMap["extensions"] = vmssviv.Extensions 11271 } 11272 if vmssviv.BootDiagnostics != nil { 11273 objectMap["bootDiagnostics"] = vmssviv.BootDiagnostics 11274 } 11275 if vmssviv.Statuses != nil { 11276 objectMap["statuses"] = vmssviv.Statuses 11277 } 11278 if vmssviv.PlacementGroupID != nil { 11279 objectMap["placementGroupId"] = vmssviv.PlacementGroupID 11280 } 11281 return json.Marshal(objectMap) 11282} 11283 11284// VirtualMachineScaleSetVMListResult the List Virtual Machine Scale Set VMs operation response. 11285type VirtualMachineScaleSetVMListResult struct { 11286 autorest.Response `json:"-"` 11287 // Value - The list of virtual machine scale sets VMs. 11288 Value *[]VirtualMachineScaleSetVM `json:"value,omitempty"` 11289 // 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 11290 NextLink *string `json:"nextLink,omitempty"` 11291} 11292 11293// VirtualMachineScaleSetVMListResultIterator provides access to a complete listing of 11294// VirtualMachineScaleSetVM values. 11295type VirtualMachineScaleSetVMListResultIterator struct { 11296 i int 11297 page VirtualMachineScaleSetVMListResultPage 11298} 11299 11300// NextWithContext advances to the next value. If there was an error making 11301// the request the iterator does not advance and the error is returned. 11302func (iter *VirtualMachineScaleSetVMListResultIterator) NextWithContext(ctx context.Context) (err error) { 11303 if tracing.IsEnabled() { 11304 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMListResultIterator.NextWithContext") 11305 defer func() { 11306 sc := -1 11307 if iter.Response().Response.Response != nil { 11308 sc = iter.Response().Response.Response.StatusCode 11309 } 11310 tracing.EndSpan(ctx, sc, err) 11311 }() 11312 } 11313 iter.i++ 11314 if iter.i < len(iter.page.Values()) { 11315 return nil 11316 } 11317 err = iter.page.NextWithContext(ctx) 11318 if err != nil { 11319 iter.i-- 11320 return err 11321 } 11322 iter.i = 0 11323 return nil 11324} 11325 11326// Next advances to the next value. If there was an error making 11327// the request the iterator does not advance and the error is returned. 11328// Deprecated: Use NextWithContext() instead. 11329func (iter *VirtualMachineScaleSetVMListResultIterator) Next() error { 11330 return iter.NextWithContext(context.Background()) 11331} 11332 11333// NotDone returns true if the enumeration should be started or is not yet complete. 11334func (iter VirtualMachineScaleSetVMListResultIterator) NotDone() bool { 11335 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11336} 11337 11338// Response returns the raw server response from the last page request. 11339func (iter VirtualMachineScaleSetVMListResultIterator) Response() VirtualMachineScaleSetVMListResult { 11340 return iter.page.Response() 11341} 11342 11343// Value returns the current value or a zero-initialized value if the 11344// iterator has advanced beyond the end of the collection. 11345func (iter VirtualMachineScaleSetVMListResultIterator) Value() VirtualMachineScaleSetVM { 11346 if !iter.page.NotDone() { 11347 return VirtualMachineScaleSetVM{} 11348 } 11349 return iter.page.Values()[iter.i] 11350} 11351 11352// Creates a new instance of the VirtualMachineScaleSetVMListResultIterator type. 11353func NewVirtualMachineScaleSetVMListResultIterator(page VirtualMachineScaleSetVMListResultPage) VirtualMachineScaleSetVMListResultIterator { 11354 return VirtualMachineScaleSetVMListResultIterator{page: page} 11355} 11356 11357// IsEmpty returns true if the ListResult contains no values. 11358func (vmssvlr VirtualMachineScaleSetVMListResult) IsEmpty() bool { 11359 return vmssvlr.Value == nil || len(*vmssvlr.Value) == 0 11360} 11361 11362// hasNextLink returns true if the NextLink is not empty. 11363func (vmssvlr VirtualMachineScaleSetVMListResult) hasNextLink() bool { 11364 return vmssvlr.NextLink != nil && len(*vmssvlr.NextLink) != 0 11365} 11366 11367// virtualMachineScaleSetVMListResultPreparer prepares a request to retrieve the next set of results. 11368// It returns nil if no more results exist. 11369func (vmssvlr VirtualMachineScaleSetVMListResult) virtualMachineScaleSetVMListResultPreparer(ctx context.Context) (*http.Request, error) { 11370 if !vmssvlr.hasNextLink() { 11371 return nil, nil 11372 } 11373 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11374 autorest.AsJSON(), 11375 autorest.AsGet(), 11376 autorest.WithBaseURL(to.String(vmssvlr.NextLink))) 11377} 11378 11379// VirtualMachineScaleSetVMListResultPage contains a page of VirtualMachineScaleSetVM values. 11380type VirtualMachineScaleSetVMListResultPage struct { 11381 fn func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error) 11382 vmssvlr VirtualMachineScaleSetVMListResult 11383} 11384 11385// NextWithContext advances to the next page of values. If there was an error making 11386// the request the page does not advance and the error is returned. 11387func (page *VirtualMachineScaleSetVMListResultPage) NextWithContext(ctx context.Context) (err error) { 11388 if tracing.IsEnabled() { 11389 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMListResultPage.NextWithContext") 11390 defer func() { 11391 sc := -1 11392 if page.Response().Response.Response != nil { 11393 sc = page.Response().Response.Response.StatusCode 11394 } 11395 tracing.EndSpan(ctx, sc, err) 11396 }() 11397 } 11398 for { 11399 next, err := page.fn(ctx, page.vmssvlr) 11400 if err != nil { 11401 return err 11402 } 11403 page.vmssvlr = next 11404 if !next.hasNextLink() || !next.IsEmpty() { 11405 break 11406 } 11407 } 11408 return nil 11409} 11410 11411// Next advances to the next page of values. If there was an error making 11412// the request the page does not advance and the error is returned. 11413// Deprecated: Use NextWithContext() instead. 11414func (page *VirtualMachineScaleSetVMListResultPage) Next() error { 11415 return page.NextWithContext(context.Background()) 11416} 11417 11418// NotDone returns true if the page enumeration should be started or is not yet complete. 11419func (page VirtualMachineScaleSetVMListResultPage) NotDone() bool { 11420 return !page.vmssvlr.IsEmpty() 11421} 11422 11423// Response returns the raw server response from the last page request. 11424func (page VirtualMachineScaleSetVMListResultPage) Response() VirtualMachineScaleSetVMListResult { 11425 return page.vmssvlr 11426} 11427 11428// Values returns the slice of values for the current page or nil if there are no values. 11429func (page VirtualMachineScaleSetVMListResultPage) Values() []VirtualMachineScaleSetVM { 11430 if page.vmssvlr.IsEmpty() { 11431 return nil 11432 } 11433 return *page.vmssvlr.Value 11434} 11435 11436// Creates a new instance of the VirtualMachineScaleSetVMListResultPage type. 11437func NewVirtualMachineScaleSetVMListResultPage(cur VirtualMachineScaleSetVMListResult, getNextPage func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error)) VirtualMachineScaleSetVMListResultPage { 11438 return VirtualMachineScaleSetVMListResultPage{ 11439 fn: getNextPage, 11440 vmssvlr: cur, 11441 } 11442} 11443 11444// VirtualMachineScaleSetVMNetworkProfileConfiguration describes a virtual machine scale set VM network 11445// profile. 11446type VirtualMachineScaleSetVMNetworkProfileConfiguration struct { 11447 // NetworkInterfaceConfigurations - The list of network configurations. 11448 NetworkInterfaceConfigurations *[]VirtualMachineScaleSetNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` 11449} 11450 11451// VirtualMachineScaleSetVMProfile describes a virtual machine scale set virtual machine profile. 11452type VirtualMachineScaleSetVMProfile struct { 11453 // OsProfile - Specifies the operating system settings for the virtual machines in the scale set. 11454 OsProfile *VirtualMachineScaleSetOSProfile `json:"osProfile,omitempty"` 11455 // StorageProfile - Specifies the storage settings for the virtual machine disks. 11456 StorageProfile *VirtualMachineScaleSetStorageProfile `json:"storageProfile,omitempty"` 11457 // NetworkProfile - Specifies properties of the network interfaces of the virtual machines in the scale set. 11458 NetworkProfile *VirtualMachineScaleSetNetworkProfile `json:"networkProfile,omitempty"` 11459 // DiagnosticsProfile - Specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. 11460 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 11461 // ExtensionProfile - Specifies a collection of settings for extensions installed on virtual machines in the scale set. 11462 ExtensionProfile *VirtualMachineScaleSetExtensionProfile `json:"extensionProfile,omitempty"` 11463 // LicenseType - Specifies that the image or disk that is being used was licensed on-premises. This element is only used for images that contain the Windows Server operating system. <br><br> Possible values are: <br><br> Windows_Client <br><br> Windows_Server <br><br> If this element is included in a request for an update, the value must match the initial value. This value cannot be updated. <br><br> For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) <br><br> Minimum api-version: 2015-06-15 11464 LicenseType *string `json:"licenseType,omitempty"` 11465 // 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' 11466 Priority VirtualMachinePriorityTypes `json:"priority,omitempty"` 11467 // EvictionPolicy - Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set. <br><br>For Azure Spot virtual machines, the only supported value is 'Deallocate' 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' 11468 EvictionPolicy VirtualMachineEvictionPolicyTypes `json:"evictionPolicy,omitempty"` 11469 // BillingProfile - Specifies the billing related details of a Azure Spot VMSS. <br><br>Minimum api-version: 2019-03-01. 11470 BillingProfile *BillingProfile `json:"billingProfile,omitempty"` 11471 // ScheduledEventsProfile - Specifies Scheduled Event related configurations. 11472 ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` 11473} 11474 11475// VirtualMachineScaleSetVMProperties describes the properties of a virtual machine scale set virtual 11476// machine. 11477type VirtualMachineScaleSetVMProperties struct { 11478 // LatestModelApplied - READ-ONLY; Specifies whether the latest model has been applied to the virtual machine. 11479 LatestModelApplied *bool `json:"latestModelApplied,omitempty"` 11480 // VMID - READ-ONLY; Azure VM unique ID. 11481 VMID *string `json:"vmId,omitempty"` 11482 // InstanceView - READ-ONLY; The virtual machine instance view. 11483 InstanceView *VirtualMachineScaleSetVMInstanceView `json:"instanceView,omitempty"` 11484 // HardwareProfile - Specifies the hardware settings for the virtual machine. 11485 HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` 11486 // StorageProfile - Specifies the storage settings for the virtual machine disks. 11487 StorageProfile *StorageProfile `json:"storageProfile,omitempty"` 11488 // 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. 11489 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 11490 // OsProfile - Specifies the operating system settings for the virtual machine. 11491 OsProfile *OSProfile `json:"osProfile,omitempty"` 11492 // NetworkProfile - Specifies the network interfaces of the virtual machine. 11493 NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` 11494 // NetworkProfileConfiguration - Specifies the network profile configuration of the virtual machine. 11495 NetworkProfileConfiguration *VirtualMachineScaleSetVMNetworkProfileConfiguration `json:"networkProfileConfiguration,omitempty"` 11496 // DiagnosticsProfile - Specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. 11497 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 11498 // 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. 11499 AvailabilitySet *SubResource `json:"availabilitySet,omitempty"` 11500 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 11501 ProvisioningState *string `json:"provisioningState,omitempty"` 11502 // LicenseType - Specifies that the image or disk that is being used was licensed on-premises. This element is only used for images that contain the Windows Server operating system. <br><br> Possible values are: <br><br> Windows_Client <br><br> Windows_Server <br><br> If this element is included in a request for an update, the value must match the initial value. This value cannot be updated. <br><br> For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) <br><br> Minimum api-version: 2015-06-15 11503 LicenseType *string `json:"licenseType,omitempty"` 11504 // 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. 11505 ModelDefinitionApplied *string `json:"modelDefinitionApplied,omitempty"` 11506 // ProtectionPolicy - Specifies the protection policy of the virtual machine. 11507 ProtectionPolicy *VirtualMachineScaleSetVMProtectionPolicy `json:"protectionPolicy,omitempty"` 11508} 11509 11510// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMProperties. 11511func (vmssvp VirtualMachineScaleSetVMProperties) MarshalJSON() ([]byte, error) { 11512 objectMap := make(map[string]interface{}) 11513 if vmssvp.HardwareProfile != nil { 11514 objectMap["hardwareProfile"] = vmssvp.HardwareProfile 11515 } 11516 if vmssvp.StorageProfile != nil { 11517 objectMap["storageProfile"] = vmssvp.StorageProfile 11518 } 11519 if vmssvp.AdditionalCapabilities != nil { 11520 objectMap["additionalCapabilities"] = vmssvp.AdditionalCapabilities 11521 } 11522 if vmssvp.OsProfile != nil { 11523 objectMap["osProfile"] = vmssvp.OsProfile 11524 } 11525 if vmssvp.NetworkProfile != nil { 11526 objectMap["networkProfile"] = vmssvp.NetworkProfile 11527 } 11528 if vmssvp.NetworkProfileConfiguration != nil { 11529 objectMap["networkProfileConfiguration"] = vmssvp.NetworkProfileConfiguration 11530 } 11531 if vmssvp.DiagnosticsProfile != nil { 11532 objectMap["diagnosticsProfile"] = vmssvp.DiagnosticsProfile 11533 } 11534 if vmssvp.AvailabilitySet != nil { 11535 objectMap["availabilitySet"] = vmssvp.AvailabilitySet 11536 } 11537 if vmssvp.LicenseType != nil { 11538 objectMap["licenseType"] = vmssvp.LicenseType 11539 } 11540 if vmssvp.ProtectionPolicy != nil { 11541 objectMap["protectionPolicy"] = vmssvp.ProtectionPolicy 11542 } 11543 return json.Marshal(objectMap) 11544} 11545 11546// VirtualMachineScaleSetVMProtectionPolicy the protection policy of a virtual machine scale set VM. 11547type VirtualMachineScaleSetVMProtectionPolicy struct { 11548 // ProtectFromScaleIn - Indicates that the virtual machine scale set VM shouldn't be considered for deletion during a scale-in operation. 11549 ProtectFromScaleIn *bool `json:"protectFromScaleIn,omitempty"` 11550 // 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. 11551 ProtectFromScaleSetActions *bool `json:"protectFromScaleSetActions,omitempty"` 11552} 11553 11554// VirtualMachineScaleSetVMReimageParameters describes a Virtual Machine Scale Set VM Reimage Parameters. 11555type VirtualMachineScaleSetVMReimageParameters struct { 11556 // 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. 11557 TempDisk *bool `json:"tempDisk,omitempty"` 11558} 11559 11560// VirtualMachineScaleSetVMsDeallocateFuture an abstraction for monitoring and retrieving the results of a 11561// long-running operation. 11562type VirtualMachineScaleSetVMsDeallocateFuture struct { 11563 azure.FutureAPI 11564 // Result returns the result of the asynchronous operation. 11565 // If the operation has not completed it will return an error. 11566 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 11567} 11568 11569// VirtualMachineScaleSetVMsDeleteFuture an abstraction for monitoring and retrieving the results of a 11570// long-running operation. 11571type VirtualMachineScaleSetVMsDeleteFuture struct { 11572 azure.FutureAPI 11573 // Result returns the result of the asynchronous operation. 11574 // If the operation has not completed it will return an error. 11575 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 11576} 11577 11578// VirtualMachineScaleSetVMsPerformMaintenanceFuture an abstraction for monitoring and retrieving the 11579// results of a long-running operation. 11580type VirtualMachineScaleSetVMsPerformMaintenanceFuture struct { 11581 azure.FutureAPI 11582 // Result returns the result of the asynchronous operation. 11583 // If the operation has not completed it will return an error. 11584 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 11585} 11586 11587// VirtualMachineScaleSetVMsPowerOffFuture an abstraction for monitoring and retrieving the results of a 11588// long-running operation. 11589type VirtualMachineScaleSetVMsPowerOffFuture struct { 11590 azure.FutureAPI 11591 // Result returns the result of the asynchronous operation. 11592 // If the operation has not completed it will return an error. 11593 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 11594} 11595 11596// VirtualMachineScaleSetVMsRedeployFuture an abstraction for monitoring and retrieving the results of a 11597// long-running operation. 11598type VirtualMachineScaleSetVMsRedeployFuture struct { 11599 azure.FutureAPI 11600 // Result returns the result of the asynchronous operation. 11601 // If the operation has not completed it will return an error. 11602 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 11603} 11604 11605// VirtualMachineScaleSetVMsReimageAllFuture an abstraction for monitoring and retrieving the results of a 11606// long-running operation. 11607type VirtualMachineScaleSetVMsReimageAllFuture struct { 11608 azure.FutureAPI 11609 // Result returns the result of the asynchronous operation. 11610 // If the operation has not completed it will return an error. 11611 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 11612} 11613 11614// VirtualMachineScaleSetVMsReimageFuture an abstraction for monitoring and retrieving the results of a 11615// long-running operation. 11616type VirtualMachineScaleSetVMsReimageFuture struct { 11617 azure.FutureAPI 11618 // Result returns the result of the asynchronous operation. 11619 // If the operation has not completed it will return an error. 11620 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 11621} 11622 11623// VirtualMachineScaleSetVMsRestartFuture an abstraction for monitoring and retrieving the results of a 11624// long-running operation. 11625type VirtualMachineScaleSetVMsRestartFuture struct { 11626 azure.FutureAPI 11627 // Result returns the result of the asynchronous operation. 11628 // If the operation has not completed it will return an error. 11629 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 11630} 11631 11632// VirtualMachineScaleSetVMsRunCommandFuture an abstraction for monitoring and retrieving the results of a 11633// long-running operation. 11634type VirtualMachineScaleSetVMsRunCommandFuture struct { 11635 azure.FutureAPI 11636 // Result returns the result of the asynchronous operation. 11637 // If the operation has not completed it will return an error. 11638 Result func(VirtualMachineScaleSetVMsClient) (RunCommandResult, error) 11639} 11640 11641// VirtualMachineScaleSetVMsStartFuture an abstraction for monitoring and retrieving the results of a 11642// long-running operation. 11643type VirtualMachineScaleSetVMsStartFuture struct { 11644 azure.FutureAPI 11645 // Result returns the result of the asynchronous operation. 11646 // If the operation has not completed it will return an error. 11647 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 11648} 11649 11650// VirtualMachineScaleSetVMsUpdateFuture an abstraction for monitoring and retrieving the results of a 11651// long-running operation. 11652type VirtualMachineScaleSetVMsUpdateFuture struct { 11653 azure.FutureAPI 11654 // Result returns the result of the asynchronous operation. 11655 // If the operation has not completed it will return an error. 11656 Result func(VirtualMachineScaleSetVMsClient) (VirtualMachineScaleSetVM, error) 11657} 11658 11659// VirtualMachinesCaptureFuture an abstraction for monitoring and retrieving the results of a long-running 11660// operation. 11661type VirtualMachinesCaptureFuture struct { 11662 azure.FutureAPI 11663 // Result returns the result of the asynchronous operation. 11664 // If the operation has not completed it will return an error. 11665 Result func(VirtualMachinesClient) (VirtualMachineCaptureResult, error) 11666} 11667 11668// VirtualMachinesConvertToManagedDisksFuture an abstraction for monitoring and retrieving the results of a 11669// long-running operation. 11670type VirtualMachinesConvertToManagedDisksFuture struct { 11671 azure.FutureAPI 11672 // Result returns the result of the asynchronous operation. 11673 // If the operation has not completed it will return an error. 11674 Result func(VirtualMachinesClient) (autorest.Response, error) 11675} 11676 11677// VirtualMachinesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 11678// long-running operation. 11679type VirtualMachinesCreateOrUpdateFuture struct { 11680 azure.FutureAPI 11681 // Result returns the result of the asynchronous operation. 11682 // If the operation has not completed it will return an error. 11683 Result func(VirtualMachinesClient) (VirtualMachine, error) 11684} 11685 11686// VirtualMachinesDeallocateFuture an abstraction for monitoring and retrieving the results of a 11687// long-running operation. 11688type VirtualMachinesDeallocateFuture struct { 11689 azure.FutureAPI 11690 // Result returns the result of the asynchronous operation. 11691 // If the operation has not completed it will return an error. 11692 Result func(VirtualMachinesClient) (autorest.Response, error) 11693} 11694 11695// VirtualMachinesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 11696// operation. 11697type VirtualMachinesDeleteFuture struct { 11698 azure.FutureAPI 11699 // Result returns the result of the asynchronous operation. 11700 // If the operation has not completed it will return an error. 11701 Result func(VirtualMachinesClient) (autorest.Response, error) 11702} 11703 11704// VirtualMachineSize describes the properties of a VM size. 11705type VirtualMachineSize struct { 11706 // Name - The name of the virtual machine size. 11707 Name *string `json:"name,omitempty"` 11708 // NumberOfCores - The number of cores supported by the virtual machine size. 11709 NumberOfCores *int32 `json:"numberOfCores,omitempty"` 11710 // OsDiskSizeInMB - The OS disk size, in MB, allowed by the virtual machine size. 11711 OsDiskSizeInMB *int32 `json:"osDiskSizeInMB,omitempty"` 11712 // ResourceDiskSizeInMB - The resource disk size, in MB, allowed by the virtual machine size. 11713 ResourceDiskSizeInMB *int32 `json:"resourceDiskSizeInMB,omitempty"` 11714 // MemoryInMB - The amount of memory, in MB, supported by the virtual machine size. 11715 MemoryInMB *int32 `json:"memoryInMB,omitempty"` 11716 // MaxDataDiskCount - The maximum number of data disks that can be attached to the virtual machine size. 11717 MaxDataDiskCount *int32 `json:"maxDataDiskCount,omitempty"` 11718} 11719 11720// VirtualMachineSizeListResult the List Virtual Machine operation response. 11721type VirtualMachineSizeListResult struct { 11722 autorest.Response `json:"-"` 11723 // Value - The list of virtual machine sizes. 11724 Value *[]VirtualMachineSize `json:"value,omitempty"` 11725} 11726 11727// VirtualMachinesPerformMaintenanceFuture an abstraction for monitoring and retrieving the results of a 11728// long-running operation. 11729type VirtualMachinesPerformMaintenanceFuture struct { 11730 azure.FutureAPI 11731 // Result returns the result of the asynchronous operation. 11732 // If the operation has not completed it will return an error. 11733 Result func(VirtualMachinesClient) (autorest.Response, error) 11734} 11735 11736// VirtualMachinesPowerOffFuture an abstraction for monitoring and retrieving the results of a long-running 11737// operation. 11738type VirtualMachinesPowerOffFuture struct { 11739 azure.FutureAPI 11740 // Result returns the result of the asynchronous operation. 11741 // If the operation has not completed it will return an error. 11742 Result func(VirtualMachinesClient) (autorest.Response, error) 11743} 11744 11745// VirtualMachinesReapplyFuture an abstraction for monitoring and retrieving the results of a long-running 11746// operation. 11747type VirtualMachinesReapplyFuture struct { 11748 azure.FutureAPI 11749 // Result returns the result of the asynchronous operation. 11750 // If the operation has not completed it will return an error. 11751 Result func(VirtualMachinesClient) (autorest.Response, error) 11752} 11753 11754// VirtualMachinesRedeployFuture an abstraction for monitoring and retrieving the results of a long-running 11755// operation. 11756type VirtualMachinesRedeployFuture struct { 11757 azure.FutureAPI 11758 // Result returns the result of the asynchronous operation. 11759 // If the operation has not completed it will return an error. 11760 Result func(VirtualMachinesClient) (autorest.Response, error) 11761} 11762 11763// VirtualMachinesReimageFuture an abstraction for monitoring and retrieving the results of a long-running 11764// operation. 11765type VirtualMachinesReimageFuture struct { 11766 azure.FutureAPI 11767 // Result returns the result of the asynchronous operation. 11768 // If the operation has not completed it will return an error. 11769 Result func(VirtualMachinesClient) (autorest.Response, error) 11770} 11771 11772// VirtualMachinesRestartFuture an abstraction for monitoring and retrieving the results of a long-running 11773// operation. 11774type VirtualMachinesRestartFuture struct { 11775 azure.FutureAPI 11776 // Result returns the result of the asynchronous operation. 11777 // If the operation has not completed it will return an error. 11778 Result func(VirtualMachinesClient) (autorest.Response, error) 11779} 11780 11781// VirtualMachinesRunCommandFuture an abstraction for monitoring and retrieving the results of a 11782// long-running operation. 11783type VirtualMachinesRunCommandFuture struct { 11784 azure.FutureAPI 11785 // Result returns the result of the asynchronous operation. 11786 // If the operation has not completed it will return an error. 11787 Result func(VirtualMachinesClient) (RunCommandResult, error) 11788} 11789 11790// VirtualMachinesStartFuture an abstraction for monitoring and retrieving the results of a long-running 11791// operation. 11792type VirtualMachinesStartFuture struct { 11793 azure.FutureAPI 11794 // Result returns the result of the asynchronous operation. 11795 // If the operation has not completed it will return an error. 11796 Result func(VirtualMachinesClient) (autorest.Response, error) 11797} 11798 11799// VirtualMachineStatusCodeCount the status code and count of the virtual machine scale set instance view 11800// status summary. 11801type VirtualMachineStatusCodeCount struct { 11802 // Code - READ-ONLY; The instance view status code. 11803 Code *string `json:"code,omitempty"` 11804 // Count - READ-ONLY; The number of instances having a particular status code. 11805 Count *int32 `json:"count,omitempty"` 11806} 11807 11808// VirtualMachinesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 11809// operation. 11810type VirtualMachinesUpdateFuture struct { 11811 azure.FutureAPI 11812 // Result returns the result of the asynchronous operation. 11813 // If the operation has not completed it will return an error. 11814 Result func(VirtualMachinesClient) (VirtualMachine, error) 11815} 11816 11817// VirtualMachineUpdate describes a Virtual Machine Update. 11818type VirtualMachineUpdate struct { 11819 // 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**. 11820 Plan *Plan `json:"plan,omitempty"` 11821 *VirtualMachineProperties `json:"properties,omitempty"` 11822 // Identity - The identity of the virtual machine, if configured. 11823 Identity *VirtualMachineIdentity `json:"identity,omitempty"` 11824 // Zones - The virtual machine zones. 11825 Zones *[]string `json:"zones,omitempty"` 11826 // Tags - Resource tags 11827 Tags map[string]*string `json:"tags"` 11828} 11829 11830// MarshalJSON is the custom marshaler for VirtualMachineUpdate. 11831func (vmu VirtualMachineUpdate) MarshalJSON() ([]byte, error) { 11832 objectMap := make(map[string]interface{}) 11833 if vmu.Plan != nil { 11834 objectMap["plan"] = vmu.Plan 11835 } 11836 if vmu.VirtualMachineProperties != nil { 11837 objectMap["properties"] = vmu.VirtualMachineProperties 11838 } 11839 if vmu.Identity != nil { 11840 objectMap["identity"] = vmu.Identity 11841 } 11842 if vmu.Zones != nil { 11843 objectMap["zones"] = vmu.Zones 11844 } 11845 if vmu.Tags != nil { 11846 objectMap["tags"] = vmu.Tags 11847 } 11848 return json.Marshal(objectMap) 11849} 11850 11851// UnmarshalJSON is the custom unmarshaler for VirtualMachineUpdate struct. 11852func (vmu *VirtualMachineUpdate) UnmarshalJSON(body []byte) error { 11853 var m map[string]*json.RawMessage 11854 err := json.Unmarshal(body, &m) 11855 if err != nil { 11856 return err 11857 } 11858 for k, v := range m { 11859 switch k { 11860 case "plan": 11861 if v != nil { 11862 var plan Plan 11863 err = json.Unmarshal(*v, &plan) 11864 if err != nil { 11865 return err 11866 } 11867 vmu.Plan = &plan 11868 } 11869 case "properties": 11870 if v != nil { 11871 var virtualMachineProperties VirtualMachineProperties 11872 err = json.Unmarshal(*v, &virtualMachineProperties) 11873 if err != nil { 11874 return err 11875 } 11876 vmu.VirtualMachineProperties = &virtualMachineProperties 11877 } 11878 case "identity": 11879 if v != nil { 11880 var identity VirtualMachineIdentity 11881 err = json.Unmarshal(*v, &identity) 11882 if err != nil { 11883 return err 11884 } 11885 vmu.Identity = &identity 11886 } 11887 case "zones": 11888 if v != nil { 11889 var zones []string 11890 err = json.Unmarshal(*v, &zones) 11891 if err != nil { 11892 return err 11893 } 11894 vmu.Zones = &zones 11895 } 11896 case "tags": 11897 if v != nil { 11898 var tags map[string]*string 11899 err = json.Unmarshal(*v, &tags) 11900 if err != nil { 11901 return err 11902 } 11903 vmu.Tags = tags 11904 } 11905 } 11906 } 11907 11908 return nil 11909} 11910 11911// VMScaleSetConvertToSinglePlacementGroupInput ... 11912type VMScaleSetConvertToSinglePlacementGroupInput struct { 11913 // 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. 11914 ActivePlacementGroupID *string `json:"activePlacementGroupId,omitempty"` 11915} 11916 11917// WindowsConfiguration specifies Windows operating system settings on the virtual machine. 11918type WindowsConfiguration struct { 11919 // 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. 11920 ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` 11921 // 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. 11922 EnableAutomaticUpdates *bool `json:"enableAutomaticUpdates,omitempty"` 11923 // 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). 11924 TimeZone *string `json:"timeZone,omitempty"` 11925 // AdditionalUnattendContent - Specifies additional base-64 encoded XML formatted information that can be included in the Unattend.xml file, which is used by Windows Setup. 11926 AdditionalUnattendContent *[]AdditionalUnattendContent `json:"additionalUnattendContent,omitempty"` 11927 // WinRM - Specifies the Windows Remote Management listeners. This enables remote Windows PowerShell. 11928 WinRM *WinRMConfiguration `json:"winRM,omitempty"` 11929} 11930 11931// WinRMConfiguration describes Windows Remote Management configuration of the VM 11932type WinRMConfiguration struct { 11933 // Listeners - The list of Windows Remote Management listeners 11934 Listeners *[]WinRMListener `json:"listeners,omitempty"` 11935} 11936 11937// WinRMListener describes Protocol and thumbprint of Windows Remote Management listener 11938type WinRMListener struct { 11939 // Protocol - Specifies the protocol of WinRM listener. <br><br> Possible values are: <br>**http** <br><br> **https**. Possible values include: 'HTTP', 'HTTPS' 11940 Protocol ProtocolTypes `json:"protocol,omitempty"` 11941 // 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>} 11942 CertificateURL *string `json:"certificateUrl,omitempty"` 11943} 11944