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-12-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 // GalleryImageReference - Required if creating from a Gallery Image. The id of the ImageDiskReference will be the ARM id of the shared galley image version from which to create a disk. 992 GalleryImageReference *ImageDiskReference `json:"galleryImageReference,omitempty"` 993 // SourceURI - If createOption is Import, this is the URI of a blob to be imported into a managed disk. 994 SourceURI *string `json:"sourceUri,omitempty"` 995 // SourceResourceID - If createOption is Copy, this is the ARM id of the source snapshot or disk. 996 SourceResourceID *string `json:"sourceResourceId,omitempty"` 997 // SourceUniqueID - READ-ONLY; If this field is set, this is the unique id identifying the source of this resource. 998 SourceUniqueID *string `json:"sourceUniqueId,omitempty"` 999 // 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). 1000 UploadSizeBytes *int64 `json:"uploadSizeBytes,omitempty"` 1001} 1002 1003// MarshalJSON is the custom marshaler for CreationData. 1004func (cd CreationData) MarshalJSON() ([]byte, error) { 1005 objectMap := make(map[string]interface{}) 1006 if cd.CreateOption != "" { 1007 objectMap["createOption"] = cd.CreateOption 1008 } 1009 if cd.StorageAccountID != nil { 1010 objectMap["storageAccountId"] = cd.StorageAccountID 1011 } 1012 if cd.ImageReference != nil { 1013 objectMap["imageReference"] = cd.ImageReference 1014 } 1015 if cd.GalleryImageReference != nil { 1016 objectMap["galleryImageReference"] = cd.GalleryImageReference 1017 } 1018 if cd.SourceURI != nil { 1019 objectMap["sourceUri"] = cd.SourceURI 1020 } 1021 if cd.SourceResourceID != nil { 1022 objectMap["sourceResourceId"] = cd.SourceResourceID 1023 } 1024 if cd.UploadSizeBytes != nil { 1025 objectMap["uploadSizeBytes"] = cd.UploadSizeBytes 1026 } 1027 return json.Marshal(objectMap) 1028} 1029 1030// DataDisk describes a data disk. 1031type DataDisk struct { 1032 // 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. 1033 Lun *int32 `json:"lun,omitempty"` 1034 // Name - The disk name. 1035 Name *string `json:"name,omitempty"` 1036 // Vhd - The virtual hard disk. 1037 Vhd *VirtualHardDisk `json:"vhd,omitempty"` 1038 // 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. 1039 Image *VirtualHardDisk `json:"image,omitempty"` 1040 // 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' 1041 Caching CachingTypes `json:"caching,omitempty"` 1042 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 1043 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 1044 // 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' 1045 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 1046 // 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 1047 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 1048 // ManagedDisk - The managed disk parameters. 1049 ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` 1050 // ToBeDetached - Specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset 1051 ToBeDetached *bool `json:"toBeDetached,omitempty"` 1052 // 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. 1053 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 1054 // 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. 1055 DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` 1056} 1057 1058// MarshalJSON is the custom marshaler for DataDisk. 1059func (dd DataDisk) MarshalJSON() ([]byte, error) { 1060 objectMap := make(map[string]interface{}) 1061 if dd.Lun != nil { 1062 objectMap["lun"] = dd.Lun 1063 } 1064 if dd.Name != nil { 1065 objectMap["name"] = dd.Name 1066 } 1067 if dd.Vhd != nil { 1068 objectMap["vhd"] = dd.Vhd 1069 } 1070 if dd.Image != nil { 1071 objectMap["image"] = dd.Image 1072 } 1073 if dd.Caching != "" { 1074 objectMap["caching"] = dd.Caching 1075 } 1076 if dd.WriteAcceleratorEnabled != nil { 1077 objectMap["writeAcceleratorEnabled"] = dd.WriteAcceleratorEnabled 1078 } 1079 if dd.CreateOption != "" { 1080 objectMap["createOption"] = dd.CreateOption 1081 } 1082 if dd.DiskSizeGB != nil { 1083 objectMap["diskSizeGB"] = dd.DiskSizeGB 1084 } 1085 if dd.ManagedDisk != nil { 1086 objectMap["managedDisk"] = dd.ManagedDisk 1087 } 1088 if dd.ToBeDetached != nil { 1089 objectMap["toBeDetached"] = dd.ToBeDetached 1090 } 1091 return json.Marshal(objectMap) 1092} 1093 1094// DataDiskImage contains the data disk images information. 1095type DataDiskImage struct { 1096 // 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. 1097 Lun *int32 `json:"lun,omitempty"` 1098} 1099 1100// DataDiskImageEncryption contains encryption settings for a data disk image. 1101type DataDiskImageEncryption struct { 1102 // 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. 1103 Lun *int32 `json:"lun,omitempty"` 1104 // DiskEncryptionSetID - A relative URI containing the resource ID of the disk encryption set. 1105 DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` 1106} 1107 1108// DedicatedHost specifies information about the Dedicated host. 1109type DedicatedHost struct { 1110 autorest.Response `json:"-"` 1111 *DedicatedHostProperties `json:"properties,omitempty"` 1112 // 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. 1113 Sku *Sku `json:"sku,omitempty"` 1114 // ID - READ-ONLY; Resource Id 1115 ID *string `json:"id,omitempty"` 1116 // Name - READ-ONLY; Resource name 1117 Name *string `json:"name,omitempty"` 1118 // Type - READ-ONLY; Resource type 1119 Type *string `json:"type,omitempty"` 1120 // Location - Resource location 1121 Location *string `json:"location,omitempty"` 1122 // Tags - Resource tags 1123 Tags map[string]*string `json:"tags"` 1124} 1125 1126// MarshalJSON is the custom marshaler for DedicatedHost. 1127func (dh DedicatedHost) MarshalJSON() ([]byte, error) { 1128 objectMap := make(map[string]interface{}) 1129 if dh.DedicatedHostProperties != nil { 1130 objectMap["properties"] = dh.DedicatedHostProperties 1131 } 1132 if dh.Sku != nil { 1133 objectMap["sku"] = dh.Sku 1134 } 1135 if dh.Location != nil { 1136 objectMap["location"] = dh.Location 1137 } 1138 if dh.Tags != nil { 1139 objectMap["tags"] = dh.Tags 1140 } 1141 return json.Marshal(objectMap) 1142} 1143 1144// UnmarshalJSON is the custom unmarshaler for DedicatedHost struct. 1145func (dh *DedicatedHost) UnmarshalJSON(body []byte) error { 1146 var m map[string]*json.RawMessage 1147 err := json.Unmarshal(body, &m) 1148 if err != nil { 1149 return err 1150 } 1151 for k, v := range m { 1152 switch k { 1153 case "properties": 1154 if v != nil { 1155 var dedicatedHostProperties DedicatedHostProperties 1156 err = json.Unmarshal(*v, &dedicatedHostProperties) 1157 if err != nil { 1158 return err 1159 } 1160 dh.DedicatedHostProperties = &dedicatedHostProperties 1161 } 1162 case "sku": 1163 if v != nil { 1164 var sku Sku 1165 err = json.Unmarshal(*v, &sku) 1166 if err != nil { 1167 return err 1168 } 1169 dh.Sku = &sku 1170 } 1171 case "id": 1172 if v != nil { 1173 var ID string 1174 err = json.Unmarshal(*v, &ID) 1175 if err != nil { 1176 return err 1177 } 1178 dh.ID = &ID 1179 } 1180 case "name": 1181 if v != nil { 1182 var name string 1183 err = json.Unmarshal(*v, &name) 1184 if err != nil { 1185 return err 1186 } 1187 dh.Name = &name 1188 } 1189 case "type": 1190 if v != nil { 1191 var typeVar string 1192 err = json.Unmarshal(*v, &typeVar) 1193 if err != nil { 1194 return err 1195 } 1196 dh.Type = &typeVar 1197 } 1198 case "location": 1199 if v != nil { 1200 var location string 1201 err = json.Unmarshal(*v, &location) 1202 if err != nil { 1203 return err 1204 } 1205 dh.Location = &location 1206 } 1207 case "tags": 1208 if v != nil { 1209 var tags map[string]*string 1210 err = json.Unmarshal(*v, &tags) 1211 if err != nil { 1212 return err 1213 } 1214 dh.Tags = tags 1215 } 1216 } 1217 } 1218 1219 return nil 1220} 1221 1222// DedicatedHostAllocatableVM represents the dedicated host unutilized capacity in terms of a specific VM 1223// size. 1224type DedicatedHostAllocatableVM struct { 1225 // VMSize - VM size in terms of which the unutilized capacity is represented. 1226 VMSize *string `json:"vmSize,omitempty"` 1227 // Count - Maximum number of VMs of size vmSize that can fit in the dedicated host's remaining capacity. 1228 Count *float64 `json:"count,omitempty"` 1229} 1230 1231// DedicatedHostAvailableCapacity dedicated host unutilized capacity. 1232type DedicatedHostAvailableCapacity struct { 1233 // 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. 1234 AllocatableVMs *[]DedicatedHostAllocatableVM `json:"allocatableVMs,omitempty"` 1235} 1236 1237// DedicatedHostGroup specifies information about the dedicated host group that the dedicated hosts should 1238// be assigned to. <br><br> Currently, a dedicated host can only be added to a dedicated host group at 1239// creation time. An existing dedicated host cannot be added to another dedicated host group. 1240type DedicatedHostGroup struct { 1241 autorest.Response `json:"-"` 1242 *DedicatedHostGroupProperties `json:"properties,omitempty"` 1243 // 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. 1244 Zones *[]string `json:"zones,omitempty"` 1245 // ID - READ-ONLY; Resource Id 1246 ID *string `json:"id,omitempty"` 1247 // Name - READ-ONLY; Resource name 1248 Name *string `json:"name,omitempty"` 1249 // Type - READ-ONLY; Resource type 1250 Type *string `json:"type,omitempty"` 1251 // Location - Resource location 1252 Location *string `json:"location,omitempty"` 1253 // Tags - Resource tags 1254 Tags map[string]*string `json:"tags"` 1255} 1256 1257// MarshalJSON is the custom marshaler for DedicatedHostGroup. 1258func (dhg DedicatedHostGroup) MarshalJSON() ([]byte, error) { 1259 objectMap := make(map[string]interface{}) 1260 if dhg.DedicatedHostGroupProperties != nil { 1261 objectMap["properties"] = dhg.DedicatedHostGroupProperties 1262 } 1263 if dhg.Zones != nil { 1264 objectMap["zones"] = dhg.Zones 1265 } 1266 if dhg.Location != nil { 1267 objectMap["location"] = dhg.Location 1268 } 1269 if dhg.Tags != nil { 1270 objectMap["tags"] = dhg.Tags 1271 } 1272 return json.Marshal(objectMap) 1273} 1274 1275// UnmarshalJSON is the custom unmarshaler for DedicatedHostGroup struct. 1276func (dhg *DedicatedHostGroup) UnmarshalJSON(body []byte) error { 1277 var m map[string]*json.RawMessage 1278 err := json.Unmarshal(body, &m) 1279 if err != nil { 1280 return err 1281 } 1282 for k, v := range m { 1283 switch k { 1284 case "properties": 1285 if v != nil { 1286 var dedicatedHostGroupProperties DedicatedHostGroupProperties 1287 err = json.Unmarshal(*v, &dedicatedHostGroupProperties) 1288 if err != nil { 1289 return err 1290 } 1291 dhg.DedicatedHostGroupProperties = &dedicatedHostGroupProperties 1292 } 1293 case "zones": 1294 if v != nil { 1295 var zones []string 1296 err = json.Unmarshal(*v, &zones) 1297 if err != nil { 1298 return err 1299 } 1300 dhg.Zones = &zones 1301 } 1302 case "id": 1303 if v != nil { 1304 var ID string 1305 err = json.Unmarshal(*v, &ID) 1306 if err != nil { 1307 return err 1308 } 1309 dhg.ID = &ID 1310 } 1311 case "name": 1312 if v != nil { 1313 var name string 1314 err = json.Unmarshal(*v, &name) 1315 if err != nil { 1316 return err 1317 } 1318 dhg.Name = &name 1319 } 1320 case "type": 1321 if v != nil { 1322 var typeVar string 1323 err = json.Unmarshal(*v, &typeVar) 1324 if err != nil { 1325 return err 1326 } 1327 dhg.Type = &typeVar 1328 } 1329 case "location": 1330 if v != nil { 1331 var location string 1332 err = json.Unmarshal(*v, &location) 1333 if err != nil { 1334 return err 1335 } 1336 dhg.Location = &location 1337 } 1338 case "tags": 1339 if v != nil { 1340 var tags map[string]*string 1341 err = json.Unmarshal(*v, &tags) 1342 if err != nil { 1343 return err 1344 } 1345 dhg.Tags = tags 1346 } 1347 } 1348 } 1349 1350 return nil 1351} 1352 1353// DedicatedHostGroupListResult the List Dedicated Host Group with resource group response. 1354type DedicatedHostGroupListResult struct { 1355 autorest.Response `json:"-"` 1356 // Value - The list of dedicated host groups 1357 Value *[]DedicatedHostGroup `json:"value,omitempty"` 1358 // 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. 1359 NextLink *string `json:"nextLink,omitempty"` 1360} 1361 1362// DedicatedHostGroupListResultIterator provides access to a complete listing of DedicatedHostGroup values. 1363type DedicatedHostGroupListResultIterator struct { 1364 i int 1365 page DedicatedHostGroupListResultPage 1366} 1367 1368// NextWithContext advances to the next value. If there was an error making 1369// the request the iterator does not advance and the error is returned. 1370func (iter *DedicatedHostGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { 1371 if tracing.IsEnabled() { 1372 ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupListResultIterator.NextWithContext") 1373 defer func() { 1374 sc := -1 1375 if iter.Response().Response.Response != nil { 1376 sc = iter.Response().Response.Response.StatusCode 1377 } 1378 tracing.EndSpan(ctx, sc, err) 1379 }() 1380 } 1381 iter.i++ 1382 if iter.i < len(iter.page.Values()) { 1383 return nil 1384 } 1385 err = iter.page.NextWithContext(ctx) 1386 if err != nil { 1387 iter.i-- 1388 return err 1389 } 1390 iter.i = 0 1391 return nil 1392} 1393 1394// Next advances to the next value. If there was an error making 1395// the request the iterator does not advance and the error is returned. 1396// Deprecated: Use NextWithContext() instead. 1397func (iter *DedicatedHostGroupListResultIterator) Next() error { 1398 return iter.NextWithContext(context.Background()) 1399} 1400 1401// NotDone returns true if the enumeration should be started or is not yet complete. 1402func (iter DedicatedHostGroupListResultIterator) NotDone() bool { 1403 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1404} 1405 1406// Response returns the raw server response from the last page request. 1407func (iter DedicatedHostGroupListResultIterator) Response() DedicatedHostGroupListResult { 1408 return iter.page.Response() 1409} 1410 1411// Value returns the current value or a zero-initialized value if the 1412// iterator has advanced beyond the end of the collection. 1413func (iter DedicatedHostGroupListResultIterator) Value() DedicatedHostGroup { 1414 if !iter.page.NotDone() { 1415 return DedicatedHostGroup{} 1416 } 1417 return iter.page.Values()[iter.i] 1418} 1419 1420// Creates a new instance of the DedicatedHostGroupListResultIterator type. 1421func NewDedicatedHostGroupListResultIterator(page DedicatedHostGroupListResultPage) DedicatedHostGroupListResultIterator { 1422 return DedicatedHostGroupListResultIterator{page: page} 1423} 1424 1425// IsEmpty returns true if the ListResult contains no values. 1426func (dhglr DedicatedHostGroupListResult) IsEmpty() bool { 1427 return dhglr.Value == nil || len(*dhglr.Value) == 0 1428} 1429 1430// hasNextLink returns true if the NextLink is not empty. 1431func (dhglr DedicatedHostGroupListResult) hasNextLink() bool { 1432 return dhglr.NextLink != nil && len(*dhglr.NextLink) != 0 1433} 1434 1435// dedicatedHostGroupListResultPreparer prepares a request to retrieve the next set of results. 1436// It returns nil if no more results exist. 1437func (dhglr DedicatedHostGroupListResult) dedicatedHostGroupListResultPreparer(ctx context.Context) (*http.Request, error) { 1438 if !dhglr.hasNextLink() { 1439 return nil, nil 1440 } 1441 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1442 autorest.AsJSON(), 1443 autorest.AsGet(), 1444 autorest.WithBaseURL(to.String(dhglr.NextLink))) 1445} 1446 1447// DedicatedHostGroupListResultPage contains a page of DedicatedHostGroup values. 1448type DedicatedHostGroupListResultPage struct { 1449 fn func(context.Context, DedicatedHostGroupListResult) (DedicatedHostGroupListResult, error) 1450 dhglr DedicatedHostGroupListResult 1451} 1452 1453// NextWithContext advances to the next page of values. If there was an error making 1454// the request the page does not advance and the error is returned. 1455func (page *DedicatedHostGroupListResultPage) NextWithContext(ctx context.Context) (err error) { 1456 if tracing.IsEnabled() { 1457 ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupListResultPage.NextWithContext") 1458 defer func() { 1459 sc := -1 1460 if page.Response().Response.Response != nil { 1461 sc = page.Response().Response.Response.StatusCode 1462 } 1463 tracing.EndSpan(ctx, sc, err) 1464 }() 1465 } 1466 for { 1467 next, err := page.fn(ctx, page.dhglr) 1468 if err != nil { 1469 return err 1470 } 1471 page.dhglr = next 1472 if !next.hasNextLink() || !next.IsEmpty() { 1473 break 1474 } 1475 } 1476 return nil 1477} 1478 1479// Next advances to the next page of values. If there was an error making 1480// the request the page does not advance and the error is returned. 1481// Deprecated: Use NextWithContext() instead. 1482func (page *DedicatedHostGroupListResultPage) Next() error { 1483 return page.NextWithContext(context.Background()) 1484} 1485 1486// NotDone returns true if the page enumeration should be started or is not yet complete. 1487func (page DedicatedHostGroupListResultPage) NotDone() bool { 1488 return !page.dhglr.IsEmpty() 1489} 1490 1491// Response returns the raw server response from the last page request. 1492func (page DedicatedHostGroupListResultPage) Response() DedicatedHostGroupListResult { 1493 return page.dhglr 1494} 1495 1496// Values returns the slice of values for the current page or nil if there are no values. 1497func (page DedicatedHostGroupListResultPage) Values() []DedicatedHostGroup { 1498 if page.dhglr.IsEmpty() { 1499 return nil 1500 } 1501 return *page.dhglr.Value 1502} 1503 1504// Creates a new instance of the DedicatedHostGroupListResultPage type. 1505func NewDedicatedHostGroupListResultPage(cur DedicatedHostGroupListResult, getNextPage func(context.Context, DedicatedHostGroupListResult) (DedicatedHostGroupListResult, error)) DedicatedHostGroupListResultPage { 1506 return DedicatedHostGroupListResultPage{ 1507 fn: getNextPage, 1508 dhglr: cur, 1509 } 1510} 1511 1512// DedicatedHostGroupProperties dedicated Host Group Properties. 1513type DedicatedHostGroupProperties struct { 1514 // PlatformFaultDomainCount - Number of fault domains that the host group can span. 1515 PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` 1516 // Hosts - READ-ONLY; A list of references to all dedicated hosts in the dedicated host group. 1517 Hosts *[]SubResourceReadOnly `json:"hosts,omitempty"` 1518} 1519 1520// MarshalJSON is the custom marshaler for DedicatedHostGroupProperties. 1521func (dhgp DedicatedHostGroupProperties) MarshalJSON() ([]byte, error) { 1522 objectMap := make(map[string]interface{}) 1523 if dhgp.PlatformFaultDomainCount != nil { 1524 objectMap["platformFaultDomainCount"] = dhgp.PlatformFaultDomainCount 1525 } 1526 return json.Marshal(objectMap) 1527} 1528 1529// DedicatedHostGroupUpdate specifies information about the dedicated host group that the dedicated host 1530// should be assigned to. Only tags may be updated. 1531type DedicatedHostGroupUpdate struct { 1532 *DedicatedHostGroupProperties `json:"properties,omitempty"` 1533 // 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. 1534 Zones *[]string `json:"zones,omitempty"` 1535 // Tags - Resource tags 1536 Tags map[string]*string `json:"tags"` 1537} 1538 1539// MarshalJSON is the custom marshaler for DedicatedHostGroupUpdate. 1540func (dhgu DedicatedHostGroupUpdate) MarshalJSON() ([]byte, error) { 1541 objectMap := make(map[string]interface{}) 1542 if dhgu.DedicatedHostGroupProperties != nil { 1543 objectMap["properties"] = dhgu.DedicatedHostGroupProperties 1544 } 1545 if dhgu.Zones != nil { 1546 objectMap["zones"] = dhgu.Zones 1547 } 1548 if dhgu.Tags != nil { 1549 objectMap["tags"] = dhgu.Tags 1550 } 1551 return json.Marshal(objectMap) 1552} 1553 1554// UnmarshalJSON is the custom unmarshaler for DedicatedHostGroupUpdate struct. 1555func (dhgu *DedicatedHostGroupUpdate) UnmarshalJSON(body []byte) error { 1556 var m map[string]*json.RawMessage 1557 err := json.Unmarshal(body, &m) 1558 if err != nil { 1559 return err 1560 } 1561 for k, v := range m { 1562 switch k { 1563 case "properties": 1564 if v != nil { 1565 var dedicatedHostGroupProperties DedicatedHostGroupProperties 1566 err = json.Unmarshal(*v, &dedicatedHostGroupProperties) 1567 if err != nil { 1568 return err 1569 } 1570 dhgu.DedicatedHostGroupProperties = &dedicatedHostGroupProperties 1571 } 1572 case "zones": 1573 if v != nil { 1574 var zones []string 1575 err = json.Unmarshal(*v, &zones) 1576 if err != nil { 1577 return err 1578 } 1579 dhgu.Zones = &zones 1580 } 1581 case "tags": 1582 if v != nil { 1583 var tags map[string]*string 1584 err = json.Unmarshal(*v, &tags) 1585 if err != nil { 1586 return err 1587 } 1588 dhgu.Tags = tags 1589 } 1590 } 1591 } 1592 1593 return nil 1594} 1595 1596// DedicatedHostInstanceView the instance view of a dedicated host. 1597type DedicatedHostInstanceView struct { 1598 // AssetID - READ-ONLY; Specifies the unique id of the dedicated physical machine on which the dedicated host resides. 1599 AssetID *string `json:"assetId,omitempty"` 1600 // AvailableCapacity - Unutilized capacity of the dedicated host. 1601 AvailableCapacity *DedicatedHostAvailableCapacity `json:"availableCapacity,omitempty"` 1602 // Statuses - The resource status information. 1603 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 1604} 1605 1606// MarshalJSON is the custom marshaler for DedicatedHostInstanceView. 1607func (dhiv DedicatedHostInstanceView) MarshalJSON() ([]byte, error) { 1608 objectMap := make(map[string]interface{}) 1609 if dhiv.AvailableCapacity != nil { 1610 objectMap["availableCapacity"] = dhiv.AvailableCapacity 1611 } 1612 if dhiv.Statuses != nil { 1613 objectMap["statuses"] = dhiv.Statuses 1614 } 1615 return json.Marshal(objectMap) 1616} 1617 1618// DedicatedHostListResult the list dedicated host operation response. 1619type DedicatedHostListResult struct { 1620 autorest.Response `json:"-"` 1621 // Value - The list of dedicated hosts 1622 Value *[]DedicatedHost `json:"value,omitempty"` 1623 // NextLink - The URI to fetch the next page of dedicated hosts. Call ListNext() with this URI to fetch the next page of dedicated hosts. 1624 NextLink *string `json:"nextLink,omitempty"` 1625} 1626 1627// DedicatedHostListResultIterator provides access to a complete listing of DedicatedHost values. 1628type DedicatedHostListResultIterator struct { 1629 i int 1630 page DedicatedHostListResultPage 1631} 1632 1633// NextWithContext advances to the next value. If there was an error making 1634// the request the iterator does not advance and the error is returned. 1635func (iter *DedicatedHostListResultIterator) NextWithContext(ctx context.Context) (err error) { 1636 if tracing.IsEnabled() { 1637 ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostListResultIterator.NextWithContext") 1638 defer func() { 1639 sc := -1 1640 if iter.Response().Response.Response != nil { 1641 sc = iter.Response().Response.Response.StatusCode 1642 } 1643 tracing.EndSpan(ctx, sc, err) 1644 }() 1645 } 1646 iter.i++ 1647 if iter.i < len(iter.page.Values()) { 1648 return nil 1649 } 1650 err = iter.page.NextWithContext(ctx) 1651 if err != nil { 1652 iter.i-- 1653 return err 1654 } 1655 iter.i = 0 1656 return nil 1657} 1658 1659// Next advances to the next value. If there was an error making 1660// the request the iterator does not advance and the error is returned. 1661// Deprecated: Use NextWithContext() instead. 1662func (iter *DedicatedHostListResultIterator) Next() error { 1663 return iter.NextWithContext(context.Background()) 1664} 1665 1666// NotDone returns true if the enumeration should be started or is not yet complete. 1667func (iter DedicatedHostListResultIterator) NotDone() bool { 1668 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1669} 1670 1671// Response returns the raw server response from the last page request. 1672func (iter DedicatedHostListResultIterator) Response() DedicatedHostListResult { 1673 return iter.page.Response() 1674} 1675 1676// Value returns the current value or a zero-initialized value if the 1677// iterator has advanced beyond the end of the collection. 1678func (iter DedicatedHostListResultIterator) Value() DedicatedHost { 1679 if !iter.page.NotDone() { 1680 return DedicatedHost{} 1681 } 1682 return iter.page.Values()[iter.i] 1683} 1684 1685// Creates a new instance of the DedicatedHostListResultIterator type. 1686func NewDedicatedHostListResultIterator(page DedicatedHostListResultPage) DedicatedHostListResultIterator { 1687 return DedicatedHostListResultIterator{page: page} 1688} 1689 1690// IsEmpty returns true if the ListResult contains no values. 1691func (dhlr DedicatedHostListResult) IsEmpty() bool { 1692 return dhlr.Value == nil || len(*dhlr.Value) == 0 1693} 1694 1695// hasNextLink returns true if the NextLink is not empty. 1696func (dhlr DedicatedHostListResult) hasNextLink() bool { 1697 return dhlr.NextLink != nil && len(*dhlr.NextLink) != 0 1698} 1699 1700// dedicatedHostListResultPreparer prepares a request to retrieve the next set of results. 1701// It returns nil if no more results exist. 1702func (dhlr DedicatedHostListResult) dedicatedHostListResultPreparer(ctx context.Context) (*http.Request, error) { 1703 if !dhlr.hasNextLink() { 1704 return nil, nil 1705 } 1706 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1707 autorest.AsJSON(), 1708 autorest.AsGet(), 1709 autorest.WithBaseURL(to.String(dhlr.NextLink))) 1710} 1711 1712// DedicatedHostListResultPage contains a page of DedicatedHost values. 1713type DedicatedHostListResultPage struct { 1714 fn func(context.Context, DedicatedHostListResult) (DedicatedHostListResult, error) 1715 dhlr DedicatedHostListResult 1716} 1717 1718// NextWithContext advances to the next page of values. If there was an error making 1719// the request the page does not advance and the error is returned. 1720func (page *DedicatedHostListResultPage) NextWithContext(ctx context.Context) (err error) { 1721 if tracing.IsEnabled() { 1722 ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostListResultPage.NextWithContext") 1723 defer func() { 1724 sc := -1 1725 if page.Response().Response.Response != nil { 1726 sc = page.Response().Response.Response.StatusCode 1727 } 1728 tracing.EndSpan(ctx, sc, err) 1729 }() 1730 } 1731 for { 1732 next, err := page.fn(ctx, page.dhlr) 1733 if err != nil { 1734 return err 1735 } 1736 page.dhlr = next 1737 if !next.hasNextLink() || !next.IsEmpty() { 1738 break 1739 } 1740 } 1741 return nil 1742} 1743 1744// Next advances to the next page of values. If there was an error making 1745// the request the page does not advance and the error is returned. 1746// Deprecated: Use NextWithContext() instead. 1747func (page *DedicatedHostListResultPage) Next() error { 1748 return page.NextWithContext(context.Background()) 1749} 1750 1751// NotDone returns true if the page enumeration should be started or is not yet complete. 1752func (page DedicatedHostListResultPage) NotDone() bool { 1753 return !page.dhlr.IsEmpty() 1754} 1755 1756// Response returns the raw server response from the last page request. 1757func (page DedicatedHostListResultPage) Response() DedicatedHostListResult { 1758 return page.dhlr 1759} 1760 1761// Values returns the slice of values for the current page or nil if there are no values. 1762func (page DedicatedHostListResultPage) Values() []DedicatedHost { 1763 if page.dhlr.IsEmpty() { 1764 return nil 1765 } 1766 return *page.dhlr.Value 1767} 1768 1769// Creates a new instance of the DedicatedHostListResultPage type. 1770func NewDedicatedHostListResultPage(cur DedicatedHostListResult, getNextPage func(context.Context, DedicatedHostListResult) (DedicatedHostListResult, error)) DedicatedHostListResultPage { 1771 return DedicatedHostListResultPage{ 1772 fn: getNextPage, 1773 dhlr: cur, 1774 } 1775} 1776 1777// DedicatedHostProperties properties of the dedicated host. 1778type DedicatedHostProperties struct { 1779 // PlatformFaultDomain - Fault domain of the dedicated host within a dedicated host group. 1780 PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` 1781 // AutoReplaceOnFailure - Specifies whether the dedicated host should be replaced automatically in case of a failure. The value is defaulted to 'true' when not provided. 1782 AutoReplaceOnFailure *bool `json:"autoReplaceOnFailure,omitempty"` 1783 // 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. 1784 HostID *string `json:"hostId,omitempty"` 1785 // VirtualMachines - READ-ONLY; A list of references to all virtual machines in the Dedicated Host. 1786 VirtualMachines *[]SubResourceReadOnly `json:"virtualMachines,omitempty"` 1787 // 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' 1788 LicenseType DedicatedHostLicenseTypes `json:"licenseType,omitempty"` 1789 // ProvisioningTime - READ-ONLY; The date when the host was first provisioned. 1790 ProvisioningTime *date.Time `json:"provisioningTime,omitempty"` 1791 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 1792 ProvisioningState *string `json:"provisioningState,omitempty"` 1793 // InstanceView - READ-ONLY; The dedicated host instance view. 1794 InstanceView *DedicatedHostInstanceView `json:"instanceView,omitempty"` 1795} 1796 1797// MarshalJSON is the custom marshaler for DedicatedHostProperties. 1798func (dhp DedicatedHostProperties) MarshalJSON() ([]byte, error) { 1799 objectMap := make(map[string]interface{}) 1800 if dhp.PlatformFaultDomain != nil { 1801 objectMap["platformFaultDomain"] = dhp.PlatformFaultDomain 1802 } 1803 if dhp.AutoReplaceOnFailure != nil { 1804 objectMap["autoReplaceOnFailure"] = dhp.AutoReplaceOnFailure 1805 } 1806 if dhp.LicenseType != "" { 1807 objectMap["licenseType"] = dhp.LicenseType 1808 } 1809 return json.Marshal(objectMap) 1810} 1811 1812// DedicatedHostsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 1813// long-running operation. 1814type DedicatedHostsCreateOrUpdateFuture struct { 1815 azure.FutureAPI 1816 // Result returns the result of the asynchronous operation. 1817 // If the operation has not completed it will return an error. 1818 Result func(DedicatedHostsClient) (DedicatedHost, error) 1819} 1820 1821// DedicatedHostsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 1822// operation. 1823type DedicatedHostsDeleteFuture struct { 1824 azure.FutureAPI 1825 // Result returns the result of the asynchronous operation. 1826 // If the operation has not completed it will return an error. 1827 Result func(DedicatedHostsClient) (autorest.Response, error) 1828} 1829 1830// DedicatedHostsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 1831// operation. 1832type DedicatedHostsUpdateFuture struct { 1833 azure.FutureAPI 1834 // Result returns the result of the asynchronous operation. 1835 // If the operation has not completed it will return an error. 1836 Result func(DedicatedHostsClient) (DedicatedHost, error) 1837} 1838 1839// DedicatedHostUpdate specifies information about the dedicated host. Only tags, autoReplaceOnFailure and 1840// licenseType may be updated. 1841type DedicatedHostUpdate struct { 1842 *DedicatedHostProperties `json:"properties,omitempty"` 1843 // Tags - Resource tags 1844 Tags map[string]*string `json:"tags"` 1845} 1846 1847// MarshalJSON is the custom marshaler for DedicatedHostUpdate. 1848func (dhu DedicatedHostUpdate) MarshalJSON() ([]byte, error) { 1849 objectMap := make(map[string]interface{}) 1850 if dhu.DedicatedHostProperties != nil { 1851 objectMap["properties"] = dhu.DedicatedHostProperties 1852 } 1853 if dhu.Tags != nil { 1854 objectMap["tags"] = dhu.Tags 1855 } 1856 return json.Marshal(objectMap) 1857} 1858 1859// UnmarshalJSON is the custom unmarshaler for DedicatedHostUpdate struct. 1860func (dhu *DedicatedHostUpdate) UnmarshalJSON(body []byte) error { 1861 var m map[string]*json.RawMessage 1862 err := json.Unmarshal(body, &m) 1863 if err != nil { 1864 return err 1865 } 1866 for k, v := range m { 1867 switch k { 1868 case "properties": 1869 if v != nil { 1870 var dedicatedHostProperties DedicatedHostProperties 1871 err = json.Unmarshal(*v, &dedicatedHostProperties) 1872 if err != nil { 1873 return err 1874 } 1875 dhu.DedicatedHostProperties = &dedicatedHostProperties 1876 } 1877 case "tags": 1878 if v != nil { 1879 var tags map[string]*string 1880 err = json.Unmarshal(*v, &tags) 1881 if err != nil { 1882 return err 1883 } 1884 dhu.Tags = tags 1885 } 1886 } 1887 } 1888 1889 return nil 1890} 1891 1892// DiagnosticsProfile specifies the boot diagnostic settings state. <br><br>Minimum api-version: 1893// 2015-06-15. 1894type DiagnosticsProfile struct { 1895 // 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. 1896 BootDiagnostics *BootDiagnostics `json:"bootDiagnostics,omitempty"` 1897} 1898 1899// DiffDiskSettings describes the parameters of ephemeral disk settings that can be specified for operating 1900// system disk. <br><br> NOTE: The ephemeral disk settings can only be specified for managed disk. 1901type DiffDiskSettings struct { 1902 // Option - Specifies the ephemeral disk settings for operating system disk. Possible values include: 'Local' 1903 Option DiffDiskOptions `json:"option,omitempty"` 1904 // Placement - Specifies the ephemeral disk placement for operating system disk.<br><br> Possible values are: <br><br> **CacheDisk** <br><br> **ResourceDisk** <br><br> Default: **CacheDisk** if one is configured for the VM size otherwise **ResourceDisk** is used.<br><br> Refer to VM size documentation for Windows VM at https://docs.microsoft.com/en-us/azure/virtual-machines/windows/sizes and Linux VM at https://docs.microsoft.com/en-us/azure/virtual-machines/linux/sizes to check which VM sizes exposes a cache disk. Possible values include: 'CacheDisk', 'ResourceDisk' 1905 Placement DiffDiskPlacement `json:"placement,omitempty"` 1906} 1907 1908// Disallowed describes the disallowed disk types. 1909type Disallowed struct { 1910 // DiskTypes - A list of disk types. 1911 DiskTypes *[]string `json:"diskTypes,omitempty"` 1912} 1913 1914// Disk disk resource. 1915type Disk struct { 1916 autorest.Response `json:"-"` 1917 // ManagedBy - READ-ONLY; A relative URI containing the ID of the VM that has the disk attached. 1918 ManagedBy *string `json:"managedBy,omitempty"` 1919 // ManagedByExtended - READ-ONLY; List of relative URIs containing the IDs of the VMs that have the disk attached. maxShares should be set to a value greater than one for disks to allow attaching them to multiple VMs. 1920 ManagedByExtended *[]string `json:"managedByExtended,omitempty"` 1921 Sku *DiskSku `json:"sku,omitempty"` 1922 // Zones - The Logical zone list for Disk. 1923 Zones *[]string `json:"zones,omitempty"` 1924 *DiskProperties `json:"properties,omitempty"` 1925 // ID - READ-ONLY; Resource Id 1926 ID *string `json:"id,omitempty"` 1927 // Name - READ-ONLY; Resource name 1928 Name *string `json:"name,omitempty"` 1929 // Type - READ-ONLY; Resource type 1930 Type *string `json:"type,omitempty"` 1931 // Location - Resource location 1932 Location *string `json:"location,omitempty"` 1933 // Tags - Resource tags 1934 Tags map[string]*string `json:"tags"` 1935} 1936 1937// MarshalJSON is the custom marshaler for Disk. 1938func (d Disk) MarshalJSON() ([]byte, error) { 1939 objectMap := make(map[string]interface{}) 1940 if d.Sku != nil { 1941 objectMap["sku"] = d.Sku 1942 } 1943 if d.Zones != nil { 1944 objectMap["zones"] = d.Zones 1945 } 1946 if d.DiskProperties != nil { 1947 objectMap["properties"] = d.DiskProperties 1948 } 1949 if d.Location != nil { 1950 objectMap["location"] = d.Location 1951 } 1952 if d.Tags != nil { 1953 objectMap["tags"] = d.Tags 1954 } 1955 return json.Marshal(objectMap) 1956} 1957 1958// UnmarshalJSON is the custom unmarshaler for Disk struct. 1959func (d *Disk) UnmarshalJSON(body []byte) error { 1960 var m map[string]*json.RawMessage 1961 err := json.Unmarshal(body, &m) 1962 if err != nil { 1963 return err 1964 } 1965 for k, v := range m { 1966 switch k { 1967 case "managedBy": 1968 if v != nil { 1969 var managedBy string 1970 err = json.Unmarshal(*v, &managedBy) 1971 if err != nil { 1972 return err 1973 } 1974 d.ManagedBy = &managedBy 1975 } 1976 case "managedByExtended": 1977 if v != nil { 1978 var managedByExtended []string 1979 err = json.Unmarshal(*v, &managedByExtended) 1980 if err != nil { 1981 return err 1982 } 1983 d.ManagedByExtended = &managedByExtended 1984 } 1985 case "sku": 1986 if v != nil { 1987 var sku DiskSku 1988 err = json.Unmarshal(*v, &sku) 1989 if err != nil { 1990 return err 1991 } 1992 d.Sku = &sku 1993 } 1994 case "zones": 1995 if v != nil { 1996 var zones []string 1997 err = json.Unmarshal(*v, &zones) 1998 if err != nil { 1999 return err 2000 } 2001 d.Zones = &zones 2002 } 2003 case "properties": 2004 if v != nil { 2005 var diskProperties DiskProperties 2006 err = json.Unmarshal(*v, &diskProperties) 2007 if err != nil { 2008 return err 2009 } 2010 d.DiskProperties = &diskProperties 2011 } 2012 case "id": 2013 if v != nil { 2014 var ID string 2015 err = json.Unmarshal(*v, &ID) 2016 if err != nil { 2017 return err 2018 } 2019 d.ID = &ID 2020 } 2021 case "name": 2022 if v != nil { 2023 var name string 2024 err = json.Unmarshal(*v, &name) 2025 if err != nil { 2026 return err 2027 } 2028 d.Name = &name 2029 } 2030 case "type": 2031 if v != nil { 2032 var typeVar string 2033 err = json.Unmarshal(*v, &typeVar) 2034 if err != nil { 2035 return err 2036 } 2037 d.Type = &typeVar 2038 } 2039 case "location": 2040 if v != nil { 2041 var location string 2042 err = json.Unmarshal(*v, &location) 2043 if err != nil { 2044 return err 2045 } 2046 d.Location = &location 2047 } 2048 case "tags": 2049 if v != nil { 2050 var tags map[string]*string 2051 err = json.Unmarshal(*v, &tags) 2052 if err != nil { 2053 return err 2054 } 2055 d.Tags = tags 2056 } 2057 } 2058 } 2059 2060 return nil 2061} 2062 2063// DiskEncryptionSet disk encryption set resource. 2064type DiskEncryptionSet struct { 2065 autorest.Response `json:"-"` 2066 Identity *EncryptionSetIdentity `json:"identity,omitempty"` 2067 *EncryptionSetProperties `json:"properties,omitempty"` 2068 // ID - READ-ONLY; Resource Id 2069 ID *string `json:"id,omitempty"` 2070 // Name - READ-ONLY; Resource name 2071 Name *string `json:"name,omitempty"` 2072 // Type - READ-ONLY; Resource type 2073 Type *string `json:"type,omitempty"` 2074 // Location - Resource location 2075 Location *string `json:"location,omitempty"` 2076 // Tags - Resource tags 2077 Tags map[string]*string `json:"tags"` 2078} 2079 2080// MarshalJSON is the custom marshaler for DiskEncryptionSet. 2081func (desVar DiskEncryptionSet) MarshalJSON() ([]byte, error) { 2082 objectMap := make(map[string]interface{}) 2083 if desVar.Identity != nil { 2084 objectMap["identity"] = desVar.Identity 2085 } 2086 if desVar.EncryptionSetProperties != nil { 2087 objectMap["properties"] = desVar.EncryptionSetProperties 2088 } 2089 if desVar.Location != nil { 2090 objectMap["location"] = desVar.Location 2091 } 2092 if desVar.Tags != nil { 2093 objectMap["tags"] = desVar.Tags 2094 } 2095 return json.Marshal(objectMap) 2096} 2097 2098// UnmarshalJSON is the custom unmarshaler for DiskEncryptionSet struct. 2099func (desVar *DiskEncryptionSet) UnmarshalJSON(body []byte) error { 2100 var m map[string]*json.RawMessage 2101 err := json.Unmarshal(body, &m) 2102 if err != nil { 2103 return err 2104 } 2105 for k, v := range m { 2106 switch k { 2107 case "identity": 2108 if v != nil { 2109 var identity EncryptionSetIdentity 2110 err = json.Unmarshal(*v, &identity) 2111 if err != nil { 2112 return err 2113 } 2114 desVar.Identity = &identity 2115 } 2116 case "properties": 2117 if v != nil { 2118 var encryptionSetProperties EncryptionSetProperties 2119 err = json.Unmarshal(*v, &encryptionSetProperties) 2120 if err != nil { 2121 return err 2122 } 2123 desVar.EncryptionSetProperties = &encryptionSetProperties 2124 } 2125 case "id": 2126 if v != nil { 2127 var ID string 2128 err = json.Unmarshal(*v, &ID) 2129 if err != nil { 2130 return err 2131 } 2132 desVar.ID = &ID 2133 } 2134 case "name": 2135 if v != nil { 2136 var name string 2137 err = json.Unmarshal(*v, &name) 2138 if err != nil { 2139 return err 2140 } 2141 desVar.Name = &name 2142 } 2143 case "type": 2144 if v != nil { 2145 var typeVar string 2146 err = json.Unmarshal(*v, &typeVar) 2147 if err != nil { 2148 return err 2149 } 2150 desVar.Type = &typeVar 2151 } 2152 case "location": 2153 if v != nil { 2154 var location string 2155 err = json.Unmarshal(*v, &location) 2156 if err != nil { 2157 return err 2158 } 2159 desVar.Location = &location 2160 } 2161 case "tags": 2162 if v != nil { 2163 var tags map[string]*string 2164 err = json.Unmarshal(*v, &tags) 2165 if err != nil { 2166 return err 2167 } 2168 desVar.Tags = tags 2169 } 2170 } 2171 } 2172 2173 return nil 2174} 2175 2176// DiskEncryptionSetList the List disk encryption set operation response. 2177type DiskEncryptionSetList struct { 2178 autorest.Response `json:"-"` 2179 // Value - A list of disk encryption sets. 2180 Value *[]DiskEncryptionSet `json:"value,omitempty"` 2181 // 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. 2182 NextLink *string `json:"nextLink,omitempty"` 2183} 2184 2185// DiskEncryptionSetListIterator provides access to a complete listing of DiskEncryptionSet values. 2186type DiskEncryptionSetListIterator struct { 2187 i int 2188 page DiskEncryptionSetListPage 2189} 2190 2191// NextWithContext advances to the next value. If there was an error making 2192// the request the iterator does not advance and the error is returned. 2193func (iter *DiskEncryptionSetListIterator) NextWithContext(ctx context.Context) (err error) { 2194 if tracing.IsEnabled() { 2195 ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetListIterator.NextWithContext") 2196 defer func() { 2197 sc := -1 2198 if iter.Response().Response.Response != nil { 2199 sc = iter.Response().Response.Response.StatusCode 2200 } 2201 tracing.EndSpan(ctx, sc, err) 2202 }() 2203 } 2204 iter.i++ 2205 if iter.i < len(iter.page.Values()) { 2206 return nil 2207 } 2208 err = iter.page.NextWithContext(ctx) 2209 if err != nil { 2210 iter.i-- 2211 return err 2212 } 2213 iter.i = 0 2214 return nil 2215} 2216 2217// Next advances to the next value. If there was an error making 2218// the request the iterator does not advance and the error is returned. 2219// Deprecated: Use NextWithContext() instead. 2220func (iter *DiskEncryptionSetListIterator) Next() error { 2221 return iter.NextWithContext(context.Background()) 2222} 2223 2224// NotDone returns true if the enumeration should be started or is not yet complete. 2225func (iter DiskEncryptionSetListIterator) NotDone() bool { 2226 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2227} 2228 2229// Response returns the raw server response from the last page request. 2230func (iter DiskEncryptionSetListIterator) Response() DiskEncryptionSetList { 2231 return iter.page.Response() 2232} 2233 2234// Value returns the current value or a zero-initialized value if the 2235// iterator has advanced beyond the end of the collection. 2236func (iter DiskEncryptionSetListIterator) Value() DiskEncryptionSet { 2237 if !iter.page.NotDone() { 2238 return DiskEncryptionSet{} 2239 } 2240 return iter.page.Values()[iter.i] 2241} 2242 2243// Creates a new instance of the DiskEncryptionSetListIterator type. 2244func NewDiskEncryptionSetListIterator(page DiskEncryptionSetListPage) DiskEncryptionSetListIterator { 2245 return DiskEncryptionSetListIterator{page: page} 2246} 2247 2248// IsEmpty returns true if the ListResult contains no values. 2249func (desl DiskEncryptionSetList) IsEmpty() bool { 2250 return desl.Value == nil || len(*desl.Value) == 0 2251} 2252 2253// hasNextLink returns true if the NextLink is not empty. 2254func (desl DiskEncryptionSetList) hasNextLink() bool { 2255 return desl.NextLink != nil && len(*desl.NextLink) != 0 2256} 2257 2258// diskEncryptionSetListPreparer prepares a request to retrieve the next set of results. 2259// It returns nil if no more results exist. 2260func (desl DiskEncryptionSetList) diskEncryptionSetListPreparer(ctx context.Context) (*http.Request, error) { 2261 if !desl.hasNextLink() { 2262 return nil, nil 2263 } 2264 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2265 autorest.AsJSON(), 2266 autorest.AsGet(), 2267 autorest.WithBaseURL(to.String(desl.NextLink))) 2268} 2269 2270// DiskEncryptionSetListPage contains a page of DiskEncryptionSet values. 2271type DiskEncryptionSetListPage struct { 2272 fn func(context.Context, DiskEncryptionSetList) (DiskEncryptionSetList, error) 2273 desl DiskEncryptionSetList 2274} 2275 2276// NextWithContext 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. 2278func (page *DiskEncryptionSetListPage) NextWithContext(ctx context.Context) (err error) { 2279 if tracing.IsEnabled() { 2280 ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetListPage.NextWithContext") 2281 defer func() { 2282 sc := -1 2283 if page.Response().Response.Response != nil { 2284 sc = page.Response().Response.Response.StatusCode 2285 } 2286 tracing.EndSpan(ctx, sc, err) 2287 }() 2288 } 2289 for { 2290 next, err := page.fn(ctx, page.desl) 2291 if err != nil { 2292 return err 2293 } 2294 page.desl = next 2295 if !next.hasNextLink() || !next.IsEmpty() { 2296 break 2297 } 2298 } 2299 return nil 2300} 2301 2302// Next advances to the next page of values. If there was an error making 2303// the request the page does not advance and the error is returned. 2304// Deprecated: Use NextWithContext() instead. 2305func (page *DiskEncryptionSetListPage) Next() error { 2306 return page.NextWithContext(context.Background()) 2307} 2308 2309// NotDone returns true if the page enumeration should be started or is not yet complete. 2310func (page DiskEncryptionSetListPage) NotDone() bool { 2311 return !page.desl.IsEmpty() 2312} 2313 2314// Response returns the raw server response from the last page request. 2315func (page DiskEncryptionSetListPage) Response() DiskEncryptionSetList { 2316 return page.desl 2317} 2318 2319// Values returns the slice of values for the current page or nil if there are no values. 2320func (page DiskEncryptionSetListPage) Values() []DiskEncryptionSet { 2321 if page.desl.IsEmpty() { 2322 return nil 2323 } 2324 return *page.desl.Value 2325} 2326 2327// Creates a new instance of the DiskEncryptionSetListPage type. 2328func NewDiskEncryptionSetListPage(cur DiskEncryptionSetList, getNextPage func(context.Context, DiskEncryptionSetList) (DiskEncryptionSetList, error)) DiskEncryptionSetListPage { 2329 return DiskEncryptionSetListPage{ 2330 fn: getNextPage, 2331 desl: cur, 2332 } 2333} 2334 2335// DiskEncryptionSetParameters describes the parameter of customer managed disk encryption set resource id 2336// that can be specified for disk. <br><br> NOTE: The disk encryption set resource id can only be specified 2337// for managed disk. Please refer https://aka.ms/mdssewithcmkoverview for more details. 2338type DiskEncryptionSetParameters struct { 2339 // ID - Resource Id 2340 ID *string `json:"id,omitempty"` 2341} 2342 2343// DiskEncryptionSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 2344// long-running operation. 2345type DiskEncryptionSetsCreateOrUpdateFuture struct { 2346 azure.FutureAPI 2347 // Result returns the result of the asynchronous operation. 2348 // If the operation has not completed it will return an error. 2349 Result func(DiskEncryptionSetsClient) (DiskEncryptionSet, error) 2350} 2351 2352// DiskEncryptionSetsDeleteFuture an abstraction for monitoring and retrieving the results of a 2353// long-running operation. 2354type DiskEncryptionSetsDeleteFuture struct { 2355 azure.FutureAPI 2356 // Result returns the result of the asynchronous operation. 2357 // If the operation has not completed it will return an error. 2358 Result func(DiskEncryptionSetsClient) (autorest.Response, error) 2359} 2360 2361// DiskEncryptionSetsUpdateFuture an abstraction for monitoring and retrieving the results of a 2362// long-running operation. 2363type DiskEncryptionSetsUpdateFuture struct { 2364 azure.FutureAPI 2365 // Result returns the result of the asynchronous operation. 2366 // If the operation has not completed it will return an error. 2367 Result func(DiskEncryptionSetsClient) (DiskEncryptionSet, error) 2368} 2369 2370// DiskEncryptionSettings describes a Encryption Settings for a Disk 2371type DiskEncryptionSettings struct { 2372 // DiskEncryptionKey - Specifies the location of the disk encryption key, which is a Key Vault Secret. 2373 DiskEncryptionKey *KeyVaultSecretReference `json:"diskEncryptionKey,omitempty"` 2374 // KeyEncryptionKey - Specifies the location of the key encryption key in Key Vault. 2375 KeyEncryptionKey *KeyVaultKeyReference `json:"keyEncryptionKey,omitempty"` 2376 // Enabled - Specifies whether disk encryption should be enabled on the virtual machine. 2377 Enabled *bool `json:"enabled,omitempty"` 2378} 2379 2380// DiskEncryptionSetUpdate disk encryption set update resource. 2381type DiskEncryptionSetUpdate struct { 2382 *DiskEncryptionSetUpdateProperties `json:"properties,omitempty"` 2383 // Tags - Resource tags 2384 Tags map[string]*string `json:"tags"` 2385} 2386 2387// MarshalJSON is the custom marshaler for DiskEncryptionSetUpdate. 2388func (desu DiskEncryptionSetUpdate) MarshalJSON() ([]byte, error) { 2389 objectMap := make(map[string]interface{}) 2390 if desu.DiskEncryptionSetUpdateProperties != nil { 2391 objectMap["properties"] = desu.DiskEncryptionSetUpdateProperties 2392 } 2393 if desu.Tags != nil { 2394 objectMap["tags"] = desu.Tags 2395 } 2396 return json.Marshal(objectMap) 2397} 2398 2399// UnmarshalJSON is the custom unmarshaler for DiskEncryptionSetUpdate struct. 2400func (desu *DiskEncryptionSetUpdate) UnmarshalJSON(body []byte) error { 2401 var m map[string]*json.RawMessage 2402 err := json.Unmarshal(body, &m) 2403 if err != nil { 2404 return err 2405 } 2406 for k, v := range m { 2407 switch k { 2408 case "properties": 2409 if v != nil { 2410 var diskEncryptionSetUpdateProperties DiskEncryptionSetUpdateProperties 2411 err = json.Unmarshal(*v, &diskEncryptionSetUpdateProperties) 2412 if err != nil { 2413 return err 2414 } 2415 desu.DiskEncryptionSetUpdateProperties = &diskEncryptionSetUpdateProperties 2416 } 2417 case "tags": 2418 if v != nil { 2419 var tags map[string]*string 2420 err = json.Unmarshal(*v, &tags) 2421 if err != nil { 2422 return err 2423 } 2424 desu.Tags = tags 2425 } 2426 } 2427 } 2428 2429 return nil 2430} 2431 2432// DiskEncryptionSetUpdateProperties disk encryption set resource update properties. 2433type DiskEncryptionSetUpdateProperties struct { 2434 ActiveKey *KeyVaultAndKeyReference `json:"activeKey,omitempty"` 2435} 2436 2437// DiskImageEncryption this is the disk image encryption base class. 2438type DiskImageEncryption struct { 2439 // DiskEncryptionSetID - A relative URI containing the resource ID of the disk encryption set. 2440 DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` 2441} 2442 2443// DiskInstanceView the instance view of the disk. 2444type DiskInstanceView struct { 2445 // Name - The disk name. 2446 Name *string `json:"name,omitempty"` 2447 // EncryptionSettings - Specifies the encryption settings for the OS Disk. <br><br> Minimum api-version: 2015-06-15 2448 EncryptionSettings *[]DiskEncryptionSettings `json:"encryptionSettings,omitempty"` 2449 // Statuses - The resource status information. 2450 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 2451} 2452 2453// DiskList the List Disks operation response. 2454type DiskList struct { 2455 autorest.Response `json:"-"` 2456 // Value - A list of disks. 2457 Value *[]Disk `json:"value,omitempty"` 2458 // NextLink - The uri to fetch the next page of disks. Call ListNext() with this to fetch the next page of disks. 2459 NextLink *string `json:"nextLink,omitempty"` 2460} 2461 2462// DiskListIterator provides access to a complete listing of Disk values. 2463type DiskListIterator struct { 2464 i int 2465 page DiskListPage 2466} 2467 2468// NextWithContext advances to the next value. If there was an error making 2469// the request the iterator does not advance and the error is returned. 2470func (iter *DiskListIterator) NextWithContext(ctx context.Context) (err error) { 2471 if tracing.IsEnabled() { 2472 ctx = tracing.StartSpan(ctx, fqdn+"/DiskListIterator.NextWithContext") 2473 defer func() { 2474 sc := -1 2475 if iter.Response().Response.Response != nil { 2476 sc = iter.Response().Response.Response.StatusCode 2477 } 2478 tracing.EndSpan(ctx, sc, err) 2479 }() 2480 } 2481 iter.i++ 2482 if iter.i < len(iter.page.Values()) { 2483 return nil 2484 } 2485 err = iter.page.NextWithContext(ctx) 2486 if err != nil { 2487 iter.i-- 2488 return err 2489 } 2490 iter.i = 0 2491 return nil 2492} 2493 2494// Next advances to the next value. If there was an error making 2495// the request the iterator does not advance and the error is returned. 2496// Deprecated: Use NextWithContext() instead. 2497func (iter *DiskListIterator) Next() error { 2498 return iter.NextWithContext(context.Background()) 2499} 2500 2501// NotDone returns true if the enumeration should be started or is not yet complete. 2502func (iter DiskListIterator) NotDone() bool { 2503 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2504} 2505 2506// Response returns the raw server response from the last page request. 2507func (iter DiskListIterator) Response() DiskList { 2508 return iter.page.Response() 2509} 2510 2511// Value returns the current value or a zero-initialized value if the 2512// iterator has advanced beyond the end of the collection. 2513func (iter DiskListIterator) Value() Disk { 2514 if !iter.page.NotDone() { 2515 return Disk{} 2516 } 2517 return iter.page.Values()[iter.i] 2518} 2519 2520// Creates a new instance of the DiskListIterator type. 2521func NewDiskListIterator(page DiskListPage) DiskListIterator { 2522 return DiskListIterator{page: page} 2523} 2524 2525// IsEmpty returns true if the ListResult contains no values. 2526func (dl DiskList) IsEmpty() bool { 2527 return dl.Value == nil || len(*dl.Value) == 0 2528} 2529 2530// hasNextLink returns true if the NextLink is not empty. 2531func (dl DiskList) hasNextLink() bool { 2532 return dl.NextLink != nil && len(*dl.NextLink) != 0 2533} 2534 2535// diskListPreparer prepares a request to retrieve the next set of results. 2536// It returns nil if no more results exist. 2537func (dl DiskList) diskListPreparer(ctx context.Context) (*http.Request, error) { 2538 if !dl.hasNextLink() { 2539 return nil, nil 2540 } 2541 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2542 autorest.AsJSON(), 2543 autorest.AsGet(), 2544 autorest.WithBaseURL(to.String(dl.NextLink))) 2545} 2546 2547// DiskListPage contains a page of Disk values. 2548type DiskListPage struct { 2549 fn func(context.Context, DiskList) (DiskList, error) 2550 dl DiskList 2551} 2552 2553// NextWithContext advances to the next page of values. If there was an error making 2554// the request the page does not advance and the error is returned. 2555func (page *DiskListPage) NextWithContext(ctx context.Context) (err error) { 2556 if tracing.IsEnabled() { 2557 ctx = tracing.StartSpan(ctx, fqdn+"/DiskListPage.NextWithContext") 2558 defer func() { 2559 sc := -1 2560 if page.Response().Response.Response != nil { 2561 sc = page.Response().Response.Response.StatusCode 2562 } 2563 tracing.EndSpan(ctx, sc, err) 2564 }() 2565 } 2566 for { 2567 next, err := page.fn(ctx, page.dl) 2568 if err != nil { 2569 return err 2570 } 2571 page.dl = next 2572 if !next.hasNextLink() || !next.IsEmpty() { 2573 break 2574 } 2575 } 2576 return nil 2577} 2578 2579// Next advances to the next page of values. If there was an error making 2580// the request the page does not advance and the error is returned. 2581// Deprecated: Use NextWithContext() instead. 2582func (page *DiskListPage) Next() error { 2583 return page.NextWithContext(context.Background()) 2584} 2585 2586// NotDone returns true if the page enumeration should be started or is not yet complete. 2587func (page DiskListPage) NotDone() bool { 2588 return !page.dl.IsEmpty() 2589} 2590 2591// Response returns the raw server response from the last page request. 2592func (page DiskListPage) Response() DiskList { 2593 return page.dl 2594} 2595 2596// Values returns the slice of values for the current page or nil if there are no values. 2597func (page DiskListPage) Values() []Disk { 2598 if page.dl.IsEmpty() { 2599 return nil 2600 } 2601 return *page.dl.Value 2602} 2603 2604// Creates a new instance of the DiskListPage type. 2605func NewDiskListPage(cur DiskList, getNextPage func(context.Context, DiskList) (DiskList, error)) DiskListPage { 2606 return DiskListPage{ 2607 fn: getNextPage, 2608 dl: cur, 2609 } 2610} 2611 2612// DiskProperties disk resource properties. 2613type DiskProperties struct { 2614 // TimeCreated - READ-ONLY; The time when the disk was created. 2615 TimeCreated *date.Time `json:"timeCreated,omitempty"` 2616 // OsType - The Operating System type. Possible values include: 'Windows', 'Linux' 2617 OsType OperatingSystemTypes `json:"osType,omitempty"` 2618 // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'V1', 'V2' 2619 HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` 2620 // CreationData - Disk source information. CreationData information cannot be changed after the disk has been created. 2621 CreationData *CreationData `json:"creationData,omitempty"` 2622 // 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. 2623 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 2624 // DiskSizeBytes - READ-ONLY; The size of the disk in bytes. This field is read only. 2625 DiskSizeBytes *int64 `json:"diskSizeBytes,omitempty"` 2626 // UniqueID - READ-ONLY; Unique Guid identifying the resource. 2627 UniqueID *string `json:"uniqueId,omitempty"` 2628 // EncryptionSettingsCollection - Encryption settings collection used for Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. 2629 EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` 2630 // ProvisioningState - READ-ONLY; The disk provisioning state. 2631 ProvisioningState *string `json:"provisioningState,omitempty"` 2632 // DiskIOPSReadWrite - The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. 2633 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 2634 // 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. 2635 DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` 2636 // DiskIOPSReadOnly - The total number of IOPS that will be allowed across all VMs mounting the shared disk as ReadOnly. One operation can transfer between 4k and 256k bytes. 2637 DiskIOPSReadOnly *int64 `json:"diskIOPSReadOnly,omitempty"` 2638 // DiskMBpsReadOnly - The total throughput (MBps) that will be allowed across all VMs mounting the shared disk as ReadOnly. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. 2639 DiskMBpsReadOnly *int64 `json:"diskMBpsReadOnly,omitempty"` 2640 // DiskState - READ-ONLY; The state of the disk. Possible values include: 'Unattached', 'Attached', 'Reserved', 'ActiveSAS', 'ReadyToUpload', 'ActiveUpload' 2641 DiskState DiskState `json:"diskState,omitempty"` 2642 // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 2643 Encryption *Encryption `json:"encryption,omitempty"` 2644 // MaxShares - The maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a disk that can be mounted on multiple VMs at the same time. 2645 MaxShares *int32 `json:"maxShares,omitempty"` 2646 // ShareInfo - READ-ONLY; Details of the list of all VMs that have the disk attached. maxShares should be set to a value greater than one for disks to allow attaching them to multiple VMs. 2647 ShareInfo *[]ShareInfoElement `json:"shareInfo,omitempty"` 2648} 2649 2650// MarshalJSON is the custom marshaler for DiskProperties. 2651func (dp DiskProperties) MarshalJSON() ([]byte, error) { 2652 objectMap := make(map[string]interface{}) 2653 if dp.OsType != "" { 2654 objectMap["osType"] = dp.OsType 2655 } 2656 if dp.HyperVGeneration != "" { 2657 objectMap["hyperVGeneration"] = dp.HyperVGeneration 2658 } 2659 if dp.CreationData != nil { 2660 objectMap["creationData"] = dp.CreationData 2661 } 2662 if dp.DiskSizeGB != nil { 2663 objectMap["diskSizeGB"] = dp.DiskSizeGB 2664 } 2665 if dp.EncryptionSettingsCollection != nil { 2666 objectMap["encryptionSettingsCollection"] = dp.EncryptionSettingsCollection 2667 } 2668 if dp.DiskIOPSReadWrite != nil { 2669 objectMap["diskIOPSReadWrite"] = dp.DiskIOPSReadWrite 2670 } 2671 if dp.DiskMBpsReadWrite != nil { 2672 objectMap["diskMBpsReadWrite"] = dp.DiskMBpsReadWrite 2673 } 2674 if dp.DiskIOPSReadOnly != nil { 2675 objectMap["diskIOPSReadOnly"] = dp.DiskIOPSReadOnly 2676 } 2677 if dp.DiskMBpsReadOnly != nil { 2678 objectMap["diskMBpsReadOnly"] = dp.DiskMBpsReadOnly 2679 } 2680 if dp.Encryption != nil { 2681 objectMap["encryption"] = dp.Encryption 2682 } 2683 if dp.MaxShares != nil { 2684 objectMap["maxShares"] = dp.MaxShares 2685 } 2686 return json.Marshal(objectMap) 2687} 2688 2689// DisksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 2690// operation. 2691type DisksCreateOrUpdateFuture struct { 2692 azure.FutureAPI 2693 // Result returns the result of the asynchronous operation. 2694 // If the operation has not completed it will return an error. 2695 Result func(DisksClient) (Disk, error) 2696} 2697 2698// DisksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 2699type DisksDeleteFuture struct { 2700 azure.FutureAPI 2701 // Result returns the result of the asynchronous operation. 2702 // If the operation has not completed it will return an error. 2703 Result func(DisksClient) (autorest.Response, error) 2704} 2705 2706// DisksGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running 2707// operation. 2708type DisksGrantAccessFuture struct { 2709 azure.FutureAPI 2710 // Result returns the result of the asynchronous operation. 2711 // If the operation has not completed it will return an error. 2712 Result func(DisksClient) (AccessURI, error) 2713} 2714 2715// DiskSku the disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, or UltraSSD_LRS. 2716type DiskSku struct { 2717 // Name - The sku name. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS', 'UltraSSDLRS' 2718 Name DiskStorageAccountTypes `json:"name,omitempty"` 2719 // Tier - READ-ONLY; The sku tier. 2720 Tier *string `json:"tier,omitempty"` 2721} 2722 2723// MarshalJSON is the custom marshaler for DiskSku. 2724func (ds DiskSku) MarshalJSON() ([]byte, error) { 2725 objectMap := make(map[string]interface{}) 2726 if ds.Name != "" { 2727 objectMap["name"] = ds.Name 2728 } 2729 return json.Marshal(objectMap) 2730} 2731 2732// DisksRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running 2733// operation. 2734type DisksRevokeAccessFuture struct { 2735 azure.FutureAPI 2736 // Result returns the result of the asynchronous operation. 2737 // If the operation has not completed it will return an error. 2738 Result func(DisksClient) (autorest.Response, error) 2739} 2740 2741// DisksUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. 2742type DisksUpdateFuture struct { 2743 azure.FutureAPI 2744 // Result returns the result of the asynchronous operation. 2745 // If the operation has not completed it will return an error. 2746 Result func(DisksClient) (Disk, error) 2747} 2748 2749// DiskUpdate disk update resource. 2750type DiskUpdate struct { 2751 *DiskUpdateProperties `json:"properties,omitempty"` 2752 // Tags - Resource tags 2753 Tags map[string]*string `json:"tags"` 2754 Sku *DiskSku `json:"sku,omitempty"` 2755} 2756 2757// MarshalJSON is the custom marshaler for DiskUpdate. 2758func (du DiskUpdate) MarshalJSON() ([]byte, error) { 2759 objectMap := make(map[string]interface{}) 2760 if du.DiskUpdateProperties != nil { 2761 objectMap["properties"] = du.DiskUpdateProperties 2762 } 2763 if du.Tags != nil { 2764 objectMap["tags"] = du.Tags 2765 } 2766 if du.Sku != nil { 2767 objectMap["sku"] = du.Sku 2768 } 2769 return json.Marshal(objectMap) 2770} 2771 2772// UnmarshalJSON is the custom unmarshaler for DiskUpdate struct. 2773func (du *DiskUpdate) UnmarshalJSON(body []byte) error { 2774 var m map[string]*json.RawMessage 2775 err := json.Unmarshal(body, &m) 2776 if err != nil { 2777 return err 2778 } 2779 for k, v := range m { 2780 switch k { 2781 case "properties": 2782 if v != nil { 2783 var diskUpdateProperties DiskUpdateProperties 2784 err = json.Unmarshal(*v, &diskUpdateProperties) 2785 if err != nil { 2786 return err 2787 } 2788 du.DiskUpdateProperties = &diskUpdateProperties 2789 } 2790 case "tags": 2791 if v != nil { 2792 var tags map[string]*string 2793 err = json.Unmarshal(*v, &tags) 2794 if err != nil { 2795 return err 2796 } 2797 du.Tags = tags 2798 } 2799 case "sku": 2800 if v != nil { 2801 var sku DiskSku 2802 err = json.Unmarshal(*v, &sku) 2803 if err != nil { 2804 return err 2805 } 2806 du.Sku = &sku 2807 } 2808 } 2809 } 2810 2811 return nil 2812} 2813 2814// DiskUpdateProperties disk resource update properties. 2815type DiskUpdateProperties struct { 2816 // OsType - the Operating System type. Possible values include: 'Windows', 'Linux' 2817 OsType OperatingSystemTypes `json:"osType,omitempty"` 2818 // 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. 2819 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 2820 // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. 2821 EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` 2822 // DiskIOPSReadWrite - The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. 2823 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 2824 // 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. 2825 DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` 2826 // DiskIOPSReadOnly - The total number of IOPS that will be allowed across all VMs mounting the shared disk as ReadOnly. One operation can transfer between 4k and 256k bytes. 2827 DiskIOPSReadOnly *int64 `json:"diskIOPSReadOnly,omitempty"` 2828 // DiskMBpsReadOnly - The total throughput (MBps) that will be allowed across all VMs mounting the shared disk as ReadOnly. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. 2829 DiskMBpsReadOnly *int64 `json:"diskMBpsReadOnly,omitempty"` 2830 // MaxShares - The maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a disk that can be mounted on multiple VMs at the same time. 2831 MaxShares *int32 `json:"maxShares,omitempty"` 2832 // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 2833 Encryption *Encryption `json:"encryption,omitempty"` 2834} 2835 2836// Encryption encryption at rest settings for disk or snapshot 2837type Encryption struct { 2838 // DiskEncryptionSetID - ResourceId of the disk encryption set to use for enabling encryption at rest. 2839 DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` 2840 // Type - The type of key used to encrypt the data of the disk. Possible values include: 'EncryptionAtRestWithPlatformKey', 'EncryptionAtRestWithCustomerKey' 2841 Type EncryptionType `json:"type,omitempty"` 2842} 2843 2844// EncryptionImages optional. Allows users to provide customer managed keys for encrypting the OS and data 2845// disks in the gallery artifact. 2846type EncryptionImages struct { 2847 OsDiskImage *OSDiskImageEncryption `json:"osDiskImage,omitempty"` 2848 // DataDiskImages - A list of encryption specifications for data disk images. 2849 DataDiskImages *[]DataDiskImageEncryption `json:"dataDiskImages,omitempty"` 2850} 2851 2852// EncryptionSetIdentity the managed identity for the disk encryption set. It should be given permission on 2853// the key vault before it can be used to encrypt disks. 2854type EncryptionSetIdentity struct { 2855 // Type - The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is supported. Possible values include: 'SystemAssigned' 2856 Type DiskEncryptionSetIdentityType `json:"type,omitempty"` 2857 // 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 2858 PrincipalID *string `json:"principalId,omitempty"` 2859 // 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 2860 TenantID *string `json:"tenantId,omitempty"` 2861} 2862 2863// MarshalJSON is the custom marshaler for EncryptionSetIdentity. 2864func (esi EncryptionSetIdentity) MarshalJSON() ([]byte, error) { 2865 objectMap := make(map[string]interface{}) 2866 if esi.Type != "" { 2867 objectMap["type"] = esi.Type 2868 } 2869 return json.Marshal(objectMap) 2870} 2871 2872// EncryptionSetProperties ... 2873type EncryptionSetProperties struct { 2874 // ActiveKey - The key vault key which is currently used by this disk encryption set. 2875 ActiveKey *KeyVaultAndKeyReference `json:"activeKey,omitempty"` 2876 // 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. 2877 PreviousKeys *[]KeyVaultAndKeyReference `json:"previousKeys,omitempty"` 2878 // ProvisioningState - READ-ONLY; The disk encryption set provisioning state. 2879 ProvisioningState *string `json:"provisioningState,omitempty"` 2880} 2881 2882// MarshalJSON is the custom marshaler for EncryptionSetProperties. 2883func (esp EncryptionSetProperties) MarshalJSON() ([]byte, error) { 2884 objectMap := make(map[string]interface{}) 2885 if esp.ActiveKey != nil { 2886 objectMap["activeKey"] = esp.ActiveKey 2887 } 2888 return json.Marshal(objectMap) 2889} 2890 2891// EncryptionSettingsCollection encryption settings for disk or snapshot 2892type EncryptionSettingsCollection struct { 2893 // 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. 2894 Enabled *bool `json:"enabled,omitempty"` 2895 // EncryptionSettings - A collection of encryption settings, one for each disk volume. 2896 EncryptionSettings *[]EncryptionSettingsElement `json:"encryptionSettings,omitempty"` 2897 // 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. 2898 EncryptionSettingsVersion *string `json:"encryptionSettingsVersion,omitempty"` 2899} 2900 2901// EncryptionSettingsElement encryption settings for one disk volume. 2902type EncryptionSettingsElement struct { 2903 // DiskEncryptionKey - Key Vault Secret Url and vault id of the disk encryption key 2904 DiskEncryptionKey *KeyVaultAndSecretReference `json:"diskEncryptionKey,omitempty"` 2905 // 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. 2906 KeyEncryptionKey *KeyVaultAndKeyReference `json:"keyEncryptionKey,omitempty"` 2907} 2908 2909// GalleriesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 2910// operation. 2911type GalleriesCreateOrUpdateFuture struct { 2912 azure.FutureAPI 2913 // Result returns the result of the asynchronous operation. 2914 // If the operation has not completed it will return an error. 2915 Result func(GalleriesClient) (Gallery, error) 2916} 2917 2918// GalleriesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 2919// operation. 2920type GalleriesDeleteFuture struct { 2921 azure.FutureAPI 2922 // Result returns the result of the asynchronous operation. 2923 // If the operation has not completed it will return an error. 2924 Result func(GalleriesClient) (autorest.Response, error) 2925} 2926 2927// GalleriesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 2928// operation. 2929type GalleriesUpdateFuture struct { 2930 azure.FutureAPI 2931 // Result returns the result of the asynchronous operation. 2932 // If the operation has not completed it will return an error. 2933 Result func(GalleriesClient) (Gallery, error) 2934} 2935 2936// Gallery specifies information about the Shared Image Gallery that you want to create or update. 2937type Gallery struct { 2938 autorest.Response `json:"-"` 2939 *GalleryProperties `json:"properties,omitempty"` 2940 // ID - READ-ONLY; Resource Id 2941 ID *string `json:"id,omitempty"` 2942 // Name - READ-ONLY; Resource name 2943 Name *string `json:"name,omitempty"` 2944 // Type - READ-ONLY; Resource type 2945 Type *string `json:"type,omitempty"` 2946 // Location - Resource location 2947 Location *string `json:"location,omitempty"` 2948 // Tags - Resource tags 2949 Tags map[string]*string `json:"tags"` 2950} 2951 2952// MarshalJSON is the custom marshaler for Gallery. 2953func (g Gallery) MarshalJSON() ([]byte, error) { 2954 objectMap := make(map[string]interface{}) 2955 if g.GalleryProperties != nil { 2956 objectMap["properties"] = g.GalleryProperties 2957 } 2958 if g.Location != nil { 2959 objectMap["location"] = g.Location 2960 } 2961 if g.Tags != nil { 2962 objectMap["tags"] = g.Tags 2963 } 2964 return json.Marshal(objectMap) 2965} 2966 2967// UnmarshalJSON is the custom unmarshaler for Gallery struct. 2968func (g *Gallery) UnmarshalJSON(body []byte) error { 2969 var m map[string]*json.RawMessage 2970 err := json.Unmarshal(body, &m) 2971 if err != nil { 2972 return err 2973 } 2974 for k, v := range m { 2975 switch k { 2976 case "properties": 2977 if v != nil { 2978 var galleryProperties GalleryProperties 2979 err = json.Unmarshal(*v, &galleryProperties) 2980 if err != nil { 2981 return err 2982 } 2983 g.GalleryProperties = &galleryProperties 2984 } 2985 case "id": 2986 if v != nil { 2987 var ID string 2988 err = json.Unmarshal(*v, &ID) 2989 if err != nil { 2990 return err 2991 } 2992 g.ID = &ID 2993 } 2994 case "name": 2995 if v != nil { 2996 var name string 2997 err = json.Unmarshal(*v, &name) 2998 if err != nil { 2999 return err 3000 } 3001 g.Name = &name 3002 } 3003 case "type": 3004 if v != nil { 3005 var typeVar string 3006 err = json.Unmarshal(*v, &typeVar) 3007 if err != nil { 3008 return err 3009 } 3010 g.Type = &typeVar 3011 } 3012 case "location": 3013 if v != nil { 3014 var location string 3015 err = json.Unmarshal(*v, &location) 3016 if err != nil { 3017 return err 3018 } 3019 g.Location = &location 3020 } 3021 case "tags": 3022 if v != nil { 3023 var tags map[string]*string 3024 err = json.Unmarshal(*v, &tags) 3025 if err != nil { 3026 return err 3027 } 3028 g.Tags = tags 3029 } 3030 } 3031 } 3032 3033 return nil 3034} 3035 3036// GalleryApplication specifies information about the gallery Application Definition that you want to 3037// create or update. 3038type GalleryApplication struct { 3039 autorest.Response `json:"-"` 3040 *GalleryApplicationProperties `json:"properties,omitempty"` 3041 // ID - READ-ONLY; Resource Id 3042 ID *string `json:"id,omitempty"` 3043 // Name - READ-ONLY; Resource name 3044 Name *string `json:"name,omitempty"` 3045 // Type - READ-ONLY; Resource type 3046 Type *string `json:"type,omitempty"` 3047 // Location - Resource location 3048 Location *string `json:"location,omitempty"` 3049 // Tags - Resource tags 3050 Tags map[string]*string `json:"tags"` 3051} 3052 3053// MarshalJSON is the custom marshaler for GalleryApplication. 3054func (ga GalleryApplication) MarshalJSON() ([]byte, error) { 3055 objectMap := make(map[string]interface{}) 3056 if ga.GalleryApplicationProperties != nil { 3057 objectMap["properties"] = ga.GalleryApplicationProperties 3058 } 3059 if ga.Location != nil { 3060 objectMap["location"] = ga.Location 3061 } 3062 if ga.Tags != nil { 3063 objectMap["tags"] = ga.Tags 3064 } 3065 return json.Marshal(objectMap) 3066} 3067 3068// UnmarshalJSON is the custom unmarshaler for GalleryApplication struct. 3069func (ga *GalleryApplication) UnmarshalJSON(body []byte) error { 3070 var m map[string]*json.RawMessage 3071 err := json.Unmarshal(body, &m) 3072 if err != nil { 3073 return err 3074 } 3075 for k, v := range m { 3076 switch k { 3077 case "properties": 3078 if v != nil { 3079 var galleryApplicationProperties GalleryApplicationProperties 3080 err = json.Unmarshal(*v, &galleryApplicationProperties) 3081 if err != nil { 3082 return err 3083 } 3084 ga.GalleryApplicationProperties = &galleryApplicationProperties 3085 } 3086 case "id": 3087 if v != nil { 3088 var ID string 3089 err = json.Unmarshal(*v, &ID) 3090 if err != nil { 3091 return err 3092 } 3093 ga.ID = &ID 3094 } 3095 case "name": 3096 if v != nil { 3097 var name string 3098 err = json.Unmarshal(*v, &name) 3099 if err != nil { 3100 return err 3101 } 3102 ga.Name = &name 3103 } 3104 case "type": 3105 if v != nil { 3106 var typeVar string 3107 err = json.Unmarshal(*v, &typeVar) 3108 if err != nil { 3109 return err 3110 } 3111 ga.Type = &typeVar 3112 } 3113 case "location": 3114 if v != nil { 3115 var location string 3116 err = json.Unmarshal(*v, &location) 3117 if err != nil { 3118 return err 3119 } 3120 ga.Location = &location 3121 } 3122 case "tags": 3123 if v != nil { 3124 var tags map[string]*string 3125 err = json.Unmarshal(*v, &tags) 3126 if err != nil { 3127 return err 3128 } 3129 ga.Tags = tags 3130 } 3131 } 3132 } 3133 3134 return nil 3135} 3136 3137// GalleryApplicationList the List Gallery Applications operation response. 3138type GalleryApplicationList struct { 3139 autorest.Response `json:"-"` 3140 // Value - A list of Gallery Applications. 3141 Value *[]GalleryApplication `json:"value,omitempty"` 3142 // 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. 3143 NextLink *string `json:"nextLink,omitempty"` 3144} 3145 3146// GalleryApplicationListIterator provides access to a complete listing of GalleryApplication values. 3147type GalleryApplicationListIterator struct { 3148 i int 3149 page GalleryApplicationListPage 3150} 3151 3152// NextWithContext advances to the next value. If there was an error making 3153// the request the iterator does not advance and the error is returned. 3154func (iter *GalleryApplicationListIterator) NextWithContext(ctx context.Context) (err error) { 3155 if tracing.IsEnabled() { 3156 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationListIterator.NextWithContext") 3157 defer func() { 3158 sc := -1 3159 if iter.Response().Response.Response != nil { 3160 sc = iter.Response().Response.Response.StatusCode 3161 } 3162 tracing.EndSpan(ctx, sc, err) 3163 }() 3164 } 3165 iter.i++ 3166 if iter.i < len(iter.page.Values()) { 3167 return nil 3168 } 3169 err = iter.page.NextWithContext(ctx) 3170 if err != nil { 3171 iter.i-- 3172 return err 3173 } 3174 iter.i = 0 3175 return nil 3176} 3177 3178// Next advances to the next value. If there was an error making 3179// the request the iterator does not advance and the error is returned. 3180// Deprecated: Use NextWithContext() instead. 3181func (iter *GalleryApplicationListIterator) Next() error { 3182 return iter.NextWithContext(context.Background()) 3183} 3184 3185// NotDone returns true if the enumeration should be started or is not yet complete. 3186func (iter GalleryApplicationListIterator) NotDone() bool { 3187 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3188} 3189 3190// Response returns the raw server response from the last page request. 3191func (iter GalleryApplicationListIterator) Response() GalleryApplicationList { 3192 return iter.page.Response() 3193} 3194 3195// Value returns the current value or a zero-initialized value if the 3196// iterator has advanced beyond the end of the collection. 3197func (iter GalleryApplicationListIterator) Value() GalleryApplication { 3198 if !iter.page.NotDone() { 3199 return GalleryApplication{} 3200 } 3201 return iter.page.Values()[iter.i] 3202} 3203 3204// Creates a new instance of the GalleryApplicationListIterator type. 3205func NewGalleryApplicationListIterator(page GalleryApplicationListPage) GalleryApplicationListIterator { 3206 return GalleryApplicationListIterator{page: page} 3207} 3208 3209// IsEmpty returns true if the ListResult contains no values. 3210func (gal GalleryApplicationList) IsEmpty() bool { 3211 return gal.Value == nil || len(*gal.Value) == 0 3212} 3213 3214// hasNextLink returns true if the NextLink is not empty. 3215func (gal GalleryApplicationList) hasNextLink() bool { 3216 return gal.NextLink != nil && len(*gal.NextLink) != 0 3217} 3218 3219// galleryApplicationListPreparer prepares a request to retrieve the next set of results. 3220// It returns nil if no more results exist. 3221func (gal GalleryApplicationList) galleryApplicationListPreparer(ctx context.Context) (*http.Request, error) { 3222 if !gal.hasNextLink() { 3223 return nil, nil 3224 } 3225 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3226 autorest.AsJSON(), 3227 autorest.AsGet(), 3228 autorest.WithBaseURL(to.String(gal.NextLink))) 3229} 3230 3231// GalleryApplicationListPage contains a page of GalleryApplication values. 3232type GalleryApplicationListPage struct { 3233 fn func(context.Context, GalleryApplicationList) (GalleryApplicationList, error) 3234 gal GalleryApplicationList 3235} 3236 3237// NextWithContext advances to the next page of values. If there was an error making 3238// the request the page does not advance and the error is returned. 3239func (page *GalleryApplicationListPage) NextWithContext(ctx context.Context) (err error) { 3240 if tracing.IsEnabled() { 3241 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationListPage.NextWithContext") 3242 defer func() { 3243 sc := -1 3244 if page.Response().Response.Response != nil { 3245 sc = page.Response().Response.Response.StatusCode 3246 } 3247 tracing.EndSpan(ctx, sc, err) 3248 }() 3249 } 3250 for { 3251 next, err := page.fn(ctx, page.gal) 3252 if err != nil { 3253 return err 3254 } 3255 page.gal = next 3256 if !next.hasNextLink() || !next.IsEmpty() { 3257 break 3258 } 3259 } 3260 return nil 3261} 3262 3263// Next advances to the next page of values. If there was an error making 3264// the request the page does not advance and the error is returned. 3265// Deprecated: Use NextWithContext() instead. 3266func (page *GalleryApplicationListPage) Next() error { 3267 return page.NextWithContext(context.Background()) 3268} 3269 3270// NotDone returns true if the page enumeration should be started or is not yet complete. 3271func (page GalleryApplicationListPage) NotDone() bool { 3272 return !page.gal.IsEmpty() 3273} 3274 3275// Response returns the raw server response from the last page request. 3276func (page GalleryApplicationListPage) Response() GalleryApplicationList { 3277 return page.gal 3278} 3279 3280// Values returns the slice of values for the current page or nil if there are no values. 3281func (page GalleryApplicationListPage) Values() []GalleryApplication { 3282 if page.gal.IsEmpty() { 3283 return nil 3284 } 3285 return *page.gal.Value 3286} 3287 3288// Creates a new instance of the GalleryApplicationListPage type. 3289func NewGalleryApplicationListPage(cur GalleryApplicationList, getNextPage func(context.Context, GalleryApplicationList) (GalleryApplicationList, error)) GalleryApplicationListPage { 3290 return GalleryApplicationListPage{ 3291 fn: getNextPage, 3292 gal: cur, 3293 } 3294} 3295 3296// GalleryApplicationProperties describes the properties of a gallery Application Definition. 3297type GalleryApplicationProperties struct { 3298 // Description - The description of this gallery Application Definition resource. This property is updatable. 3299 Description *string `json:"description,omitempty"` 3300 // Eula - The Eula agreement for the gallery Application Definition. 3301 Eula *string `json:"eula,omitempty"` 3302 // PrivacyStatementURI - The privacy statement uri. 3303 PrivacyStatementURI *string `json:"privacyStatementUri,omitempty"` 3304 // ReleaseNoteURI - The release note uri. 3305 ReleaseNoteURI *string `json:"releaseNoteUri,omitempty"` 3306 // EndOfLifeDate - The end of life date of the gallery Application Definition. This property can be used for decommissioning purposes. This property is updatable. 3307 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 3308 // 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' 3309 SupportedOSType OperatingSystemTypes `json:"supportedOSType,omitempty"` 3310} 3311 3312// GalleryApplicationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 3313// long-running operation. 3314type GalleryApplicationsCreateOrUpdateFuture struct { 3315 azure.FutureAPI 3316 // Result returns the result of the asynchronous operation. 3317 // If the operation has not completed it will return an error. 3318 Result func(GalleryApplicationsClient) (GalleryApplication, error) 3319} 3320 3321// GalleryApplicationsDeleteFuture an abstraction for monitoring and retrieving the results of a 3322// long-running operation. 3323type GalleryApplicationsDeleteFuture struct { 3324 azure.FutureAPI 3325 // Result returns the result of the asynchronous operation. 3326 // If the operation has not completed it will return an error. 3327 Result func(GalleryApplicationsClient) (autorest.Response, error) 3328} 3329 3330// GalleryApplicationsUpdateFuture an abstraction for monitoring and retrieving the results of a 3331// long-running operation. 3332type GalleryApplicationsUpdateFuture struct { 3333 azure.FutureAPI 3334 // Result returns the result of the asynchronous operation. 3335 // If the operation has not completed it will return an error. 3336 Result func(GalleryApplicationsClient) (GalleryApplication, error) 3337} 3338 3339// GalleryApplicationUpdate specifies information about the gallery Application Definition that you want to 3340// update. 3341type GalleryApplicationUpdate struct { 3342 *GalleryApplicationProperties `json:"properties,omitempty"` 3343 // ID - READ-ONLY; Resource Id 3344 ID *string `json:"id,omitempty"` 3345 // Name - READ-ONLY; Resource name 3346 Name *string `json:"name,omitempty"` 3347 // Type - READ-ONLY; Resource type 3348 Type *string `json:"type,omitempty"` 3349 // Tags - Resource tags 3350 Tags map[string]*string `json:"tags"` 3351} 3352 3353// MarshalJSON is the custom marshaler for GalleryApplicationUpdate. 3354func (gau GalleryApplicationUpdate) MarshalJSON() ([]byte, error) { 3355 objectMap := make(map[string]interface{}) 3356 if gau.GalleryApplicationProperties != nil { 3357 objectMap["properties"] = gau.GalleryApplicationProperties 3358 } 3359 if gau.Tags != nil { 3360 objectMap["tags"] = gau.Tags 3361 } 3362 return json.Marshal(objectMap) 3363} 3364 3365// UnmarshalJSON is the custom unmarshaler for GalleryApplicationUpdate struct. 3366func (gau *GalleryApplicationUpdate) UnmarshalJSON(body []byte) error { 3367 var m map[string]*json.RawMessage 3368 err := json.Unmarshal(body, &m) 3369 if err != nil { 3370 return err 3371 } 3372 for k, v := range m { 3373 switch k { 3374 case "properties": 3375 if v != nil { 3376 var galleryApplicationProperties GalleryApplicationProperties 3377 err = json.Unmarshal(*v, &galleryApplicationProperties) 3378 if err != nil { 3379 return err 3380 } 3381 gau.GalleryApplicationProperties = &galleryApplicationProperties 3382 } 3383 case "id": 3384 if v != nil { 3385 var ID string 3386 err = json.Unmarshal(*v, &ID) 3387 if err != nil { 3388 return err 3389 } 3390 gau.ID = &ID 3391 } 3392 case "name": 3393 if v != nil { 3394 var name string 3395 err = json.Unmarshal(*v, &name) 3396 if err != nil { 3397 return err 3398 } 3399 gau.Name = &name 3400 } 3401 case "type": 3402 if v != nil { 3403 var typeVar string 3404 err = json.Unmarshal(*v, &typeVar) 3405 if err != nil { 3406 return err 3407 } 3408 gau.Type = &typeVar 3409 } 3410 case "tags": 3411 if v != nil { 3412 var tags map[string]*string 3413 err = json.Unmarshal(*v, &tags) 3414 if err != nil { 3415 return err 3416 } 3417 gau.Tags = tags 3418 } 3419 } 3420 } 3421 3422 return nil 3423} 3424 3425// GalleryApplicationVersion specifies information about the gallery Application Version that you want to 3426// create or update. 3427type GalleryApplicationVersion struct { 3428 autorest.Response `json:"-"` 3429 *GalleryApplicationVersionProperties `json:"properties,omitempty"` 3430 // ID - READ-ONLY; Resource Id 3431 ID *string `json:"id,omitempty"` 3432 // Name - READ-ONLY; Resource name 3433 Name *string `json:"name,omitempty"` 3434 // Type - READ-ONLY; Resource type 3435 Type *string `json:"type,omitempty"` 3436 // Location - Resource location 3437 Location *string `json:"location,omitempty"` 3438 // Tags - Resource tags 3439 Tags map[string]*string `json:"tags"` 3440} 3441 3442// MarshalJSON is the custom marshaler for GalleryApplicationVersion. 3443func (gav GalleryApplicationVersion) MarshalJSON() ([]byte, error) { 3444 objectMap := make(map[string]interface{}) 3445 if gav.GalleryApplicationVersionProperties != nil { 3446 objectMap["properties"] = gav.GalleryApplicationVersionProperties 3447 } 3448 if gav.Location != nil { 3449 objectMap["location"] = gav.Location 3450 } 3451 if gav.Tags != nil { 3452 objectMap["tags"] = gav.Tags 3453 } 3454 return json.Marshal(objectMap) 3455} 3456 3457// UnmarshalJSON is the custom unmarshaler for GalleryApplicationVersion struct. 3458func (gav *GalleryApplicationVersion) UnmarshalJSON(body []byte) error { 3459 var m map[string]*json.RawMessage 3460 err := json.Unmarshal(body, &m) 3461 if err != nil { 3462 return err 3463 } 3464 for k, v := range m { 3465 switch k { 3466 case "properties": 3467 if v != nil { 3468 var galleryApplicationVersionProperties GalleryApplicationVersionProperties 3469 err = json.Unmarshal(*v, &galleryApplicationVersionProperties) 3470 if err != nil { 3471 return err 3472 } 3473 gav.GalleryApplicationVersionProperties = &galleryApplicationVersionProperties 3474 } 3475 case "id": 3476 if v != nil { 3477 var ID string 3478 err = json.Unmarshal(*v, &ID) 3479 if err != nil { 3480 return err 3481 } 3482 gav.ID = &ID 3483 } 3484 case "name": 3485 if v != nil { 3486 var name string 3487 err = json.Unmarshal(*v, &name) 3488 if err != nil { 3489 return err 3490 } 3491 gav.Name = &name 3492 } 3493 case "type": 3494 if v != nil { 3495 var typeVar string 3496 err = json.Unmarshal(*v, &typeVar) 3497 if err != nil { 3498 return err 3499 } 3500 gav.Type = &typeVar 3501 } 3502 case "location": 3503 if v != nil { 3504 var location string 3505 err = json.Unmarshal(*v, &location) 3506 if err != nil { 3507 return err 3508 } 3509 gav.Location = &location 3510 } 3511 case "tags": 3512 if v != nil { 3513 var tags map[string]*string 3514 err = json.Unmarshal(*v, &tags) 3515 if err != nil { 3516 return err 3517 } 3518 gav.Tags = tags 3519 } 3520 } 3521 } 3522 3523 return nil 3524} 3525 3526// GalleryApplicationVersionList the List Gallery Application version operation response. 3527type GalleryApplicationVersionList struct { 3528 autorest.Response `json:"-"` 3529 // Value - A list of gallery Application Versions. 3530 Value *[]GalleryApplicationVersion `json:"value,omitempty"` 3531 // 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. 3532 NextLink *string `json:"nextLink,omitempty"` 3533} 3534 3535// GalleryApplicationVersionListIterator provides access to a complete listing of GalleryApplicationVersion 3536// values. 3537type GalleryApplicationVersionListIterator struct { 3538 i int 3539 page GalleryApplicationVersionListPage 3540} 3541 3542// NextWithContext advances to the next value. If there was an error making 3543// the request the iterator does not advance and the error is returned. 3544func (iter *GalleryApplicationVersionListIterator) NextWithContext(ctx context.Context) (err error) { 3545 if tracing.IsEnabled() { 3546 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionListIterator.NextWithContext") 3547 defer func() { 3548 sc := -1 3549 if iter.Response().Response.Response != nil { 3550 sc = iter.Response().Response.Response.StatusCode 3551 } 3552 tracing.EndSpan(ctx, sc, err) 3553 }() 3554 } 3555 iter.i++ 3556 if iter.i < len(iter.page.Values()) { 3557 return nil 3558 } 3559 err = iter.page.NextWithContext(ctx) 3560 if err != nil { 3561 iter.i-- 3562 return err 3563 } 3564 iter.i = 0 3565 return nil 3566} 3567 3568// Next advances to the next value. If there was an error making 3569// the request the iterator does not advance and the error is returned. 3570// Deprecated: Use NextWithContext() instead. 3571func (iter *GalleryApplicationVersionListIterator) Next() error { 3572 return iter.NextWithContext(context.Background()) 3573} 3574 3575// NotDone returns true if the enumeration should be started or is not yet complete. 3576func (iter GalleryApplicationVersionListIterator) NotDone() bool { 3577 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3578} 3579 3580// Response returns the raw server response from the last page request. 3581func (iter GalleryApplicationVersionListIterator) Response() GalleryApplicationVersionList { 3582 return iter.page.Response() 3583} 3584 3585// Value returns the current value or a zero-initialized value if the 3586// iterator has advanced beyond the end of the collection. 3587func (iter GalleryApplicationVersionListIterator) Value() GalleryApplicationVersion { 3588 if !iter.page.NotDone() { 3589 return GalleryApplicationVersion{} 3590 } 3591 return iter.page.Values()[iter.i] 3592} 3593 3594// Creates a new instance of the GalleryApplicationVersionListIterator type. 3595func NewGalleryApplicationVersionListIterator(page GalleryApplicationVersionListPage) GalleryApplicationVersionListIterator { 3596 return GalleryApplicationVersionListIterator{page: page} 3597} 3598 3599// IsEmpty returns true if the ListResult contains no values. 3600func (gavl GalleryApplicationVersionList) IsEmpty() bool { 3601 return gavl.Value == nil || len(*gavl.Value) == 0 3602} 3603 3604// hasNextLink returns true if the NextLink is not empty. 3605func (gavl GalleryApplicationVersionList) hasNextLink() bool { 3606 return gavl.NextLink != nil && len(*gavl.NextLink) != 0 3607} 3608 3609// galleryApplicationVersionListPreparer prepares a request to retrieve the next set of results. 3610// It returns nil if no more results exist. 3611func (gavl GalleryApplicationVersionList) galleryApplicationVersionListPreparer(ctx context.Context) (*http.Request, error) { 3612 if !gavl.hasNextLink() { 3613 return nil, nil 3614 } 3615 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3616 autorest.AsJSON(), 3617 autorest.AsGet(), 3618 autorest.WithBaseURL(to.String(gavl.NextLink))) 3619} 3620 3621// GalleryApplicationVersionListPage contains a page of GalleryApplicationVersion values. 3622type GalleryApplicationVersionListPage struct { 3623 fn func(context.Context, GalleryApplicationVersionList) (GalleryApplicationVersionList, error) 3624 gavl GalleryApplicationVersionList 3625} 3626 3627// NextWithContext advances to the next page of values. If there was an error making 3628// the request the page does not advance and the error is returned. 3629func (page *GalleryApplicationVersionListPage) NextWithContext(ctx context.Context) (err error) { 3630 if tracing.IsEnabled() { 3631 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionListPage.NextWithContext") 3632 defer func() { 3633 sc := -1 3634 if page.Response().Response.Response != nil { 3635 sc = page.Response().Response.Response.StatusCode 3636 } 3637 tracing.EndSpan(ctx, sc, err) 3638 }() 3639 } 3640 for { 3641 next, err := page.fn(ctx, page.gavl) 3642 if err != nil { 3643 return err 3644 } 3645 page.gavl = next 3646 if !next.hasNextLink() || !next.IsEmpty() { 3647 break 3648 } 3649 } 3650 return nil 3651} 3652 3653// Next advances to the next page of values. If there was an error making 3654// the request the page does not advance and the error is returned. 3655// Deprecated: Use NextWithContext() instead. 3656func (page *GalleryApplicationVersionListPage) Next() error { 3657 return page.NextWithContext(context.Background()) 3658} 3659 3660// NotDone returns true if the page enumeration should be started or is not yet complete. 3661func (page GalleryApplicationVersionListPage) NotDone() bool { 3662 return !page.gavl.IsEmpty() 3663} 3664 3665// Response returns the raw server response from the last page request. 3666func (page GalleryApplicationVersionListPage) Response() GalleryApplicationVersionList { 3667 return page.gavl 3668} 3669 3670// Values returns the slice of values for the current page or nil if there are no values. 3671func (page GalleryApplicationVersionListPage) Values() []GalleryApplicationVersion { 3672 if page.gavl.IsEmpty() { 3673 return nil 3674 } 3675 return *page.gavl.Value 3676} 3677 3678// Creates a new instance of the GalleryApplicationVersionListPage type. 3679func NewGalleryApplicationVersionListPage(cur GalleryApplicationVersionList, getNextPage func(context.Context, GalleryApplicationVersionList) (GalleryApplicationVersionList, error)) GalleryApplicationVersionListPage { 3680 return GalleryApplicationVersionListPage{ 3681 fn: getNextPage, 3682 gavl: cur, 3683 } 3684} 3685 3686// GalleryApplicationVersionProperties describes the properties of a gallery Image Version. 3687type GalleryApplicationVersionProperties struct { 3688 PublishingProfile *GalleryApplicationVersionPublishingProfile `json:"publishingProfile,omitempty"` 3689 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningState1Creating', 'ProvisioningState1Updating', 'ProvisioningState1Failed', 'ProvisioningState1Succeeded', 'ProvisioningState1Deleting', 'ProvisioningState1Migrating' 3690 ProvisioningState ProvisioningState1 `json:"provisioningState,omitempty"` 3691 // ReplicationStatus - READ-ONLY 3692 ReplicationStatus *ReplicationStatus `json:"replicationStatus,omitempty"` 3693} 3694 3695// MarshalJSON is the custom marshaler for GalleryApplicationVersionProperties. 3696func (gavp GalleryApplicationVersionProperties) MarshalJSON() ([]byte, error) { 3697 objectMap := make(map[string]interface{}) 3698 if gavp.PublishingProfile != nil { 3699 objectMap["publishingProfile"] = gavp.PublishingProfile 3700 } 3701 return json.Marshal(objectMap) 3702} 3703 3704// GalleryApplicationVersionPublishingProfile the publishing profile of a gallery Image Version. 3705type GalleryApplicationVersionPublishingProfile struct { 3706 Source *UserArtifactSource `json:"source,omitempty"` 3707 // ContentType - Optional. May be used to help process this file. The type of file contained in the source, e.g. zip, json, etc. 3708 ContentType *string `json:"contentType,omitempty"` 3709 // EnableHealthCheck - Optional. Whether or not this application reports health. 3710 EnableHealthCheck *bool `json:"enableHealthCheck,omitempty"` 3711 // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. 3712 TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` 3713 // 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. 3714 ReplicaCount *int32 `json:"replicaCount,omitempty"` 3715 // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. 3716 ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` 3717 // PublishedDate - READ-ONLY; The timestamp for when the gallery Image Version is published. 3718 PublishedDate *date.Time `json:"publishedDate,omitempty"` 3719 // EndOfLifeDate - The end of life date of the gallery Image Version. This property can be used for decommissioning purposes. This property is updatable. 3720 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 3721 // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' 3722 StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` 3723} 3724 3725// MarshalJSON is the custom marshaler for GalleryApplicationVersionPublishingProfile. 3726func (gavpp GalleryApplicationVersionPublishingProfile) MarshalJSON() ([]byte, error) { 3727 objectMap := make(map[string]interface{}) 3728 if gavpp.Source != nil { 3729 objectMap["source"] = gavpp.Source 3730 } 3731 if gavpp.ContentType != nil { 3732 objectMap["contentType"] = gavpp.ContentType 3733 } 3734 if gavpp.EnableHealthCheck != nil { 3735 objectMap["enableHealthCheck"] = gavpp.EnableHealthCheck 3736 } 3737 if gavpp.TargetRegions != nil { 3738 objectMap["targetRegions"] = gavpp.TargetRegions 3739 } 3740 if gavpp.ReplicaCount != nil { 3741 objectMap["replicaCount"] = gavpp.ReplicaCount 3742 } 3743 if gavpp.ExcludeFromLatest != nil { 3744 objectMap["excludeFromLatest"] = gavpp.ExcludeFromLatest 3745 } 3746 if gavpp.EndOfLifeDate != nil { 3747 objectMap["endOfLifeDate"] = gavpp.EndOfLifeDate 3748 } 3749 if gavpp.StorageAccountType != "" { 3750 objectMap["storageAccountType"] = gavpp.StorageAccountType 3751 } 3752 return json.Marshal(objectMap) 3753} 3754 3755// GalleryApplicationVersionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results 3756// of a long-running operation. 3757type GalleryApplicationVersionsCreateOrUpdateFuture struct { 3758 azure.FutureAPI 3759 // Result returns the result of the asynchronous operation. 3760 // If the operation has not completed it will return an error. 3761 Result func(GalleryApplicationVersionsClient) (GalleryApplicationVersion, error) 3762} 3763 3764// GalleryApplicationVersionsDeleteFuture an abstraction for monitoring and retrieving the results of a 3765// long-running operation. 3766type GalleryApplicationVersionsDeleteFuture struct { 3767 azure.FutureAPI 3768 // Result returns the result of the asynchronous operation. 3769 // If the operation has not completed it will return an error. 3770 Result func(GalleryApplicationVersionsClient) (autorest.Response, error) 3771} 3772 3773// GalleryApplicationVersionsUpdateFuture an abstraction for monitoring and retrieving the results of a 3774// long-running operation. 3775type GalleryApplicationVersionsUpdateFuture struct { 3776 azure.FutureAPI 3777 // Result returns the result of the asynchronous operation. 3778 // If the operation has not completed it will return an error. 3779 Result func(GalleryApplicationVersionsClient) (GalleryApplicationVersion, error) 3780} 3781 3782// GalleryApplicationVersionUpdate specifies information about the gallery Application Version that you 3783// want to update. 3784type GalleryApplicationVersionUpdate struct { 3785 *GalleryApplicationVersionProperties `json:"properties,omitempty"` 3786 // ID - READ-ONLY; Resource Id 3787 ID *string `json:"id,omitempty"` 3788 // Name - READ-ONLY; Resource name 3789 Name *string `json:"name,omitempty"` 3790 // Type - READ-ONLY; Resource type 3791 Type *string `json:"type,omitempty"` 3792 // Tags - Resource tags 3793 Tags map[string]*string `json:"tags"` 3794} 3795 3796// MarshalJSON is the custom marshaler for GalleryApplicationVersionUpdate. 3797func (gavu GalleryApplicationVersionUpdate) MarshalJSON() ([]byte, error) { 3798 objectMap := make(map[string]interface{}) 3799 if gavu.GalleryApplicationVersionProperties != nil { 3800 objectMap["properties"] = gavu.GalleryApplicationVersionProperties 3801 } 3802 if gavu.Tags != nil { 3803 objectMap["tags"] = gavu.Tags 3804 } 3805 return json.Marshal(objectMap) 3806} 3807 3808// UnmarshalJSON is the custom unmarshaler for GalleryApplicationVersionUpdate struct. 3809func (gavu *GalleryApplicationVersionUpdate) UnmarshalJSON(body []byte) error { 3810 var m map[string]*json.RawMessage 3811 err := json.Unmarshal(body, &m) 3812 if err != nil { 3813 return err 3814 } 3815 for k, v := range m { 3816 switch k { 3817 case "properties": 3818 if v != nil { 3819 var galleryApplicationVersionProperties GalleryApplicationVersionProperties 3820 err = json.Unmarshal(*v, &galleryApplicationVersionProperties) 3821 if err != nil { 3822 return err 3823 } 3824 gavu.GalleryApplicationVersionProperties = &galleryApplicationVersionProperties 3825 } 3826 case "id": 3827 if v != nil { 3828 var ID string 3829 err = json.Unmarshal(*v, &ID) 3830 if err != nil { 3831 return err 3832 } 3833 gavu.ID = &ID 3834 } 3835 case "name": 3836 if v != nil { 3837 var name string 3838 err = json.Unmarshal(*v, &name) 3839 if err != nil { 3840 return err 3841 } 3842 gavu.Name = &name 3843 } 3844 case "type": 3845 if v != nil { 3846 var typeVar string 3847 err = json.Unmarshal(*v, &typeVar) 3848 if err != nil { 3849 return err 3850 } 3851 gavu.Type = &typeVar 3852 } 3853 case "tags": 3854 if v != nil { 3855 var tags map[string]*string 3856 err = json.Unmarshal(*v, &tags) 3857 if err != nil { 3858 return err 3859 } 3860 gavu.Tags = tags 3861 } 3862 } 3863 } 3864 3865 return nil 3866} 3867 3868// GalleryArtifactPublishingProfileBase describes the basic gallery artifact publishing profile. 3869type GalleryArtifactPublishingProfileBase struct { 3870 // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. 3871 TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` 3872 // 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. 3873 ReplicaCount *int32 `json:"replicaCount,omitempty"` 3874 // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. 3875 ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` 3876 // PublishedDate - READ-ONLY; The timestamp for when the gallery Image Version is published. 3877 PublishedDate *date.Time `json:"publishedDate,omitempty"` 3878 // EndOfLifeDate - The end of life date of the gallery Image Version. This property can be used for decommissioning purposes. This property is updatable. 3879 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 3880 // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' 3881 StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` 3882} 3883 3884// MarshalJSON is the custom marshaler for GalleryArtifactPublishingProfileBase. 3885func (gappb GalleryArtifactPublishingProfileBase) MarshalJSON() ([]byte, error) { 3886 objectMap := make(map[string]interface{}) 3887 if gappb.TargetRegions != nil { 3888 objectMap["targetRegions"] = gappb.TargetRegions 3889 } 3890 if gappb.ReplicaCount != nil { 3891 objectMap["replicaCount"] = gappb.ReplicaCount 3892 } 3893 if gappb.ExcludeFromLatest != nil { 3894 objectMap["excludeFromLatest"] = gappb.ExcludeFromLatest 3895 } 3896 if gappb.EndOfLifeDate != nil { 3897 objectMap["endOfLifeDate"] = gappb.EndOfLifeDate 3898 } 3899 if gappb.StorageAccountType != "" { 3900 objectMap["storageAccountType"] = gappb.StorageAccountType 3901 } 3902 return json.Marshal(objectMap) 3903} 3904 3905// GalleryArtifactSource the source image from which the Image Version is going to be created. 3906type GalleryArtifactSource struct { 3907 ManagedImage *ManagedArtifact `json:"managedImage,omitempty"` 3908} 3909 3910// GalleryArtifactVersionSource the gallery artifact version source. 3911type GalleryArtifactVersionSource struct { 3912 // ID - The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, or user image. 3913 ID *string `json:"id,omitempty"` 3914} 3915 3916// GalleryDataDiskImage this is the data disk image. 3917type GalleryDataDiskImage struct { 3918 // 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. 3919 Lun *int32 `json:"lun,omitempty"` 3920 // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. 3921 SizeInGB *int32 `json:"sizeInGB,omitempty"` 3922 // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' 3923 HostCaching HostCaching `json:"hostCaching,omitempty"` 3924 Source *GalleryArtifactVersionSource `json:"source,omitempty"` 3925} 3926 3927// MarshalJSON is the custom marshaler for GalleryDataDiskImage. 3928func (gddi GalleryDataDiskImage) MarshalJSON() ([]byte, error) { 3929 objectMap := make(map[string]interface{}) 3930 if gddi.Lun != nil { 3931 objectMap["lun"] = gddi.Lun 3932 } 3933 if gddi.HostCaching != "" { 3934 objectMap["hostCaching"] = gddi.HostCaching 3935 } 3936 if gddi.Source != nil { 3937 objectMap["source"] = gddi.Source 3938 } 3939 return json.Marshal(objectMap) 3940} 3941 3942// GalleryDiskImage this is the disk image base class. 3943type GalleryDiskImage struct { 3944 // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. 3945 SizeInGB *int32 `json:"sizeInGB,omitempty"` 3946 // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' 3947 HostCaching HostCaching `json:"hostCaching,omitempty"` 3948 Source *GalleryArtifactVersionSource `json:"source,omitempty"` 3949} 3950 3951// MarshalJSON is the custom marshaler for GalleryDiskImage. 3952func (gdi GalleryDiskImage) MarshalJSON() ([]byte, error) { 3953 objectMap := make(map[string]interface{}) 3954 if gdi.HostCaching != "" { 3955 objectMap["hostCaching"] = gdi.HostCaching 3956 } 3957 if gdi.Source != nil { 3958 objectMap["source"] = gdi.Source 3959 } 3960 return json.Marshal(objectMap) 3961} 3962 3963// GalleryIdentifier describes the gallery unique name. 3964type GalleryIdentifier struct { 3965 // UniqueName - READ-ONLY; The unique name of the Shared Image Gallery. This name is generated automatically by Azure. 3966 UniqueName *string `json:"uniqueName,omitempty"` 3967} 3968 3969// GalleryImage specifies information about the gallery Image Definition that you want to create or update. 3970type GalleryImage struct { 3971 autorest.Response `json:"-"` 3972 *GalleryImageProperties `json:"properties,omitempty"` 3973 // ID - READ-ONLY; Resource Id 3974 ID *string `json:"id,omitempty"` 3975 // Name - READ-ONLY; Resource name 3976 Name *string `json:"name,omitempty"` 3977 // Type - READ-ONLY; Resource type 3978 Type *string `json:"type,omitempty"` 3979 // Location - Resource location 3980 Location *string `json:"location,omitempty"` 3981 // Tags - Resource tags 3982 Tags map[string]*string `json:"tags"` 3983} 3984 3985// MarshalJSON is the custom marshaler for GalleryImage. 3986func (gi GalleryImage) MarshalJSON() ([]byte, error) { 3987 objectMap := make(map[string]interface{}) 3988 if gi.GalleryImageProperties != nil { 3989 objectMap["properties"] = gi.GalleryImageProperties 3990 } 3991 if gi.Location != nil { 3992 objectMap["location"] = gi.Location 3993 } 3994 if gi.Tags != nil { 3995 objectMap["tags"] = gi.Tags 3996 } 3997 return json.Marshal(objectMap) 3998} 3999 4000// UnmarshalJSON is the custom unmarshaler for GalleryImage struct. 4001func (gi *GalleryImage) UnmarshalJSON(body []byte) error { 4002 var m map[string]*json.RawMessage 4003 err := json.Unmarshal(body, &m) 4004 if err != nil { 4005 return err 4006 } 4007 for k, v := range m { 4008 switch k { 4009 case "properties": 4010 if v != nil { 4011 var galleryImageProperties GalleryImageProperties 4012 err = json.Unmarshal(*v, &galleryImageProperties) 4013 if err != nil { 4014 return err 4015 } 4016 gi.GalleryImageProperties = &galleryImageProperties 4017 } 4018 case "id": 4019 if v != nil { 4020 var ID string 4021 err = json.Unmarshal(*v, &ID) 4022 if err != nil { 4023 return err 4024 } 4025 gi.ID = &ID 4026 } 4027 case "name": 4028 if v != nil { 4029 var name string 4030 err = json.Unmarshal(*v, &name) 4031 if err != nil { 4032 return err 4033 } 4034 gi.Name = &name 4035 } 4036 case "type": 4037 if v != nil { 4038 var typeVar string 4039 err = json.Unmarshal(*v, &typeVar) 4040 if err != nil { 4041 return err 4042 } 4043 gi.Type = &typeVar 4044 } 4045 case "location": 4046 if v != nil { 4047 var location string 4048 err = json.Unmarshal(*v, &location) 4049 if err != nil { 4050 return err 4051 } 4052 gi.Location = &location 4053 } 4054 case "tags": 4055 if v != nil { 4056 var tags map[string]*string 4057 err = json.Unmarshal(*v, &tags) 4058 if err != nil { 4059 return err 4060 } 4061 gi.Tags = tags 4062 } 4063 } 4064 } 4065 4066 return nil 4067} 4068 4069// GalleryImageIdentifier this is the gallery Image Definition identifier. 4070type GalleryImageIdentifier struct { 4071 // Publisher - The name of the gallery Image Definition publisher. 4072 Publisher *string `json:"publisher,omitempty"` 4073 // Offer - The name of the gallery Image Definition offer. 4074 Offer *string `json:"offer,omitempty"` 4075 // Sku - The name of the gallery Image Definition SKU. 4076 Sku *string `json:"sku,omitempty"` 4077} 4078 4079// GalleryImageList the List Gallery Images operation response. 4080type GalleryImageList struct { 4081 autorest.Response `json:"-"` 4082 // Value - A list of Shared Image Gallery images. 4083 Value *[]GalleryImage `json:"value,omitempty"` 4084 // 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. 4085 NextLink *string `json:"nextLink,omitempty"` 4086} 4087 4088// GalleryImageListIterator provides access to a complete listing of GalleryImage values. 4089type GalleryImageListIterator struct { 4090 i int 4091 page GalleryImageListPage 4092} 4093 4094// NextWithContext advances to the next value. If there was an error making 4095// the request the iterator does not advance and the error is returned. 4096func (iter *GalleryImageListIterator) NextWithContext(ctx context.Context) (err error) { 4097 if tracing.IsEnabled() { 4098 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageListIterator.NextWithContext") 4099 defer func() { 4100 sc := -1 4101 if iter.Response().Response.Response != nil { 4102 sc = iter.Response().Response.Response.StatusCode 4103 } 4104 tracing.EndSpan(ctx, sc, err) 4105 }() 4106 } 4107 iter.i++ 4108 if iter.i < len(iter.page.Values()) { 4109 return nil 4110 } 4111 err = iter.page.NextWithContext(ctx) 4112 if err != nil { 4113 iter.i-- 4114 return err 4115 } 4116 iter.i = 0 4117 return nil 4118} 4119 4120// Next advances to the next value. If there was an error making 4121// the request the iterator does not advance and the error is returned. 4122// Deprecated: Use NextWithContext() instead. 4123func (iter *GalleryImageListIterator) Next() error { 4124 return iter.NextWithContext(context.Background()) 4125} 4126 4127// NotDone returns true if the enumeration should be started or is not yet complete. 4128func (iter GalleryImageListIterator) NotDone() bool { 4129 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4130} 4131 4132// Response returns the raw server response from the last page request. 4133func (iter GalleryImageListIterator) Response() GalleryImageList { 4134 return iter.page.Response() 4135} 4136 4137// Value returns the current value or a zero-initialized value if the 4138// iterator has advanced beyond the end of the collection. 4139func (iter GalleryImageListIterator) Value() GalleryImage { 4140 if !iter.page.NotDone() { 4141 return GalleryImage{} 4142 } 4143 return iter.page.Values()[iter.i] 4144} 4145 4146// Creates a new instance of the GalleryImageListIterator type. 4147func NewGalleryImageListIterator(page GalleryImageListPage) GalleryImageListIterator { 4148 return GalleryImageListIterator{page: page} 4149} 4150 4151// IsEmpty returns true if the ListResult contains no values. 4152func (gil GalleryImageList) IsEmpty() bool { 4153 return gil.Value == nil || len(*gil.Value) == 0 4154} 4155 4156// hasNextLink returns true if the NextLink is not empty. 4157func (gil GalleryImageList) hasNextLink() bool { 4158 return gil.NextLink != nil && len(*gil.NextLink) != 0 4159} 4160 4161// galleryImageListPreparer prepares a request to retrieve the next set of results. 4162// It returns nil if no more results exist. 4163func (gil GalleryImageList) galleryImageListPreparer(ctx context.Context) (*http.Request, error) { 4164 if !gil.hasNextLink() { 4165 return nil, nil 4166 } 4167 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4168 autorest.AsJSON(), 4169 autorest.AsGet(), 4170 autorest.WithBaseURL(to.String(gil.NextLink))) 4171} 4172 4173// GalleryImageListPage contains a page of GalleryImage values. 4174type GalleryImageListPage struct { 4175 fn func(context.Context, GalleryImageList) (GalleryImageList, error) 4176 gil GalleryImageList 4177} 4178 4179// NextWithContext advances to the next page of values. If there was an error making 4180// the request the page does not advance and the error is returned. 4181func (page *GalleryImageListPage) NextWithContext(ctx context.Context) (err error) { 4182 if tracing.IsEnabled() { 4183 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageListPage.NextWithContext") 4184 defer func() { 4185 sc := -1 4186 if page.Response().Response.Response != nil { 4187 sc = page.Response().Response.Response.StatusCode 4188 } 4189 tracing.EndSpan(ctx, sc, err) 4190 }() 4191 } 4192 for { 4193 next, err := page.fn(ctx, page.gil) 4194 if err != nil { 4195 return err 4196 } 4197 page.gil = next 4198 if !next.hasNextLink() || !next.IsEmpty() { 4199 break 4200 } 4201 } 4202 return nil 4203} 4204 4205// Next advances to the next page of values. If there was an error making 4206// the request the page does not advance and the error is returned. 4207// Deprecated: Use NextWithContext() instead. 4208func (page *GalleryImageListPage) Next() error { 4209 return page.NextWithContext(context.Background()) 4210} 4211 4212// NotDone returns true if the page enumeration should be started or is not yet complete. 4213func (page GalleryImageListPage) NotDone() bool { 4214 return !page.gil.IsEmpty() 4215} 4216 4217// Response returns the raw server response from the last page request. 4218func (page GalleryImageListPage) Response() GalleryImageList { 4219 return page.gil 4220} 4221 4222// Values returns the slice of values for the current page or nil if there are no values. 4223func (page GalleryImageListPage) Values() []GalleryImage { 4224 if page.gil.IsEmpty() { 4225 return nil 4226 } 4227 return *page.gil.Value 4228} 4229 4230// Creates a new instance of the GalleryImageListPage type. 4231func NewGalleryImageListPage(cur GalleryImageList, getNextPage func(context.Context, GalleryImageList) (GalleryImageList, error)) GalleryImageListPage { 4232 return GalleryImageListPage{ 4233 fn: getNextPage, 4234 gil: cur, 4235 } 4236} 4237 4238// GalleryImageProperties describes the properties of a gallery Image Definition. 4239type GalleryImageProperties struct { 4240 // Description - The description of this gallery Image Definition resource. This property is updatable. 4241 Description *string `json:"description,omitempty"` 4242 // Eula - The Eula agreement for the gallery Image Definition. 4243 Eula *string `json:"eula,omitempty"` 4244 // PrivacyStatementURI - The privacy statement uri. 4245 PrivacyStatementURI *string `json:"privacyStatementUri,omitempty"` 4246 // ReleaseNoteURI - The release note uri. 4247 ReleaseNoteURI *string `json:"releaseNoteUri,omitempty"` 4248 // 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' 4249 OsType OperatingSystemTypes `json:"osType,omitempty"` 4250 // 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' 4251 OsState OperatingSystemStateTypes `json:"osState,omitempty"` 4252 // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'V1', 'V2' 4253 HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` 4254 // EndOfLifeDate - The end of life date of the gallery Image Definition. This property can be used for decommissioning purposes. This property is updatable. 4255 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 4256 Identifier *GalleryImageIdentifier `json:"identifier,omitempty"` 4257 Recommended *RecommendedMachineConfiguration `json:"recommended,omitempty"` 4258 Disallowed *Disallowed `json:"disallowed,omitempty"` 4259 PurchasePlan *ImagePurchasePlan `json:"purchasePlan,omitempty"` 4260 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningState2Creating', 'ProvisioningState2Updating', 'ProvisioningState2Failed', 'ProvisioningState2Succeeded', 'ProvisioningState2Deleting', 'ProvisioningState2Migrating' 4261 ProvisioningState ProvisioningState2 `json:"provisioningState,omitempty"` 4262} 4263 4264// MarshalJSON is the custom marshaler for GalleryImageProperties. 4265func (gip GalleryImageProperties) MarshalJSON() ([]byte, error) { 4266 objectMap := make(map[string]interface{}) 4267 if gip.Description != nil { 4268 objectMap["description"] = gip.Description 4269 } 4270 if gip.Eula != nil { 4271 objectMap["eula"] = gip.Eula 4272 } 4273 if gip.PrivacyStatementURI != nil { 4274 objectMap["privacyStatementUri"] = gip.PrivacyStatementURI 4275 } 4276 if gip.ReleaseNoteURI != nil { 4277 objectMap["releaseNoteUri"] = gip.ReleaseNoteURI 4278 } 4279 if gip.OsType != "" { 4280 objectMap["osType"] = gip.OsType 4281 } 4282 if gip.OsState != "" { 4283 objectMap["osState"] = gip.OsState 4284 } 4285 if gip.HyperVGeneration != "" { 4286 objectMap["hyperVGeneration"] = gip.HyperVGeneration 4287 } 4288 if gip.EndOfLifeDate != nil { 4289 objectMap["endOfLifeDate"] = gip.EndOfLifeDate 4290 } 4291 if gip.Identifier != nil { 4292 objectMap["identifier"] = gip.Identifier 4293 } 4294 if gip.Recommended != nil { 4295 objectMap["recommended"] = gip.Recommended 4296 } 4297 if gip.Disallowed != nil { 4298 objectMap["disallowed"] = gip.Disallowed 4299 } 4300 if gip.PurchasePlan != nil { 4301 objectMap["purchasePlan"] = gip.PurchasePlan 4302 } 4303 return json.Marshal(objectMap) 4304} 4305 4306// GalleryImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 4307// long-running operation. 4308type GalleryImagesCreateOrUpdateFuture struct { 4309 azure.FutureAPI 4310 // Result returns the result of the asynchronous operation. 4311 // If the operation has not completed it will return an error. 4312 Result func(GalleryImagesClient) (GalleryImage, error) 4313} 4314 4315// GalleryImagesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 4316// operation. 4317type GalleryImagesDeleteFuture struct { 4318 azure.FutureAPI 4319 // Result returns the result of the asynchronous operation. 4320 // If the operation has not completed it will return an error. 4321 Result func(GalleryImagesClient) (autorest.Response, error) 4322} 4323 4324// GalleryImagesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 4325// operation. 4326type GalleryImagesUpdateFuture struct { 4327 azure.FutureAPI 4328 // Result returns the result of the asynchronous operation. 4329 // If the operation has not completed it will return an error. 4330 Result func(GalleryImagesClient) (GalleryImage, error) 4331} 4332 4333// GalleryImageUpdate specifies information about the gallery Image Definition that you want to update. 4334type GalleryImageUpdate struct { 4335 *GalleryImageProperties `json:"properties,omitempty"` 4336 // ID - READ-ONLY; Resource Id 4337 ID *string `json:"id,omitempty"` 4338 // Name - READ-ONLY; Resource name 4339 Name *string `json:"name,omitempty"` 4340 // Type - READ-ONLY; Resource type 4341 Type *string `json:"type,omitempty"` 4342 // Tags - Resource tags 4343 Tags map[string]*string `json:"tags"` 4344} 4345 4346// MarshalJSON is the custom marshaler for GalleryImageUpdate. 4347func (giu GalleryImageUpdate) MarshalJSON() ([]byte, error) { 4348 objectMap := make(map[string]interface{}) 4349 if giu.GalleryImageProperties != nil { 4350 objectMap["properties"] = giu.GalleryImageProperties 4351 } 4352 if giu.Tags != nil { 4353 objectMap["tags"] = giu.Tags 4354 } 4355 return json.Marshal(objectMap) 4356} 4357 4358// UnmarshalJSON is the custom unmarshaler for GalleryImageUpdate struct. 4359func (giu *GalleryImageUpdate) UnmarshalJSON(body []byte) error { 4360 var m map[string]*json.RawMessage 4361 err := json.Unmarshal(body, &m) 4362 if err != nil { 4363 return err 4364 } 4365 for k, v := range m { 4366 switch k { 4367 case "properties": 4368 if v != nil { 4369 var galleryImageProperties GalleryImageProperties 4370 err = json.Unmarshal(*v, &galleryImageProperties) 4371 if err != nil { 4372 return err 4373 } 4374 giu.GalleryImageProperties = &galleryImageProperties 4375 } 4376 case "id": 4377 if v != nil { 4378 var ID string 4379 err = json.Unmarshal(*v, &ID) 4380 if err != nil { 4381 return err 4382 } 4383 giu.ID = &ID 4384 } 4385 case "name": 4386 if v != nil { 4387 var name string 4388 err = json.Unmarshal(*v, &name) 4389 if err != nil { 4390 return err 4391 } 4392 giu.Name = &name 4393 } 4394 case "type": 4395 if v != nil { 4396 var typeVar string 4397 err = json.Unmarshal(*v, &typeVar) 4398 if err != nil { 4399 return err 4400 } 4401 giu.Type = &typeVar 4402 } 4403 case "tags": 4404 if v != nil { 4405 var tags map[string]*string 4406 err = json.Unmarshal(*v, &tags) 4407 if err != nil { 4408 return err 4409 } 4410 giu.Tags = tags 4411 } 4412 } 4413 } 4414 4415 return nil 4416} 4417 4418// GalleryImageVersion specifies information about the gallery Image Version that you want to create or 4419// update. 4420type GalleryImageVersion struct { 4421 autorest.Response `json:"-"` 4422 *GalleryImageVersionProperties `json:"properties,omitempty"` 4423 // ID - READ-ONLY; Resource Id 4424 ID *string `json:"id,omitempty"` 4425 // Name - READ-ONLY; Resource name 4426 Name *string `json:"name,omitempty"` 4427 // Type - READ-ONLY; Resource type 4428 Type *string `json:"type,omitempty"` 4429 // Location - Resource location 4430 Location *string `json:"location,omitempty"` 4431 // Tags - Resource tags 4432 Tags map[string]*string `json:"tags"` 4433} 4434 4435// MarshalJSON is the custom marshaler for GalleryImageVersion. 4436func (giv GalleryImageVersion) MarshalJSON() ([]byte, error) { 4437 objectMap := make(map[string]interface{}) 4438 if giv.GalleryImageVersionProperties != nil { 4439 objectMap["properties"] = giv.GalleryImageVersionProperties 4440 } 4441 if giv.Location != nil { 4442 objectMap["location"] = giv.Location 4443 } 4444 if giv.Tags != nil { 4445 objectMap["tags"] = giv.Tags 4446 } 4447 return json.Marshal(objectMap) 4448} 4449 4450// UnmarshalJSON is the custom unmarshaler for GalleryImageVersion struct. 4451func (giv *GalleryImageVersion) UnmarshalJSON(body []byte) error { 4452 var m map[string]*json.RawMessage 4453 err := json.Unmarshal(body, &m) 4454 if err != nil { 4455 return err 4456 } 4457 for k, v := range m { 4458 switch k { 4459 case "properties": 4460 if v != nil { 4461 var galleryImageVersionProperties GalleryImageVersionProperties 4462 err = json.Unmarshal(*v, &galleryImageVersionProperties) 4463 if err != nil { 4464 return err 4465 } 4466 giv.GalleryImageVersionProperties = &galleryImageVersionProperties 4467 } 4468 case "id": 4469 if v != nil { 4470 var ID string 4471 err = json.Unmarshal(*v, &ID) 4472 if err != nil { 4473 return err 4474 } 4475 giv.ID = &ID 4476 } 4477 case "name": 4478 if v != nil { 4479 var name string 4480 err = json.Unmarshal(*v, &name) 4481 if err != nil { 4482 return err 4483 } 4484 giv.Name = &name 4485 } 4486 case "type": 4487 if v != nil { 4488 var typeVar string 4489 err = json.Unmarshal(*v, &typeVar) 4490 if err != nil { 4491 return err 4492 } 4493 giv.Type = &typeVar 4494 } 4495 case "location": 4496 if v != nil { 4497 var location string 4498 err = json.Unmarshal(*v, &location) 4499 if err != nil { 4500 return err 4501 } 4502 giv.Location = &location 4503 } 4504 case "tags": 4505 if v != nil { 4506 var tags map[string]*string 4507 err = json.Unmarshal(*v, &tags) 4508 if err != nil { 4509 return err 4510 } 4511 giv.Tags = tags 4512 } 4513 } 4514 } 4515 4516 return nil 4517} 4518 4519// GalleryImageVersionList the List Gallery Image version operation response. 4520type GalleryImageVersionList struct { 4521 autorest.Response `json:"-"` 4522 // Value - A list of gallery Image Versions. 4523 Value *[]GalleryImageVersion `json:"value,omitempty"` 4524 // 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. 4525 NextLink *string `json:"nextLink,omitempty"` 4526} 4527 4528// GalleryImageVersionListIterator provides access to a complete listing of GalleryImageVersion values. 4529type GalleryImageVersionListIterator struct { 4530 i int 4531 page GalleryImageVersionListPage 4532} 4533 4534// NextWithContext advances to the next value. If there was an error making 4535// the request the iterator does not advance and the error is returned. 4536func (iter *GalleryImageVersionListIterator) NextWithContext(ctx context.Context) (err error) { 4537 if tracing.IsEnabled() { 4538 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionListIterator.NextWithContext") 4539 defer func() { 4540 sc := -1 4541 if iter.Response().Response.Response != nil { 4542 sc = iter.Response().Response.Response.StatusCode 4543 } 4544 tracing.EndSpan(ctx, sc, err) 4545 }() 4546 } 4547 iter.i++ 4548 if iter.i < len(iter.page.Values()) { 4549 return nil 4550 } 4551 err = iter.page.NextWithContext(ctx) 4552 if err != nil { 4553 iter.i-- 4554 return err 4555 } 4556 iter.i = 0 4557 return nil 4558} 4559 4560// Next advances to the next value. If there was an error making 4561// the request the iterator does not advance and the error is returned. 4562// Deprecated: Use NextWithContext() instead. 4563func (iter *GalleryImageVersionListIterator) Next() error { 4564 return iter.NextWithContext(context.Background()) 4565} 4566 4567// NotDone returns true if the enumeration should be started or is not yet complete. 4568func (iter GalleryImageVersionListIterator) NotDone() bool { 4569 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4570} 4571 4572// Response returns the raw server response from the last page request. 4573func (iter GalleryImageVersionListIterator) Response() GalleryImageVersionList { 4574 return iter.page.Response() 4575} 4576 4577// Value returns the current value or a zero-initialized value if the 4578// iterator has advanced beyond the end of the collection. 4579func (iter GalleryImageVersionListIterator) Value() GalleryImageVersion { 4580 if !iter.page.NotDone() { 4581 return GalleryImageVersion{} 4582 } 4583 return iter.page.Values()[iter.i] 4584} 4585 4586// Creates a new instance of the GalleryImageVersionListIterator type. 4587func NewGalleryImageVersionListIterator(page GalleryImageVersionListPage) GalleryImageVersionListIterator { 4588 return GalleryImageVersionListIterator{page: page} 4589} 4590 4591// IsEmpty returns true if the ListResult contains no values. 4592func (givl GalleryImageVersionList) IsEmpty() bool { 4593 return givl.Value == nil || len(*givl.Value) == 0 4594} 4595 4596// hasNextLink returns true if the NextLink is not empty. 4597func (givl GalleryImageVersionList) hasNextLink() bool { 4598 return givl.NextLink != nil && len(*givl.NextLink) != 0 4599} 4600 4601// galleryImageVersionListPreparer prepares a request to retrieve the next set of results. 4602// It returns nil if no more results exist. 4603func (givl GalleryImageVersionList) galleryImageVersionListPreparer(ctx context.Context) (*http.Request, error) { 4604 if !givl.hasNextLink() { 4605 return nil, nil 4606 } 4607 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4608 autorest.AsJSON(), 4609 autorest.AsGet(), 4610 autorest.WithBaseURL(to.String(givl.NextLink))) 4611} 4612 4613// GalleryImageVersionListPage contains a page of GalleryImageVersion values. 4614type GalleryImageVersionListPage struct { 4615 fn func(context.Context, GalleryImageVersionList) (GalleryImageVersionList, error) 4616 givl GalleryImageVersionList 4617} 4618 4619// NextWithContext advances to the next page of values. If there was an error making 4620// the request the page does not advance and the error is returned. 4621func (page *GalleryImageVersionListPage) NextWithContext(ctx context.Context) (err error) { 4622 if tracing.IsEnabled() { 4623 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionListPage.NextWithContext") 4624 defer func() { 4625 sc := -1 4626 if page.Response().Response.Response != nil { 4627 sc = page.Response().Response.Response.StatusCode 4628 } 4629 tracing.EndSpan(ctx, sc, err) 4630 }() 4631 } 4632 for { 4633 next, err := page.fn(ctx, page.givl) 4634 if err != nil { 4635 return err 4636 } 4637 page.givl = next 4638 if !next.hasNextLink() || !next.IsEmpty() { 4639 break 4640 } 4641 } 4642 return nil 4643} 4644 4645// Next advances to the next page of values. If there was an error making 4646// the request the page does not advance and the error is returned. 4647// Deprecated: Use NextWithContext() instead. 4648func (page *GalleryImageVersionListPage) Next() error { 4649 return page.NextWithContext(context.Background()) 4650} 4651 4652// NotDone returns true if the page enumeration should be started or is not yet complete. 4653func (page GalleryImageVersionListPage) NotDone() bool { 4654 return !page.givl.IsEmpty() 4655} 4656 4657// Response returns the raw server response from the last page request. 4658func (page GalleryImageVersionListPage) Response() GalleryImageVersionList { 4659 return page.givl 4660} 4661 4662// Values returns the slice of values for the current page or nil if there are no values. 4663func (page GalleryImageVersionListPage) Values() []GalleryImageVersion { 4664 if page.givl.IsEmpty() { 4665 return nil 4666 } 4667 return *page.givl.Value 4668} 4669 4670// Creates a new instance of the GalleryImageVersionListPage type. 4671func NewGalleryImageVersionListPage(cur GalleryImageVersionList, getNextPage func(context.Context, GalleryImageVersionList) (GalleryImageVersionList, error)) GalleryImageVersionListPage { 4672 return GalleryImageVersionListPage{ 4673 fn: getNextPage, 4674 givl: cur, 4675 } 4676} 4677 4678// GalleryImageVersionProperties describes the properties of a gallery Image Version. 4679type GalleryImageVersionProperties struct { 4680 PublishingProfile *GalleryImageVersionPublishingProfile `json:"publishingProfile,omitempty"` 4681 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningState3Creating', 'ProvisioningState3Updating', 'ProvisioningState3Failed', 'ProvisioningState3Succeeded', 'ProvisioningState3Deleting', 'ProvisioningState3Migrating' 4682 ProvisioningState ProvisioningState3 `json:"provisioningState,omitempty"` 4683 StorageProfile *GalleryImageVersionStorageProfile `json:"storageProfile,omitempty"` 4684 // ReplicationStatus - READ-ONLY 4685 ReplicationStatus *ReplicationStatus `json:"replicationStatus,omitempty"` 4686} 4687 4688// MarshalJSON is the custom marshaler for GalleryImageVersionProperties. 4689func (givp GalleryImageVersionProperties) MarshalJSON() ([]byte, error) { 4690 objectMap := make(map[string]interface{}) 4691 if givp.PublishingProfile != nil { 4692 objectMap["publishingProfile"] = givp.PublishingProfile 4693 } 4694 if givp.StorageProfile != nil { 4695 objectMap["storageProfile"] = givp.StorageProfile 4696 } 4697 return json.Marshal(objectMap) 4698} 4699 4700// GalleryImageVersionPublishingProfile the publishing profile of a gallery Image Version. 4701type GalleryImageVersionPublishingProfile struct { 4702 // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. 4703 TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` 4704 // 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. 4705 ReplicaCount *int32 `json:"replicaCount,omitempty"` 4706 // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. 4707 ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` 4708 // PublishedDate - READ-ONLY; The timestamp for when the gallery Image Version is published. 4709 PublishedDate *date.Time `json:"publishedDate,omitempty"` 4710 // EndOfLifeDate - The end of life date of the gallery Image Version. This property can be used for decommissioning purposes. This property is updatable. 4711 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 4712 // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' 4713 StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` 4714} 4715 4716// MarshalJSON is the custom marshaler for GalleryImageVersionPublishingProfile. 4717func (givpp GalleryImageVersionPublishingProfile) MarshalJSON() ([]byte, error) { 4718 objectMap := make(map[string]interface{}) 4719 if givpp.TargetRegions != nil { 4720 objectMap["targetRegions"] = givpp.TargetRegions 4721 } 4722 if givpp.ReplicaCount != nil { 4723 objectMap["replicaCount"] = givpp.ReplicaCount 4724 } 4725 if givpp.ExcludeFromLatest != nil { 4726 objectMap["excludeFromLatest"] = givpp.ExcludeFromLatest 4727 } 4728 if givpp.EndOfLifeDate != nil { 4729 objectMap["endOfLifeDate"] = givpp.EndOfLifeDate 4730 } 4731 if givpp.StorageAccountType != "" { 4732 objectMap["storageAccountType"] = givpp.StorageAccountType 4733 } 4734 return json.Marshal(objectMap) 4735} 4736 4737// GalleryImageVersionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 4738// long-running operation. 4739type GalleryImageVersionsCreateOrUpdateFuture struct { 4740 azure.FutureAPI 4741 // Result returns the result of the asynchronous operation. 4742 // If the operation has not completed it will return an error. 4743 Result func(GalleryImageVersionsClient) (GalleryImageVersion, error) 4744} 4745 4746// GalleryImageVersionsDeleteFuture an abstraction for monitoring and retrieving the results of a 4747// long-running operation. 4748type GalleryImageVersionsDeleteFuture struct { 4749 azure.FutureAPI 4750 // Result returns the result of the asynchronous operation. 4751 // If the operation has not completed it will return an error. 4752 Result func(GalleryImageVersionsClient) (autorest.Response, error) 4753} 4754 4755// GalleryImageVersionStorageProfile this is the storage profile of a Gallery Image Version. 4756type GalleryImageVersionStorageProfile struct { 4757 Source *GalleryArtifactVersionSource `json:"source,omitempty"` 4758 OsDiskImage *GalleryOSDiskImage `json:"osDiskImage,omitempty"` 4759 // DataDiskImages - A list of data disk images. 4760 DataDiskImages *[]GalleryDataDiskImage `json:"dataDiskImages,omitempty"` 4761} 4762 4763// GalleryImageVersionsUpdateFuture an abstraction for monitoring and retrieving the results of a 4764// long-running operation. 4765type GalleryImageVersionsUpdateFuture struct { 4766 azure.FutureAPI 4767 // Result returns the result of the asynchronous operation. 4768 // If the operation has not completed it will return an error. 4769 Result func(GalleryImageVersionsClient) (GalleryImageVersion, error) 4770} 4771 4772// GalleryImageVersionUpdate specifies information about the gallery Image Version that you want to update. 4773type GalleryImageVersionUpdate struct { 4774 *GalleryImageVersionProperties `json:"properties,omitempty"` 4775 // ID - READ-ONLY; Resource Id 4776 ID *string `json:"id,omitempty"` 4777 // Name - READ-ONLY; Resource name 4778 Name *string `json:"name,omitempty"` 4779 // Type - READ-ONLY; Resource type 4780 Type *string `json:"type,omitempty"` 4781 // Tags - Resource tags 4782 Tags map[string]*string `json:"tags"` 4783} 4784 4785// MarshalJSON is the custom marshaler for GalleryImageVersionUpdate. 4786func (givu GalleryImageVersionUpdate) MarshalJSON() ([]byte, error) { 4787 objectMap := make(map[string]interface{}) 4788 if givu.GalleryImageVersionProperties != nil { 4789 objectMap["properties"] = givu.GalleryImageVersionProperties 4790 } 4791 if givu.Tags != nil { 4792 objectMap["tags"] = givu.Tags 4793 } 4794 return json.Marshal(objectMap) 4795} 4796 4797// UnmarshalJSON is the custom unmarshaler for GalleryImageVersionUpdate struct. 4798func (givu *GalleryImageVersionUpdate) UnmarshalJSON(body []byte) error { 4799 var m map[string]*json.RawMessage 4800 err := json.Unmarshal(body, &m) 4801 if err != nil { 4802 return err 4803 } 4804 for k, v := range m { 4805 switch k { 4806 case "properties": 4807 if v != nil { 4808 var galleryImageVersionProperties GalleryImageVersionProperties 4809 err = json.Unmarshal(*v, &galleryImageVersionProperties) 4810 if err != nil { 4811 return err 4812 } 4813 givu.GalleryImageVersionProperties = &galleryImageVersionProperties 4814 } 4815 case "id": 4816 if v != nil { 4817 var ID string 4818 err = json.Unmarshal(*v, &ID) 4819 if err != nil { 4820 return err 4821 } 4822 givu.ID = &ID 4823 } 4824 case "name": 4825 if v != nil { 4826 var name string 4827 err = json.Unmarshal(*v, &name) 4828 if err != nil { 4829 return err 4830 } 4831 givu.Name = &name 4832 } 4833 case "type": 4834 if v != nil { 4835 var typeVar string 4836 err = json.Unmarshal(*v, &typeVar) 4837 if err != nil { 4838 return err 4839 } 4840 givu.Type = &typeVar 4841 } 4842 case "tags": 4843 if v != nil { 4844 var tags map[string]*string 4845 err = json.Unmarshal(*v, &tags) 4846 if err != nil { 4847 return err 4848 } 4849 givu.Tags = tags 4850 } 4851 } 4852 } 4853 4854 return nil 4855} 4856 4857// GalleryList the List Galleries operation response. 4858type GalleryList struct { 4859 autorest.Response `json:"-"` 4860 // Value - A list of galleries. 4861 Value *[]Gallery `json:"value,omitempty"` 4862 // NextLink - The uri to fetch the next page of galleries. Call ListNext() with this to fetch the next page of galleries. 4863 NextLink *string `json:"nextLink,omitempty"` 4864} 4865 4866// GalleryListIterator provides access to a complete listing of Gallery values. 4867type GalleryListIterator struct { 4868 i int 4869 page GalleryListPage 4870} 4871 4872// NextWithContext advances to the next value. If there was an error making 4873// the request the iterator does not advance and the error is returned. 4874func (iter *GalleryListIterator) NextWithContext(ctx context.Context) (err error) { 4875 if tracing.IsEnabled() { 4876 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryListIterator.NextWithContext") 4877 defer func() { 4878 sc := -1 4879 if iter.Response().Response.Response != nil { 4880 sc = iter.Response().Response.Response.StatusCode 4881 } 4882 tracing.EndSpan(ctx, sc, err) 4883 }() 4884 } 4885 iter.i++ 4886 if iter.i < len(iter.page.Values()) { 4887 return nil 4888 } 4889 err = iter.page.NextWithContext(ctx) 4890 if err != nil { 4891 iter.i-- 4892 return err 4893 } 4894 iter.i = 0 4895 return nil 4896} 4897 4898// Next advances to the next value. If there was an error making 4899// the request the iterator does not advance and the error is returned. 4900// Deprecated: Use NextWithContext() instead. 4901func (iter *GalleryListIterator) Next() error { 4902 return iter.NextWithContext(context.Background()) 4903} 4904 4905// NotDone returns true if the enumeration should be started or is not yet complete. 4906func (iter GalleryListIterator) NotDone() bool { 4907 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4908} 4909 4910// Response returns the raw server response from the last page request. 4911func (iter GalleryListIterator) Response() GalleryList { 4912 return iter.page.Response() 4913} 4914 4915// Value returns the current value or a zero-initialized value if the 4916// iterator has advanced beyond the end of the collection. 4917func (iter GalleryListIterator) Value() Gallery { 4918 if !iter.page.NotDone() { 4919 return Gallery{} 4920 } 4921 return iter.page.Values()[iter.i] 4922} 4923 4924// Creates a new instance of the GalleryListIterator type. 4925func NewGalleryListIterator(page GalleryListPage) GalleryListIterator { 4926 return GalleryListIterator{page: page} 4927} 4928 4929// IsEmpty returns true if the ListResult contains no values. 4930func (gl GalleryList) IsEmpty() bool { 4931 return gl.Value == nil || len(*gl.Value) == 0 4932} 4933 4934// hasNextLink returns true if the NextLink is not empty. 4935func (gl GalleryList) hasNextLink() bool { 4936 return gl.NextLink != nil && len(*gl.NextLink) != 0 4937} 4938 4939// galleryListPreparer prepares a request to retrieve the next set of results. 4940// It returns nil if no more results exist. 4941func (gl GalleryList) galleryListPreparer(ctx context.Context) (*http.Request, error) { 4942 if !gl.hasNextLink() { 4943 return nil, nil 4944 } 4945 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4946 autorest.AsJSON(), 4947 autorest.AsGet(), 4948 autorest.WithBaseURL(to.String(gl.NextLink))) 4949} 4950 4951// GalleryListPage contains a page of Gallery values. 4952type GalleryListPage struct { 4953 fn func(context.Context, GalleryList) (GalleryList, error) 4954 gl GalleryList 4955} 4956 4957// NextWithContext advances to the next page of values. If there was an error making 4958// the request the page does not advance and the error is returned. 4959func (page *GalleryListPage) NextWithContext(ctx context.Context) (err error) { 4960 if tracing.IsEnabled() { 4961 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryListPage.NextWithContext") 4962 defer func() { 4963 sc := -1 4964 if page.Response().Response.Response != nil { 4965 sc = page.Response().Response.Response.StatusCode 4966 } 4967 tracing.EndSpan(ctx, sc, err) 4968 }() 4969 } 4970 for { 4971 next, err := page.fn(ctx, page.gl) 4972 if err != nil { 4973 return err 4974 } 4975 page.gl = next 4976 if !next.hasNextLink() || !next.IsEmpty() { 4977 break 4978 } 4979 } 4980 return nil 4981} 4982 4983// Next advances to the next page of values. If there was an error making 4984// the request the page does not advance and the error is returned. 4985// Deprecated: Use NextWithContext() instead. 4986func (page *GalleryListPage) Next() error { 4987 return page.NextWithContext(context.Background()) 4988} 4989 4990// NotDone returns true if the page enumeration should be started or is not yet complete. 4991func (page GalleryListPage) NotDone() bool { 4992 return !page.gl.IsEmpty() 4993} 4994 4995// Response returns the raw server response from the last page request. 4996func (page GalleryListPage) Response() GalleryList { 4997 return page.gl 4998} 4999 5000// Values returns the slice of values for the current page or nil if there are no values. 5001func (page GalleryListPage) Values() []Gallery { 5002 if page.gl.IsEmpty() { 5003 return nil 5004 } 5005 return *page.gl.Value 5006} 5007 5008// Creates a new instance of the GalleryListPage type. 5009func NewGalleryListPage(cur GalleryList, getNextPage func(context.Context, GalleryList) (GalleryList, error)) GalleryListPage { 5010 return GalleryListPage{ 5011 fn: getNextPage, 5012 gl: cur, 5013 } 5014} 5015 5016// GalleryOSDiskImage this is the OS disk image. 5017type GalleryOSDiskImage struct { 5018 // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. 5019 SizeInGB *int32 `json:"sizeInGB,omitempty"` 5020 // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' 5021 HostCaching HostCaching `json:"hostCaching,omitempty"` 5022 Source *GalleryArtifactVersionSource `json:"source,omitempty"` 5023} 5024 5025// MarshalJSON is the custom marshaler for GalleryOSDiskImage. 5026func (godi GalleryOSDiskImage) MarshalJSON() ([]byte, error) { 5027 objectMap := make(map[string]interface{}) 5028 if godi.HostCaching != "" { 5029 objectMap["hostCaching"] = godi.HostCaching 5030 } 5031 if godi.Source != nil { 5032 objectMap["source"] = godi.Source 5033 } 5034 return json.Marshal(objectMap) 5035} 5036 5037// GalleryProperties describes the properties of a Shared Image Gallery. 5038type GalleryProperties struct { 5039 // Description - The description of this Shared Image Gallery resource. This property is updatable. 5040 Description *string `json:"description,omitempty"` 5041 Identifier *GalleryIdentifier `json:"identifier,omitempty"` 5042 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningStateCreating', 'ProvisioningStateUpdating', 'ProvisioningStateFailed', 'ProvisioningStateSucceeded', 'ProvisioningStateDeleting', 'ProvisioningStateMigrating' 5043 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 5044} 5045 5046// MarshalJSON is the custom marshaler for GalleryProperties. 5047func (gp GalleryProperties) MarshalJSON() ([]byte, error) { 5048 objectMap := make(map[string]interface{}) 5049 if gp.Description != nil { 5050 objectMap["description"] = gp.Description 5051 } 5052 if gp.Identifier != nil { 5053 objectMap["identifier"] = gp.Identifier 5054 } 5055 return json.Marshal(objectMap) 5056} 5057 5058// GalleryUpdate specifies information about the Shared Image Gallery that you want to update. 5059type GalleryUpdate struct { 5060 *GalleryProperties `json:"properties,omitempty"` 5061 // ID - READ-ONLY; Resource Id 5062 ID *string `json:"id,omitempty"` 5063 // Name - READ-ONLY; Resource name 5064 Name *string `json:"name,omitempty"` 5065 // Type - READ-ONLY; Resource type 5066 Type *string `json:"type,omitempty"` 5067 // Tags - Resource tags 5068 Tags map[string]*string `json:"tags"` 5069} 5070 5071// MarshalJSON is the custom marshaler for GalleryUpdate. 5072func (gu GalleryUpdate) MarshalJSON() ([]byte, error) { 5073 objectMap := make(map[string]interface{}) 5074 if gu.GalleryProperties != nil { 5075 objectMap["properties"] = gu.GalleryProperties 5076 } 5077 if gu.Tags != nil { 5078 objectMap["tags"] = gu.Tags 5079 } 5080 return json.Marshal(objectMap) 5081} 5082 5083// UnmarshalJSON is the custom unmarshaler for GalleryUpdate struct. 5084func (gu *GalleryUpdate) UnmarshalJSON(body []byte) error { 5085 var m map[string]*json.RawMessage 5086 err := json.Unmarshal(body, &m) 5087 if err != nil { 5088 return err 5089 } 5090 for k, v := range m { 5091 switch k { 5092 case "properties": 5093 if v != nil { 5094 var galleryProperties GalleryProperties 5095 err = json.Unmarshal(*v, &galleryProperties) 5096 if err != nil { 5097 return err 5098 } 5099 gu.GalleryProperties = &galleryProperties 5100 } 5101 case "id": 5102 if v != nil { 5103 var ID string 5104 err = json.Unmarshal(*v, &ID) 5105 if err != nil { 5106 return err 5107 } 5108 gu.ID = &ID 5109 } 5110 case "name": 5111 if v != nil { 5112 var name string 5113 err = json.Unmarshal(*v, &name) 5114 if err != nil { 5115 return err 5116 } 5117 gu.Name = &name 5118 } 5119 case "type": 5120 if v != nil { 5121 var typeVar string 5122 err = json.Unmarshal(*v, &typeVar) 5123 if err != nil { 5124 return err 5125 } 5126 gu.Type = &typeVar 5127 } 5128 case "tags": 5129 if v != nil { 5130 var tags map[string]*string 5131 err = json.Unmarshal(*v, &tags) 5132 if err != nil { 5133 return err 5134 } 5135 gu.Tags = tags 5136 } 5137 } 5138 } 5139 5140 return nil 5141} 5142 5143// GrantAccessData data used for requesting a SAS. 5144type GrantAccessData struct { 5145 // Access - Possible values include: 'None', 'Read', 'Write' 5146 Access AccessLevel `json:"access,omitempty"` 5147 // DurationInSeconds - Time duration in seconds until the SAS access expires. 5148 DurationInSeconds *int32 `json:"durationInSeconds,omitempty"` 5149} 5150 5151// HardwareProfile specifies the hardware settings for the virtual machine. 5152type HardwareProfile struct { 5153 // 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' 5154 VMSize VirtualMachineSizeTypes `json:"vmSize,omitempty"` 5155} 5156 5157// Image the source user image virtual hard disk. The virtual hard disk will be copied before being 5158// attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not 5159// exist. 5160type Image struct { 5161 autorest.Response `json:"-"` 5162 *ImageProperties `json:"properties,omitempty"` 5163 // ID - READ-ONLY; Resource Id 5164 ID *string `json:"id,omitempty"` 5165 // Name - READ-ONLY; Resource name 5166 Name *string `json:"name,omitempty"` 5167 // Type - READ-ONLY; Resource type 5168 Type *string `json:"type,omitempty"` 5169 // Location - Resource location 5170 Location *string `json:"location,omitempty"` 5171 // Tags - Resource tags 5172 Tags map[string]*string `json:"tags"` 5173} 5174 5175// MarshalJSON is the custom marshaler for Image. 5176func (i Image) MarshalJSON() ([]byte, error) { 5177 objectMap := make(map[string]interface{}) 5178 if i.ImageProperties != nil { 5179 objectMap["properties"] = i.ImageProperties 5180 } 5181 if i.Location != nil { 5182 objectMap["location"] = i.Location 5183 } 5184 if i.Tags != nil { 5185 objectMap["tags"] = i.Tags 5186 } 5187 return json.Marshal(objectMap) 5188} 5189 5190// UnmarshalJSON is the custom unmarshaler for Image struct. 5191func (i *Image) UnmarshalJSON(body []byte) error { 5192 var m map[string]*json.RawMessage 5193 err := json.Unmarshal(body, &m) 5194 if err != nil { 5195 return err 5196 } 5197 for k, v := range m { 5198 switch k { 5199 case "properties": 5200 if v != nil { 5201 var imageProperties ImageProperties 5202 err = json.Unmarshal(*v, &imageProperties) 5203 if err != nil { 5204 return err 5205 } 5206 i.ImageProperties = &imageProperties 5207 } 5208 case "id": 5209 if v != nil { 5210 var ID string 5211 err = json.Unmarshal(*v, &ID) 5212 if err != nil { 5213 return err 5214 } 5215 i.ID = &ID 5216 } 5217 case "name": 5218 if v != nil { 5219 var name string 5220 err = json.Unmarshal(*v, &name) 5221 if err != nil { 5222 return err 5223 } 5224 i.Name = &name 5225 } 5226 case "type": 5227 if v != nil { 5228 var typeVar string 5229 err = json.Unmarshal(*v, &typeVar) 5230 if err != nil { 5231 return err 5232 } 5233 i.Type = &typeVar 5234 } 5235 case "location": 5236 if v != nil { 5237 var location string 5238 err = json.Unmarshal(*v, &location) 5239 if err != nil { 5240 return err 5241 } 5242 i.Location = &location 5243 } 5244 case "tags": 5245 if v != nil { 5246 var tags map[string]*string 5247 err = json.Unmarshal(*v, &tags) 5248 if err != nil { 5249 return err 5250 } 5251 i.Tags = tags 5252 } 5253 } 5254 } 5255 5256 return nil 5257} 5258 5259// ImageDataDisk describes a data disk. 5260type ImageDataDisk struct { 5261 // 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. 5262 Lun *int32 `json:"lun,omitempty"` 5263 // Snapshot - The snapshot. 5264 Snapshot *SubResource `json:"snapshot,omitempty"` 5265 // ManagedDisk - The managedDisk. 5266 ManagedDisk *SubResource `json:"managedDisk,omitempty"` 5267 // BlobURI - The Virtual Hard Disk. 5268 BlobURI *string `json:"blobUri,omitempty"` 5269 // 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' 5270 Caching CachingTypes `json:"caching,omitempty"` 5271 // 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 5272 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 5273 // 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' 5274 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 5275 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. 5276 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 5277} 5278 5279// ImageDisk describes a image disk. 5280type ImageDisk struct { 5281 // Snapshot - The snapshot. 5282 Snapshot *SubResource `json:"snapshot,omitempty"` 5283 // ManagedDisk - The managedDisk. 5284 ManagedDisk *SubResource `json:"managedDisk,omitempty"` 5285 // BlobURI - The Virtual Hard Disk. 5286 BlobURI *string `json:"blobUri,omitempty"` 5287 // 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' 5288 Caching CachingTypes `json:"caching,omitempty"` 5289 // 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 5290 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 5291 // 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' 5292 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 5293 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. 5294 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 5295} 5296 5297// ImageDiskReference the source image used for creating the disk. 5298type ImageDiskReference struct { 5299 // ID - A relative uri containing either a Platform Image Repository or user image reference. 5300 ID *string `json:"id,omitempty"` 5301 // 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. 5302 Lun *int32 `json:"lun,omitempty"` 5303} 5304 5305// ImageListResult the List Image operation response. 5306type ImageListResult struct { 5307 autorest.Response `json:"-"` 5308 // Value - The list of Images. 5309 Value *[]Image `json:"value,omitempty"` 5310 // NextLink - The uri to fetch the next page of Images. Call ListNext() with this to fetch the next page of Images. 5311 NextLink *string `json:"nextLink,omitempty"` 5312} 5313 5314// ImageListResultIterator provides access to a complete listing of Image values. 5315type ImageListResultIterator struct { 5316 i int 5317 page ImageListResultPage 5318} 5319 5320// NextWithContext advances to the next value. If there was an error making 5321// the request the iterator does not advance and the error is returned. 5322func (iter *ImageListResultIterator) NextWithContext(ctx context.Context) (err error) { 5323 if tracing.IsEnabled() { 5324 ctx = tracing.StartSpan(ctx, fqdn+"/ImageListResultIterator.NextWithContext") 5325 defer func() { 5326 sc := -1 5327 if iter.Response().Response.Response != nil { 5328 sc = iter.Response().Response.Response.StatusCode 5329 } 5330 tracing.EndSpan(ctx, sc, err) 5331 }() 5332 } 5333 iter.i++ 5334 if iter.i < len(iter.page.Values()) { 5335 return nil 5336 } 5337 err = iter.page.NextWithContext(ctx) 5338 if err != nil { 5339 iter.i-- 5340 return err 5341 } 5342 iter.i = 0 5343 return nil 5344} 5345 5346// Next advances to the next value. If there was an error making 5347// the request the iterator does not advance and the error is returned. 5348// Deprecated: Use NextWithContext() instead. 5349func (iter *ImageListResultIterator) Next() error { 5350 return iter.NextWithContext(context.Background()) 5351} 5352 5353// NotDone returns true if the enumeration should be started or is not yet complete. 5354func (iter ImageListResultIterator) NotDone() bool { 5355 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5356} 5357 5358// Response returns the raw server response from the last page request. 5359func (iter ImageListResultIterator) Response() ImageListResult { 5360 return iter.page.Response() 5361} 5362 5363// Value returns the current value or a zero-initialized value if the 5364// iterator has advanced beyond the end of the collection. 5365func (iter ImageListResultIterator) Value() Image { 5366 if !iter.page.NotDone() { 5367 return Image{} 5368 } 5369 return iter.page.Values()[iter.i] 5370} 5371 5372// Creates a new instance of the ImageListResultIterator type. 5373func NewImageListResultIterator(page ImageListResultPage) ImageListResultIterator { 5374 return ImageListResultIterator{page: page} 5375} 5376 5377// IsEmpty returns true if the ListResult contains no values. 5378func (ilr ImageListResult) IsEmpty() bool { 5379 return ilr.Value == nil || len(*ilr.Value) == 0 5380} 5381 5382// hasNextLink returns true if the NextLink is not empty. 5383func (ilr ImageListResult) hasNextLink() bool { 5384 return ilr.NextLink != nil && len(*ilr.NextLink) != 0 5385} 5386 5387// imageListResultPreparer prepares a request to retrieve the next set of results. 5388// It returns nil if no more results exist. 5389func (ilr ImageListResult) imageListResultPreparer(ctx context.Context) (*http.Request, error) { 5390 if !ilr.hasNextLink() { 5391 return nil, nil 5392 } 5393 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5394 autorest.AsJSON(), 5395 autorest.AsGet(), 5396 autorest.WithBaseURL(to.String(ilr.NextLink))) 5397} 5398 5399// ImageListResultPage contains a page of Image values. 5400type ImageListResultPage struct { 5401 fn func(context.Context, ImageListResult) (ImageListResult, error) 5402 ilr ImageListResult 5403} 5404 5405// NextWithContext advances to the next page of values. If there was an error making 5406// the request the page does not advance and the error is returned. 5407func (page *ImageListResultPage) NextWithContext(ctx context.Context) (err error) { 5408 if tracing.IsEnabled() { 5409 ctx = tracing.StartSpan(ctx, fqdn+"/ImageListResultPage.NextWithContext") 5410 defer func() { 5411 sc := -1 5412 if page.Response().Response.Response != nil { 5413 sc = page.Response().Response.Response.StatusCode 5414 } 5415 tracing.EndSpan(ctx, sc, err) 5416 }() 5417 } 5418 for { 5419 next, err := page.fn(ctx, page.ilr) 5420 if err != nil { 5421 return err 5422 } 5423 page.ilr = next 5424 if !next.hasNextLink() || !next.IsEmpty() { 5425 break 5426 } 5427 } 5428 return nil 5429} 5430 5431// Next advances to the next page of values. If there was an error making 5432// the request the page does not advance and the error is returned. 5433// Deprecated: Use NextWithContext() instead. 5434func (page *ImageListResultPage) Next() error { 5435 return page.NextWithContext(context.Background()) 5436} 5437 5438// NotDone returns true if the page enumeration should be started or is not yet complete. 5439func (page ImageListResultPage) NotDone() bool { 5440 return !page.ilr.IsEmpty() 5441} 5442 5443// Response returns the raw server response from the last page request. 5444func (page ImageListResultPage) Response() ImageListResult { 5445 return page.ilr 5446} 5447 5448// Values returns the slice of values for the current page or nil if there are no values. 5449func (page ImageListResultPage) Values() []Image { 5450 if page.ilr.IsEmpty() { 5451 return nil 5452 } 5453 return *page.ilr.Value 5454} 5455 5456// Creates a new instance of the ImageListResultPage type. 5457func NewImageListResultPage(cur ImageListResult, getNextPage func(context.Context, ImageListResult) (ImageListResult, error)) ImageListResultPage { 5458 return ImageListResultPage{ 5459 fn: getNextPage, 5460 ilr: cur, 5461 } 5462} 5463 5464// ImageOSDisk describes an Operating System disk. 5465type ImageOSDisk struct { 5466 // 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' 5467 OsType OperatingSystemTypes `json:"osType,omitempty"` 5468 // OsState - The OS State. Possible values include: 'Generalized', 'Specialized' 5469 OsState OperatingSystemStateTypes `json:"osState,omitempty"` 5470 // Snapshot - The snapshot. 5471 Snapshot *SubResource `json:"snapshot,omitempty"` 5472 // ManagedDisk - The managedDisk. 5473 ManagedDisk *SubResource `json:"managedDisk,omitempty"` 5474 // BlobURI - The Virtual Hard Disk. 5475 BlobURI *string `json:"blobUri,omitempty"` 5476 // 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' 5477 Caching CachingTypes `json:"caching,omitempty"` 5478 // 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 5479 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 5480 // 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' 5481 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 5482 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. 5483 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 5484} 5485 5486// ImageProperties describes the properties of an Image. 5487type ImageProperties struct { 5488 // SourceVirtualMachine - The source virtual machine from which Image is created. 5489 SourceVirtualMachine *SubResource `json:"sourceVirtualMachine,omitempty"` 5490 // StorageProfile - Specifies the storage settings for the virtual machine disks. 5491 StorageProfile *ImageStorageProfile `json:"storageProfile,omitempty"` 5492 // ProvisioningState - READ-ONLY; The provisioning state. 5493 ProvisioningState *string `json:"provisioningState,omitempty"` 5494 // HyperVGeneration - Gets the HyperVGenerationType of the VirtualMachine created from the image. Possible values include: 'HyperVGenerationTypesV1', 'HyperVGenerationTypesV2' 5495 HyperVGeneration HyperVGenerationTypes `json:"hyperVGeneration,omitempty"` 5496} 5497 5498// MarshalJSON is the custom marshaler for ImageProperties. 5499func (IP ImageProperties) MarshalJSON() ([]byte, error) { 5500 objectMap := make(map[string]interface{}) 5501 if IP.SourceVirtualMachine != nil { 5502 objectMap["sourceVirtualMachine"] = IP.SourceVirtualMachine 5503 } 5504 if IP.StorageProfile != nil { 5505 objectMap["storageProfile"] = IP.StorageProfile 5506 } 5507 if IP.HyperVGeneration != "" { 5508 objectMap["hyperVGeneration"] = IP.HyperVGeneration 5509 } 5510 return json.Marshal(objectMap) 5511} 5512 5513// ImagePurchasePlan describes the gallery Image Definition purchase plan. This is used by marketplace 5514// images. 5515type ImagePurchasePlan struct { 5516 // Name - The plan ID. 5517 Name *string `json:"name,omitempty"` 5518 // Publisher - The publisher ID. 5519 Publisher *string `json:"publisher,omitempty"` 5520 // Product - The product ID. 5521 Product *string `json:"product,omitempty"` 5522} 5523 5524// ImageReference specifies information about the image to use. You can specify information about platform 5525// images, marketplace images, or virtual machine images. This element is required when you want to use a 5526// platform image, marketplace image, or virtual machine image, but is not used in other creation 5527// operations. NOTE: Image reference publisher and offer can only be set when you create the scale set. 5528type ImageReference struct { 5529 // Publisher - The image publisher. 5530 Publisher *string `json:"publisher,omitempty"` 5531 // Offer - Specifies the offer of the platform image or marketplace image used to create the virtual machine. 5532 Offer *string `json:"offer,omitempty"` 5533 // Sku - The image SKU. 5534 Sku *string `json:"sku,omitempty"` 5535 // 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. 5536 Version *string `json:"version,omitempty"` 5537 // 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'. 5538 ExactVersion *string `json:"exactVersion,omitempty"` 5539 // ID - Resource Id 5540 ID *string `json:"id,omitempty"` 5541} 5542 5543// MarshalJSON is the custom marshaler for ImageReference. 5544func (ir ImageReference) MarshalJSON() ([]byte, error) { 5545 objectMap := make(map[string]interface{}) 5546 if ir.Publisher != nil { 5547 objectMap["publisher"] = ir.Publisher 5548 } 5549 if ir.Offer != nil { 5550 objectMap["offer"] = ir.Offer 5551 } 5552 if ir.Sku != nil { 5553 objectMap["sku"] = ir.Sku 5554 } 5555 if ir.Version != nil { 5556 objectMap["version"] = ir.Version 5557 } 5558 if ir.ID != nil { 5559 objectMap["id"] = ir.ID 5560 } 5561 return json.Marshal(objectMap) 5562} 5563 5564// ImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 5565// operation. 5566type ImagesCreateOrUpdateFuture struct { 5567 azure.FutureAPI 5568 // Result returns the result of the asynchronous operation. 5569 // If the operation has not completed it will return an error. 5570 Result func(ImagesClient) (Image, error) 5571} 5572 5573// ImagesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 5574type ImagesDeleteFuture struct { 5575 azure.FutureAPI 5576 // Result returns the result of the asynchronous operation. 5577 // If the operation has not completed it will return an error. 5578 Result func(ImagesClient) (autorest.Response, error) 5579} 5580 5581// ImageStorageProfile describes a storage profile. 5582type ImageStorageProfile struct { 5583 // 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). 5584 OsDisk *ImageOSDisk `json:"osDisk,omitempty"` 5585 // 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). 5586 DataDisks *[]ImageDataDisk `json:"dataDisks,omitempty"` 5587 // 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). 5588 ZoneResilient *bool `json:"zoneResilient,omitempty"` 5589} 5590 5591// ImagesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. 5592type ImagesUpdateFuture struct { 5593 azure.FutureAPI 5594 // Result returns the result of the asynchronous operation. 5595 // If the operation has not completed it will return an error. 5596 Result func(ImagesClient) (Image, error) 5597} 5598 5599// ImageUpdate the source user image virtual hard disk. Only tags may be updated. 5600type ImageUpdate struct { 5601 *ImageProperties `json:"properties,omitempty"` 5602 // Tags - Resource tags 5603 Tags map[string]*string `json:"tags"` 5604} 5605 5606// MarshalJSON is the custom marshaler for ImageUpdate. 5607func (iu ImageUpdate) MarshalJSON() ([]byte, error) { 5608 objectMap := make(map[string]interface{}) 5609 if iu.ImageProperties != nil { 5610 objectMap["properties"] = iu.ImageProperties 5611 } 5612 if iu.Tags != nil { 5613 objectMap["tags"] = iu.Tags 5614 } 5615 return json.Marshal(objectMap) 5616} 5617 5618// UnmarshalJSON is the custom unmarshaler for ImageUpdate struct. 5619func (iu *ImageUpdate) UnmarshalJSON(body []byte) error { 5620 var m map[string]*json.RawMessage 5621 err := json.Unmarshal(body, &m) 5622 if err != nil { 5623 return err 5624 } 5625 for k, v := range m { 5626 switch k { 5627 case "properties": 5628 if v != nil { 5629 var imageProperties ImageProperties 5630 err = json.Unmarshal(*v, &imageProperties) 5631 if err != nil { 5632 return err 5633 } 5634 iu.ImageProperties = &imageProperties 5635 } 5636 case "tags": 5637 if v != nil { 5638 var tags map[string]*string 5639 err = json.Unmarshal(*v, &tags) 5640 if err != nil { 5641 return err 5642 } 5643 iu.Tags = tags 5644 } 5645 } 5646 } 5647 5648 return nil 5649} 5650 5651// InnerError inner error details. 5652type InnerError struct { 5653 // Exceptiontype - The exception type. 5654 Exceptiontype *string `json:"exceptiontype,omitempty"` 5655 // Errordetail - The internal error message or exception dump. 5656 Errordetail *string `json:"errordetail,omitempty"` 5657} 5658 5659// InstanceViewStatus instance view status. 5660type InstanceViewStatus struct { 5661 // Code - The status code. 5662 Code *string `json:"code,omitempty"` 5663 // Level - The level code. Possible values include: 'Info', 'Warning', 'Error' 5664 Level StatusLevelTypes `json:"level,omitempty"` 5665 // DisplayStatus - The short localizable label for the status. 5666 DisplayStatus *string `json:"displayStatus,omitempty"` 5667 // Message - The detailed status message, including for alerts and error messages. 5668 Message *string `json:"message,omitempty"` 5669 // Time - The time of the status. 5670 Time *date.Time `json:"time,omitempty"` 5671} 5672 5673// KeyVaultAndKeyReference key Vault Key Url and vault id of KeK, KeK is optional and when provided is used 5674// to unwrap the encryptionKey 5675type KeyVaultAndKeyReference struct { 5676 // SourceVault - Resource id of the KeyVault containing the key or secret 5677 SourceVault *SourceVault `json:"sourceVault,omitempty"` 5678 // KeyURL - Url pointing to a key or secret in KeyVault 5679 KeyURL *string `json:"keyUrl,omitempty"` 5680} 5681 5682// KeyVaultAndSecretReference key Vault Secret Url and vault id of the encryption key 5683type KeyVaultAndSecretReference struct { 5684 // SourceVault - Resource id of the KeyVault containing the key or secret 5685 SourceVault *SourceVault `json:"sourceVault,omitempty"` 5686 // SecretURL - Url pointing to a key or secret in KeyVault 5687 SecretURL *string `json:"secretUrl,omitempty"` 5688} 5689 5690// KeyVaultKeyReference describes a reference to Key Vault Key 5691type KeyVaultKeyReference struct { 5692 // KeyURL - The URL referencing a key encryption key in Key Vault. 5693 KeyURL *string `json:"keyUrl,omitempty"` 5694 // SourceVault - The relative URL of the Key Vault containing the key. 5695 SourceVault *SubResource `json:"sourceVault,omitempty"` 5696} 5697 5698// KeyVaultSecretReference describes a reference to Key Vault Secret 5699type KeyVaultSecretReference struct { 5700 // SecretURL - The URL referencing a secret in a Key Vault. 5701 SecretURL *string `json:"secretUrl,omitempty"` 5702 // SourceVault - The relative URL of the Key Vault containing the secret. 5703 SourceVault *SubResource `json:"sourceVault,omitempty"` 5704} 5705 5706// LinuxConfiguration specifies the Linux operating system settings on the virtual machine. <br><br>For a 5707// list of supported Linux distributions, see [Linux on Azure-Endorsed 5708// Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) 5709// <br><br> For running non-endorsed distributions, see [Information for Non-Endorsed 5710// Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). 5711type LinuxConfiguration struct { 5712 // DisablePasswordAuthentication - Specifies whether password authentication should be disabled. 5713 DisablePasswordAuthentication *bool `json:"disablePasswordAuthentication,omitempty"` 5714 // SSH - Specifies the ssh key configuration for a Linux OS. 5715 SSH *SSHConfiguration `json:"ssh,omitempty"` 5716 // 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. 5717 ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` 5718} 5719 5720// ListUsagesResult the List Usages operation response. 5721type ListUsagesResult struct { 5722 autorest.Response `json:"-"` 5723 // Value - The list of compute resource usages. 5724 Value *[]Usage `json:"value,omitempty"` 5725 // 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. 5726 NextLink *string `json:"nextLink,omitempty"` 5727} 5728 5729// ListUsagesResultIterator provides access to a complete listing of Usage values. 5730type ListUsagesResultIterator struct { 5731 i int 5732 page ListUsagesResultPage 5733} 5734 5735// NextWithContext advances to the next value. If there was an error making 5736// the request the iterator does not advance and the error is returned. 5737func (iter *ListUsagesResultIterator) NextWithContext(ctx context.Context) (err error) { 5738 if tracing.IsEnabled() { 5739 ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultIterator.NextWithContext") 5740 defer func() { 5741 sc := -1 5742 if iter.Response().Response.Response != nil { 5743 sc = iter.Response().Response.Response.StatusCode 5744 } 5745 tracing.EndSpan(ctx, sc, err) 5746 }() 5747 } 5748 iter.i++ 5749 if iter.i < len(iter.page.Values()) { 5750 return nil 5751 } 5752 err = iter.page.NextWithContext(ctx) 5753 if err != nil { 5754 iter.i-- 5755 return err 5756 } 5757 iter.i = 0 5758 return nil 5759} 5760 5761// Next advances to the next value. If there was an error making 5762// the request the iterator does not advance and the error is returned. 5763// Deprecated: Use NextWithContext() instead. 5764func (iter *ListUsagesResultIterator) Next() error { 5765 return iter.NextWithContext(context.Background()) 5766} 5767 5768// NotDone returns true if the enumeration should be started or is not yet complete. 5769func (iter ListUsagesResultIterator) NotDone() bool { 5770 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5771} 5772 5773// Response returns the raw server response from the last page request. 5774func (iter ListUsagesResultIterator) Response() ListUsagesResult { 5775 return iter.page.Response() 5776} 5777 5778// Value returns the current value or a zero-initialized value if the 5779// iterator has advanced beyond the end of the collection. 5780func (iter ListUsagesResultIterator) Value() Usage { 5781 if !iter.page.NotDone() { 5782 return Usage{} 5783 } 5784 return iter.page.Values()[iter.i] 5785} 5786 5787// Creates a new instance of the ListUsagesResultIterator type. 5788func NewListUsagesResultIterator(page ListUsagesResultPage) ListUsagesResultIterator { 5789 return ListUsagesResultIterator{page: page} 5790} 5791 5792// IsEmpty returns true if the ListResult contains no values. 5793func (lur ListUsagesResult) IsEmpty() bool { 5794 return lur.Value == nil || len(*lur.Value) == 0 5795} 5796 5797// hasNextLink returns true if the NextLink is not empty. 5798func (lur ListUsagesResult) hasNextLink() bool { 5799 return lur.NextLink != nil && len(*lur.NextLink) != 0 5800} 5801 5802// listUsagesResultPreparer prepares a request to retrieve the next set of results. 5803// It returns nil if no more results exist. 5804func (lur ListUsagesResult) listUsagesResultPreparer(ctx context.Context) (*http.Request, error) { 5805 if !lur.hasNextLink() { 5806 return nil, nil 5807 } 5808 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5809 autorest.AsJSON(), 5810 autorest.AsGet(), 5811 autorest.WithBaseURL(to.String(lur.NextLink))) 5812} 5813 5814// ListUsagesResultPage contains a page of Usage values. 5815type ListUsagesResultPage struct { 5816 fn func(context.Context, ListUsagesResult) (ListUsagesResult, error) 5817 lur ListUsagesResult 5818} 5819 5820// NextWithContext advances to the next page of values. If there was an error making 5821// the request the page does not advance and the error is returned. 5822func (page *ListUsagesResultPage) NextWithContext(ctx context.Context) (err error) { 5823 if tracing.IsEnabled() { 5824 ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultPage.NextWithContext") 5825 defer func() { 5826 sc := -1 5827 if page.Response().Response.Response != nil { 5828 sc = page.Response().Response.Response.StatusCode 5829 } 5830 tracing.EndSpan(ctx, sc, err) 5831 }() 5832 } 5833 for { 5834 next, err := page.fn(ctx, page.lur) 5835 if err != nil { 5836 return err 5837 } 5838 page.lur = next 5839 if !next.hasNextLink() || !next.IsEmpty() { 5840 break 5841 } 5842 } 5843 return nil 5844} 5845 5846// Next advances to the next page of values. If there was an error making 5847// the request the page does not advance and the error is returned. 5848// Deprecated: Use NextWithContext() instead. 5849func (page *ListUsagesResultPage) Next() error { 5850 return page.NextWithContext(context.Background()) 5851} 5852 5853// NotDone returns true if the page enumeration should be started or is not yet complete. 5854func (page ListUsagesResultPage) NotDone() bool { 5855 return !page.lur.IsEmpty() 5856} 5857 5858// Response returns the raw server response from the last page request. 5859func (page ListUsagesResultPage) Response() ListUsagesResult { 5860 return page.lur 5861} 5862 5863// Values returns the slice of values for the current page or nil if there are no values. 5864func (page ListUsagesResultPage) Values() []Usage { 5865 if page.lur.IsEmpty() { 5866 return nil 5867 } 5868 return *page.lur.Value 5869} 5870 5871// Creates a new instance of the ListUsagesResultPage type. 5872func NewListUsagesResultPage(cur ListUsagesResult, getNextPage func(context.Context, ListUsagesResult) (ListUsagesResult, error)) ListUsagesResultPage { 5873 return ListUsagesResultPage{ 5874 fn: getNextPage, 5875 lur: cur, 5876 } 5877} 5878 5879// ListVirtualMachineExtensionImage ... 5880type ListVirtualMachineExtensionImage struct { 5881 autorest.Response `json:"-"` 5882 Value *[]VirtualMachineExtensionImage `json:"value,omitempty"` 5883} 5884 5885// ListVirtualMachineImageResource ... 5886type ListVirtualMachineImageResource struct { 5887 autorest.Response `json:"-"` 5888 Value *[]VirtualMachineImageResource `json:"value,omitempty"` 5889} 5890 5891// LogAnalyticsExportRequestRateByIntervalFuture an abstraction for monitoring and retrieving the results 5892// of a long-running operation. 5893type LogAnalyticsExportRequestRateByIntervalFuture struct { 5894 azure.FutureAPI 5895 // Result returns the result of the asynchronous operation. 5896 // If the operation has not completed it will return an error. 5897 Result func(LogAnalyticsClient) (LogAnalyticsOperationResult, error) 5898} 5899 5900// LogAnalyticsExportThrottledRequestsFuture an abstraction for monitoring and retrieving the results of a 5901// long-running operation. 5902type LogAnalyticsExportThrottledRequestsFuture struct { 5903 azure.FutureAPI 5904 // Result returns the result of the asynchronous operation. 5905 // If the operation has not completed it will return an error. 5906 Result func(LogAnalyticsClient) (LogAnalyticsOperationResult, error) 5907} 5908 5909// LogAnalyticsInputBase api input base class for LogAnalytics Api. 5910type LogAnalyticsInputBase struct { 5911 // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. 5912 BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` 5913 // FromTime - From time of the query 5914 FromTime *date.Time `json:"fromTime,omitempty"` 5915 // ToTime - To time of the query 5916 ToTime *date.Time `json:"toTime,omitempty"` 5917 // GroupByThrottlePolicy - Group query result by Throttle Policy applied. 5918 GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` 5919 // GroupByOperationName - Group query result by Operation Name. 5920 GroupByOperationName *bool `json:"groupByOperationName,omitempty"` 5921 // GroupByResourceName - Group query result by Resource Name. 5922 GroupByResourceName *bool `json:"groupByResourceName,omitempty"` 5923} 5924 5925// LogAnalyticsOperationResult logAnalytics operation status response 5926type LogAnalyticsOperationResult struct { 5927 autorest.Response `json:"-"` 5928 // Properties - READ-ONLY; LogAnalyticsOutput 5929 Properties *LogAnalyticsOutput `json:"properties,omitempty"` 5930} 5931 5932// LogAnalyticsOutput logAnalytics output properties 5933type LogAnalyticsOutput struct { 5934 // Output - READ-ONLY; Output file Uri path to blob container. 5935 Output *string `json:"output,omitempty"` 5936} 5937 5938// MaintenanceRedeployStatus maintenance Operation Status. 5939type MaintenanceRedeployStatus struct { 5940 // IsCustomerInitiatedMaintenanceAllowed - True, if customer is allowed to perform Maintenance. 5941 IsCustomerInitiatedMaintenanceAllowed *bool `json:"isCustomerInitiatedMaintenanceAllowed,omitempty"` 5942 // PreMaintenanceWindowStartTime - Start Time for the Pre Maintenance Window. 5943 PreMaintenanceWindowStartTime *date.Time `json:"preMaintenanceWindowStartTime,omitempty"` 5944 // PreMaintenanceWindowEndTime - End Time for the Pre Maintenance Window. 5945 PreMaintenanceWindowEndTime *date.Time `json:"preMaintenanceWindowEndTime,omitempty"` 5946 // MaintenanceWindowStartTime - Start Time for the Maintenance Window. 5947 MaintenanceWindowStartTime *date.Time `json:"maintenanceWindowStartTime,omitempty"` 5948 // MaintenanceWindowEndTime - End Time for the Maintenance Window. 5949 MaintenanceWindowEndTime *date.Time `json:"maintenanceWindowEndTime,omitempty"` 5950 // LastOperationResultCode - The Last Maintenance Operation Result Code. Possible values include: 'MaintenanceOperationResultCodeTypesNone', 'MaintenanceOperationResultCodeTypesRetryLater', 'MaintenanceOperationResultCodeTypesMaintenanceAborted', 'MaintenanceOperationResultCodeTypesMaintenanceCompleted' 5951 LastOperationResultCode MaintenanceOperationResultCodeTypes `json:"lastOperationResultCode,omitempty"` 5952 // LastOperationMessage - Message returned for the last Maintenance Operation. 5953 LastOperationMessage *string `json:"lastOperationMessage,omitempty"` 5954} 5955 5956// ManagedArtifact the managed artifact. 5957type ManagedArtifact struct { 5958 // ID - The managed artifact id. 5959 ID *string `json:"id,omitempty"` 5960} 5961 5962// ManagedDiskParameters the parameters of a managed disk. 5963type ManagedDiskParameters struct { 5964 // 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' 5965 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 5966 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed disk. 5967 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 5968 // ID - Resource Id 5969 ID *string `json:"id,omitempty"` 5970} 5971 5972// NetworkInterfaceReference describes a network interface reference. 5973type NetworkInterfaceReference struct { 5974 *NetworkInterfaceReferenceProperties `json:"properties,omitempty"` 5975 // ID - Resource Id 5976 ID *string `json:"id,omitempty"` 5977} 5978 5979// MarshalJSON is the custom marshaler for NetworkInterfaceReference. 5980func (nir NetworkInterfaceReference) MarshalJSON() ([]byte, error) { 5981 objectMap := make(map[string]interface{}) 5982 if nir.NetworkInterfaceReferenceProperties != nil { 5983 objectMap["properties"] = nir.NetworkInterfaceReferenceProperties 5984 } 5985 if nir.ID != nil { 5986 objectMap["id"] = nir.ID 5987 } 5988 return json.Marshal(objectMap) 5989} 5990 5991// UnmarshalJSON is the custom unmarshaler for NetworkInterfaceReference struct. 5992func (nir *NetworkInterfaceReference) UnmarshalJSON(body []byte) error { 5993 var m map[string]*json.RawMessage 5994 err := json.Unmarshal(body, &m) 5995 if err != nil { 5996 return err 5997 } 5998 for k, v := range m { 5999 switch k { 6000 case "properties": 6001 if v != nil { 6002 var networkInterfaceReferenceProperties NetworkInterfaceReferenceProperties 6003 err = json.Unmarshal(*v, &networkInterfaceReferenceProperties) 6004 if err != nil { 6005 return err 6006 } 6007 nir.NetworkInterfaceReferenceProperties = &networkInterfaceReferenceProperties 6008 } 6009 case "id": 6010 if v != nil { 6011 var ID string 6012 err = json.Unmarshal(*v, &ID) 6013 if err != nil { 6014 return err 6015 } 6016 nir.ID = &ID 6017 } 6018 } 6019 } 6020 6021 return nil 6022} 6023 6024// NetworkInterfaceReferenceProperties describes a network interface reference properties. 6025type NetworkInterfaceReferenceProperties struct { 6026 // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. 6027 Primary *bool `json:"primary,omitempty"` 6028} 6029 6030// NetworkProfile specifies the network interfaces of the virtual machine. 6031type NetworkProfile struct { 6032 // NetworkInterfaces - Specifies the list of resource Ids for the network interfaces associated with the virtual machine. 6033 NetworkInterfaces *[]NetworkInterfaceReference `json:"networkInterfaces,omitempty"` 6034} 6035 6036// OperationListResult the List Compute Operation operation response. 6037type OperationListResult struct { 6038 autorest.Response `json:"-"` 6039 // Value - READ-ONLY; The list of compute operations 6040 Value *[]OperationValue `json:"value,omitempty"` 6041} 6042 6043// OperationValue describes the properties of a Compute Operation value. 6044type OperationValue struct { 6045 // Origin - READ-ONLY; The origin of the compute operation. 6046 Origin *string `json:"origin,omitempty"` 6047 // Name - READ-ONLY; The name of the compute operation. 6048 Name *string `json:"name,omitempty"` 6049 *OperationValueDisplay `json:"display,omitempty"` 6050} 6051 6052// MarshalJSON is the custom marshaler for OperationValue. 6053func (ov OperationValue) MarshalJSON() ([]byte, error) { 6054 objectMap := make(map[string]interface{}) 6055 if ov.OperationValueDisplay != nil { 6056 objectMap["display"] = ov.OperationValueDisplay 6057 } 6058 return json.Marshal(objectMap) 6059} 6060 6061// UnmarshalJSON is the custom unmarshaler for OperationValue struct. 6062func (ov *OperationValue) UnmarshalJSON(body []byte) error { 6063 var m map[string]*json.RawMessage 6064 err := json.Unmarshal(body, &m) 6065 if err != nil { 6066 return err 6067 } 6068 for k, v := range m { 6069 switch k { 6070 case "origin": 6071 if v != nil { 6072 var origin string 6073 err = json.Unmarshal(*v, &origin) 6074 if err != nil { 6075 return err 6076 } 6077 ov.Origin = &origin 6078 } 6079 case "name": 6080 if v != nil { 6081 var name string 6082 err = json.Unmarshal(*v, &name) 6083 if err != nil { 6084 return err 6085 } 6086 ov.Name = &name 6087 } 6088 case "display": 6089 if v != nil { 6090 var operationValueDisplay OperationValueDisplay 6091 err = json.Unmarshal(*v, &operationValueDisplay) 6092 if err != nil { 6093 return err 6094 } 6095 ov.OperationValueDisplay = &operationValueDisplay 6096 } 6097 } 6098 } 6099 6100 return nil 6101} 6102 6103// OperationValueDisplay describes the properties of a Compute Operation Value Display. 6104type OperationValueDisplay struct { 6105 // Operation - READ-ONLY; The display name of the compute operation. 6106 Operation *string `json:"operation,omitempty"` 6107 // Resource - READ-ONLY; The display name of the resource the operation applies to. 6108 Resource *string `json:"resource,omitempty"` 6109 // Description - READ-ONLY; The description of the operation. 6110 Description *string `json:"description,omitempty"` 6111 // Provider - READ-ONLY; The resource provider for the operation. 6112 Provider *string `json:"provider,omitempty"` 6113} 6114 6115// OrchestrationServiceStateInput the input for OrchestrationServiceState 6116type OrchestrationServiceStateInput struct { 6117 // ServiceName - The name of the service. Possible values include: 'AutomaticRepairs' 6118 ServiceName OrchestrationServiceNames `json:"serviceName,omitempty"` 6119 // Action - The action to be performed. Possible values include: 'Resume', 'Suspend' 6120 Action OrchestrationServiceStateAction `json:"action,omitempty"` 6121} 6122 6123// OrchestrationServiceSummary summary for an orchestration service of a virtual machine scale set. 6124type OrchestrationServiceSummary struct { 6125 // ServiceName - READ-ONLY; The name of the service. Possible values include: 'AutomaticRepairs', 'DummyOrchestrationServiceName' 6126 ServiceName OrchestrationServiceNames `json:"serviceName,omitempty"` 6127 // ServiceState - READ-ONLY; The current state of the service. Possible values include: 'NotRunning', 'Running', 'Suspended' 6128 ServiceState OrchestrationServiceState `json:"serviceState,omitempty"` 6129} 6130 6131// OSDisk specifies information about the operating system disk used by the virtual machine. <br><br> For 6132// more information about disks, see [About disks and VHDs for Azure virtual 6133// machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). 6134type OSDisk struct { 6135 // 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' 6136 OsType OperatingSystemTypes `json:"osType,omitempty"` 6137 // EncryptionSettings - Specifies the encryption settings for the OS Disk. <br><br> Minimum api-version: 2015-06-15 6138 EncryptionSettings *DiskEncryptionSettings `json:"encryptionSettings,omitempty"` 6139 // Name - The disk name. 6140 Name *string `json:"name,omitempty"` 6141 // Vhd - The virtual hard disk. 6142 Vhd *VirtualHardDisk `json:"vhd,omitempty"` 6143 // 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. 6144 Image *VirtualHardDisk `json:"image,omitempty"` 6145 // 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' 6146 Caching CachingTypes `json:"caching,omitempty"` 6147 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 6148 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 6149 // DiffDiskSettings - Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine. 6150 DiffDiskSettings *DiffDiskSettings `json:"diffDiskSettings,omitempty"` 6151 // 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' 6152 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 6153 // 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 6154 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 6155 // ManagedDisk - The managed disk parameters. 6156 ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` 6157} 6158 6159// OSDiskImage contains the os disk image information. 6160type OSDiskImage struct { 6161 // OperatingSystem - The operating system of the osDiskImage. Possible values include: 'Windows', 'Linux' 6162 OperatingSystem OperatingSystemTypes `json:"operatingSystem,omitempty"` 6163} 6164 6165// OSDiskImageEncryption contains encryption settings for an OS disk image. 6166type OSDiskImageEncryption struct { 6167 // DiskEncryptionSetID - A relative URI containing the resource ID of the disk encryption set. 6168 DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` 6169} 6170 6171// OSProfile specifies the operating system settings for the virtual machine. Some of the settings cannot 6172// be changed once VM is provisioned. 6173type OSProfile struct { 6174 // 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). 6175 ComputerName *string `json:"computerName,omitempty"` 6176 // 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) 6177 AdminUsername *string `json:"adminUsername,omitempty"` 6178 // 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) 6179 AdminPassword *string `json:"adminPassword,omitempty"` 6180 // CustomData - Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array is 65535 bytes. <br><br> **Note: Do not pass any secrets or passwords in customData property** <br><br> This property cannot be updated after the VM is created. <br><br> customData is passed to the VM to be saved as a file, for more information see [Custom Data on Azure VMs](https://azure.microsoft.com/en-us/blog/custom-data-and-cloud-init-on-windows-azure/) <br><br> For using cloud-init for your Linux VM, see [Using cloud-init to customize a Linux VM during creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) 6181 CustomData *string `json:"customData,omitempty"` 6182 // WindowsConfiguration - Specifies Windows operating system settings on the virtual machine. 6183 WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` 6184 // 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). 6185 LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` 6186 // Secrets - Specifies set of certificates that should be installed onto the virtual machine. 6187 Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` 6188 // 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. 6189 AllowExtensionOperations *bool `json:"allowExtensionOperations,omitempty"` 6190 // RequireGuestProvisionSignal - Specifies whether the guest provision signal is required to infer provision success of the virtual machine. 6191 RequireGuestProvisionSignal *bool `json:"requireGuestProvisionSignal,omitempty"` 6192} 6193 6194// Plan specifies information about the marketplace image used to create the virtual machine. This element 6195// is only used for marketplace images. Before you can use a marketplace image from an API, you must enable 6196// the image for programmatic use. In the Azure portal, find the marketplace image that you want to use 6197// and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and 6198// then click **Save**. 6199type Plan struct { 6200 // Name - The plan ID. 6201 Name *string `json:"name,omitempty"` 6202 // Publisher - The publisher ID. 6203 Publisher *string `json:"publisher,omitempty"` 6204 // Product - Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. 6205 Product *string `json:"product,omitempty"` 6206 // PromotionCode - The promotion code. 6207 PromotionCode *string `json:"promotionCode,omitempty"` 6208} 6209 6210// ProximityPlacementGroup specifies information about the proximity placement group. 6211type ProximityPlacementGroup struct { 6212 autorest.Response `json:"-"` 6213 // ProximityPlacementGroupProperties - Describes the properties of a Proximity Placement Group. 6214 *ProximityPlacementGroupProperties `json:"properties,omitempty"` 6215 // ID - READ-ONLY; Resource Id 6216 ID *string `json:"id,omitempty"` 6217 // Name - READ-ONLY; Resource name 6218 Name *string `json:"name,omitempty"` 6219 // Type - READ-ONLY; Resource type 6220 Type *string `json:"type,omitempty"` 6221 // Location - Resource location 6222 Location *string `json:"location,omitempty"` 6223 // Tags - Resource tags 6224 Tags map[string]*string `json:"tags"` 6225} 6226 6227// MarshalJSON is the custom marshaler for ProximityPlacementGroup. 6228func (ppg ProximityPlacementGroup) MarshalJSON() ([]byte, error) { 6229 objectMap := make(map[string]interface{}) 6230 if ppg.ProximityPlacementGroupProperties != nil { 6231 objectMap["properties"] = ppg.ProximityPlacementGroupProperties 6232 } 6233 if ppg.Location != nil { 6234 objectMap["location"] = ppg.Location 6235 } 6236 if ppg.Tags != nil { 6237 objectMap["tags"] = ppg.Tags 6238 } 6239 return json.Marshal(objectMap) 6240} 6241 6242// UnmarshalJSON is the custom unmarshaler for ProximityPlacementGroup struct. 6243func (ppg *ProximityPlacementGroup) UnmarshalJSON(body []byte) error { 6244 var m map[string]*json.RawMessage 6245 err := json.Unmarshal(body, &m) 6246 if err != nil { 6247 return err 6248 } 6249 for k, v := range m { 6250 switch k { 6251 case "properties": 6252 if v != nil { 6253 var proximityPlacementGroupProperties ProximityPlacementGroupProperties 6254 err = json.Unmarshal(*v, &proximityPlacementGroupProperties) 6255 if err != nil { 6256 return err 6257 } 6258 ppg.ProximityPlacementGroupProperties = &proximityPlacementGroupProperties 6259 } 6260 case "id": 6261 if v != nil { 6262 var ID string 6263 err = json.Unmarshal(*v, &ID) 6264 if err != nil { 6265 return err 6266 } 6267 ppg.ID = &ID 6268 } 6269 case "name": 6270 if v != nil { 6271 var name string 6272 err = json.Unmarshal(*v, &name) 6273 if err != nil { 6274 return err 6275 } 6276 ppg.Name = &name 6277 } 6278 case "type": 6279 if v != nil { 6280 var typeVar string 6281 err = json.Unmarshal(*v, &typeVar) 6282 if err != nil { 6283 return err 6284 } 6285 ppg.Type = &typeVar 6286 } 6287 case "location": 6288 if v != nil { 6289 var location string 6290 err = json.Unmarshal(*v, &location) 6291 if err != nil { 6292 return err 6293 } 6294 ppg.Location = &location 6295 } 6296 case "tags": 6297 if v != nil { 6298 var tags map[string]*string 6299 err = json.Unmarshal(*v, &tags) 6300 if err != nil { 6301 return err 6302 } 6303 ppg.Tags = tags 6304 } 6305 } 6306 } 6307 6308 return nil 6309} 6310 6311// ProximityPlacementGroupListResult the List Proximity Placement Group operation response. 6312type ProximityPlacementGroupListResult struct { 6313 autorest.Response `json:"-"` 6314 // Value - The list of proximity placement groups 6315 Value *[]ProximityPlacementGroup `json:"value,omitempty"` 6316 // NextLink - The URI to fetch the next page of proximity placement groups. 6317 NextLink *string `json:"nextLink,omitempty"` 6318} 6319 6320// ProximityPlacementGroupListResultIterator provides access to a complete listing of 6321// ProximityPlacementGroup values. 6322type ProximityPlacementGroupListResultIterator struct { 6323 i int 6324 page ProximityPlacementGroupListResultPage 6325} 6326 6327// NextWithContext advances to the next value. If there was an error making 6328// the request the iterator does not advance and the error is returned. 6329func (iter *ProximityPlacementGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { 6330 if tracing.IsEnabled() { 6331 ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupListResultIterator.NextWithContext") 6332 defer func() { 6333 sc := -1 6334 if iter.Response().Response.Response != nil { 6335 sc = iter.Response().Response.Response.StatusCode 6336 } 6337 tracing.EndSpan(ctx, sc, err) 6338 }() 6339 } 6340 iter.i++ 6341 if iter.i < len(iter.page.Values()) { 6342 return nil 6343 } 6344 err = iter.page.NextWithContext(ctx) 6345 if err != nil { 6346 iter.i-- 6347 return err 6348 } 6349 iter.i = 0 6350 return nil 6351} 6352 6353// Next advances to the next value. If there was an error making 6354// the request the iterator does not advance and the error is returned. 6355// Deprecated: Use NextWithContext() instead. 6356func (iter *ProximityPlacementGroupListResultIterator) Next() error { 6357 return iter.NextWithContext(context.Background()) 6358} 6359 6360// NotDone returns true if the enumeration should be started or is not yet complete. 6361func (iter ProximityPlacementGroupListResultIterator) NotDone() bool { 6362 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6363} 6364 6365// Response returns the raw server response from the last page request. 6366func (iter ProximityPlacementGroupListResultIterator) Response() ProximityPlacementGroupListResult { 6367 return iter.page.Response() 6368} 6369 6370// Value returns the current value or a zero-initialized value if the 6371// iterator has advanced beyond the end of the collection. 6372func (iter ProximityPlacementGroupListResultIterator) Value() ProximityPlacementGroup { 6373 if !iter.page.NotDone() { 6374 return ProximityPlacementGroup{} 6375 } 6376 return iter.page.Values()[iter.i] 6377} 6378 6379// Creates a new instance of the ProximityPlacementGroupListResultIterator type. 6380func NewProximityPlacementGroupListResultIterator(page ProximityPlacementGroupListResultPage) ProximityPlacementGroupListResultIterator { 6381 return ProximityPlacementGroupListResultIterator{page: page} 6382} 6383 6384// IsEmpty returns true if the ListResult contains no values. 6385func (ppglr ProximityPlacementGroupListResult) IsEmpty() bool { 6386 return ppglr.Value == nil || len(*ppglr.Value) == 0 6387} 6388 6389// hasNextLink returns true if the NextLink is not empty. 6390func (ppglr ProximityPlacementGroupListResult) hasNextLink() bool { 6391 return ppglr.NextLink != nil && len(*ppglr.NextLink) != 0 6392} 6393 6394// proximityPlacementGroupListResultPreparer prepares a request to retrieve the next set of results. 6395// It returns nil if no more results exist. 6396func (ppglr ProximityPlacementGroupListResult) proximityPlacementGroupListResultPreparer(ctx context.Context) (*http.Request, error) { 6397 if !ppglr.hasNextLink() { 6398 return nil, nil 6399 } 6400 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6401 autorest.AsJSON(), 6402 autorest.AsGet(), 6403 autorest.WithBaseURL(to.String(ppglr.NextLink))) 6404} 6405 6406// ProximityPlacementGroupListResultPage contains a page of ProximityPlacementGroup values. 6407type ProximityPlacementGroupListResultPage struct { 6408 fn func(context.Context, ProximityPlacementGroupListResult) (ProximityPlacementGroupListResult, error) 6409 ppglr ProximityPlacementGroupListResult 6410} 6411 6412// NextWithContext advances to the next page of values. If there was an error making 6413// the request the page does not advance and the error is returned. 6414func (page *ProximityPlacementGroupListResultPage) NextWithContext(ctx context.Context) (err error) { 6415 if tracing.IsEnabled() { 6416 ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupListResultPage.NextWithContext") 6417 defer func() { 6418 sc := -1 6419 if page.Response().Response.Response != nil { 6420 sc = page.Response().Response.Response.StatusCode 6421 } 6422 tracing.EndSpan(ctx, sc, err) 6423 }() 6424 } 6425 for { 6426 next, err := page.fn(ctx, page.ppglr) 6427 if err != nil { 6428 return err 6429 } 6430 page.ppglr = next 6431 if !next.hasNextLink() || !next.IsEmpty() { 6432 break 6433 } 6434 } 6435 return nil 6436} 6437 6438// Next advances to the next page of values. If there was an error making 6439// the request the page does not advance and the error is returned. 6440// Deprecated: Use NextWithContext() instead. 6441func (page *ProximityPlacementGroupListResultPage) Next() error { 6442 return page.NextWithContext(context.Background()) 6443} 6444 6445// NotDone returns true if the page enumeration should be started or is not yet complete. 6446func (page ProximityPlacementGroupListResultPage) NotDone() bool { 6447 return !page.ppglr.IsEmpty() 6448} 6449 6450// Response returns the raw server response from the last page request. 6451func (page ProximityPlacementGroupListResultPage) Response() ProximityPlacementGroupListResult { 6452 return page.ppglr 6453} 6454 6455// Values returns the slice of values for the current page or nil if there are no values. 6456func (page ProximityPlacementGroupListResultPage) Values() []ProximityPlacementGroup { 6457 if page.ppglr.IsEmpty() { 6458 return nil 6459 } 6460 return *page.ppglr.Value 6461} 6462 6463// Creates a new instance of the ProximityPlacementGroupListResultPage type. 6464func NewProximityPlacementGroupListResultPage(cur ProximityPlacementGroupListResult, getNextPage func(context.Context, ProximityPlacementGroupListResult) (ProximityPlacementGroupListResult, error)) ProximityPlacementGroupListResultPage { 6465 return ProximityPlacementGroupListResultPage{ 6466 fn: getNextPage, 6467 ppglr: cur, 6468 } 6469} 6470 6471// ProximityPlacementGroupProperties describes the properties of a Proximity Placement Group. 6472type ProximityPlacementGroupProperties struct { 6473 // 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' 6474 ProximityPlacementGroupType ProximityPlacementGroupType `json:"proximityPlacementGroupType,omitempty"` 6475 // VirtualMachines - READ-ONLY; A list of references to all virtual machines in the proximity placement group. 6476 VirtualMachines *[]SubResourceWithColocationStatus `json:"virtualMachines,omitempty"` 6477 // VirtualMachineScaleSets - READ-ONLY; A list of references to all virtual machine scale sets in the proximity placement group. 6478 VirtualMachineScaleSets *[]SubResourceWithColocationStatus `json:"virtualMachineScaleSets,omitempty"` 6479 // AvailabilitySets - READ-ONLY; A list of references to all availability sets in the proximity placement group. 6480 AvailabilitySets *[]SubResourceWithColocationStatus `json:"availabilitySets,omitempty"` 6481 // ColocationStatus - Describes colocation status of the Proximity Placement Group. 6482 ColocationStatus *InstanceViewStatus `json:"colocationStatus,omitempty"` 6483} 6484 6485// MarshalJSON is the custom marshaler for ProximityPlacementGroupProperties. 6486func (ppgp ProximityPlacementGroupProperties) MarshalJSON() ([]byte, error) { 6487 objectMap := make(map[string]interface{}) 6488 if ppgp.ProximityPlacementGroupType != "" { 6489 objectMap["proximityPlacementGroupType"] = ppgp.ProximityPlacementGroupType 6490 } 6491 if ppgp.ColocationStatus != nil { 6492 objectMap["colocationStatus"] = ppgp.ColocationStatus 6493 } 6494 return json.Marshal(objectMap) 6495} 6496 6497// ProximityPlacementGroupUpdate specifies information about the proximity placement group. 6498type ProximityPlacementGroupUpdate struct { 6499 // Tags - Resource tags 6500 Tags map[string]*string `json:"tags"` 6501} 6502 6503// MarshalJSON is the custom marshaler for ProximityPlacementGroupUpdate. 6504func (ppgu ProximityPlacementGroupUpdate) MarshalJSON() ([]byte, error) { 6505 objectMap := make(map[string]interface{}) 6506 if ppgu.Tags != nil { 6507 objectMap["tags"] = ppgu.Tags 6508 } 6509 return json.Marshal(objectMap) 6510} 6511 6512// PurchasePlan used for establishing the purchase context of any 3rd Party artifact through MarketPlace. 6513type PurchasePlan struct { 6514 // Publisher - The publisher ID. 6515 Publisher *string `json:"publisher,omitempty"` 6516 // Name - The plan ID. 6517 Name *string `json:"name,omitempty"` 6518 // Product - Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. 6519 Product *string `json:"product,omitempty"` 6520} 6521 6522// RecommendedMachineConfiguration the properties describe the recommended machine configuration for this 6523// Image Definition. These properties are updatable. 6524type RecommendedMachineConfiguration struct { 6525 VCPUs *ResourceRange `json:"vCPUs,omitempty"` 6526 Memory *ResourceRange `json:"memory,omitempty"` 6527} 6528 6529// RecoveryWalkResponse response after calling a manual recovery walk 6530type RecoveryWalkResponse struct { 6531 autorest.Response `json:"-"` 6532 // WalkPerformed - READ-ONLY; Whether the recovery walk was performed 6533 WalkPerformed *bool `json:"walkPerformed,omitempty"` 6534 // NextPlatformUpdateDomain - READ-ONLY; The next update domain that needs to be walked. Null means walk spanning all update domains has been completed 6535 NextPlatformUpdateDomain *int32 `json:"nextPlatformUpdateDomain,omitempty"` 6536} 6537 6538// RegionalReplicationStatus this is the regional replication status. 6539type RegionalReplicationStatus struct { 6540 // Region - READ-ONLY; The region to which the gallery Image Version is being replicated to. 6541 Region *string `json:"region,omitempty"` 6542 // State - READ-ONLY; This is the regional replication state. Possible values include: 'ReplicationStateUnknown', 'ReplicationStateReplicating', 'ReplicationStateCompleted', 'ReplicationStateFailed' 6543 State ReplicationState `json:"state,omitempty"` 6544 // Details - READ-ONLY; The details of the replication status. 6545 Details *string `json:"details,omitempty"` 6546 // Progress - READ-ONLY; It indicates progress of the replication job. 6547 Progress *int32 `json:"progress,omitempty"` 6548} 6549 6550// ReplicationStatus this is the replication status of the gallery Image Version. 6551type ReplicationStatus struct { 6552 // AggregatedState - READ-ONLY; This is the aggregated replication status based on all the regional replication status flags. Possible values include: 'Unknown', 'InProgress', 'Completed', 'Failed' 6553 AggregatedState AggregatedReplicationState `json:"aggregatedState,omitempty"` 6554 // Summary - READ-ONLY; This is a summary of replication status for each region. 6555 Summary *[]RegionalReplicationStatus `json:"summary,omitempty"` 6556} 6557 6558// RequestRateByIntervalInput api request input for LogAnalytics getRequestRateByInterval Api. 6559type RequestRateByIntervalInput struct { 6560 // IntervalLength - Interval value in minutes used to create LogAnalytics call rate logs. Possible values include: 'ThreeMins', 'FiveMins', 'ThirtyMins', 'SixtyMins' 6561 IntervalLength IntervalInMins `json:"intervalLength,omitempty"` 6562 // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. 6563 BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` 6564 // FromTime - From time of the query 6565 FromTime *date.Time `json:"fromTime,omitempty"` 6566 // ToTime - To time of the query 6567 ToTime *date.Time `json:"toTime,omitempty"` 6568 // GroupByThrottlePolicy - Group query result by Throttle Policy applied. 6569 GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` 6570 // GroupByOperationName - Group query result by Operation Name. 6571 GroupByOperationName *bool `json:"groupByOperationName,omitempty"` 6572 // GroupByResourceName - Group query result by Resource Name. 6573 GroupByResourceName *bool `json:"groupByResourceName,omitempty"` 6574} 6575 6576// Resource the Resource model definition. 6577type Resource struct { 6578 // ID - READ-ONLY; Resource Id 6579 ID *string `json:"id,omitempty"` 6580 // Name - READ-ONLY; Resource name 6581 Name *string `json:"name,omitempty"` 6582 // Type - READ-ONLY; Resource type 6583 Type *string `json:"type,omitempty"` 6584 // Location - Resource location 6585 Location *string `json:"location,omitempty"` 6586 // Tags - Resource tags 6587 Tags map[string]*string `json:"tags"` 6588} 6589 6590// MarshalJSON is the custom marshaler for Resource. 6591func (r Resource) MarshalJSON() ([]byte, error) { 6592 objectMap := make(map[string]interface{}) 6593 if r.Location != nil { 6594 objectMap["location"] = r.Location 6595 } 6596 if r.Tags != nil { 6597 objectMap["tags"] = r.Tags 6598 } 6599 return json.Marshal(objectMap) 6600} 6601 6602// ResourceRange describes the resource range. 6603type ResourceRange struct { 6604 // Min - The minimum number of the resource. 6605 Min *int32 `json:"min,omitempty"` 6606 // Max - The maximum number of the resource. 6607 Max *int32 `json:"max,omitempty"` 6608} 6609 6610// ResourceSku describes an available Compute SKU. 6611type ResourceSku struct { 6612 // ResourceType - READ-ONLY; The type of resource the SKU applies to. 6613 ResourceType *string `json:"resourceType,omitempty"` 6614 // Name - READ-ONLY; The name of SKU. 6615 Name *string `json:"name,omitempty"` 6616 // Tier - READ-ONLY; Specifies the tier of virtual machines in a scale set.<br /><br /> Possible Values:<br /><br /> **Standard**<br /><br /> **Basic** 6617 Tier *string `json:"tier,omitempty"` 6618 // Size - READ-ONLY; The Size of the SKU. 6619 Size *string `json:"size,omitempty"` 6620 // Family - READ-ONLY; The Family of this particular SKU. 6621 Family *string `json:"family,omitempty"` 6622 // Kind - READ-ONLY; The Kind of resources that are supported in this SKU. 6623 Kind *string `json:"kind,omitempty"` 6624 // Capacity - READ-ONLY; Specifies the number of virtual machines in the scale set. 6625 Capacity *ResourceSkuCapacity `json:"capacity,omitempty"` 6626 // Locations - READ-ONLY; The set of locations that the SKU is available. 6627 Locations *[]string `json:"locations,omitempty"` 6628 // LocationInfo - READ-ONLY; A list of locations and availability zones in those locations where the SKU is available. 6629 LocationInfo *[]ResourceSkuLocationInfo `json:"locationInfo,omitempty"` 6630 // APIVersions - READ-ONLY; The api versions that support this SKU. 6631 APIVersions *[]string `json:"apiVersions,omitempty"` 6632 // Costs - READ-ONLY; Metadata for retrieving price info. 6633 Costs *[]ResourceSkuCosts `json:"costs,omitempty"` 6634 // Capabilities - READ-ONLY; A name value pair to describe the capability. 6635 Capabilities *[]ResourceSkuCapabilities `json:"capabilities,omitempty"` 6636 // Restrictions - READ-ONLY; The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. 6637 Restrictions *[]ResourceSkuRestrictions `json:"restrictions,omitempty"` 6638} 6639 6640// ResourceSkuCapabilities describes The SKU capabilities object. 6641type ResourceSkuCapabilities struct { 6642 // Name - READ-ONLY; An invariant to describe the feature. 6643 Name *string `json:"name,omitempty"` 6644 // Value - READ-ONLY; An invariant if the feature is measured by quantity. 6645 Value *string `json:"value,omitempty"` 6646} 6647 6648// ResourceSkuCapacity describes scaling information of a SKU. 6649type ResourceSkuCapacity struct { 6650 // Minimum - READ-ONLY; The minimum capacity. 6651 Minimum *int64 `json:"minimum,omitempty"` 6652 // Maximum - READ-ONLY; The maximum capacity that can be set. 6653 Maximum *int64 `json:"maximum,omitempty"` 6654 // Default - READ-ONLY; The default capacity. 6655 Default *int64 `json:"default,omitempty"` 6656 // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'ResourceSkuCapacityScaleTypeAutomatic', 'ResourceSkuCapacityScaleTypeManual', 'ResourceSkuCapacityScaleTypeNone' 6657 ScaleType ResourceSkuCapacityScaleType `json:"scaleType,omitempty"` 6658} 6659 6660// ResourceSkuCosts describes metadata for retrieving price info. 6661type ResourceSkuCosts struct { 6662 // MeterID - READ-ONLY; Used for querying price from commerce. 6663 MeterID *string `json:"meterID,omitempty"` 6664 // Quantity - READ-ONLY; The multiplier is needed to extend the base metered cost. 6665 Quantity *int64 `json:"quantity,omitempty"` 6666 // ExtendedUnit - READ-ONLY; An invariant to show the extended unit. 6667 ExtendedUnit *string `json:"extendedUnit,omitempty"` 6668} 6669 6670// ResourceSkuLocationInfo ... 6671type ResourceSkuLocationInfo struct { 6672 // Location - READ-ONLY; Location of the SKU 6673 Location *string `json:"location,omitempty"` 6674 // Zones - READ-ONLY; List of availability zones where the SKU is supported. 6675 Zones *[]string `json:"zones,omitempty"` 6676 // ZoneDetails - READ-ONLY; Details of capabilities available to a SKU in specific zones. 6677 ZoneDetails *[]ResourceSkuZoneDetails `json:"zoneDetails,omitempty"` 6678} 6679 6680// ResourceSkuRestrictionInfo ... 6681type ResourceSkuRestrictionInfo struct { 6682 // Locations - READ-ONLY; Locations where the SKU is restricted 6683 Locations *[]string `json:"locations,omitempty"` 6684 // Zones - READ-ONLY; List of availability zones where the SKU is restricted. 6685 Zones *[]string `json:"zones,omitempty"` 6686} 6687 6688// ResourceSkuRestrictions describes scaling information of a SKU. 6689type ResourceSkuRestrictions struct { 6690 // Type - READ-ONLY; The type of restrictions. Possible values include: 'Location', 'Zone' 6691 Type ResourceSkuRestrictionsType `json:"type,omitempty"` 6692 // 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. 6693 Values *[]string `json:"values,omitempty"` 6694 // RestrictionInfo - READ-ONLY; The information about the restriction where the SKU cannot be used. 6695 RestrictionInfo *ResourceSkuRestrictionInfo `json:"restrictionInfo,omitempty"` 6696 // ReasonCode - READ-ONLY; The reason for restriction. Possible values include: 'QuotaID', 'NotAvailableForSubscription' 6697 ReasonCode ResourceSkuRestrictionsReasonCode `json:"reasonCode,omitempty"` 6698} 6699 6700// ResourceSkusResult the List Resource Skus operation response. 6701type ResourceSkusResult struct { 6702 autorest.Response `json:"-"` 6703 // Value - The list of skus available for the subscription. 6704 Value *[]ResourceSku `json:"value,omitempty"` 6705 // NextLink - The URI to fetch the next page of Resource Skus. Call ListNext() with this URI to fetch the next page of Resource Skus 6706 NextLink *string `json:"nextLink,omitempty"` 6707} 6708 6709// ResourceSkusResultIterator provides access to a complete listing of ResourceSku values. 6710type ResourceSkusResultIterator struct { 6711 i int 6712 page ResourceSkusResultPage 6713} 6714 6715// NextWithContext advances to the next value. If there was an error making 6716// the request the iterator does not advance and the error is returned. 6717func (iter *ResourceSkusResultIterator) NextWithContext(ctx context.Context) (err error) { 6718 if tracing.IsEnabled() { 6719 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusResultIterator.NextWithContext") 6720 defer func() { 6721 sc := -1 6722 if iter.Response().Response.Response != nil { 6723 sc = iter.Response().Response.Response.StatusCode 6724 } 6725 tracing.EndSpan(ctx, sc, err) 6726 }() 6727 } 6728 iter.i++ 6729 if iter.i < len(iter.page.Values()) { 6730 return nil 6731 } 6732 err = iter.page.NextWithContext(ctx) 6733 if err != nil { 6734 iter.i-- 6735 return err 6736 } 6737 iter.i = 0 6738 return nil 6739} 6740 6741// Next advances to the next value. If there was an error making 6742// the request the iterator does not advance and the error is returned. 6743// Deprecated: Use NextWithContext() instead. 6744func (iter *ResourceSkusResultIterator) Next() error { 6745 return iter.NextWithContext(context.Background()) 6746} 6747 6748// NotDone returns true if the enumeration should be started or is not yet complete. 6749func (iter ResourceSkusResultIterator) NotDone() bool { 6750 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6751} 6752 6753// Response returns the raw server response from the last page request. 6754func (iter ResourceSkusResultIterator) Response() ResourceSkusResult { 6755 return iter.page.Response() 6756} 6757 6758// Value returns the current value or a zero-initialized value if the 6759// iterator has advanced beyond the end of the collection. 6760func (iter ResourceSkusResultIterator) Value() ResourceSku { 6761 if !iter.page.NotDone() { 6762 return ResourceSku{} 6763 } 6764 return iter.page.Values()[iter.i] 6765} 6766 6767// Creates a new instance of the ResourceSkusResultIterator type. 6768func NewResourceSkusResultIterator(page ResourceSkusResultPage) ResourceSkusResultIterator { 6769 return ResourceSkusResultIterator{page: page} 6770} 6771 6772// IsEmpty returns true if the ListResult contains no values. 6773func (rsr ResourceSkusResult) IsEmpty() bool { 6774 return rsr.Value == nil || len(*rsr.Value) == 0 6775} 6776 6777// hasNextLink returns true if the NextLink is not empty. 6778func (rsr ResourceSkusResult) hasNextLink() bool { 6779 return rsr.NextLink != nil && len(*rsr.NextLink) != 0 6780} 6781 6782// resourceSkusResultPreparer prepares a request to retrieve the next set of results. 6783// It returns nil if no more results exist. 6784func (rsr ResourceSkusResult) resourceSkusResultPreparer(ctx context.Context) (*http.Request, error) { 6785 if !rsr.hasNextLink() { 6786 return nil, nil 6787 } 6788 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6789 autorest.AsJSON(), 6790 autorest.AsGet(), 6791 autorest.WithBaseURL(to.String(rsr.NextLink))) 6792} 6793 6794// ResourceSkusResultPage contains a page of ResourceSku values. 6795type ResourceSkusResultPage struct { 6796 fn func(context.Context, ResourceSkusResult) (ResourceSkusResult, error) 6797 rsr ResourceSkusResult 6798} 6799 6800// NextWithContext advances to the next page of values. If there was an error making 6801// the request the page does not advance and the error is returned. 6802func (page *ResourceSkusResultPage) NextWithContext(ctx context.Context) (err error) { 6803 if tracing.IsEnabled() { 6804 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusResultPage.NextWithContext") 6805 defer func() { 6806 sc := -1 6807 if page.Response().Response.Response != nil { 6808 sc = page.Response().Response.Response.StatusCode 6809 } 6810 tracing.EndSpan(ctx, sc, err) 6811 }() 6812 } 6813 for { 6814 next, err := page.fn(ctx, page.rsr) 6815 if err != nil { 6816 return err 6817 } 6818 page.rsr = next 6819 if !next.hasNextLink() || !next.IsEmpty() { 6820 break 6821 } 6822 } 6823 return nil 6824} 6825 6826// Next advances to the next page of values. If there was an error making 6827// the request the page does not advance and the error is returned. 6828// Deprecated: Use NextWithContext() instead. 6829func (page *ResourceSkusResultPage) Next() error { 6830 return page.NextWithContext(context.Background()) 6831} 6832 6833// NotDone returns true if the page enumeration should be started or is not yet complete. 6834func (page ResourceSkusResultPage) NotDone() bool { 6835 return !page.rsr.IsEmpty() 6836} 6837 6838// Response returns the raw server response from the last page request. 6839func (page ResourceSkusResultPage) Response() ResourceSkusResult { 6840 return page.rsr 6841} 6842 6843// Values returns the slice of values for the current page or nil if there are no values. 6844func (page ResourceSkusResultPage) Values() []ResourceSku { 6845 if page.rsr.IsEmpty() { 6846 return nil 6847 } 6848 return *page.rsr.Value 6849} 6850 6851// Creates a new instance of the ResourceSkusResultPage type. 6852func NewResourceSkusResultPage(cur ResourceSkusResult, getNextPage func(context.Context, ResourceSkusResult) (ResourceSkusResult, error)) ResourceSkusResultPage { 6853 return ResourceSkusResultPage{ 6854 fn: getNextPage, 6855 rsr: cur, 6856 } 6857} 6858 6859// ResourceSkuZoneDetails describes The zonal capabilities of a SKU. 6860type ResourceSkuZoneDetails struct { 6861 // Name - READ-ONLY; The set of zones that the SKU is available in with the specified capabilities. 6862 Name *[]string `json:"name,omitempty"` 6863 // Capabilities - READ-ONLY; A list of capabilities that are available for the SKU in the specified list of zones. 6864 Capabilities *[]ResourceSkuCapabilities `json:"capabilities,omitempty"` 6865} 6866 6867// RollbackStatusInfo information about rollback on failed VM instances after a OS Upgrade operation. 6868type RollbackStatusInfo struct { 6869 // SuccessfullyRolledbackInstanceCount - READ-ONLY; The number of instances which have been successfully rolled back. 6870 SuccessfullyRolledbackInstanceCount *int32 `json:"successfullyRolledbackInstanceCount,omitempty"` 6871 // FailedRolledbackInstanceCount - READ-ONLY; The number of instances which failed to rollback. 6872 FailedRolledbackInstanceCount *int32 `json:"failedRolledbackInstanceCount,omitempty"` 6873 // RollbackError - READ-ONLY; Error details if OS rollback failed. 6874 RollbackError *APIError `json:"rollbackError,omitempty"` 6875} 6876 6877// RollingUpgradePolicy the configuration parameters used while performing a rolling upgrade. 6878type RollingUpgradePolicy struct { 6879 // 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%. 6880 MaxBatchInstancePercent *int32 `json:"maxBatchInstancePercent,omitempty"` 6881 // 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%. 6882 MaxUnhealthyInstancePercent *int32 `json:"maxUnhealthyInstancePercent,omitempty"` 6883 // 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%. 6884 MaxUnhealthyUpgradedInstancePercent *int32 `json:"maxUnhealthyUpgradedInstancePercent,omitempty"` 6885 // 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). 6886 PauseTimeBetweenBatches *string `json:"pauseTimeBetweenBatches,omitempty"` 6887} 6888 6889// RollingUpgradeProgressInfo information about the number of virtual machine instances in each upgrade 6890// state. 6891type RollingUpgradeProgressInfo struct { 6892 // SuccessfulInstanceCount - READ-ONLY; The number of instances that have been successfully upgraded. 6893 SuccessfulInstanceCount *int32 `json:"successfulInstanceCount,omitempty"` 6894 // FailedInstanceCount - READ-ONLY; The number of instances that have failed to be upgraded successfully. 6895 FailedInstanceCount *int32 `json:"failedInstanceCount,omitempty"` 6896 // InProgressInstanceCount - READ-ONLY; The number of instances that are currently being upgraded. 6897 InProgressInstanceCount *int32 `json:"inProgressInstanceCount,omitempty"` 6898 // PendingInstanceCount - READ-ONLY; The number of instances that have not yet begun to be upgraded. 6899 PendingInstanceCount *int32 `json:"pendingInstanceCount,omitempty"` 6900} 6901 6902// RollingUpgradeRunningStatus information about the current running state of the overall upgrade. 6903type RollingUpgradeRunningStatus struct { 6904 // Code - READ-ONLY; Code indicating the current status of the upgrade. Possible values include: 'RollingUpgradeStatusCodeRollingForward', 'RollingUpgradeStatusCodeCancelled', 'RollingUpgradeStatusCodeCompleted', 'RollingUpgradeStatusCodeFaulted' 6905 Code RollingUpgradeStatusCode `json:"code,omitempty"` 6906 // StartTime - READ-ONLY; Start time of the upgrade. 6907 StartTime *date.Time `json:"startTime,omitempty"` 6908 // LastAction - READ-ONLY; The last action performed on the rolling upgrade. Possible values include: 'Start', 'Cancel' 6909 LastAction RollingUpgradeActionType `json:"lastAction,omitempty"` 6910 // LastActionTime - READ-ONLY; Last action time of the upgrade. 6911 LastActionTime *date.Time `json:"lastActionTime,omitempty"` 6912} 6913 6914// RollingUpgradeStatusInfo the status of the latest virtual machine scale set rolling upgrade. 6915type RollingUpgradeStatusInfo struct { 6916 autorest.Response `json:"-"` 6917 *RollingUpgradeStatusInfoProperties `json:"properties,omitempty"` 6918 // ID - READ-ONLY; Resource Id 6919 ID *string `json:"id,omitempty"` 6920 // Name - READ-ONLY; Resource name 6921 Name *string `json:"name,omitempty"` 6922 // Type - READ-ONLY; Resource type 6923 Type *string `json:"type,omitempty"` 6924 // Location - Resource location 6925 Location *string `json:"location,omitempty"` 6926 // Tags - Resource tags 6927 Tags map[string]*string `json:"tags"` 6928} 6929 6930// MarshalJSON is the custom marshaler for RollingUpgradeStatusInfo. 6931func (rusi RollingUpgradeStatusInfo) MarshalJSON() ([]byte, error) { 6932 objectMap := make(map[string]interface{}) 6933 if rusi.RollingUpgradeStatusInfoProperties != nil { 6934 objectMap["properties"] = rusi.RollingUpgradeStatusInfoProperties 6935 } 6936 if rusi.Location != nil { 6937 objectMap["location"] = rusi.Location 6938 } 6939 if rusi.Tags != nil { 6940 objectMap["tags"] = rusi.Tags 6941 } 6942 return json.Marshal(objectMap) 6943} 6944 6945// UnmarshalJSON is the custom unmarshaler for RollingUpgradeStatusInfo struct. 6946func (rusi *RollingUpgradeStatusInfo) UnmarshalJSON(body []byte) error { 6947 var m map[string]*json.RawMessage 6948 err := json.Unmarshal(body, &m) 6949 if err != nil { 6950 return err 6951 } 6952 for k, v := range m { 6953 switch k { 6954 case "properties": 6955 if v != nil { 6956 var rollingUpgradeStatusInfoProperties RollingUpgradeStatusInfoProperties 6957 err = json.Unmarshal(*v, &rollingUpgradeStatusInfoProperties) 6958 if err != nil { 6959 return err 6960 } 6961 rusi.RollingUpgradeStatusInfoProperties = &rollingUpgradeStatusInfoProperties 6962 } 6963 case "id": 6964 if v != nil { 6965 var ID string 6966 err = json.Unmarshal(*v, &ID) 6967 if err != nil { 6968 return err 6969 } 6970 rusi.ID = &ID 6971 } 6972 case "name": 6973 if v != nil { 6974 var name string 6975 err = json.Unmarshal(*v, &name) 6976 if err != nil { 6977 return err 6978 } 6979 rusi.Name = &name 6980 } 6981 case "type": 6982 if v != nil { 6983 var typeVar string 6984 err = json.Unmarshal(*v, &typeVar) 6985 if err != nil { 6986 return err 6987 } 6988 rusi.Type = &typeVar 6989 } 6990 case "location": 6991 if v != nil { 6992 var location string 6993 err = json.Unmarshal(*v, &location) 6994 if err != nil { 6995 return err 6996 } 6997 rusi.Location = &location 6998 } 6999 case "tags": 7000 if v != nil { 7001 var tags map[string]*string 7002 err = json.Unmarshal(*v, &tags) 7003 if err != nil { 7004 return err 7005 } 7006 rusi.Tags = tags 7007 } 7008 } 7009 } 7010 7011 return nil 7012} 7013 7014// RollingUpgradeStatusInfoProperties the status of the latest virtual machine scale set rolling upgrade. 7015type RollingUpgradeStatusInfoProperties struct { 7016 // Policy - READ-ONLY; The rolling upgrade policies applied for this upgrade. 7017 Policy *RollingUpgradePolicy `json:"policy,omitempty"` 7018 // RunningStatus - READ-ONLY; Information about the current running state of the overall upgrade. 7019 RunningStatus *RollingUpgradeRunningStatus `json:"runningStatus,omitempty"` 7020 // Progress - READ-ONLY; Information about the number of virtual machine instances in each upgrade state. 7021 Progress *RollingUpgradeProgressInfo `json:"progress,omitempty"` 7022 // Error - READ-ONLY; Error details for this upgrade, if there are any. 7023 Error *APIError `json:"error,omitempty"` 7024} 7025 7026// RunCommandDocument describes the properties of a Run Command. 7027type RunCommandDocument struct { 7028 autorest.Response `json:"-"` 7029 // Script - The script to be executed. 7030 Script *[]string `json:"script,omitempty"` 7031 // Parameters - The parameters used by the script. 7032 Parameters *[]RunCommandParameterDefinition `json:"parameters,omitempty"` 7033 // Schema - The VM run command schema. 7034 Schema *string `json:"$schema,omitempty"` 7035 // ID - The VM run command id. 7036 ID *string `json:"id,omitempty"` 7037 // OsType - The Operating System type. Possible values include: 'Windows', 'Linux' 7038 OsType OperatingSystemTypes `json:"osType,omitempty"` 7039 // Label - The VM run command label. 7040 Label *string `json:"label,omitempty"` 7041 // Description - The VM run command description. 7042 Description *string `json:"description,omitempty"` 7043} 7044 7045// RunCommandDocumentBase describes the properties of a Run Command metadata. 7046type RunCommandDocumentBase struct { 7047 // Schema - The VM run command schema. 7048 Schema *string `json:"$schema,omitempty"` 7049 // ID - The VM run command id. 7050 ID *string `json:"id,omitempty"` 7051 // OsType - The Operating System type. Possible values include: 'Windows', 'Linux' 7052 OsType OperatingSystemTypes `json:"osType,omitempty"` 7053 // Label - The VM run command label. 7054 Label *string `json:"label,omitempty"` 7055 // Description - The VM run command description. 7056 Description *string `json:"description,omitempty"` 7057} 7058 7059// RunCommandInput capture Virtual Machine parameters. 7060type RunCommandInput struct { 7061 // CommandID - The run command id. 7062 CommandID *string `json:"commandId,omitempty"` 7063 // Script - Optional. The script to be executed. When this value is given, the given script will override the default script of the command. 7064 Script *[]string `json:"script,omitempty"` 7065 // Parameters - The run command parameters. 7066 Parameters *[]RunCommandInputParameter `json:"parameters,omitempty"` 7067} 7068 7069// RunCommandInputParameter describes the properties of a run command parameter. 7070type RunCommandInputParameter struct { 7071 // Name - The run command parameter name. 7072 Name *string `json:"name,omitempty"` 7073 // Value - The run command parameter value. 7074 Value *string `json:"value,omitempty"` 7075} 7076 7077// RunCommandListResult the List Virtual Machine operation response. 7078type RunCommandListResult struct { 7079 autorest.Response `json:"-"` 7080 // Value - The list of virtual machine run commands. 7081 Value *[]RunCommandDocumentBase `json:"value,omitempty"` 7082 // NextLink - The uri to fetch the next page of run commands. Call ListNext() with this to fetch the next page of run commands. 7083 NextLink *string `json:"nextLink,omitempty"` 7084} 7085 7086// RunCommandListResultIterator provides access to a complete listing of RunCommandDocumentBase values. 7087type RunCommandListResultIterator struct { 7088 i int 7089 page RunCommandListResultPage 7090} 7091 7092// NextWithContext advances to the next value. If there was an error making 7093// the request the iterator does not advance and the error is returned. 7094func (iter *RunCommandListResultIterator) NextWithContext(ctx context.Context) (err error) { 7095 if tracing.IsEnabled() { 7096 ctx = tracing.StartSpan(ctx, fqdn+"/RunCommandListResultIterator.NextWithContext") 7097 defer func() { 7098 sc := -1 7099 if iter.Response().Response.Response != nil { 7100 sc = iter.Response().Response.Response.StatusCode 7101 } 7102 tracing.EndSpan(ctx, sc, err) 7103 }() 7104 } 7105 iter.i++ 7106 if iter.i < len(iter.page.Values()) { 7107 return nil 7108 } 7109 err = iter.page.NextWithContext(ctx) 7110 if err != nil { 7111 iter.i-- 7112 return err 7113 } 7114 iter.i = 0 7115 return nil 7116} 7117 7118// Next advances to the next value. If there was an error making 7119// the request the iterator does not advance and the error is returned. 7120// Deprecated: Use NextWithContext() instead. 7121func (iter *RunCommandListResultIterator) Next() error { 7122 return iter.NextWithContext(context.Background()) 7123} 7124 7125// NotDone returns true if the enumeration should be started or is not yet complete. 7126func (iter RunCommandListResultIterator) NotDone() bool { 7127 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7128} 7129 7130// Response returns the raw server response from the last page request. 7131func (iter RunCommandListResultIterator) Response() RunCommandListResult { 7132 return iter.page.Response() 7133} 7134 7135// Value returns the current value or a zero-initialized value if the 7136// iterator has advanced beyond the end of the collection. 7137func (iter RunCommandListResultIterator) Value() RunCommandDocumentBase { 7138 if !iter.page.NotDone() { 7139 return RunCommandDocumentBase{} 7140 } 7141 return iter.page.Values()[iter.i] 7142} 7143 7144// Creates a new instance of the RunCommandListResultIterator type. 7145func NewRunCommandListResultIterator(page RunCommandListResultPage) RunCommandListResultIterator { 7146 return RunCommandListResultIterator{page: page} 7147} 7148 7149// IsEmpty returns true if the ListResult contains no values. 7150func (rclr RunCommandListResult) IsEmpty() bool { 7151 return rclr.Value == nil || len(*rclr.Value) == 0 7152} 7153 7154// hasNextLink returns true if the NextLink is not empty. 7155func (rclr RunCommandListResult) hasNextLink() bool { 7156 return rclr.NextLink != nil && len(*rclr.NextLink) != 0 7157} 7158 7159// runCommandListResultPreparer prepares a request to retrieve the next set of results. 7160// It returns nil if no more results exist. 7161func (rclr RunCommandListResult) runCommandListResultPreparer(ctx context.Context) (*http.Request, error) { 7162 if !rclr.hasNextLink() { 7163 return nil, nil 7164 } 7165 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7166 autorest.AsJSON(), 7167 autorest.AsGet(), 7168 autorest.WithBaseURL(to.String(rclr.NextLink))) 7169} 7170 7171// RunCommandListResultPage contains a page of RunCommandDocumentBase values. 7172type RunCommandListResultPage struct { 7173 fn func(context.Context, RunCommandListResult) (RunCommandListResult, error) 7174 rclr RunCommandListResult 7175} 7176 7177// NextWithContext advances to the next page of values. If there was an error making 7178// the request the page does not advance and the error is returned. 7179func (page *RunCommandListResultPage) NextWithContext(ctx context.Context) (err error) { 7180 if tracing.IsEnabled() { 7181 ctx = tracing.StartSpan(ctx, fqdn+"/RunCommandListResultPage.NextWithContext") 7182 defer func() { 7183 sc := -1 7184 if page.Response().Response.Response != nil { 7185 sc = page.Response().Response.Response.StatusCode 7186 } 7187 tracing.EndSpan(ctx, sc, err) 7188 }() 7189 } 7190 for { 7191 next, err := page.fn(ctx, page.rclr) 7192 if err != nil { 7193 return err 7194 } 7195 page.rclr = next 7196 if !next.hasNextLink() || !next.IsEmpty() { 7197 break 7198 } 7199 } 7200 return nil 7201} 7202 7203// Next advances to the next page of values. If there was an error making 7204// the request the page does not advance and the error is returned. 7205// Deprecated: Use NextWithContext() instead. 7206func (page *RunCommandListResultPage) Next() error { 7207 return page.NextWithContext(context.Background()) 7208} 7209 7210// NotDone returns true if the page enumeration should be started or is not yet complete. 7211func (page RunCommandListResultPage) NotDone() bool { 7212 return !page.rclr.IsEmpty() 7213} 7214 7215// Response returns the raw server response from the last page request. 7216func (page RunCommandListResultPage) Response() RunCommandListResult { 7217 return page.rclr 7218} 7219 7220// Values returns the slice of values for the current page or nil if there are no values. 7221func (page RunCommandListResultPage) Values() []RunCommandDocumentBase { 7222 if page.rclr.IsEmpty() { 7223 return nil 7224 } 7225 return *page.rclr.Value 7226} 7227 7228// Creates a new instance of the RunCommandListResultPage type. 7229func NewRunCommandListResultPage(cur RunCommandListResult, getNextPage func(context.Context, RunCommandListResult) (RunCommandListResult, error)) RunCommandListResultPage { 7230 return RunCommandListResultPage{ 7231 fn: getNextPage, 7232 rclr: cur, 7233 } 7234} 7235 7236// RunCommandParameterDefinition describes the properties of a run command parameter. 7237type RunCommandParameterDefinition struct { 7238 // Name - The run command parameter name. 7239 Name *string `json:"name,omitempty"` 7240 // Type - The run command parameter type. 7241 Type *string `json:"type,omitempty"` 7242 // DefaultValue - The run command parameter default value. 7243 DefaultValue *string `json:"defaultValue,omitempty"` 7244 // Required - The run command parameter required. 7245 Required *bool `json:"required,omitempty"` 7246} 7247 7248// RunCommandResult ... 7249type RunCommandResult struct { 7250 autorest.Response `json:"-"` 7251 // Value - Run command operation response. 7252 Value *[]InstanceViewStatus `json:"value,omitempty"` 7253} 7254 7255// ScaleInPolicy describes a scale-in policy for a virtual machine scale set. 7256type ScaleInPolicy struct { 7257 // 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> 7258 Rules *[]VirtualMachineScaleSetScaleInRules `json:"rules,omitempty"` 7259} 7260 7261// ScheduledEventsProfile ... 7262type ScheduledEventsProfile struct { 7263 // TerminateNotificationProfile - Specifies Terminate Scheduled Event related configurations. 7264 TerminateNotificationProfile *TerminateNotificationProfile `json:"terminateNotificationProfile,omitempty"` 7265} 7266 7267// ShareInfoElement ... 7268type ShareInfoElement struct { 7269 // VMURI - READ-ONLY; A relative URI containing the ID of the VM that has the disk attached. 7270 VMURI *string `json:"vmUri,omitempty"` 7271} 7272 7273// Sku describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware 7274// the scale set is currently on, you need to deallocate the VMs in the scale set before you modify the SKU 7275// name. 7276type Sku struct { 7277 // Name - The sku name. 7278 Name *string `json:"name,omitempty"` 7279 // Tier - Specifies the tier of virtual machines in a scale set.<br /><br /> Possible Values:<br /><br /> **Standard**<br /><br /> **Basic** 7280 Tier *string `json:"tier,omitempty"` 7281 // Capacity - Specifies the number of virtual machines in the scale set. 7282 Capacity *int64 `json:"capacity,omitempty"` 7283} 7284 7285// Snapshot snapshot resource. 7286type Snapshot struct { 7287 autorest.Response `json:"-"` 7288 // ManagedBy - READ-ONLY; Unused. Always Null. 7289 ManagedBy *string `json:"managedBy,omitempty"` 7290 Sku *SnapshotSku `json:"sku,omitempty"` 7291 *SnapshotProperties `json:"properties,omitempty"` 7292 // ID - READ-ONLY; Resource Id 7293 ID *string `json:"id,omitempty"` 7294 // Name - READ-ONLY; Resource name 7295 Name *string `json:"name,omitempty"` 7296 // Type - READ-ONLY; Resource type 7297 Type *string `json:"type,omitempty"` 7298 // Location - Resource location 7299 Location *string `json:"location,omitempty"` 7300 // Tags - Resource tags 7301 Tags map[string]*string `json:"tags"` 7302} 7303 7304// MarshalJSON is the custom marshaler for Snapshot. 7305func (s Snapshot) MarshalJSON() ([]byte, error) { 7306 objectMap := make(map[string]interface{}) 7307 if s.Sku != nil { 7308 objectMap["sku"] = s.Sku 7309 } 7310 if s.SnapshotProperties != nil { 7311 objectMap["properties"] = s.SnapshotProperties 7312 } 7313 if s.Location != nil { 7314 objectMap["location"] = s.Location 7315 } 7316 if s.Tags != nil { 7317 objectMap["tags"] = s.Tags 7318 } 7319 return json.Marshal(objectMap) 7320} 7321 7322// UnmarshalJSON is the custom unmarshaler for Snapshot struct. 7323func (s *Snapshot) UnmarshalJSON(body []byte) error { 7324 var m map[string]*json.RawMessage 7325 err := json.Unmarshal(body, &m) 7326 if err != nil { 7327 return err 7328 } 7329 for k, v := range m { 7330 switch k { 7331 case "managedBy": 7332 if v != nil { 7333 var managedBy string 7334 err = json.Unmarshal(*v, &managedBy) 7335 if err != nil { 7336 return err 7337 } 7338 s.ManagedBy = &managedBy 7339 } 7340 case "sku": 7341 if v != nil { 7342 var sku SnapshotSku 7343 err = json.Unmarshal(*v, &sku) 7344 if err != nil { 7345 return err 7346 } 7347 s.Sku = &sku 7348 } 7349 case "properties": 7350 if v != nil { 7351 var snapshotProperties SnapshotProperties 7352 err = json.Unmarshal(*v, &snapshotProperties) 7353 if err != nil { 7354 return err 7355 } 7356 s.SnapshotProperties = &snapshotProperties 7357 } 7358 case "id": 7359 if v != nil { 7360 var ID string 7361 err = json.Unmarshal(*v, &ID) 7362 if err != nil { 7363 return err 7364 } 7365 s.ID = &ID 7366 } 7367 case "name": 7368 if v != nil { 7369 var name string 7370 err = json.Unmarshal(*v, &name) 7371 if err != nil { 7372 return err 7373 } 7374 s.Name = &name 7375 } 7376 case "type": 7377 if v != nil { 7378 var typeVar string 7379 err = json.Unmarshal(*v, &typeVar) 7380 if err != nil { 7381 return err 7382 } 7383 s.Type = &typeVar 7384 } 7385 case "location": 7386 if v != nil { 7387 var location string 7388 err = json.Unmarshal(*v, &location) 7389 if err != nil { 7390 return err 7391 } 7392 s.Location = &location 7393 } 7394 case "tags": 7395 if v != nil { 7396 var tags map[string]*string 7397 err = json.Unmarshal(*v, &tags) 7398 if err != nil { 7399 return err 7400 } 7401 s.Tags = tags 7402 } 7403 } 7404 } 7405 7406 return nil 7407} 7408 7409// SnapshotList the List Snapshots operation response. 7410type SnapshotList struct { 7411 autorest.Response `json:"-"` 7412 // Value - A list of snapshots. 7413 Value *[]Snapshot `json:"value,omitempty"` 7414 // NextLink - The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the next page of snapshots. 7415 NextLink *string `json:"nextLink,omitempty"` 7416} 7417 7418// SnapshotListIterator provides access to a complete listing of Snapshot values. 7419type SnapshotListIterator struct { 7420 i int 7421 page SnapshotListPage 7422} 7423 7424// NextWithContext advances to the next value. If there was an error making 7425// the request the iterator does not advance and the error is returned. 7426func (iter *SnapshotListIterator) NextWithContext(ctx context.Context) (err error) { 7427 if tracing.IsEnabled() { 7428 ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotListIterator.NextWithContext") 7429 defer func() { 7430 sc := -1 7431 if iter.Response().Response.Response != nil { 7432 sc = iter.Response().Response.Response.StatusCode 7433 } 7434 tracing.EndSpan(ctx, sc, err) 7435 }() 7436 } 7437 iter.i++ 7438 if iter.i < len(iter.page.Values()) { 7439 return nil 7440 } 7441 err = iter.page.NextWithContext(ctx) 7442 if err != nil { 7443 iter.i-- 7444 return err 7445 } 7446 iter.i = 0 7447 return nil 7448} 7449 7450// Next advances to the next value. If there was an error making 7451// the request the iterator does not advance and the error is returned. 7452// Deprecated: Use NextWithContext() instead. 7453func (iter *SnapshotListIterator) Next() error { 7454 return iter.NextWithContext(context.Background()) 7455} 7456 7457// NotDone returns true if the enumeration should be started or is not yet complete. 7458func (iter SnapshotListIterator) NotDone() bool { 7459 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7460} 7461 7462// Response returns the raw server response from the last page request. 7463func (iter SnapshotListIterator) Response() SnapshotList { 7464 return iter.page.Response() 7465} 7466 7467// Value returns the current value or a zero-initialized value if the 7468// iterator has advanced beyond the end of the collection. 7469func (iter SnapshotListIterator) Value() Snapshot { 7470 if !iter.page.NotDone() { 7471 return Snapshot{} 7472 } 7473 return iter.page.Values()[iter.i] 7474} 7475 7476// Creates a new instance of the SnapshotListIterator type. 7477func NewSnapshotListIterator(page SnapshotListPage) SnapshotListIterator { 7478 return SnapshotListIterator{page: page} 7479} 7480 7481// IsEmpty returns true if the ListResult contains no values. 7482func (sl SnapshotList) IsEmpty() bool { 7483 return sl.Value == nil || len(*sl.Value) == 0 7484} 7485 7486// hasNextLink returns true if the NextLink is not empty. 7487func (sl SnapshotList) hasNextLink() bool { 7488 return sl.NextLink != nil && len(*sl.NextLink) != 0 7489} 7490 7491// snapshotListPreparer prepares a request to retrieve the next set of results. 7492// It returns nil if no more results exist. 7493func (sl SnapshotList) snapshotListPreparer(ctx context.Context) (*http.Request, error) { 7494 if !sl.hasNextLink() { 7495 return nil, nil 7496 } 7497 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7498 autorest.AsJSON(), 7499 autorest.AsGet(), 7500 autorest.WithBaseURL(to.String(sl.NextLink))) 7501} 7502 7503// SnapshotListPage contains a page of Snapshot values. 7504type SnapshotListPage struct { 7505 fn func(context.Context, SnapshotList) (SnapshotList, error) 7506 sl SnapshotList 7507} 7508 7509// NextWithContext advances to the next page of values. If there was an error making 7510// the request the page does not advance and the error is returned. 7511func (page *SnapshotListPage) NextWithContext(ctx context.Context) (err error) { 7512 if tracing.IsEnabled() { 7513 ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotListPage.NextWithContext") 7514 defer func() { 7515 sc := -1 7516 if page.Response().Response.Response != nil { 7517 sc = page.Response().Response.Response.StatusCode 7518 } 7519 tracing.EndSpan(ctx, sc, err) 7520 }() 7521 } 7522 for { 7523 next, err := page.fn(ctx, page.sl) 7524 if err != nil { 7525 return err 7526 } 7527 page.sl = next 7528 if !next.hasNextLink() || !next.IsEmpty() { 7529 break 7530 } 7531 } 7532 return nil 7533} 7534 7535// Next advances to the next page of values. If there was an error making 7536// the request the page does not advance and the error is returned. 7537// Deprecated: Use NextWithContext() instead. 7538func (page *SnapshotListPage) Next() error { 7539 return page.NextWithContext(context.Background()) 7540} 7541 7542// NotDone returns true if the page enumeration should be started or is not yet complete. 7543func (page SnapshotListPage) NotDone() bool { 7544 return !page.sl.IsEmpty() 7545} 7546 7547// Response returns the raw server response from the last page request. 7548func (page SnapshotListPage) Response() SnapshotList { 7549 return page.sl 7550} 7551 7552// Values returns the slice of values for the current page or nil if there are no values. 7553func (page SnapshotListPage) Values() []Snapshot { 7554 if page.sl.IsEmpty() { 7555 return nil 7556 } 7557 return *page.sl.Value 7558} 7559 7560// Creates a new instance of the SnapshotListPage type. 7561func NewSnapshotListPage(cur SnapshotList, getNextPage func(context.Context, SnapshotList) (SnapshotList, error)) SnapshotListPage { 7562 return SnapshotListPage{ 7563 fn: getNextPage, 7564 sl: cur, 7565 } 7566} 7567 7568// SnapshotProperties snapshot resource properties. 7569type SnapshotProperties struct { 7570 // TimeCreated - READ-ONLY; The time when the disk was created. 7571 TimeCreated *date.Time `json:"timeCreated,omitempty"` 7572 // OsType - The Operating System type. Possible values include: 'Windows', 'Linux' 7573 OsType OperatingSystemTypes `json:"osType,omitempty"` 7574 // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'V1', 'V2' 7575 HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` 7576 // CreationData - Disk source information. CreationData information cannot be changed after the disk has been created. 7577 CreationData *CreationData `json:"creationData,omitempty"` 7578 // 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. 7579 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 7580 // DiskSizeBytes - READ-ONLY; The size of the disk in bytes. This field is read only. 7581 DiskSizeBytes *int64 `json:"diskSizeBytes,omitempty"` 7582 // UniqueID - READ-ONLY; Unique Guid identifying the resource. 7583 UniqueID *string `json:"uniqueId,omitempty"` 7584 // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. 7585 EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` 7586 // ProvisioningState - READ-ONLY; The disk provisioning state. 7587 ProvisioningState *string `json:"provisioningState,omitempty"` 7588 // Incremental - Whether a snapshot is incremental. Incremental snapshots on the same disk occupy less space than full snapshots and can be diffed. 7589 Incremental *bool `json:"incremental,omitempty"` 7590 // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 7591 Encryption *Encryption `json:"encryption,omitempty"` 7592} 7593 7594// MarshalJSON is the custom marshaler for SnapshotProperties. 7595func (sp SnapshotProperties) MarshalJSON() ([]byte, error) { 7596 objectMap := make(map[string]interface{}) 7597 if sp.OsType != "" { 7598 objectMap["osType"] = sp.OsType 7599 } 7600 if sp.HyperVGeneration != "" { 7601 objectMap["hyperVGeneration"] = sp.HyperVGeneration 7602 } 7603 if sp.CreationData != nil { 7604 objectMap["creationData"] = sp.CreationData 7605 } 7606 if sp.DiskSizeGB != nil { 7607 objectMap["diskSizeGB"] = sp.DiskSizeGB 7608 } 7609 if sp.EncryptionSettingsCollection != nil { 7610 objectMap["encryptionSettingsCollection"] = sp.EncryptionSettingsCollection 7611 } 7612 if sp.Incremental != nil { 7613 objectMap["incremental"] = sp.Incremental 7614 } 7615 if sp.Encryption != nil { 7616 objectMap["encryption"] = sp.Encryption 7617 } 7618 return json.Marshal(objectMap) 7619} 7620 7621// SnapshotsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 7622// operation. 7623type SnapshotsCreateOrUpdateFuture struct { 7624 azure.FutureAPI 7625 // Result returns the result of the asynchronous operation. 7626 // If the operation has not completed it will return an error. 7627 Result func(SnapshotsClient) (Snapshot, error) 7628} 7629 7630// SnapshotsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 7631// operation. 7632type SnapshotsDeleteFuture struct { 7633 azure.FutureAPI 7634 // Result returns the result of the asynchronous operation. 7635 // If the operation has not completed it will return an error. 7636 Result func(SnapshotsClient) (autorest.Response, error) 7637} 7638 7639// SnapshotsGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running 7640// operation. 7641type SnapshotsGrantAccessFuture struct { 7642 azure.FutureAPI 7643 // Result returns the result of the asynchronous operation. 7644 // If the operation has not completed it will return an error. 7645 Result func(SnapshotsClient) (AccessURI, error) 7646} 7647 7648// SnapshotSku the snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. 7649type SnapshotSku struct { 7650 // Name - The sku name. Possible values include: 'SnapshotStorageAccountTypesStandardLRS', 'SnapshotStorageAccountTypesPremiumLRS', 'SnapshotStorageAccountTypesStandardZRS' 7651 Name SnapshotStorageAccountTypes `json:"name,omitempty"` 7652 // Tier - READ-ONLY; The sku tier. 7653 Tier *string `json:"tier,omitempty"` 7654} 7655 7656// MarshalJSON is the custom marshaler for SnapshotSku. 7657func (ss SnapshotSku) MarshalJSON() ([]byte, error) { 7658 objectMap := make(map[string]interface{}) 7659 if ss.Name != "" { 7660 objectMap["name"] = ss.Name 7661 } 7662 return json.Marshal(objectMap) 7663} 7664 7665// SnapshotsRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running 7666// operation. 7667type SnapshotsRevokeAccessFuture struct { 7668 azure.FutureAPI 7669 // Result returns the result of the asynchronous operation. 7670 // If the operation has not completed it will return an error. 7671 Result func(SnapshotsClient) (autorest.Response, error) 7672} 7673 7674// SnapshotsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 7675// operation. 7676type SnapshotsUpdateFuture struct { 7677 azure.FutureAPI 7678 // Result returns the result of the asynchronous operation. 7679 // If the operation has not completed it will return an error. 7680 Result func(SnapshotsClient) (Snapshot, error) 7681} 7682 7683// SnapshotUpdate snapshot update resource. 7684type SnapshotUpdate struct { 7685 *SnapshotUpdateProperties `json:"properties,omitempty"` 7686 // Tags - Resource tags 7687 Tags map[string]*string `json:"tags"` 7688 Sku *SnapshotSku `json:"sku,omitempty"` 7689} 7690 7691// MarshalJSON is the custom marshaler for SnapshotUpdate. 7692func (su SnapshotUpdate) MarshalJSON() ([]byte, error) { 7693 objectMap := make(map[string]interface{}) 7694 if su.SnapshotUpdateProperties != nil { 7695 objectMap["properties"] = su.SnapshotUpdateProperties 7696 } 7697 if su.Tags != nil { 7698 objectMap["tags"] = su.Tags 7699 } 7700 if su.Sku != nil { 7701 objectMap["sku"] = su.Sku 7702 } 7703 return json.Marshal(objectMap) 7704} 7705 7706// UnmarshalJSON is the custom unmarshaler for SnapshotUpdate struct. 7707func (su *SnapshotUpdate) UnmarshalJSON(body []byte) error { 7708 var m map[string]*json.RawMessage 7709 err := json.Unmarshal(body, &m) 7710 if err != nil { 7711 return err 7712 } 7713 for k, v := range m { 7714 switch k { 7715 case "properties": 7716 if v != nil { 7717 var snapshotUpdateProperties SnapshotUpdateProperties 7718 err = json.Unmarshal(*v, &snapshotUpdateProperties) 7719 if err != nil { 7720 return err 7721 } 7722 su.SnapshotUpdateProperties = &snapshotUpdateProperties 7723 } 7724 case "tags": 7725 if v != nil { 7726 var tags map[string]*string 7727 err = json.Unmarshal(*v, &tags) 7728 if err != nil { 7729 return err 7730 } 7731 su.Tags = tags 7732 } 7733 case "sku": 7734 if v != nil { 7735 var sku SnapshotSku 7736 err = json.Unmarshal(*v, &sku) 7737 if err != nil { 7738 return err 7739 } 7740 su.Sku = &sku 7741 } 7742 } 7743 } 7744 7745 return nil 7746} 7747 7748// SnapshotUpdateProperties snapshot resource update properties. 7749type SnapshotUpdateProperties struct { 7750 // OsType - the Operating System type. Possible values include: 'Windows', 'Linux' 7751 OsType OperatingSystemTypes `json:"osType,omitempty"` 7752 // 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. 7753 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 7754 // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. 7755 EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` 7756 // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 7757 Encryption *Encryption `json:"encryption,omitempty"` 7758} 7759 7760// SourceVault the vault id is an Azure Resource Manager Resource id in the form 7761// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName} 7762type SourceVault struct { 7763 // ID - Resource Id 7764 ID *string `json:"id,omitempty"` 7765} 7766 7767// SSHConfiguration SSH configuration for Linux based VMs running on Azure 7768type SSHConfiguration struct { 7769 // PublicKeys - The list of SSH public keys used to authenticate with linux based VMs. 7770 PublicKeys *[]SSHPublicKey `json:"publicKeys,omitempty"` 7771} 7772 7773// SSHPublicKey contains information about SSH certificate public key and the path on the Linux VM where 7774// the public key is placed. 7775type SSHPublicKey struct { 7776 // 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 7777 Path *string `json:"path,omitempty"` 7778 // 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). 7779 KeyData *string `json:"keyData,omitempty"` 7780} 7781 7782// SSHPublicKeyGenerateKeyPairResult response from generation of an SSH key pair. 7783type SSHPublicKeyGenerateKeyPairResult struct { 7784 autorest.Response `json:"-"` 7785 // PrivateKey - Private key portion of the key pair used to authenticate to a virtual machine through ssh. The private key is returned in RFC3447 format and should be treated as a secret. 7786 PrivateKey *string `json:"privateKey,omitempty"` 7787 // PublicKey - Public key portion of the key pair used to authenticate to a virtual machine through ssh. The public key is in ssh-rsa format. 7788 PublicKey *string `json:"publicKey,omitempty"` 7789 // ID - The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{SshPublicKeyName} 7790 ID *string `json:"id,omitempty"` 7791} 7792 7793// SSHPublicKeyResource specifies information about the SSH public key. 7794type SSHPublicKeyResource struct { 7795 autorest.Response `json:"-"` 7796 // SSHPublicKeyResourceProperties - Properties of the SSH public key. 7797 *SSHPublicKeyResourceProperties `json:"properties,omitempty"` 7798 // ID - READ-ONLY; Resource Id 7799 ID *string `json:"id,omitempty"` 7800 // Name - READ-ONLY; Resource name 7801 Name *string `json:"name,omitempty"` 7802 // Type - READ-ONLY; Resource type 7803 Type *string `json:"type,omitempty"` 7804 // Location - Resource location 7805 Location *string `json:"location,omitempty"` 7806 // Tags - Resource tags 7807 Tags map[string]*string `json:"tags"` 7808} 7809 7810// MarshalJSON is the custom marshaler for SSHPublicKeyResource. 7811func (spkr SSHPublicKeyResource) MarshalJSON() ([]byte, error) { 7812 objectMap := make(map[string]interface{}) 7813 if spkr.SSHPublicKeyResourceProperties != nil { 7814 objectMap["properties"] = spkr.SSHPublicKeyResourceProperties 7815 } 7816 if spkr.Location != nil { 7817 objectMap["location"] = spkr.Location 7818 } 7819 if spkr.Tags != nil { 7820 objectMap["tags"] = spkr.Tags 7821 } 7822 return json.Marshal(objectMap) 7823} 7824 7825// UnmarshalJSON is the custom unmarshaler for SSHPublicKeyResource struct. 7826func (spkr *SSHPublicKeyResource) UnmarshalJSON(body []byte) error { 7827 var m map[string]*json.RawMessage 7828 err := json.Unmarshal(body, &m) 7829 if err != nil { 7830 return err 7831 } 7832 for k, v := range m { 7833 switch k { 7834 case "properties": 7835 if v != nil { 7836 var SSHPublicKeyResourceProperties SSHPublicKeyResourceProperties 7837 err = json.Unmarshal(*v, &SSHPublicKeyResourceProperties) 7838 if err != nil { 7839 return err 7840 } 7841 spkr.SSHPublicKeyResourceProperties = &SSHPublicKeyResourceProperties 7842 } 7843 case "id": 7844 if v != nil { 7845 var ID string 7846 err = json.Unmarshal(*v, &ID) 7847 if err != nil { 7848 return err 7849 } 7850 spkr.ID = &ID 7851 } 7852 case "name": 7853 if v != nil { 7854 var name string 7855 err = json.Unmarshal(*v, &name) 7856 if err != nil { 7857 return err 7858 } 7859 spkr.Name = &name 7860 } 7861 case "type": 7862 if v != nil { 7863 var typeVar string 7864 err = json.Unmarshal(*v, &typeVar) 7865 if err != nil { 7866 return err 7867 } 7868 spkr.Type = &typeVar 7869 } 7870 case "location": 7871 if v != nil { 7872 var location string 7873 err = json.Unmarshal(*v, &location) 7874 if err != nil { 7875 return err 7876 } 7877 spkr.Location = &location 7878 } 7879 case "tags": 7880 if v != nil { 7881 var tags map[string]*string 7882 err = json.Unmarshal(*v, &tags) 7883 if err != nil { 7884 return err 7885 } 7886 spkr.Tags = tags 7887 } 7888 } 7889 } 7890 7891 return nil 7892} 7893 7894// SSHPublicKeyResourceProperties properties of the SSH public key. 7895type SSHPublicKeyResourceProperties struct { 7896 // PublicKey - SSH public key used to authenticate to a virtual machine through ssh. If this property is not initially provided when the resource is created, the publicKey property will be populated when generateKeyPair is called. If the public key is provided upon resource creation, the provided public key needs to be at least 2048-bit and in ssh-rsa format. 7897 PublicKey *string `json:"publicKey,omitempty"` 7898} 7899 7900// SSHPublicKeysGroupListResult the list SSH public keys operation response. 7901type SSHPublicKeysGroupListResult struct { 7902 autorest.Response `json:"-"` 7903 // Value - The list of SSH public keys 7904 Value *[]SSHPublicKeyResource `json:"value,omitempty"` 7905 // NextLink - The URI to fetch the next page of SSH public keys. Call ListNext() with this URI to fetch the next page of SSH public keys. 7906 NextLink *string `json:"nextLink,omitempty"` 7907} 7908 7909// SSHPublicKeysGroupListResultIterator provides access to a complete listing of SSHPublicKeyResource 7910// values. 7911type SSHPublicKeysGroupListResultIterator struct { 7912 i int 7913 page SSHPublicKeysGroupListResultPage 7914} 7915 7916// NextWithContext advances to the next value. If there was an error making 7917// the request the iterator does not advance and the error is returned. 7918func (iter *SSHPublicKeysGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { 7919 if tracing.IsEnabled() { 7920 ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysGroupListResultIterator.NextWithContext") 7921 defer func() { 7922 sc := -1 7923 if iter.Response().Response.Response != nil { 7924 sc = iter.Response().Response.Response.StatusCode 7925 } 7926 tracing.EndSpan(ctx, sc, err) 7927 }() 7928 } 7929 iter.i++ 7930 if iter.i < len(iter.page.Values()) { 7931 return nil 7932 } 7933 err = iter.page.NextWithContext(ctx) 7934 if err != nil { 7935 iter.i-- 7936 return err 7937 } 7938 iter.i = 0 7939 return nil 7940} 7941 7942// Next advances to the next value. If there was an error making 7943// the request the iterator does not advance and the error is returned. 7944// Deprecated: Use NextWithContext() instead. 7945func (iter *SSHPublicKeysGroupListResultIterator) Next() error { 7946 return iter.NextWithContext(context.Background()) 7947} 7948 7949// NotDone returns true if the enumeration should be started or is not yet complete. 7950func (iter SSHPublicKeysGroupListResultIterator) NotDone() bool { 7951 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7952} 7953 7954// Response returns the raw server response from the last page request. 7955func (iter SSHPublicKeysGroupListResultIterator) Response() SSHPublicKeysGroupListResult { 7956 return iter.page.Response() 7957} 7958 7959// Value returns the current value or a zero-initialized value if the 7960// iterator has advanced beyond the end of the collection. 7961func (iter SSHPublicKeysGroupListResultIterator) Value() SSHPublicKeyResource { 7962 if !iter.page.NotDone() { 7963 return SSHPublicKeyResource{} 7964 } 7965 return iter.page.Values()[iter.i] 7966} 7967 7968// Creates a new instance of the SSHPublicKeysGroupListResultIterator type. 7969func NewSSHPublicKeysGroupListResultIterator(page SSHPublicKeysGroupListResultPage) SSHPublicKeysGroupListResultIterator { 7970 return SSHPublicKeysGroupListResultIterator{page: page} 7971} 7972 7973// IsEmpty returns true if the ListResult contains no values. 7974func (spkglr SSHPublicKeysGroupListResult) IsEmpty() bool { 7975 return spkglr.Value == nil || len(*spkglr.Value) == 0 7976} 7977 7978// hasNextLink returns true if the NextLink is not empty. 7979func (spkglr SSHPublicKeysGroupListResult) hasNextLink() bool { 7980 return spkglr.NextLink != nil && len(*spkglr.NextLink) != 0 7981} 7982 7983// sSHPublicKeysGroupListResultPreparer prepares a request to retrieve the next set of results. 7984// It returns nil if no more results exist. 7985func (spkglr SSHPublicKeysGroupListResult) sSHPublicKeysGroupListResultPreparer(ctx context.Context) (*http.Request, error) { 7986 if !spkglr.hasNextLink() { 7987 return nil, nil 7988 } 7989 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7990 autorest.AsJSON(), 7991 autorest.AsGet(), 7992 autorest.WithBaseURL(to.String(spkglr.NextLink))) 7993} 7994 7995// SSHPublicKeysGroupListResultPage contains a page of SSHPublicKeyResource values. 7996type SSHPublicKeysGroupListResultPage struct { 7997 fn func(context.Context, SSHPublicKeysGroupListResult) (SSHPublicKeysGroupListResult, error) 7998 spkglr SSHPublicKeysGroupListResult 7999} 8000 8001// NextWithContext advances to the next page of values. If there was an error making 8002// the request the page does not advance and the error is returned. 8003func (page *SSHPublicKeysGroupListResultPage) NextWithContext(ctx context.Context) (err error) { 8004 if tracing.IsEnabled() { 8005 ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysGroupListResultPage.NextWithContext") 8006 defer func() { 8007 sc := -1 8008 if page.Response().Response.Response != nil { 8009 sc = page.Response().Response.Response.StatusCode 8010 } 8011 tracing.EndSpan(ctx, sc, err) 8012 }() 8013 } 8014 for { 8015 next, err := page.fn(ctx, page.spkglr) 8016 if err != nil { 8017 return err 8018 } 8019 page.spkglr = next 8020 if !next.hasNextLink() || !next.IsEmpty() { 8021 break 8022 } 8023 } 8024 return nil 8025} 8026 8027// Next advances to the next page of values. If there was an error making 8028// the request the page does not advance and the error is returned. 8029// Deprecated: Use NextWithContext() instead. 8030func (page *SSHPublicKeysGroupListResultPage) Next() error { 8031 return page.NextWithContext(context.Background()) 8032} 8033 8034// NotDone returns true if the page enumeration should be started or is not yet complete. 8035func (page SSHPublicKeysGroupListResultPage) NotDone() bool { 8036 return !page.spkglr.IsEmpty() 8037} 8038 8039// Response returns the raw server response from the last page request. 8040func (page SSHPublicKeysGroupListResultPage) Response() SSHPublicKeysGroupListResult { 8041 return page.spkglr 8042} 8043 8044// Values returns the slice of values for the current page or nil if there are no values. 8045func (page SSHPublicKeysGroupListResultPage) Values() []SSHPublicKeyResource { 8046 if page.spkglr.IsEmpty() { 8047 return nil 8048 } 8049 return *page.spkglr.Value 8050} 8051 8052// Creates a new instance of the SSHPublicKeysGroupListResultPage type. 8053func NewSSHPublicKeysGroupListResultPage(cur SSHPublicKeysGroupListResult, getNextPage func(context.Context, SSHPublicKeysGroupListResult) (SSHPublicKeysGroupListResult, error)) SSHPublicKeysGroupListResultPage { 8054 return SSHPublicKeysGroupListResultPage{ 8055 fn: getNextPage, 8056 spkglr: cur, 8057 } 8058} 8059 8060// SSHPublicKeyUpdateResource specifies information about the SSH public key. 8061type SSHPublicKeyUpdateResource struct { 8062 // SSHPublicKeyResourceProperties - Properties of the SSH public key. 8063 *SSHPublicKeyResourceProperties `json:"properties,omitempty"` 8064 // Tags - Resource tags 8065 Tags map[string]*string `json:"tags"` 8066} 8067 8068// MarshalJSON is the custom marshaler for SSHPublicKeyUpdateResource. 8069func (spkur SSHPublicKeyUpdateResource) MarshalJSON() ([]byte, error) { 8070 objectMap := make(map[string]interface{}) 8071 if spkur.SSHPublicKeyResourceProperties != nil { 8072 objectMap["properties"] = spkur.SSHPublicKeyResourceProperties 8073 } 8074 if spkur.Tags != nil { 8075 objectMap["tags"] = spkur.Tags 8076 } 8077 return json.Marshal(objectMap) 8078} 8079 8080// UnmarshalJSON is the custom unmarshaler for SSHPublicKeyUpdateResource struct. 8081func (spkur *SSHPublicKeyUpdateResource) UnmarshalJSON(body []byte) error { 8082 var m map[string]*json.RawMessage 8083 err := json.Unmarshal(body, &m) 8084 if err != nil { 8085 return err 8086 } 8087 for k, v := range m { 8088 switch k { 8089 case "properties": 8090 if v != nil { 8091 var SSHPublicKeyResourceProperties SSHPublicKeyResourceProperties 8092 err = json.Unmarshal(*v, &SSHPublicKeyResourceProperties) 8093 if err != nil { 8094 return err 8095 } 8096 spkur.SSHPublicKeyResourceProperties = &SSHPublicKeyResourceProperties 8097 } 8098 case "tags": 8099 if v != nil { 8100 var tags map[string]*string 8101 err = json.Unmarshal(*v, &tags) 8102 if err != nil { 8103 return err 8104 } 8105 spkur.Tags = tags 8106 } 8107 } 8108 } 8109 8110 return nil 8111} 8112 8113// StorageProfile specifies the storage settings for the virtual machine disks. 8114type StorageProfile struct { 8115 // 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. 8116 ImageReference *ImageReference `json:"imageReference,omitempty"` 8117 // 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). 8118 OsDisk *OSDisk `json:"osDisk,omitempty"` 8119 // 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). 8120 DataDisks *[]DataDisk `json:"dataDisks,omitempty"` 8121} 8122 8123// SubResource ... 8124type SubResource struct { 8125 // ID - Resource Id 8126 ID *string `json:"id,omitempty"` 8127} 8128 8129// SubResourceReadOnly ... 8130type SubResourceReadOnly struct { 8131 // ID - READ-ONLY; Resource Id 8132 ID *string `json:"id,omitempty"` 8133} 8134 8135// SubResourceWithColocationStatus ... 8136type SubResourceWithColocationStatus struct { 8137 // ColocationStatus - Describes colocation status of a resource in the Proximity Placement Group. 8138 ColocationStatus *InstanceViewStatus `json:"colocationStatus,omitempty"` 8139 // ID - Resource Id 8140 ID *string `json:"id,omitempty"` 8141} 8142 8143// TargetRegion describes the target region information. 8144type TargetRegion struct { 8145 // Name - The name of the region. 8146 Name *string `json:"name,omitempty"` 8147 // RegionalReplicaCount - The number of replicas of the Image Version to be created per region. This property is updatable. 8148 RegionalReplicaCount *int32 `json:"regionalReplicaCount,omitempty"` 8149 // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' 8150 StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` 8151 Encryption *EncryptionImages `json:"encryption,omitempty"` 8152} 8153 8154// TerminateNotificationProfile ... 8155type TerminateNotificationProfile struct { 8156 // 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) 8157 NotBeforeTimeout *string `json:"notBeforeTimeout,omitempty"` 8158 // Enable - Specifies whether the Terminate Scheduled event is enabled or disabled. 8159 Enable *bool `json:"enable,omitempty"` 8160} 8161 8162// ThrottledRequestsInput api request input for LogAnalytics getThrottledRequests Api. 8163type ThrottledRequestsInput struct { 8164 // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. 8165 BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` 8166 // FromTime - From time of the query 8167 FromTime *date.Time `json:"fromTime,omitempty"` 8168 // ToTime - To time of the query 8169 ToTime *date.Time `json:"toTime,omitempty"` 8170 // GroupByThrottlePolicy - Group query result by Throttle Policy applied. 8171 GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` 8172 // GroupByOperationName - Group query result by Operation Name. 8173 GroupByOperationName *bool `json:"groupByOperationName,omitempty"` 8174 // GroupByResourceName - Group query result by Resource Name. 8175 GroupByResourceName *bool `json:"groupByResourceName,omitempty"` 8176} 8177 8178// UpdateResource the Update Resource model definition. 8179type UpdateResource struct { 8180 // Tags - Resource tags 8181 Tags map[string]*string `json:"tags"` 8182} 8183 8184// MarshalJSON is the custom marshaler for UpdateResource. 8185func (ur UpdateResource) MarshalJSON() ([]byte, error) { 8186 objectMap := make(map[string]interface{}) 8187 if ur.Tags != nil { 8188 objectMap["tags"] = ur.Tags 8189 } 8190 return json.Marshal(objectMap) 8191} 8192 8193// UpdateResourceDefinition the Update Resource model definition. 8194type UpdateResourceDefinition struct { 8195 // ID - READ-ONLY; Resource Id 8196 ID *string `json:"id,omitempty"` 8197 // Name - READ-ONLY; Resource name 8198 Name *string `json:"name,omitempty"` 8199 // Type - READ-ONLY; Resource type 8200 Type *string `json:"type,omitempty"` 8201 // Tags - Resource tags 8202 Tags map[string]*string `json:"tags"` 8203} 8204 8205// MarshalJSON is the custom marshaler for UpdateResourceDefinition. 8206func (urd UpdateResourceDefinition) MarshalJSON() ([]byte, error) { 8207 objectMap := make(map[string]interface{}) 8208 if urd.Tags != nil { 8209 objectMap["tags"] = urd.Tags 8210 } 8211 return json.Marshal(objectMap) 8212} 8213 8214// UpgradeOperationHistoricalStatusInfo virtual Machine Scale Set OS Upgrade History operation response. 8215type UpgradeOperationHistoricalStatusInfo struct { 8216 // Properties - READ-ONLY; Information about the properties of the upgrade operation. 8217 Properties *UpgradeOperationHistoricalStatusInfoProperties `json:"properties,omitempty"` 8218 // Type - READ-ONLY; Resource type 8219 Type *string `json:"type,omitempty"` 8220 // Location - READ-ONLY; Resource location 8221 Location *string `json:"location,omitempty"` 8222} 8223 8224// UpgradeOperationHistoricalStatusInfoProperties describes each OS upgrade on the Virtual Machine Scale 8225// Set. 8226type UpgradeOperationHistoricalStatusInfoProperties struct { 8227 // RunningStatus - READ-ONLY; Information about the overall status of the upgrade operation. 8228 RunningStatus *UpgradeOperationHistoryStatus `json:"runningStatus,omitempty"` 8229 // Progress - READ-ONLY; Counts of the VMs in each state. 8230 Progress *RollingUpgradeProgressInfo `json:"progress,omitempty"` 8231 // Error - READ-ONLY; Error Details for this upgrade if there are any. 8232 Error *APIError `json:"error,omitempty"` 8233 // StartedBy - READ-ONLY; Invoker of the Upgrade Operation. Possible values include: 'UpgradeOperationInvokerUnknown', 'UpgradeOperationInvokerUser', 'UpgradeOperationInvokerPlatform' 8234 StartedBy UpgradeOperationInvoker `json:"startedBy,omitempty"` 8235 // TargetImageReference - READ-ONLY; Image Reference details 8236 TargetImageReference *ImageReference `json:"targetImageReference,omitempty"` 8237 // RollbackInfo - READ-ONLY; Information about OS rollback if performed 8238 RollbackInfo *RollbackStatusInfo `json:"rollbackInfo,omitempty"` 8239} 8240 8241// UpgradeOperationHistoryStatus information about the current running state of the overall upgrade. 8242type UpgradeOperationHistoryStatus struct { 8243 // Code - READ-ONLY; Code indicating the current status of the upgrade. Possible values include: 'UpgradeStateRollingForward', 'UpgradeStateCancelled', 'UpgradeStateCompleted', 'UpgradeStateFaulted' 8244 Code UpgradeState `json:"code,omitempty"` 8245 // StartTime - READ-ONLY; Start time of the upgrade. 8246 StartTime *date.Time `json:"startTime,omitempty"` 8247 // EndTime - READ-ONLY; End time of the upgrade. 8248 EndTime *date.Time `json:"endTime,omitempty"` 8249} 8250 8251// UpgradePolicy describes an upgrade policy - automatic, manual, or rolling. 8252type UpgradePolicy struct { 8253 // 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' 8254 Mode UpgradeMode `json:"mode,omitempty"` 8255 // RollingUpgradePolicy - The configuration parameters used while performing a rolling upgrade. 8256 RollingUpgradePolicy *RollingUpgradePolicy `json:"rollingUpgradePolicy,omitempty"` 8257 // AutomaticOSUpgradePolicy - Configuration parameters used for performing automatic OS Upgrade. 8258 AutomaticOSUpgradePolicy *AutomaticOSUpgradePolicy `json:"automaticOSUpgradePolicy,omitempty"` 8259} 8260 8261// Usage describes Compute Resource Usage. 8262type Usage struct { 8263 // Unit - An enum describing the unit of usage measurement. 8264 Unit *string `json:"unit,omitempty"` 8265 // CurrentValue - The current usage of the resource. 8266 CurrentValue *int32 `json:"currentValue,omitempty"` 8267 // Limit - The maximum permitted usage of the resource. 8268 Limit *int64 `json:"limit,omitempty"` 8269 // Name - The name of the type of usage. 8270 Name *UsageName `json:"name,omitempty"` 8271} 8272 8273// UsageName the Usage Names. 8274type UsageName struct { 8275 // Value - The name of the resource. 8276 Value *string `json:"value,omitempty"` 8277 // LocalizedValue - The localized name of the resource. 8278 LocalizedValue *string `json:"localizedValue,omitempty"` 8279} 8280 8281// UserArtifactSource the source image from which the Image Version is going to be created. 8282type UserArtifactSource struct { 8283 // FileName - Required. The fileName of the artifact. 8284 FileName *string `json:"fileName,omitempty"` 8285 // MediaLink - Required. The mediaLink of the artifact, must be a readable storage blob. 8286 MediaLink *string `json:"mediaLink,omitempty"` 8287} 8288 8289// VaultCertificate describes a single certificate reference in a Key Vault, and where the certificate 8290// should reside on the VM. 8291type VaultCertificate struct { 8292 // 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>} 8293 CertificateURL *string `json:"certificateUrl,omitempty"` 8294 // 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. 8295 CertificateStore *string `json:"certificateStore,omitempty"` 8296} 8297 8298// VaultSecretGroup describes a set of certificates which are all in the same Key Vault. 8299type VaultSecretGroup struct { 8300 // SourceVault - The relative URL of the Key Vault containing all of the certificates in VaultCertificates. 8301 SourceVault *SubResource `json:"sourceVault,omitempty"` 8302 // VaultCertificates - The list of key vault references in SourceVault which contain certificates. 8303 VaultCertificates *[]VaultCertificate `json:"vaultCertificates,omitempty"` 8304} 8305 8306// VirtualHardDisk describes the uri of a disk. 8307type VirtualHardDisk struct { 8308 // URI - Specifies the virtual hard disk's uri. 8309 URI *string `json:"uri,omitempty"` 8310} 8311 8312// VirtualMachine describes a Virtual Machine. 8313type VirtualMachine struct { 8314 autorest.Response `json:"-"` 8315 // 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**. 8316 Plan *Plan `json:"plan,omitempty"` 8317 *VirtualMachineProperties `json:"properties,omitempty"` 8318 // Resources - READ-ONLY; The virtual machine child extension resources. 8319 Resources *[]VirtualMachineExtension `json:"resources,omitempty"` 8320 // Identity - The identity of the virtual machine, if configured. 8321 Identity *VirtualMachineIdentity `json:"identity,omitempty"` 8322 // Zones - The virtual machine zones. 8323 Zones *[]string `json:"zones,omitempty"` 8324 // ID - READ-ONLY; Resource Id 8325 ID *string `json:"id,omitempty"` 8326 // Name - READ-ONLY; Resource name 8327 Name *string `json:"name,omitempty"` 8328 // Type - READ-ONLY; Resource type 8329 Type *string `json:"type,omitempty"` 8330 // Location - Resource location 8331 Location *string `json:"location,omitempty"` 8332 // Tags - Resource tags 8333 Tags map[string]*string `json:"tags"` 8334} 8335 8336// MarshalJSON is the custom marshaler for VirtualMachine. 8337func (VM VirtualMachine) MarshalJSON() ([]byte, error) { 8338 objectMap := make(map[string]interface{}) 8339 if VM.Plan != nil { 8340 objectMap["plan"] = VM.Plan 8341 } 8342 if VM.VirtualMachineProperties != nil { 8343 objectMap["properties"] = VM.VirtualMachineProperties 8344 } 8345 if VM.Identity != nil { 8346 objectMap["identity"] = VM.Identity 8347 } 8348 if VM.Zones != nil { 8349 objectMap["zones"] = VM.Zones 8350 } 8351 if VM.Location != nil { 8352 objectMap["location"] = VM.Location 8353 } 8354 if VM.Tags != nil { 8355 objectMap["tags"] = VM.Tags 8356 } 8357 return json.Marshal(objectMap) 8358} 8359 8360// UnmarshalJSON is the custom unmarshaler for VirtualMachine struct. 8361func (VM *VirtualMachine) UnmarshalJSON(body []byte) error { 8362 var m map[string]*json.RawMessage 8363 err := json.Unmarshal(body, &m) 8364 if err != nil { 8365 return err 8366 } 8367 for k, v := range m { 8368 switch k { 8369 case "plan": 8370 if v != nil { 8371 var plan Plan 8372 err = json.Unmarshal(*v, &plan) 8373 if err != nil { 8374 return err 8375 } 8376 VM.Plan = &plan 8377 } 8378 case "properties": 8379 if v != nil { 8380 var virtualMachineProperties VirtualMachineProperties 8381 err = json.Unmarshal(*v, &virtualMachineProperties) 8382 if err != nil { 8383 return err 8384 } 8385 VM.VirtualMachineProperties = &virtualMachineProperties 8386 } 8387 case "resources": 8388 if v != nil { 8389 var resources []VirtualMachineExtension 8390 err = json.Unmarshal(*v, &resources) 8391 if err != nil { 8392 return err 8393 } 8394 VM.Resources = &resources 8395 } 8396 case "identity": 8397 if v != nil { 8398 var identity VirtualMachineIdentity 8399 err = json.Unmarshal(*v, &identity) 8400 if err != nil { 8401 return err 8402 } 8403 VM.Identity = &identity 8404 } 8405 case "zones": 8406 if v != nil { 8407 var zones []string 8408 err = json.Unmarshal(*v, &zones) 8409 if err != nil { 8410 return err 8411 } 8412 VM.Zones = &zones 8413 } 8414 case "id": 8415 if v != nil { 8416 var ID string 8417 err = json.Unmarshal(*v, &ID) 8418 if err != nil { 8419 return err 8420 } 8421 VM.ID = &ID 8422 } 8423 case "name": 8424 if v != nil { 8425 var name string 8426 err = json.Unmarshal(*v, &name) 8427 if err != nil { 8428 return err 8429 } 8430 VM.Name = &name 8431 } 8432 case "type": 8433 if v != nil { 8434 var typeVar string 8435 err = json.Unmarshal(*v, &typeVar) 8436 if err != nil { 8437 return err 8438 } 8439 VM.Type = &typeVar 8440 } 8441 case "location": 8442 if v != nil { 8443 var location string 8444 err = json.Unmarshal(*v, &location) 8445 if err != nil { 8446 return err 8447 } 8448 VM.Location = &location 8449 } 8450 case "tags": 8451 if v != nil { 8452 var tags map[string]*string 8453 err = json.Unmarshal(*v, &tags) 8454 if err != nil { 8455 return err 8456 } 8457 VM.Tags = tags 8458 } 8459 } 8460 } 8461 8462 return nil 8463} 8464 8465// VirtualMachineAgentInstanceView the instance view of the VM Agent running on the virtual machine. 8466type VirtualMachineAgentInstanceView struct { 8467 // VMAgentVersion - The VM Agent full version. 8468 VMAgentVersion *string `json:"vmAgentVersion,omitempty"` 8469 // ExtensionHandlers - The virtual machine extension handler instance view. 8470 ExtensionHandlers *[]VirtualMachineExtensionHandlerInstanceView `json:"extensionHandlers,omitempty"` 8471 // Statuses - The resource status information. 8472 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 8473} 8474 8475// VirtualMachineCaptureParameters capture Virtual Machine parameters. 8476type VirtualMachineCaptureParameters struct { 8477 // VhdPrefix - The captured virtual hard disk's name prefix. 8478 VhdPrefix *string `json:"vhdPrefix,omitempty"` 8479 // DestinationContainerName - The destination container name. 8480 DestinationContainerName *string `json:"destinationContainerName,omitempty"` 8481 // OverwriteVhds - Specifies whether to overwrite the destination virtual hard disk, in case of conflict. 8482 OverwriteVhds *bool `json:"overwriteVhds,omitempty"` 8483} 8484 8485// VirtualMachineCaptureResult output of virtual machine capture operation. 8486type VirtualMachineCaptureResult struct { 8487 autorest.Response `json:"-"` 8488 // Schema - READ-ONLY; the schema of the captured virtual machine 8489 Schema *string `json:"$schema,omitempty"` 8490 // ContentVersion - READ-ONLY; the version of the content 8491 ContentVersion *string `json:"contentVersion,omitempty"` 8492 // Parameters - READ-ONLY; parameters of the captured virtual machine 8493 Parameters interface{} `json:"parameters,omitempty"` 8494 // Resources - READ-ONLY; a list of resource items of the captured virtual machine 8495 Resources *[]interface{} `json:"resources,omitempty"` 8496 // ID - Resource Id 8497 ID *string `json:"id,omitempty"` 8498} 8499 8500// MarshalJSON is the custom marshaler for VirtualMachineCaptureResult. 8501func (vmcr VirtualMachineCaptureResult) MarshalJSON() ([]byte, error) { 8502 objectMap := make(map[string]interface{}) 8503 if vmcr.ID != nil { 8504 objectMap["id"] = vmcr.ID 8505 } 8506 return json.Marshal(objectMap) 8507} 8508 8509// VirtualMachineExtension describes a Virtual Machine Extension. 8510type VirtualMachineExtension struct { 8511 autorest.Response `json:"-"` 8512 *VirtualMachineExtensionProperties `json:"properties,omitempty"` 8513 // ID - READ-ONLY; Resource Id 8514 ID *string `json:"id,omitempty"` 8515 // Name - READ-ONLY; Resource name 8516 Name *string `json:"name,omitempty"` 8517 // Type - READ-ONLY; Resource type 8518 Type *string `json:"type,omitempty"` 8519 // Location - Resource location 8520 Location *string `json:"location,omitempty"` 8521 // Tags - Resource tags 8522 Tags map[string]*string `json:"tags"` 8523} 8524 8525// MarshalJSON is the custom marshaler for VirtualMachineExtension. 8526func (vme VirtualMachineExtension) MarshalJSON() ([]byte, error) { 8527 objectMap := make(map[string]interface{}) 8528 if vme.VirtualMachineExtensionProperties != nil { 8529 objectMap["properties"] = vme.VirtualMachineExtensionProperties 8530 } 8531 if vme.Location != nil { 8532 objectMap["location"] = vme.Location 8533 } 8534 if vme.Tags != nil { 8535 objectMap["tags"] = vme.Tags 8536 } 8537 return json.Marshal(objectMap) 8538} 8539 8540// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtension struct. 8541func (vme *VirtualMachineExtension) UnmarshalJSON(body []byte) error { 8542 var m map[string]*json.RawMessage 8543 err := json.Unmarshal(body, &m) 8544 if err != nil { 8545 return err 8546 } 8547 for k, v := range m { 8548 switch k { 8549 case "properties": 8550 if v != nil { 8551 var virtualMachineExtensionProperties VirtualMachineExtensionProperties 8552 err = json.Unmarshal(*v, &virtualMachineExtensionProperties) 8553 if err != nil { 8554 return err 8555 } 8556 vme.VirtualMachineExtensionProperties = &virtualMachineExtensionProperties 8557 } 8558 case "id": 8559 if v != nil { 8560 var ID string 8561 err = json.Unmarshal(*v, &ID) 8562 if err != nil { 8563 return err 8564 } 8565 vme.ID = &ID 8566 } 8567 case "name": 8568 if v != nil { 8569 var name string 8570 err = json.Unmarshal(*v, &name) 8571 if err != nil { 8572 return err 8573 } 8574 vme.Name = &name 8575 } 8576 case "type": 8577 if v != nil { 8578 var typeVar string 8579 err = json.Unmarshal(*v, &typeVar) 8580 if err != nil { 8581 return err 8582 } 8583 vme.Type = &typeVar 8584 } 8585 case "location": 8586 if v != nil { 8587 var location string 8588 err = json.Unmarshal(*v, &location) 8589 if err != nil { 8590 return err 8591 } 8592 vme.Location = &location 8593 } 8594 case "tags": 8595 if v != nil { 8596 var tags map[string]*string 8597 err = json.Unmarshal(*v, &tags) 8598 if err != nil { 8599 return err 8600 } 8601 vme.Tags = tags 8602 } 8603 } 8604 } 8605 8606 return nil 8607} 8608 8609// VirtualMachineExtensionHandlerInstanceView the instance view of a virtual machine extension handler. 8610type VirtualMachineExtensionHandlerInstanceView struct { 8611 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 8612 Type *string `json:"type,omitempty"` 8613 // TypeHandlerVersion - Specifies the version of the script handler. 8614 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 8615 // Status - The extension handler status. 8616 Status *InstanceViewStatus `json:"status,omitempty"` 8617} 8618 8619// VirtualMachineExtensionImage describes a Virtual Machine Extension Image. 8620type VirtualMachineExtensionImage struct { 8621 autorest.Response `json:"-"` 8622 *VirtualMachineExtensionImageProperties `json:"properties,omitempty"` 8623 // ID - READ-ONLY; Resource Id 8624 ID *string `json:"id,omitempty"` 8625 // Name - READ-ONLY; Resource name 8626 Name *string `json:"name,omitempty"` 8627 // Type - READ-ONLY; Resource type 8628 Type *string `json:"type,omitempty"` 8629 // Location - Resource location 8630 Location *string `json:"location,omitempty"` 8631 // Tags - Resource tags 8632 Tags map[string]*string `json:"tags"` 8633} 8634 8635// MarshalJSON is the custom marshaler for VirtualMachineExtensionImage. 8636func (vmei VirtualMachineExtensionImage) MarshalJSON() ([]byte, error) { 8637 objectMap := make(map[string]interface{}) 8638 if vmei.VirtualMachineExtensionImageProperties != nil { 8639 objectMap["properties"] = vmei.VirtualMachineExtensionImageProperties 8640 } 8641 if vmei.Location != nil { 8642 objectMap["location"] = vmei.Location 8643 } 8644 if vmei.Tags != nil { 8645 objectMap["tags"] = vmei.Tags 8646 } 8647 return json.Marshal(objectMap) 8648} 8649 8650// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtensionImage struct. 8651func (vmei *VirtualMachineExtensionImage) UnmarshalJSON(body []byte) error { 8652 var m map[string]*json.RawMessage 8653 err := json.Unmarshal(body, &m) 8654 if err != nil { 8655 return err 8656 } 8657 for k, v := range m { 8658 switch k { 8659 case "properties": 8660 if v != nil { 8661 var virtualMachineExtensionImageProperties VirtualMachineExtensionImageProperties 8662 err = json.Unmarshal(*v, &virtualMachineExtensionImageProperties) 8663 if err != nil { 8664 return err 8665 } 8666 vmei.VirtualMachineExtensionImageProperties = &virtualMachineExtensionImageProperties 8667 } 8668 case "id": 8669 if v != nil { 8670 var ID string 8671 err = json.Unmarshal(*v, &ID) 8672 if err != nil { 8673 return err 8674 } 8675 vmei.ID = &ID 8676 } 8677 case "name": 8678 if v != nil { 8679 var name string 8680 err = json.Unmarshal(*v, &name) 8681 if err != nil { 8682 return err 8683 } 8684 vmei.Name = &name 8685 } 8686 case "type": 8687 if v != nil { 8688 var typeVar string 8689 err = json.Unmarshal(*v, &typeVar) 8690 if err != nil { 8691 return err 8692 } 8693 vmei.Type = &typeVar 8694 } 8695 case "location": 8696 if v != nil { 8697 var location string 8698 err = json.Unmarshal(*v, &location) 8699 if err != nil { 8700 return err 8701 } 8702 vmei.Location = &location 8703 } 8704 case "tags": 8705 if v != nil { 8706 var tags map[string]*string 8707 err = json.Unmarshal(*v, &tags) 8708 if err != nil { 8709 return err 8710 } 8711 vmei.Tags = tags 8712 } 8713 } 8714 } 8715 8716 return nil 8717} 8718 8719// VirtualMachineExtensionImageProperties describes the properties of a Virtual Machine Extension Image. 8720type VirtualMachineExtensionImageProperties struct { 8721 // OperatingSystem - The operating system this extension supports. 8722 OperatingSystem *string `json:"operatingSystem,omitempty"` 8723 // ComputeRole - The type of role (IaaS or PaaS) this extension supports. 8724 ComputeRole *string `json:"computeRole,omitempty"` 8725 // HandlerSchema - The schema defined by publisher, where extension consumers should provide settings in a matching schema. 8726 HandlerSchema *string `json:"handlerSchema,omitempty"` 8727 // 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. 8728 VMScaleSetEnabled *bool `json:"vmScaleSetEnabled,omitempty"` 8729 // SupportsMultipleExtensions - Whether the handler can support multiple extensions. 8730 SupportsMultipleExtensions *bool `json:"supportsMultipleExtensions,omitempty"` 8731} 8732 8733// VirtualMachineExtensionInstanceView the instance view of a virtual machine extension. 8734type VirtualMachineExtensionInstanceView struct { 8735 // Name - The virtual machine extension name. 8736 Name *string `json:"name,omitempty"` 8737 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 8738 Type *string `json:"type,omitempty"` 8739 // TypeHandlerVersion - Specifies the version of the script handler. 8740 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 8741 // Substatuses - The resource status information. 8742 Substatuses *[]InstanceViewStatus `json:"substatuses,omitempty"` 8743 // Statuses - The resource status information. 8744 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 8745} 8746 8747// VirtualMachineExtensionProperties describes the properties of a Virtual Machine Extension. 8748type VirtualMachineExtensionProperties struct { 8749 // ForceUpdateTag - How the extension handler should be forced to update even if the extension configuration has not changed. 8750 ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` 8751 // Publisher - The name of the extension handler publisher. 8752 Publisher *string `json:"publisher,omitempty"` 8753 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 8754 Type *string `json:"type,omitempty"` 8755 // TypeHandlerVersion - Specifies the version of the script handler. 8756 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 8757 // 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. 8758 AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` 8759 // Settings - Json formatted public settings for the extension. 8760 Settings interface{} `json:"settings,omitempty"` 8761 // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. 8762 ProtectedSettings interface{} `json:"protectedSettings,omitempty"` 8763 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 8764 ProvisioningState *string `json:"provisioningState,omitempty"` 8765 // InstanceView - The virtual machine extension instance view. 8766 InstanceView *VirtualMachineExtensionInstanceView `json:"instanceView,omitempty"` 8767} 8768 8769// MarshalJSON is the custom marshaler for VirtualMachineExtensionProperties. 8770func (vmep VirtualMachineExtensionProperties) MarshalJSON() ([]byte, error) { 8771 objectMap := make(map[string]interface{}) 8772 if vmep.ForceUpdateTag != nil { 8773 objectMap["forceUpdateTag"] = vmep.ForceUpdateTag 8774 } 8775 if vmep.Publisher != nil { 8776 objectMap["publisher"] = vmep.Publisher 8777 } 8778 if vmep.Type != nil { 8779 objectMap["type"] = vmep.Type 8780 } 8781 if vmep.TypeHandlerVersion != nil { 8782 objectMap["typeHandlerVersion"] = vmep.TypeHandlerVersion 8783 } 8784 if vmep.AutoUpgradeMinorVersion != nil { 8785 objectMap["autoUpgradeMinorVersion"] = vmep.AutoUpgradeMinorVersion 8786 } 8787 if vmep.Settings != nil { 8788 objectMap["settings"] = vmep.Settings 8789 } 8790 if vmep.ProtectedSettings != nil { 8791 objectMap["protectedSettings"] = vmep.ProtectedSettings 8792 } 8793 if vmep.InstanceView != nil { 8794 objectMap["instanceView"] = vmep.InstanceView 8795 } 8796 return json.Marshal(objectMap) 8797} 8798 8799// VirtualMachineExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of 8800// a long-running operation. 8801type VirtualMachineExtensionsCreateOrUpdateFuture struct { 8802 azure.FutureAPI 8803 // Result returns the result of the asynchronous operation. 8804 // If the operation has not completed it will return an error. 8805 Result func(VirtualMachineExtensionsClient) (VirtualMachineExtension, error) 8806} 8807 8808// VirtualMachineExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of a 8809// long-running operation. 8810type VirtualMachineExtensionsDeleteFuture struct { 8811 azure.FutureAPI 8812 // Result returns the result of the asynchronous operation. 8813 // If the operation has not completed it will return an error. 8814 Result func(VirtualMachineExtensionsClient) (autorest.Response, error) 8815} 8816 8817// VirtualMachineExtensionsListResult the List Extension operation response 8818type VirtualMachineExtensionsListResult struct { 8819 autorest.Response `json:"-"` 8820 // Value - The list of extensions 8821 Value *[]VirtualMachineExtension `json:"value,omitempty"` 8822} 8823 8824// VirtualMachineExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of a 8825// long-running operation. 8826type VirtualMachineExtensionsUpdateFuture struct { 8827 azure.FutureAPI 8828 // Result returns the result of the asynchronous operation. 8829 // If the operation has not completed it will return an error. 8830 Result func(VirtualMachineExtensionsClient) (VirtualMachineExtension, error) 8831} 8832 8833// VirtualMachineExtensionUpdate describes a Virtual Machine Extension. 8834type VirtualMachineExtensionUpdate struct { 8835 *VirtualMachineExtensionUpdateProperties `json:"properties,omitempty"` 8836 // Tags - Resource tags 8837 Tags map[string]*string `json:"tags"` 8838} 8839 8840// MarshalJSON is the custom marshaler for VirtualMachineExtensionUpdate. 8841func (vmeu VirtualMachineExtensionUpdate) MarshalJSON() ([]byte, error) { 8842 objectMap := make(map[string]interface{}) 8843 if vmeu.VirtualMachineExtensionUpdateProperties != nil { 8844 objectMap["properties"] = vmeu.VirtualMachineExtensionUpdateProperties 8845 } 8846 if vmeu.Tags != nil { 8847 objectMap["tags"] = vmeu.Tags 8848 } 8849 return json.Marshal(objectMap) 8850} 8851 8852// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtensionUpdate struct. 8853func (vmeu *VirtualMachineExtensionUpdate) UnmarshalJSON(body []byte) error { 8854 var m map[string]*json.RawMessage 8855 err := json.Unmarshal(body, &m) 8856 if err != nil { 8857 return err 8858 } 8859 for k, v := range m { 8860 switch k { 8861 case "properties": 8862 if v != nil { 8863 var virtualMachineExtensionUpdateProperties VirtualMachineExtensionUpdateProperties 8864 err = json.Unmarshal(*v, &virtualMachineExtensionUpdateProperties) 8865 if err != nil { 8866 return err 8867 } 8868 vmeu.VirtualMachineExtensionUpdateProperties = &virtualMachineExtensionUpdateProperties 8869 } 8870 case "tags": 8871 if v != nil { 8872 var tags map[string]*string 8873 err = json.Unmarshal(*v, &tags) 8874 if err != nil { 8875 return err 8876 } 8877 vmeu.Tags = tags 8878 } 8879 } 8880 } 8881 8882 return nil 8883} 8884 8885// VirtualMachineExtensionUpdateProperties describes the properties of a Virtual Machine Extension. 8886type VirtualMachineExtensionUpdateProperties struct { 8887 // ForceUpdateTag - How the extension handler should be forced to update even if the extension configuration has not changed. 8888 ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` 8889 // Publisher - The name of the extension handler publisher. 8890 Publisher *string `json:"publisher,omitempty"` 8891 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 8892 Type *string `json:"type,omitempty"` 8893 // TypeHandlerVersion - Specifies the version of the script handler. 8894 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 8895 // 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. 8896 AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` 8897 // Settings - Json formatted public settings for the extension. 8898 Settings interface{} `json:"settings,omitempty"` 8899 // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. 8900 ProtectedSettings interface{} `json:"protectedSettings,omitempty"` 8901} 8902 8903// VirtualMachineHealthStatus the health status of the VM. 8904type VirtualMachineHealthStatus struct { 8905 // Status - READ-ONLY; The health status information for the VM. 8906 Status *InstanceViewStatus `json:"status,omitempty"` 8907} 8908 8909// VirtualMachineIdentity identity for the virtual machine. 8910type VirtualMachineIdentity struct { 8911 // PrincipalID - READ-ONLY; The principal id of virtual machine identity. This property will only be provided for a system assigned identity. 8912 PrincipalID *string `json:"principalId,omitempty"` 8913 // TenantID - READ-ONLY; The tenant id associated with the virtual machine. This property will only be provided for a system assigned identity. 8914 TenantID *string `json:"tenantId,omitempty"` 8915 // 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' 8916 Type ResourceIdentityType `json:"type,omitempty"` 8917 // 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}'. 8918 UserAssignedIdentities map[string]*VirtualMachineIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` 8919} 8920 8921// MarshalJSON is the custom marshaler for VirtualMachineIdentity. 8922func (vmi VirtualMachineIdentity) MarshalJSON() ([]byte, error) { 8923 objectMap := make(map[string]interface{}) 8924 if vmi.Type != "" { 8925 objectMap["type"] = vmi.Type 8926 } 8927 if vmi.UserAssignedIdentities != nil { 8928 objectMap["userAssignedIdentities"] = vmi.UserAssignedIdentities 8929 } 8930 return json.Marshal(objectMap) 8931} 8932 8933// VirtualMachineIdentityUserAssignedIdentitiesValue ... 8934type VirtualMachineIdentityUserAssignedIdentitiesValue struct { 8935 // PrincipalID - READ-ONLY; The principal id of user assigned identity. 8936 PrincipalID *string `json:"principalId,omitempty"` 8937 // ClientID - READ-ONLY; The client id of user assigned identity. 8938 ClientID *string `json:"clientId,omitempty"` 8939} 8940 8941// VirtualMachineImage describes a Virtual Machine Image. 8942type VirtualMachineImage struct { 8943 autorest.Response `json:"-"` 8944 *VirtualMachineImageProperties `json:"properties,omitempty"` 8945 // Name - The name of the resource. 8946 Name *string `json:"name,omitempty"` 8947 // Location - The supported Azure location of the resource. 8948 Location *string `json:"location,omitempty"` 8949 // 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). 8950 Tags map[string]*string `json:"tags"` 8951 // ID - Resource Id 8952 ID *string `json:"id,omitempty"` 8953} 8954 8955// MarshalJSON is the custom marshaler for VirtualMachineImage. 8956func (vmi VirtualMachineImage) MarshalJSON() ([]byte, error) { 8957 objectMap := make(map[string]interface{}) 8958 if vmi.VirtualMachineImageProperties != nil { 8959 objectMap["properties"] = vmi.VirtualMachineImageProperties 8960 } 8961 if vmi.Name != nil { 8962 objectMap["name"] = vmi.Name 8963 } 8964 if vmi.Location != nil { 8965 objectMap["location"] = vmi.Location 8966 } 8967 if vmi.Tags != nil { 8968 objectMap["tags"] = vmi.Tags 8969 } 8970 if vmi.ID != nil { 8971 objectMap["id"] = vmi.ID 8972 } 8973 return json.Marshal(objectMap) 8974} 8975 8976// UnmarshalJSON is the custom unmarshaler for VirtualMachineImage struct. 8977func (vmi *VirtualMachineImage) UnmarshalJSON(body []byte) error { 8978 var m map[string]*json.RawMessage 8979 err := json.Unmarshal(body, &m) 8980 if err != nil { 8981 return err 8982 } 8983 for k, v := range m { 8984 switch k { 8985 case "properties": 8986 if v != nil { 8987 var virtualMachineImageProperties VirtualMachineImageProperties 8988 err = json.Unmarshal(*v, &virtualMachineImageProperties) 8989 if err != nil { 8990 return err 8991 } 8992 vmi.VirtualMachineImageProperties = &virtualMachineImageProperties 8993 } 8994 case "name": 8995 if v != nil { 8996 var name string 8997 err = json.Unmarshal(*v, &name) 8998 if err != nil { 8999 return err 9000 } 9001 vmi.Name = &name 9002 } 9003 case "location": 9004 if v != nil { 9005 var location string 9006 err = json.Unmarshal(*v, &location) 9007 if err != nil { 9008 return err 9009 } 9010 vmi.Location = &location 9011 } 9012 case "tags": 9013 if v != nil { 9014 var tags map[string]*string 9015 err = json.Unmarshal(*v, &tags) 9016 if err != nil { 9017 return err 9018 } 9019 vmi.Tags = tags 9020 } 9021 case "id": 9022 if v != nil { 9023 var ID string 9024 err = json.Unmarshal(*v, &ID) 9025 if err != nil { 9026 return err 9027 } 9028 vmi.ID = &ID 9029 } 9030 } 9031 } 9032 9033 return nil 9034} 9035 9036// VirtualMachineImageProperties describes the properties of a Virtual Machine Image. 9037type VirtualMachineImageProperties struct { 9038 Plan *PurchasePlan `json:"plan,omitempty"` 9039 OsDiskImage *OSDiskImage `json:"osDiskImage,omitempty"` 9040 DataDiskImages *[]DataDiskImage `json:"dataDiskImages,omitempty"` 9041 AutomaticOSUpgradeProperties *AutomaticOSUpgradeProperties `json:"automaticOSUpgradeProperties,omitempty"` 9042 // HyperVGeneration - Possible values include: 'HyperVGenerationTypesV1', 'HyperVGenerationTypesV2' 9043 HyperVGeneration HyperVGenerationTypes `json:"hyperVGeneration,omitempty"` 9044} 9045 9046// VirtualMachineImageResource virtual machine image resource information. 9047type VirtualMachineImageResource struct { 9048 // Name - The name of the resource. 9049 Name *string `json:"name,omitempty"` 9050 // Location - The supported Azure location of the resource. 9051 Location *string `json:"location,omitempty"` 9052 // 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). 9053 Tags map[string]*string `json:"tags"` 9054 // ID - Resource Id 9055 ID *string `json:"id,omitempty"` 9056} 9057 9058// MarshalJSON is the custom marshaler for VirtualMachineImageResource. 9059func (vmir VirtualMachineImageResource) MarshalJSON() ([]byte, error) { 9060 objectMap := make(map[string]interface{}) 9061 if vmir.Name != nil { 9062 objectMap["name"] = vmir.Name 9063 } 9064 if vmir.Location != nil { 9065 objectMap["location"] = vmir.Location 9066 } 9067 if vmir.Tags != nil { 9068 objectMap["tags"] = vmir.Tags 9069 } 9070 if vmir.ID != nil { 9071 objectMap["id"] = vmir.ID 9072 } 9073 return json.Marshal(objectMap) 9074} 9075 9076// VirtualMachineInstanceView the instance view of a virtual machine. 9077type VirtualMachineInstanceView struct { 9078 autorest.Response `json:"-"` 9079 // PlatformUpdateDomain - Specifies the update domain of the virtual machine. 9080 PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` 9081 // PlatformFaultDomain - Specifies the fault domain of the virtual machine. 9082 PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` 9083 // ComputerName - The computer name assigned to the virtual machine. 9084 ComputerName *string `json:"computerName,omitempty"` 9085 // OsName - The Operating System running on the virtual machine. 9086 OsName *string `json:"osName,omitempty"` 9087 // OsVersion - The version of Operating System running on the virtual machine. 9088 OsVersion *string `json:"osVersion,omitempty"` 9089 // HyperVGeneration - Specifies the HyperVGeneration Type associated with a resource. Possible values include: 'HyperVGenerationTypeV1', 'HyperVGenerationTypeV2' 9090 HyperVGeneration HyperVGenerationType `json:"hyperVGeneration,omitempty"` 9091 // RdpThumbPrint - The Remote desktop certificate thumbprint. 9092 RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"` 9093 // VMAgent - The VM Agent running on the virtual machine. 9094 VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"` 9095 // MaintenanceRedeployStatus - The Maintenance Operation status on the virtual machine. 9096 MaintenanceRedeployStatus *MaintenanceRedeployStatus `json:"maintenanceRedeployStatus,omitempty"` 9097 // Disks - The virtual machine disk information. 9098 Disks *[]DiskInstanceView `json:"disks,omitempty"` 9099 // Extensions - The extensions information. 9100 Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` 9101 // 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. 9102 BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` 9103 // Statuses - The resource status information. 9104 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 9105} 9106 9107// VirtualMachineListResult the List Virtual Machine operation response. 9108type VirtualMachineListResult struct { 9109 autorest.Response `json:"-"` 9110 // Value - The list of virtual machines. 9111 Value *[]VirtualMachine `json:"value,omitempty"` 9112 // NextLink - The URI to fetch the next page of VMs. Call ListNext() with this URI to fetch the next page of Virtual Machines. 9113 NextLink *string `json:"nextLink,omitempty"` 9114} 9115 9116// VirtualMachineListResultIterator provides access to a complete listing of VirtualMachine values. 9117type VirtualMachineListResultIterator struct { 9118 i int 9119 page VirtualMachineListResultPage 9120} 9121 9122// NextWithContext advances to the next value. If there was an error making 9123// the request the iterator does not advance and the error is returned. 9124func (iter *VirtualMachineListResultIterator) NextWithContext(ctx context.Context) (err error) { 9125 if tracing.IsEnabled() { 9126 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineListResultIterator.NextWithContext") 9127 defer func() { 9128 sc := -1 9129 if iter.Response().Response.Response != nil { 9130 sc = iter.Response().Response.Response.StatusCode 9131 } 9132 tracing.EndSpan(ctx, sc, err) 9133 }() 9134 } 9135 iter.i++ 9136 if iter.i < len(iter.page.Values()) { 9137 return nil 9138 } 9139 err = iter.page.NextWithContext(ctx) 9140 if err != nil { 9141 iter.i-- 9142 return err 9143 } 9144 iter.i = 0 9145 return nil 9146} 9147 9148// Next advances to the next value. If there was an error making 9149// the request the iterator does not advance and the error is returned. 9150// Deprecated: Use NextWithContext() instead. 9151func (iter *VirtualMachineListResultIterator) Next() error { 9152 return iter.NextWithContext(context.Background()) 9153} 9154 9155// NotDone returns true if the enumeration should be started or is not yet complete. 9156func (iter VirtualMachineListResultIterator) NotDone() bool { 9157 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9158} 9159 9160// Response returns the raw server response from the last page request. 9161func (iter VirtualMachineListResultIterator) Response() VirtualMachineListResult { 9162 return iter.page.Response() 9163} 9164 9165// Value returns the current value or a zero-initialized value if the 9166// iterator has advanced beyond the end of the collection. 9167func (iter VirtualMachineListResultIterator) Value() VirtualMachine { 9168 if !iter.page.NotDone() { 9169 return VirtualMachine{} 9170 } 9171 return iter.page.Values()[iter.i] 9172} 9173 9174// Creates a new instance of the VirtualMachineListResultIterator type. 9175func NewVirtualMachineListResultIterator(page VirtualMachineListResultPage) VirtualMachineListResultIterator { 9176 return VirtualMachineListResultIterator{page: page} 9177} 9178 9179// IsEmpty returns true if the ListResult contains no values. 9180func (vmlr VirtualMachineListResult) IsEmpty() bool { 9181 return vmlr.Value == nil || len(*vmlr.Value) == 0 9182} 9183 9184// hasNextLink returns true if the NextLink is not empty. 9185func (vmlr VirtualMachineListResult) hasNextLink() bool { 9186 return vmlr.NextLink != nil && len(*vmlr.NextLink) != 0 9187} 9188 9189// virtualMachineListResultPreparer prepares a request to retrieve the next set of results. 9190// It returns nil if no more results exist. 9191func (vmlr VirtualMachineListResult) virtualMachineListResultPreparer(ctx context.Context) (*http.Request, error) { 9192 if !vmlr.hasNextLink() { 9193 return nil, nil 9194 } 9195 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9196 autorest.AsJSON(), 9197 autorest.AsGet(), 9198 autorest.WithBaseURL(to.String(vmlr.NextLink))) 9199} 9200 9201// VirtualMachineListResultPage contains a page of VirtualMachine values. 9202type VirtualMachineListResultPage struct { 9203 fn func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error) 9204 vmlr VirtualMachineListResult 9205} 9206 9207// NextWithContext advances to the next page of values. If there was an error making 9208// the request the page does not advance and the error is returned. 9209func (page *VirtualMachineListResultPage) NextWithContext(ctx context.Context) (err error) { 9210 if tracing.IsEnabled() { 9211 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineListResultPage.NextWithContext") 9212 defer func() { 9213 sc := -1 9214 if page.Response().Response.Response != nil { 9215 sc = page.Response().Response.Response.StatusCode 9216 } 9217 tracing.EndSpan(ctx, sc, err) 9218 }() 9219 } 9220 for { 9221 next, err := page.fn(ctx, page.vmlr) 9222 if err != nil { 9223 return err 9224 } 9225 page.vmlr = next 9226 if !next.hasNextLink() || !next.IsEmpty() { 9227 break 9228 } 9229 } 9230 return nil 9231} 9232 9233// Next advances to the next page of values. If there was an error making 9234// the request the page does not advance and the error is returned. 9235// Deprecated: Use NextWithContext() instead. 9236func (page *VirtualMachineListResultPage) Next() error { 9237 return page.NextWithContext(context.Background()) 9238} 9239 9240// NotDone returns true if the page enumeration should be started or is not yet complete. 9241func (page VirtualMachineListResultPage) NotDone() bool { 9242 return !page.vmlr.IsEmpty() 9243} 9244 9245// Response returns the raw server response from the last page request. 9246func (page VirtualMachineListResultPage) Response() VirtualMachineListResult { 9247 return page.vmlr 9248} 9249 9250// Values returns the slice of values for the current page or nil if there are no values. 9251func (page VirtualMachineListResultPage) Values() []VirtualMachine { 9252 if page.vmlr.IsEmpty() { 9253 return nil 9254 } 9255 return *page.vmlr.Value 9256} 9257 9258// Creates a new instance of the VirtualMachineListResultPage type. 9259func NewVirtualMachineListResultPage(cur VirtualMachineListResult, getNextPage func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error)) VirtualMachineListResultPage { 9260 return VirtualMachineListResultPage{ 9261 fn: getNextPage, 9262 vmlr: cur, 9263 } 9264} 9265 9266// VirtualMachineProperties describes the properties of a Virtual Machine. 9267type VirtualMachineProperties struct { 9268 // HardwareProfile - Specifies the hardware settings for the virtual machine. 9269 HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` 9270 // StorageProfile - Specifies the storage settings for the virtual machine disks. 9271 StorageProfile *StorageProfile `json:"storageProfile,omitempty"` 9272 // AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the virtual machine. 9273 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 9274 // OsProfile - Specifies the operating system settings used while creating the virtual machine. Some of the settings cannot be changed once VM is provisioned. 9275 OsProfile *OSProfile `json:"osProfile,omitempty"` 9276 // NetworkProfile - Specifies the network interfaces of the virtual machine. 9277 NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` 9278 // DiagnosticsProfile - Specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. 9279 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 9280 // 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. 9281 AvailabilitySet *SubResource `json:"availabilitySet,omitempty"` 9282 // 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 9283 VirtualMachineScaleSet *SubResource `json:"virtualMachineScaleSet,omitempty"` 9284 // ProximityPlacementGroup - Specifies information about the proximity placement group that the virtual machine should be assigned to. <br><br>Minimum api-version: 2018-04-01. 9285 ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` 9286 // Priority - Specifies the priority for the virtual machine. <br><br>Minimum api-version: 2019-03-01. Possible values include: 'Regular', 'Low', 'Spot' 9287 Priority VirtualMachinePriorityTypes `json:"priority,omitempty"` 9288 // EvictionPolicy - Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set. <br><br>For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01. <br><br>For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. Possible values include: 'Deallocate', 'Delete' 9289 EvictionPolicy VirtualMachineEvictionPolicyTypes `json:"evictionPolicy,omitempty"` 9290 // BillingProfile - Specifies the billing related details of a Azure Spot virtual machine. <br><br>Minimum api-version: 2019-03-01. 9291 BillingProfile *BillingProfile `json:"billingProfile,omitempty"` 9292 // Host - Specifies information about the dedicated host that the virtual machine resides in. <br><br>Minimum api-version: 2018-10-01. 9293 Host *SubResource `json:"host,omitempty"` 9294 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 9295 ProvisioningState *string `json:"provisioningState,omitempty"` 9296 // InstanceView - READ-ONLY; The virtual machine instance view. 9297 InstanceView *VirtualMachineInstanceView `json:"instanceView,omitempty"` 9298 // 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 9299 LicenseType *string `json:"licenseType,omitempty"` 9300 // 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. 9301 VMID *string `json:"vmId,omitempty"` 9302} 9303 9304// MarshalJSON is the custom marshaler for VirtualMachineProperties. 9305func (vmp VirtualMachineProperties) MarshalJSON() ([]byte, error) { 9306 objectMap := make(map[string]interface{}) 9307 if vmp.HardwareProfile != nil { 9308 objectMap["hardwareProfile"] = vmp.HardwareProfile 9309 } 9310 if vmp.StorageProfile != nil { 9311 objectMap["storageProfile"] = vmp.StorageProfile 9312 } 9313 if vmp.AdditionalCapabilities != nil { 9314 objectMap["additionalCapabilities"] = vmp.AdditionalCapabilities 9315 } 9316 if vmp.OsProfile != nil { 9317 objectMap["osProfile"] = vmp.OsProfile 9318 } 9319 if vmp.NetworkProfile != nil { 9320 objectMap["networkProfile"] = vmp.NetworkProfile 9321 } 9322 if vmp.DiagnosticsProfile != nil { 9323 objectMap["diagnosticsProfile"] = vmp.DiagnosticsProfile 9324 } 9325 if vmp.AvailabilitySet != nil { 9326 objectMap["availabilitySet"] = vmp.AvailabilitySet 9327 } 9328 if vmp.VirtualMachineScaleSet != nil { 9329 objectMap["virtualMachineScaleSet"] = vmp.VirtualMachineScaleSet 9330 } 9331 if vmp.ProximityPlacementGroup != nil { 9332 objectMap["proximityPlacementGroup"] = vmp.ProximityPlacementGroup 9333 } 9334 if vmp.Priority != "" { 9335 objectMap["priority"] = vmp.Priority 9336 } 9337 if vmp.EvictionPolicy != "" { 9338 objectMap["evictionPolicy"] = vmp.EvictionPolicy 9339 } 9340 if vmp.BillingProfile != nil { 9341 objectMap["billingProfile"] = vmp.BillingProfile 9342 } 9343 if vmp.Host != nil { 9344 objectMap["host"] = vmp.Host 9345 } 9346 if vmp.LicenseType != nil { 9347 objectMap["licenseType"] = vmp.LicenseType 9348 } 9349 return json.Marshal(objectMap) 9350} 9351 9352// VirtualMachineReimageParameters parameters for Reimaging Virtual Machine. NOTE: Virtual Machine OS disk 9353// will always be reimaged 9354type VirtualMachineReimageParameters struct { 9355 // 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. 9356 TempDisk *bool `json:"tempDisk,omitempty"` 9357} 9358 9359// VirtualMachineScaleSet describes a Virtual Machine Scale Set. 9360type VirtualMachineScaleSet struct { 9361 autorest.Response `json:"-"` 9362 // Sku - The virtual machine scale set sku. 9363 Sku *Sku `json:"sku,omitempty"` 9364 // 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**. 9365 Plan *Plan `json:"plan,omitempty"` 9366 *VirtualMachineScaleSetProperties `json:"properties,omitempty"` 9367 // Identity - The identity of the virtual machine scale set, if configured. 9368 Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"` 9369 // Zones - The virtual machine scale set zones. NOTE: Availability zones can only be set when you create the scale set 9370 Zones *[]string `json:"zones,omitempty"` 9371 // ID - READ-ONLY; Resource Id 9372 ID *string `json:"id,omitempty"` 9373 // Name - READ-ONLY; Resource name 9374 Name *string `json:"name,omitempty"` 9375 // Type - READ-ONLY; Resource type 9376 Type *string `json:"type,omitempty"` 9377 // Location - Resource location 9378 Location *string `json:"location,omitempty"` 9379 // Tags - Resource tags 9380 Tags map[string]*string `json:"tags"` 9381} 9382 9383// MarshalJSON is the custom marshaler for VirtualMachineScaleSet. 9384func (vmss VirtualMachineScaleSet) MarshalJSON() ([]byte, error) { 9385 objectMap := make(map[string]interface{}) 9386 if vmss.Sku != nil { 9387 objectMap["sku"] = vmss.Sku 9388 } 9389 if vmss.Plan != nil { 9390 objectMap["plan"] = vmss.Plan 9391 } 9392 if vmss.VirtualMachineScaleSetProperties != nil { 9393 objectMap["properties"] = vmss.VirtualMachineScaleSetProperties 9394 } 9395 if vmss.Identity != nil { 9396 objectMap["identity"] = vmss.Identity 9397 } 9398 if vmss.Zones != nil { 9399 objectMap["zones"] = vmss.Zones 9400 } 9401 if vmss.Location != nil { 9402 objectMap["location"] = vmss.Location 9403 } 9404 if vmss.Tags != nil { 9405 objectMap["tags"] = vmss.Tags 9406 } 9407 return json.Marshal(objectMap) 9408} 9409 9410// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSet struct. 9411func (vmss *VirtualMachineScaleSet) UnmarshalJSON(body []byte) error { 9412 var m map[string]*json.RawMessage 9413 err := json.Unmarshal(body, &m) 9414 if err != nil { 9415 return err 9416 } 9417 for k, v := range m { 9418 switch k { 9419 case "sku": 9420 if v != nil { 9421 var sku Sku 9422 err = json.Unmarshal(*v, &sku) 9423 if err != nil { 9424 return err 9425 } 9426 vmss.Sku = &sku 9427 } 9428 case "plan": 9429 if v != nil { 9430 var plan Plan 9431 err = json.Unmarshal(*v, &plan) 9432 if err != nil { 9433 return err 9434 } 9435 vmss.Plan = &plan 9436 } 9437 case "properties": 9438 if v != nil { 9439 var virtualMachineScaleSetProperties VirtualMachineScaleSetProperties 9440 err = json.Unmarshal(*v, &virtualMachineScaleSetProperties) 9441 if err != nil { 9442 return err 9443 } 9444 vmss.VirtualMachineScaleSetProperties = &virtualMachineScaleSetProperties 9445 } 9446 case "identity": 9447 if v != nil { 9448 var identity VirtualMachineScaleSetIdentity 9449 err = json.Unmarshal(*v, &identity) 9450 if err != nil { 9451 return err 9452 } 9453 vmss.Identity = &identity 9454 } 9455 case "zones": 9456 if v != nil { 9457 var zones []string 9458 err = json.Unmarshal(*v, &zones) 9459 if err != nil { 9460 return err 9461 } 9462 vmss.Zones = &zones 9463 } 9464 case "id": 9465 if v != nil { 9466 var ID string 9467 err = json.Unmarshal(*v, &ID) 9468 if err != nil { 9469 return err 9470 } 9471 vmss.ID = &ID 9472 } 9473 case "name": 9474 if v != nil { 9475 var name string 9476 err = json.Unmarshal(*v, &name) 9477 if err != nil { 9478 return err 9479 } 9480 vmss.Name = &name 9481 } 9482 case "type": 9483 if v != nil { 9484 var typeVar string 9485 err = json.Unmarshal(*v, &typeVar) 9486 if err != nil { 9487 return err 9488 } 9489 vmss.Type = &typeVar 9490 } 9491 case "location": 9492 if v != nil { 9493 var location string 9494 err = json.Unmarshal(*v, &location) 9495 if err != nil { 9496 return err 9497 } 9498 vmss.Location = &location 9499 } 9500 case "tags": 9501 if v != nil { 9502 var tags map[string]*string 9503 err = json.Unmarshal(*v, &tags) 9504 if err != nil { 9505 return err 9506 } 9507 vmss.Tags = tags 9508 } 9509 } 9510 } 9511 9512 return nil 9513} 9514 9515// VirtualMachineScaleSetDataDisk describes a virtual machine scale set data disk. 9516type VirtualMachineScaleSetDataDisk struct { 9517 // Name - The disk name. 9518 Name *string `json:"name,omitempty"` 9519 // 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. 9520 Lun *int32 `json:"lun,omitempty"` 9521 // 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' 9522 Caching CachingTypes `json:"caching,omitempty"` 9523 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 9524 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 9525 // CreateOption - The create option. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' 9526 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 9527 // 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 9528 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 9529 // ManagedDisk - The managed disk parameters. 9530 ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` 9531 // 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. 9532 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 9533 // 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. 9534 DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` 9535} 9536 9537// VirtualMachineScaleSetExtension describes a Virtual Machine Scale Set Extension. 9538type VirtualMachineScaleSetExtension struct { 9539 autorest.Response `json:"-"` 9540 // Name - The name of the extension. 9541 Name *string `json:"name,omitempty"` 9542 // Type - READ-ONLY; Resource type 9543 Type *string `json:"type,omitempty"` 9544 *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"` 9545 // ID - READ-ONLY; Resource Id 9546 ID *string `json:"id,omitempty"` 9547} 9548 9549// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtension. 9550func (vmsse VirtualMachineScaleSetExtension) MarshalJSON() ([]byte, error) { 9551 objectMap := make(map[string]interface{}) 9552 if vmsse.Name != nil { 9553 objectMap["name"] = vmsse.Name 9554 } 9555 if vmsse.VirtualMachineScaleSetExtensionProperties != nil { 9556 objectMap["properties"] = vmsse.VirtualMachineScaleSetExtensionProperties 9557 } 9558 return json.Marshal(objectMap) 9559} 9560 9561// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetExtension struct. 9562func (vmsse *VirtualMachineScaleSetExtension) UnmarshalJSON(body []byte) error { 9563 var m map[string]*json.RawMessage 9564 err := json.Unmarshal(body, &m) 9565 if err != nil { 9566 return err 9567 } 9568 for k, v := range m { 9569 switch k { 9570 case "name": 9571 if v != nil { 9572 var name string 9573 err = json.Unmarshal(*v, &name) 9574 if err != nil { 9575 return err 9576 } 9577 vmsse.Name = &name 9578 } 9579 case "type": 9580 if v != nil { 9581 var typeVar string 9582 err = json.Unmarshal(*v, &typeVar) 9583 if err != nil { 9584 return err 9585 } 9586 vmsse.Type = &typeVar 9587 } 9588 case "properties": 9589 if v != nil { 9590 var virtualMachineScaleSetExtensionProperties VirtualMachineScaleSetExtensionProperties 9591 err = json.Unmarshal(*v, &virtualMachineScaleSetExtensionProperties) 9592 if err != nil { 9593 return err 9594 } 9595 vmsse.VirtualMachineScaleSetExtensionProperties = &virtualMachineScaleSetExtensionProperties 9596 } 9597 case "id": 9598 if v != nil { 9599 var ID string 9600 err = json.Unmarshal(*v, &ID) 9601 if err != nil { 9602 return err 9603 } 9604 vmsse.ID = &ID 9605 } 9606 } 9607 } 9608 9609 return nil 9610} 9611 9612// VirtualMachineScaleSetExtensionListResult the List VM scale set extension operation response. 9613type VirtualMachineScaleSetExtensionListResult struct { 9614 autorest.Response `json:"-"` 9615 // Value - The list of VM scale set extensions. 9616 Value *[]VirtualMachineScaleSetExtension `json:"value,omitempty"` 9617 // 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. 9618 NextLink *string `json:"nextLink,omitempty"` 9619} 9620 9621// VirtualMachineScaleSetExtensionListResultIterator provides access to a complete listing of 9622// VirtualMachineScaleSetExtension values. 9623type VirtualMachineScaleSetExtensionListResultIterator struct { 9624 i int 9625 page VirtualMachineScaleSetExtensionListResultPage 9626} 9627 9628// NextWithContext advances to the next value. If there was an error making 9629// the request the iterator does not advance and the error is returned. 9630func (iter *VirtualMachineScaleSetExtensionListResultIterator) NextWithContext(ctx context.Context) (err error) { 9631 if tracing.IsEnabled() { 9632 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionListResultIterator.NextWithContext") 9633 defer func() { 9634 sc := -1 9635 if iter.Response().Response.Response != nil { 9636 sc = iter.Response().Response.Response.StatusCode 9637 } 9638 tracing.EndSpan(ctx, sc, err) 9639 }() 9640 } 9641 iter.i++ 9642 if iter.i < len(iter.page.Values()) { 9643 return nil 9644 } 9645 err = iter.page.NextWithContext(ctx) 9646 if err != nil { 9647 iter.i-- 9648 return err 9649 } 9650 iter.i = 0 9651 return nil 9652} 9653 9654// Next advances to the next value. If there was an error making 9655// the request the iterator does not advance and the error is returned. 9656// Deprecated: Use NextWithContext() instead. 9657func (iter *VirtualMachineScaleSetExtensionListResultIterator) Next() error { 9658 return iter.NextWithContext(context.Background()) 9659} 9660 9661// NotDone returns true if the enumeration should be started or is not yet complete. 9662func (iter VirtualMachineScaleSetExtensionListResultIterator) NotDone() bool { 9663 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9664} 9665 9666// Response returns the raw server response from the last page request. 9667func (iter VirtualMachineScaleSetExtensionListResultIterator) Response() VirtualMachineScaleSetExtensionListResult { 9668 return iter.page.Response() 9669} 9670 9671// Value returns the current value or a zero-initialized value if the 9672// iterator has advanced beyond the end of the collection. 9673func (iter VirtualMachineScaleSetExtensionListResultIterator) Value() VirtualMachineScaleSetExtension { 9674 if !iter.page.NotDone() { 9675 return VirtualMachineScaleSetExtension{} 9676 } 9677 return iter.page.Values()[iter.i] 9678} 9679 9680// Creates a new instance of the VirtualMachineScaleSetExtensionListResultIterator type. 9681func NewVirtualMachineScaleSetExtensionListResultIterator(page VirtualMachineScaleSetExtensionListResultPage) VirtualMachineScaleSetExtensionListResultIterator { 9682 return VirtualMachineScaleSetExtensionListResultIterator{page: page} 9683} 9684 9685// IsEmpty returns true if the ListResult contains no values. 9686func (vmsselr VirtualMachineScaleSetExtensionListResult) IsEmpty() bool { 9687 return vmsselr.Value == nil || len(*vmsselr.Value) == 0 9688} 9689 9690// hasNextLink returns true if the NextLink is not empty. 9691func (vmsselr VirtualMachineScaleSetExtensionListResult) hasNextLink() bool { 9692 return vmsselr.NextLink != nil && len(*vmsselr.NextLink) != 0 9693} 9694 9695// virtualMachineScaleSetExtensionListResultPreparer prepares a request to retrieve the next set of results. 9696// It returns nil if no more results exist. 9697func (vmsselr VirtualMachineScaleSetExtensionListResult) virtualMachineScaleSetExtensionListResultPreparer(ctx context.Context) (*http.Request, error) { 9698 if !vmsselr.hasNextLink() { 9699 return nil, nil 9700 } 9701 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9702 autorest.AsJSON(), 9703 autorest.AsGet(), 9704 autorest.WithBaseURL(to.String(vmsselr.NextLink))) 9705} 9706 9707// VirtualMachineScaleSetExtensionListResultPage contains a page of VirtualMachineScaleSetExtension values. 9708type VirtualMachineScaleSetExtensionListResultPage struct { 9709 fn func(context.Context, VirtualMachineScaleSetExtensionListResult) (VirtualMachineScaleSetExtensionListResult, error) 9710 vmsselr VirtualMachineScaleSetExtensionListResult 9711} 9712 9713// NextWithContext advances to the next page of values. If there was an error making 9714// the request the page does not advance and the error is returned. 9715func (page *VirtualMachineScaleSetExtensionListResultPage) NextWithContext(ctx context.Context) (err error) { 9716 if tracing.IsEnabled() { 9717 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionListResultPage.NextWithContext") 9718 defer func() { 9719 sc := -1 9720 if page.Response().Response.Response != nil { 9721 sc = page.Response().Response.Response.StatusCode 9722 } 9723 tracing.EndSpan(ctx, sc, err) 9724 }() 9725 } 9726 for { 9727 next, err := page.fn(ctx, page.vmsselr) 9728 if err != nil { 9729 return err 9730 } 9731 page.vmsselr = next 9732 if !next.hasNextLink() || !next.IsEmpty() { 9733 break 9734 } 9735 } 9736 return nil 9737} 9738 9739// Next advances to the next page of values. If there was an error making 9740// the request the page does not advance and the error is returned. 9741// Deprecated: Use NextWithContext() instead. 9742func (page *VirtualMachineScaleSetExtensionListResultPage) Next() error { 9743 return page.NextWithContext(context.Background()) 9744} 9745 9746// NotDone returns true if the page enumeration should be started or is not yet complete. 9747func (page VirtualMachineScaleSetExtensionListResultPage) NotDone() bool { 9748 return !page.vmsselr.IsEmpty() 9749} 9750 9751// Response returns the raw server response from the last page request. 9752func (page VirtualMachineScaleSetExtensionListResultPage) Response() VirtualMachineScaleSetExtensionListResult { 9753 return page.vmsselr 9754} 9755 9756// Values returns the slice of values for the current page or nil if there are no values. 9757func (page VirtualMachineScaleSetExtensionListResultPage) Values() []VirtualMachineScaleSetExtension { 9758 if page.vmsselr.IsEmpty() { 9759 return nil 9760 } 9761 return *page.vmsselr.Value 9762} 9763 9764// Creates a new instance of the VirtualMachineScaleSetExtensionListResultPage type. 9765func NewVirtualMachineScaleSetExtensionListResultPage(cur VirtualMachineScaleSetExtensionListResult, getNextPage func(context.Context, VirtualMachineScaleSetExtensionListResult) (VirtualMachineScaleSetExtensionListResult, error)) VirtualMachineScaleSetExtensionListResultPage { 9766 return VirtualMachineScaleSetExtensionListResultPage{ 9767 fn: getNextPage, 9768 vmsselr: cur, 9769 } 9770} 9771 9772// VirtualMachineScaleSetExtensionProfile describes a virtual machine scale set extension profile. 9773type VirtualMachineScaleSetExtensionProfile struct { 9774 // Extensions - The virtual machine scale set child extension resources. 9775 Extensions *[]VirtualMachineScaleSetExtension `json:"extensions,omitempty"` 9776} 9777 9778// VirtualMachineScaleSetExtensionProperties describes the properties of a Virtual Machine Scale Set 9779// Extension. 9780type VirtualMachineScaleSetExtensionProperties struct { 9781 // 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. 9782 ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` 9783 // Publisher - The name of the extension handler publisher. 9784 Publisher *string `json:"publisher,omitempty"` 9785 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 9786 Type *string `json:"type,omitempty"` 9787 // TypeHandlerVersion - Specifies the version of the script handler. 9788 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 9789 // 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. 9790 AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` 9791 // Settings - Json formatted public settings for the extension. 9792 Settings interface{} `json:"settings,omitempty"` 9793 // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. 9794 ProtectedSettings interface{} `json:"protectedSettings,omitempty"` 9795 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 9796 ProvisioningState *string `json:"provisioningState,omitempty"` 9797 // ProvisionAfterExtensions - Collection of extension names after which this extension needs to be provisioned. 9798 ProvisionAfterExtensions *[]string `json:"provisionAfterExtensions,omitempty"` 9799} 9800 9801// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtensionProperties. 9802func (vmssep VirtualMachineScaleSetExtensionProperties) MarshalJSON() ([]byte, error) { 9803 objectMap := make(map[string]interface{}) 9804 if vmssep.ForceUpdateTag != nil { 9805 objectMap["forceUpdateTag"] = vmssep.ForceUpdateTag 9806 } 9807 if vmssep.Publisher != nil { 9808 objectMap["publisher"] = vmssep.Publisher 9809 } 9810 if vmssep.Type != nil { 9811 objectMap["type"] = vmssep.Type 9812 } 9813 if vmssep.TypeHandlerVersion != nil { 9814 objectMap["typeHandlerVersion"] = vmssep.TypeHandlerVersion 9815 } 9816 if vmssep.AutoUpgradeMinorVersion != nil { 9817 objectMap["autoUpgradeMinorVersion"] = vmssep.AutoUpgradeMinorVersion 9818 } 9819 if vmssep.Settings != nil { 9820 objectMap["settings"] = vmssep.Settings 9821 } 9822 if vmssep.ProtectedSettings != nil { 9823 objectMap["protectedSettings"] = vmssep.ProtectedSettings 9824 } 9825 if vmssep.ProvisionAfterExtensions != nil { 9826 objectMap["provisionAfterExtensions"] = vmssep.ProvisionAfterExtensions 9827 } 9828 return json.Marshal(objectMap) 9829} 9830 9831// VirtualMachineScaleSetExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the 9832// results of a long-running operation. 9833type VirtualMachineScaleSetExtensionsCreateOrUpdateFuture struct { 9834 azure.FutureAPI 9835 // Result returns the result of the asynchronous operation. 9836 // If the operation has not completed it will return an error. 9837 Result func(VirtualMachineScaleSetExtensionsClient) (VirtualMachineScaleSetExtension, error) 9838} 9839 9840// VirtualMachineScaleSetExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of 9841// a long-running operation. 9842type VirtualMachineScaleSetExtensionsDeleteFuture struct { 9843 azure.FutureAPI 9844 // Result returns the result of the asynchronous operation. 9845 // If the operation has not completed it will return an error. 9846 Result func(VirtualMachineScaleSetExtensionsClient) (autorest.Response, error) 9847} 9848 9849// VirtualMachineScaleSetExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of 9850// a long-running operation. 9851type VirtualMachineScaleSetExtensionsUpdateFuture struct { 9852 azure.FutureAPI 9853 // Result returns the result of the asynchronous operation. 9854 // If the operation has not completed it will return an error. 9855 Result func(VirtualMachineScaleSetExtensionsClient) (VirtualMachineScaleSetExtension, error) 9856} 9857 9858// VirtualMachineScaleSetExtensionUpdate describes a Virtual Machine Scale Set Extension. 9859type VirtualMachineScaleSetExtensionUpdate struct { 9860 // Name - READ-ONLY; The name of the extension. 9861 Name *string `json:"name,omitempty"` 9862 // Type - READ-ONLY; Resource type 9863 Type *string `json:"type,omitempty"` 9864 *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"` 9865 // ID - READ-ONLY; Resource Id 9866 ID *string `json:"id,omitempty"` 9867} 9868 9869// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtensionUpdate. 9870func (vmsseu VirtualMachineScaleSetExtensionUpdate) MarshalJSON() ([]byte, error) { 9871 objectMap := make(map[string]interface{}) 9872 if vmsseu.VirtualMachineScaleSetExtensionProperties != nil { 9873 objectMap["properties"] = vmsseu.VirtualMachineScaleSetExtensionProperties 9874 } 9875 return json.Marshal(objectMap) 9876} 9877 9878// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetExtensionUpdate struct. 9879func (vmsseu *VirtualMachineScaleSetExtensionUpdate) UnmarshalJSON(body []byte) error { 9880 var m map[string]*json.RawMessage 9881 err := json.Unmarshal(body, &m) 9882 if err != nil { 9883 return err 9884 } 9885 for k, v := range m { 9886 switch k { 9887 case "name": 9888 if v != nil { 9889 var name string 9890 err = json.Unmarshal(*v, &name) 9891 if err != nil { 9892 return err 9893 } 9894 vmsseu.Name = &name 9895 } 9896 case "type": 9897 if v != nil { 9898 var typeVar string 9899 err = json.Unmarshal(*v, &typeVar) 9900 if err != nil { 9901 return err 9902 } 9903 vmsseu.Type = &typeVar 9904 } 9905 case "properties": 9906 if v != nil { 9907 var virtualMachineScaleSetExtensionProperties VirtualMachineScaleSetExtensionProperties 9908 err = json.Unmarshal(*v, &virtualMachineScaleSetExtensionProperties) 9909 if err != nil { 9910 return err 9911 } 9912 vmsseu.VirtualMachineScaleSetExtensionProperties = &virtualMachineScaleSetExtensionProperties 9913 } 9914 case "id": 9915 if v != nil { 9916 var ID string 9917 err = json.Unmarshal(*v, &ID) 9918 if err != nil { 9919 return err 9920 } 9921 vmsseu.ID = &ID 9922 } 9923 } 9924 } 9925 9926 return nil 9927} 9928 9929// VirtualMachineScaleSetIdentity identity for the virtual machine scale set. 9930type VirtualMachineScaleSetIdentity struct { 9931 // PrincipalID - READ-ONLY; The principal id of virtual machine scale set identity. This property will only be provided for a system assigned identity. 9932 PrincipalID *string `json:"principalId,omitempty"` 9933 // TenantID - READ-ONLY; The tenant id associated with the virtual machine scale set. This property will only be provided for a system assigned identity. 9934 TenantID *string `json:"tenantId,omitempty"` 9935 // 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' 9936 Type ResourceIdentityType `json:"type,omitempty"` 9937 // 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}'. 9938 UserAssignedIdentities map[string]*VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` 9939} 9940 9941// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIdentity. 9942func (vmssi VirtualMachineScaleSetIdentity) MarshalJSON() ([]byte, error) { 9943 objectMap := make(map[string]interface{}) 9944 if vmssi.Type != "" { 9945 objectMap["type"] = vmssi.Type 9946 } 9947 if vmssi.UserAssignedIdentities != nil { 9948 objectMap["userAssignedIdentities"] = vmssi.UserAssignedIdentities 9949 } 9950 return json.Marshal(objectMap) 9951} 9952 9953// VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue ... 9954type VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue struct { 9955 // PrincipalID - READ-ONLY; The principal id of user assigned identity. 9956 PrincipalID *string `json:"principalId,omitempty"` 9957 // ClientID - READ-ONLY; The client id of user assigned identity. 9958 ClientID *string `json:"clientId,omitempty"` 9959} 9960 9961// VirtualMachineScaleSetInstanceView the instance view of a virtual machine scale set. 9962type VirtualMachineScaleSetInstanceView struct { 9963 autorest.Response `json:"-"` 9964 // VirtualMachine - READ-ONLY; The instance view status summary for the virtual machine scale set. 9965 VirtualMachine *VirtualMachineScaleSetInstanceViewStatusesSummary `json:"virtualMachine,omitempty"` 9966 // Extensions - READ-ONLY; The extensions information. 9967 Extensions *[]VirtualMachineScaleSetVMExtensionsSummary `json:"extensions,omitempty"` 9968 // Statuses - The resource status information. 9969 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 9970 // OrchestrationServices - READ-ONLY; The orchestration services information. 9971 OrchestrationServices *[]OrchestrationServiceSummary `json:"orchestrationServices,omitempty"` 9972} 9973 9974// MarshalJSON is the custom marshaler for VirtualMachineScaleSetInstanceView. 9975func (vmssiv VirtualMachineScaleSetInstanceView) MarshalJSON() ([]byte, error) { 9976 objectMap := make(map[string]interface{}) 9977 if vmssiv.Statuses != nil { 9978 objectMap["statuses"] = vmssiv.Statuses 9979 } 9980 return json.Marshal(objectMap) 9981} 9982 9983// VirtualMachineScaleSetInstanceViewStatusesSummary instance view statuses summary for virtual machines of 9984// a virtual machine scale set. 9985type VirtualMachineScaleSetInstanceViewStatusesSummary struct { 9986 // StatusesSummary - READ-ONLY; The extensions information. 9987 StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` 9988} 9989 9990// VirtualMachineScaleSetIPConfiguration describes a virtual machine scale set network profile's IP 9991// configuration. 9992type VirtualMachineScaleSetIPConfiguration struct { 9993 // Name - The IP configuration name. 9994 Name *string `json:"name,omitempty"` 9995 *VirtualMachineScaleSetIPConfigurationProperties `json:"properties,omitempty"` 9996 // ID - Resource Id 9997 ID *string `json:"id,omitempty"` 9998} 9999 10000// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIPConfiguration. 10001func (vmssic VirtualMachineScaleSetIPConfiguration) MarshalJSON() ([]byte, error) { 10002 objectMap := make(map[string]interface{}) 10003 if vmssic.Name != nil { 10004 objectMap["name"] = vmssic.Name 10005 } 10006 if vmssic.VirtualMachineScaleSetIPConfigurationProperties != nil { 10007 objectMap["properties"] = vmssic.VirtualMachineScaleSetIPConfigurationProperties 10008 } 10009 if vmssic.ID != nil { 10010 objectMap["id"] = vmssic.ID 10011 } 10012 return json.Marshal(objectMap) 10013} 10014 10015// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetIPConfiguration struct. 10016func (vmssic *VirtualMachineScaleSetIPConfiguration) UnmarshalJSON(body []byte) error { 10017 var m map[string]*json.RawMessage 10018 err := json.Unmarshal(body, &m) 10019 if err != nil { 10020 return err 10021 } 10022 for k, v := range m { 10023 switch k { 10024 case "name": 10025 if v != nil { 10026 var name string 10027 err = json.Unmarshal(*v, &name) 10028 if err != nil { 10029 return err 10030 } 10031 vmssic.Name = &name 10032 } 10033 case "properties": 10034 if v != nil { 10035 var virtualMachineScaleSetIPConfigurationProperties VirtualMachineScaleSetIPConfigurationProperties 10036 err = json.Unmarshal(*v, &virtualMachineScaleSetIPConfigurationProperties) 10037 if err != nil { 10038 return err 10039 } 10040 vmssic.VirtualMachineScaleSetIPConfigurationProperties = &virtualMachineScaleSetIPConfigurationProperties 10041 } 10042 case "id": 10043 if v != nil { 10044 var ID string 10045 err = json.Unmarshal(*v, &ID) 10046 if err != nil { 10047 return err 10048 } 10049 vmssic.ID = &ID 10050 } 10051 } 10052 } 10053 10054 return nil 10055} 10056 10057// VirtualMachineScaleSetIPConfigurationProperties describes a virtual machine scale set network profile's 10058// IP configuration properties. 10059type VirtualMachineScaleSetIPConfigurationProperties struct { 10060 // Subnet - Specifies the identifier of the subnet. 10061 Subnet *APIEntityReference `json:"subnet,omitempty"` 10062 // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. 10063 Primary *bool `json:"primary,omitempty"` 10064 // PublicIPAddressConfiguration - The publicIPAddressConfiguration. 10065 PublicIPAddressConfiguration *VirtualMachineScaleSetPublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` 10066 // 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' 10067 PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` 10068 // 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. 10069 ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` 10070 // ApplicationSecurityGroups - Specifies an array of references to application security group. 10071 ApplicationSecurityGroups *[]SubResource `json:"applicationSecurityGroups,omitempty"` 10072 // LoadBalancerBackendAddressPools - Specifies an array of references to backend address pools of load balancers. A scale set can reference backend address pools of one public and one internal load balancer. Multiple scale sets cannot use the same basic sku load balancer. 10073 LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` 10074 // LoadBalancerInboundNatPools - Specifies an array of references to inbound Nat pools of the load balancers. A scale set can reference inbound nat pools of one public and one internal load balancer. Multiple scale sets cannot use the same basic sku load balancer. 10075 LoadBalancerInboundNatPools *[]SubResource `json:"loadBalancerInboundNatPools,omitempty"` 10076} 10077 10078// VirtualMachineScaleSetIPTag contains the IP tag associated with the public IP address. 10079type VirtualMachineScaleSetIPTag struct { 10080 // IPTagType - IP tag type. Example: FirstPartyUsage. 10081 IPTagType *string `json:"ipTagType,omitempty"` 10082 // Tag - IP tag associated with the public IP. Example: SQL, Storage etc. 10083 Tag *string `json:"tag,omitempty"` 10084} 10085 10086// VirtualMachineScaleSetListOSUpgradeHistory list of Virtual Machine Scale Set OS Upgrade History 10087// operation response. 10088type VirtualMachineScaleSetListOSUpgradeHistory struct { 10089 autorest.Response `json:"-"` 10090 // Value - The list of OS upgrades performed on the virtual machine scale set. 10091 Value *[]UpgradeOperationHistoricalStatusInfo `json:"value,omitempty"` 10092 // 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. 10093 NextLink *string `json:"nextLink,omitempty"` 10094} 10095 10096// VirtualMachineScaleSetListOSUpgradeHistoryIterator provides access to a complete listing of 10097// UpgradeOperationHistoricalStatusInfo values. 10098type VirtualMachineScaleSetListOSUpgradeHistoryIterator struct { 10099 i int 10100 page VirtualMachineScaleSetListOSUpgradeHistoryPage 10101} 10102 10103// NextWithContext advances to the next value. If there was an error making 10104// the request the iterator does not advance and the error is returned. 10105func (iter *VirtualMachineScaleSetListOSUpgradeHistoryIterator) NextWithContext(ctx context.Context) (err error) { 10106 if tracing.IsEnabled() { 10107 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListOSUpgradeHistoryIterator.NextWithContext") 10108 defer func() { 10109 sc := -1 10110 if iter.Response().Response.Response != nil { 10111 sc = iter.Response().Response.Response.StatusCode 10112 } 10113 tracing.EndSpan(ctx, sc, err) 10114 }() 10115 } 10116 iter.i++ 10117 if iter.i < len(iter.page.Values()) { 10118 return nil 10119 } 10120 err = iter.page.NextWithContext(ctx) 10121 if err != nil { 10122 iter.i-- 10123 return err 10124 } 10125 iter.i = 0 10126 return nil 10127} 10128 10129// Next advances to the next value. If there was an error making 10130// the request the iterator does not advance and the error is returned. 10131// Deprecated: Use NextWithContext() instead. 10132func (iter *VirtualMachineScaleSetListOSUpgradeHistoryIterator) Next() error { 10133 return iter.NextWithContext(context.Background()) 10134} 10135 10136// NotDone returns true if the enumeration should be started or is not yet complete. 10137func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) NotDone() bool { 10138 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10139} 10140 10141// Response returns the raw server response from the last page request. 10142func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) Response() VirtualMachineScaleSetListOSUpgradeHistory { 10143 return iter.page.Response() 10144} 10145 10146// Value returns the current value or a zero-initialized value if the 10147// iterator has advanced beyond the end of the collection. 10148func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) Value() UpgradeOperationHistoricalStatusInfo { 10149 if !iter.page.NotDone() { 10150 return UpgradeOperationHistoricalStatusInfo{} 10151 } 10152 return iter.page.Values()[iter.i] 10153} 10154 10155// Creates a new instance of the VirtualMachineScaleSetListOSUpgradeHistoryIterator type. 10156func NewVirtualMachineScaleSetListOSUpgradeHistoryIterator(page VirtualMachineScaleSetListOSUpgradeHistoryPage) VirtualMachineScaleSetListOSUpgradeHistoryIterator { 10157 return VirtualMachineScaleSetListOSUpgradeHistoryIterator{page: page} 10158} 10159 10160// IsEmpty returns true if the ListResult contains no values. 10161func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) IsEmpty() bool { 10162 return vmsslouh.Value == nil || len(*vmsslouh.Value) == 0 10163} 10164 10165// hasNextLink returns true if the NextLink is not empty. 10166func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) hasNextLink() bool { 10167 return vmsslouh.NextLink != nil && len(*vmsslouh.NextLink) != 0 10168} 10169 10170// virtualMachineScaleSetListOSUpgradeHistoryPreparer prepares a request to retrieve the next set of results. 10171// It returns nil if no more results exist. 10172func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) virtualMachineScaleSetListOSUpgradeHistoryPreparer(ctx context.Context) (*http.Request, error) { 10173 if !vmsslouh.hasNextLink() { 10174 return nil, nil 10175 } 10176 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10177 autorest.AsJSON(), 10178 autorest.AsGet(), 10179 autorest.WithBaseURL(to.String(vmsslouh.NextLink))) 10180} 10181 10182// VirtualMachineScaleSetListOSUpgradeHistoryPage contains a page of UpgradeOperationHistoricalStatusInfo 10183// values. 10184type VirtualMachineScaleSetListOSUpgradeHistoryPage struct { 10185 fn func(context.Context, VirtualMachineScaleSetListOSUpgradeHistory) (VirtualMachineScaleSetListOSUpgradeHistory, error) 10186 vmsslouh VirtualMachineScaleSetListOSUpgradeHistory 10187} 10188 10189// NextWithContext advances to the next page of values. If there was an error making 10190// the request the page does not advance and the error is returned. 10191func (page *VirtualMachineScaleSetListOSUpgradeHistoryPage) NextWithContext(ctx context.Context) (err error) { 10192 if tracing.IsEnabled() { 10193 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListOSUpgradeHistoryPage.NextWithContext") 10194 defer func() { 10195 sc := -1 10196 if page.Response().Response.Response != nil { 10197 sc = page.Response().Response.Response.StatusCode 10198 } 10199 tracing.EndSpan(ctx, sc, err) 10200 }() 10201 } 10202 for { 10203 next, err := page.fn(ctx, page.vmsslouh) 10204 if err != nil { 10205 return err 10206 } 10207 page.vmsslouh = next 10208 if !next.hasNextLink() || !next.IsEmpty() { 10209 break 10210 } 10211 } 10212 return nil 10213} 10214 10215// Next advances to the next page of values. If there was an error making 10216// the request the page does not advance and the error is returned. 10217// Deprecated: Use NextWithContext() instead. 10218func (page *VirtualMachineScaleSetListOSUpgradeHistoryPage) Next() error { 10219 return page.NextWithContext(context.Background()) 10220} 10221 10222// NotDone returns true if the page enumeration should be started or is not yet complete. 10223func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) NotDone() bool { 10224 return !page.vmsslouh.IsEmpty() 10225} 10226 10227// Response returns the raw server response from the last page request. 10228func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) Response() VirtualMachineScaleSetListOSUpgradeHistory { 10229 return page.vmsslouh 10230} 10231 10232// Values returns the slice of values for the current page or nil if there are no values. 10233func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) Values() []UpgradeOperationHistoricalStatusInfo { 10234 if page.vmsslouh.IsEmpty() { 10235 return nil 10236 } 10237 return *page.vmsslouh.Value 10238} 10239 10240// Creates a new instance of the VirtualMachineScaleSetListOSUpgradeHistoryPage type. 10241func NewVirtualMachineScaleSetListOSUpgradeHistoryPage(cur VirtualMachineScaleSetListOSUpgradeHistory, getNextPage func(context.Context, VirtualMachineScaleSetListOSUpgradeHistory) (VirtualMachineScaleSetListOSUpgradeHistory, error)) VirtualMachineScaleSetListOSUpgradeHistoryPage { 10242 return VirtualMachineScaleSetListOSUpgradeHistoryPage{ 10243 fn: getNextPage, 10244 vmsslouh: cur, 10245 } 10246} 10247 10248// VirtualMachineScaleSetListResult the List Virtual Machine operation response. 10249type VirtualMachineScaleSetListResult struct { 10250 autorest.Response `json:"-"` 10251 // Value - The list of virtual machine scale sets. 10252 Value *[]VirtualMachineScaleSet `json:"value,omitempty"` 10253 // NextLink - The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with this to fetch the next page of VMSS. 10254 NextLink *string `json:"nextLink,omitempty"` 10255} 10256 10257// VirtualMachineScaleSetListResultIterator provides access to a complete listing of VirtualMachineScaleSet 10258// values. 10259type VirtualMachineScaleSetListResultIterator struct { 10260 i int 10261 page VirtualMachineScaleSetListResultPage 10262} 10263 10264// NextWithContext advances to the next value. If there was an error making 10265// the request the iterator does not advance and the error is returned. 10266func (iter *VirtualMachineScaleSetListResultIterator) NextWithContext(ctx context.Context) (err error) { 10267 if tracing.IsEnabled() { 10268 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListResultIterator.NextWithContext") 10269 defer func() { 10270 sc := -1 10271 if iter.Response().Response.Response != nil { 10272 sc = iter.Response().Response.Response.StatusCode 10273 } 10274 tracing.EndSpan(ctx, sc, err) 10275 }() 10276 } 10277 iter.i++ 10278 if iter.i < len(iter.page.Values()) { 10279 return nil 10280 } 10281 err = iter.page.NextWithContext(ctx) 10282 if err != nil { 10283 iter.i-- 10284 return err 10285 } 10286 iter.i = 0 10287 return nil 10288} 10289 10290// Next advances to the next value. If there was an error making 10291// the request the iterator does not advance and the error is returned. 10292// Deprecated: Use NextWithContext() instead. 10293func (iter *VirtualMachineScaleSetListResultIterator) Next() error { 10294 return iter.NextWithContext(context.Background()) 10295} 10296 10297// NotDone returns true if the enumeration should be started or is not yet complete. 10298func (iter VirtualMachineScaleSetListResultIterator) NotDone() bool { 10299 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10300} 10301 10302// Response returns the raw server response from the last page request. 10303func (iter VirtualMachineScaleSetListResultIterator) Response() VirtualMachineScaleSetListResult { 10304 return iter.page.Response() 10305} 10306 10307// Value returns the current value or a zero-initialized value if the 10308// iterator has advanced beyond the end of the collection. 10309func (iter VirtualMachineScaleSetListResultIterator) Value() VirtualMachineScaleSet { 10310 if !iter.page.NotDone() { 10311 return VirtualMachineScaleSet{} 10312 } 10313 return iter.page.Values()[iter.i] 10314} 10315 10316// Creates a new instance of the VirtualMachineScaleSetListResultIterator type. 10317func NewVirtualMachineScaleSetListResultIterator(page VirtualMachineScaleSetListResultPage) VirtualMachineScaleSetListResultIterator { 10318 return VirtualMachineScaleSetListResultIterator{page: page} 10319} 10320 10321// IsEmpty returns true if the ListResult contains no values. 10322func (vmsslr VirtualMachineScaleSetListResult) IsEmpty() bool { 10323 return vmsslr.Value == nil || len(*vmsslr.Value) == 0 10324} 10325 10326// hasNextLink returns true if the NextLink is not empty. 10327func (vmsslr VirtualMachineScaleSetListResult) hasNextLink() bool { 10328 return vmsslr.NextLink != nil && len(*vmsslr.NextLink) != 0 10329} 10330 10331// virtualMachineScaleSetListResultPreparer prepares a request to retrieve the next set of results. 10332// It returns nil if no more results exist. 10333func (vmsslr VirtualMachineScaleSetListResult) virtualMachineScaleSetListResultPreparer(ctx context.Context) (*http.Request, error) { 10334 if !vmsslr.hasNextLink() { 10335 return nil, nil 10336 } 10337 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10338 autorest.AsJSON(), 10339 autorest.AsGet(), 10340 autorest.WithBaseURL(to.String(vmsslr.NextLink))) 10341} 10342 10343// VirtualMachineScaleSetListResultPage contains a page of VirtualMachineScaleSet values. 10344type VirtualMachineScaleSetListResultPage struct { 10345 fn func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error) 10346 vmsslr VirtualMachineScaleSetListResult 10347} 10348 10349// NextWithContext advances to the next page of values. If there was an error making 10350// the request the page does not advance and the error is returned. 10351func (page *VirtualMachineScaleSetListResultPage) NextWithContext(ctx context.Context) (err error) { 10352 if tracing.IsEnabled() { 10353 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListResultPage.NextWithContext") 10354 defer func() { 10355 sc := -1 10356 if page.Response().Response.Response != nil { 10357 sc = page.Response().Response.Response.StatusCode 10358 } 10359 tracing.EndSpan(ctx, sc, err) 10360 }() 10361 } 10362 for { 10363 next, err := page.fn(ctx, page.vmsslr) 10364 if err != nil { 10365 return err 10366 } 10367 page.vmsslr = next 10368 if !next.hasNextLink() || !next.IsEmpty() { 10369 break 10370 } 10371 } 10372 return nil 10373} 10374 10375// Next advances to the next page of values. If there was an error making 10376// the request the page does not advance and the error is returned. 10377// Deprecated: Use NextWithContext() instead. 10378func (page *VirtualMachineScaleSetListResultPage) Next() error { 10379 return page.NextWithContext(context.Background()) 10380} 10381 10382// NotDone returns true if the page enumeration should be started or is not yet complete. 10383func (page VirtualMachineScaleSetListResultPage) NotDone() bool { 10384 return !page.vmsslr.IsEmpty() 10385} 10386 10387// Response returns the raw server response from the last page request. 10388func (page VirtualMachineScaleSetListResultPage) Response() VirtualMachineScaleSetListResult { 10389 return page.vmsslr 10390} 10391 10392// Values returns the slice of values for the current page or nil if there are no values. 10393func (page VirtualMachineScaleSetListResultPage) Values() []VirtualMachineScaleSet { 10394 if page.vmsslr.IsEmpty() { 10395 return nil 10396 } 10397 return *page.vmsslr.Value 10398} 10399 10400// Creates a new instance of the VirtualMachineScaleSetListResultPage type. 10401func NewVirtualMachineScaleSetListResultPage(cur VirtualMachineScaleSetListResult, getNextPage func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error)) VirtualMachineScaleSetListResultPage { 10402 return VirtualMachineScaleSetListResultPage{ 10403 fn: getNextPage, 10404 vmsslr: cur, 10405 } 10406} 10407 10408// VirtualMachineScaleSetListSkusResult the Virtual Machine Scale Set List Skus operation response. 10409type VirtualMachineScaleSetListSkusResult struct { 10410 autorest.Response `json:"-"` 10411 // Value - The list of skus available for the virtual machine scale set. 10412 Value *[]VirtualMachineScaleSetSku `json:"value,omitempty"` 10413 // 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. 10414 NextLink *string `json:"nextLink,omitempty"` 10415} 10416 10417// VirtualMachineScaleSetListSkusResultIterator provides access to a complete listing of 10418// VirtualMachineScaleSetSku values. 10419type VirtualMachineScaleSetListSkusResultIterator struct { 10420 i int 10421 page VirtualMachineScaleSetListSkusResultPage 10422} 10423 10424// NextWithContext advances to the next value. If there was an error making 10425// the request the iterator does not advance and the error is returned. 10426func (iter *VirtualMachineScaleSetListSkusResultIterator) NextWithContext(ctx context.Context) (err error) { 10427 if tracing.IsEnabled() { 10428 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListSkusResultIterator.NextWithContext") 10429 defer func() { 10430 sc := -1 10431 if iter.Response().Response.Response != nil { 10432 sc = iter.Response().Response.Response.StatusCode 10433 } 10434 tracing.EndSpan(ctx, sc, err) 10435 }() 10436 } 10437 iter.i++ 10438 if iter.i < len(iter.page.Values()) { 10439 return nil 10440 } 10441 err = iter.page.NextWithContext(ctx) 10442 if err != nil { 10443 iter.i-- 10444 return err 10445 } 10446 iter.i = 0 10447 return nil 10448} 10449 10450// Next advances to the next value. If there was an error making 10451// the request the iterator does not advance and the error is returned. 10452// Deprecated: Use NextWithContext() instead. 10453func (iter *VirtualMachineScaleSetListSkusResultIterator) Next() error { 10454 return iter.NextWithContext(context.Background()) 10455} 10456 10457// NotDone returns true if the enumeration should be started or is not yet complete. 10458func (iter VirtualMachineScaleSetListSkusResultIterator) NotDone() bool { 10459 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10460} 10461 10462// Response returns the raw server response from the last page request. 10463func (iter VirtualMachineScaleSetListSkusResultIterator) Response() VirtualMachineScaleSetListSkusResult { 10464 return iter.page.Response() 10465} 10466 10467// Value returns the current value or a zero-initialized value if the 10468// iterator has advanced beyond the end of the collection. 10469func (iter VirtualMachineScaleSetListSkusResultIterator) Value() VirtualMachineScaleSetSku { 10470 if !iter.page.NotDone() { 10471 return VirtualMachineScaleSetSku{} 10472 } 10473 return iter.page.Values()[iter.i] 10474} 10475 10476// Creates a new instance of the VirtualMachineScaleSetListSkusResultIterator type. 10477func NewVirtualMachineScaleSetListSkusResultIterator(page VirtualMachineScaleSetListSkusResultPage) VirtualMachineScaleSetListSkusResultIterator { 10478 return VirtualMachineScaleSetListSkusResultIterator{page: page} 10479} 10480 10481// IsEmpty returns true if the ListResult contains no values. 10482func (vmsslsr VirtualMachineScaleSetListSkusResult) IsEmpty() bool { 10483 return vmsslsr.Value == nil || len(*vmsslsr.Value) == 0 10484} 10485 10486// hasNextLink returns true if the NextLink is not empty. 10487func (vmsslsr VirtualMachineScaleSetListSkusResult) hasNextLink() bool { 10488 return vmsslsr.NextLink != nil && len(*vmsslsr.NextLink) != 0 10489} 10490 10491// virtualMachineScaleSetListSkusResultPreparer prepares a request to retrieve the next set of results. 10492// It returns nil if no more results exist. 10493func (vmsslsr VirtualMachineScaleSetListSkusResult) virtualMachineScaleSetListSkusResultPreparer(ctx context.Context) (*http.Request, error) { 10494 if !vmsslsr.hasNextLink() { 10495 return nil, nil 10496 } 10497 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10498 autorest.AsJSON(), 10499 autorest.AsGet(), 10500 autorest.WithBaseURL(to.String(vmsslsr.NextLink))) 10501} 10502 10503// VirtualMachineScaleSetListSkusResultPage contains a page of VirtualMachineScaleSetSku values. 10504type VirtualMachineScaleSetListSkusResultPage struct { 10505 fn func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error) 10506 vmsslsr VirtualMachineScaleSetListSkusResult 10507} 10508 10509// NextWithContext advances to the next page of values. If there was an error making 10510// the request the page does not advance and the error is returned. 10511func (page *VirtualMachineScaleSetListSkusResultPage) NextWithContext(ctx context.Context) (err error) { 10512 if tracing.IsEnabled() { 10513 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListSkusResultPage.NextWithContext") 10514 defer func() { 10515 sc := -1 10516 if page.Response().Response.Response != nil { 10517 sc = page.Response().Response.Response.StatusCode 10518 } 10519 tracing.EndSpan(ctx, sc, err) 10520 }() 10521 } 10522 for { 10523 next, err := page.fn(ctx, page.vmsslsr) 10524 if err != nil { 10525 return err 10526 } 10527 page.vmsslsr = next 10528 if !next.hasNextLink() || !next.IsEmpty() { 10529 break 10530 } 10531 } 10532 return nil 10533} 10534 10535// Next advances to the next page of values. If there was an error making 10536// the request the page does not advance and the error is returned. 10537// Deprecated: Use NextWithContext() instead. 10538func (page *VirtualMachineScaleSetListSkusResultPage) Next() error { 10539 return page.NextWithContext(context.Background()) 10540} 10541 10542// NotDone returns true if the page enumeration should be started or is not yet complete. 10543func (page VirtualMachineScaleSetListSkusResultPage) NotDone() bool { 10544 return !page.vmsslsr.IsEmpty() 10545} 10546 10547// Response returns the raw server response from the last page request. 10548func (page VirtualMachineScaleSetListSkusResultPage) Response() VirtualMachineScaleSetListSkusResult { 10549 return page.vmsslsr 10550} 10551 10552// Values returns the slice of values for the current page or nil if there are no values. 10553func (page VirtualMachineScaleSetListSkusResultPage) Values() []VirtualMachineScaleSetSku { 10554 if page.vmsslsr.IsEmpty() { 10555 return nil 10556 } 10557 return *page.vmsslsr.Value 10558} 10559 10560// Creates a new instance of the VirtualMachineScaleSetListSkusResultPage type. 10561func NewVirtualMachineScaleSetListSkusResultPage(cur VirtualMachineScaleSetListSkusResult, getNextPage func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error)) VirtualMachineScaleSetListSkusResultPage { 10562 return VirtualMachineScaleSetListSkusResultPage{ 10563 fn: getNextPage, 10564 vmsslsr: cur, 10565 } 10566} 10567 10568// VirtualMachineScaleSetListWithLinkResult the List Virtual Machine operation response. 10569type VirtualMachineScaleSetListWithLinkResult struct { 10570 autorest.Response `json:"-"` 10571 // Value - The list of virtual machine scale sets. 10572 Value *[]VirtualMachineScaleSet `json:"value,omitempty"` 10573 // 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. 10574 NextLink *string `json:"nextLink,omitempty"` 10575} 10576 10577// VirtualMachineScaleSetListWithLinkResultIterator provides access to a complete listing of 10578// VirtualMachineScaleSet values. 10579type VirtualMachineScaleSetListWithLinkResultIterator struct { 10580 i int 10581 page VirtualMachineScaleSetListWithLinkResultPage 10582} 10583 10584// NextWithContext advances to the next value. If there was an error making 10585// the request the iterator does not advance and the error is returned. 10586func (iter *VirtualMachineScaleSetListWithLinkResultIterator) NextWithContext(ctx context.Context) (err error) { 10587 if tracing.IsEnabled() { 10588 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListWithLinkResultIterator.NextWithContext") 10589 defer func() { 10590 sc := -1 10591 if iter.Response().Response.Response != nil { 10592 sc = iter.Response().Response.Response.StatusCode 10593 } 10594 tracing.EndSpan(ctx, sc, err) 10595 }() 10596 } 10597 iter.i++ 10598 if iter.i < len(iter.page.Values()) { 10599 return nil 10600 } 10601 err = iter.page.NextWithContext(ctx) 10602 if err != nil { 10603 iter.i-- 10604 return err 10605 } 10606 iter.i = 0 10607 return nil 10608} 10609 10610// Next advances to the next value. If there was an error making 10611// the request the iterator does not advance and the error is returned. 10612// Deprecated: Use NextWithContext() instead. 10613func (iter *VirtualMachineScaleSetListWithLinkResultIterator) Next() error { 10614 return iter.NextWithContext(context.Background()) 10615} 10616 10617// NotDone returns true if the enumeration should be started or is not yet complete. 10618func (iter VirtualMachineScaleSetListWithLinkResultIterator) NotDone() bool { 10619 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10620} 10621 10622// Response returns the raw server response from the last page request. 10623func (iter VirtualMachineScaleSetListWithLinkResultIterator) Response() VirtualMachineScaleSetListWithLinkResult { 10624 return iter.page.Response() 10625} 10626 10627// Value returns the current value or a zero-initialized value if the 10628// iterator has advanced beyond the end of the collection. 10629func (iter VirtualMachineScaleSetListWithLinkResultIterator) Value() VirtualMachineScaleSet { 10630 if !iter.page.NotDone() { 10631 return VirtualMachineScaleSet{} 10632 } 10633 return iter.page.Values()[iter.i] 10634} 10635 10636// Creates a new instance of the VirtualMachineScaleSetListWithLinkResultIterator type. 10637func NewVirtualMachineScaleSetListWithLinkResultIterator(page VirtualMachineScaleSetListWithLinkResultPage) VirtualMachineScaleSetListWithLinkResultIterator { 10638 return VirtualMachineScaleSetListWithLinkResultIterator{page: page} 10639} 10640 10641// IsEmpty returns true if the ListResult contains no values. 10642func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) IsEmpty() bool { 10643 return vmsslwlr.Value == nil || len(*vmsslwlr.Value) == 0 10644} 10645 10646// hasNextLink returns true if the NextLink is not empty. 10647func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) hasNextLink() bool { 10648 return vmsslwlr.NextLink != nil && len(*vmsslwlr.NextLink) != 0 10649} 10650 10651// virtualMachineScaleSetListWithLinkResultPreparer prepares a request to retrieve the next set of results. 10652// It returns nil if no more results exist. 10653func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) virtualMachineScaleSetListWithLinkResultPreparer(ctx context.Context) (*http.Request, error) { 10654 if !vmsslwlr.hasNextLink() { 10655 return nil, nil 10656 } 10657 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10658 autorest.AsJSON(), 10659 autorest.AsGet(), 10660 autorest.WithBaseURL(to.String(vmsslwlr.NextLink))) 10661} 10662 10663// VirtualMachineScaleSetListWithLinkResultPage contains a page of VirtualMachineScaleSet values. 10664type VirtualMachineScaleSetListWithLinkResultPage struct { 10665 fn func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error) 10666 vmsslwlr VirtualMachineScaleSetListWithLinkResult 10667} 10668 10669// NextWithContext advances to the next page of values. If there was an error making 10670// the request the page does not advance and the error is returned. 10671func (page *VirtualMachineScaleSetListWithLinkResultPage) NextWithContext(ctx context.Context) (err error) { 10672 if tracing.IsEnabled() { 10673 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListWithLinkResultPage.NextWithContext") 10674 defer func() { 10675 sc := -1 10676 if page.Response().Response.Response != nil { 10677 sc = page.Response().Response.Response.StatusCode 10678 } 10679 tracing.EndSpan(ctx, sc, err) 10680 }() 10681 } 10682 for { 10683 next, err := page.fn(ctx, page.vmsslwlr) 10684 if err != nil { 10685 return err 10686 } 10687 page.vmsslwlr = next 10688 if !next.hasNextLink() || !next.IsEmpty() { 10689 break 10690 } 10691 } 10692 return nil 10693} 10694 10695// Next advances to the next page of values. If there was an error making 10696// the request the page does not advance and the error is returned. 10697// Deprecated: Use NextWithContext() instead. 10698func (page *VirtualMachineScaleSetListWithLinkResultPage) Next() error { 10699 return page.NextWithContext(context.Background()) 10700} 10701 10702// NotDone returns true if the page enumeration should be started or is not yet complete. 10703func (page VirtualMachineScaleSetListWithLinkResultPage) NotDone() bool { 10704 return !page.vmsslwlr.IsEmpty() 10705} 10706 10707// Response returns the raw server response from the last page request. 10708func (page VirtualMachineScaleSetListWithLinkResultPage) Response() VirtualMachineScaleSetListWithLinkResult { 10709 return page.vmsslwlr 10710} 10711 10712// Values returns the slice of values for the current page or nil if there are no values. 10713func (page VirtualMachineScaleSetListWithLinkResultPage) Values() []VirtualMachineScaleSet { 10714 if page.vmsslwlr.IsEmpty() { 10715 return nil 10716 } 10717 return *page.vmsslwlr.Value 10718} 10719 10720// Creates a new instance of the VirtualMachineScaleSetListWithLinkResultPage type. 10721func NewVirtualMachineScaleSetListWithLinkResultPage(cur VirtualMachineScaleSetListWithLinkResult, getNextPage func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error)) VirtualMachineScaleSetListWithLinkResultPage { 10722 return VirtualMachineScaleSetListWithLinkResultPage{ 10723 fn: getNextPage, 10724 vmsslwlr: cur, 10725 } 10726} 10727 10728// VirtualMachineScaleSetManagedDiskParameters describes the parameters of a ScaleSet managed disk. 10729type VirtualMachineScaleSetManagedDiskParameters struct { 10730 // 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' 10731 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 10732 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed disk. 10733 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 10734} 10735 10736// VirtualMachineScaleSetNetworkConfiguration describes a virtual machine scale set network profile's 10737// network configurations. 10738type VirtualMachineScaleSetNetworkConfiguration struct { 10739 // Name - The network configuration name. 10740 Name *string `json:"name,omitempty"` 10741 *VirtualMachineScaleSetNetworkConfigurationProperties `json:"properties,omitempty"` 10742 // ID - Resource Id 10743 ID *string `json:"id,omitempty"` 10744} 10745 10746// MarshalJSON is the custom marshaler for VirtualMachineScaleSetNetworkConfiguration. 10747func (vmssnc VirtualMachineScaleSetNetworkConfiguration) MarshalJSON() ([]byte, error) { 10748 objectMap := make(map[string]interface{}) 10749 if vmssnc.Name != nil { 10750 objectMap["name"] = vmssnc.Name 10751 } 10752 if vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties != nil { 10753 objectMap["properties"] = vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties 10754 } 10755 if vmssnc.ID != nil { 10756 objectMap["id"] = vmssnc.ID 10757 } 10758 return json.Marshal(objectMap) 10759} 10760 10761// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetNetworkConfiguration struct. 10762func (vmssnc *VirtualMachineScaleSetNetworkConfiguration) UnmarshalJSON(body []byte) error { 10763 var m map[string]*json.RawMessage 10764 err := json.Unmarshal(body, &m) 10765 if err != nil { 10766 return err 10767 } 10768 for k, v := range m { 10769 switch k { 10770 case "name": 10771 if v != nil { 10772 var name string 10773 err = json.Unmarshal(*v, &name) 10774 if err != nil { 10775 return err 10776 } 10777 vmssnc.Name = &name 10778 } 10779 case "properties": 10780 if v != nil { 10781 var virtualMachineScaleSetNetworkConfigurationProperties VirtualMachineScaleSetNetworkConfigurationProperties 10782 err = json.Unmarshal(*v, &virtualMachineScaleSetNetworkConfigurationProperties) 10783 if err != nil { 10784 return err 10785 } 10786 vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties = &virtualMachineScaleSetNetworkConfigurationProperties 10787 } 10788 case "id": 10789 if v != nil { 10790 var ID string 10791 err = json.Unmarshal(*v, &ID) 10792 if err != nil { 10793 return err 10794 } 10795 vmssnc.ID = &ID 10796 } 10797 } 10798 } 10799 10800 return nil 10801} 10802 10803// VirtualMachineScaleSetNetworkConfigurationDNSSettings describes a virtual machines scale sets network 10804// configuration's DNS settings. 10805type VirtualMachineScaleSetNetworkConfigurationDNSSettings struct { 10806 // DNSServers - List of DNS servers IP addresses 10807 DNSServers *[]string `json:"dnsServers,omitempty"` 10808} 10809 10810// VirtualMachineScaleSetNetworkConfigurationProperties describes a virtual machine scale set network 10811// profile's IP configuration. 10812type VirtualMachineScaleSetNetworkConfigurationProperties struct { 10813 // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. 10814 Primary *bool `json:"primary,omitempty"` 10815 // EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled. 10816 EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` 10817 // NetworkSecurityGroup - The network security group. 10818 NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` 10819 // DNSSettings - The dns settings to be applied on the network interfaces. 10820 DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings `json:"dnsSettings,omitempty"` 10821 // IPConfigurations - Specifies the IP configurations of the network interface. 10822 IPConfigurations *[]VirtualMachineScaleSetIPConfiguration `json:"ipConfigurations,omitempty"` 10823 // EnableIPForwarding - Whether IP forwarding enabled on this NIC. 10824 EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` 10825} 10826 10827// VirtualMachineScaleSetNetworkProfile describes a virtual machine scale set network profile. 10828type VirtualMachineScaleSetNetworkProfile struct { 10829 // 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}'. 10830 HealthProbe *APIEntityReference `json:"healthProbe,omitempty"` 10831 // NetworkInterfaceConfigurations - The list of network configurations. 10832 NetworkInterfaceConfigurations *[]VirtualMachineScaleSetNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` 10833} 10834 10835// VirtualMachineScaleSetOSDisk describes a virtual machine scale set operating system disk. 10836type VirtualMachineScaleSetOSDisk struct { 10837 // Name - The disk name. 10838 Name *string `json:"name,omitempty"` 10839 // 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' 10840 Caching CachingTypes `json:"caching,omitempty"` 10841 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 10842 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 10843 // 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' 10844 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 10845 // DiffDiskSettings - Specifies the ephemeral disk Settings for the operating system disk used by the virtual machine scale set. 10846 DiffDiskSettings *DiffDiskSettings `json:"diffDiskSettings,omitempty"` 10847 // 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 10848 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 10849 // 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' 10850 OsType OperatingSystemTypes `json:"osType,omitempty"` 10851 // Image - Specifies information about the unmanaged user image to base the scale set on. 10852 Image *VirtualHardDisk `json:"image,omitempty"` 10853 // VhdContainers - Specifies the container urls that are used to store operating system disks for the scale set. 10854 VhdContainers *[]string `json:"vhdContainers,omitempty"` 10855 // ManagedDisk - The managed disk parameters. 10856 ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` 10857} 10858 10859// VirtualMachineScaleSetOSProfile describes a virtual machine scale set OS profile. 10860type VirtualMachineScaleSetOSProfile struct { 10861 // 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. 10862 ComputerNamePrefix *string `json:"computerNamePrefix,omitempty"` 10863 // 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) 10864 AdminUsername *string `json:"adminUsername,omitempty"` 10865 // 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) 10866 AdminPassword *string `json:"adminPassword,omitempty"` 10867 // 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) 10868 CustomData *string `json:"customData,omitempty"` 10869 // WindowsConfiguration - Specifies Windows operating system settings on the virtual machine. 10870 WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` 10871 // 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). 10872 LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` 10873 // Secrets - Specifies set of certificates that should be installed onto the virtual machines in the scale set. 10874 Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` 10875} 10876 10877// VirtualMachineScaleSetProperties describes the properties of a Virtual Machine Scale Set. 10878type VirtualMachineScaleSetProperties struct { 10879 // UpgradePolicy - The upgrade policy. 10880 UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` 10881 // AutomaticRepairsPolicy - Policy for automatic repairs. 10882 AutomaticRepairsPolicy *AutomaticRepairsPolicy `json:"automaticRepairsPolicy,omitempty"` 10883 // VirtualMachineProfile - The virtual machine profile. 10884 VirtualMachineProfile *VirtualMachineScaleSetVMProfile `json:"virtualMachineProfile,omitempty"` 10885 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 10886 ProvisioningState *string `json:"provisioningState,omitempty"` 10887 // Overprovision - Specifies whether the Virtual Machine Scale Set should be overprovisioned. 10888 Overprovision *bool `json:"overprovision,omitempty"` 10889 // 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. 10890 DoNotRunExtensionsOnOverprovisionedVMs *bool `json:"doNotRunExtensionsOnOverprovisionedVMs,omitempty"` 10891 // UniqueID - READ-ONLY; Specifies the ID which uniquely identifies a Virtual Machine Scale Set. 10892 UniqueID *string `json:"uniqueId,omitempty"` 10893 // 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. 10894 SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"` 10895 // ZoneBalance - Whether to force strictly even Virtual Machine distribution cross x-zones in case there is zone outage. 10896 ZoneBalance *bool `json:"zoneBalance,omitempty"` 10897 // PlatformFaultDomainCount - Fault Domain count for each placement group. 10898 PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` 10899 // 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. 10900 ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` 10901 // 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. 10902 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 10903 // ScaleInPolicy - Specifies the scale-in policy that decides which virtual machines are chosen for removal when a Virtual Machine Scale Set is scaled-in. 10904 ScaleInPolicy *ScaleInPolicy `json:"scaleInPolicy,omitempty"` 10905} 10906 10907// MarshalJSON is the custom marshaler for VirtualMachineScaleSetProperties. 10908func (vmssp VirtualMachineScaleSetProperties) MarshalJSON() ([]byte, error) { 10909 objectMap := make(map[string]interface{}) 10910 if vmssp.UpgradePolicy != nil { 10911 objectMap["upgradePolicy"] = vmssp.UpgradePolicy 10912 } 10913 if vmssp.AutomaticRepairsPolicy != nil { 10914 objectMap["automaticRepairsPolicy"] = vmssp.AutomaticRepairsPolicy 10915 } 10916 if vmssp.VirtualMachineProfile != nil { 10917 objectMap["virtualMachineProfile"] = vmssp.VirtualMachineProfile 10918 } 10919 if vmssp.Overprovision != nil { 10920 objectMap["overprovision"] = vmssp.Overprovision 10921 } 10922 if vmssp.DoNotRunExtensionsOnOverprovisionedVMs != nil { 10923 objectMap["doNotRunExtensionsOnOverprovisionedVMs"] = vmssp.DoNotRunExtensionsOnOverprovisionedVMs 10924 } 10925 if vmssp.SinglePlacementGroup != nil { 10926 objectMap["singlePlacementGroup"] = vmssp.SinglePlacementGroup 10927 } 10928 if vmssp.ZoneBalance != nil { 10929 objectMap["zoneBalance"] = vmssp.ZoneBalance 10930 } 10931 if vmssp.PlatformFaultDomainCount != nil { 10932 objectMap["platformFaultDomainCount"] = vmssp.PlatformFaultDomainCount 10933 } 10934 if vmssp.ProximityPlacementGroup != nil { 10935 objectMap["proximityPlacementGroup"] = vmssp.ProximityPlacementGroup 10936 } 10937 if vmssp.AdditionalCapabilities != nil { 10938 objectMap["additionalCapabilities"] = vmssp.AdditionalCapabilities 10939 } 10940 if vmssp.ScaleInPolicy != nil { 10941 objectMap["scaleInPolicy"] = vmssp.ScaleInPolicy 10942 } 10943 return json.Marshal(objectMap) 10944} 10945 10946// VirtualMachineScaleSetPublicIPAddressConfiguration describes a virtual machines scale set IP 10947// Configuration's PublicIPAddress configuration 10948type VirtualMachineScaleSetPublicIPAddressConfiguration struct { 10949 // Name - The publicIP address configuration name. 10950 Name *string `json:"name,omitempty"` 10951 *VirtualMachineScaleSetPublicIPAddressConfigurationProperties `json:"properties,omitempty"` 10952} 10953 10954// MarshalJSON is the custom marshaler for VirtualMachineScaleSetPublicIPAddressConfiguration. 10955func (vmsspiac VirtualMachineScaleSetPublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { 10956 objectMap := make(map[string]interface{}) 10957 if vmsspiac.Name != nil { 10958 objectMap["name"] = vmsspiac.Name 10959 } 10960 if vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties != nil { 10961 objectMap["properties"] = vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties 10962 } 10963 return json.Marshal(objectMap) 10964} 10965 10966// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetPublicIPAddressConfiguration struct. 10967func (vmsspiac *VirtualMachineScaleSetPublicIPAddressConfiguration) UnmarshalJSON(body []byte) error { 10968 var m map[string]*json.RawMessage 10969 err := json.Unmarshal(body, &m) 10970 if err != nil { 10971 return err 10972 } 10973 for k, v := range m { 10974 switch k { 10975 case "name": 10976 if v != nil { 10977 var name string 10978 err = json.Unmarshal(*v, &name) 10979 if err != nil { 10980 return err 10981 } 10982 vmsspiac.Name = &name 10983 } 10984 case "properties": 10985 if v != nil { 10986 var virtualMachineScaleSetPublicIPAddressConfigurationProperties VirtualMachineScaleSetPublicIPAddressConfigurationProperties 10987 err = json.Unmarshal(*v, &virtualMachineScaleSetPublicIPAddressConfigurationProperties) 10988 if err != nil { 10989 return err 10990 } 10991 vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties = &virtualMachineScaleSetPublicIPAddressConfigurationProperties 10992 } 10993 } 10994 } 10995 10996 return nil 10997} 10998 10999// VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings describes a virtual machines scale sets 11000// network configuration's DNS settings. 11001type VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings struct { 11002 // 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 11003 DomainNameLabel *string `json:"domainNameLabel,omitempty"` 11004} 11005 11006// VirtualMachineScaleSetPublicIPAddressConfigurationProperties describes a virtual machines scale set IP 11007// Configuration's PublicIPAddress configuration 11008type VirtualMachineScaleSetPublicIPAddressConfigurationProperties struct { 11009 // IdleTimeoutInMinutes - The idle timeout of the public IP address. 11010 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` 11011 // DNSSettings - The dns settings to be applied on the publicIP addresses . 11012 DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings `json:"dnsSettings,omitempty"` 11013 // IPTags - The list of IP tags associated with the public IP address. 11014 IPTags *[]VirtualMachineScaleSetIPTag `json:"ipTags,omitempty"` 11015 // PublicIPPrefix - The PublicIPPrefix from which to allocate publicIP addresses. 11016 PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` 11017 // 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' 11018 PublicIPAddressVersion IPVersion `json:"publicIPAddressVersion,omitempty"` 11019} 11020 11021// VirtualMachineScaleSetReimageParameters describes a Virtual Machine Scale Set VM Reimage Parameters. 11022type VirtualMachineScaleSetReimageParameters struct { 11023 // 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. 11024 InstanceIds *[]string `json:"instanceIds,omitempty"` 11025 // 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. 11026 TempDisk *bool `json:"tempDisk,omitempty"` 11027} 11028 11029// VirtualMachineScaleSetRollingUpgradesCancelFuture an abstraction for monitoring and retrieving the 11030// results of a long-running operation. 11031type VirtualMachineScaleSetRollingUpgradesCancelFuture struct { 11032 azure.FutureAPI 11033 // Result returns the result of the asynchronous operation. 11034 // If the operation has not completed it will return an error. 11035 Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) 11036} 11037 11038// VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture an abstraction for monitoring and 11039// retrieving the results of a long-running operation. 11040type VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture struct { 11041 azure.FutureAPI 11042 // Result returns the result of the asynchronous operation. 11043 // If the operation has not completed it will return an error. 11044 Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) 11045} 11046 11047// VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture an abstraction for monitoring and retrieving 11048// the results of a long-running operation. 11049type VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture struct { 11050 azure.FutureAPI 11051 // Result returns the result of the asynchronous operation. 11052 // If the operation has not completed it will return an error. 11053 Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) 11054} 11055 11056// VirtualMachineScaleSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of 11057// a long-running operation. 11058type VirtualMachineScaleSetsCreateOrUpdateFuture struct { 11059 azure.FutureAPI 11060 // Result returns the result of the asynchronous operation. 11061 // If the operation has not completed it will return an error. 11062 Result func(VirtualMachineScaleSetsClient) (VirtualMachineScaleSet, error) 11063} 11064 11065// VirtualMachineScaleSetsDeallocateFuture an abstraction for monitoring and retrieving the results of a 11066// long-running operation. 11067type VirtualMachineScaleSetsDeallocateFuture struct { 11068 azure.FutureAPI 11069 // Result returns the result of the asynchronous operation. 11070 // If the operation has not completed it will return an error. 11071 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 11072} 11073 11074// VirtualMachineScaleSetsDeleteFuture an abstraction for monitoring and retrieving the results of a 11075// long-running operation. 11076type VirtualMachineScaleSetsDeleteFuture struct { 11077 azure.FutureAPI 11078 // Result returns the result of the asynchronous operation. 11079 // If the operation has not completed it will return an error. 11080 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 11081} 11082 11083// VirtualMachineScaleSetsDeleteInstancesFuture an abstraction for monitoring and retrieving the results of 11084// a long-running operation. 11085type VirtualMachineScaleSetsDeleteInstancesFuture struct { 11086 azure.FutureAPI 11087 // Result returns the result of the asynchronous operation. 11088 // If the operation has not completed it will return an error. 11089 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 11090} 11091 11092// VirtualMachineScaleSetSku describes an available virtual machine scale set sku. 11093type VirtualMachineScaleSetSku struct { 11094 // ResourceType - READ-ONLY; The type of resource the sku applies to. 11095 ResourceType *string `json:"resourceType,omitempty"` 11096 // Sku - READ-ONLY; The Sku. 11097 Sku *Sku `json:"sku,omitempty"` 11098 // Capacity - READ-ONLY; Specifies the number of virtual machines in the scale set. 11099 Capacity *VirtualMachineScaleSetSkuCapacity `json:"capacity,omitempty"` 11100} 11101 11102// VirtualMachineScaleSetSkuCapacity describes scaling information of a sku. 11103type VirtualMachineScaleSetSkuCapacity struct { 11104 // Minimum - READ-ONLY; The minimum capacity. 11105 Minimum *int64 `json:"minimum,omitempty"` 11106 // Maximum - READ-ONLY; The maximum capacity that can be set. 11107 Maximum *int64 `json:"maximum,omitempty"` 11108 // DefaultCapacity - READ-ONLY; The default capacity. 11109 DefaultCapacity *int64 `json:"defaultCapacity,omitempty"` 11110 // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'VirtualMachineScaleSetSkuScaleTypeAutomatic', 'VirtualMachineScaleSetSkuScaleTypeNone' 11111 ScaleType VirtualMachineScaleSetSkuScaleType `json:"scaleType,omitempty"` 11112} 11113 11114// VirtualMachineScaleSetsPerformMaintenanceFuture an abstraction for monitoring and retrieving the results 11115// of a long-running operation. 11116type VirtualMachineScaleSetsPerformMaintenanceFuture struct { 11117 azure.FutureAPI 11118 // Result returns the result of the asynchronous operation. 11119 // If the operation has not completed it will return an error. 11120 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 11121} 11122 11123// VirtualMachineScaleSetsPowerOffFuture an abstraction for monitoring and retrieving the results of a 11124// long-running operation. 11125type VirtualMachineScaleSetsPowerOffFuture struct { 11126 azure.FutureAPI 11127 // Result returns the result of the asynchronous operation. 11128 // If the operation has not completed it will return an error. 11129 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 11130} 11131 11132// VirtualMachineScaleSetsRedeployFuture an abstraction for monitoring and retrieving the results of a 11133// long-running operation. 11134type VirtualMachineScaleSetsRedeployFuture struct { 11135 azure.FutureAPI 11136 // Result returns the result of the asynchronous operation. 11137 // If the operation has not completed it will return an error. 11138 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 11139} 11140 11141// VirtualMachineScaleSetsReimageAllFuture an abstraction for monitoring and retrieving the results of a 11142// long-running operation. 11143type VirtualMachineScaleSetsReimageAllFuture struct { 11144 azure.FutureAPI 11145 // Result returns the result of the asynchronous operation. 11146 // If the operation has not completed it will return an error. 11147 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 11148} 11149 11150// VirtualMachineScaleSetsReimageFuture an abstraction for monitoring and retrieving the results of a 11151// long-running operation. 11152type VirtualMachineScaleSetsReimageFuture struct { 11153 azure.FutureAPI 11154 // Result returns the result of the asynchronous operation. 11155 // If the operation has not completed it will return an error. 11156 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 11157} 11158 11159// VirtualMachineScaleSetsRestartFuture an abstraction for monitoring and retrieving the results of a 11160// long-running operation. 11161type VirtualMachineScaleSetsRestartFuture struct { 11162 azure.FutureAPI 11163 // Result returns the result of the asynchronous operation. 11164 // If the operation has not completed it will return an error. 11165 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 11166} 11167 11168// VirtualMachineScaleSetsSetOrchestrationServiceStateFuture an abstraction for monitoring and retrieving 11169// the results of a long-running operation. 11170type VirtualMachineScaleSetsSetOrchestrationServiceStateFuture struct { 11171 azure.FutureAPI 11172 // Result returns the result of the asynchronous operation. 11173 // If the operation has not completed it will return an error. 11174 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 11175} 11176 11177// VirtualMachineScaleSetsStartFuture an abstraction for monitoring and retrieving the results of a 11178// long-running operation. 11179type VirtualMachineScaleSetsStartFuture struct { 11180 azure.FutureAPI 11181 // Result returns the result of the asynchronous operation. 11182 // If the operation has not completed it will return an error. 11183 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 11184} 11185 11186// VirtualMachineScaleSetStorageProfile describes a virtual machine scale set storage profile. 11187type VirtualMachineScaleSetStorageProfile struct { 11188 // 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. 11189 ImageReference *ImageReference `json:"imageReference,omitempty"` 11190 // 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). 11191 OsDisk *VirtualMachineScaleSetOSDisk `json:"osDisk,omitempty"` 11192 // 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). 11193 DataDisks *[]VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"` 11194} 11195 11196// VirtualMachineScaleSetsUpdateFuture an abstraction for monitoring and retrieving the results of a 11197// long-running operation. 11198type VirtualMachineScaleSetsUpdateFuture struct { 11199 azure.FutureAPI 11200 // Result returns the result of the asynchronous operation. 11201 // If the operation has not completed it will return an error. 11202 Result func(VirtualMachineScaleSetsClient) (VirtualMachineScaleSet, error) 11203} 11204 11205// VirtualMachineScaleSetsUpdateInstancesFuture an abstraction for monitoring and retrieving the results of 11206// a long-running operation. 11207type VirtualMachineScaleSetsUpdateInstancesFuture struct { 11208 azure.FutureAPI 11209 // Result returns the result of the asynchronous operation. 11210 // If the operation has not completed it will return an error. 11211 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 11212} 11213 11214// VirtualMachineScaleSetUpdate describes a Virtual Machine Scale Set. 11215type VirtualMachineScaleSetUpdate struct { 11216 // Sku - The virtual machine scale set sku. 11217 Sku *Sku `json:"sku,omitempty"` 11218 // Plan - The purchase plan when deploying a virtual machine scale set from VM Marketplace images. 11219 Plan *Plan `json:"plan,omitempty"` 11220 *VirtualMachineScaleSetUpdateProperties `json:"properties,omitempty"` 11221 // Identity - The identity of the virtual machine scale set, if configured. 11222 Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"` 11223 // Tags - Resource tags 11224 Tags map[string]*string `json:"tags"` 11225} 11226 11227// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdate. 11228func (vmssu VirtualMachineScaleSetUpdate) MarshalJSON() ([]byte, error) { 11229 objectMap := make(map[string]interface{}) 11230 if vmssu.Sku != nil { 11231 objectMap["sku"] = vmssu.Sku 11232 } 11233 if vmssu.Plan != nil { 11234 objectMap["plan"] = vmssu.Plan 11235 } 11236 if vmssu.VirtualMachineScaleSetUpdateProperties != nil { 11237 objectMap["properties"] = vmssu.VirtualMachineScaleSetUpdateProperties 11238 } 11239 if vmssu.Identity != nil { 11240 objectMap["identity"] = vmssu.Identity 11241 } 11242 if vmssu.Tags != nil { 11243 objectMap["tags"] = vmssu.Tags 11244 } 11245 return json.Marshal(objectMap) 11246} 11247 11248// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdate struct. 11249func (vmssu *VirtualMachineScaleSetUpdate) UnmarshalJSON(body []byte) error { 11250 var m map[string]*json.RawMessage 11251 err := json.Unmarshal(body, &m) 11252 if err != nil { 11253 return err 11254 } 11255 for k, v := range m { 11256 switch k { 11257 case "sku": 11258 if v != nil { 11259 var sku Sku 11260 err = json.Unmarshal(*v, &sku) 11261 if err != nil { 11262 return err 11263 } 11264 vmssu.Sku = &sku 11265 } 11266 case "plan": 11267 if v != nil { 11268 var plan Plan 11269 err = json.Unmarshal(*v, &plan) 11270 if err != nil { 11271 return err 11272 } 11273 vmssu.Plan = &plan 11274 } 11275 case "properties": 11276 if v != nil { 11277 var virtualMachineScaleSetUpdateProperties VirtualMachineScaleSetUpdateProperties 11278 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateProperties) 11279 if err != nil { 11280 return err 11281 } 11282 vmssu.VirtualMachineScaleSetUpdateProperties = &virtualMachineScaleSetUpdateProperties 11283 } 11284 case "identity": 11285 if v != nil { 11286 var identity VirtualMachineScaleSetIdentity 11287 err = json.Unmarshal(*v, &identity) 11288 if err != nil { 11289 return err 11290 } 11291 vmssu.Identity = &identity 11292 } 11293 case "tags": 11294 if v != nil { 11295 var tags map[string]*string 11296 err = json.Unmarshal(*v, &tags) 11297 if err != nil { 11298 return err 11299 } 11300 vmssu.Tags = tags 11301 } 11302 } 11303 } 11304 11305 return nil 11306} 11307 11308// VirtualMachineScaleSetUpdateIPConfiguration describes a virtual machine scale set network profile's IP 11309// configuration. NOTE: The subnet of a scale set may be modified as long as the original subnet and the 11310// new subnet are in the same virtual network 11311type VirtualMachineScaleSetUpdateIPConfiguration struct { 11312 // Name - The IP configuration name. 11313 Name *string `json:"name,omitempty"` 11314 *VirtualMachineScaleSetUpdateIPConfigurationProperties `json:"properties,omitempty"` 11315 // ID - Resource Id 11316 ID *string `json:"id,omitempty"` 11317} 11318 11319// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdateIPConfiguration. 11320func (vmssuic VirtualMachineScaleSetUpdateIPConfiguration) MarshalJSON() ([]byte, error) { 11321 objectMap := make(map[string]interface{}) 11322 if vmssuic.Name != nil { 11323 objectMap["name"] = vmssuic.Name 11324 } 11325 if vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties != nil { 11326 objectMap["properties"] = vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties 11327 } 11328 if vmssuic.ID != nil { 11329 objectMap["id"] = vmssuic.ID 11330 } 11331 return json.Marshal(objectMap) 11332} 11333 11334// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdateIPConfiguration struct. 11335func (vmssuic *VirtualMachineScaleSetUpdateIPConfiguration) UnmarshalJSON(body []byte) error { 11336 var m map[string]*json.RawMessage 11337 err := json.Unmarshal(body, &m) 11338 if err != nil { 11339 return err 11340 } 11341 for k, v := range m { 11342 switch k { 11343 case "name": 11344 if v != nil { 11345 var name string 11346 err = json.Unmarshal(*v, &name) 11347 if err != nil { 11348 return err 11349 } 11350 vmssuic.Name = &name 11351 } 11352 case "properties": 11353 if v != nil { 11354 var virtualMachineScaleSetUpdateIPConfigurationProperties VirtualMachineScaleSetUpdateIPConfigurationProperties 11355 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateIPConfigurationProperties) 11356 if err != nil { 11357 return err 11358 } 11359 vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties = &virtualMachineScaleSetUpdateIPConfigurationProperties 11360 } 11361 case "id": 11362 if v != nil { 11363 var ID string 11364 err = json.Unmarshal(*v, &ID) 11365 if err != nil { 11366 return err 11367 } 11368 vmssuic.ID = &ID 11369 } 11370 } 11371 } 11372 11373 return nil 11374} 11375 11376// VirtualMachineScaleSetUpdateIPConfigurationProperties describes a virtual machine scale set network 11377// profile's IP configuration properties. 11378type VirtualMachineScaleSetUpdateIPConfigurationProperties struct { 11379 // Subnet - The subnet. 11380 Subnet *APIEntityReference `json:"subnet,omitempty"` 11381 // Primary - Specifies the primary IP Configuration in case the network interface has more than one IP Configuration. 11382 Primary *bool `json:"primary,omitempty"` 11383 // PublicIPAddressConfiguration - The publicIPAddressConfiguration. 11384 PublicIPAddressConfiguration *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` 11385 // 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' 11386 PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` 11387 // ApplicationGatewayBackendAddressPools - The application gateway backend address pools. 11388 ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` 11389 // ApplicationSecurityGroups - Specifies an array of references to application security group. 11390 ApplicationSecurityGroups *[]SubResource `json:"applicationSecurityGroups,omitempty"` 11391 // LoadBalancerBackendAddressPools - The load balancer backend address pools. 11392 LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` 11393 // LoadBalancerInboundNatPools - The load balancer inbound nat pools. 11394 LoadBalancerInboundNatPools *[]SubResource `json:"loadBalancerInboundNatPools,omitempty"` 11395} 11396 11397// VirtualMachineScaleSetUpdateNetworkConfiguration describes a virtual machine scale set network profile's 11398// network configurations. 11399type VirtualMachineScaleSetUpdateNetworkConfiguration struct { 11400 // Name - The network configuration name. 11401 Name *string `json:"name,omitempty"` 11402 *VirtualMachineScaleSetUpdateNetworkConfigurationProperties `json:"properties,omitempty"` 11403 // ID - Resource Id 11404 ID *string `json:"id,omitempty"` 11405} 11406 11407// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdateNetworkConfiguration. 11408func (vmssunc VirtualMachineScaleSetUpdateNetworkConfiguration) MarshalJSON() ([]byte, error) { 11409 objectMap := make(map[string]interface{}) 11410 if vmssunc.Name != nil { 11411 objectMap["name"] = vmssunc.Name 11412 } 11413 if vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties != nil { 11414 objectMap["properties"] = vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties 11415 } 11416 if vmssunc.ID != nil { 11417 objectMap["id"] = vmssunc.ID 11418 } 11419 return json.Marshal(objectMap) 11420} 11421 11422// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdateNetworkConfiguration struct. 11423func (vmssunc *VirtualMachineScaleSetUpdateNetworkConfiguration) UnmarshalJSON(body []byte) error { 11424 var m map[string]*json.RawMessage 11425 err := json.Unmarshal(body, &m) 11426 if err != nil { 11427 return err 11428 } 11429 for k, v := range m { 11430 switch k { 11431 case "name": 11432 if v != nil { 11433 var name string 11434 err = json.Unmarshal(*v, &name) 11435 if err != nil { 11436 return err 11437 } 11438 vmssunc.Name = &name 11439 } 11440 case "properties": 11441 if v != nil { 11442 var virtualMachineScaleSetUpdateNetworkConfigurationProperties VirtualMachineScaleSetUpdateNetworkConfigurationProperties 11443 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateNetworkConfigurationProperties) 11444 if err != nil { 11445 return err 11446 } 11447 vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties = &virtualMachineScaleSetUpdateNetworkConfigurationProperties 11448 } 11449 case "id": 11450 if v != nil { 11451 var ID string 11452 err = json.Unmarshal(*v, &ID) 11453 if err != nil { 11454 return err 11455 } 11456 vmssunc.ID = &ID 11457 } 11458 } 11459 } 11460 11461 return nil 11462} 11463 11464// VirtualMachineScaleSetUpdateNetworkConfigurationProperties describes a virtual machine scale set 11465// updatable network profile's IP configuration.Use this object for updating network profile's IP 11466// Configuration. 11467type VirtualMachineScaleSetUpdateNetworkConfigurationProperties struct { 11468 // Primary - Whether this is a primary NIC on a virtual machine. 11469 Primary *bool `json:"primary,omitempty"` 11470 // EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled. 11471 EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` 11472 // NetworkSecurityGroup - The network security group. 11473 NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` 11474 // DNSSettings - The dns settings to be applied on the network interfaces. 11475 DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings `json:"dnsSettings,omitempty"` 11476 // IPConfigurations - The virtual machine scale set IP Configuration. 11477 IPConfigurations *[]VirtualMachineScaleSetUpdateIPConfiguration `json:"ipConfigurations,omitempty"` 11478 // EnableIPForwarding - Whether IP forwarding enabled on this NIC. 11479 EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` 11480} 11481 11482// VirtualMachineScaleSetUpdateNetworkProfile describes a virtual machine scale set network profile. 11483type VirtualMachineScaleSetUpdateNetworkProfile struct { 11484 // 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}'. 11485 HealthProbe *APIEntityReference `json:"healthProbe,omitempty"` 11486 // NetworkInterfaceConfigurations - The list of network configurations. 11487 NetworkInterfaceConfigurations *[]VirtualMachineScaleSetUpdateNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` 11488} 11489 11490// VirtualMachineScaleSetUpdateOSDisk describes virtual machine scale set operating system disk Update 11491// Object. This should be used for Updating VMSS OS Disk. 11492type VirtualMachineScaleSetUpdateOSDisk struct { 11493 // Caching - The caching type. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' 11494 Caching CachingTypes `json:"caching,omitempty"` 11495 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 11496 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 11497 // 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 11498 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 11499 // 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. 11500 Image *VirtualHardDisk `json:"image,omitempty"` 11501 // VhdContainers - The list of virtual hard disk container uris. 11502 VhdContainers *[]string `json:"vhdContainers,omitempty"` 11503 // ManagedDisk - The managed disk parameters. 11504 ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` 11505} 11506 11507// VirtualMachineScaleSetUpdateOSProfile describes a virtual machine scale set OS profile. 11508type VirtualMachineScaleSetUpdateOSProfile struct { 11509 // CustomData - A base-64 encoded string of custom data. 11510 CustomData *string `json:"customData,omitempty"` 11511 // WindowsConfiguration - The Windows Configuration of the OS profile. 11512 WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` 11513 // LinuxConfiguration - The Linux Configuration of the OS profile. 11514 LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` 11515 // Secrets - The List of certificates for addition to the VM. 11516 Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` 11517} 11518 11519// VirtualMachineScaleSetUpdateProperties describes the properties of a Virtual Machine Scale Set. 11520type VirtualMachineScaleSetUpdateProperties struct { 11521 // UpgradePolicy - The upgrade policy. 11522 UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` 11523 // AutomaticRepairsPolicy - Policy for automatic repairs. 11524 AutomaticRepairsPolicy *AutomaticRepairsPolicy `json:"automaticRepairsPolicy,omitempty"` 11525 // VirtualMachineProfile - The virtual machine profile. 11526 VirtualMachineProfile *VirtualMachineScaleSetUpdateVMProfile `json:"virtualMachineProfile,omitempty"` 11527 // Overprovision - Specifies whether the Virtual Machine Scale Set should be overprovisioned. 11528 Overprovision *bool `json:"overprovision,omitempty"` 11529 // 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. 11530 DoNotRunExtensionsOnOverprovisionedVMs *bool `json:"doNotRunExtensionsOnOverprovisionedVMs,omitempty"` 11531 // 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. 11532 SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"` 11533 // 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. 11534 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 11535 // ScaleInPolicy - Specifies the scale-in policy that decides which virtual machines are chosen for removal when a Virtual Machine Scale Set is scaled-in. 11536 ScaleInPolicy *ScaleInPolicy `json:"scaleInPolicy,omitempty"` 11537 // 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. 11538 ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` 11539} 11540 11541// VirtualMachineScaleSetUpdatePublicIPAddressConfiguration describes a virtual machines scale set IP 11542// Configuration's PublicIPAddress configuration 11543type VirtualMachineScaleSetUpdatePublicIPAddressConfiguration struct { 11544 // Name - The publicIP address configuration name. 11545 Name *string `json:"name,omitempty"` 11546 *VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties `json:"properties,omitempty"` 11547} 11548 11549// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdatePublicIPAddressConfiguration. 11550func (vmssupiac VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { 11551 objectMap := make(map[string]interface{}) 11552 if vmssupiac.Name != nil { 11553 objectMap["name"] = vmssupiac.Name 11554 } 11555 if vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties != nil { 11556 objectMap["properties"] = vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties 11557 } 11558 return json.Marshal(objectMap) 11559} 11560 11561// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdatePublicIPAddressConfiguration struct. 11562func (vmssupiac *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) UnmarshalJSON(body []byte) error { 11563 var m map[string]*json.RawMessage 11564 err := json.Unmarshal(body, &m) 11565 if err != nil { 11566 return err 11567 } 11568 for k, v := range m { 11569 switch k { 11570 case "name": 11571 if v != nil { 11572 var name string 11573 err = json.Unmarshal(*v, &name) 11574 if err != nil { 11575 return err 11576 } 11577 vmssupiac.Name = &name 11578 } 11579 case "properties": 11580 if v != nil { 11581 var virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties 11582 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties) 11583 if err != nil { 11584 return err 11585 } 11586 vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties = &virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties 11587 } 11588 } 11589 } 11590 11591 return nil 11592} 11593 11594// VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties describes a virtual machines scale 11595// set IP Configuration's PublicIPAddress configuration 11596type VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties struct { 11597 // IdleTimeoutInMinutes - The idle timeout of the public IP address. 11598 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` 11599 // DNSSettings - The dns settings to be applied on the publicIP addresses . 11600 DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings `json:"dnsSettings,omitempty"` 11601} 11602 11603// VirtualMachineScaleSetUpdateStorageProfile describes a virtual machine scale set storage profile. 11604type VirtualMachineScaleSetUpdateStorageProfile struct { 11605 // ImageReference - The image reference. 11606 ImageReference *ImageReference `json:"imageReference,omitempty"` 11607 // OsDisk - The OS disk. 11608 OsDisk *VirtualMachineScaleSetUpdateOSDisk `json:"osDisk,omitempty"` 11609 // DataDisks - The data disks. 11610 DataDisks *[]VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"` 11611} 11612 11613// VirtualMachineScaleSetUpdateVMProfile describes a virtual machine scale set virtual machine profile. 11614type VirtualMachineScaleSetUpdateVMProfile struct { 11615 // OsProfile - The virtual machine scale set OS profile. 11616 OsProfile *VirtualMachineScaleSetUpdateOSProfile `json:"osProfile,omitempty"` 11617 // StorageProfile - The virtual machine scale set storage profile. 11618 StorageProfile *VirtualMachineScaleSetUpdateStorageProfile `json:"storageProfile,omitempty"` 11619 // NetworkProfile - The virtual machine scale set network profile. 11620 NetworkProfile *VirtualMachineScaleSetUpdateNetworkProfile `json:"networkProfile,omitempty"` 11621 // DiagnosticsProfile - The virtual machine scale set diagnostics profile. 11622 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 11623 // ExtensionProfile - The virtual machine scale set extension profile. 11624 ExtensionProfile *VirtualMachineScaleSetExtensionProfile `json:"extensionProfile,omitempty"` 11625 // LicenseType - The license type, which is for bring your own license scenario. 11626 LicenseType *string `json:"licenseType,omitempty"` 11627 // BillingProfile - Specifies the billing related details of a Azure Spot VMSS. <br><br>Minimum api-version: 2019-03-01. 11628 BillingProfile *BillingProfile `json:"billingProfile,omitempty"` 11629 // ScheduledEventsProfile - Specifies Scheduled Event related configurations. 11630 ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` 11631} 11632 11633// VirtualMachineScaleSetVM describes a virtual machine scale set virtual machine. 11634type VirtualMachineScaleSetVM struct { 11635 autorest.Response `json:"-"` 11636 // InstanceID - READ-ONLY; The virtual machine instance ID. 11637 InstanceID *string `json:"instanceId,omitempty"` 11638 // Sku - READ-ONLY; The virtual machine SKU. 11639 Sku *Sku `json:"sku,omitempty"` 11640 *VirtualMachineScaleSetVMProperties `json:"properties,omitempty"` 11641 // 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**. 11642 Plan *Plan `json:"plan,omitempty"` 11643 // Resources - READ-ONLY; The virtual machine child extension resources. 11644 Resources *[]VirtualMachineExtension `json:"resources,omitempty"` 11645 // Zones - READ-ONLY; The virtual machine zones. 11646 Zones *[]string `json:"zones,omitempty"` 11647 // ID - READ-ONLY; Resource Id 11648 ID *string `json:"id,omitempty"` 11649 // Name - READ-ONLY; Resource name 11650 Name *string `json:"name,omitempty"` 11651 // Type - READ-ONLY; Resource type 11652 Type *string `json:"type,omitempty"` 11653 // Location - Resource location 11654 Location *string `json:"location,omitempty"` 11655 // Tags - Resource tags 11656 Tags map[string]*string `json:"tags"` 11657} 11658 11659// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVM. 11660func (vmssv VirtualMachineScaleSetVM) MarshalJSON() ([]byte, error) { 11661 objectMap := make(map[string]interface{}) 11662 if vmssv.VirtualMachineScaleSetVMProperties != nil { 11663 objectMap["properties"] = vmssv.VirtualMachineScaleSetVMProperties 11664 } 11665 if vmssv.Plan != nil { 11666 objectMap["plan"] = vmssv.Plan 11667 } 11668 if vmssv.Location != nil { 11669 objectMap["location"] = vmssv.Location 11670 } 11671 if vmssv.Tags != nil { 11672 objectMap["tags"] = vmssv.Tags 11673 } 11674 return json.Marshal(objectMap) 11675} 11676 11677// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetVM struct. 11678func (vmssv *VirtualMachineScaleSetVM) UnmarshalJSON(body []byte) error { 11679 var m map[string]*json.RawMessage 11680 err := json.Unmarshal(body, &m) 11681 if err != nil { 11682 return err 11683 } 11684 for k, v := range m { 11685 switch k { 11686 case "instanceId": 11687 if v != nil { 11688 var instanceID string 11689 err = json.Unmarshal(*v, &instanceID) 11690 if err != nil { 11691 return err 11692 } 11693 vmssv.InstanceID = &instanceID 11694 } 11695 case "sku": 11696 if v != nil { 11697 var sku Sku 11698 err = json.Unmarshal(*v, &sku) 11699 if err != nil { 11700 return err 11701 } 11702 vmssv.Sku = &sku 11703 } 11704 case "properties": 11705 if v != nil { 11706 var virtualMachineScaleSetVMProperties VirtualMachineScaleSetVMProperties 11707 err = json.Unmarshal(*v, &virtualMachineScaleSetVMProperties) 11708 if err != nil { 11709 return err 11710 } 11711 vmssv.VirtualMachineScaleSetVMProperties = &virtualMachineScaleSetVMProperties 11712 } 11713 case "plan": 11714 if v != nil { 11715 var plan Plan 11716 err = json.Unmarshal(*v, &plan) 11717 if err != nil { 11718 return err 11719 } 11720 vmssv.Plan = &plan 11721 } 11722 case "resources": 11723 if v != nil { 11724 var resources []VirtualMachineExtension 11725 err = json.Unmarshal(*v, &resources) 11726 if err != nil { 11727 return err 11728 } 11729 vmssv.Resources = &resources 11730 } 11731 case "zones": 11732 if v != nil { 11733 var zones []string 11734 err = json.Unmarshal(*v, &zones) 11735 if err != nil { 11736 return err 11737 } 11738 vmssv.Zones = &zones 11739 } 11740 case "id": 11741 if v != nil { 11742 var ID string 11743 err = json.Unmarshal(*v, &ID) 11744 if err != nil { 11745 return err 11746 } 11747 vmssv.ID = &ID 11748 } 11749 case "name": 11750 if v != nil { 11751 var name string 11752 err = json.Unmarshal(*v, &name) 11753 if err != nil { 11754 return err 11755 } 11756 vmssv.Name = &name 11757 } 11758 case "type": 11759 if v != nil { 11760 var typeVar string 11761 err = json.Unmarshal(*v, &typeVar) 11762 if err != nil { 11763 return err 11764 } 11765 vmssv.Type = &typeVar 11766 } 11767 case "location": 11768 if v != nil { 11769 var location string 11770 err = json.Unmarshal(*v, &location) 11771 if err != nil { 11772 return err 11773 } 11774 vmssv.Location = &location 11775 } 11776 case "tags": 11777 if v != nil { 11778 var tags map[string]*string 11779 err = json.Unmarshal(*v, &tags) 11780 if err != nil { 11781 return err 11782 } 11783 vmssv.Tags = tags 11784 } 11785 } 11786 } 11787 11788 return nil 11789} 11790 11791// VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the 11792// results of a long-running operation. 11793type VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture struct { 11794 azure.FutureAPI 11795 // Result returns the result of the asynchronous operation. 11796 // If the operation has not completed it will return an error. 11797 Result func(VirtualMachineScaleSetVMExtensionsClient) (VirtualMachineExtension, error) 11798} 11799 11800// VirtualMachineScaleSetVMExtensionsDeleteFuture an abstraction for monitoring and retrieving the results 11801// of a long-running operation. 11802type VirtualMachineScaleSetVMExtensionsDeleteFuture struct { 11803 azure.FutureAPI 11804 // Result returns the result of the asynchronous operation. 11805 // If the operation has not completed it will return an error. 11806 Result func(VirtualMachineScaleSetVMExtensionsClient) (autorest.Response, error) 11807} 11808 11809// VirtualMachineScaleSetVMExtensionsSummary extensions summary for virtual machines of a virtual machine 11810// scale set. 11811type VirtualMachineScaleSetVMExtensionsSummary struct { 11812 // Name - READ-ONLY; The extension name. 11813 Name *string `json:"name,omitempty"` 11814 // StatusesSummary - READ-ONLY; The extensions information. 11815 StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` 11816} 11817 11818// VirtualMachineScaleSetVMExtensionsUpdateFuture an abstraction for monitoring and retrieving the results 11819// of a long-running operation. 11820type VirtualMachineScaleSetVMExtensionsUpdateFuture struct { 11821 azure.FutureAPI 11822 // Result returns the result of the asynchronous operation. 11823 // If the operation has not completed it will return an error. 11824 Result func(VirtualMachineScaleSetVMExtensionsClient) (VirtualMachineExtension, error) 11825} 11826 11827// VirtualMachineScaleSetVMInstanceIDs specifies a list of virtual machine instance IDs from the VM scale 11828// set. 11829type VirtualMachineScaleSetVMInstanceIDs struct { 11830 // 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. 11831 InstanceIds *[]string `json:"instanceIds,omitempty"` 11832} 11833 11834// VirtualMachineScaleSetVMInstanceRequiredIDs specifies a list of virtual machine instance IDs from the VM 11835// scale set. 11836type VirtualMachineScaleSetVMInstanceRequiredIDs struct { 11837 // InstanceIds - The virtual machine scale set instance ids. 11838 InstanceIds *[]string `json:"instanceIds,omitempty"` 11839} 11840 11841// VirtualMachineScaleSetVMInstanceView the instance view of a virtual machine scale set VM. 11842type VirtualMachineScaleSetVMInstanceView struct { 11843 autorest.Response `json:"-"` 11844 // PlatformUpdateDomain - The Update Domain count. 11845 PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` 11846 // PlatformFaultDomain - The Fault Domain count. 11847 PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` 11848 // RdpThumbPrint - The Remote desktop certificate thumbprint. 11849 RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"` 11850 // VMAgent - The VM Agent running on the virtual machine. 11851 VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"` 11852 // MaintenanceRedeployStatus - The Maintenance Operation status on the virtual machine. 11853 MaintenanceRedeployStatus *MaintenanceRedeployStatus `json:"maintenanceRedeployStatus,omitempty"` 11854 // Disks - The disks information. 11855 Disks *[]DiskInstanceView `json:"disks,omitempty"` 11856 // Extensions - The extensions information. 11857 Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` 11858 // VMHealth - READ-ONLY; The health status for the VM. 11859 VMHealth *VirtualMachineHealthStatus `json:"vmHealth,omitempty"` 11860 // 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. 11861 BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` 11862 // Statuses - The resource status information. 11863 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 11864 // PlacementGroupID - The placement group in which the VM is running. If the VM is deallocated it will not have a placementGroupId. 11865 PlacementGroupID *string `json:"placementGroupId,omitempty"` 11866} 11867 11868// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMInstanceView. 11869func (vmssviv VirtualMachineScaleSetVMInstanceView) MarshalJSON() ([]byte, error) { 11870 objectMap := make(map[string]interface{}) 11871 if vmssviv.PlatformUpdateDomain != nil { 11872 objectMap["platformUpdateDomain"] = vmssviv.PlatformUpdateDomain 11873 } 11874 if vmssviv.PlatformFaultDomain != nil { 11875 objectMap["platformFaultDomain"] = vmssviv.PlatformFaultDomain 11876 } 11877 if vmssviv.RdpThumbPrint != nil { 11878 objectMap["rdpThumbPrint"] = vmssviv.RdpThumbPrint 11879 } 11880 if vmssviv.VMAgent != nil { 11881 objectMap["vmAgent"] = vmssviv.VMAgent 11882 } 11883 if vmssviv.MaintenanceRedeployStatus != nil { 11884 objectMap["maintenanceRedeployStatus"] = vmssviv.MaintenanceRedeployStatus 11885 } 11886 if vmssviv.Disks != nil { 11887 objectMap["disks"] = vmssviv.Disks 11888 } 11889 if vmssviv.Extensions != nil { 11890 objectMap["extensions"] = vmssviv.Extensions 11891 } 11892 if vmssviv.BootDiagnostics != nil { 11893 objectMap["bootDiagnostics"] = vmssviv.BootDiagnostics 11894 } 11895 if vmssviv.Statuses != nil { 11896 objectMap["statuses"] = vmssviv.Statuses 11897 } 11898 if vmssviv.PlacementGroupID != nil { 11899 objectMap["placementGroupId"] = vmssviv.PlacementGroupID 11900 } 11901 return json.Marshal(objectMap) 11902} 11903 11904// VirtualMachineScaleSetVMListResult the List Virtual Machine Scale Set VMs operation response. 11905type VirtualMachineScaleSetVMListResult struct { 11906 autorest.Response `json:"-"` 11907 // Value - The list of virtual machine scale sets VMs. 11908 Value *[]VirtualMachineScaleSetVM `json:"value,omitempty"` 11909 // 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 11910 NextLink *string `json:"nextLink,omitempty"` 11911} 11912 11913// VirtualMachineScaleSetVMListResultIterator provides access to a complete listing of 11914// VirtualMachineScaleSetVM values. 11915type VirtualMachineScaleSetVMListResultIterator struct { 11916 i int 11917 page VirtualMachineScaleSetVMListResultPage 11918} 11919 11920// NextWithContext advances to the next value. If there was an error making 11921// the request the iterator does not advance and the error is returned. 11922func (iter *VirtualMachineScaleSetVMListResultIterator) NextWithContext(ctx context.Context) (err error) { 11923 if tracing.IsEnabled() { 11924 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMListResultIterator.NextWithContext") 11925 defer func() { 11926 sc := -1 11927 if iter.Response().Response.Response != nil { 11928 sc = iter.Response().Response.Response.StatusCode 11929 } 11930 tracing.EndSpan(ctx, sc, err) 11931 }() 11932 } 11933 iter.i++ 11934 if iter.i < len(iter.page.Values()) { 11935 return nil 11936 } 11937 err = iter.page.NextWithContext(ctx) 11938 if err != nil { 11939 iter.i-- 11940 return err 11941 } 11942 iter.i = 0 11943 return nil 11944} 11945 11946// Next advances to the next value. If there was an error making 11947// the request the iterator does not advance and the error is returned. 11948// Deprecated: Use NextWithContext() instead. 11949func (iter *VirtualMachineScaleSetVMListResultIterator) Next() error { 11950 return iter.NextWithContext(context.Background()) 11951} 11952 11953// NotDone returns true if the enumeration should be started or is not yet complete. 11954func (iter VirtualMachineScaleSetVMListResultIterator) NotDone() bool { 11955 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11956} 11957 11958// Response returns the raw server response from the last page request. 11959func (iter VirtualMachineScaleSetVMListResultIterator) Response() VirtualMachineScaleSetVMListResult { 11960 return iter.page.Response() 11961} 11962 11963// Value returns the current value or a zero-initialized value if the 11964// iterator has advanced beyond the end of the collection. 11965func (iter VirtualMachineScaleSetVMListResultIterator) Value() VirtualMachineScaleSetVM { 11966 if !iter.page.NotDone() { 11967 return VirtualMachineScaleSetVM{} 11968 } 11969 return iter.page.Values()[iter.i] 11970} 11971 11972// Creates a new instance of the VirtualMachineScaleSetVMListResultIterator type. 11973func NewVirtualMachineScaleSetVMListResultIterator(page VirtualMachineScaleSetVMListResultPage) VirtualMachineScaleSetVMListResultIterator { 11974 return VirtualMachineScaleSetVMListResultIterator{page: page} 11975} 11976 11977// IsEmpty returns true if the ListResult contains no values. 11978func (vmssvlr VirtualMachineScaleSetVMListResult) IsEmpty() bool { 11979 return vmssvlr.Value == nil || len(*vmssvlr.Value) == 0 11980} 11981 11982// hasNextLink returns true if the NextLink is not empty. 11983func (vmssvlr VirtualMachineScaleSetVMListResult) hasNextLink() bool { 11984 return vmssvlr.NextLink != nil && len(*vmssvlr.NextLink) != 0 11985} 11986 11987// virtualMachineScaleSetVMListResultPreparer prepares a request to retrieve the next set of results. 11988// It returns nil if no more results exist. 11989func (vmssvlr VirtualMachineScaleSetVMListResult) virtualMachineScaleSetVMListResultPreparer(ctx context.Context) (*http.Request, error) { 11990 if !vmssvlr.hasNextLink() { 11991 return nil, nil 11992 } 11993 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11994 autorest.AsJSON(), 11995 autorest.AsGet(), 11996 autorest.WithBaseURL(to.String(vmssvlr.NextLink))) 11997} 11998 11999// VirtualMachineScaleSetVMListResultPage contains a page of VirtualMachineScaleSetVM values. 12000type VirtualMachineScaleSetVMListResultPage struct { 12001 fn func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error) 12002 vmssvlr VirtualMachineScaleSetVMListResult 12003} 12004 12005// NextWithContext advances to the next page of values. If there was an error making 12006// the request the page does not advance and the error is returned. 12007func (page *VirtualMachineScaleSetVMListResultPage) NextWithContext(ctx context.Context) (err error) { 12008 if tracing.IsEnabled() { 12009 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMListResultPage.NextWithContext") 12010 defer func() { 12011 sc := -1 12012 if page.Response().Response.Response != nil { 12013 sc = page.Response().Response.Response.StatusCode 12014 } 12015 tracing.EndSpan(ctx, sc, err) 12016 }() 12017 } 12018 for { 12019 next, err := page.fn(ctx, page.vmssvlr) 12020 if err != nil { 12021 return err 12022 } 12023 page.vmssvlr = next 12024 if !next.hasNextLink() || !next.IsEmpty() { 12025 break 12026 } 12027 } 12028 return nil 12029} 12030 12031// Next advances to the next page of values. If there was an error making 12032// the request the page does not advance and the error is returned. 12033// Deprecated: Use NextWithContext() instead. 12034func (page *VirtualMachineScaleSetVMListResultPage) Next() error { 12035 return page.NextWithContext(context.Background()) 12036} 12037 12038// NotDone returns true if the page enumeration should be started or is not yet complete. 12039func (page VirtualMachineScaleSetVMListResultPage) NotDone() bool { 12040 return !page.vmssvlr.IsEmpty() 12041} 12042 12043// Response returns the raw server response from the last page request. 12044func (page VirtualMachineScaleSetVMListResultPage) Response() VirtualMachineScaleSetVMListResult { 12045 return page.vmssvlr 12046} 12047 12048// Values returns the slice of values for the current page or nil if there are no values. 12049func (page VirtualMachineScaleSetVMListResultPage) Values() []VirtualMachineScaleSetVM { 12050 if page.vmssvlr.IsEmpty() { 12051 return nil 12052 } 12053 return *page.vmssvlr.Value 12054} 12055 12056// Creates a new instance of the VirtualMachineScaleSetVMListResultPage type. 12057func NewVirtualMachineScaleSetVMListResultPage(cur VirtualMachineScaleSetVMListResult, getNextPage func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error)) VirtualMachineScaleSetVMListResultPage { 12058 return VirtualMachineScaleSetVMListResultPage{ 12059 fn: getNextPage, 12060 vmssvlr: cur, 12061 } 12062} 12063 12064// VirtualMachineScaleSetVMNetworkProfileConfiguration describes a virtual machine scale set VM network 12065// profile. 12066type VirtualMachineScaleSetVMNetworkProfileConfiguration struct { 12067 // NetworkInterfaceConfigurations - The list of network configurations. 12068 NetworkInterfaceConfigurations *[]VirtualMachineScaleSetNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` 12069} 12070 12071// VirtualMachineScaleSetVMProfile describes a virtual machine scale set virtual machine profile. 12072type VirtualMachineScaleSetVMProfile struct { 12073 // OsProfile - Specifies the operating system settings for the virtual machines in the scale set. 12074 OsProfile *VirtualMachineScaleSetOSProfile `json:"osProfile,omitempty"` 12075 // StorageProfile - Specifies the storage settings for the virtual machine disks. 12076 StorageProfile *VirtualMachineScaleSetStorageProfile `json:"storageProfile,omitempty"` 12077 // NetworkProfile - Specifies properties of the network interfaces of the virtual machines in the scale set. 12078 NetworkProfile *VirtualMachineScaleSetNetworkProfile `json:"networkProfile,omitempty"` 12079 // DiagnosticsProfile - Specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. 12080 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 12081 // ExtensionProfile - Specifies a collection of settings for extensions installed on virtual machines in the scale set. 12082 ExtensionProfile *VirtualMachineScaleSetExtensionProfile `json:"extensionProfile,omitempty"` 12083 // 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 12084 LicenseType *string `json:"licenseType,omitempty"` 12085 // 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' 12086 Priority VirtualMachinePriorityTypes `json:"priority,omitempty"` 12087 // EvictionPolicy - Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set. <br><br>For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01. <br><br>For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. Possible values include: 'Deallocate', 'Delete' 12088 EvictionPolicy VirtualMachineEvictionPolicyTypes `json:"evictionPolicy,omitempty"` 12089 // BillingProfile - Specifies the billing related details of a Azure Spot VMSS. <br><br>Minimum api-version: 2019-03-01. 12090 BillingProfile *BillingProfile `json:"billingProfile,omitempty"` 12091 // ScheduledEventsProfile - Specifies Scheduled Event related configurations. 12092 ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` 12093} 12094 12095// VirtualMachineScaleSetVMProperties describes the properties of a virtual machine scale set virtual 12096// machine. 12097type VirtualMachineScaleSetVMProperties struct { 12098 // LatestModelApplied - READ-ONLY; Specifies whether the latest model has been applied to the virtual machine. 12099 LatestModelApplied *bool `json:"latestModelApplied,omitempty"` 12100 // VMID - READ-ONLY; Azure VM unique ID. 12101 VMID *string `json:"vmId,omitempty"` 12102 // InstanceView - READ-ONLY; The virtual machine instance view. 12103 InstanceView *VirtualMachineScaleSetVMInstanceView `json:"instanceView,omitempty"` 12104 // HardwareProfile - Specifies the hardware settings for the virtual machine. 12105 HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` 12106 // StorageProfile - Specifies the storage settings for the virtual machine disks. 12107 StorageProfile *StorageProfile `json:"storageProfile,omitempty"` 12108 // 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. 12109 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 12110 // OsProfile - Specifies the operating system settings for the virtual machine. 12111 OsProfile *OSProfile `json:"osProfile,omitempty"` 12112 // NetworkProfile - Specifies the network interfaces of the virtual machine. 12113 NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` 12114 // NetworkProfileConfiguration - Specifies the network profile configuration of the virtual machine. 12115 NetworkProfileConfiguration *VirtualMachineScaleSetVMNetworkProfileConfiguration `json:"networkProfileConfiguration,omitempty"` 12116 // DiagnosticsProfile - Specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. 12117 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 12118 // 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. 12119 AvailabilitySet *SubResource `json:"availabilitySet,omitempty"` 12120 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 12121 ProvisioningState *string `json:"provisioningState,omitempty"` 12122 // 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 12123 LicenseType *string `json:"licenseType,omitempty"` 12124 // 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. 12125 ModelDefinitionApplied *string `json:"modelDefinitionApplied,omitempty"` 12126 // ProtectionPolicy - Specifies the protection policy of the virtual machine. 12127 ProtectionPolicy *VirtualMachineScaleSetVMProtectionPolicy `json:"protectionPolicy,omitempty"` 12128} 12129 12130// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMProperties. 12131func (vmssvp VirtualMachineScaleSetVMProperties) MarshalJSON() ([]byte, error) { 12132 objectMap := make(map[string]interface{}) 12133 if vmssvp.HardwareProfile != nil { 12134 objectMap["hardwareProfile"] = vmssvp.HardwareProfile 12135 } 12136 if vmssvp.StorageProfile != nil { 12137 objectMap["storageProfile"] = vmssvp.StorageProfile 12138 } 12139 if vmssvp.AdditionalCapabilities != nil { 12140 objectMap["additionalCapabilities"] = vmssvp.AdditionalCapabilities 12141 } 12142 if vmssvp.OsProfile != nil { 12143 objectMap["osProfile"] = vmssvp.OsProfile 12144 } 12145 if vmssvp.NetworkProfile != nil { 12146 objectMap["networkProfile"] = vmssvp.NetworkProfile 12147 } 12148 if vmssvp.NetworkProfileConfiguration != nil { 12149 objectMap["networkProfileConfiguration"] = vmssvp.NetworkProfileConfiguration 12150 } 12151 if vmssvp.DiagnosticsProfile != nil { 12152 objectMap["diagnosticsProfile"] = vmssvp.DiagnosticsProfile 12153 } 12154 if vmssvp.AvailabilitySet != nil { 12155 objectMap["availabilitySet"] = vmssvp.AvailabilitySet 12156 } 12157 if vmssvp.LicenseType != nil { 12158 objectMap["licenseType"] = vmssvp.LicenseType 12159 } 12160 if vmssvp.ProtectionPolicy != nil { 12161 objectMap["protectionPolicy"] = vmssvp.ProtectionPolicy 12162 } 12163 return json.Marshal(objectMap) 12164} 12165 12166// VirtualMachineScaleSetVMProtectionPolicy the protection policy of a virtual machine scale set VM. 12167type VirtualMachineScaleSetVMProtectionPolicy struct { 12168 // ProtectFromScaleIn - Indicates that the virtual machine scale set VM shouldn't be considered for deletion during a scale-in operation. 12169 ProtectFromScaleIn *bool `json:"protectFromScaleIn,omitempty"` 12170 // 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. 12171 ProtectFromScaleSetActions *bool `json:"protectFromScaleSetActions,omitempty"` 12172} 12173 12174// VirtualMachineScaleSetVMReimageParameters describes a Virtual Machine Scale Set VM Reimage Parameters. 12175type VirtualMachineScaleSetVMReimageParameters struct { 12176 // 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. 12177 TempDisk *bool `json:"tempDisk,omitempty"` 12178} 12179 12180// VirtualMachineScaleSetVMsDeallocateFuture an abstraction for monitoring and retrieving the results of a 12181// long-running operation. 12182type VirtualMachineScaleSetVMsDeallocateFuture struct { 12183 azure.FutureAPI 12184 // Result returns the result of the asynchronous operation. 12185 // If the operation has not completed it will return an error. 12186 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 12187} 12188 12189// VirtualMachineScaleSetVMsDeleteFuture an abstraction for monitoring and retrieving the results of a 12190// long-running operation. 12191type VirtualMachineScaleSetVMsDeleteFuture struct { 12192 azure.FutureAPI 12193 // Result returns the result of the asynchronous operation. 12194 // If the operation has not completed it will return an error. 12195 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 12196} 12197 12198// VirtualMachineScaleSetVMsPerformMaintenanceFuture an abstraction for monitoring and retrieving the 12199// results of a long-running operation. 12200type VirtualMachineScaleSetVMsPerformMaintenanceFuture struct { 12201 azure.FutureAPI 12202 // Result returns the result of the asynchronous operation. 12203 // If the operation has not completed it will return an error. 12204 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 12205} 12206 12207// VirtualMachineScaleSetVMsPowerOffFuture an abstraction for monitoring and retrieving the results of a 12208// long-running operation. 12209type VirtualMachineScaleSetVMsPowerOffFuture struct { 12210 azure.FutureAPI 12211 // Result returns the result of the asynchronous operation. 12212 // If the operation has not completed it will return an error. 12213 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 12214} 12215 12216// VirtualMachineScaleSetVMsRedeployFuture an abstraction for monitoring and retrieving the results of a 12217// long-running operation. 12218type VirtualMachineScaleSetVMsRedeployFuture struct { 12219 azure.FutureAPI 12220 // Result returns the result of the asynchronous operation. 12221 // If the operation has not completed it will return an error. 12222 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 12223} 12224 12225// VirtualMachineScaleSetVMsReimageAllFuture an abstraction for monitoring and retrieving the results of a 12226// long-running operation. 12227type VirtualMachineScaleSetVMsReimageAllFuture struct { 12228 azure.FutureAPI 12229 // Result returns the result of the asynchronous operation. 12230 // If the operation has not completed it will return an error. 12231 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 12232} 12233 12234// VirtualMachineScaleSetVMsReimageFuture an abstraction for monitoring and retrieving the results of a 12235// long-running operation. 12236type VirtualMachineScaleSetVMsReimageFuture struct { 12237 azure.FutureAPI 12238 // Result returns the result of the asynchronous operation. 12239 // If the operation has not completed it will return an error. 12240 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 12241} 12242 12243// VirtualMachineScaleSetVMsRestartFuture an abstraction for monitoring and retrieving the results of a 12244// long-running operation. 12245type VirtualMachineScaleSetVMsRestartFuture struct { 12246 azure.FutureAPI 12247 // Result returns the result of the asynchronous operation. 12248 // If the operation has not completed it will return an error. 12249 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 12250} 12251 12252// VirtualMachineScaleSetVMsRunCommandFuture an abstraction for monitoring and retrieving the results of a 12253// long-running operation. 12254type VirtualMachineScaleSetVMsRunCommandFuture struct { 12255 azure.FutureAPI 12256 // Result returns the result of the asynchronous operation. 12257 // If the operation has not completed it will return an error. 12258 Result func(VirtualMachineScaleSetVMsClient) (RunCommandResult, error) 12259} 12260 12261// VirtualMachineScaleSetVMsStartFuture an abstraction for monitoring and retrieving the results of a 12262// long-running operation. 12263type VirtualMachineScaleSetVMsStartFuture struct { 12264 azure.FutureAPI 12265 // Result returns the result of the asynchronous operation. 12266 // If the operation has not completed it will return an error. 12267 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 12268} 12269 12270// VirtualMachineScaleSetVMsUpdateFuture an abstraction for monitoring and retrieving the results of a 12271// long-running operation. 12272type VirtualMachineScaleSetVMsUpdateFuture struct { 12273 azure.FutureAPI 12274 // Result returns the result of the asynchronous operation. 12275 // If the operation has not completed it will return an error. 12276 Result func(VirtualMachineScaleSetVMsClient) (VirtualMachineScaleSetVM, error) 12277} 12278 12279// VirtualMachinesCaptureFuture an abstraction for monitoring and retrieving the results of a long-running 12280// operation. 12281type VirtualMachinesCaptureFuture struct { 12282 azure.FutureAPI 12283 // Result returns the result of the asynchronous operation. 12284 // If the operation has not completed it will return an error. 12285 Result func(VirtualMachinesClient) (VirtualMachineCaptureResult, error) 12286} 12287 12288// VirtualMachinesConvertToManagedDisksFuture an abstraction for monitoring and retrieving the results of a 12289// long-running operation. 12290type VirtualMachinesConvertToManagedDisksFuture struct { 12291 azure.FutureAPI 12292 // Result returns the result of the asynchronous operation. 12293 // If the operation has not completed it will return an error. 12294 Result func(VirtualMachinesClient) (autorest.Response, error) 12295} 12296 12297// VirtualMachinesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 12298// long-running operation. 12299type VirtualMachinesCreateOrUpdateFuture struct { 12300 azure.FutureAPI 12301 // Result returns the result of the asynchronous operation. 12302 // If the operation has not completed it will return an error. 12303 Result func(VirtualMachinesClient) (VirtualMachine, error) 12304} 12305 12306// VirtualMachinesDeallocateFuture an abstraction for monitoring and retrieving the results of a 12307// long-running operation. 12308type VirtualMachinesDeallocateFuture struct { 12309 azure.FutureAPI 12310 // Result returns the result of the asynchronous operation. 12311 // If the operation has not completed it will return an error. 12312 Result func(VirtualMachinesClient) (autorest.Response, error) 12313} 12314 12315// VirtualMachinesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 12316// operation. 12317type VirtualMachinesDeleteFuture struct { 12318 azure.FutureAPI 12319 // Result returns the result of the asynchronous operation. 12320 // If the operation has not completed it will return an error. 12321 Result func(VirtualMachinesClient) (autorest.Response, error) 12322} 12323 12324// VirtualMachineSize describes the properties of a VM size. 12325type VirtualMachineSize struct { 12326 // Name - The name of the virtual machine size. 12327 Name *string `json:"name,omitempty"` 12328 // NumberOfCores - The number of cores supported by the virtual machine size. 12329 NumberOfCores *int32 `json:"numberOfCores,omitempty"` 12330 // OsDiskSizeInMB - The OS disk size, in MB, allowed by the virtual machine size. 12331 OsDiskSizeInMB *int32 `json:"osDiskSizeInMB,omitempty"` 12332 // ResourceDiskSizeInMB - The resource disk size, in MB, allowed by the virtual machine size. 12333 ResourceDiskSizeInMB *int32 `json:"resourceDiskSizeInMB,omitempty"` 12334 // MemoryInMB - The amount of memory, in MB, supported by the virtual machine size. 12335 MemoryInMB *int32 `json:"memoryInMB,omitempty"` 12336 // MaxDataDiskCount - The maximum number of data disks that can be attached to the virtual machine size. 12337 MaxDataDiskCount *int32 `json:"maxDataDiskCount,omitempty"` 12338} 12339 12340// VirtualMachineSizeListResult the List Virtual Machine operation response. 12341type VirtualMachineSizeListResult struct { 12342 autorest.Response `json:"-"` 12343 // Value - The list of virtual machine sizes. 12344 Value *[]VirtualMachineSize `json:"value,omitempty"` 12345} 12346 12347// VirtualMachinesPerformMaintenanceFuture an abstraction for monitoring and retrieving the results of a 12348// long-running operation. 12349type VirtualMachinesPerformMaintenanceFuture struct { 12350 azure.FutureAPI 12351 // Result returns the result of the asynchronous operation. 12352 // If the operation has not completed it will return an error. 12353 Result func(VirtualMachinesClient) (autorest.Response, error) 12354} 12355 12356// VirtualMachinesPowerOffFuture an abstraction for monitoring and retrieving the results of a long-running 12357// operation. 12358type VirtualMachinesPowerOffFuture struct { 12359 azure.FutureAPI 12360 // Result returns the result of the asynchronous operation. 12361 // If the operation has not completed it will return an error. 12362 Result func(VirtualMachinesClient) (autorest.Response, error) 12363} 12364 12365// VirtualMachinesReapplyFuture an abstraction for monitoring and retrieving the results of a long-running 12366// operation. 12367type VirtualMachinesReapplyFuture struct { 12368 azure.FutureAPI 12369 // Result returns the result of the asynchronous operation. 12370 // If the operation has not completed it will return an error. 12371 Result func(VirtualMachinesClient) (autorest.Response, error) 12372} 12373 12374// VirtualMachinesRedeployFuture an abstraction for monitoring and retrieving the results of a long-running 12375// operation. 12376type VirtualMachinesRedeployFuture struct { 12377 azure.FutureAPI 12378 // Result returns the result of the asynchronous operation. 12379 // If the operation has not completed it will return an error. 12380 Result func(VirtualMachinesClient) (autorest.Response, error) 12381} 12382 12383// VirtualMachinesReimageFuture an abstraction for monitoring and retrieving the results of a long-running 12384// operation. 12385type VirtualMachinesReimageFuture struct { 12386 azure.FutureAPI 12387 // Result returns the result of the asynchronous operation. 12388 // If the operation has not completed it will return an error. 12389 Result func(VirtualMachinesClient) (autorest.Response, error) 12390} 12391 12392// VirtualMachinesRestartFuture an abstraction for monitoring and retrieving the results of a long-running 12393// operation. 12394type VirtualMachinesRestartFuture struct { 12395 azure.FutureAPI 12396 // Result returns the result of the asynchronous operation. 12397 // If the operation has not completed it will return an error. 12398 Result func(VirtualMachinesClient) (autorest.Response, error) 12399} 12400 12401// VirtualMachinesRunCommandFuture an abstraction for monitoring and retrieving the results of a 12402// long-running operation. 12403type VirtualMachinesRunCommandFuture struct { 12404 azure.FutureAPI 12405 // Result returns the result of the asynchronous operation. 12406 // If the operation has not completed it will return an error. 12407 Result func(VirtualMachinesClient) (RunCommandResult, error) 12408} 12409 12410// VirtualMachinesStartFuture an abstraction for monitoring and retrieving the results of a long-running 12411// operation. 12412type VirtualMachinesStartFuture struct { 12413 azure.FutureAPI 12414 // Result returns the result of the asynchronous operation. 12415 // If the operation has not completed it will return an error. 12416 Result func(VirtualMachinesClient) (autorest.Response, error) 12417} 12418 12419// VirtualMachineStatusCodeCount the status code and count of the virtual machine scale set instance view 12420// status summary. 12421type VirtualMachineStatusCodeCount struct { 12422 // Code - READ-ONLY; The instance view status code. 12423 Code *string `json:"code,omitempty"` 12424 // Count - READ-ONLY; The number of instances having a particular status code. 12425 Count *int32 `json:"count,omitempty"` 12426} 12427 12428// VirtualMachinesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 12429// operation. 12430type VirtualMachinesUpdateFuture struct { 12431 azure.FutureAPI 12432 // Result returns the result of the asynchronous operation. 12433 // If the operation has not completed it will return an error. 12434 Result func(VirtualMachinesClient) (VirtualMachine, error) 12435} 12436 12437// VirtualMachineUpdate describes a Virtual Machine Update. 12438type VirtualMachineUpdate struct { 12439 // 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**. 12440 Plan *Plan `json:"plan,omitempty"` 12441 *VirtualMachineProperties `json:"properties,omitempty"` 12442 // Identity - The identity of the virtual machine, if configured. 12443 Identity *VirtualMachineIdentity `json:"identity,omitempty"` 12444 // Zones - The virtual machine zones. 12445 Zones *[]string `json:"zones,omitempty"` 12446 // Tags - Resource tags 12447 Tags map[string]*string `json:"tags"` 12448} 12449 12450// MarshalJSON is the custom marshaler for VirtualMachineUpdate. 12451func (vmu VirtualMachineUpdate) MarshalJSON() ([]byte, error) { 12452 objectMap := make(map[string]interface{}) 12453 if vmu.Plan != nil { 12454 objectMap["plan"] = vmu.Plan 12455 } 12456 if vmu.VirtualMachineProperties != nil { 12457 objectMap["properties"] = vmu.VirtualMachineProperties 12458 } 12459 if vmu.Identity != nil { 12460 objectMap["identity"] = vmu.Identity 12461 } 12462 if vmu.Zones != nil { 12463 objectMap["zones"] = vmu.Zones 12464 } 12465 if vmu.Tags != nil { 12466 objectMap["tags"] = vmu.Tags 12467 } 12468 return json.Marshal(objectMap) 12469} 12470 12471// UnmarshalJSON is the custom unmarshaler for VirtualMachineUpdate struct. 12472func (vmu *VirtualMachineUpdate) UnmarshalJSON(body []byte) error { 12473 var m map[string]*json.RawMessage 12474 err := json.Unmarshal(body, &m) 12475 if err != nil { 12476 return err 12477 } 12478 for k, v := range m { 12479 switch k { 12480 case "plan": 12481 if v != nil { 12482 var plan Plan 12483 err = json.Unmarshal(*v, &plan) 12484 if err != nil { 12485 return err 12486 } 12487 vmu.Plan = &plan 12488 } 12489 case "properties": 12490 if v != nil { 12491 var virtualMachineProperties VirtualMachineProperties 12492 err = json.Unmarshal(*v, &virtualMachineProperties) 12493 if err != nil { 12494 return err 12495 } 12496 vmu.VirtualMachineProperties = &virtualMachineProperties 12497 } 12498 case "identity": 12499 if v != nil { 12500 var identity VirtualMachineIdentity 12501 err = json.Unmarshal(*v, &identity) 12502 if err != nil { 12503 return err 12504 } 12505 vmu.Identity = &identity 12506 } 12507 case "zones": 12508 if v != nil { 12509 var zones []string 12510 err = json.Unmarshal(*v, &zones) 12511 if err != nil { 12512 return err 12513 } 12514 vmu.Zones = &zones 12515 } 12516 case "tags": 12517 if v != nil { 12518 var tags map[string]*string 12519 err = json.Unmarshal(*v, &tags) 12520 if err != nil { 12521 return err 12522 } 12523 vmu.Tags = tags 12524 } 12525 } 12526 } 12527 12528 return nil 12529} 12530 12531// VMScaleSetConvertToSinglePlacementGroupInput ... 12532type VMScaleSetConvertToSinglePlacementGroupInput struct { 12533 // 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. 12534 ActivePlacementGroupID *string `json:"activePlacementGroupId,omitempty"` 12535} 12536 12537// WindowsConfiguration specifies Windows operating system settings on the virtual machine. 12538type WindowsConfiguration struct { 12539 // 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. 12540 ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` 12541 // 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. 12542 EnableAutomaticUpdates *bool `json:"enableAutomaticUpdates,omitempty"` 12543 // 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). 12544 TimeZone *string `json:"timeZone,omitempty"` 12545 // AdditionalUnattendContent - Specifies additional base-64 encoded XML formatted information that can be included in the Unattend.xml file, which is used by Windows Setup. 12546 AdditionalUnattendContent *[]AdditionalUnattendContent `json:"additionalUnattendContent,omitempty"` 12547 // WinRM - Specifies the Windows Remote Management listeners. This enables remote Windows PowerShell. 12548 WinRM *WinRMConfiguration `json:"winRM,omitempty"` 12549} 12550 12551// WinRMConfiguration describes Windows Remote Management configuration of the VM 12552type WinRMConfiguration struct { 12553 // Listeners - The list of Windows Remote Management listeners 12554 Listeners *[]WinRMListener `json:"listeners,omitempty"` 12555} 12556 12557// WinRMListener describes Protocol and thumbprint of Windows Remote Management listener 12558type WinRMListener struct { 12559 // Protocol - Specifies the protocol of WinRM listener. <br><br> Possible values are: <br>**http** <br><br> **https**. Possible values include: 'HTTP', 'HTTPS' 12560 Protocol ProtocolTypes `json:"protocol,omitempty"` 12561 // 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>} 12562 CertificateURL *string `json:"certificateUrl,omitempty"` 12563} 12564