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/2020-06-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// AvailablePatchSummary describes the properties of an virtual machine instance view for available patch 497// summary. 498type AvailablePatchSummary struct { 499 // Status - READ-ONLY; The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Failed", "Succeeded", or "CompletedWithWarnings.". Possible values include: 'PatchOperationStatusInProgress', 'PatchOperationStatusFailed', 'PatchOperationStatusSucceeded', 'PatchOperationStatusCompletedWithWarnings' 500 Status PatchOperationStatus `json:"status,omitempty"` 501 // AssessmentActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. 502 AssessmentActivityID *string `json:"assessmentActivityId,omitempty"` 503 // RebootPending - READ-ONLY; The overall reboot status of the VM. It will be true when partially installed patches require a reboot to complete installation but the reboot has not yet occurred. 504 RebootPending *bool `json:"rebootPending,omitempty"` 505 // CriticalAndSecurityPatchCount - READ-ONLY; The number of critical or security patches that have been detected as available and not yet installed. 506 CriticalAndSecurityPatchCount *int32 `json:"criticalAndSecurityPatchCount,omitempty"` 507 // OtherPatchCount - READ-ONLY; The number of all available patches excluding critical and security. 508 OtherPatchCount *int32 `json:"otherPatchCount,omitempty"` 509 // StartTime - READ-ONLY; The UTC timestamp when the operation began. 510 StartTime *date.Time `json:"startTime,omitempty"` 511 // LastModifiedTime - READ-ONLY; The UTC timestamp when the operation began. 512 LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` 513 // Error - READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. 514 Error *APIError `json:"error,omitempty"` 515} 516 517// BillingProfile specifies the billing related details of a Azure Spot VM or VMSS. <br><br>Minimum 518// api-version: 2019-03-01. 519type BillingProfile struct { 520 // MaxPrice - Specifies the maximum price you are willing to pay for a Azure Spot VM/VMSS. This price is in US Dollars. <br><br> This price will be compared with the current Azure Spot price for the VM size. Also, the prices are compared at the time of create/update of Azure Spot VM/VMSS and the operation will only succeed if the maxPrice is greater than the current Azure Spot price. <br><br> The maxPrice will also be used for evicting a Azure Spot VM/VMSS if the current Azure Spot price goes beyond the maxPrice after creation of VM/VMSS. <br><br> Possible values are: <br><br> - Any decimal value greater than zero. Example: 0.01538 <br><br> -1 – indicates default price to be up-to on-demand. <br><br> You can set the maxPrice to -1 to indicate that the Azure Spot VM/VMSS should not be evicted for price reasons. Also, the default max price is -1 if it is not provided by you. <br><br>Minimum api-version: 2019-03-01. 521 MaxPrice *float64 `json:"maxPrice,omitempty"` 522} 523 524// BootDiagnostics boot Diagnostics is a debugging feature which allows you to view Console Output and 525// Screenshot to diagnose VM status. <br><br> You can easily view the output of your console log. <br><br> 526// Azure also enables you to see a screenshot of the VM from the hypervisor. 527type BootDiagnostics struct { 528 // Enabled - Whether boot diagnostics should be enabled on the Virtual Machine. 529 Enabled *bool `json:"enabled,omitempty"` 530 // StorageURI - Uri of the storage account to use for placing the console output and screenshot. <br><br>If storageUri is not specified while enabling boot diagnostics, managed storage will be used. 531 StorageURI *string `json:"storageUri,omitempty"` 532} 533 534// BootDiagnosticsInstanceView the instance view of a virtual machine boot diagnostics. 535type BootDiagnosticsInstanceView struct { 536 // ConsoleScreenshotBlobURI - READ-ONLY; The console screenshot blob URI. <br><br>NOTE: This will **not** be set if boot diagnostics is currently enabled with managed storage. 537 ConsoleScreenshotBlobURI *string `json:"consoleScreenshotBlobUri,omitempty"` 538 // SerialConsoleLogBlobURI - READ-ONLY; The serial console log blob Uri. <br><br>NOTE: This will **not** be set if boot diagnostics is currently enabled with managed storage. 539 SerialConsoleLogBlobURI *string `json:"serialConsoleLogBlobUri,omitempty"` 540 // Status - READ-ONLY; The boot diagnostics status information for the VM. <br><br> NOTE: It will be set only if there are errors encountered in enabling boot diagnostics. 541 Status *InstanceViewStatus `json:"status,omitempty"` 542} 543 544// CloudError an error response from the Compute service. 545type CloudError struct { 546 Error *APIError `json:"error,omitempty"` 547} 548 549// ContainerService container service. 550type ContainerService struct { 551 autorest.Response `json:"-"` 552 *ContainerServiceProperties `json:"properties,omitempty"` 553 // ID - READ-ONLY; Resource Id 554 ID *string `json:"id,omitempty"` 555 // Name - READ-ONLY; Resource name 556 Name *string `json:"name,omitempty"` 557 // Type - READ-ONLY; Resource type 558 Type *string `json:"type,omitempty"` 559 // Location - Resource location 560 Location *string `json:"location,omitempty"` 561 // Tags - Resource tags 562 Tags map[string]*string `json:"tags"` 563} 564 565// MarshalJSON is the custom marshaler for ContainerService. 566func (cs ContainerService) MarshalJSON() ([]byte, error) { 567 objectMap := make(map[string]interface{}) 568 if cs.ContainerServiceProperties != nil { 569 objectMap["properties"] = cs.ContainerServiceProperties 570 } 571 if cs.Location != nil { 572 objectMap["location"] = cs.Location 573 } 574 if cs.Tags != nil { 575 objectMap["tags"] = cs.Tags 576 } 577 return json.Marshal(objectMap) 578} 579 580// UnmarshalJSON is the custom unmarshaler for ContainerService struct. 581func (cs *ContainerService) UnmarshalJSON(body []byte) error { 582 var m map[string]*json.RawMessage 583 err := json.Unmarshal(body, &m) 584 if err != nil { 585 return err 586 } 587 for k, v := range m { 588 switch k { 589 case "properties": 590 if v != nil { 591 var containerServiceProperties ContainerServiceProperties 592 err = json.Unmarshal(*v, &containerServiceProperties) 593 if err != nil { 594 return err 595 } 596 cs.ContainerServiceProperties = &containerServiceProperties 597 } 598 case "id": 599 if v != nil { 600 var ID string 601 err = json.Unmarshal(*v, &ID) 602 if err != nil { 603 return err 604 } 605 cs.ID = &ID 606 } 607 case "name": 608 if v != nil { 609 var name string 610 err = json.Unmarshal(*v, &name) 611 if err != nil { 612 return err 613 } 614 cs.Name = &name 615 } 616 case "type": 617 if v != nil { 618 var typeVar string 619 err = json.Unmarshal(*v, &typeVar) 620 if err != nil { 621 return err 622 } 623 cs.Type = &typeVar 624 } 625 case "location": 626 if v != nil { 627 var location string 628 err = json.Unmarshal(*v, &location) 629 if err != nil { 630 return err 631 } 632 cs.Location = &location 633 } 634 case "tags": 635 if v != nil { 636 var tags map[string]*string 637 err = json.Unmarshal(*v, &tags) 638 if err != nil { 639 return err 640 } 641 cs.Tags = tags 642 } 643 } 644 } 645 646 return nil 647} 648 649// ContainerServiceAgentPoolProfile profile for the container service agent pool. 650type ContainerServiceAgentPoolProfile struct { 651 // Name - Unique name of the agent pool profile in the context of the subscription and resource group. 652 Name *string `json:"name,omitempty"` 653 // 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. 654 Count *int32 `json:"count,omitempty"` 655 // 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' 656 VMSize ContainerServiceVMSizeTypes `json:"vmSize,omitempty"` 657 // DNSPrefix - DNS prefix to be used to create the FQDN for the agent pool. 658 DNSPrefix *string `json:"dnsPrefix,omitempty"` 659 // Fqdn - READ-ONLY; FQDN for the agent pool. 660 Fqdn *string `json:"fqdn,omitempty"` 661} 662 663// MarshalJSON is the custom marshaler for ContainerServiceAgentPoolProfile. 664func (csapp ContainerServiceAgentPoolProfile) MarshalJSON() ([]byte, error) { 665 objectMap := make(map[string]interface{}) 666 if csapp.Name != nil { 667 objectMap["name"] = csapp.Name 668 } 669 if csapp.Count != nil { 670 objectMap["count"] = csapp.Count 671 } 672 if csapp.VMSize != "" { 673 objectMap["vmSize"] = csapp.VMSize 674 } 675 if csapp.DNSPrefix != nil { 676 objectMap["dnsPrefix"] = csapp.DNSPrefix 677 } 678 return json.Marshal(objectMap) 679} 680 681// ContainerServiceCustomProfile properties to configure a custom container service cluster. 682type ContainerServiceCustomProfile struct { 683 // Orchestrator - The name of the custom orchestrator to use. 684 Orchestrator *string `json:"orchestrator,omitempty"` 685} 686 687// ContainerServiceDiagnosticsProfile ... 688type ContainerServiceDiagnosticsProfile struct { 689 // VMDiagnostics - Profile for the container service VM diagnostic agent. 690 VMDiagnostics *ContainerServiceVMDiagnostics `json:"vmDiagnostics,omitempty"` 691} 692 693// ContainerServiceLinuxProfile profile for Linux VMs in the container service cluster. 694type ContainerServiceLinuxProfile struct { 695 // AdminUsername - The administrator username to use for Linux VMs. 696 AdminUsername *string `json:"adminUsername,omitempty"` 697 // SSH - The ssh key configuration for Linux VMs. 698 SSH *ContainerServiceSSHConfiguration `json:"ssh,omitempty"` 699} 700 701// ContainerServiceListResult the response from the List Container Services operation. 702type ContainerServiceListResult struct { 703 autorest.Response `json:"-"` 704 // Value - the list of container services. 705 Value *[]ContainerService `json:"value,omitempty"` 706 // NextLink - The URL to get the next set of container service results. 707 NextLink *string `json:"nextLink,omitempty"` 708} 709 710// ContainerServiceListResultIterator provides access to a complete listing of ContainerService values. 711type ContainerServiceListResultIterator struct { 712 i int 713 page ContainerServiceListResultPage 714} 715 716// NextWithContext advances to the next value. If there was an error making 717// the request the iterator does not advance and the error is returned. 718func (iter *ContainerServiceListResultIterator) NextWithContext(ctx context.Context) (err error) { 719 if tracing.IsEnabled() { 720 ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServiceListResultIterator.NextWithContext") 721 defer func() { 722 sc := -1 723 if iter.Response().Response.Response != nil { 724 sc = iter.Response().Response.Response.StatusCode 725 } 726 tracing.EndSpan(ctx, sc, err) 727 }() 728 } 729 iter.i++ 730 if iter.i < len(iter.page.Values()) { 731 return nil 732 } 733 err = iter.page.NextWithContext(ctx) 734 if err != nil { 735 iter.i-- 736 return err 737 } 738 iter.i = 0 739 return nil 740} 741 742// Next advances to the next value. If there was an error making 743// the request the iterator does not advance and the error is returned. 744// Deprecated: Use NextWithContext() instead. 745func (iter *ContainerServiceListResultIterator) Next() error { 746 return iter.NextWithContext(context.Background()) 747} 748 749// NotDone returns true if the enumeration should be started or is not yet complete. 750func (iter ContainerServiceListResultIterator) NotDone() bool { 751 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 752} 753 754// Response returns the raw server response from the last page request. 755func (iter ContainerServiceListResultIterator) Response() ContainerServiceListResult { 756 return iter.page.Response() 757} 758 759// Value returns the current value or a zero-initialized value if the 760// iterator has advanced beyond the end of the collection. 761func (iter ContainerServiceListResultIterator) Value() ContainerService { 762 if !iter.page.NotDone() { 763 return ContainerService{} 764 } 765 return iter.page.Values()[iter.i] 766} 767 768// Creates a new instance of the ContainerServiceListResultIterator type. 769func NewContainerServiceListResultIterator(page ContainerServiceListResultPage) ContainerServiceListResultIterator { 770 return ContainerServiceListResultIterator{page: page} 771} 772 773// IsEmpty returns true if the ListResult contains no values. 774func (cslr ContainerServiceListResult) IsEmpty() bool { 775 return cslr.Value == nil || len(*cslr.Value) == 0 776} 777 778// hasNextLink returns true if the NextLink is not empty. 779func (cslr ContainerServiceListResult) hasNextLink() bool { 780 return cslr.NextLink != nil && len(*cslr.NextLink) != 0 781} 782 783// containerServiceListResultPreparer prepares a request to retrieve the next set of results. 784// It returns nil if no more results exist. 785func (cslr ContainerServiceListResult) containerServiceListResultPreparer(ctx context.Context) (*http.Request, error) { 786 if !cslr.hasNextLink() { 787 return nil, nil 788 } 789 return autorest.Prepare((&http.Request{}).WithContext(ctx), 790 autorest.AsJSON(), 791 autorest.AsGet(), 792 autorest.WithBaseURL(to.String(cslr.NextLink))) 793} 794 795// ContainerServiceListResultPage contains a page of ContainerService values. 796type ContainerServiceListResultPage struct { 797 fn func(context.Context, ContainerServiceListResult) (ContainerServiceListResult, error) 798 cslr ContainerServiceListResult 799} 800 801// NextWithContext advances to the next page of values. If there was an error making 802// the request the page does not advance and the error is returned. 803func (page *ContainerServiceListResultPage) NextWithContext(ctx context.Context) (err error) { 804 if tracing.IsEnabled() { 805 ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServiceListResultPage.NextWithContext") 806 defer func() { 807 sc := -1 808 if page.Response().Response.Response != nil { 809 sc = page.Response().Response.Response.StatusCode 810 } 811 tracing.EndSpan(ctx, sc, err) 812 }() 813 } 814 for { 815 next, err := page.fn(ctx, page.cslr) 816 if err != nil { 817 return err 818 } 819 page.cslr = next 820 if !next.hasNextLink() || !next.IsEmpty() { 821 break 822 } 823 } 824 return nil 825} 826 827// Next advances to the next page of values. If there was an error making 828// the request the page does not advance and the error is returned. 829// Deprecated: Use NextWithContext() instead. 830func (page *ContainerServiceListResultPage) Next() error { 831 return page.NextWithContext(context.Background()) 832} 833 834// NotDone returns true if the page enumeration should be started or is not yet complete. 835func (page ContainerServiceListResultPage) NotDone() bool { 836 return !page.cslr.IsEmpty() 837} 838 839// Response returns the raw server response from the last page request. 840func (page ContainerServiceListResultPage) Response() ContainerServiceListResult { 841 return page.cslr 842} 843 844// Values returns the slice of values for the current page or nil if there are no values. 845func (page ContainerServiceListResultPage) Values() []ContainerService { 846 if page.cslr.IsEmpty() { 847 return nil 848 } 849 return *page.cslr.Value 850} 851 852// Creates a new instance of the ContainerServiceListResultPage type. 853func NewContainerServiceListResultPage(cur ContainerServiceListResult, getNextPage func(context.Context, ContainerServiceListResult) (ContainerServiceListResult, error)) ContainerServiceListResultPage { 854 return ContainerServiceListResultPage{ 855 fn: getNextPage, 856 cslr: cur, 857 } 858} 859 860// ContainerServiceMasterProfile profile for the container service master. 861type ContainerServiceMasterProfile struct { 862 // Count - Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. 863 Count *int32 `json:"count,omitempty"` 864 // DNSPrefix - DNS prefix to be used to create the FQDN for master. 865 DNSPrefix *string `json:"dnsPrefix,omitempty"` 866 // Fqdn - READ-ONLY; FQDN for the master. 867 Fqdn *string `json:"fqdn,omitempty"` 868} 869 870// MarshalJSON is the custom marshaler for ContainerServiceMasterProfile. 871func (csmp ContainerServiceMasterProfile) MarshalJSON() ([]byte, error) { 872 objectMap := make(map[string]interface{}) 873 if csmp.Count != nil { 874 objectMap["count"] = csmp.Count 875 } 876 if csmp.DNSPrefix != nil { 877 objectMap["dnsPrefix"] = csmp.DNSPrefix 878 } 879 return json.Marshal(objectMap) 880} 881 882// ContainerServiceOrchestratorProfile profile for the container service orchestrator. 883type ContainerServiceOrchestratorProfile struct { 884 // 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' 885 OrchestratorType ContainerServiceOrchestratorTypes `json:"orchestratorType,omitempty"` 886} 887 888// ContainerServiceProperties properties of the container service. 889type ContainerServiceProperties struct { 890 // ProvisioningState - READ-ONLY; the current deployment or provisioning state, which only appears in the response. 891 ProvisioningState *string `json:"provisioningState,omitempty"` 892 // OrchestratorProfile - Properties of the orchestrator. 893 OrchestratorProfile *ContainerServiceOrchestratorProfile `json:"orchestratorProfile,omitempty"` 894 // CustomProfile - Properties for custom clusters. 895 CustomProfile *ContainerServiceCustomProfile `json:"customProfile,omitempty"` 896 // ServicePrincipalProfile - Properties for cluster service principals. 897 ServicePrincipalProfile *ContainerServiceServicePrincipalProfile `json:"servicePrincipalProfile,omitempty"` 898 // MasterProfile - Properties of master agents. 899 MasterProfile *ContainerServiceMasterProfile `json:"masterProfile,omitempty"` 900 // AgentPoolProfiles - Properties of the agent pool. 901 AgentPoolProfiles *[]ContainerServiceAgentPoolProfile `json:"agentPoolProfiles,omitempty"` 902 // WindowsProfile - Properties of Windows VMs. 903 WindowsProfile *ContainerServiceWindowsProfile `json:"windowsProfile,omitempty"` 904 // LinuxProfile - Properties of Linux VMs. 905 LinuxProfile *ContainerServiceLinuxProfile `json:"linuxProfile,omitempty"` 906 // DiagnosticsProfile - Properties of the diagnostic agent. 907 DiagnosticsProfile *ContainerServiceDiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 908} 909 910// MarshalJSON is the custom marshaler for ContainerServiceProperties. 911func (csp ContainerServiceProperties) MarshalJSON() ([]byte, error) { 912 objectMap := make(map[string]interface{}) 913 if csp.OrchestratorProfile != nil { 914 objectMap["orchestratorProfile"] = csp.OrchestratorProfile 915 } 916 if csp.CustomProfile != nil { 917 objectMap["customProfile"] = csp.CustomProfile 918 } 919 if csp.ServicePrincipalProfile != nil { 920 objectMap["servicePrincipalProfile"] = csp.ServicePrincipalProfile 921 } 922 if csp.MasterProfile != nil { 923 objectMap["masterProfile"] = csp.MasterProfile 924 } 925 if csp.AgentPoolProfiles != nil { 926 objectMap["agentPoolProfiles"] = csp.AgentPoolProfiles 927 } 928 if csp.WindowsProfile != nil { 929 objectMap["windowsProfile"] = csp.WindowsProfile 930 } 931 if csp.LinuxProfile != nil { 932 objectMap["linuxProfile"] = csp.LinuxProfile 933 } 934 if csp.DiagnosticsProfile != nil { 935 objectMap["diagnosticsProfile"] = csp.DiagnosticsProfile 936 } 937 return json.Marshal(objectMap) 938} 939 940// ContainerServicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 941// long-running operation. 942type ContainerServicesCreateOrUpdateFuture struct { 943 azure.FutureAPI 944 // Result returns the result of the asynchronous operation. 945 // If the operation has not completed it will return an error. 946 Result func(ContainerServicesClient) (ContainerService, error) 947} 948 949// ContainerServicesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 950// operation. 951type ContainerServicesDeleteFuture struct { 952 azure.FutureAPI 953 // Result returns the result of the asynchronous operation. 954 // If the operation has not completed it will return an error. 955 Result func(ContainerServicesClient) (autorest.Response, error) 956} 957 958// ContainerServiceServicePrincipalProfile information about a service principal identity for the cluster 959// to use for manipulating Azure APIs. 960type ContainerServiceServicePrincipalProfile struct { 961 // ClientID - The ID for the service principal. 962 ClientID *string `json:"clientId,omitempty"` 963 // Secret - The secret password associated with the service principal. 964 Secret *string `json:"secret,omitempty"` 965} 966 967// ContainerServiceSSHConfiguration SSH configuration for Linux-based VMs running on Azure. 968type ContainerServiceSSHConfiguration struct { 969 // PublicKeys - the list of SSH public keys used to authenticate with Linux-based VMs. 970 PublicKeys *[]ContainerServiceSSHPublicKey `json:"publicKeys,omitempty"` 971} 972 973// ContainerServiceSSHPublicKey contains information about SSH certificate public key data. 974type ContainerServiceSSHPublicKey struct { 975 // KeyData - Certificate public key used to authenticate with VMs through SSH. The certificate must be in PEM format with or without headers. 976 KeyData *string `json:"keyData,omitempty"` 977} 978 979// ContainerServiceVMDiagnostics profile for diagnostics on the container service VMs. 980type ContainerServiceVMDiagnostics struct { 981 // Enabled - Whether the VM diagnostic agent is provisioned on the VM. 982 Enabled *bool `json:"enabled,omitempty"` 983 // StorageURI - READ-ONLY; The URI of the storage account where diagnostics are stored. 984 StorageURI *string `json:"storageUri,omitempty"` 985} 986 987// MarshalJSON is the custom marshaler for ContainerServiceVMDiagnostics. 988func (csvd ContainerServiceVMDiagnostics) MarshalJSON() ([]byte, error) { 989 objectMap := make(map[string]interface{}) 990 if csvd.Enabled != nil { 991 objectMap["enabled"] = csvd.Enabled 992 } 993 return json.Marshal(objectMap) 994} 995 996// ContainerServiceWindowsProfile profile for Windows VMs in the container service cluster. 997type ContainerServiceWindowsProfile struct { 998 // AdminUsername - The administrator username to use for Windows VMs. 999 AdminUsername *string `json:"adminUsername,omitempty"` 1000 // AdminPassword - The administrator password to use for Windows VMs. 1001 AdminPassword *string `json:"adminPassword,omitempty"` 1002} 1003 1004// CreationData data used when creating a disk. 1005type CreationData struct { 1006 // CreateOption - This enumerates the possible sources of a disk's creation. Possible values include: 'Empty', 'Attach', 'FromImage', 'Import', 'Copy', 'Restore', 'Upload' 1007 CreateOption DiskCreateOption `json:"createOption,omitempty"` 1008 // StorageAccountID - Required if createOption is Import. The Azure Resource Manager identifier of the storage account containing the blob to import as a disk. 1009 StorageAccountID *string `json:"storageAccountId,omitempty"` 1010 // ImageReference - Disk source information. 1011 ImageReference *ImageDiskReference `json:"imageReference,omitempty"` 1012 // 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. 1013 GalleryImageReference *ImageDiskReference `json:"galleryImageReference,omitempty"` 1014 // SourceURI - If createOption is Import, this is the URI of a blob to be imported into a managed disk. 1015 SourceURI *string `json:"sourceUri,omitempty"` 1016 // SourceResourceID - If createOption is Copy, this is the ARM id of the source snapshot or disk. 1017 SourceResourceID *string `json:"sourceResourceId,omitempty"` 1018 // SourceUniqueID - READ-ONLY; If this field is set, this is the unique id identifying the source of this resource. 1019 SourceUniqueID *string `json:"sourceUniqueId,omitempty"` 1020 // 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). 1021 UploadSizeBytes *int64 `json:"uploadSizeBytes,omitempty"` 1022} 1023 1024// MarshalJSON is the custom marshaler for CreationData. 1025func (cd CreationData) MarshalJSON() ([]byte, error) { 1026 objectMap := make(map[string]interface{}) 1027 if cd.CreateOption != "" { 1028 objectMap["createOption"] = cd.CreateOption 1029 } 1030 if cd.StorageAccountID != nil { 1031 objectMap["storageAccountId"] = cd.StorageAccountID 1032 } 1033 if cd.ImageReference != nil { 1034 objectMap["imageReference"] = cd.ImageReference 1035 } 1036 if cd.GalleryImageReference != nil { 1037 objectMap["galleryImageReference"] = cd.GalleryImageReference 1038 } 1039 if cd.SourceURI != nil { 1040 objectMap["sourceUri"] = cd.SourceURI 1041 } 1042 if cd.SourceResourceID != nil { 1043 objectMap["sourceResourceId"] = cd.SourceResourceID 1044 } 1045 if cd.UploadSizeBytes != nil { 1046 objectMap["uploadSizeBytes"] = cd.UploadSizeBytes 1047 } 1048 return json.Marshal(objectMap) 1049} 1050 1051// DataDisk describes a data disk. 1052type DataDisk struct { 1053 // 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. 1054 Lun *int32 `json:"lun,omitempty"` 1055 // Name - The disk name. 1056 Name *string `json:"name,omitempty"` 1057 // Vhd - The virtual hard disk. 1058 Vhd *VirtualHardDisk `json:"vhd,omitempty"` 1059 // 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. 1060 Image *VirtualHardDisk `json:"image,omitempty"` 1061 // 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' 1062 Caching CachingTypes `json:"caching,omitempty"` 1063 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 1064 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 1065 // 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' 1066 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 1067 // 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 1068 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 1069 // ManagedDisk - The managed disk parameters. 1070 ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` 1071 // ToBeDetached - Specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset 1072 ToBeDetached *bool `json:"toBeDetached,omitempty"` 1073 // 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. 1074 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 1075 // 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. 1076 DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` 1077} 1078 1079// MarshalJSON is the custom marshaler for DataDisk. 1080func (dd DataDisk) MarshalJSON() ([]byte, error) { 1081 objectMap := make(map[string]interface{}) 1082 if dd.Lun != nil { 1083 objectMap["lun"] = dd.Lun 1084 } 1085 if dd.Name != nil { 1086 objectMap["name"] = dd.Name 1087 } 1088 if dd.Vhd != nil { 1089 objectMap["vhd"] = dd.Vhd 1090 } 1091 if dd.Image != nil { 1092 objectMap["image"] = dd.Image 1093 } 1094 if dd.Caching != "" { 1095 objectMap["caching"] = dd.Caching 1096 } 1097 if dd.WriteAcceleratorEnabled != nil { 1098 objectMap["writeAcceleratorEnabled"] = dd.WriteAcceleratorEnabled 1099 } 1100 if dd.CreateOption != "" { 1101 objectMap["createOption"] = dd.CreateOption 1102 } 1103 if dd.DiskSizeGB != nil { 1104 objectMap["diskSizeGB"] = dd.DiskSizeGB 1105 } 1106 if dd.ManagedDisk != nil { 1107 objectMap["managedDisk"] = dd.ManagedDisk 1108 } 1109 if dd.ToBeDetached != nil { 1110 objectMap["toBeDetached"] = dd.ToBeDetached 1111 } 1112 return json.Marshal(objectMap) 1113} 1114 1115// DataDiskImage contains the data disk images information. 1116type DataDiskImage struct { 1117 // 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. 1118 Lun *int32 `json:"lun,omitempty"` 1119} 1120 1121// DataDiskImageEncryption contains encryption settings for a data disk image. 1122type DataDiskImageEncryption struct { 1123 // 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. 1124 Lun *int32 `json:"lun,omitempty"` 1125 // DiskEncryptionSetID - A relative URI containing the resource ID of the disk encryption set. 1126 DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` 1127} 1128 1129// DedicatedHost specifies information about the Dedicated host. 1130type DedicatedHost struct { 1131 autorest.Response `json:"-"` 1132 *DedicatedHostProperties `json:"properties,omitempty"` 1133 // 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. 1134 Sku *Sku `json:"sku,omitempty"` 1135 // ID - READ-ONLY; Resource Id 1136 ID *string `json:"id,omitempty"` 1137 // Name - READ-ONLY; Resource name 1138 Name *string `json:"name,omitempty"` 1139 // Type - READ-ONLY; Resource type 1140 Type *string `json:"type,omitempty"` 1141 // Location - Resource location 1142 Location *string `json:"location,omitempty"` 1143 // Tags - Resource tags 1144 Tags map[string]*string `json:"tags"` 1145} 1146 1147// MarshalJSON is the custom marshaler for DedicatedHost. 1148func (dh DedicatedHost) MarshalJSON() ([]byte, error) { 1149 objectMap := make(map[string]interface{}) 1150 if dh.DedicatedHostProperties != nil { 1151 objectMap["properties"] = dh.DedicatedHostProperties 1152 } 1153 if dh.Sku != nil { 1154 objectMap["sku"] = dh.Sku 1155 } 1156 if dh.Location != nil { 1157 objectMap["location"] = dh.Location 1158 } 1159 if dh.Tags != nil { 1160 objectMap["tags"] = dh.Tags 1161 } 1162 return json.Marshal(objectMap) 1163} 1164 1165// UnmarshalJSON is the custom unmarshaler for DedicatedHost struct. 1166func (dh *DedicatedHost) UnmarshalJSON(body []byte) error { 1167 var m map[string]*json.RawMessage 1168 err := json.Unmarshal(body, &m) 1169 if err != nil { 1170 return err 1171 } 1172 for k, v := range m { 1173 switch k { 1174 case "properties": 1175 if v != nil { 1176 var dedicatedHostProperties DedicatedHostProperties 1177 err = json.Unmarshal(*v, &dedicatedHostProperties) 1178 if err != nil { 1179 return err 1180 } 1181 dh.DedicatedHostProperties = &dedicatedHostProperties 1182 } 1183 case "sku": 1184 if v != nil { 1185 var sku Sku 1186 err = json.Unmarshal(*v, &sku) 1187 if err != nil { 1188 return err 1189 } 1190 dh.Sku = &sku 1191 } 1192 case "id": 1193 if v != nil { 1194 var ID string 1195 err = json.Unmarshal(*v, &ID) 1196 if err != nil { 1197 return err 1198 } 1199 dh.ID = &ID 1200 } 1201 case "name": 1202 if v != nil { 1203 var name string 1204 err = json.Unmarshal(*v, &name) 1205 if err != nil { 1206 return err 1207 } 1208 dh.Name = &name 1209 } 1210 case "type": 1211 if v != nil { 1212 var typeVar string 1213 err = json.Unmarshal(*v, &typeVar) 1214 if err != nil { 1215 return err 1216 } 1217 dh.Type = &typeVar 1218 } 1219 case "location": 1220 if v != nil { 1221 var location string 1222 err = json.Unmarshal(*v, &location) 1223 if err != nil { 1224 return err 1225 } 1226 dh.Location = &location 1227 } 1228 case "tags": 1229 if v != nil { 1230 var tags map[string]*string 1231 err = json.Unmarshal(*v, &tags) 1232 if err != nil { 1233 return err 1234 } 1235 dh.Tags = tags 1236 } 1237 } 1238 } 1239 1240 return nil 1241} 1242 1243// DedicatedHostAllocatableVM represents the dedicated host unutilized capacity in terms of a specific VM 1244// size. 1245type DedicatedHostAllocatableVM struct { 1246 // VMSize - VM size in terms of which the unutilized capacity is represented. 1247 VMSize *string `json:"vmSize,omitempty"` 1248 // Count - Maximum number of VMs of size vmSize that can fit in the dedicated host's remaining capacity. 1249 Count *float64 `json:"count,omitempty"` 1250} 1251 1252// DedicatedHostAvailableCapacity dedicated host unutilized capacity. 1253type DedicatedHostAvailableCapacity struct { 1254 // 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. 1255 AllocatableVMs *[]DedicatedHostAllocatableVM `json:"allocatableVMs,omitempty"` 1256} 1257 1258// DedicatedHostGroup specifies information about the dedicated host group that the dedicated hosts should 1259// be assigned to. <br><br> Currently, a dedicated host can only be added to a dedicated host group at 1260// creation time. An existing dedicated host cannot be added to another dedicated host group. 1261type DedicatedHostGroup struct { 1262 autorest.Response `json:"-"` 1263 *DedicatedHostGroupProperties `json:"properties,omitempty"` 1264 // 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. 1265 Zones *[]string `json:"zones,omitempty"` 1266 // ID - READ-ONLY; Resource Id 1267 ID *string `json:"id,omitempty"` 1268 // Name - READ-ONLY; Resource name 1269 Name *string `json:"name,omitempty"` 1270 // Type - READ-ONLY; Resource type 1271 Type *string `json:"type,omitempty"` 1272 // Location - Resource location 1273 Location *string `json:"location,omitempty"` 1274 // Tags - Resource tags 1275 Tags map[string]*string `json:"tags"` 1276} 1277 1278// MarshalJSON is the custom marshaler for DedicatedHostGroup. 1279func (dhg DedicatedHostGroup) MarshalJSON() ([]byte, error) { 1280 objectMap := make(map[string]interface{}) 1281 if dhg.DedicatedHostGroupProperties != nil { 1282 objectMap["properties"] = dhg.DedicatedHostGroupProperties 1283 } 1284 if dhg.Zones != nil { 1285 objectMap["zones"] = dhg.Zones 1286 } 1287 if dhg.Location != nil { 1288 objectMap["location"] = dhg.Location 1289 } 1290 if dhg.Tags != nil { 1291 objectMap["tags"] = dhg.Tags 1292 } 1293 return json.Marshal(objectMap) 1294} 1295 1296// UnmarshalJSON is the custom unmarshaler for DedicatedHostGroup struct. 1297func (dhg *DedicatedHostGroup) UnmarshalJSON(body []byte) error { 1298 var m map[string]*json.RawMessage 1299 err := json.Unmarshal(body, &m) 1300 if err != nil { 1301 return err 1302 } 1303 for k, v := range m { 1304 switch k { 1305 case "properties": 1306 if v != nil { 1307 var dedicatedHostGroupProperties DedicatedHostGroupProperties 1308 err = json.Unmarshal(*v, &dedicatedHostGroupProperties) 1309 if err != nil { 1310 return err 1311 } 1312 dhg.DedicatedHostGroupProperties = &dedicatedHostGroupProperties 1313 } 1314 case "zones": 1315 if v != nil { 1316 var zones []string 1317 err = json.Unmarshal(*v, &zones) 1318 if err != nil { 1319 return err 1320 } 1321 dhg.Zones = &zones 1322 } 1323 case "id": 1324 if v != nil { 1325 var ID string 1326 err = json.Unmarshal(*v, &ID) 1327 if err != nil { 1328 return err 1329 } 1330 dhg.ID = &ID 1331 } 1332 case "name": 1333 if v != nil { 1334 var name string 1335 err = json.Unmarshal(*v, &name) 1336 if err != nil { 1337 return err 1338 } 1339 dhg.Name = &name 1340 } 1341 case "type": 1342 if v != nil { 1343 var typeVar string 1344 err = json.Unmarshal(*v, &typeVar) 1345 if err != nil { 1346 return err 1347 } 1348 dhg.Type = &typeVar 1349 } 1350 case "location": 1351 if v != nil { 1352 var location string 1353 err = json.Unmarshal(*v, &location) 1354 if err != nil { 1355 return err 1356 } 1357 dhg.Location = &location 1358 } 1359 case "tags": 1360 if v != nil { 1361 var tags map[string]*string 1362 err = json.Unmarshal(*v, &tags) 1363 if err != nil { 1364 return err 1365 } 1366 dhg.Tags = tags 1367 } 1368 } 1369 } 1370 1371 return nil 1372} 1373 1374// DedicatedHostGroupInstanceView ... 1375type DedicatedHostGroupInstanceView struct { 1376 // Hosts - List of instance view of the dedicated hosts under the dedicated host group. 1377 Hosts *[]DedicatedHostInstanceViewWithName `json:"hosts,omitempty"` 1378} 1379 1380// DedicatedHostGroupListResult the List Dedicated Host Group with resource group response. 1381type DedicatedHostGroupListResult struct { 1382 autorest.Response `json:"-"` 1383 // Value - The list of dedicated host groups 1384 Value *[]DedicatedHostGroup `json:"value,omitempty"` 1385 // 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. 1386 NextLink *string `json:"nextLink,omitempty"` 1387} 1388 1389// DedicatedHostGroupListResultIterator provides access to a complete listing of DedicatedHostGroup values. 1390type DedicatedHostGroupListResultIterator struct { 1391 i int 1392 page DedicatedHostGroupListResultPage 1393} 1394 1395// NextWithContext advances to the next value. If there was an error making 1396// the request the iterator does not advance and the error is returned. 1397func (iter *DedicatedHostGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { 1398 if tracing.IsEnabled() { 1399 ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupListResultIterator.NextWithContext") 1400 defer func() { 1401 sc := -1 1402 if iter.Response().Response.Response != nil { 1403 sc = iter.Response().Response.Response.StatusCode 1404 } 1405 tracing.EndSpan(ctx, sc, err) 1406 }() 1407 } 1408 iter.i++ 1409 if iter.i < len(iter.page.Values()) { 1410 return nil 1411 } 1412 err = iter.page.NextWithContext(ctx) 1413 if err != nil { 1414 iter.i-- 1415 return err 1416 } 1417 iter.i = 0 1418 return nil 1419} 1420 1421// Next advances to the next value. If there was an error making 1422// the request the iterator does not advance and the error is returned. 1423// Deprecated: Use NextWithContext() instead. 1424func (iter *DedicatedHostGroupListResultIterator) Next() error { 1425 return iter.NextWithContext(context.Background()) 1426} 1427 1428// NotDone returns true if the enumeration should be started or is not yet complete. 1429func (iter DedicatedHostGroupListResultIterator) NotDone() bool { 1430 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1431} 1432 1433// Response returns the raw server response from the last page request. 1434func (iter DedicatedHostGroupListResultIterator) Response() DedicatedHostGroupListResult { 1435 return iter.page.Response() 1436} 1437 1438// Value returns the current value or a zero-initialized value if the 1439// iterator has advanced beyond the end of the collection. 1440func (iter DedicatedHostGroupListResultIterator) Value() DedicatedHostGroup { 1441 if !iter.page.NotDone() { 1442 return DedicatedHostGroup{} 1443 } 1444 return iter.page.Values()[iter.i] 1445} 1446 1447// Creates a new instance of the DedicatedHostGroupListResultIterator type. 1448func NewDedicatedHostGroupListResultIterator(page DedicatedHostGroupListResultPage) DedicatedHostGroupListResultIterator { 1449 return DedicatedHostGroupListResultIterator{page: page} 1450} 1451 1452// IsEmpty returns true if the ListResult contains no values. 1453func (dhglr DedicatedHostGroupListResult) IsEmpty() bool { 1454 return dhglr.Value == nil || len(*dhglr.Value) == 0 1455} 1456 1457// hasNextLink returns true if the NextLink is not empty. 1458func (dhglr DedicatedHostGroupListResult) hasNextLink() bool { 1459 return dhglr.NextLink != nil && len(*dhglr.NextLink) != 0 1460} 1461 1462// dedicatedHostGroupListResultPreparer prepares a request to retrieve the next set of results. 1463// It returns nil if no more results exist. 1464func (dhglr DedicatedHostGroupListResult) dedicatedHostGroupListResultPreparer(ctx context.Context) (*http.Request, error) { 1465 if !dhglr.hasNextLink() { 1466 return nil, nil 1467 } 1468 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1469 autorest.AsJSON(), 1470 autorest.AsGet(), 1471 autorest.WithBaseURL(to.String(dhglr.NextLink))) 1472} 1473 1474// DedicatedHostGroupListResultPage contains a page of DedicatedHostGroup values. 1475type DedicatedHostGroupListResultPage struct { 1476 fn func(context.Context, DedicatedHostGroupListResult) (DedicatedHostGroupListResult, error) 1477 dhglr DedicatedHostGroupListResult 1478} 1479 1480// NextWithContext advances to the next page of values. If there was an error making 1481// the request the page does not advance and the error is returned. 1482func (page *DedicatedHostGroupListResultPage) NextWithContext(ctx context.Context) (err error) { 1483 if tracing.IsEnabled() { 1484 ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupListResultPage.NextWithContext") 1485 defer func() { 1486 sc := -1 1487 if page.Response().Response.Response != nil { 1488 sc = page.Response().Response.Response.StatusCode 1489 } 1490 tracing.EndSpan(ctx, sc, err) 1491 }() 1492 } 1493 for { 1494 next, err := page.fn(ctx, page.dhglr) 1495 if err != nil { 1496 return err 1497 } 1498 page.dhglr = next 1499 if !next.hasNextLink() || !next.IsEmpty() { 1500 break 1501 } 1502 } 1503 return nil 1504} 1505 1506// Next advances to the next page of values. If there was an error making 1507// the request the page does not advance and the error is returned. 1508// Deprecated: Use NextWithContext() instead. 1509func (page *DedicatedHostGroupListResultPage) Next() error { 1510 return page.NextWithContext(context.Background()) 1511} 1512 1513// NotDone returns true if the page enumeration should be started or is not yet complete. 1514func (page DedicatedHostGroupListResultPage) NotDone() bool { 1515 return !page.dhglr.IsEmpty() 1516} 1517 1518// Response returns the raw server response from the last page request. 1519func (page DedicatedHostGroupListResultPage) Response() DedicatedHostGroupListResult { 1520 return page.dhglr 1521} 1522 1523// Values returns the slice of values for the current page or nil if there are no values. 1524func (page DedicatedHostGroupListResultPage) Values() []DedicatedHostGroup { 1525 if page.dhglr.IsEmpty() { 1526 return nil 1527 } 1528 return *page.dhglr.Value 1529} 1530 1531// Creates a new instance of the DedicatedHostGroupListResultPage type. 1532func NewDedicatedHostGroupListResultPage(cur DedicatedHostGroupListResult, getNextPage func(context.Context, DedicatedHostGroupListResult) (DedicatedHostGroupListResult, error)) DedicatedHostGroupListResultPage { 1533 return DedicatedHostGroupListResultPage{ 1534 fn: getNextPage, 1535 dhglr: cur, 1536 } 1537} 1538 1539// DedicatedHostGroupProperties dedicated Host Group Properties. 1540type DedicatedHostGroupProperties struct { 1541 // PlatformFaultDomainCount - Number of fault domains that the host group can span. 1542 PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` 1543 // Hosts - READ-ONLY; A list of references to all dedicated hosts in the dedicated host group. 1544 Hosts *[]SubResourceReadOnly `json:"hosts,omitempty"` 1545 // InstanceView - READ-ONLY; The dedicated host group instance view, which has the list of instance view of the dedicated hosts under the dedicated host group. 1546 InstanceView *DedicatedHostGroupInstanceView `json:"instanceView,omitempty"` 1547 // SupportAutomaticPlacement - Specifies whether virtual machines or virtual machine scale sets can be placed automatically on the dedicated host group. Automatic placement means resources are allocated on dedicated hosts, that are chosen by Azure, under the dedicated host group. The value is defaulted to 'false' when not provided. <br><br>Minimum api-version: 2020-06-01. 1548 SupportAutomaticPlacement *bool `json:"supportAutomaticPlacement,omitempty"` 1549} 1550 1551// MarshalJSON is the custom marshaler for DedicatedHostGroupProperties. 1552func (dhgp DedicatedHostGroupProperties) MarshalJSON() ([]byte, error) { 1553 objectMap := make(map[string]interface{}) 1554 if dhgp.PlatformFaultDomainCount != nil { 1555 objectMap["platformFaultDomainCount"] = dhgp.PlatformFaultDomainCount 1556 } 1557 if dhgp.SupportAutomaticPlacement != nil { 1558 objectMap["supportAutomaticPlacement"] = dhgp.SupportAutomaticPlacement 1559 } 1560 return json.Marshal(objectMap) 1561} 1562 1563// DedicatedHostGroupUpdate specifies information about the dedicated host group that the dedicated host 1564// should be assigned to. Only tags may be updated. 1565type DedicatedHostGroupUpdate struct { 1566 *DedicatedHostGroupProperties `json:"properties,omitempty"` 1567 // 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. 1568 Zones *[]string `json:"zones,omitempty"` 1569 // Tags - Resource tags 1570 Tags map[string]*string `json:"tags"` 1571} 1572 1573// MarshalJSON is the custom marshaler for DedicatedHostGroupUpdate. 1574func (dhgu DedicatedHostGroupUpdate) MarshalJSON() ([]byte, error) { 1575 objectMap := make(map[string]interface{}) 1576 if dhgu.DedicatedHostGroupProperties != nil { 1577 objectMap["properties"] = dhgu.DedicatedHostGroupProperties 1578 } 1579 if dhgu.Zones != nil { 1580 objectMap["zones"] = dhgu.Zones 1581 } 1582 if dhgu.Tags != nil { 1583 objectMap["tags"] = dhgu.Tags 1584 } 1585 return json.Marshal(objectMap) 1586} 1587 1588// UnmarshalJSON is the custom unmarshaler for DedicatedHostGroupUpdate struct. 1589func (dhgu *DedicatedHostGroupUpdate) UnmarshalJSON(body []byte) error { 1590 var m map[string]*json.RawMessage 1591 err := json.Unmarshal(body, &m) 1592 if err != nil { 1593 return err 1594 } 1595 for k, v := range m { 1596 switch k { 1597 case "properties": 1598 if v != nil { 1599 var dedicatedHostGroupProperties DedicatedHostGroupProperties 1600 err = json.Unmarshal(*v, &dedicatedHostGroupProperties) 1601 if err != nil { 1602 return err 1603 } 1604 dhgu.DedicatedHostGroupProperties = &dedicatedHostGroupProperties 1605 } 1606 case "zones": 1607 if v != nil { 1608 var zones []string 1609 err = json.Unmarshal(*v, &zones) 1610 if err != nil { 1611 return err 1612 } 1613 dhgu.Zones = &zones 1614 } 1615 case "tags": 1616 if v != nil { 1617 var tags map[string]*string 1618 err = json.Unmarshal(*v, &tags) 1619 if err != nil { 1620 return err 1621 } 1622 dhgu.Tags = tags 1623 } 1624 } 1625 } 1626 1627 return nil 1628} 1629 1630// DedicatedHostInstanceView the instance view of a dedicated host. 1631type DedicatedHostInstanceView struct { 1632 // AssetID - READ-ONLY; Specifies the unique id of the dedicated physical machine on which the dedicated host resides. 1633 AssetID *string `json:"assetId,omitempty"` 1634 // AvailableCapacity - Unutilized capacity of the dedicated host. 1635 AvailableCapacity *DedicatedHostAvailableCapacity `json:"availableCapacity,omitempty"` 1636 // Statuses - The resource status information. 1637 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 1638} 1639 1640// MarshalJSON is the custom marshaler for DedicatedHostInstanceView. 1641func (dhiv DedicatedHostInstanceView) MarshalJSON() ([]byte, error) { 1642 objectMap := make(map[string]interface{}) 1643 if dhiv.AvailableCapacity != nil { 1644 objectMap["availableCapacity"] = dhiv.AvailableCapacity 1645 } 1646 if dhiv.Statuses != nil { 1647 objectMap["statuses"] = dhiv.Statuses 1648 } 1649 return json.Marshal(objectMap) 1650} 1651 1652// DedicatedHostInstanceViewWithName the instance view of a dedicated host that includes the name of the 1653// dedicated host. It is used for the response to the instance view of a dedicated host group. 1654type DedicatedHostInstanceViewWithName struct { 1655 // Name - READ-ONLY; The name of the dedicated host. 1656 Name *string `json:"name,omitempty"` 1657 // AssetID - READ-ONLY; Specifies the unique id of the dedicated physical machine on which the dedicated host resides. 1658 AssetID *string `json:"assetId,omitempty"` 1659 // AvailableCapacity - Unutilized capacity of the dedicated host. 1660 AvailableCapacity *DedicatedHostAvailableCapacity `json:"availableCapacity,omitempty"` 1661 // Statuses - The resource status information. 1662 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 1663} 1664 1665// MarshalJSON is the custom marshaler for DedicatedHostInstanceViewWithName. 1666func (dhivwn DedicatedHostInstanceViewWithName) MarshalJSON() ([]byte, error) { 1667 objectMap := make(map[string]interface{}) 1668 if dhivwn.AvailableCapacity != nil { 1669 objectMap["availableCapacity"] = dhivwn.AvailableCapacity 1670 } 1671 if dhivwn.Statuses != nil { 1672 objectMap["statuses"] = dhivwn.Statuses 1673 } 1674 return json.Marshal(objectMap) 1675} 1676 1677// DedicatedHostListResult the list dedicated host operation response. 1678type DedicatedHostListResult struct { 1679 autorest.Response `json:"-"` 1680 // Value - The list of dedicated hosts 1681 Value *[]DedicatedHost `json:"value,omitempty"` 1682 // NextLink - The URI to fetch the next page of dedicated hosts. Call ListNext() with this URI to fetch the next page of dedicated hosts. 1683 NextLink *string `json:"nextLink,omitempty"` 1684} 1685 1686// DedicatedHostListResultIterator provides access to a complete listing of DedicatedHost values. 1687type DedicatedHostListResultIterator struct { 1688 i int 1689 page DedicatedHostListResultPage 1690} 1691 1692// NextWithContext advances to the next value. If there was an error making 1693// the request the iterator does not advance and the error is returned. 1694func (iter *DedicatedHostListResultIterator) NextWithContext(ctx context.Context) (err error) { 1695 if tracing.IsEnabled() { 1696 ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostListResultIterator.NextWithContext") 1697 defer func() { 1698 sc := -1 1699 if iter.Response().Response.Response != nil { 1700 sc = iter.Response().Response.Response.StatusCode 1701 } 1702 tracing.EndSpan(ctx, sc, err) 1703 }() 1704 } 1705 iter.i++ 1706 if iter.i < len(iter.page.Values()) { 1707 return nil 1708 } 1709 err = iter.page.NextWithContext(ctx) 1710 if err != nil { 1711 iter.i-- 1712 return err 1713 } 1714 iter.i = 0 1715 return nil 1716} 1717 1718// Next advances to the next value. If there was an error making 1719// the request the iterator does not advance and the error is returned. 1720// Deprecated: Use NextWithContext() instead. 1721func (iter *DedicatedHostListResultIterator) Next() error { 1722 return iter.NextWithContext(context.Background()) 1723} 1724 1725// NotDone returns true if the enumeration should be started or is not yet complete. 1726func (iter DedicatedHostListResultIterator) NotDone() bool { 1727 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1728} 1729 1730// Response returns the raw server response from the last page request. 1731func (iter DedicatedHostListResultIterator) Response() DedicatedHostListResult { 1732 return iter.page.Response() 1733} 1734 1735// Value returns the current value or a zero-initialized value if the 1736// iterator has advanced beyond the end of the collection. 1737func (iter DedicatedHostListResultIterator) Value() DedicatedHost { 1738 if !iter.page.NotDone() { 1739 return DedicatedHost{} 1740 } 1741 return iter.page.Values()[iter.i] 1742} 1743 1744// Creates a new instance of the DedicatedHostListResultIterator type. 1745func NewDedicatedHostListResultIterator(page DedicatedHostListResultPage) DedicatedHostListResultIterator { 1746 return DedicatedHostListResultIterator{page: page} 1747} 1748 1749// IsEmpty returns true if the ListResult contains no values. 1750func (dhlr DedicatedHostListResult) IsEmpty() bool { 1751 return dhlr.Value == nil || len(*dhlr.Value) == 0 1752} 1753 1754// hasNextLink returns true if the NextLink is not empty. 1755func (dhlr DedicatedHostListResult) hasNextLink() bool { 1756 return dhlr.NextLink != nil && len(*dhlr.NextLink) != 0 1757} 1758 1759// dedicatedHostListResultPreparer prepares a request to retrieve the next set of results. 1760// It returns nil if no more results exist. 1761func (dhlr DedicatedHostListResult) dedicatedHostListResultPreparer(ctx context.Context) (*http.Request, error) { 1762 if !dhlr.hasNextLink() { 1763 return nil, nil 1764 } 1765 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1766 autorest.AsJSON(), 1767 autorest.AsGet(), 1768 autorest.WithBaseURL(to.String(dhlr.NextLink))) 1769} 1770 1771// DedicatedHostListResultPage contains a page of DedicatedHost values. 1772type DedicatedHostListResultPage struct { 1773 fn func(context.Context, DedicatedHostListResult) (DedicatedHostListResult, error) 1774 dhlr DedicatedHostListResult 1775} 1776 1777// NextWithContext advances to the next page of values. If there was an error making 1778// the request the page does not advance and the error is returned. 1779func (page *DedicatedHostListResultPage) NextWithContext(ctx context.Context) (err error) { 1780 if tracing.IsEnabled() { 1781 ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostListResultPage.NextWithContext") 1782 defer func() { 1783 sc := -1 1784 if page.Response().Response.Response != nil { 1785 sc = page.Response().Response.Response.StatusCode 1786 } 1787 tracing.EndSpan(ctx, sc, err) 1788 }() 1789 } 1790 for { 1791 next, err := page.fn(ctx, page.dhlr) 1792 if err != nil { 1793 return err 1794 } 1795 page.dhlr = next 1796 if !next.hasNextLink() || !next.IsEmpty() { 1797 break 1798 } 1799 } 1800 return nil 1801} 1802 1803// Next advances to the next page of values. If there was an error making 1804// the request the page does not advance and the error is returned. 1805// Deprecated: Use NextWithContext() instead. 1806func (page *DedicatedHostListResultPage) Next() error { 1807 return page.NextWithContext(context.Background()) 1808} 1809 1810// NotDone returns true if the page enumeration should be started or is not yet complete. 1811func (page DedicatedHostListResultPage) NotDone() bool { 1812 return !page.dhlr.IsEmpty() 1813} 1814 1815// Response returns the raw server response from the last page request. 1816func (page DedicatedHostListResultPage) Response() DedicatedHostListResult { 1817 return page.dhlr 1818} 1819 1820// Values returns the slice of values for the current page or nil if there are no values. 1821func (page DedicatedHostListResultPage) Values() []DedicatedHost { 1822 if page.dhlr.IsEmpty() { 1823 return nil 1824 } 1825 return *page.dhlr.Value 1826} 1827 1828// Creates a new instance of the DedicatedHostListResultPage type. 1829func NewDedicatedHostListResultPage(cur DedicatedHostListResult, getNextPage func(context.Context, DedicatedHostListResult) (DedicatedHostListResult, error)) DedicatedHostListResultPage { 1830 return DedicatedHostListResultPage{ 1831 fn: getNextPage, 1832 dhlr: cur, 1833 } 1834} 1835 1836// DedicatedHostProperties properties of the dedicated host. 1837type DedicatedHostProperties struct { 1838 // PlatformFaultDomain - Fault domain of the dedicated host within a dedicated host group. 1839 PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` 1840 // AutoReplaceOnFailure - Specifies whether the dedicated host should be replaced automatically in case of a failure. The value is defaulted to 'true' when not provided. 1841 AutoReplaceOnFailure *bool `json:"autoReplaceOnFailure,omitempty"` 1842 // 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. 1843 HostID *string `json:"hostId,omitempty"` 1844 // VirtualMachines - READ-ONLY; A list of references to all virtual machines in the Dedicated Host. 1845 VirtualMachines *[]SubResourceReadOnly `json:"virtualMachines,omitempty"` 1846 // 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' 1847 LicenseType DedicatedHostLicenseTypes `json:"licenseType,omitempty"` 1848 // ProvisioningTime - READ-ONLY; The date when the host was first provisioned. 1849 ProvisioningTime *date.Time `json:"provisioningTime,omitempty"` 1850 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 1851 ProvisioningState *string `json:"provisioningState,omitempty"` 1852 // InstanceView - READ-ONLY; The dedicated host instance view. 1853 InstanceView *DedicatedHostInstanceView `json:"instanceView,omitempty"` 1854} 1855 1856// MarshalJSON is the custom marshaler for DedicatedHostProperties. 1857func (dhp DedicatedHostProperties) MarshalJSON() ([]byte, error) { 1858 objectMap := make(map[string]interface{}) 1859 if dhp.PlatformFaultDomain != nil { 1860 objectMap["platformFaultDomain"] = dhp.PlatformFaultDomain 1861 } 1862 if dhp.AutoReplaceOnFailure != nil { 1863 objectMap["autoReplaceOnFailure"] = dhp.AutoReplaceOnFailure 1864 } 1865 if dhp.LicenseType != "" { 1866 objectMap["licenseType"] = dhp.LicenseType 1867 } 1868 return json.Marshal(objectMap) 1869} 1870 1871// DedicatedHostsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 1872// long-running operation. 1873type DedicatedHostsCreateOrUpdateFuture struct { 1874 azure.FutureAPI 1875 // Result returns the result of the asynchronous operation. 1876 // If the operation has not completed it will return an error. 1877 Result func(DedicatedHostsClient) (DedicatedHost, error) 1878} 1879 1880// DedicatedHostsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 1881// operation. 1882type DedicatedHostsDeleteFuture struct { 1883 azure.FutureAPI 1884 // Result returns the result of the asynchronous operation. 1885 // If the operation has not completed it will return an error. 1886 Result func(DedicatedHostsClient) (autorest.Response, error) 1887} 1888 1889// DedicatedHostsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 1890// operation. 1891type DedicatedHostsUpdateFuture struct { 1892 azure.FutureAPI 1893 // Result returns the result of the asynchronous operation. 1894 // If the operation has not completed it will return an error. 1895 Result func(DedicatedHostsClient) (DedicatedHost, error) 1896} 1897 1898// DedicatedHostUpdate specifies information about the dedicated host. Only tags, autoReplaceOnFailure and 1899// licenseType may be updated. 1900type DedicatedHostUpdate struct { 1901 *DedicatedHostProperties `json:"properties,omitempty"` 1902 // Tags - Resource tags 1903 Tags map[string]*string `json:"tags"` 1904} 1905 1906// MarshalJSON is the custom marshaler for DedicatedHostUpdate. 1907func (dhu DedicatedHostUpdate) MarshalJSON() ([]byte, error) { 1908 objectMap := make(map[string]interface{}) 1909 if dhu.DedicatedHostProperties != nil { 1910 objectMap["properties"] = dhu.DedicatedHostProperties 1911 } 1912 if dhu.Tags != nil { 1913 objectMap["tags"] = dhu.Tags 1914 } 1915 return json.Marshal(objectMap) 1916} 1917 1918// UnmarshalJSON is the custom unmarshaler for DedicatedHostUpdate struct. 1919func (dhu *DedicatedHostUpdate) UnmarshalJSON(body []byte) error { 1920 var m map[string]*json.RawMessage 1921 err := json.Unmarshal(body, &m) 1922 if err != nil { 1923 return err 1924 } 1925 for k, v := range m { 1926 switch k { 1927 case "properties": 1928 if v != nil { 1929 var dedicatedHostProperties DedicatedHostProperties 1930 err = json.Unmarshal(*v, &dedicatedHostProperties) 1931 if err != nil { 1932 return err 1933 } 1934 dhu.DedicatedHostProperties = &dedicatedHostProperties 1935 } 1936 case "tags": 1937 if v != nil { 1938 var tags map[string]*string 1939 err = json.Unmarshal(*v, &tags) 1940 if err != nil { 1941 return err 1942 } 1943 dhu.Tags = tags 1944 } 1945 } 1946 } 1947 1948 return nil 1949} 1950 1951// DiagnosticsProfile specifies the boot diagnostic settings state. <br><br>Minimum api-version: 1952// 2015-06-15. 1953type DiagnosticsProfile struct { 1954 // 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. 1955 BootDiagnostics *BootDiagnostics `json:"bootDiagnostics,omitempty"` 1956} 1957 1958// DiffDiskSettings describes the parameters of ephemeral disk settings that can be specified for operating 1959// system disk. <br><br> NOTE: The ephemeral disk settings can only be specified for managed disk. 1960type DiffDiskSettings struct { 1961 // Option - Specifies the ephemeral disk settings for operating system disk. Possible values include: 'Local' 1962 Option DiffDiskOptions `json:"option,omitempty"` 1963 // 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' 1964 Placement DiffDiskPlacement `json:"placement,omitempty"` 1965} 1966 1967// Disallowed describes the disallowed disk types. 1968type Disallowed struct { 1969 // DiskTypes - A list of disk types. 1970 DiskTypes *[]string `json:"diskTypes,omitempty"` 1971} 1972 1973// DisallowedConfiguration specifies the disallowed configuration for a virtual machine image. 1974type DisallowedConfiguration struct { 1975 // VMDiskType - VM disk types which are disallowed. Possible values include: 'VMDiskTypesNone', 'VMDiskTypesUnmanaged' 1976 VMDiskType VMDiskTypes `json:"vmDiskType,omitempty"` 1977} 1978 1979// Disk disk resource. 1980type Disk struct { 1981 autorest.Response `json:"-"` 1982 // ManagedBy - READ-ONLY; A relative URI containing the ID of the VM that has the disk attached. 1983 ManagedBy *string `json:"managedBy,omitempty"` 1984 // 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. 1985 ManagedByExtended *[]string `json:"managedByExtended,omitempty"` 1986 Sku *DiskSku `json:"sku,omitempty"` 1987 // Zones - The Logical zone list for Disk. 1988 Zones *[]string `json:"zones,omitempty"` 1989 *DiskProperties `json:"properties,omitempty"` 1990 // ID - READ-ONLY; Resource Id 1991 ID *string `json:"id,omitempty"` 1992 // Name - READ-ONLY; Resource name 1993 Name *string `json:"name,omitempty"` 1994 // Type - READ-ONLY; Resource type 1995 Type *string `json:"type,omitempty"` 1996 // Location - Resource location 1997 Location *string `json:"location,omitempty"` 1998 // Tags - Resource tags 1999 Tags map[string]*string `json:"tags"` 2000} 2001 2002// MarshalJSON is the custom marshaler for Disk. 2003func (d Disk) MarshalJSON() ([]byte, error) { 2004 objectMap := make(map[string]interface{}) 2005 if d.Sku != nil { 2006 objectMap["sku"] = d.Sku 2007 } 2008 if d.Zones != nil { 2009 objectMap["zones"] = d.Zones 2010 } 2011 if d.DiskProperties != nil { 2012 objectMap["properties"] = d.DiskProperties 2013 } 2014 if d.Location != nil { 2015 objectMap["location"] = d.Location 2016 } 2017 if d.Tags != nil { 2018 objectMap["tags"] = d.Tags 2019 } 2020 return json.Marshal(objectMap) 2021} 2022 2023// UnmarshalJSON is the custom unmarshaler for Disk struct. 2024func (d *Disk) UnmarshalJSON(body []byte) error { 2025 var m map[string]*json.RawMessage 2026 err := json.Unmarshal(body, &m) 2027 if err != nil { 2028 return err 2029 } 2030 for k, v := range m { 2031 switch k { 2032 case "managedBy": 2033 if v != nil { 2034 var managedBy string 2035 err = json.Unmarshal(*v, &managedBy) 2036 if err != nil { 2037 return err 2038 } 2039 d.ManagedBy = &managedBy 2040 } 2041 case "managedByExtended": 2042 if v != nil { 2043 var managedByExtended []string 2044 err = json.Unmarshal(*v, &managedByExtended) 2045 if err != nil { 2046 return err 2047 } 2048 d.ManagedByExtended = &managedByExtended 2049 } 2050 case "sku": 2051 if v != nil { 2052 var sku DiskSku 2053 err = json.Unmarshal(*v, &sku) 2054 if err != nil { 2055 return err 2056 } 2057 d.Sku = &sku 2058 } 2059 case "zones": 2060 if v != nil { 2061 var zones []string 2062 err = json.Unmarshal(*v, &zones) 2063 if err != nil { 2064 return err 2065 } 2066 d.Zones = &zones 2067 } 2068 case "properties": 2069 if v != nil { 2070 var diskProperties DiskProperties 2071 err = json.Unmarshal(*v, &diskProperties) 2072 if err != nil { 2073 return err 2074 } 2075 d.DiskProperties = &diskProperties 2076 } 2077 case "id": 2078 if v != nil { 2079 var ID string 2080 err = json.Unmarshal(*v, &ID) 2081 if err != nil { 2082 return err 2083 } 2084 d.ID = &ID 2085 } 2086 case "name": 2087 if v != nil { 2088 var name string 2089 err = json.Unmarshal(*v, &name) 2090 if err != nil { 2091 return err 2092 } 2093 d.Name = &name 2094 } 2095 case "type": 2096 if v != nil { 2097 var typeVar string 2098 err = json.Unmarshal(*v, &typeVar) 2099 if err != nil { 2100 return err 2101 } 2102 d.Type = &typeVar 2103 } 2104 case "location": 2105 if v != nil { 2106 var location string 2107 err = json.Unmarshal(*v, &location) 2108 if err != nil { 2109 return err 2110 } 2111 d.Location = &location 2112 } 2113 case "tags": 2114 if v != nil { 2115 var tags map[string]*string 2116 err = json.Unmarshal(*v, &tags) 2117 if err != nil { 2118 return err 2119 } 2120 d.Tags = tags 2121 } 2122 } 2123 } 2124 2125 return nil 2126} 2127 2128// DiskAccess disk access resource. 2129type DiskAccess struct { 2130 autorest.Response `json:"-"` 2131 *DiskAccessProperties `json:"properties,omitempty"` 2132 // ID - READ-ONLY; Resource Id 2133 ID *string `json:"id,omitempty"` 2134 // Name - READ-ONLY; Resource name 2135 Name *string `json:"name,omitempty"` 2136 // Type - READ-ONLY; Resource type 2137 Type *string `json:"type,omitempty"` 2138 // Location - Resource location 2139 Location *string `json:"location,omitempty"` 2140 // Tags - Resource tags 2141 Tags map[string]*string `json:"tags"` 2142} 2143 2144// MarshalJSON is the custom marshaler for DiskAccess. 2145func (da DiskAccess) MarshalJSON() ([]byte, error) { 2146 objectMap := make(map[string]interface{}) 2147 if da.DiskAccessProperties != nil { 2148 objectMap["properties"] = da.DiskAccessProperties 2149 } 2150 if da.Location != nil { 2151 objectMap["location"] = da.Location 2152 } 2153 if da.Tags != nil { 2154 objectMap["tags"] = da.Tags 2155 } 2156 return json.Marshal(objectMap) 2157} 2158 2159// UnmarshalJSON is the custom unmarshaler for DiskAccess struct. 2160func (da *DiskAccess) UnmarshalJSON(body []byte) error { 2161 var m map[string]*json.RawMessage 2162 err := json.Unmarshal(body, &m) 2163 if err != nil { 2164 return err 2165 } 2166 for k, v := range m { 2167 switch k { 2168 case "properties": 2169 if v != nil { 2170 var diskAccessProperties DiskAccessProperties 2171 err = json.Unmarshal(*v, &diskAccessProperties) 2172 if err != nil { 2173 return err 2174 } 2175 da.DiskAccessProperties = &diskAccessProperties 2176 } 2177 case "id": 2178 if v != nil { 2179 var ID string 2180 err = json.Unmarshal(*v, &ID) 2181 if err != nil { 2182 return err 2183 } 2184 da.ID = &ID 2185 } 2186 case "name": 2187 if v != nil { 2188 var name string 2189 err = json.Unmarshal(*v, &name) 2190 if err != nil { 2191 return err 2192 } 2193 da.Name = &name 2194 } 2195 case "type": 2196 if v != nil { 2197 var typeVar string 2198 err = json.Unmarshal(*v, &typeVar) 2199 if err != nil { 2200 return err 2201 } 2202 da.Type = &typeVar 2203 } 2204 case "location": 2205 if v != nil { 2206 var location string 2207 err = json.Unmarshal(*v, &location) 2208 if err != nil { 2209 return err 2210 } 2211 da.Location = &location 2212 } 2213 case "tags": 2214 if v != nil { 2215 var tags map[string]*string 2216 err = json.Unmarshal(*v, &tags) 2217 if err != nil { 2218 return err 2219 } 2220 da.Tags = tags 2221 } 2222 } 2223 } 2224 2225 return nil 2226} 2227 2228// DiskAccessesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 2229// long-running operation. 2230type DiskAccessesCreateOrUpdateFuture struct { 2231 azure.FutureAPI 2232 // Result returns the result of the asynchronous operation. 2233 // If the operation has not completed it will return an error. 2234 Result func(DiskAccessesClient) (DiskAccess, error) 2235} 2236 2237// DiskAccessesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 2238// operation. 2239type DiskAccessesDeleteFuture struct { 2240 azure.FutureAPI 2241 // Result returns the result of the asynchronous operation. 2242 // If the operation has not completed it will return an error. 2243 Result func(DiskAccessesClient) (autorest.Response, error) 2244} 2245 2246// DiskAccessesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 2247// operation. 2248type DiskAccessesUpdateFuture struct { 2249 azure.FutureAPI 2250 // Result returns the result of the asynchronous operation. 2251 // If the operation has not completed it will return an error. 2252 Result func(DiskAccessesClient) (DiskAccess, error) 2253} 2254 2255// DiskAccessList the List disk access operation response. 2256type DiskAccessList struct { 2257 autorest.Response `json:"-"` 2258 // Value - A list of disk access resources. 2259 Value *[]DiskAccess `json:"value,omitempty"` 2260 // NextLink - The uri to fetch the next page of disk access resources. Call ListNext() with this to fetch the next page of disk access resources. 2261 NextLink *string `json:"nextLink,omitempty"` 2262} 2263 2264// DiskAccessListIterator provides access to a complete listing of DiskAccess values. 2265type DiskAccessListIterator struct { 2266 i int 2267 page DiskAccessListPage 2268} 2269 2270// NextWithContext advances to the next value. If there was an error making 2271// the request the iterator does not advance and the error is returned. 2272func (iter *DiskAccessListIterator) NextWithContext(ctx context.Context) (err error) { 2273 if tracing.IsEnabled() { 2274 ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessListIterator.NextWithContext") 2275 defer func() { 2276 sc := -1 2277 if iter.Response().Response.Response != nil { 2278 sc = iter.Response().Response.Response.StatusCode 2279 } 2280 tracing.EndSpan(ctx, sc, err) 2281 }() 2282 } 2283 iter.i++ 2284 if iter.i < len(iter.page.Values()) { 2285 return nil 2286 } 2287 err = iter.page.NextWithContext(ctx) 2288 if err != nil { 2289 iter.i-- 2290 return err 2291 } 2292 iter.i = 0 2293 return nil 2294} 2295 2296// Next advances to the next value. If there was an error making 2297// the request the iterator does not advance and the error is returned. 2298// Deprecated: Use NextWithContext() instead. 2299func (iter *DiskAccessListIterator) Next() error { 2300 return iter.NextWithContext(context.Background()) 2301} 2302 2303// NotDone returns true if the enumeration should be started or is not yet complete. 2304func (iter DiskAccessListIterator) NotDone() bool { 2305 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2306} 2307 2308// Response returns the raw server response from the last page request. 2309func (iter DiskAccessListIterator) Response() DiskAccessList { 2310 return iter.page.Response() 2311} 2312 2313// Value returns the current value or a zero-initialized value if the 2314// iterator has advanced beyond the end of the collection. 2315func (iter DiskAccessListIterator) Value() DiskAccess { 2316 if !iter.page.NotDone() { 2317 return DiskAccess{} 2318 } 2319 return iter.page.Values()[iter.i] 2320} 2321 2322// Creates a new instance of the DiskAccessListIterator type. 2323func NewDiskAccessListIterator(page DiskAccessListPage) DiskAccessListIterator { 2324 return DiskAccessListIterator{page: page} 2325} 2326 2327// IsEmpty returns true if the ListResult contains no values. 2328func (dal DiskAccessList) IsEmpty() bool { 2329 return dal.Value == nil || len(*dal.Value) == 0 2330} 2331 2332// hasNextLink returns true if the NextLink is not empty. 2333func (dal DiskAccessList) hasNextLink() bool { 2334 return dal.NextLink != nil && len(*dal.NextLink) != 0 2335} 2336 2337// diskAccessListPreparer prepares a request to retrieve the next set of results. 2338// It returns nil if no more results exist. 2339func (dal DiskAccessList) diskAccessListPreparer(ctx context.Context) (*http.Request, error) { 2340 if !dal.hasNextLink() { 2341 return nil, nil 2342 } 2343 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2344 autorest.AsJSON(), 2345 autorest.AsGet(), 2346 autorest.WithBaseURL(to.String(dal.NextLink))) 2347} 2348 2349// DiskAccessListPage contains a page of DiskAccess values. 2350type DiskAccessListPage struct { 2351 fn func(context.Context, DiskAccessList) (DiskAccessList, error) 2352 dal DiskAccessList 2353} 2354 2355// NextWithContext advances to the next page of values. If there was an error making 2356// the request the page does not advance and the error is returned. 2357func (page *DiskAccessListPage) NextWithContext(ctx context.Context) (err error) { 2358 if tracing.IsEnabled() { 2359 ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessListPage.NextWithContext") 2360 defer func() { 2361 sc := -1 2362 if page.Response().Response.Response != nil { 2363 sc = page.Response().Response.Response.StatusCode 2364 } 2365 tracing.EndSpan(ctx, sc, err) 2366 }() 2367 } 2368 for { 2369 next, err := page.fn(ctx, page.dal) 2370 if err != nil { 2371 return err 2372 } 2373 page.dal = next 2374 if !next.hasNextLink() || !next.IsEmpty() { 2375 break 2376 } 2377 } 2378 return nil 2379} 2380 2381// Next advances to the next page of values. If there was an error making 2382// the request the page does not advance and the error is returned. 2383// Deprecated: Use NextWithContext() instead. 2384func (page *DiskAccessListPage) Next() error { 2385 return page.NextWithContext(context.Background()) 2386} 2387 2388// NotDone returns true if the page enumeration should be started or is not yet complete. 2389func (page DiskAccessListPage) NotDone() bool { 2390 return !page.dal.IsEmpty() 2391} 2392 2393// Response returns the raw server response from the last page request. 2394func (page DiskAccessListPage) Response() DiskAccessList { 2395 return page.dal 2396} 2397 2398// Values returns the slice of values for the current page or nil if there are no values. 2399func (page DiskAccessListPage) Values() []DiskAccess { 2400 if page.dal.IsEmpty() { 2401 return nil 2402 } 2403 return *page.dal.Value 2404} 2405 2406// Creates a new instance of the DiskAccessListPage type. 2407func NewDiskAccessListPage(cur DiskAccessList, getNextPage func(context.Context, DiskAccessList) (DiskAccessList, error)) DiskAccessListPage { 2408 return DiskAccessListPage{ 2409 fn: getNextPage, 2410 dal: cur, 2411 } 2412} 2413 2414// DiskAccessProperties ... 2415type DiskAccessProperties struct { 2416 // PrivateEndpointConnections - READ-ONLY; A readonly collection of private endpoint connections created on the disk. Currently only one endpoint connection is supported. 2417 PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` 2418 // ProvisioningState - READ-ONLY; The disk access resource provisioning state. 2419 ProvisioningState *string `json:"provisioningState,omitempty"` 2420 // TimeCreated - READ-ONLY; The time when the disk access was created. 2421 TimeCreated *date.Time `json:"timeCreated,omitempty"` 2422} 2423 2424// DiskAccessUpdate used for updating a disk access resource. 2425type DiskAccessUpdate struct { 2426 // Tags - Resource tags 2427 Tags map[string]*string `json:"tags"` 2428} 2429 2430// MarshalJSON is the custom marshaler for DiskAccessUpdate. 2431func (dau DiskAccessUpdate) MarshalJSON() ([]byte, error) { 2432 objectMap := make(map[string]interface{}) 2433 if dau.Tags != nil { 2434 objectMap["tags"] = dau.Tags 2435 } 2436 return json.Marshal(objectMap) 2437} 2438 2439// DiskEncryptionSet disk encryption set resource. 2440type DiskEncryptionSet struct { 2441 autorest.Response `json:"-"` 2442 Identity *EncryptionSetIdentity `json:"identity,omitempty"` 2443 *EncryptionSetProperties `json:"properties,omitempty"` 2444 // ID - READ-ONLY; Resource Id 2445 ID *string `json:"id,omitempty"` 2446 // Name - READ-ONLY; Resource name 2447 Name *string `json:"name,omitempty"` 2448 // Type - READ-ONLY; Resource type 2449 Type *string `json:"type,omitempty"` 2450 // Location - Resource location 2451 Location *string `json:"location,omitempty"` 2452 // Tags - Resource tags 2453 Tags map[string]*string `json:"tags"` 2454} 2455 2456// MarshalJSON is the custom marshaler for DiskEncryptionSet. 2457func (desVar DiskEncryptionSet) MarshalJSON() ([]byte, error) { 2458 objectMap := make(map[string]interface{}) 2459 if desVar.Identity != nil { 2460 objectMap["identity"] = desVar.Identity 2461 } 2462 if desVar.EncryptionSetProperties != nil { 2463 objectMap["properties"] = desVar.EncryptionSetProperties 2464 } 2465 if desVar.Location != nil { 2466 objectMap["location"] = desVar.Location 2467 } 2468 if desVar.Tags != nil { 2469 objectMap["tags"] = desVar.Tags 2470 } 2471 return json.Marshal(objectMap) 2472} 2473 2474// UnmarshalJSON is the custom unmarshaler for DiskEncryptionSet struct. 2475func (desVar *DiskEncryptionSet) UnmarshalJSON(body []byte) error { 2476 var m map[string]*json.RawMessage 2477 err := json.Unmarshal(body, &m) 2478 if err != nil { 2479 return err 2480 } 2481 for k, v := range m { 2482 switch k { 2483 case "identity": 2484 if v != nil { 2485 var identity EncryptionSetIdentity 2486 err = json.Unmarshal(*v, &identity) 2487 if err != nil { 2488 return err 2489 } 2490 desVar.Identity = &identity 2491 } 2492 case "properties": 2493 if v != nil { 2494 var encryptionSetProperties EncryptionSetProperties 2495 err = json.Unmarshal(*v, &encryptionSetProperties) 2496 if err != nil { 2497 return err 2498 } 2499 desVar.EncryptionSetProperties = &encryptionSetProperties 2500 } 2501 case "id": 2502 if v != nil { 2503 var ID string 2504 err = json.Unmarshal(*v, &ID) 2505 if err != nil { 2506 return err 2507 } 2508 desVar.ID = &ID 2509 } 2510 case "name": 2511 if v != nil { 2512 var name string 2513 err = json.Unmarshal(*v, &name) 2514 if err != nil { 2515 return err 2516 } 2517 desVar.Name = &name 2518 } 2519 case "type": 2520 if v != nil { 2521 var typeVar string 2522 err = json.Unmarshal(*v, &typeVar) 2523 if err != nil { 2524 return err 2525 } 2526 desVar.Type = &typeVar 2527 } 2528 case "location": 2529 if v != nil { 2530 var location string 2531 err = json.Unmarshal(*v, &location) 2532 if err != nil { 2533 return err 2534 } 2535 desVar.Location = &location 2536 } 2537 case "tags": 2538 if v != nil { 2539 var tags map[string]*string 2540 err = json.Unmarshal(*v, &tags) 2541 if err != nil { 2542 return err 2543 } 2544 desVar.Tags = tags 2545 } 2546 } 2547 } 2548 2549 return nil 2550} 2551 2552// DiskEncryptionSetList the List disk encryption set operation response. 2553type DiskEncryptionSetList struct { 2554 autorest.Response `json:"-"` 2555 // Value - A list of disk encryption sets. 2556 Value *[]DiskEncryptionSet `json:"value,omitempty"` 2557 // 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. 2558 NextLink *string `json:"nextLink,omitempty"` 2559} 2560 2561// DiskEncryptionSetListIterator provides access to a complete listing of DiskEncryptionSet values. 2562type DiskEncryptionSetListIterator struct { 2563 i int 2564 page DiskEncryptionSetListPage 2565} 2566 2567// NextWithContext advances to the next value. If there was an error making 2568// the request the iterator does not advance and the error is returned. 2569func (iter *DiskEncryptionSetListIterator) NextWithContext(ctx context.Context) (err error) { 2570 if tracing.IsEnabled() { 2571 ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetListIterator.NextWithContext") 2572 defer func() { 2573 sc := -1 2574 if iter.Response().Response.Response != nil { 2575 sc = iter.Response().Response.Response.StatusCode 2576 } 2577 tracing.EndSpan(ctx, sc, err) 2578 }() 2579 } 2580 iter.i++ 2581 if iter.i < len(iter.page.Values()) { 2582 return nil 2583 } 2584 err = iter.page.NextWithContext(ctx) 2585 if err != nil { 2586 iter.i-- 2587 return err 2588 } 2589 iter.i = 0 2590 return nil 2591} 2592 2593// Next advances to the next value. If there was an error making 2594// the request the iterator does not advance and the error is returned. 2595// Deprecated: Use NextWithContext() instead. 2596func (iter *DiskEncryptionSetListIterator) Next() error { 2597 return iter.NextWithContext(context.Background()) 2598} 2599 2600// NotDone returns true if the enumeration should be started or is not yet complete. 2601func (iter DiskEncryptionSetListIterator) NotDone() bool { 2602 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2603} 2604 2605// Response returns the raw server response from the last page request. 2606func (iter DiskEncryptionSetListIterator) Response() DiskEncryptionSetList { 2607 return iter.page.Response() 2608} 2609 2610// Value returns the current value or a zero-initialized value if the 2611// iterator has advanced beyond the end of the collection. 2612func (iter DiskEncryptionSetListIterator) Value() DiskEncryptionSet { 2613 if !iter.page.NotDone() { 2614 return DiskEncryptionSet{} 2615 } 2616 return iter.page.Values()[iter.i] 2617} 2618 2619// Creates a new instance of the DiskEncryptionSetListIterator type. 2620func NewDiskEncryptionSetListIterator(page DiskEncryptionSetListPage) DiskEncryptionSetListIterator { 2621 return DiskEncryptionSetListIterator{page: page} 2622} 2623 2624// IsEmpty returns true if the ListResult contains no values. 2625func (desl DiskEncryptionSetList) IsEmpty() bool { 2626 return desl.Value == nil || len(*desl.Value) == 0 2627} 2628 2629// hasNextLink returns true if the NextLink is not empty. 2630func (desl DiskEncryptionSetList) hasNextLink() bool { 2631 return desl.NextLink != nil && len(*desl.NextLink) != 0 2632} 2633 2634// diskEncryptionSetListPreparer prepares a request to retrieve the next set of results. 2635// It returns nil if no more results exist. 2636func (desl DiskEncryptionSetList) diskEncryptionSetListPreparer(ctx context.Context) (*http.Request, error) { 2637 if !desl.hasNextLink() { 2638 return nil, nil 2639 } 2640 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2641 autorest.AsJSON(), 2642 autorest.AsGet(), 2643 autorest.WithBaseURL(to.String(desl.NextLink))) 2644} 2645 2646// DiskEncryptionSetListPage contains a page of DiskEncryptionSet values. 2647type DiskEncryptionSetListPage struct { 2648 fn func(context.Context, DiskEncryptionSetList) (DiskEncryptionSetList, error) 2649 desl DiskEncryptionSetList 2650} 2651 2652// NextWithContext advances to the next page of values. If there was an error making 2653// the request the page does not advance and the error is returned. 2654func (page *DiskEncryptionSetListPage) NextWithContext(ctx context.Context) (err error) { 2655 if tracing.IsEnabled() { 2656 ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetListPage.NextWithContext") 2657 defer func() { 2658 sc := -1 2659 if page.Response().Response.Response != nil { 2660 sc = page.Response().Response.Response.StatusCode 2661 } 2662 tracing.EndSpan(ctx, sc, err) 2663 }() 2664 } 2665 for { 2666 next, err := page.fn(ctx, page.desl) 2667 if err != nil { 2668 return err 2669 } 2670 page.desl = next 2671 if !next.hasNextLink() || !next.IsEmpty() { 2672 break 2673 } 2674 } 2675 return nil 2676} 2677 2678// Next advances to the next page of values. If there was an error making 2679// the request the page does not advance and the error is returned. 2680// Deprecated: Use NextWithContext() instead. 2681func (page *DiskEncryptionSetListPage) Next() error { 2682 return page.NextWithContext(context.Background()) 2683} 2684 2685// NotDone returns true if the page enumeration should be started or is not yet complete. 2686func (page DiskEncryptionSetListPage) NotDone() bool { 2687 return !page.desl.IsEmpty() 2688} 2689 2690// Response returns the raw server response from the last page request. 2691func (page DiskEncryptionSetListPage) Response() DiskEncryptionSetList { 2692 return page.desl 2693} 2694 2695// Values returns the slice of values for the current page or nil if there are no values. 2696func (page DiskEncryptionSetListPage) Values() []DiskEncryptionSet { 2697 if page.desl.IsEmpty() { 2698 return nil 2699 } 2700 return *page.desl.Value 2701} 2702 2703// Creates a new instance of the DiskEncryptionSetListPage type. 2704func NewDiskEncryptionSetListPage(cur DiskEncryptionSetList, getNextPage func(context.Context, DiskEncryptionSetList) (DiskEncryptionSetList, error)) DiskEncryptionSetListPage { 2705 return DiskEncryptionSetListPage{ 2706 fn: getNextPage, 2707 desl: cur, 2708 } 2709} 2710 2711// DiskEncryptionSetParameters describes the parameter of customer managed disk encryption set resource id 2712// that can be specified for disk. <br><br> NOTE: The disk encryption set resource id can only be specified 2713// for managed disk. Please refer https://aka.ms/mdssewithcmkoverview for more details. 2714type DiskEncryptionSetParameters struct { 2715 // ID - Resource Id 2716 ID *string `json:"id,omitempty"` 2717} 2718 2719// DiskEncryptionSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 2720// long-running operation. 2721type DiskEncryptionSetsCreateOrUpdateFuture struct { 2722 azure.FutureAPI 2723 // Result returns the result of the asynchronous operation. 2724 // If the operation has not completed it will return an error. 2725 Result func(DiskEncryptionSetsClient) (DiskEncryptionSet, error) 2726} 2727 2728// DiskEncryptionSetsDeleteFuture an abstraction for monitoring and retrieving the results of a 2729// long-running operation. 2730type DiskEncryptionSetsDeleteFuture struct { 2731 azure.FutureAPI 2732 // Result returns the result of the asynchronous operation. 2733 // If the operation has not completed it will return an error. 2734 Result func(DiskEncryptionSetsClient) (autorest.Response, error) 2735} 2736 2737// DiskEncryptionSetsUpdateFuture an abstraction for monitoring and retrieving the results of a 2738// long-running operation. 2739type DiskEncryptionSetsUpdateFuture struct { 2740 azure.FutureAPI 2741 // Result returns the result of the asynchronous operation. 2742 // If the operation has not completed it will return an error. 2743 Result func(DiskEncryptionSetsClient) (DiskEncryptionSet, error) 2744} 2745 2746// DiskEncryptionSettings describes a Encryption Settings for a Disk 2747type DiskEncryptionSettings struct { 2748 // DiskEncryptionKey - Specifies the location of the disk encryption key, which is a Key Vault Secret. 2749 DiskEncryptionKey *KeyVaultSecretReference `json:"diskEncryptionKey,omitempty"` 2750 // KeyEncryptionKey - Specifies the location of the key encryption key in Key Vault. 2751 KeyEncryptionKey *KeyVaultKeyReference `json:"keyEncryptionKey,omitempty"` 2752 // Enabled - Specifies whether disk encryption should be enabled on the virtual machine. 2753 Enabled *bool `json:"enabled,omitempty"` 2754} 2755 2756// DiskEncryptionSetUpdate disk encryption set update resource. 2757type DiskEncryptionSetUpdate struct { 2758 *DiskEncryptionSetUpdateProperties `json:"properties,omitempty"` 2759 // Tags - Resource tags 2760 Tags map[string]*string `json:"tags"` 2761} 2762 2763// MarshalJSON is the custom marshaler for DiskEncryptionSetUpdate. 2764func (desu DiskEncryptionSetUpdate) MarshalJSON() ([]byte, error) { 2765 objectMap := make(map[string]interface{}) 2766 if desu.DiskEncryptionSetUpdateProperties != nil { 2767 objectMap["properties"] = desu.DiskEncryptionSetUpdateProperties 2768 } 2769 if desu.Tags != nil { 2770 objectMap["tags"] = desu.Tags 2771 } 2772 return json.Marshal(objectMap) 2773} 2774 2775// UnmarshalJSON is the custom unmarshaler for DiskEncryptionSetUpdate struct. 2776func (desu *DiskEncryptionSetUpdate) UnmarshalJSON(body []byte) error { 2777 var m map[string]*json.RawMessage 2778 err := json.Unmarshal(body, &m) 2779 if err != nil { 2780 return err 2781 } 2782 for k, v := range m { 2783 switch k { 2784 case "properties": 2785 if v != nil { 2786 var diskEncryptionSetUpdateProperties DiskEncryptionSetUpdateProperties 2787 err = json.Unmarshal(*v, &diskEncryptionSetUpdateProperties) 2788 if err != nil { 2789 return err 2790 } 2791 desu.DiskEncryptionSetUpdateProperties = &diskEncryptionSetUpdateProperties 2792 } 2793 case "tags": 2794 if v != nil { 2795 var tags map[string]*string 2796 err = json.Unmarshal(*v, &tags) 2797 if err != nil { 2798 return err 2799 } 2800 desu.Tags = tags 2801 } 2802 } 2803 } 2804 2805 return nil 2806} 2807 2808// DiskEncryptionSetUpdateProperties disk encryption set resource update properties. 2809type DiskEncryptionSetUpdateProperties struct { 2810 // EncryptionType - Possible values include: 'EncryptionAtRestWithPlatformKey', 'EncryptionAtRestWithCustomerKey', 'EncryptionAtRestWithPlatformAndCustomerKeys' 2811 EncryptionType EncryptionType `json:"encryptionType,omitempty"` 2812 ActiveKey *KeyVaultAndKeyReference `json:"activeKey,omitempty"` 2813} 2814 2815// DiskImageEncryption this is the disk image encryption base class. 2816type DiskImageEncryption struct { 2817 // DiskEncryptionSetID - A relative URI containing the resource ID of the disk encryption set. 2818 DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` 2819} 2820 2821// DiskInstanceView the instance view of the disk. 2822type DiskInstanceView struct { 2823 // Name - The disk name. 2824 Name *string `json:"name,omitempty"` 2825 // EncryptionSettings - Specifies the encryption settings for the OS Disk. <br><br> Minimum api-version: 2015-06-15 2826 EncryptionSettings *[]DiskEncryptionSettings `json:"encryptionSettings,omitempty"` 2827 // Statuses - The resource status information. 2828 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 2829} 2830 2831// DiskList the List Disks operation response. 2832type DiskList struct { 2833 autorest.Response `json:"-"` 2834 // Value - A list of disks. 2835 Value *[]Disk `json:"value,omitempty"` 2836 // NextLink - The uri to fetch the next page of disks. Call ListNext() with this to fetch the next page of disks. 2837 NextLink *string `json:"nextLink,omitempty"` 2838} 2839 2840// DiskListIterator provides access to a complete listing of Disk values. 2841type DiskListIterator struct { 2842 i int 2843 page DiskListPage 2844} 2845 2846// NextWithContext advances to the next value. If there was an error making 2847// the request the iterator does not advance and the error is returned. 2848func (iter *DiskListIterator) NextWithContext(ctx context.Context) (err error) { 2849 if tracing.IsEnabled() { 2850 ctx = tracing.StartSpan(ctx, fqdn+"/DiskListIterator.NextWithContext") 2851 defer func() { 2852 sc := -1 2853 if iter.Response().Response.Response != nil { 2854 sc = iter.Response().Response.Response.StatusCode 2855 } 2856 tracing.EndSpan(ctx, sc, err) 2857 }() 2858 } 2859 iter.i++ 2860 if iter.i < len(iter.page.Values()) { 2861 return nil 2862 } 2863 err = iter.page.NextWithContext(ctx) 2864 if err != nil { 2865 iter.i-- 2866 return err 2867 } 2868 iter.i = 0 2869 return nil 2870} 2871 2872// Next advances to the next value. If there was an error making 2873// the request the iterator does not advance and the error is returned. 2874// Deprecated: Use NextWithContext() instead. 2875func (iter *DiskListIterator) Next() error { 2876 return iter.NextWithContext(context.Background()) 2877} 2878 2879// NotDone returns true if the enumeration should be started or is not yet complete. 2880func (iter DiskListIterator) NotDone() bool { 2881 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2882} 2883 2884// Response returns the raw server response from the last page request. 2885func (iter DiskListIterator) Response() DiskList { 2886 return iter.page.Response() 2887} 2888 2889// Value returns the current value or a zero-initialized value if the 2890// iterator has advanced beyond the end of the collection. 2891func (iter DiskListIterator) Value() Disk { 2892 if !iter.page.NotDone() { 2893 return Disk{} 2894 } 2895 return iter.page.Values()[iter.i] 2896} 2897 2898// Creates a new instance of the DiskListIterator type. 2899func NewDiskListIterator(page DiskListPage) DiskListIterator { 2900 return DiskListIterator{page: page} 2901} 2902 2903// IsEmpty returns true if the ListResult contains no values. 2904func (dl DiskList) IsEmpty() bool { 2905 return dl.Value == nil || len(*dl.Value) == 0 2906} 2907 2908// hasNextLink returns true if the NextLink is not empty. 2909func (dl DiskList) hasNextLink() bool { 2910 return dl.NextLink != nil && len(*dl.NextLink) != 0 2911} 2912 2913// diskListPreparer prepares a request to retrieve the next set of results. 2914// It returns nil if no more results exist. 2915func (dl DiskList) diskListPreparer(ctx context.Context) (*http.Request, error) { 2916 if !dl.hasNextLink() { 2917 return nil, nil 2918 } 2919 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2920 autorest.AsJSON(), 2921 autorest.AsGet(), 2922 autorest.WithBaseURL(to.String(dl.NextLink))) 2923} 2924 2925// DiskListPage contains a page of Disk values. 2926type DiskListPage struct { 2927 fn func(context.Context, DiskList) (DiskList, error) 2928 dl DiskList 2929} 2930 2931// NextWithContext advances to the next page of values. If there was an error making 2932// the request the page does not advance and the error is returned. 2933func (page *DiskListPage) NextWithContext(ctx context.Context) (err error) { 2934 if tracing.IsEnabled() { 2935 ctx = tracing.StartSpan(ctx, fqdn+"/DiskListPage.NextWithContext") 2936 defer func() { 2937 sc := -1 2938 if page.Response().Response.Response != nil { 2939 sc = page.Response().Response.Response.StatusCode 2940 } 2941 tracing.EndSpan(ctx, sc, err) 2942 }() 2943 } 2944 for { 2945 next, err := page.fn(ctx, page.dl) 2946 if err != nil { 2947 return err 2948 } 2949 page.dl = next 2950 if !next.hasNextLink() || !next.IsEmpty() { 2951 break 2952 } 2953 } 2954 return nil 2955} 2956 2957// Next advances to the next page of values. If there was an error making 2958// the request the page does not advance and the error is returned. 2959// Deprecated: Use NextWithContext() instead. 2960func (page *DiskListPage) Next() error { 2961 return page.NextWithContext(context.Background()) 2962} 2963 2964// NotDone returns true if the page enumeration should be started or is not yet complete. 2965func (page DiskListPage) NotDone() bool { 2966 return !page.dl.IsEmpty() 2967} 2968 2969// Response returns the raw server response from the last page request. 2970func (page DiskListPage) Response() DiskList { 2971 return page.dl 2972} 2973 2974// Values returns the slice of values for the current page or nil if there are no values. 2975func (page DiskListPage) Values() []Disk { 2976 if page.dl.IsEmpty() { 2977 return nil 2978 } 2979 return *page.dl.Value 2980} 2981 2982// Creates a new instance of the DiskListPage type. 2983func NewDiskListPage(cur DiskList, getNextPage func(context.Context, DiskList) (DiskList, error)) DiskListPage { 2984 return DiskListPage{ 2985 fn: getNextPage, 2986 dl: cur, 2987 } 2988} 2989 2990// DiskProperties disk resource properties. 2991type DiskProperties struct { 2992 // TimeCreated - READ-ONLY; The time when the disk was created. 2993 TimeCreated *date.Time `json:"timeCreated,omitempty"` 2994 // OsType - The Operating System type. Possible values include: 'Windows', 'Linux' 2995 OsType OperatingSystemTypes `json:"osType,omitempty"` 2996 // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'V1', 'V2' 2997 HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` 2998 // CreationData - Disk source information. CreationData information cannot be changed after the disk has been created. 2999 CreationData *CreationData `json:"creationData,omitempty"` 3000 // 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. 3001 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 3002 // DiskSizeBytes - READ-ONLY; The size of the disk in bytes. This field is read only. 3003 DiskSizeBytes *int64 `json:"diskSizeBytes,omitempty"` 3004 // UniqueID - READ-ONLY; Unique Guid identifying the resource. 3005 UniqueID *string `json:"uniqueId,omitempty"` 3006 // EncryptionSettingsCollection - Encryption settings collection used for Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. 3007 EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` 3008 // ProvisioningState - READ-ONLY; The disk provisioning state. 3009 ProvisioningState *string `json:"provisioningState,omitempty"` 3010 // DiskIOPSReadWrite - The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. 3011 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 3012 // 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. 3013 DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` 3014 // 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. 3015 DiskIOPSReadOnly *int64 `json:"diskIOPSReadOnly,omitempty"` 3016 // 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. 3017 DiskMBpsReadOnly *int64 `json:"diskMBpsReadOnly,omitempty"` 3018 // DiskState - READ-ONLY; The state of the disk. Possible values include: 'Unattached', 'Attached', 'Reserved', 'ActiveSAS', 'ReadyToUpload', 'ActiveUpload' 3019 DiskState DiskState `json:"diskState,omitempty"` 3020 // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 3021 Encryption *Encryption `json:"encryption,omitempty"` 3022 // 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. 3023 MaxShares *int32 `json:"maxShares,omitempty"` 3024 // 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. 3025 ShareInfo *[]ShareInfoElement `json:"shareInfo,omitempty"` 3026 // NetworkAccessPolicy - Possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll' 3027 NetworkAccessPolicy NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` 3028 // DiskAccessID - ARM id of the DiskAccess resource for using private endpoints on disks. 3029 DiskAccessID *string `json:"diskAccessId,omitempty"` 3030} 3031 3032// MarshalJSON is the custom marshaler for DiskProperties. 3033func (dp DiskProperties) MarshalJSON() ([]byte, error) { 3034 objectMap := make(map[string]interface{}) 3035 if dp.OsType != "" { 3036 objectMap["osType"] = dp.OsType 3037 } 3038 if dp.HyperVGeneration != "" { 3039 objectMap["hyperVGeneration"] = dp.HyperVGeneration 3040 } 3041 if dp.CreationData != nil { 3042 objectMap["creationData"] = dp.CreationData 3043 } 3044 if dp.DiskSizeGB != nil { 3045 objectMap["diskSizeGB"] = dp.DiskSizeGB 3046 } 3047 if dp.EncryptionSettingsCollection != nil { 3048 objectMap["encryptionSettingsCollection"] = dp.EncryptionSettingsCollection 3049 } 3050 if dp.DiskIOPSReadWrite != nil { 3051 objectMap["diskIOPSReadWrite"] = dp.DiskIOPSReadWrite 3052 } 3053 if dp.DiskMBpsReadWrite != nil { 3054 objectMap["diskMBpsReadWrite"] = dp.DiskMBpsReadWrite 3055 } 3056 if dp.DiskIOPSReadOnly != nil { 3057 objectMap["diskIOPSReadOnly"] = dp.DiskIOPSReadOnly 3058 } 3059 if dp.DiskMBpsReadOnly != nil { 3060 objectMap["diskMBpsReadOnly"] = dp.DiskMBpsReadOnly 3061 } 3062 if dp.Encryption != nil { 3063 objectMap["encryption"] = dp.Encryption 3064 } 3065 if dp.MaxShares != nil { 3066 objectMap["maxShares"] = dp.MaxShares 3067 } 3068 if dp.NetworkAccessPolicy != "" { 3069 objectMap["networkAccessPolicy"] = dp.NetworkAccessPolicy 3070 } 3071 if dp.DiskAccessID != nil { 3072 objectMap["diskAccessId"] = dp.DiskAccessID 3073 } 3074 return json.Marshal(objectMap) 3075} 3076 3077// DisksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 3078// operation. 3079type DisksCreateOrUpdateFuture struct { 3080 azure.FutureAPI 3081 // Result returns the result of the asynchronous operation. 3082 // If the operation has not completed it will return an error. 3083 Result func(DisksClient) (Disk, error) 3084} 3085 3086// DisksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 3087type DisksDeleteFuture struct { 3088 azure.FutureAPI 3089 // Result returns the result of the asynchronous operation. 3090 // If the operation has not completed it will return an error. 3091 Result func(DisksClient) (autorest.Response, error) 3092} 3093 3094// DisksGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running 3095// operation. 3096type DisksGrantAccessFuture struct { 3097 azure.FutureAPI 3098 // Result returns the result of the asynchronous operation. 3099 // If the operation has not completed it will return an error. 3100 Result func(DisksClient) (AccessURI, error) 3101} 3102 3103// DiskSku the disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, or UltraSSD_LRS. 3104type DiskSku struct { 3105 // Name - The sku name. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS', 'UltraSSDLRS' 3106 Name DiskStorageAccountTypes `json:"name,omitempty"` 3107 // Tier - READ-ONLY; The sku tier. 3108 Tier *string `json:"tier,omitempty"` 3109} 3110 3111// MarshalJSON is the custom marshaler for DiskSku. 3112func (ds DiskSku) MarshalJSON() ([]byte, error) { 3113 objectMap := make(map[string]interface{}) 3114 if ds.Name != "" { 3115 objectMap["name"] = ds.Name 3116 } 3117 return json.Marshal(objectMap) 3118} 3119 3120// DisksRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running 3121// operation. 3122type DisksRevokeAccessFuture struct { 3123 azure.FutureAPI 3124 // Result returns the result of the asynchronous operation. 3125 // If the operation has not completed it will return an error. 3126 Result func(DisksClient) (autorest.Response, error) 3127} 3128 3129// DisksUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. 3130type DisksUpdateFuture struct { 3131 azure.FutureAPI 3132 // Result returns the result of the asynchronous operation. 3133 // If the operation has not completed it will return an error. 3134 Result func(DisksClient) (Disk, error) 3135} 3136 3137// DiskUpdate disk update resource. 3138type DiskUpdate struct { 3139 *DiskUpdateProperties `json:"properties,omitempty"` 3140 // Tags - Resource tags 3141 Tags map[string]*string `json:"tags"` 3142 Sku *DiskSku `json:"sku,omitempty"` 3143} 3144 3145// MarshalJSON is the custom marshaler for DiskUpdate. 3146func (du DiskUpdate) MarshalJSON() ([]byte, error) { 3147 objectMap := make(map[string]interface{}) 3148 if du.DiskUpdateProperties != nil { 3149 objectMap["properties"] = du.DiskUpdateProperties 3150 } 3151 if du.Tags != nil { 3152 objectMap["tags"] = du.Tags 3153 } 3154 if du.Sku != nil { 3155 objectMap["sku"] = du.Sku 3156 } 3157 return json.Marshal(objectMap) 3158} 3159 3160// UnmarshalJSON is the custom unmarshaler for DiskUpdate struct. 3161func (du *DiskUpdate) UnmarshalJSON(body []byte) error { 3162 var m map[string]*json.RawMessage 3163 err := json.Unmarshal(body, &m) 3164 if err != nil { 3165 return err 3166 } 3167 for k, v := range m { 3168 switch k { 3169 case "properties": 3170 if v != nil { 3171 var diskUpdateProperties DiskUpdateProperties 3172 err = json.Unmarshal(*v, &diskUpdateProperties) 3173 if err != nil { 3174 return err 3175 } 3176 du.DiskUpdateProperties = &diskUpdateProperties 3177 } 3178 case "tags": 3179 if v != nil { 3180 var tags map[string]*string 3181 err = json.Unmarshal(*v, &tags) 3182 if err != nil { 3183 return err 3184 } 3185 du.Tags = tags 3186 } 3187 case "sku": 3188 if v != nil { 3189 var sku DiskSku 3190 err = json.Unmarshal(*v, &sku) 3191 if err != nil { 3192 return err 3193 } 3194 du.Sku = &sku 3195 } 3196 } 3197 } 3198 3199 return nil 3200} 3201 3202// DiskUpdateProperties disk resource update properties. 3203type DiskUpdateProperties struct { 3204 // OsType - the Operating System type. Possible values include: 'Windows', 'Linux' 3205 OsType OperatingSystemTypes `json:"osType,omitempty"` 3206 // 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. 3207 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 3208 // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. 3209 EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` 3210 // DiskIOPSReadWrite - The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. 3211 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 3212 // 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. 3213 DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` 3214 // 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. 3215 DiskIOPSReadOnly *int64 `json:"diskIOPSReadOnly,omitempty"` 3216 // 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. 3217 DiskMBpsReadOnly *int64 `json:"diskMBpsReadOnly,omitempty"` 3218 // 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. 3219 MaxShares *int32 `json:"maxShares,omitempty"` 3220 // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 3221 Encryption *Encryption `json:"encryption,omitempty"` 3222 // NetworkAccessPolicy - Possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll' 3223 NetworkAccessPolicy NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` 3224 // DiskAccessID - ARM id of the DiskAccess resource for using private endpoints on disks. 3225 DiskAccessID *string `json:"diskAccessId,omitempty"` 3226} 3227 3228// Encryption encryption at rest settings for disk or snapshot 3229type Encryption struct { 3230 // DiskEncryptionSetID - ResourceId of the disk encryption set to use for enabling encryption at rest. 3231 DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` 3232 // Type - Possible values include: 'EncryptionAtRestWithPlatformKey', 'EncryptionAtRestWithCustomerKey', 'EncryptionAtRestWithPlatformAndCustomerKeys' 3233 Type EncryptionType `json:"type,omitempty"` 3234} 3235 3236// EncryptionImages optional. Allows users to provide customer managed keys for encrypting the OS and data 3237// disks in the gallery artifact. 3238type EncryptionImages struct { 3239 OsDiskImage *OSDiskImageEncryption `json:"osDiskImage,omitempty"` 3240 // DataDiskImages - A list of encryption specifications for data disk images. 3241 DataDiskImages *[]DataDiskImageEncryption `json:"dataDiskImages,omitempty"` 3242} 3243 3244// EncryptionSetIdentity the managed identity for the disk encryption set. It should be given permission on 3245// the key vault before it can be used to encrypt disks. 3246type EncryptionSetIdentity struct { 3247 // Type - The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is supported. Possible values include: 'SystemAssigned' 3248 Type DiskEncryptionSetIdentityType `json:"type,omitempty"` 3249 // 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 3250 PrincipalID *string `json:"principalId,omitempty"` 3251 // 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 3252 TenantID *string `json:"tenantId,omitempty"` 3253} 3254 3255// MarshalJSON is the custom marshaler for EncryptionSetIdentity. 3256func (esi EncryptionSetIdentity) MarshalJSON() ([]byte, error) { 3257 objectMap := make(map[string]interface{}) 3258 if esi.Type != "" { 3259 objectMap["type"] = esi.Type 3260 } 3261 return json.Marshal(objectMap) 3262} 3263 3264// EncryptionSetProperties ... 3265type EncryptionSetProperties struct { 3266 // EncryptionType - Possible values include: 'EncryptionAtRestWithPlatformKey', 'EncryptionAtRestWithCustomerKey', 'EncryptionAtRestWithPlatformAndCustomerKeys' 3267 EncryptionType EncryptionType `json:"encryptionType,omitempty"` 3268 // ActiveKey - The key vault key which is currently used by this disk encryption set. 3269 ActiveKey *KeyVaultAndKeyReference `json:"activeKey,omitempty"` 3270 // 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. 3271 PreviousKeys *[]KeyVaultAndKeyReference `json:"previousKeys,omitempty"` 3272 // ProvisioningState - READ-ONLY; The disk encryption set provisioning state. 3273 ProvisioningState *string `json:"provisioningState,omitempty"` 3274} 3275 3276// MarshalJSON is the custom marshaler for EncryptionSetProperties. 3277func (esp EncryptionSetProperties) MarshalJSON() ([]byte, error) { 3278 objectMap := make(map[string]interface{}) 3279 if esp.EncryptionType != "" { 3280 objectMap["encryptionType"] = esp.EncryptionType 3281 } 3282 if esp.ActiveKey != nil { 3283 objectMap["activeKey"] = esp.ActiveKey 3284 } 3285 return json.Marshal(objectMap) 3286} 3287 3288// EncryptionSettingsCollection encryption settings for disk or snapshot 3289type EncryptionSettingsCollection struct { 3290 // 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. 3291 Enabled *bool `json:"enabled,omitempty"` 3292 // EncryptionSettings - A collection of encryption settings, one for each disk volume. 3293 EncryptionSettings *[]EncryptionSettingsElement `json:"encryptionSettings,omitempty"` 3294 // 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. 3295 EncryptionSettingsVersion *string `json:"encryptionSettingsVersion,omitempty"` 3296} 3297 3298// EncryptionSettingsElement encryption settings for one disk volume. 3299type EncryptionSettingsElement struct { 3300 // DiskEncryptionKey - Key Vault Secret Url and vault id of the disk encryption key 3301 DiskEncryptionKey *KeyVaultAndSecretReference `json:"diskEncryptionKey,omitempty"` 3302 // 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. 3303 KeyEncryptionKey *KeyVaultAndKeyReference `json:"keyEncryptionKey,omitempty"` 3304} 3305 3306// GalleriesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 3307// operation. 3308type GalleriesCreateOrUpdateFuture struct { 3309 azure.FutureAPI 3310 // Result returns the result of the asynchronous operation. 3311 // If the operation has not completed it will return an error. 3312 Result func(GalleriesClient) (Gallery, error) 3313} 3314 3315// GalleriesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 3316// operation. 3317type GalleriesDeleteFuture struct { 3318 azure.FutureAPI 3319 // Result returns the result of the asynchronous operation. 3320 // If the operation has not completed it will return an error. 3321 Result func(GalleriesClient) (autorest.Response, error) 3322} 3323 3324// GalleriesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 3325// operation. 3326type GalleriesUpdateFuture struct { 3327 azure.FutureAPI 3328 // Result returns the result of the asynchronous operation. 3329 // If the operation has not completed it will return an error. 3330 Result func(GalleriesClient) (Gallery, error) 3331} 3332 3333// Gallery specifies information about the Shared Image Gallery that you want to create or update. 3334type Gallery struct { 3335 autorest.Response `json:"-"` 3336 *GalleryProperties `json:"properties,omitempty"` 3337 // ID - READ-ONLY; Resource Id 3338 ID *string `json:"id,omitempty"` 3339 // Name - READ-ONLY; Resource name 3340 Name *string `json:"name,omitempty"` 3341 // Type - READ-ONLY; Resource type 3342 Type *string `json:"type,omitempty"` 3343 // Location - Resource location 3344 Location *string `json:"location,omitempty"` 3345 // Tags - Resource tags 3346 Tags map[string]*string `json:"tags"` 3347} 3348 3349// MarshalJSON is the custom marshaler for Gallery. 3350func (g Gallery) MarshalJSON() ([]byte, error) { 3351 objectMap := make(map[string]interface{}) 3352 if g.GalleryProperties != nil { 3353 objectMap["properties"] = g.GalleryProperties 3354 } 3355 if g.Location != nil { 3356 objectMap["location"] = g.Location 3357 } 3358 if g.Tags != nil { 3359 objectMap["tags"] = g.Tags 3360 } 3361 return json.Marshal(objectMap) 3362} 3363 3364// UnmarshalJSON is the custom unmarshaler for Gallery struct. 3365func (g *Gallery) UnmarshalJSON(body []byte) error { 3366 var m map[string]*json.RawMessage 3367 err := json.Unmarshal(body, &m) 3368 if err != nil { 3369 return err 3370 } 3371 for k, v := range m { 3372 switch k { 3373 case "properties": 3374 if v != nil { 3375 var galleryProperties GalleryProperties 3376 err = json.Unmarshal(*v, &galleryProperties) 3377 if err != nil { 3378 return err 3379 } 3380 g.GalleryProperties = &galleryProperties 3381 } 3382 case "id": 3383 if v != nil { 3384 var ID string 3385 err = json.Unmarshal(*v, &ID) 3386 if err != nil { 3387 return err 3388 } 3389 g.ID = &ID 3390 } 3391 case "name": 3392 if v != nil { 3393 var name string 3394 err = json.Unmarshal(*v, &name) 3395 if err != nil { 3396 return err 3397 } 3398 g.Name = &name 3399 } 3400 case "type": 3401 if v != nil { 3402 var typeVar string 3403 err = json.Unmarshal(*v, &typeVar) 3404 if err != nil { 3405 return err 3406 } 3407 g.Type = &typeVar 3408 } 3409 case "location": 3410 if v != nil { 3411 var location string 3412 err = json.Unmarshal(*v, &location) 3413 if err != nil { 3414 return err 3415 } 3416 g.Location = &location 3417 } 3418 case "tags": 3419 if v != nil { 3420 var tags map[string]*string 3421 err = json.Unmarshal(*v, &tags) 3422 if err != nil { 3423 return err 3424 } 3425 g.Tags = tags 3426 } 3427 } 3428 } 3429 3430 return nil 3431} 3432 3433// GalleryApplication specifies information about the gallery Application Definition that you want to 3434// create or update. 3435type GalleryApplication struct { 3436 autorest.Response `json:"-"` 3437 *GalleryApplicationProperties `json:"properties,omitempty"` 3438 // ID - READ-ONLY; Resource Id 3439 ID *string `json:"id,omitempty"` 3440 // Name - READ-ONLY; Resource name 3441 Name *string `json:"name,omitempty"` 3442 // Type - READ-ONLY; Resource type 3443 Type *string `json:"type,omitempty"` 3444 // Location - Resource location 3445 Location *string `json:"location,omitempty"` 3446 // Tags - Resource tags 3447 Tags map[string]*string `json:"tags"` 3448} 3449 3450// MarshalJSON is the custom marshaler for GalleryApplication. 3451func (ga GalleryApplication) MarshalJSON() ([]byte, error) { 3452 objectMap := make(map[string]interface{}) 3453 if ga.GalleryApplicationProperties != nil { 3454 objectMap["properties"] = ga.GalleryApplicationProperties 3455 } 3456 if ga.Location != nil { 3457 objectMap["location"] = ga.Location 3458 } 3459 if ga.Tags != nil { 3460 objectMap["tags"] = ga.Tags 3461 } 3462 return json.Marshal(objectMap) 3463} 3464 3465// UnmarshalJSON is the custom unmarshaler for GalleryApplication struct. 3466func (ga *GalleryApplication) UnmarshalJSON(body []byte) error { 3467 var m map[string]*json.RawMessage 3468 err := json.Unmarshal(body, &m) 3469 if err != nil { 3470 return err 3471 } 3472 for k, v := range m { 3473 switch k { 3474 case "properties": 3475 if v != nil { 3476 var galleryApplicationProperties GalleryApplicationProperties 3477 err = json.Unmarshal(*v, &galleryApplicationProperties) 3478 if err != nil { 3479 return err 3480 } 3481 ga.GalleryApplicationProperties = &galleryApplicationProperties 3482 } 3483 case "id": 3484 if v != nil { 3485 var ID string 3486 err = json.Unmarshal(*v, &ID) 3487 if err != nil { 3488 return err 3489 } 3490 ga.ID = &ID 3491 } 3492 case "name": 3493 if v != nil { 3494 var name string 3495 err = json.Unmarshal(*v, &name) 3496 if err != nil { 3497 return err 3498 } 3499 ga.Name = &name 3500 } 3501 case "type": 3502 if v != nil { 3503 var typeVar string 3504 err = json.Unmarshal(*v, &typeVar) 3505 if err != nil { 3506 return err 3507 } 3508 ga.Type = &typeVar 3509 } 3510 case "location": 3511 if v != nil { 3512 var location string 3513 err = json.Unmarshal(*v, &location) 3514 if err != nil { 3515 return err 3516 } 3517 ga.Location = &location 3518 } 3519 case "tags": 3520 if v != nil { 3521 var tags map[string]*string 3522 err = json.Unmarshal(*v, &tags) 3523 if err != nil { 3524 return err 3525 } 3526 ga.Tags = tags 3527 } 3528 } 3529 } 3530 3531 return nil 3532} 3533 3534// GalleryApplicationList the List Gallery Applications operation response. 3535type GalleryApplicationList struct { 3536 autorest.Response `json:"-"` 3537 // Value - A list of Gallery Applications. 3538 Value *[]GalleryApplication `json:"value,omitempty"` 3539 // 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. 3540 NextLink *string `json:"nextLink,omitempty"` 3541} 3542 3543// GalleryApplicationListIterator provides access to a complete listing of GalleryApplication values. 3544type GalleryApplicationListIterator struct { 3545 i int 3546 page GalleryApplicationListPage 3547} 3548 3549// NextWithContext advances to the next value. If there was an error making 3550// the request the iterator does not advance and the error is returned. 3551func (iter *GalleryApplicationListIterator) NextWithContext(ctx context.Context) (err error) { 3552 if tracing.IsEnabled() { 3553 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationListIterator.NextWithContext") 3554 defer func() { 3555 sc := -1 3556 if iter.Response().Response.Response != nil { 3557 sc = iter.Response().Response.Response.StatusCode 3558 } 3559 tracing.EndSpan(ctx, sc, err) 3560 }() 3561 } 3562 iter.i++ 3563 if iter.i < len(iter.page.Values()) { 3564 return nil 3565 } 3566 err = iter.page.NextWithContext(ctx) 3567 if err != nil { 3568 iter.i-- 3569 return err 3570 } 3571 iter.i = 0 3572 return nil 3573} 3574 3575// Next advances to the next value. If there was an error making 3576// the request the iterator does not advance and the error is returned. 3577// Deprecated: Use NextWithContext() instead. 3578func (iter *GalleryApplicationListIterator) Next() error { 3579 return iter.NextWithContext(context.Background()) 3580} 3581 3582// NotDone returns true if the enumeration should be started or is not yet complete. 3583func (iter GalleryApplicationListIterator) NotDone() bool { 3584 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3585} 3586 3587// Response returns the raw server response from the last page request. 3588func (iter GalleryApplicationListIterator) Response() GalleryApplicationList { 3589 return iter.page.Response() 3590} 3591 3592// Value returns the current value or a zero-initialized value if the 3593// iterator has advanced beyond the end of the collection. 3594func (iter GalleryApplicationListIterator) Value() GalleryApplication { 3595 if !iter.page.NotDone() { 3596 return GalleryApplication{} 3597 } 3598 return iter.page.Values()[iter.i] 3599} 3600 3601// Creates a new instance of the GalleryApplicationListIterator type. 3602func NewGalleryApplicationListIterator(page GalleryApplicationListPage) GalleryApplicationListIterator { 3603 return GalleryApplicationListIterator{page: page} 3604} 3605 3606// IsEmpty returns true if the ListResult contains no values. 3607func (gal GalleryApplicationList) IsEmpty() bool { 3608 return gal.Value == nil || len(*gal.Value) == 0 3609} 3610 3611// hasNextLink returns true if the NextLink is not empty. 3612func (gal GalleryApplicationList) hasNextLink() bool { 3613 return gal.NextLink != nil && len(*gal.NextLink) != 0 3614} 3615 3616// galleryApplicationListPreparer prepares a request to retrieve the next set of results. 3617// It returns nil if no more results exist. 3618func (gal GalleryApplicationList) galleryApplicationListPreparer(ctx context.Context) (*http.Request, error) { 3619 if !gal.hasNextLink() { 3620 return nil, nil 3621 } 3622 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3623 autorest.AsJSON(), 3624 autorest.AsGet(), 3625 autorest.WithBaseURL(to.String(gal.NextLink))) 3626} 3627 3628// GalleryApplicationListPage contains a page of GalleryApplication values. 3629type GalleryApplicationListPage struct { 3630 fn func(context.Context, GalleryApplicationList) (GalleryApplicationList, error) 3631 gal GalleryApplicationList 3632} 3633 3634// NextWithContext advances to the next page of values. If there was an error making 3635// the request the page does not advance and the error is returned. 3636func (page *GalleryApplicationListPage) NextWithContext(ctx context.Context) (err error) { 3637 if tracing.IsEnabled() { 3638 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationListPage.NextWithContext") 3639 defer func() { 3640 sc := -1 3641 if page.Response().Response.Response != nil { 3642 sc = page.Response().Response.Response.StatusCode 3643 } 3644 tracing.EndSpan(ctx, sc, err) 3645 }() 3646 } 3647 for { 3648 next, err := page.fn(ctx, page.gal) 3649 if err != nil { 3650 return err 3651 } 3652 page.gal = next 3653 if !next.hasNextLink() || !next.IsEmpty() { 3654 break 3655 } 3656 } 3657 return nil 3658} 3659 3660// Next advances to the next page of values. If there was an error making 3661// the request the page does not advance and the error is returned. 3662// Deprecated: Use NextWithContext() instead. 3663func (page *GalleryApplicationListPage) Next() error { 3664 return page.NextWithContext(context.Background()) 3665} 3666 3667// NotDone returns true if the page enumeration should be started or is not yet complete. 3668func (page GalleryApplicationListPage) NotDone() bool { 3669 return !page.gal.IsEmpty() 3670} 3671 3672// Response returns the raw server response from the last page request. 3673func (page GalleryApplicationListPage) Response() GalleryApplicationList { 3674 return page.gal 3675} 3676 3677// Values returns the slice of values for the current page or nil if there are no values. 3678func (page GalleryApplicationListPage) Values() []GalleryApplication { 3679 if page.gal.IsEmpty() { 3680 return nil 3681 } 3682 return *page.gal.Value 3683} 3684 3685// Creates a new instance of the GalleryApplicationListPage type. 3686func NewGalleryApplicationListPage(cur GalleryApplicationList, getNextPage func(context.Context, GalleryApplicationList) (GalleryApplicationList, error)) GalleryApplicationListPage { 3687 return GalleryApplicationListPage{ 3688 fn: getNextPage, 3689 gal: cur, 3690 } 3691} 3692 3693// GalleryApplicationProperties describes the properties of a gallery Application Definition. 3694type GalleryApplicationProperties struct { 3695 // Description - The description of this gallery Application Definition resource. This property is updatable. 3696 Description *string `json:"description,omitempty"` 3697 // Eula - The Eula agreement for the gallery Application Definition. 3698 Eula *string `json:"eula,omitempty"` 3699 // PrivacyStatementURI - The privacy statement uri. 3700 PrivacyStatementURI *string `json:"privacyStatementUri,omitempty"` 3701 // ReleaseNoteURI - The release note uri. 3702 ReleaseNoteURI *string `json:"releaseNoteUri,omitempty"` 3703 // EndOfLifeDate - The end of life date of the gallery Application Definition. This property can be used for decommissioning purposes. This property is updatable. 3704 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 3705 // 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' 3706 SupportedOSType OperatingSystemTypes `json:"supportedOSType,omitempty"` 3707} 3708 3709// GalleryApplicationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 3710// long-running operation. 3711type GalleryApplicationsCreateOrUpdateFuture struct { 3712 azure.FutureAPI 3713 // Result returns the result of the asynchronous operation. 3714 // If the operation has not completed it will return an error. 3715 Result func(GalleryApplicationsClient) (GalleryApplication, error) 3716} 3717 3718// GalleryApplicationsDeleteFuture an abstraction for monitoring and retrieving the results of a 3719// long-running operation. 3720type GalleryApplicationsDeleteFuture struct { 3721 azure.FutureAPI 3722 // Result returns the result of the asynchronous operation. 3723 // If the operation has not completed it will return an error. 3724 Result func(GalleryApplicationsClient) (autorest.Response, error) 3725} 3726 3727// GalleryApplicationsUpdateFuture an abstraction for monitoring and retrieving the results of a 3728// long-running operation. 3729type GalleryApplicationsUpdateFuture struct { 3730 azure.FutureAPI 3731 // Result returns the result of the asynchronous operation. 3732 // If the operation has not completed it will return an error. 3733 Result func(GalleryApplicationsClient) (GalleryApplication, error) 3734} 3735 3736// GalleryApplicationUpdate specifies information about the gallery Application Definition that you want to 3737// update. 3738type GalleryApplicationUpdate struct { 3739 *GalleryApplicationProperties `json:"properties,omitempty"` 3740 // ID - READ-ONLY; Resource Id 3741 ID *string `json:"id,omitempty"` 3742 // Name - READ-ONLY; Resource name 3743 Name *string `json:"name,omitempty"` 3744 // Type - READ-ONLY; Resource type 3745 Type *string `json:"type,omitempty"` 3746 // Tags - Resource tags 3747 Tags map[string]*string `json:"tags"` 3748} 3749 3750// MarshalJSON is the custom marshaler for GalleryApplicationUpdate. 3751func (gau GalleryApplicationUpdate) MarshalJSON() ([]byte, error) { 3752 objectMap := make(map[string]interface{}) 3753 if gau.GalleryApplicationProperties != nil { 3754 objectMap["properties"] = gau.GalleryApplicationProperties 3755 } 3756 if gau.Tags != nil { 3757 objectMap["tags"] = gau.Tags 3758 } 3759 return json.Marshal(objectMap) 3760} 3761 3762// UnmarshalJSON is the custom unmarshaler for GalleryApplicationUpdate struct. 3763func (gau *GalleryApplicationUpdate) UnmarshalJSON(body []byte) error { 3764 var m map[string]*json.RawMessage 3765 err := json.Unmarshal(body, &m) 3766 if err != nil { 3767 return err 3768 } 3769 for k, v := range m { 3770 switch k { 3771 case "properties": 3772 if v != nil { 3773 var galleryApplicationProperties GalleryApplicationProperties 3774 err = json.Unmarshal(*v, &galleryApplicationProperties) 3775 if err != nil { 3776 return err 3777 } 3778 gau.GalleryApplicationProperties = &galleryApplicationProperties 3779 } 3780 case "id": 3781 if v != nil { 3782 var ID string 3783 err = json.Unmarshal(*v, &ID) 3784 if err != nil { 3785 return err 3786 } 3787 gau.ID = &ID 3788 } 3789 case "name": 3790 if v != nil { 3791 var name string 3792 err = json.Unmarshal(*v, &name) 3793 if err != nil { 3794 return err 3795 } 3796 gau.Name = &name 3797 } 3798 case "type": 3799 if v != nil { 3800 var typeVar string 3801 err = json.Unmarshal(*v, &typeVar) 3802 if err != nil { 3803 return err 3804 } 3805 gau.Type = &typeVar 3806 } 3807 case "tags": 3808 if v != nil { 3809 var tags map[string]*string 3810 err = json.Unmarshal(*v, &tags) 3811 if err != nil { 3812 return err 3813 } 3814 gau.Tags = tags 3815 } 3816 } 3817 } 3818 3819 return nil 3820} 3821 3822// GalleryApplicationVersion specifies information about the gallery Application Version that you want to 3823// create or update. 3824type GalleryApplicationVersion struct { 3825 autorest.Response `json:"-"` 3826 *GalleryApplicationVersionProperties `json:"properties,omitempty"` 3827 // ID - READ-ONLY; Resource Id 3828 ID *string `json:"id,omitempty"` 3829 // Name - READ-ONLY; Resource name 3830 Name *string `json:"name,omitempty"` 3831 // Type - READ-ONLY; Resource type 3832 Type *string `json:"type,omitempty"` 3833 // Location - Resource location 3834 Location *string `json:"location,omitempty"` 3835 // Tags - Resource tags 3836 Tags map[string]*string `json:"tags"` 3837} 3838 3839// MarshalJSON is the custom marshaler for GalleryApplicationVersion. 3840func (gav GalleryApplicationVersion) MarshalJSON() ([]byte, error) { 3841 objectMap := make(map[string]interface{}) 3842 if gav.GalleryApplicationVersionProperties != nil { 3843 objectMap["properties"] = gav.GalleryApplicationVersionProperties 3844 } 3845 if gav.Location != nil { 3846 objectMap["location"] = gav.Location 3847 } 3848 if gav.Tags != nil { 3849 objectMap["tags"] = gav.Tags 3850 } 3851 return json.Marshal(objectMap) 3852} 3853 3854// UnmarshalJSON is the custom unmarshaler for GalleryApplicationVersion struct. 3855func (gav *GalleryApplicationVersion) UnmarshalJSON(body []byte) error { 3856 var m map[string]*json.RawMessage 3857 err := json.Unmarshal(body, &m) 3858 if err != nil { 3859 return err 3860 } 3861 for k, v := range m { 3862 switch k { 3863 case "properties": 3864 if v != nil { 3865 var galleryApplicationVersionProperties GalleryApplicationVersionProperties 3866 err = json.Unmarshal(*v, &galleryApplicationVersionProperties) 3867 if err != nil { 3868 return err 3869 } 3870 gav.GalleryApplicationVersionProperties = &galleryApplicationVersionProperties 3871 } 3872 case "id": 3873 if v != nil { 3874 var ID string 3875 err = json.Unmarshal(*v, &ID) 3876 if err != nil { 3877 return err 3878 } 3879 gav.ID = &ID 3880 } 3881 case "name": 3882 if v != nil { 3883 var name string 3884 err = json.Unmarshal(*v, &name) 3885 if err != nil { 3886 return err 3887 } 3888 gav.Name = &name 3889 } 3890 case "type": 3891 if v != nil { 3892 var typeVar string 3893 err = json.Unmarshal(*v, &typeVar) 3894 if err != nil { 3895 return err 3896 } 3897 gav.Type = &typeVar 3898 } 3899 case "location": 3900 if v != nil { 3901 var location string 3902 err = json.Unmarshal(*v, &location) 3903 if err != nil { 3904 return err 3905 } 3906 gav.Location = &location 3907 } 3908 case "tags": 3909 if v != nil { 3910 var tags map[string]*string 3911 err = json.Unmarshal(*v, &tags) 3912 if err != nil { 3913 return err 3914 } 3915 gav.Tags = tags 3916 } 3917 } 3918 } 3919 3920 return nil 3921} 3922 3923// GalleryApplicationVersionList the List Gallery Application version operation response. 3924type GalleryApplicationVersionList struct { 3925 autorest.Response `json:"-"` 3926 // Value - A list of gallery Application Versions. 3927 Value *[]GalleryApplicationVersion `json:"value,omitempty"` 3928 // 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. 3929 NextLink *string `json:"nextLink,omitempty"` 3930} 3931 3932// GalleryApplicationVersionListIterator provides access to a complete listing of GalleryApplicationVersion 3933// values. 3934type GalleryApplicationVersionListIterator struct { 3935 i int 3936 page GalleryApplicationVersionListPage 3937} 3938 3939// NextWithContext advances to the next value. If there was an error making 3940// the request the iterator does not advance and the error is returned. 3941func (iter *GalleryApplicationVersionListIterator) NextWithContext(ctx context.Context) (err error) { 3942 if tracing.IsEnabled() { 3943 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionListIterator.NextWithContext") 3944 defer func() { 3945 sc := -1 3946 if iter.Response().Response.Response != nil { 3947 sc = iter.Response().Response.Response.StatusCode 3948 } 3949 tracing.EndSpan(ctx, sc, err) 3950 }() 3951 } 3952 iter.i++ 3953 if iter.i < len(iter.page.Values()) { 3954 return nil 3955 } 3956 err = iter.page.NextWithContext(ctx) 3957 if err != nil { 3958 iter.i-- 3959 return err 3960 } 3961 iter.i = 0 3962 return nil 3963} 3964 3965// Next advances to the next value. If there was an error making 3966// the request the iterator does not advance and the error is returned. 3967// Deprecated: Use NextWithContext() instead. 3968func (iter *GalleryApplicationVersionListIterator) Next() error { 3969 return iter.NextWithContext(context.Background()) 3970} 3971 3972// NotDone returns true if the enumeration should be started or is not yet complete. 3973func (iter GalleryApplicationVersionListIterator) NotDone() bool { 3974 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3975} 3976 3977// Response returns the raw server response from the last page request. 3978func (iter GalleryApplicationVersionListIterator) Response() GalleryApplicationVersionList { 3979 return iter.page.Response() 3980} 3981 3982// Value returns the current value or a zero-initialized value if the 3983// iterator has advanced beyond the end of the collection. 3984func (iter GalleryApplicationVersionListIterator) Value() GalleryApplicationVersion { 3985 if !iter.page.NotDone() { 3986 return GalleryApplicationVersion{} 3987 } 3988 return iter.page.Values()[iter.i] 3989} 3990 3991// Creates a new instance of the GalleryApplicationVersionListIterator type. 3992func NewGalleryApplicationVersionListIterator(page GalleryApplicationVersionListPage) GalleryApplicationVersionListIterator { 3993 return GalleryApplicationVersionListIterator{page: page} 3994} 3995 3996// IsEmpty returns true if the ListResult contains no values. 3997func (gavl GalleryApplicationVersionList) IsEmpty() bool { 3998 return gavl.Value == nil || len(*gavl.Value) == 0 3999} 4000 4001// hasNextLink returns true if the NextLink is not empty. 4002func (gavl GalleryApplicationVersionList) hasNextLink() bool { 4003 return gavl.NextLink != nil && len(*gavl.NextLink) != 0 4004} 4005 4006// galleryApplicationVersionListPreparer prepares a request to retrieve the next set of results. 4007// It returns nil if no more results exist. 4008func (gavl GalleryApplicationVersionList) galleryApplicationVersionListPreparer(ctx context.Context) (*http.Request, error) { 4009 if !gavl.hasNextLink() { 4010 return nil, nil 4011 } 4012 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4013 autorest.AsJSON(), 4014 autorest.AsGet(), 4015 autorest.WithBaseURL(to.String(gavl.NextLink))) 4016} 4017 4018// GalleryApplicationVersionListPage contains a page of GalleryApplicationVersion values. 4019type GalleryApplicationVersionListPage struct { 4020 fn func(context.Context, GalleryApplicationVersionList) (GalleryApplicationVersionList, error) 4021 gavl GalleryApplicationVersionList 4022} 4023 4024// NextWithContext advances to the next page of values. If there was an error making 4025// the request the page does not advance and the error is returned. 4026func (page *GalleryApplicationVersionListPage) NextWithContext(ctx context.Context) (err error) { 4027 if tracing.IsEnabled() { 4028 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionListPage.NextWithContext") 4029 defer func() { 4030 sc := -1 4031 if page.Response().Response.Response != nil { 4032 sc = page.Response().Response.Response.StatusCode 4033 } 4034 tracing.EndSpan(ctx, sc, err) 4035 }() 4036 } 4037 for { 4038 next, err := page.fn(ctx, page.gavl) 4039 if err != nil { 4040 return err 4041 } 4042 page.gavl = next 4043 if !next.hasNextLink() || !next.IsEmpty() { 4044 break 4045 } 4046 } 4047 return nil 4048} 4049 4050// Next advances to the next page of values. If there was an error making 4051// the request the page does not advance and the error is returned. 4052// Deprecated: Use NextWithContext() instead. 4053func (page *GalleryApplicationVersionListPage) Next() error { 4054 return page.NextWithContext(context.Background()) 4055} 4056 4057// NotDone returns true if the page enumeration should be started or is not yet complete. 4058func (page GalleryApplicationVersionListPage) NotDone() bool { 4059 return !page.gavl.IsEmpty() 4060} 4061 4062// Response returns the raw server response from the last page request. 4063func (page GalleryApplicationVersionListPage) Response() GalleryApplicationVersionList { 4064 return page.gavl 4065} 4066 4067// Values returns the slice of values for the current page or nil if there are no values. 4068func (page GalleryApplicationVersionListPage) Values() []GalleryApplicationVersion { 4069 if page.gavl.IsEmpty() { 4070 return nil 4071 } 4072 return *page.gavl.Value 4073} 4074 4075// Creates a new instance of the GalleryApplicationVersionListPage type. 4076func NewGalleryApplicationVersionListPage(cur GalleryApplicationVersionList, getNextPage func(context.Context, GalleryApplicationVersionList) (GalleryApplicationVersionList, error)) GalleryApplicationVersionListPage { 4077 return GalleryApplicationVersionListPage{ 4078 fn: getNextPage, 4079 gavl: cur, 4080 } 4081} 4082 4083// GalleryApplicationVersionProperties describes the properties of a gallery Image Version. 4084type GalleryApplicationVersionProperties struct { 4085 PublishingProfile *GalleryApplicationVersionPublishingProfile `json:"publishingProfile,omitempty"` 4086 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningState1Creating', 'ProvisioningState1Updating', 'ProvisioningState1Failed', 'ProvisioningState1Succeeded', 'ProvisioningState1Deleting', 'ProvisioningState1Migrating' 4087 ProvisioningState ProvisioningState1 `json:"provisioningState,omitempty"` 4088 // ReplicationStatus - READ-ONLY 4089 ReplicationStatus *ReplicationStatus `json:"replicationStatus,omitempty"` 4090} 4091 4092// MarshalJSON is the custom marshaler for GalleryApplicationVersionProperties. 4093func (gavp GalleryApplicationVersionProperties) MarshalJSON() ([]byte, error) { 4094 objectMap := make(map[string]interface{}) 4095 if gavp.PublishingProfile != nil { 4096 objectMap["publishingProfile"] = gavp.PublishingProfile 4097 } 4098 return json.Marshal(objectMap) 4099} 4100 4101// GalleryApplicationVersionPublishingProfile the publishing profile of a gallery Image Version. 4102type GalleryApplicationVersionPublishingProfile struct { 4103 Source *UserArtifactSource `json:"source,omitempty"` 4104 // ContentType - Optional. May be used to help process this file. The type of file contained in the source, e.g. zip, json, etc. 4105 ContentType *string `json:"contentType,omitempty"` 4106 // EnableHealthCheck - Optional. Whether or not this application reports health. 4107 EnableHealthCheck *bool `json:"enableHealthCheck,omitempty"` 4108 // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. 4109 TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` 4110 // 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. 4111 ReplicaCount *int32 `json:"replicaCount,omitempty"` 4112 // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. 4113 ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` 4114 // PublishedDate - READ-ONLY; The timestamp for when the gallery Image Version is published. 4115 PublishedDate *date.Time `json:"publishedDate,omitempty"` 4116 // EndOfLifeDate - The end of life date of the gallery Image Version. This property can be used for decommissioning purposes. This property is updatable. 4117 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 4118 // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' 4119 StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` 4120} 4121 4122// MarshalJSON is the custom marshaler for GalleryApplicationVersionPublishingProfile. 4123func (gavpp GalleryApplicationVersionPublishingProfile) MarshalJSON() ([]byte, error) { 4124 objectMap := make(map[string]interface{}) 4125 if gavpp.Source != nil { 4126 objectMap["source"] = gavpp.Source 4127 } 4128 if gavpp.ContentType != nil { 4129 objectMap["contentType"] = gavpp.ContentType 4130 } 4131 if gavpp.EnableHealthCheck != nil { 4132 objectMap["enableHealthCheck"] = gavpp.EnableHealthCheck 4133 } 4134 if gavpp.TargetRegions != nil { 4135 objectMap["targetRegions"] = gavpp.TargetRegions 4136 } 4137 if gavpp.ReplicaCount != nil { 4138 objectMap["replicaCount"] = gavpp.ReplicaCount 4139 } 4140 if gavpp.ExcludeFromLatest != nil { 4141 objectMap["excludeFromLatest"] = gavpp.ExcludeFromLatest 4142 } 4143 if gavpp.EndOfLifeDate != nil { 4144 objectMap["endOfLifeDate"] = gavpp.EndOfLifeDate 4145 } 4146 if gavpp.StorageAccountType != "" { 4147 objectMap["storageAccountType"] = gavpp.StorageAccountType 4148 } 4149 return json.Marshal(objectMap) 4150} 4151 4152// GalleryApplicationVersionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results 4153// of a long-running operation. 4154type GalleryApplicationVersionsCreateOrUpdateFuture struct { 4155 azure.FutureAPI 4156 // Result returns the result of the asynchronous operation. 4157 // If the operation has not completed it will return an error. 4158 Result func(GalleryApplicationVersionsClient) (GalleryApplicationVersion, error) 4159} 4160 4161// GalleryApplicationVersionsDeleteFuture an abstraction for monitoring and retrieving the results of a 4162// long-running operation. 4163type GalleryApplicationVersionsDeleteFuture struct { 4164 azure.FutureAPI 4165 // Result returns the result of the asynchronous operation. 4166 // If the operation has not completed it will return an error. 4167 Result func(GalleryApplicationVersionsClient) (autorest.Response, error) 4168} 4169 4170// GalleryApplicationVersionsUpdateFuture an abstraction for monitoring and retrieving the results of a 4171// long-running operation. 4172type GalleryApplicationVersionsUpdateFuture struct { 4173 azure.FutureAPI 4174 // Result returns the result of the asynchronous operation. 4175 // If the operation has not completed it will return an error. 4176 Result func(GalleryApplicationVersionsClient) (GalleryApplicationVersion, error) 4177} 4178 4179// GalleryApplicationVersionUpdate specifies information about the gallery Application Version that you 4180// want to update. 4181type GalleryApplicationVersionUpdate struct { 4182 *GalleryApplicationVersionProperties `json:"properties,omitempty"` 4183 // ID - READ-ONLY; Resource Id 4184 ID *string `json:"id,omitempty"` 4185 // Name - READ-ONLY; Resource name 4186 Name *string `json:"name,omitempty"` 4187 // Type - READ-ONLY; Resource type 4188 Type *string `json:"type,omitempty"` 4189 // Tags - Resource tags 4190 Tags map[string]*string `json:"tags"` 4191} 4192 4193// MarshalJSON is the custom marshaler for GalleryApplicationVersionUpdate. 4194func (gavu GalleryApplicationVersionUpdate) MarshalJSON() ([]byte, error) { 4195 objectMap := make(map[string]interface{}) 4196 if gavu.GalleryApplicationVersionProperties != nil { 4197 objectMap["properties"] = gavu.GalleryApplicationVersionProperties 4198 } 4199 if gavu.Tags != nil { 4200 objectMap["tags"] = gavu.Tags 4201 } 4202 return json.Marshal(objectMap) 4203} 4204 4205// UnmarshalJSON is the custom unmarshaler for GalleryApplicationVersionUpdate struct. 4206func (gavu *GalleryApplicationVersionUpdate) UnmarshalJSON(body []byte) error { 4207 var m map[string]*json.RawMessage 4208 err := json.Unmarshal(body, &m) 4209 if err != nil { 4210 return err 4211 } 4212 for k, v := range m { 4213 switch k { 4214 case "properties": 4215 if v != nil { 4216 var galleryApplicationVersionProperties GalleryApplicationVersionProperties 4217 err = json.Unmarshal(*v, &galleryApplicationVersionProperties) 4218 if err != nil { 4219 return err 4220 } 4221 gavu.GalleryApplicationVersionProperties = &galleryApplicationVersionProperties 4222 } 4223 case "id": 4224 if v != nil { 4225 var ID string 4226 err = json.Unmarshal(*v, &ID) 4227 if err != nil { 4228 return err 4229 } 4230 gavu.ID = &ID 4231 } 4232 case "name": 4233 if v != nil { 4234 var name string 4235 err = json.Unmarshal(*v, &name) 4236 if err != nil { 4237 return err 4238 } 4239 gavu.Name = &name 4240 } 4241 case "type": 4242 if v != nil { 4243 var typeVar string 4244 err = json.Unmarshal(*v, &typeVar) 4245 if err != nil { 4246 return err 4247 } 4248 gavu.Type = &typeVar 4249 } 4250 case "tags": 4251 if v != nil { 4252 var tags map[string]*string 4253 err = json.Unmarshal(*v, &tags) 4254 if err != nil { 4255 return err 4256 } 4257 gavu.Tags = tags 4258 } 4259 } 4260 } 4261 4262 return nil 4263} 4264 4265// GalleryArtifactPublishingProfileBase describes the basic gallery artifact publishing profile. 4266type GalleryArtifactPublishingProfileBase struct { 4267 // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. 4268 TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` 4269 // 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. 4270 ReplicaCount *int32 `json:"replicaCount,omitempty"` 4271 // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. 4272 ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` 4273 // PublishedDate - READ-ONLY; The timestamp for when the gallery Image Version is published. 4274 PublishedDate *date.Time `json:"publishedDate,omitempty"` 4275 // EndOfLifeDate - The end of life date of the gallery Image Version. This property can be used for decommissioning purposes. This property is updatable. 4276 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 4277 // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' 4278 StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` 4279} 4280 4281// MarshalJSON is the custom marshaler for GalleryArtifactPublishingProfileBase. 4282func (gappb GalleryArtifactPublishingProfileBase) MarshalJSON() ([]byte, error) { 4283 objectMap := make(map[string]interface{}) 4284 if gappb.TargetRegions != nil { 4285 objectMap["targetRegions"] = gappb.TargetRegions 4286 } 4287 if gappb.ReplicaCount != nil { 4288 objectMap["replicaCount"] = gappb.ReplicaCount 4289 } 4290 if gappb.ExcludeFromLatest != nil { 4291 objectMap["excludeFromLatest"] = gappb.ExcludeFromLatest 4292 } 4293 if gappb.EndOfLifeDate != nil { 4294 objectMap["endOfLifeDate"] = gappb.EndOfLifeDate 4295 } 4296 if gappb.StorageAccountType != "" { 4297 objectMap["storageAccountType"] = gappb.StorageAccountType 4298 } 4299 return json.Marshal(objectMap) 4300} 4301 4302// GalleryArtifactSource the source image from which the Image Version is going to be created. 4303type GalleryArtifactSource struct { 4304 ManagedImage *ManagedArtifact `json:"managedImage,omitempty"` 4305} 4306 4307// GalleryArtifactVersionSource the gallery artifact version source. 4308type GalleryArtifactVersionSource struct { 4309 // ID - The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, or user image. 4310 ID *string `json:"id,omitempty"` 4311} 4312 4313// GalleryDataDiskImage this is the data disk image. 4314type GalleryDataDiskImage struct { 4315 // 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. 4316 Lun *int32 `json:"lun,omitempty"` 4317 // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. 4318 SizeInGB *int32 `json:"sizeInGB,omitempty"` 4319 // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' 4320 HostCaching HostCaching `json:"hostCaching,omitempty"` 4321 Source *GalleryArtifactVersionSource `json:"source,omitempty"` 4322} 4323 4324// MarshalJSON is the custom marshaler for GalleryDataDiskImage. 4325func (gddi GalleryDataDiskImage) MarshalJSON() ([]byte, error) { 4326 objectMap := make(map[string]interface{}) 4327 if gddi.Lun != nil { 4328 objectMap["lun"] = gddi.Lun 4329 } 4330 if gddi.HostCaching != "" { 4331 objectMap["hostCaching"] = gddi.HostCaching 4332 } 4333 if gddi.Source != nil { 4334 objectMap["source"] = gddi.Source 4335 } 4336 return json.Marshal(objectMap) 4337} 4338 4339// GalleryDiskImage this is the disk image base class. 4340type GalleryDiskImage struct { 4341 // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. 4342 SizeInGB *int32 `json:"sizeInGB,omitempty"` 4343 // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' 4344 HostCaching HostCaching `json:"hostCaching,omitempty"` 4345 Source *GalleryArtifactVersionSource `json:"source,omitempty"` 4346} 4347 4348// MarshalJSON is the custom marshaler for GalleryDiskImage. 4349func (gdi GalleryDiskImage) MarshalJSON() ([]byte, error) { 4350 objectMap := make(map[string]interface{}) 4351 if gdi.HostCaching != "" { 4352 objectMap["hostCaching"] = gdi.HostCaching 4353 } 4354 if gdi.Source != nil { 4355 objectMap["source"] = gdi.Source 4356 } 4357 return json.Marshal(objectMap) 4358} 4359 4360// GalleryIdentifier describes the gallery unique name. 4361type GalleryIdentifier struct { 4362 // UniqueName - READ-ONLY; The unique name of the Shared Image Gallery. This name is generated automatically by Azure. 4363 UniqueName *string `json:"uniqueName,omitempty"` 4364} 4365 4366// GalleryImage specifies information about the gallery Image Definition that you want to create or update. 4367type GalleryImage struct { 4368 autorest.Response `json:"-"` 4369 *GalleryImageProperties `json:"properties,omitempty"` 4370 // ID - READ-ONLY; Resource Id 4371 ID *string `json:"id,omitempty"` 4372 // Name - READ-ONLY; Resource name 4373 Name *string `json:"name,omitempty"` 4374 // Type - READ-ONLY; Resource type 4375 Type *string `json:"type,omitempty"` 4376 // Location - Resource location 4377 Location *string `json:"location,omitempty"` 4378 // Tags - Resource tags 4379 Tags map[string]*string `json:"tags"` 4380} 4381 4382// MarshalJSON is the custom marshaler for GalleryImage. 4383func (gi GalleryImage) MarshalJSON() ([]byte, error) { 4384 objectMap := make(map[string]interface{}) 4385 if gi.GalleryImageProperties != nil { 4386 objectMap["properties"] = gi.GalleryImageProperties 4387 } 4388 if gi.Location != nil { 4389 objectMap["location"] = gi.Location 4390 } 4391 if gi.Tags != nil { 4392 objectMap["tags"] = gi.Tags 4393 } 4394 return json.Marshal(objectMap) 4395} 4396 4397// UnmarshalJSON is the custom unmarshaler for GalleryImage struct. 4398func (gi *GalleryImage) UnmarshalJSON(body []byte) error { 4399 var m map[string]*json.RawMessage 4400 err := json.Unmarshal(body, &m) 4401 if err != nil { 4402 return err 4403 } 4404 for k, v := range m { 4405 switch k { 4406 case "properties": 4407 if v != nil { 4408 var galleryImageProperties GalleryImageProperties 4409 err = json.Unmarshal(*v, &galleryImageProperties) 4410 if err != nil { 4411 return err 4412 } 4413 gi.GalleryImageProperties = &galleryImageProperties 4414 } 4415 case "id": 4416 if v != nil { 4417 var ID string 4418 err = json.Unmarshal(*v, &ID) 4419 if err != nil { 4420 return err 4421 } 4422 gi.ID = &ID 4423 } 4424 case "name": 4425 if v != nil { 4426 var name string 4427 err = json.Unmarshal(*v, &name) 4428 if err != nil { 4429 return err 4430 } 4431 gi.Name = &name 4432 } 4433 case "type": 4434 if v != nil { 4435 var typeVar string 4436 err = json.Unmarshal(*v, &typeVar) 4437 if err != nil { 4438 return err 4439 } 4440 gi.Type = &typeVar 4441 } 4442 case "location": 4443 if v != nil { 4444 var location string 4445 err = json.Unmarshal(*v, &location) 4446 if err != nil { 4447 return err 4448 } 4449 gi.Location = &location 4450 } 4451 case "tags": 4452 if v != nil { 4453 var tags map[string]*string 4454 err = json.Unmarshal(*v, &tags) 4455 if err != nil { 4456 return err 4457 } 4458 gi.Tags = tags 4459 } 4460 } 4461 } 4462 4463 return nil 4464} 4465 4466// GalleryImageIdentifier this is the gallery Image Definition identifier. 4467type GalleryImageIdentifier struct { 4468 // Publisher - The name of the gallery Image Definition publisher. 4469 Publisher *string `json:"publisher,omitempty"` 4470 // Offer - The name of the gallery Image Definition offer. 4471 Offer *string `json:"offer,omitempty"` 4472 // Sku - The name of the gallery Image Definition SKU. 4473 Sku *string `json:"sku,omitempty"` 4474} 4475 4476// GalleryImageList the List Gallery Images operation response. 4477type GalleryImageList struct { 4478 autorest.Response `json:"-"` 4479 // Value - A list of Shared Image Gallery images. 4480 Value *[]GalleryImage `json:"value,omitempty"` 4481 // 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. 4482 NextLink *string `json:"nextLink,omitempty"` 4483} 4484 4485// GalleryImageListIterator provides access to a complete listing of GalleryImage values. 4486type GalleryImageListIterator struct { 4487 i int 4488 page GalleryImageListPage 4489} 4490 4491// NextWithContext advances to the next value. If there was an error making 4492// the request the iterator does not advance and the error is returned. 4493func (iter *GalleryImageListIterator) NextWithContext(ctx context.Context) (err error) { 4494 if tracing.IsEnabled() { 4495 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageListIterator.NextWithContext") 4496 defer func() { 4497 sc := -1 4498 if iter.Response().Response.Response != nil { 4499 sc = iter.Response().Response.Response.StatusCode 4500 } 4501 tracing.EndSpan(ctx, sc, err) 4502 }() 4503 } 4504 iter.i++ 4505 if iter.i < len(iter.page.Values()) { 4506 return nil 4507 } 4508 err = iter.page.NextWithContext(ctx) 4509 if err != nil { 4510 iter.i-- 4511 return err 4512 } 4513 iter.i = 0 4514 return nil 4515} 4516 4517// Next advances to the next value. If there was an error making 4518// the request the iterator does not advance and the error is returned. 4519// Deprecated: Use NextWithContext() instead. 4520func (iter *GalleryImageListIterator) Next() error { 4521 return iter.NextWithContext(context.Background()) 4522} 4523 4524// NotDone returns true if the enumeration should be started or is not yet complete. 4525func (iter GalleryImageListIterator) NotDone() bool { 4526 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4527} 4528 4529// Response returns the raw server response from the last page request. 4530func (iter GalleryImageListIterator) Response() GalleryImageList { 4531 return iter.page.Response() 4532} 4533 4534// Value returns the current value or a zero-initialized value if the 4535// iterator has advanced beyond the end of the collection. 4536func (iter GalleryImageListIterator) Value() GalleryImage { 4537 if !iter.page.NotDone() { 4538 return GalleryImage{} 4539 } 4540 return iter.page.Values()[iter.i] 4541} 4542 4543// Creates a new instance of the GalleryImageListIterator type. 4544func NewGalleryImageListIterator(page GalleryImageListPage) GalleryImageListIterator { 4545 return GalleryImageListIterator{page: page} 4546} 4547 4548// IsEmpty returns true if the ListResult contains no values. 4549func (gil GalleryImageList) IsEmpty() bool { 4550 return gil.Value == nil || len(*gil.Value) == 0 4551} 4552 4553// hasNextLink returns true if the NextLink is not empty. 4554func (gil GalleryImageList) hasNextLink() bool { 4555 return gil.NextLink != nil && len(*gil.NextLink) != 0 4556} 4557 4558// galleryImageListPreparer prepares a request to retrieve the next set of results. 4559// It returns nil if no more results exist. 4560func (gil GalleryImageList) galleryImageListPreparer(ctx context.Context) (*http.Request, error) { 4561 if !gil.hasNextLink() { 4562 return nil, nil 4563 } 4564 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4565 autorest.AsJSON(), 4566 autorest.AsGet(), 4567 autorest.WithBaseURL(to.String(gil.NextLink))) 4568} 4569 4570// GalleryImageListPage contains a page of GalleryImage values. 4571type GalleryImageListPage struct { 4572 fn func(context.Context, GalleryImageList) (GalleryImageList, error) 4573 gil GalleryImageList 4574} 4575 4576// NextWithContext advances to the next page of values. If there was an error making 4577// the request the page does not advance and the error is returned. 4578func (page *GalleryImageListPage) NextWithContext(ctx context.Context) (err error) { 4579 if tracing.IsEnabled() { 4580 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageListPage.NextWithContext") 4581 defer func() { 4582 sc := -1 4583 if page.Response().Response.Response != nil { 4584 sc = page.Response().Response.Response.StatusCode 4585 } 4586 tracing.EndSpan(ctx, sc, err) 4587 }() 4588 } 4589 for { 4590 next, err := page.fn(ctx, page.gil) 4591 if err != nil { 4592 return err 4593 } 4594 page.gil = next 4595 if !next.hasNextLink() || !next.IsEmpty() { 4596 break 4597 } 4598 } 4599 return nil 4600} 4601 4602// Next advances to the next page of values. If there was an error making 4603// the request the page does not advance and the error is returned. 4604// Deprecated: Use NextWithContext() instead. 4605func (page *GalleryImageListPage) Next() error { 4606 return page.NextWithContext(context.Background()) 4607} 4608 4609// NotDone returns true if the page enumeration should be started or is not yet complete. 4610func (page GalleryImageListPage) NotDone() bool { 4611 return !page.gil.IsEmpty() 4612} 4613 4614// Response returns the raw server response from the last page request. 4615func (page GalleryImageListPage) Response() GalleryImageList { 4616 return page.gil 4617} 4618 4619// Values returns the slice of values for the current page or nil if there are no values. 4620func (page GalleryImageListPage) Values() []GalleryImage { 4621 if page.gil.IsEmpty() { 4622 return nil 4623 } 4624 return *page.gil.Value 4625} 4626 4627// Creates a new instance of the GalleryImageListPage type. 4628func NewGalleryImageListPage(cur GalleryImageList, getNextPage func(context.Context, GalleryImageList) (GalleryImageList, error)) GalleryImageListPage { 4629 return GalleryImageListPage{ 4630 fn: getNextPage, 4631 gil: cur, 4632 } 4633} 4634 4635// GalleryImageProperties describes the properties of a gallery Image Definition. 4636type GalleryImageProperties struct { 4637 // Description - The description of this gallery Image Definition resource. This property is updatable. 4638 Description *string `json:"description,omitempty"` 4639 // Eula - The Eula agreement for the gallery Image Definition. 4640 Eula *string `json:"eula,omitempty"` 4641 // PrivacyStatementURI - The privacy statement uri. 4642 PrivacyStatementURI *string `json:"privacyStatementUri,omitempty"` 4643 // ReleaseNoteURI - The release note uri. 4644 ReleaseNoteURI *string `json:"releaseNoteUri,omitempty"` 4645 // 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' 4646 OsType OperatingSystemTypes `json:"osType,omitempty"` 4647 // 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' 4648 OsState OperatingSystemStateTypes `json:"osState,omitempty"` 4649 // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'V1', 'V2' 4650 HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` 4651 // EndOfLifeDate - The end of life date of the gallery Image Definition. This property can be used for decommissioning purposes. This property is updatable. 4652 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 4653 Identifier *GalleryImageIdentifier `json:"identifier,omitempty"` 4654 Recommended *RecommendedMachineConfiguration `json:"recommended,omitempty"` 4655 Disallowed *Disallowed `json:"disallowed,omitempty"` 4656 PurchasePlan *ImagePurchasePlan `json:"purchasePlan,omitempty"` 4657 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningState2Creating', 'ProvisioningState2Updating', 'ProvisioningState2Failed', 'ProvisioningState2Succeeded', 'ProvisioningState2Deleting', 'ProvisioningState2Migrating' 4658 ProvisioningState ProvisioningState2 `json:"provisioningState,omitempty"` 4659} 4660 4661// MarshalJSON is the custom marshaler for GalleryImageProperties. 4662func (gip GalleryImageProperties) MarshalJSON() ([]byte, error) { 4663 objectMap := make(map[string]interface{}) 4664 if gip.Description != nil { 4665 objectMap["description"] = gip.Description 4666 } 4667 if gip.Eula != nil { 4668 objectMap["eula"] = gip.Eula 4669 } 4670 if gip.PrivacyStatementURI != nil { 4671 objectMap["privacyStatementUri"] = gip.PrivacyStatementURI 4672 } 4673 if gip.ReleaseNoteURI != nil { 4674 objectMap["releaseNoteUri"] = gip.ReleaseNoteURI 4675 } 4676 if gip.OsType != "" { 4677 objectMap["osType"] = gip.OsType 4678 } 4679 if gip.OsState != "" { 4680 objectMap["osState"] = gip.OsState 4681 } 4682 if gip.HyperVGeneration != "" { 4683 objectMap["hyperVGeneration"] = gip.HyperVGeneration 4684 } 4685 if gip.EndOfLifeDate != nil { 4686 objectMap["endOfLifeDate"] = gip.EndOfLifeDate 4687 } 4688 if gip.Identifier != nil { 4689 objectMap["identifier"] = gip.Identifier 4690 } 4691 if gip.Recommended != nil { 4692 objectMap["recommended"] = gip.Recommended 4693 } 4694 if gip.Disallowed != nil { 4695 objectMap["disallowed"] = gip.Disallowed 4696 } 4697 if gip.PurchasePlan != nil { 4698 objectMap["purchasePlan"] = gip.PurchasePlan 4699 } 4700 return json.Marshal(objectMap) 4701} 4702 4703// GalleryImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 4704// long-running operation. 4705type GalleryImagesCreateOrUpdateFuture struct { 4706 azure.FutureAPI 4707 // Result returns the result of the asynchronous operation. 4708 // If the operation has not completed it will return an error. 4709 Result func(GalleryImagesClient) (GalleryImage, error) 4710} 4711 4712// GalleryImagesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 4713// operation. 4714type GalleryImagesDeleteFuture struct { 4715 azure.FutureAPI 4716 // Result returns the result of the asynchronous operation. 4717 // If the operation has not completed it will return an error. 4718 Result func(GalleryImagesClient) (autorest.Response, error) 4719} 4720 4721// GalleryImagesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 4722// operation. 4723type GalleryImagesUpdateFuture struct { 4724 azure.FutureAPI 4725 // Result returns the result of the asynchronous operation. 4726 // If the operation has not completed it will return an error. 4727 Result func(GalleryImagesClient) (GalleryImage, error) 4728} 4729 4730// GalleryImageUpdate specifies information about the gallery Image Definition that you want to update. 4731type GalleryImageUpdate struct { 4732 *GalleryImageProperties `json:"properties,omitempty"` 4733 // ID - READ-ONLY; Resource Id 4734 ID *string `json:"id,omitempty"` 4735 // Name - READ-ONLY; Resource name 4736 Name *string `json:"name,omitempty"` 4737 // Type - READ-ONLY; Resource type 4738 Type *string `json:"type,omitempty"` 4739 // Tags - Resource tags 4740 Tags map[string]*string `json:"tags"` 4741} 4742 4743// MarshalJSON is the custom marshaler for GalleryImageUpdate. 4744func (giu GalleryImageUpdate) MarshalJSON() ([]byte, error) { 4745 objectMap := make(map[string]interface{}) 4746 if giu.GalleryImageProperties != nil { 4747 objectMap["properties"] = giu.GalleryImageProperties 4748 } 4749 if giu.Tags != nil { 4750 objectMap["tags"] = giu.Tags 4751 } 4752 return json.Marshal(objectMap) 4753} 4754 4755// UnmarshalJSON is the custom unmarshaler for GalleryImageUpdate struct. 4756func (giu *GalleryImageUpdate) UnmarshalJSON(body []byte) error { 4757 var m map[string]*json.RawMessage 4758 err := json.Unmarshal(body, &m) 4759 if err != nil { 4760 return err 4761 } 4762 for k, v := range m { 4763 switch k { 4764 case "properties": 4765 if v != nil { 4766 var galleryImageProperties GalleryImageProperties 4767 err = json.Unmarshal(*v, &galleryImageProperties) 4768 if err != nil { 4769 return err 4770 } 4771 giu.GalleryImageProperties = &galleryImageProperties 4772 } 4773 case "id": 4774 if v != nil { 4775 var ID string 4776 err = json.Unmarshal(*v, &ID) 4777 if err != nil { 4778 return err 4779 } 4780 giu.ID = &ID 4781 } 4782 case "name": 4783 if v != nil { 4784 var name string 4785 err = json.Unmarshal(*v, &name) 4786 if err != nil { 4787 return err 4788 } 4789 giu.Name = &name 4790 } 4791 case "type": 4792 if v != nil { 4793 var typeVar string 4794 err = json.Unmarshal(*v, &typeVar) 4795 if err != nil { 4796 return err 4797 } 4798 giu.Type = &typeVar 4799 } 4800 case "tags": 4801 if v != nil { 4802 var tags map[string]*string 4803 err = json.Unmarshal(*v, &tags) 4804 if err != nil { 4805 return err 4806 } 4807 giu.Tags = tags 4808 } 4809 } 4810 } 4811 4812 return nil 4813} 4814 4815// GalleryImageVersion specifies information about the gallery Image Version that you want to create or 4816// update. 4817type GalleryImageVersion struct { 4818 autorest.Response `json:"-"` 4819 *GalleryImageVersionProperties `json:"properties,omitempty"` 4820 // ID - READ-ONLY; Resource Id 4821 ID *string `json:"id,omitempty"` 4822 // Name - READ-ONLY; Resource name 4823 Name *string `json:"name,omitempty"` 4824 // Type - READ-ONLY; Resource type 4825 Type *string `json:"type,omitempty"` 4826 // Location - Resource location 4827 Location *string `json:"location,omitempty"` 4828 // Tags - Resource tags 4829 Tags map[string]*string `json:"tags"` 4830} 4831 4832// MarshalJSON is the custom marshaler for GalleryImageVersion. 4833func (giv GalleryImageVersion) MarshalJSON() ([]byte, error) { 4834 objectMap := make(map[string]interface{}) 4835 if giv.GalleryImageVersionProperties != nil { 4836 objectMap["properties"] = giv.GalleryImageVersionProperties 4837 } 4838 if giv.Location != nil { 4839 objectMap["location"] = giv.Location 4840 } 4841 if giv.Tags != nil { 4842 objectMap["tags"] = giv.Tags 4843 } 4844 return json.Marshal(objectMap) 4845} 4846 4847// UnmarshalJSON is the custom unmarshaler for GalleryImageVersion struct. 4848func (giv *GalleryImageVersion) UnmarshalJSON(body []byte) error { 4849 var m map[string]*json.RawMessage 4850 err := json.Unmarshal(body, &m) 4851 if err != nil { 4852 return err 4853 } 4854 for k, v := range m { 4855 switch k { 4856 case "properties": 4857 if v != nil { 4858 var galleryImageVersionProperties GalleryImageVersionProperties 4859 err = json.Unmarshal(*v, &galleryImageVersionProperties) 4860 if err != nil { 4861 return err 4862 } 4863 giv.GalleryImageVersionProperties = &galleryImageVersionProperties 4864 } 4865 case "id": 4866 if v != nil { 4867 var ID string 4868 err = json.Unmarshal(*v, &ID) 4869 if err != nil { 4870 return err 4871 } 4872 giv.ID = &ID 4873 } 4874 case "name": 4875 if v != nil { 4876 var name string 4877 err = json.Unmarshal(*v, &name) 4878 if err != nil { 4879 return err 4880 } 4881 giv.Name = &name 4882 } 4883 case "type": 4884 if v != nil { 4885 var typeVar string 4886 err = json.Unmarshal(*v, &typeVar) 4887 if err != nil { 4888 return err 4889 } 4890 giv.Type = &typeVar 4891 } 4892 case "location": 4893 if v != nil { 4894 var location string 4895 err = json.Unmarshal(*v, &location) 4896 if err != nil { 4897 return err 4898 } 4899 giv.Location = &location 4900 } 4901 case "tags": 4902 if v != nil { 4903 var tags map[string]*string 4904 err = json.Unmarshal(*v, &tags) 4905 if err != nil { 4906 return err 4907 } 4908 giv.Tags = tags 4909 } 4910 } 4911 } 4912 4913 return nil 4914} 4915 4916// GalleryImageVersionList the List Gallery Image version operation response. 4917type GalleryImageVersionList struct { 4918 autorest.Response `json:"-"` 4919 // Value - A list of gallery Image Versions. 4920 Value *[]GalleryImageVersion `json:"value,omitempty"` 4921 // 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. 4922 NextLink *string `json:"nextLink,omitempty"` 4923} 4924 4925// GalleryImageVersionListIterator provides access to a complete listing of GalleryImageVersion values. 4926type GalleryImageVersionListIterator struct { 4927 i int 4928 page GalleryImageVersionListPage 4929} 4930 4931// NextWithContext advances to the next value. If there was an error making 4932// the request the iterator does not advance and the error is returned. 4933func (iter *GalleryImageVersionListIterator) NextWithContext(ctx context.Context) (err error) { 4934 if tracing.IsEnabled() { 4935 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionListIterator.NextWithContext") 4936 defer func() { 4937 sc := -1 4938 if iter.Response().Response.Response != nil { 4939 sc = iter.Response().Response.Response.StatusCode 4940 } 4941 tracing.EndSpan(ctx, sc, err) 4942 }() 4943 } 4944 iter.i++ 4945 if iter.i < len(iter.page.Values()) { 4946 return nil 4947 } 4948 err = iter.page.NextWithContext(ctx) 4949 if err != nil { 4950 iter.i-- 4951 return err 4952 } 4953 iter.i = 0 4954 return nil 4955} 4956 4957// Next advances to the next value. If there was an error making 4958// the request the iterator does not advance and the error is returned. 4959// Deprecated: Use NextWithContext() instead. 4960func (iter *GalleryImageVersionListIterator) Next() error { 4961 return iter.NextWithContext(context.Background()) 4962} 4963 4964// NotDone returns true if the enumeration should be started or is not yet complete. 4965func (iter GalleryImageVersionListIterator) NotDone() bool { 4966 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4967} 4968 4969// Response returns the raw server response from the last page request. 4970func (iter GalleryImageVersionListIterator) Response() GalleryImageVersionList { 4971 return iter.page.Response() 4972} 4973 4974// Value returns the current value or a zero-initialized value if the 4975// iterator has advanced beyond the end of the collection. 4976func (iter GalleryImageVersionListIterator) Value() GalleryImageVersion { 4977 if !iter.page.NotDone() { 4978 return GalleryImageVersion{} 4979 } 4980 return iter.page.Values()[iter.i] 4981} 4982 4983// Creates a new instance of the GalleryImageVersionListIterator type. 4984func NewGalleryImageVersionListIterator(page GalleryImageVersionListPage) GalleryImageVersionListIterator { 4985 return GalleryImageVersionListIterator{page: page} 4986} 4987 4988// IsEmpty returns true if the ListResult contains no values. 4989func (givl GalleryImageVersionList) IsEmpty() bool { 4990 return givl.Value == nil || len(*givl.Value) == 0 4991} 4992 4993// hasNextLink returns true if the NextLink is not empty. 4994func (givl GalleryImageVersionList) hasNextLink() bool { 4995 return givl.NextLink != nil && len(*givl.NextLink) != 0 4996} 4997 4998// galleryImageVersionListPreparer prepares a request to retrieve the next set of results. 4999// It returns nil if no more results exist. 5000func (givl GalleryImageVersionList) galleryImageVersionListPreparer(ctx context.Context) (*http.Request, error) { 5001 if !givl.hasNextLink() { 5002 return nil, nil 5003 } 5004 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5005 autorest.AsJSON(), 5006 autorest.AsGet(), 5007 autorest.WithBaseURL(to.String(givl.NextLink))) 5008} 5009 5010// GalleryImageVersionListPage contains a page of GalleryImageVersion values. 5011type GalleryImageVersionListPage struct { 5012 fn func(context.Context, GalleryImageVersionList) (GalleryImageVersionList, error) 5013 givl GalleryImageVersionList 5014} 5015 5016// NextWithContext advances to the next page of values. If there was an error making 5017// the request the page does not advance and the error is returned. 5018func (page *GalleryImageVersionListPage) NextWithContext(ctx context.Context) (err error) { 5019 if tracing.IsEnabled() { 5020 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionListPage.NextWithContext") 5021 defer func() { 5022 sc := -1 5023 if page.Response().Response.Response != nil { 5024 sc = page.Response().Response.Response.StatusCode 5025 } 5026 tracing.EndSpan(ctx, sc, err) 5027 }() 5028 } 5029 for { 5030 next, err := page.fn(ctx, page.givl) 5031 if err != nil { 5032 return err 5033 } 5034 page.givl = next 5035 if !next.hasNextLink() || !next.IsEmpty() { 5036 break 5037 } 5038 } 5039 return nil 5040} 5041 5042// Next advances to the next page of values. If there was an error making 5043// the request the page does not advance and the error is returned. 5044// Deprecated: Use NextWithContext() instead. 5045func (page *GalleryImageVersionListPage) Next() error { 5046 return page.NextWithContext(context.Background()) 5047} 5048 5049// NotDone returns true if the page enumeration should be started or is not yet complete. 5050func (page GalleryImageVersionListPage) NotDone() bool { 5051 return !page.givl.IsEmpty() 5052} 5053 5054// Response returns the raw server response from the last page request. 5055func (page GalleryImageVersionListPage) Response() GalleryImageVersionList { 5056 return page.givl 5057} 5058 5059// Values returns the slice of values for the current page or nil if there are no values. 5060func (page GalleryImageVersionListPage) Values() []GalleryImageVersion { 5061 if page.givl.IsEmpty() { 5062 return nil 5063 } 5064 return *page.givl.Value 5065} 5066 5067// Creates a new instance of the GalleryImageVersionListPage type. 5068func NewGalleryImageVersionListPage(cur GalleryImageVersionList, getNextPage func(context.Context, GalleryImageVersionList) (GalleryImageVersionList, error)) GalleryImageVersionListPage { 5069 return GalleryImageVersionListPage{ 5070 fn: getNextPage, 5071 givl: cur, 5072 } 5073} 5074 5075// GalleryImageVersionProperties describes the properties of a gallery Image Version. 5076type GalleryImageVersionProperties struct { 5077 PublishingProfile *GalleryImageVersionPublishingProfile `json:"publishingProfile,omitempty"` 5078 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningState3Creating', 'ProvisioningState3Updating', 'ProvisioningState3Failed', 'ProvisioningState3Succeeded', 'ProvisioningState3Deleting', 'ProvisioningState3Migrating' 5079 ProvisioningState ProvisioningState3 `json:"provisioningState,omitempty"` 5080 StorageProfile *GalleryImageVersionStorageProfile `json:"storageProfile,omitempty"` 5081 // ReplicationStatus - READ-ONLY 5082 ReplicationStatus *ReplicationStatus `json:"replicationStatus,omitempty"` 5083} 5084 5085// MarshalJSON is the custom marshaler for GalleryImageVersionProperties. 5086func (givp GalleryImageVersionProperties) MarshalJSON() ([]byte, error) { 5087 objectMap := make(map[string]interface{}) 5088 if givp.PublishingProfile != nil { 5089 objectMap["publishingProfile"] = givp.PublishingProfile 5090 } 5091 if givp.StorageProfile != nil { 5092 objectMap["storageProfile"] = givp.StorageProfile 5093 } 5094 return json.Marshal(objectMap) 5095} 5096 5097// GalleryImageVersionPublishingProfile the publishing profile of a gallery Image Version. 5098type GalleryImageVersionPublishingProfile struct { 5099 // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. 5100 TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` 5101 // 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. 5102 ReplicaCount *int32 `json:"replicaCount,omitempty"` 5103 // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. 5104 ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` 5105 // PublishedDate - READ-ONLY; The timestamp for when the gallery Image Version is published. 5106 PublishedDate *date.Time `json:"publishedDate,omitempty"` 5107 // EndOfLifeDate - The end of life date of the gallery Image Version. This property can be used for decommissioning purposes. This property is updatable. 5108 EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` 5109 // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' 5110 StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` 5111} 5112 5113// MarshalJSON is the custom marshaler for GalleryImageVersionPublishingProfile. 5114func (givpp GalleryImageVersionPublishingProfile) MarshalJSON() ([]byte, error) { 5115 objectMap := make(map[string]interface{}) 5116 if givpp.TargetRegions != nil { 5117 objectMap["targetRegions"] = givpp.TargetRegions 5118 } 5119 if givpp.ReplicaCount != nil { 5120 objectMap["replicaCount"] = givpp.ReplicaCount 5121 } 5122 if givpp.ExcludeFromLatest != nil { 5123 objectMap["excludeFromLatest"] = givpp.ExcludeFromLatest 5124 } 5125 if givpp.EndOfLifeDate != nil { 5126 objectMap["endOfLifeDate"] = givpp.EndOfLifeDate 5127 } 5128 if givpp.StorageAccountType != "" { 5129 objectMap["storageAccountType"] = givpp.StorageAccountType 5130 } 5131 return json.Marshal(objectMap) 5132} 5133 5134// GalleryImageVersionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 5135// long-running operation. 5136type GalleryImageVersionsCreateOrUpdateFuture struct { 5137 azure.FutureAPI 5138 // Result returns the result of the asynchronous operation. 5139 // If the operation has not completed it will return an error. 5140 Result func(GalleryImageVersionsClient) (GalleryImageVersion, error) 5141} 5142 5143// GalleryImageVersionsDeleteFuture an abstraction for monitoring and retrieving the results of a 5144// long-running operation. 5145type GalleryImageVersionsDeleteFuture struct { 5146 azure.FutureAPI 5147 // Result returns the result of the asynchronous operation. 5148 // If the operation has not completed it will return an error. 5149 Result func(GalleryImageVersionsClient) (autorest.Response, error) 5150} 5151 5152// GalleryImageVersionStorageProfile this is the storage profile of a Gallery Image Version. 5153type GalleryImageVersionStorageProfile struct { 5154 Source *GalleryArtifactVersionSource `json:"source,omitempty"` 5155 OsDiskImage *GalleryOSDiskImage `json:"osDiskImage,omitempty"` 5156 // DataDiskImages - A list of data disk images. 5157 DataDiskImages *[]GalleryDataDiskImage `json:"dataDiskImages,omitempty"` 5158} 5159 5160// GalleryImageVersionsUpdateFuture an abstraction for monitoring and retrieving the results of a 5161// long-running operation. 5162type GalleryImageVersionsUpdateFuture struct { 5163 azure.FutureAPI 5164 // Result returns the result of the asynchronous operation. 5165 // If the operation has not completed it will return an error. 5166 Result func(GalleryImageVersionsClient) (GalleryImageVersion, error) 5167} 5168 5169// GalleryImageVersionUpdate specifies information about the gallery Image Version that you want to update. 5170type GalleryImageVersionUpdate struct { 5171 *GalleryImageVersionProperties `json:"properties,omitempty"` 5172 // ID - READ-ONLY; Resource Id 5173 ID *string `json:"id,omitempty"` 5174 // Name - READ-ONLY; Resource name 5175 Name *string `json:"name,omitempty"` 5176 // Type - READ-ONLY; Resource type 5177 Type *string `json:"type,omitempty"` 5178 // Tags - Resource tags 5179 Tags map[string]*string `json:"tags"` 5180} 5181 5182// MarshalJSON is the custom marshaler for GalleryImageVersionUpdate. 5183func (givu GalleryImageVersionUpdate) MarshalJSON() ([]byte, error) { 5184 objectMap := make(map[string]interface{}) 5185 if givu.GalleryImageVersionProperties != nil { 5186 objectMap["properties"] = givu.GalleryImageVersionProperties 5187 } 5188 if givu.Tags != nil { 5189 objectMap["tags"] = givu.Tags 5190 } 5191 return json.Marshal(objectMap) 5192} 5193 5194// UnmarshalJSON is the custom unmarshaler for GalleryImageVersionUpdate struct. 5195func (givu *GalleryImageVersionUpdate) UnmarshalJSON(body []byte) error { 5196 var m map[string]*json.RawMessage 5197 err := json.Unmarshal(body, &m) 5198 if err != nil { 5199 return err 5200 } 5201 for k, v := range m { 5202 switch k { 5203 case "properties": 5204 if v != nil { 5205 var galleryImageVersionProperties GalleryImageVersionProperties 5206 err = json.Unmarshal(*v, &galleryImageVersionProperties) 5207 if err != nil { 5208 return err 5209 } 5210 givu.GalleryImageVersionProperties = &galleryImageVersionProperties 5211 } 5212 case "id": 5213 if v != nil { 5214 var ID string 5215 err = json.Unmarshal(*v, &ID) 5216 if err != nil { 5217 return err 5218 } 5219 givu.ID = &ID 5220 } 5221 case "name": 5222 if v != nil { 5223 var name string 5224 err = json.Unmarshal(*v, &name) 5225 if err != nil { 5226 return err 5227 } 5228 givu.Name = &name 5229 } 5230 case "type": 5231 if v != nil { 5232 var typeVar string 5233 err = json.Unmarshal(*v, &typeVar) 5234 if err != nil { 5235 return err 5236 } 5237 givu.Type = &typeVar 5238 } 5239 case "tags": 5240 if v != nil { 5241 var tags map[string]*string 5242 err = json.Unmarshal(*v, &tags) 5243 if err != nil { 5244 return err 5245 } 5246 givu.Tags = tags 5247 } 5248 } 5249 } 5250 5251 return nil 5252} 5253 5254// GalleryList the List Galleries operation response. 5255type GalleryList struct { 5256 autorest.Response `json:"-"` 5257 // Value - A list of galleries. 5258 Value *[]Gallery `json:"value,omitempty"` 5259 // NextLink - The uri to fetch the next page of galleries. Call ListNext() with this to fetch the next page of galleries. 5260 NextLink *string `json:"nextLink,omitempty"` 5261} 5262 5263// GalleryListIterator provides access to a complete listing of Gallery values. 5264type GalleryListIterator struct { 5265 i int 5266 page GalleryListPage 5267} 5268 5269// NextWithContext advances to the next value. If there was an error making 5270// the request the iterator does not advance and the error is returned. 5271func (iter *GalleryListIterator) NextWithContext(ctx context.Context) (err error) { 5272 if tracing.IsEnabled() { 5273 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryListIterator.NextWithContext") 5274 defer func() { 5275 sc := -1 5276 if iter.Response().Response.Response != nil { 5277 sc = iter.Response().Response.Response.StatusCode 5278 } 5279 tracing.EndSpan(ctx, sc, err) 5280 }() 5281 } 5282 iter.i++ 5283 if iter.i < len(iter.page.Values()) { 5284 return nil 5285 } 5286 err = iter.page.NextWithContext(ctx) 5287 if err != nil { 5288 iter.i-- 5289 return err 5290 } 5291 iter.i = 0 5292 return nil 5293} 5294 5295// Next advances to the next value. If there was an error making 5296// the request the iterator does not advance and the error is returned. 5297// Deprecated: Use NextWithContext() instead. 5298func (iter *GalleryListIterator) Next() error { 5299 return iter.NextWithContext(context.Background()) 5300} 5301 5302// NotDone returns true if the enumeration should be started or is not yet complete. 5303func (iter GalleryListIterator) NotDone() bool { 5304 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5305} 5306 5307// Response returns the raw server response from the last page request. 5308func (iter GalleryListIterator) Response() GalleryList { 5309 return iter.page.Response() 5310} 5311 5312// Value returns the current value or a zero-initialized value if the 5313// iterator has advanced beyond the end of the collection. 5314func (iter GalleryListIterator) Value() Gallery { 5315 if !iter.page.NotDone() { 5316 return Gallery{} 5317 } 5318 return iter.page.Values()[iter.i] 5319} 5320 5321// Creates a new instance of the GalleryListIterator type. 5322func NewGalleryListIterator(page GalleryListPage) GalleryListIterator { 5323 return GalleryListIterator{page: page} 5324} 5325 5326// IsEmpty returns true if the ListResult contains no values. 5327func (gl GalleryList) IsEmpty() bool { 5328 return gl.Value == nil || len(*gl.Value) == 0 5329} 5330 5331// hasNextLink returns true if the NextLink is not empty. 5332func (gl GalleryList) hasNextLink() bool { 5333 return gl.NextLink != nil && len(*gl.NextLink) != 0 5334} 5335 5336// galleryListPreparer prepares a request to retrieve the next set of results. 5337// It returns nil if no more results exist. 5338func (gl GalleryList) galleryListPreparer(ctx context.Context) (*http.Request, error) { 5339 if !gl.hasNextLink() { 5340 return nil, nil 5341 } 5342 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5343 autorest.AsJSON(), 5344 autorest.AsGet(), 5345 autorest.WithBaseURL(to.String(gl.NextLink))) 5346} 5347 5348// GalleryListPage contains a page of Gallery values. 5349type GalleryListPage struct { 5350 fn func(context.Context, GalleryList) (GalleryList, error) 5351 gl GalleryList 5352} 5353 5354// NextWithContext advances to the next page of values. If there was an error making 5355// the request the page does not advance and the error is returned. 5356func (page *GalleryListPage) NextWithContext(ctx context.Context) (err error) { 5357 if tracing.IsEnabled() { 5358 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryListPage.NextWithContext") 5359 defer func() { 5360 sc := -1 5361 if page.Response().Response.Response != nil { 5362 sc = page.Response().Response.Response.StatusCode 5363 } 5364 tracing.EndSpan(ctx, sc, err) 5365 }() 5366 } 5367 for { 5368 next, err := page.fn(ctx, page.gl) 5369 if err != nil { 5370 return err 5371 } 5372 page.gl = next 5373 if !next.hasNextLink() || !next.IsEmpty() { 5374 break 5375 } 5376 } 5377 return nil 5378} 5379 5380// Next advances to the next page of values. If there was an error making 5381// the request the page does not advance and the error is returned. 5382// Deprecated: Use NextWithContext() instead. 5383func (page *GalleryListPage) Next() error { 5384 return page.NextWithContext(context.Background()) 5385} 5386 5387// NotDone returns true if the page enumeration should be started or is not yet complete. 5388func (page GalleryListPage) NotDone() bool { 5389 return !page.gl.IsEmpty() 5390} 5391 5392// Response returns the raw server response from the last page request. 5393func (page GalleryListPage) Response() GalleryList { 5394 return page.gl 5395} 5396 5397// Values returns the slice of values for the current page or nil if there are no values. 5398func (page GalleryListPage) Values() []Gallery { 5399 if page.gl.IsEmpty() { 5400 return nil 5401 } 5402 return *page.gl.Value 5403} 5404 5405// Creates a new instance of the GalleryListPage type. 5406func NewGalleryListPage(cur GalleryList, getNextPage func(context.Context, GalleryList) (GalleryList, error)) GalleryListPage { 5407 return GalleryListPage{ 5408 fn: getNextPage, 5409 gl: cur, 5410 } 5411} 5412 5413// GalleryOSDiskImage this is the OS disk image. 5414type GalleryOSDiskImage struct { 5415 // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. 5416 SizeInGB *int32 `json:"sizeInGB,omitempty"` 5417 // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' 5418 HostCaching HostCaching `json:"hostCaching,omitempty"` 5419 Source *GalleryArtifactVersionSource `json:"source,omitempty"` 5420} 5421 5422// MarshalJSON is the custom marshaler for GalleryOSDiskImage. 5423func (godi GalleryOSDiskImage) MarshalJSON() ([]byte, error) { 5424 objectMap := make(map[string]interface{}) 5425 if godi.HostCaching != "" { 5426 objectMap["hostCaching"] = godi.HostCaching 5427 } 5428 if godi.Source != nil { 5429 objectMap["source"] = godi.Source 5430 } 5431 return json.Marshal(objectMap) 5432} 5433 5434// GalleryProperties describes the properties of a Shared Image Gallery. 5435type GalleryProperties struct { 5436 // Description - The description of this Shared Image Gallery resource. This property is updatable. 5437 Description *string `json:"description,omitempty"` 5438 Identifier *GalleryIdentifier `json:"identifier,omitempty"` 5439 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningStateCreating', 'ProvisioningStateUpdating', 'ProvisioningStateFailed', 'ProvisioningStateSucceeded', 'ProvisioningStateDeleting', 'ProvisioningStateMigrating' 5440 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 5441} 5442 5443// MarshalJSON is the custom marshaler for GalleryProperties. 5444func (gp GalleryProperties) MarshalJSON() ([]byte, error) { 5445 objectMap := make(map[string]interface{}) 5446 if gp.Description != nil { 5447 objectMap["description"] = gp.Description 5448 } 5449 if gp.Identifier != nil { 5450 objectMap["identifier"] = gp.Identifier 5451 } 5452 return json.Marshal(objectMap) 5453} 5454 5455// GalleryUpdate specifies information about the Shared Image Gallery that you want to update. 5456type GalleryUpdate struct { 5457 *GalleryProperties `json:"properties,omitempty"` 5458 // ID - READ-ONLY; Resource Id 5459 ID *string `json:"id,omitempty"` 5460 // Name - READ-ONLY; Resource name 5461 Name *string `json:"name,omitempty"` 5462 // Type - READ-ONLY; Resource type 5463 Type *string `json:"type,omitempty"` 5464 // Tags - Resource tags 5465 Tags map[string]*string `json:"tags"` 5466} 5467 5468// MarshalJSON is the custom marshaler for GalleryUpdate. 5469func (gu GalleryUpdate) MarshalJSON() ([]byte, error) { 5470 objectMap := make(map[string]interface{}) 5471 if gu.GalleryProperties != nil { 5472 objectMap["properties"] = gu.GalleryProperties 5473 } 5474 if gu.Tags != nil { 5475 objectMap["tags"] = gu.Tags 5476 } 5477 return json.Marshal(objectMap) 5478} 5479 5480// UnmarshalJSON is the custom unmarshaler for GalleryUpdate struct. 5481func (gu *GalleryUpdate) UnmarshalJSON(body []byte) error { 5482 var m map[string]*json.RawMessage 5483 err := json.Unmarshal(body, &m) 5484 if err != nil { 5485 return err 5486 } 5487 for k, v := range m { 5488 switch k { 5489 case "properties": 5490 if v != nil { 5491 var galleryProperties GalleryProperties 5492 err = json.Unmarshal(*v, &galleryProperties) 5493 if err != nil { 5494 return err 5495 } 5496 gu.GalleryProperties = &galleryProperties 5497 } 5498 case "id": 5499 if v != nil { 5500 var ID string 5501 err = json.Unmarshal(*v, &ID) 5502 if err != nil { 5503 return err 5504 } 5505 gu.ID = &ID 5506 } 5507 case "name": 5508 if v != nil { 5509 var name string 5510 err = json.Unmarshal(*v, &name) 5511 if err != nil { 5512 return err 5513 } 5514 gu.Name = &name 5515 } 5516 case "type": 5517 if v != nil { 5518 var typeVar string 5519 err = json.Unmarshal(*v, &typeVar) 5520 if err != nil { 5521 return err 5522 } 5523 gu.Type = &typeVar 5524 } 5525 case "tags": 5526 if v != nil { 5527 var tags map[string]*string 5528 err = json.Unmarshal(*v, &tags) 5529 if err != nil { 5530 return err 5531 } 5532 gu.Tags = tags 5533 } 5534 } 5535 } 5536 5537 return nil 5538} 5539 5540// GrantAccessData data used for requesting a SAS. 5541type GrantAccessData struct { 5542 // Access - Possible values include: 'None', 'Read', 'Write' 5543 Access AccessLevel `json:"access,omitempty"` 5544 // DurationInSeconds - Time duration in seconds until the SAS access expires. 5545 DurationInSeconds *int32 `json:"durationInSeconds,omitempty"` 5546} 5547 5548// HardwareProfile specifies the hardware settings for the virtual machine. 5549type HardwareProfile struct { 5550 // VMSize - Specifies the size of the virtual machine. For more information about virtual machine sizes, see [Sizes for virtual machines](https://docs.microsoft.com/en-us/azure/virtual-machines/sizes). <br><br> The available VM sizes depend on region and availability set. For a list of available sizes use these APIs: <br><br> [List all available virtual machine sizes in an availability set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) <br><br> [List all available virtual machine sizes in a region]( https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list) <br><br> [List all available virtual machine sizes for resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). <br><br> This list of sizes is no longer updated and the **VirtualMachineSizeTypes** string constants will be removed from the subsequent REST API specification. Use [List all available virtual machine sizes in a region]( https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list) to get the latest sizes. Possible values include: 'VirtualMachineSizeTypesBasicA0', 'VirtualMachineSizeTypesBasicA1', 'VirtualMachineSizeTypesBasicA2', 'VirtualMachineSizeTypesBasicA3', 'VirtualMachineSizeTypesBasicA4', 'VirtualMachineSizeTypesStandardA0', 'VirtualMachineSizeTypesStandardA1', 'VirtualMachineSizeTypesStandardA2', 'VirtualMachineSizeTypesStandardA3', 'VirtualMachineSizeTypesStandardA4', 'VirtualMachineSizeTypesStandardA5', 'VirtualMachineSizeTypesStandardA6', 'VirtualMachineSizeTypesStandardA7', 'VirtualMachineSizeTypesStandardA8', 'VirtualMachineSizeTypesStandardA9', 'VirtualMachineSizeTypesStandardA10', 'VirtualMachineSizeTypesStandardA11', 'VirtualMachineSizeTypesStandardA1V2', 'VirtualMachineSizeTypesStandardA2V2', 'VirtualMachineSizeTypesStandardA4V2', 'VirtualMachineSizeTypesStandardA8V2', 'VirtualMachineSizeTypesStandardA2mV2', 'VirtualMachineSizeTypesStandardA4mV2', 'VirtualMachineSizeTypesStandardA8mV2', 'VirtualMachineSizeTypesStandardB1s', 'VirtualMachineSizeTypesStandardB1ms', 'VirtualMachineSizeTypesStandardB2s', 'VirtualMachineSizeTypesStandardB2ms', 'VirtualMachineSizeTypesStandardB4ms', 'VirtualMachineSizeTypesStandardB8ms', 'VirtualMachineSizeTypesStandardD1', 'VirtualMachineSizeTypesStandardD2', 'VirtualMachineSizeTypesStandardD3', 'VirtualMachineSizeTypesStandardD4', 'VirtualMachineSizeTypesStandardD11', 'VirtualMachineSizeTypesStandardD12', 'VirtualMachineSizeTypesStandardD13', 'VirtualMachineSizeTypesStandardD14', 'VirtualMachineSizeTypesStandardD1V2', 'VirtualMachineSizeTypesStandardD2V2', 'VirtualMachineSizeTypesStandardD3V2', 'VirtualMachineSizeTypesStandardD4V2', 'VirtualMachineSizeTypesStandardD5V2', 'VirtualMachineSizeTypesStandardD2V3', 'VirtualMachineSizeTypesStandardD4V3', 'VirtualMachineSizeTypesStandardD8V3', 'VirtualMachineSizeTypesStandardD16V3', 'VirtualMachineSizeTypesStandardD32V3', 'VirtualMachineSizeTypesStandardD64V3', 'VirtualMachineSizeTypesStandardD2sV3', 'VirtualMachineSizeTypesStandardD4sV3', 'VirtualMachineSizeTypesStandardD8sV3', 'VirtualMachineSizeTypesStandardD16sV3', 'VirtualMachineSizeTypesStandardD32sV3', 'VirtualMachineSizeTypesStandardD64sV3', 'VirtualMachineSizeTypesStandardD11V2', 'VirtualMachineSizeTypesStandardD12V2', 'VirtualMachineSizeTypesStandardD13V2', 'VirtualMachineSizeTypesStandardD14V2', 'VirtualMachineSizeTypesStandardD15V2', 'VirtualMachineSizeTypesStandardDS1', 'VirtualMachineSizeTypesStandardDS2', 'VirtualMachineSizeTypesStandardDS3', 'VirtualMachineSizeTypesStandardDS4', 'VirtualMachineSizeTypesStandardDS11', 'VirtualMachineSizeTypesStandardDS12', 'VirtualMachineSizeTypesStandardDS13', 'VirtualMachineSizeTypesStandardDS14', 'VirtualMachineSizeTypesStandardDS1V2', 'VirtualMachineSizeTypesStandardDS2V2', 'VirtualMachineSizeTypesStandardDS3V2', 'VirtualMachineSizeTypesStandardDS4V2', 'VirtualMachineSizeTypesStandardDS5V2', 'VirtualMachineSizeTypesStandardDS11V2', 'VirtualMachineSizeTypesStandardDS12V2', 'VirtualMachineSizeTypesStandardDS13V2', 'VirtualMachineSizeTypesStandardDS14V2', 'VirtualMachineSizeTypesStandardDS15V2', 'VirtualMachineSizeTypesStandardDS134V2', 'VirtualMachineSizeTypesStandardDS132V2', 'VirtualMachineSizeTypesStandardDS148V2', 'VirtualMachineSizeTypesStandardDS144V2', 'VirtualMachineSizeTypesStandardE2V3', 'VirtualMachineSizeTypesStandardE4V3', 'VirtualMachineSizeTypesStandardE8V3', 'VirtualMachineSizeTypesStandardE16V3', 'VirtualMachineSizeTypesStandardE32V3', 'VirtualMachineSizeTypesStandardE64V3', 'VirtualMachineSizeTypesStandardE2sV3', 'VirtualMachineSizeTypesStandardE4sV3', 'VirtualMachineSizeTypesStandardE8sV3', 'VirtualMachineSizeTypesStandardE16sV3', 'VirtualMachineSizeTypesStandardE32sV3', 'VirtualMachineSizeTypesStandardE64sV3', 'VirtualMachineSizeTypesStandardE3216V3', 'VirtualMachineSizeTypesStandardE328sV3', 'VirtualMachineSizeTypesStandardE6432sV3', 'VirtualMachineSizeTypesStandardE6416sV3', 'VirtualMachineSizeTypesStandardF1', 'VirtualMachineSizeTypesStandardF2', 'VirtualMachineSizeTypesStandardF4', 'VirtualMachineSizeTypesStandardF8', 'VirtualMachineSizeTypesStandardF16', 'VirtualMachineSizeTypesStandardF1s', 'VirtualMachineSizeTypesStandardF2s', 'VirtualMachineSizeTypesStandardF4s', 'VirtualMachineSizeTypesStandardF8s', 'VirtualMachineSizeTypesStandardF16s', 'VirtualMachineSizeTypesStandardF2sV2', 'VirtualMachineSizeTypesStandardF4sV2', 'VirtualMachineSizeTypesStandardF8sV2', 'VirtualMachineSizeTypesStandardF16sV2', 'VirtualMachineSizeTypesStandardF32sV2', 'VirtualMachineSizeTypesStandardF64sV2', 'VirtualMachineSizeTypesStandardF72sV2', 'VirtualMachineSizeTypesStandardG1', 'VirtualMachineSizeTypesStandardG2', 'VirtualMachineSizeTypesStandardG3', 'VirtualMachineSizeTypesStandardG4', 'VirtualMachineSizeTypesStandardG5', 'VirtualMachineSizeTypesStandardGS1', 'VirtualMachineSizeTypesStandardGS2', 'VirtualMachineSizeTypesStandardGS3', 'VirtualMachineSizeTypesStandardGS4', 'VirtualMachineSizeTypesStandardGS5', 'VirtualMachineSizeTypesStandardGS48', 'VirtualMachineSizeTypesStandardGS44', 'VirtualMachineSizeTypesStandardGS516', 'VirtualMachineSizeTypesStandardGS58', 'VirtualMachineSizeTypesStandardH8', 'VirtualMachineSizeTypesStandardH16', 'VirtualMachineSizeTypesStandardH8m', 'VirtualMachineSizeTypesStandardH16m', 'VirtualMachineSizeTypesStandardH16r', 'VirtualMachineSizeTypesStandardH16mr', 'VirtualMachineSizeTypesStandardL4s', 'VirtualMachineSizeTypesStandardL8s', 'VirtualMachineSizeTypesStandardL16s', 'VirtualMachineSizeTypesStandardL32s', 'VirtualMachineSizeTypesStandardM64s', 'VirtualMachineSizeTypesStandardM64ms', 'VirtualMachineSizeTypesStandardM128s', 'VirtualMachineSizeTypesStandardM128ms', 'VirtualMachineSizeTypesStandardM6432ms', 'VirtualMachineSizeTypesStandardM6416ms', 'VirtualMachineSizeTypesStandardM12864ms', 'VirtualMachineSizeTypesStandardM12832ms', 'VirtualMachineSizeTypesStandardNC6', 'VirtualMachineSizeTypesStandardNC12', 'VirtualMachineSizeTypesStandardNC24', 'VirtualMachineSizeTypesStandardNC24r', 'VirtualMachineSizeTypesStandardNC6sV2', 'VirtualMachineSizeTypesStandardNC12sV2', 'VirtualMachineSizeTypesStandardNC24sV2', 'VirtualMachineSizeTypesStandardNC24rsV2', 'VirtualMachineSizeTypesStandardNC6sV3', 'VirtualMachineSizeTypesStandardNC12sV3', 'VirtualMachineSizeTypesStandardNC24sV3', 'VirtualMachineSizeTypesStandardNC24rsV3', 'VirtualMachineSizeTypesStandardND6s', 'VirtualMachineSizeTypesStandardND12s', 'VirtualMachineSizeTypesStandardND24s', 'VirtualMachineSizeTypesStandardND24rs', 'VirtualMachineSizeTypesStandardNV6', 'VirtualMachineSizeTypesStandardNV12', 'VirtualMachineSizeTypesStandardNV24' 5551 VMSize VirtualMachineSizeTypes `json:"vmSize,omitempty"` 5552} 5553 5554// Image the source user image virtual hard disk. The virtual hard disk will be copied before being 5555// attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not 5556// exist. 5557type Image struct { 5558 autorest.Response `json:"-"` 5559 *ImageProperties `json:"properties,omitempty"` 5560 // ID - READ-ONLY; Resource Id 5561 ID *string `json:"id,omitempty"` 5562 // Name - READ-ONLY; Resource name 5563 Name *string `json:"name,omitempty"` 5564 // Type - READ-ONLY; Resource type 5565 Type *string `json:"type,omitempty"` 5566 // Location - Resource location 5567 Location *string `json:"location,omitempty"` 5568 // Tags - Resource tags 5569 Tags map[string]*string `json:"tags"` 5570} 5571 5572// MarshalJSON is the custom marshaler for Image. 5573func (i Image) MarshalJSON() ([]byte, error) { 5574 objectMap := make(map[string]interface{}) 5575 if i.ImageProperties != nil { 5576 objectMap["properties"] = i.ImageProperties 5577 } 5578 if i.Location != nil { 5579 objectMap["location"] = i.Location 5580 } 5581 if i.Tags != nil { 5582 objectMap["tags"] = i.Tags 5583 } 5584 return json.Marshal(objectMap) 5585} 5586 5587// UnmarshalJSON is the custom unmarshaler for Image struct. 5588func (i *Image) UnmarshalJSON(body []byte) error { 5589 var m map[string]*json.RawMessage 5590 err := json.Unmarshal(body, &m) 5591 if err != nil { 5592 return err 5593 } 5594 for k, v := range m { 5595 switch k { 5596 case "properties": 5597 if v != nil { 5598 var imageProperties ImageProperties 5599 err = json.Unmarshal(*v, &imageProperties) 5600 if err != nil { 5601 return err 5602 } 5603 i.ImageProperties = &imageProperties 5604 } 5605 case "id": 5606 if v != nil { 5607 var ID string 5608 err = json.Unmarshal(*v, &ID) 5609 if err != nil { 5610 return err 5611 } 5612 i.ID = &ID 5613 } 5614 case "name": 5615 if v != nil { 5616 var name string 5617 err = json.Unmarshal(*v, &name) 5618 if err != nil { 5619 return err 5620 } 5621 i.Name = &name 5622 } 5623 case "type": 5624 if v != nil { 5625 var typeVar string 5626 err = json.Unmarshal(*v, &typeVar) 5627 if err != nil { 5628 return err 5629 } 5630 i.Type = &typeVar 5631 } 5632 case "location": 5633 if v != nil { 5634 var location string 5635 err = json.Unmarshal(*v, &location) 5636 if err != nil { 5637 return err 5638 } 5639 i.Location = &location 5640 } 5641 case "tags": 5642 if v != nil { 5643 var tags map[string]*string 5644 err = json.Unmarshal(*v, &tags) 5645 if err != nil { 5646 return err 5647 } 5648 i.Tags = tags 5649 } 5650 } 5651 } 5652 5653 return nil 5654} 5655 5656// ImageDataDisk describes a data disk. 5657type ImageDataDisk struct { 5658 // 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. 5659 Lun *int32 `json:"lun,omitempty"` 5660 // Snapshot - The snapshot. 5661 Snapshot *SubResource `json:"snapshot,omitempty"` 5662 // ManagedDisk - The managedDisk. 5663 ManagedDisk *SubResource `json:"managedDisk,omitempty"` 5664 // BlobURI - The Virtual Hard Disk. 5665 BlobURI *string `json:"blobUri,omitempty"` 5666 // 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' 5667 Caching CachingTypes `json:"caching,omitempty"` 5668 // 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 5669 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 5670 // 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' 5671 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 5672 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. 5673 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 5674} 5675 5676// ImageDisk describes a image disk. 5677type ImageDisk struct { 5678 // Snapshot - The snapshot. 5679 Snapshot *SubResource `json:"snapshot,omitempty"` 5680 // ManagedDisk - The managedDisk. 5681 ManagedDisk *SubResource `json:"managedDisk,omitempty"` 5682 // BlobURI - The Virtual Hard Disk. 5683 BlobURI *string `json:"blobUri,omitempty"` 5684 // 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' 5685 Caching CachingTypes `json:"caching,omitempty"` 5686 // 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 5687 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 5688 // 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' 5689 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 5690 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. 5691 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 5692} 5693 5694// ImageDiskReference the source image used for creating the disk. 5695type ImageDiskReference struct { 5696 // ID - A relative uri containing either a Platform Image Repository or user image reference. 5697 ID *string `json:"id,omitempty"` 5698 // 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. 5699 Lun *int32 `json:"lun,omitempty"` 5700} 5701 5702// ImageListResult the List Image operation response. 5703type ImageListResult struct { 5704 autorest.Response `json:"-"` 5705 // Value - The list of Images. 5706 Value *[]Image `json:"value,omitempty"` 5707 // NextLink - The uri to fetch the next page of Images. Call ListNext() with this to fetch the next page of Images. 5708 NextLink *string `json:"nextLink,omitempty"` 5709} 5710 5711// ImageListResultIterator provides access to a complete listing of Image values. 5712type ImageListResultIterator struct { 5713 i int 5714 page ImageListResultPage 5715} 5716 5717// NextWithContext advances to the next value. If there was an error making 5718// the request the iterator does not advance and the error is returned. 5719func (iter *ImageListResultIterator) NextWithContext(ctx context.Context) (err error) { 5720 if tracing.IsEnabled() { 5721 ctx = tracing.StartSpan(ctx, fqdn+"/ImageListResultIterator.NextWithContext") 5722 defer func() { 5723 sc := -1 5724 if iter.Response().Response.Response != nil { 5725 sc = iter.Response().Response.Response.StatusCode 5726 } 5727 tracing.EndSpan(ctx, sc, err) 5728 }() 5729 } 5730 iter.i++ 5731 if iter.i < len(iter.page.Values()) { 5732 return nil 5733 } 5734 err = iter.page.NextWithContext(ctx) 5735 if err != nil { 5736 iter.i-- 5737 return err 5738 } 5739 iter.i = 0 5740 return nil 5741} 5742 5743// Next advances to the next value. If there was an error making 5744// the request the iterator does not advance and the error is returned. 5745// Deprecated: Use NextWithContext() instead. 5746func (iter *ImageListResultIterator) Next() error { 5747 return iter.NextWithContext(context.Background()) 5748} 5749 5750// NotDone returns true if the enumeration should be started or is not yet complete. 5751func (iter ImageListResultIterator) NotDone() bool { 5752 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5753} 5754 5755// Response returns the raw server response from the last page request. 5756func (iter ImageListResultIterator) Response() ImageListResult { 5757 return iter.page.Response() 5758} 5759 5760// Value returns the current value or a zero-initialized value if the 5761// iterator has advanced beyond the end of the collection. 5762func (iter ImageListResultIterator) Value() Image { 5763 if !iter.page.NotDone() { 5764 return Image{} 5765 } 5766 return iter.page.Values()[iter.i] 5767} 5768 5769// Creates a new instance of the ImageListResultIterator type. 5770func NewImageListResultIterator(page ImageListResultPage) ImageListResultIterator { 5771 return ImageListResultIterator{page: page} 5772} 5773 5774// IsEmpty returns true if the ListResult contains no values. 5775func (ilr ImageListResult) IsEmpty() bool { 5776 return ilr.Value == nil || len(*ilr.Value) == 0 5777} 5778 5779// hasNextLink returns true if the NextLink is not empty. 5780func (ilr ImageListResult) hasNextLink() bool { 5781 return ilr.NextLink != nil && len(*ilr.NextLink) != 0 5782} 5783 5784// imageListResultPreparer prepares a request to retrieve the next set of results. 5785// It returns nil if no more results exist. 5786func (ilr ImageListResult) imageListResultPreparer(ctx context.Context) (*http.Request, error) { 5787 if !ilr.hasNextLink() { 5788 return nil, nil 5789 } 5790 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5791 autorest.AsJSON(), 5792 autorest.AsGet(), 5793 autorest.WithBaseURL(to.String(ilr.NextLink))) 5794} 5795 5796// ImageListResultPage contains a page of Image values. 5797type ImageListResultPage struct { 5798 fn func(context.Context, ImageListResult) (ImageListResult, error) 5799 ilr ImageListResult 5800} 5801 5802// NextWithContext advances to the next page of values. If there was an error making 5803// the request the page does not advance and the error is returned. 5804func (page *ImageListResultPage) NextWithContext(ctx context.Context) (err error) { 5805 if tracing.IsEnabled() { 5806 ctx = tracing.StartSpan(ctx, fqdn+"/ImageListResultPage.NextWithContext") 5807 defer func() { 5808 sc := -1 5809 if page.Response().Response.Response != nil { 5810 sc = page.Response().Response.Response.StatusCode 5811 } 5812 tracing.EndSpan(ctx, sc, err) 5813 }() 5814 } 5815 for { 5816 next, err := page.fn(ctx, page.ilr) 5817 if err != nil { 5818 return err 5819 } 5820 page.ilr = next 5821 if !next.hasNextLink() || !next.IsEmpty() { 5822 break 5823 } 5824 } 5825 return nil 5826} 5827 5828// Next advances to the next page of values. If there was an error making 5829// the request the page does not advance and the error is returned. 5830// Deprecated: Use NextWithContext() instead. 5831func (page *ImageListResultPage) Next() error { 5832 return page.NextWithContext(context.Background()) 5833} 5834 5835// NotDone returns true if the page enumeration should be started or is not yet complete. 5836func (page ImageListResultPage) NotDone() bool { 5837 return !page.ilr.IsEmpty() 5838} 5839 5840// Response returns the raw server response from the last page request. 5841func (page ImageListResultPage) Response() ImageListResult { 5842 return page.ilr 5843} 5844 5845// Values returns the slice of values for the current page or nil if there are no values. 5846func (page ImageListResultPage) Values() []Image { 5847 if page.ilr.IsEmpty() { 5848 return nil 5849 } 5850 return *page.ilr.Value 5851} 5852 5853// Creates a new instance of the ImageListResultPage type. 5854func NewImageListResultPage(cur ImageListResult, getNextPage func(context.Context, ImageListResult) (ImageListResult, error)) ImageListResultPage { 5855 return ImageListResultPage{ 5856 fn: getNextPage, 5857 ilr: cur, 5858 } 5859} 5860 5861// ImageOSDisk describes an Operating System disk. 5862type ImageOSDisk struct { 5863 // 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' 5864 OsType OperatingSystemTypes `json:"osType,omitempty"` 5865 // OsState - The OS State. Possible values include: 'Generalized', 'Specialized' 5866 OsState OperatingSystemStateTypes `json:"osState,omitempty"` 5867 // Snapshot - The snapshot. 5868 Snapshot *SubResource `json:"snapshot,omitempty"` 5869 // ManagedDisk - The managedDisk. 5870 ManagedDisk *SubResource `json:"managedDisk,omitempty"` 5871 // BlobURI - The Virtual Hard Disk. 5872 BlobURI *string `json:"blobUri,omitempty"` 5873 // 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' 5874 Caching CachingTypes `json:"caching,omitempty"` 5875 // 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 5876 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 5877 // 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' 5878 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 5879 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. 5880 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 5881} 5882 5883// ImageProperties describes the properties of an Image. 5884type ImageProperties struct { 5885 // SourceVirtualMachine - The source virtual machine from which Image is created. 5886 SourceVirtualMachine *SubResource `json:"sourceVirtualMachine,omitempty"` 5887 // StorageProfile - Specifies the storage settings for the virtual machine disks. 5888 StorageProfile *ImageStorageProfile `json:"storageProfile,omitempty"` 5889 // ProvisioningState - READ-ONLY; The provisioning state. 5890 ProvisioningState *string `json:"provisioningState,omitempty"` 5891 // HyperVGeneration - Gets the HyperVGenerationType of the VirtualMachine created from the image. Possible values include: 'HyperVGenerationTypesV1', 'HyperVGenerationTypesV2' 5892 HyperVGeneration HyperVGenerationTypes `json:"hyperVGeneration,omitempty"` 5893} 5894 5895// MarshalJSON is the custom marshaler for ImageProperties. 5896func (IP ImageProperties) MarshalJSON() ([]byte, error) { 5897 objectMap := make(map[string]interface{}) 5898 if IP.SourceVirtualMachine != nil { 5899 objectMap["sourceVirtualMachine"] = IP.SourceVirtualMachine 5900 } 5901 if IP.StorageProfile != nil { 5902 objectMap["storageProfile"] = IP.StorageProfile 5903 } 5904 if IP.HyperVGeneration != "" { 5905 objectMap["hyperVGeneration"] = IP.HyperVGeneration 5906 } 5907 return json.Marshal(objectMap) 5908} 5909 5910// ImagePurchasePlan describes the gallery Image Definition purchase plan. This is used by marketplace 5911// images. 5912type ImagePurchasePlan struct { 5913 // Name - The plan ID. 5914 Name *string `json:"name,omitempty"` 5915 // Publisher - The publisher ID. 5916 Publisher *string `json:"publisher,omitempty"` 5917 // Product - The product ID. 5918 Product *string `json:"product,omitempty"` 5919} 5920 5921// ImageReference specifies information about the image to use. You can specify information about platform 5922// images, marketplace images, or virtual machine images. This element is required when you want to use a 5923// platform image, marketplace image, or virtual machine image, but is not used in other creation 5924// operations. NOTE: Image reference publisher and offer can only be set when you create the scale set. 5925type ImageReference struct { 5926 // Publisher - The image publisher. 5927 Publisher *string `json:"publisher,omitempty"` 5928 // Offer - Specifies the offer of the platform image or marketplace image used to create the virtual machine. 5929 Offer *string `json:"offer,omitempty"` 5930 // Sku - The image SKU. 5931 Sku *string `json:"sku,omitempty"` 5932 // 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. 5933 Version *string `json:"version,omitempty"` 5934 // 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'. 5935 ExactVersion *string `json:"exactVersion,omitempty"` 5936 // ID - Resource Id 5937 ID *string `json:"id,omitempty"` 5938} 5939 5940// MarshalJSON is the custom marshaler for ImageReference. 5941func (ir ImageReference) MarshalJSON() ([]byte, error) { 5942 objectMap := make(map[string]interface{}) 5943 if ir.Publisher != nil { 5944 objectMap["publisher"] = ir.Publisher 5945 } 5946 if ir.Offer != nil { 5947 objectMap["offer"] = ir.Offer 5948 } 5949 if ir.Sku != nil { 5950 objectMap["sku"] = ir.Sku 5951 } 5952 if ir.Version != nil { 5953 objectMap["version"] = ir.Version 5954 } 5955 if ir.ID != nil { 5956 objectMap["id"] = ir.ID 5957 } 5958 return json.Marshal(objectMap) 5959} 5960 5961// ImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 5962// operation. 5963type ImagesCreateOrUpdateFuture struct { 5964 azure.FutureAPI 5965 // Result returns the result of the asynchronous operation. 5966 // If the operation has not completed it will return an error. 5967 Result func(ImagesClient) (Image, error) 5968} 5969 5970// ImagesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 5971type ImagesDeleteFuture struct { 5972 azure.FutureAPI 5973 // Result returns the result of the asynchronous operation. 5974 // If the operation has not completed it will return an error. 5975 Result func(ImagesClient) (autorest.Response, error) 5976} 5977 5978// ImageStorageProfile describes a storage profile. 5979type ImageStorageProfile struct { 5980 // 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). 5981 OsDisk *ImageOSDisk `json:"osDisk,omitempty"` 5982 // 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). 5983 DataDisks *[]ImageDataDisk `json:"dataDisks,omitempty"` 5984 // 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). 5985 ZoneResilient *bool `json:"zoneResilient,omitempty"` 5986} 5987 5988// ImagesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. 5989type ImagesUpdateFuture struct { 5990 azure.FutureAPI 5991 // Result returns the result of the asynchronous operation. 5992 // If the operation has not completed it will return an error. 5993 Result func(ImagesClient) (Image, error) 5994} 5995 5996// ImageUpdate the source user image virtual hard disk. Only tags may be updated. 5997type ImageUpdate struct { 5998 *ImageProperties `json:"properties,omitempty"` 5999 // Tags - Resource tags 6000 Tags map[string]*string `json:"tags"` 6001} 6002 6003// MarshalJSON is the custom marshaler for ImageUpdate. 6004func (iu ImageUpdate) MarshalJSON() ([]byte, error) { 6005 objectMap := make(map[string]interface{}) 6006 if iu.ImageProperties != nil { 6007 objectMap["properties"] = iu.ImageProperties 6008 } 6009 if iu.Tags != nil { 6010 objectMap["tags"] = iu.Tags 6011 } 6012 return json.Marshal(objectMap) 6013} 6014 6015// UnmarshalJSON is the custom unmarshaler for ImageUpdate struct. 6016func (iu *ImageUpdate) UnmarshalJSON(body []byte) error { 6017 var m map[string]*json.RawMessage 6018 err := json.Unmarshal(body, &m) 6019 if err != nil { 6020 return err 6021 } 6022 for k, v := range m { 6023 switch k { 6024 case "properties": 6025 if v != nil { 6026 var imageProperties ImageProperties 6027 err = json.Unmarshal(*v, &imageProperties) 6028 if err != nil { 6029 return err 6030 } 6031 iu.ImageProperties = &imageProperties 6032 } 6033 case "tags": 6034 if v != nil { 6035 var tags map[string]*string 6036 err = json.Unmarshal(*v, &tags) 6037 if err != nil { 6038 return err 6039 } 6040 iu.Tags = tags 6041 } 6042 } 6043 } 6044 6045 return nil 6046} 6047 6048// InnerError inner error details. 6049type InnerError struct { 6050 // Exceptiontype - The exception type. 6051 Exceptiontype *string `json:"exceptiontype,omitempty"` 6052 // Errordetail - The internal error message or exception dump. 6053 Errordetail *string `json:"errordetail,omitempty"` 6054} 6055 6056// InstanceViewStatus instance view status. 6057type InstanceViewStatus struct { 6058 // Code - The status code. 6059 Code *string `json:"code,omitempty"` 6060 // Level - The level code. Possible values include: 'Info', 'Warning', 'Error' 6061 Level StatusLevelTypes `json:"level,omitempty"` 6062 // DisplayStatus - The short localizable label for the status. 6063 DisplayStatus *string `json:"displayStatus,omitempty"` 6064 // Message - The detailed status message, including for alerts and error messages. 6065 Message *string `json:"message,omitempty"` 6066 // Time - The time of the status. 6067 Time *date.Time `json:"time,omitempty"` 6068} 6069 6070// KeyVaultAndKeyReference key Vault Key Url and vault id of KeK, KeK is optional and when provided is used 6071// to unwrap the encryptionKey 6072type KeyVaultAndKeyReference struct { 6073 // SourceVault - Resource id of the KeyVault containing the key or secret 6074 SourceVault *SourceVault `json:"sourceVault,omitempty"` 6075 // KeyURL - Url pointing to a key or secret in KeyVault 6076 KeyURL *string `json:"keyUrl,omitempty"` 6077} 6078 6079// KeyVaultAndSecretReference key Vault Secret Url and vault id of the encryption key 6080type KeyVaultAndSecretReference struct { 6081 // SourceVault - Resource id of the KeyVault containing the key or secret 6082 SourceVault *SourceVault `json:"sourceVault,omitempty"` 6083 // SecretURL - Url pointing to a key or secret in KeyVault 6084 SecretURL *string `json:"secretUrl,omitempty"` 6085} 6086 6087// KeyVaultKeyReference describes a reference to Key Vault Key 6088type KeyVaultKeyReference struct { 6089 // KeyURL - The URL referencing a key encryption key in Key Vault. 6090 KeyURL *string `json:"keyUrl,omitempty"` 6091 // SourceVault - The relative URL of the Key Vault containing the key. 6092 SourceVault *SubResource `json:"sourceVault,omitempty"` 6093} 6094 6095// KeyVaultSecretReference describes a reference to Key Vault Secret 6096type KeyVaultSecretReference struct { 6097 // SecretURL - The URL referencing a secret in a Key Vault. 6098 SecretURL *string `json:"secretUrl,omitempty"` 6099 // SourceVault - The relative URL of the Key Vault containing the secret. 6100 SourceVault *SubResource `json:"sourceVault,omitempty"` 6101} 6102 6103// LastPatchInstallationSummary describes the properties of the last installed patch summary. 6104type LastPatchInstallationSummary struct { 6105 // Status - READ-ONLY; The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Failed", "Succeeded", or "CompletedWithWarnings.". Possible values include: 'PatchOperationStatusInProgress', 'PatchOperationStatusFailed', 'PatchOperationStatusSucceeded', 'PatchOperationStatusCompletedWithWarnings' 6106 Status PatchOperationStatus `json:"status,omitempty"` 6107 // InstallationActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. 6108 InstallationActivityID *string `json:"installationActivityId,omitempty"` 6109 // MaintenanceWindowExceeded - READ-ONLY; Describes whether the operation ran out of time before it completed all its intended actions 6110 MaintenanceWindowExceeded *bool `json:"maintenanceWindowExceeded,omitempty"` 6111 // RebootStatus - READ-ONLY; The reboot status of the machine after the patch operation. It will be in "NotNeeded" status if reboot is not needed after the patch operation. "Required" will be the status once the patch is applied and machine is required to reboot. "Started" will be the reboot status when the machine has started to reboot. "Failed" will be the status if the machine is failed to reboot. "Completed" will be the status once the machine is rebooted successfully. Possible values include: 'RebootStatusNotNeeded', 'RebootStatusRequired', 'RebootStatusStarted', 'RebootStatusFailed', 'RebootStatusCompleted' 6112 RebootStatus RebootStatus `json:"rebootStatus,omitempty"` 6113 // NotSelectedPatchCount - READ-ONLY; The number of all available patches but not going to be installed because it didn't match a classification or inclusion list entry. 6114 NotSelectedPatchCount *int32 `json:"notSelectedPatchCount,omitempty"` 6115 // ExcludedPatchCount - READ-ONLY; The number of all available patches but excluded explicitly by a customer-specified exclusion list match. 6116 ExcludedPatchCount *int32 `json:"excludedPatchCount,omitempty"` 6117 // PendingPatchCount - READ-ONLY; The number of all available patches expected to be installed over the course of the patch installation operation. 6118 PendingPatchCount *int32 `json:"pendingPatchCount,omitempty"` 6119 // InstalledPatchCount - READ-ONLY; The count of patches that successfully installed. 6120 InstalledPatchCount *int32 `json:"installedPatchCount,omitempty"` 6121 // FailedPatchCount - READ-ONLY; The count of patches that failed installation. 6122 FailedPatchCount *int32 `json:"failedPatchCount,omitempty"` 6123 // StartTime - READ-ONLY; The UTC timestamp when the operation began. 6124 StartTime *date.Time `json:"startTime,omitempty"` 6125 // LastModifiedTime - READ-ONLY; The UTC timestamp when the operation began. 6126 LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` 6127 // StartedBy - READ-ONLY; The person or system account that started the operation 6128 StartedBy *string `json:"startedBy,omitempty"` 6129 // Error - READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. 6130 Error *APIError `json:"error,omitempty"` 6131} 6132 6133// LinuxConfiguration specifies the Linux operating system settings on the virtual machine. <br><br>For a 6134// list of supported Linux distributions, see [Linux on Azure-Endorsed 6135// Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) 6136// <br><br> For running non-endorsed distributions, see [Information for Non-Endorsed 6137// Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). 6138type LinuxConfiguration struct { 6139 // DisablePasswordAuthentication - Specifies whether password authentication should be disabled. 6140 DisablePasswordAuthentication *bool `json:"disablePasswordAuthentication,omitempty"` 6141 // SSH - Specifies the ssh key configuration for a Linux OS. 6142 SSH *SSHConfiguration `json:"ssh,omitempty"` 6143 // 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. 6144 ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` 6145} 6146 6147// ListUsagesResult the List Usages operation response. 6148type ListUsagesResult struct { 6149 autorest.Response `json:"-"` 6150 // Value - The list of compute resource usages. 6151 Value *[]Usage `json:"value,omitempty"` 6152 // 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. 6153 NextLink *string `json:"nextLink,omitempty"` 6154} 6155 6156// ListUsagesResultIterator provides access to a complete listing of Usage values. 6157type ListUsagesResultIterator struct { 6158 i int 6159 page ListUsagesResultPage 6160} 6161 6162// NextWithContext advances to the next value. If there was an error making 6163// the request the iterator does not advance and the error is returned. 6164func (iter *ListUsagesResultIterator) NextWithContext(ctx context.Context) (err error) { 6165 if tracing.IsEnabled() { 6166 ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultIterator.NextWithContext") 6167 defer func() { 6168 sc := -1 6169 if iter.Response().Response.Response != nil { 6170 sc = iter.Response().Response.Response.StatusCode 6171 } 6172 tracing.EndSpan(ctx, sc, err) 6173 }() 6174 } 6175 iter.i++ 6176 if iter.i < len(iter.page.Values()) { 6177 return nil 6178 } 6179 err = iter.page.NextWithContext(ctx) 6180 if err != nil { 6181 iter.i-- 6182 return err 6183 } 6184 iter.i = 0 6185 return nil 6186} 6187 6188// Next advances to the next value. If there was an error making 6189// the request the iterator does not advance and the error is returned. 6190// Deprecated: Use NextWithContext() instead. 6191func (iter *ListUsagesResultIterator) Next() error { 6192 return iter.NextWithContext(context.Background()) 6193} 6194 6195// NotDone returns true if the enumeration should be started or is not yet complete. 6196func (iter ListUsagesResultIterator) NotDone() bool { 6197 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6198} 6199 6200// Response returns the raw server response from the last page request. 6201func (iter ListUsagesResultIterator) Response() ListUsagesResult { 6202 return iter.page.Response() 6203} 6204 6205// Value returns the current value or a zero-initialized value if the 6206// iterator has advanced beyond the end of the collection. 6207func (iter ListUsagesResultIterator) Value() Usage { 6208 if !iter.page.NotDone() { 6209 return Usage{} 6210 } 6211 return iter.page.Values()[iter.i] 6212} 6213 6214// Creates a new instance of the ListUsagesResultIterator type. 6215func NewListUsagesResultIterator(page ListUsagesResultPage) ListUsagesResultIterator { 6216 return ListUsagesResultIterator{page: page} 6217} 6218 6219// IsEmpty returns true if the ListResult contains no values. 6220func (lur ListUsagesResult) IsEmpty() bool { 6221 return lur.Value == nil || len(*lur.Value) == 0 6222} 6223 6224// hasNextLink returns true if the NextLink is not empty. 6225func (lur ListUsagesResult) hasNextLink() bool { 6226 return lur.NextLink != nil && len(*lur.NextLink) != 0 6227} 6228 6229// listUsagesResultPreparer prepares a request to retrieve the next set of results. 6230// It returns nil if no more results exist. 6231func (lur ListUsagesResult) listUsagesResultPreparer(ctx context.Context) (*http.Request, error) { 6232 if !lur.hasNextLink() { 6233 return nil, nil 6234 } 6235 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6236 autorest.AsJSON(), 6237 autorest.AsGet(), 6238 autorest.WithBaseURL(to.String(lur.NextLink))) 6239} 6240 6241// ListUsagesResultPage contains a page of Usage values. 6242type ListUsagesResultPage struct { 6243 fn func(context.Context, ListUsagesResult) (ListUsagesResult, error) 6244 lur ListUsagesResult 6245} 6246 6247// NextWithContext advances to the next page of values. If there was an error making 6248// the request the page does not advance and the error is returned. 6249func (page *ListUsagesResultPage) NextWithContext(ctx context.Context) (err error) { 6250 if tracing.IsEnabled() { 6251 ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultPage.NextWithContext") 6252 defer func() { 6253 sc := -1 6254 if page.Response().Response.Response != nil { 6255 sc = page.Response().Response.Response.StatusCode 6256 } 6257 tracing.EndSpan(ctx, sc, err) 6258 }() 6259 } 6260 for { 6261 next, err := page.fn(ctx, page.lur) 6262 if err != nil { 6263 return err 6264 } 6265 page.lur = next 6266 if !next.hasNextLink() || !next.IsEmpty() { 6267 break 6268 } 6269 } 6270 return nil 6271} 6272 6273// Next advances to the next page of values. If there was an error making 6274// the request the page does not advance and the error is returned. 6275// Deprecated: Use NextWithContext() instead. 6276func (page *ListUsagesResultPage) Next() error { 6277 return page.NextWithContext(context.Background()) 6278} 6279 6280// NotDone returns true if the page enumeration should be started or is not yet complete. 6281func (page ListUsagesResultPage) NotDone() bool { 6282 return !page.lur.IsEmpty() 6283} 6284 6285// Response returns the raw server response from the last page request. 6286func (page ListUsagesResultPage) Response() ListUsagesResult { 6287 return page.lur 6288} 6289 6290// Values returns the slice of values for the current page or nil if there are no values. 6291func (page ListUsagesResultPage) Values() []Usage { 6292 if page.lur.IsEmpty() { 6293 return nil 6294 } 6295 return *page.lur.Value 6296} 6297 6298// Creates a new instance of the ListUsagesResultPage type. 6299func NewListUsagesResultPage(cur ListUsagesResult, getNextPage func(context.Context, ListUsagesResult) (ListUsagesResult, error)) ListUsagesResultPage { 6300 return ListUsagesResultPage{ 6301 fn: getNextPage, 6302 lur: cur, 6303 } 6304} 6305 6306// ListVirtualMachineExtensionImage ... 6307type ListVirtualMachineExtensionImage struct { 6308 autorest.Response `json:"-"` 6309 Value *[]VirtualMachineExtensionImage `json:"value,omitempty"` 6310} 6311 6312// ListVirtualMachineImageResource ... 6313type ListVirtualMachineImageResource struct { 6314 autorest.Response `json:"-"` 6315 Value *[]VirtualMachineImageResource `json:"value,omitempty"` 6316} 6317 6318// LogAnalyticsExportRequestRateByIntervalFuture an abstraction for monitoring and retrieving the results 6319// of a long-running operation. 6320type LogAnalyticsExportRequestRateByIntervalFuture struct { 6321 azure.FutureAPI 6322 // Result returns the result of the asynchronous operation. 6323 // If the operation has not completed it will return an error. 6324 Result func(LogAnalyticsClient) (LogAnalyticsOperationResult, error) 6325} 6326 6327// LogAnalyticsExportThrottledRequestsFuture an abstraction for monitoring and retrieving the results of a 6328// long-running operation. 6329type LogAnalyticsExportThrottledRequestsFuture struct { 6330 azure.FutureAPI 6331 // Result returns the result of the asynchronous operation. 6332 // If the operation has not completed it will return an error. 6333 Result func(LogAnalyticsClient) (LogAnalyticsOperationResult, error) 6334} 6335 6336// LogAnalyticsInputBase api input base class for LogAnalytics Api. 6337type LogAnalyticsInputBase struct { 6338 // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. 6339 BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` 6340 // FromTime - From time of the query 6341 FromTime *date.Time `json:"fromTime,omitempty"` 6342 // ToTime - To time of the query 6343 ToTime *date.Time `json:"toTime,omitempty"` 6344 // GroupByThrottlePolicy - Group query result by Throttle Policy applied. 6345 GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` 6346 // GroupByOperationName - Group query result by Operation Name. 6347 GroupByOperationName *bool `json:"groupByOperationName,omitempty"` 6348 // GroupByResourceName - Group query result by Resource Name. 6349 GroupByResourceName *bool `json:"groupByResourceName,omitempty"` 6350} 6351 6352// LogAnalyticsOperationResult logAnalytics operation status response 6353type LogAnalyticsOperationResult struct { 6354 autorest.Response `json:"-"` 6355 // Properties - READ-ONLY; LogAnalyticsOutput 6356 Properties *LogAnalyticsOutput `json:"properties,omitempty"` 6357} 6358 6359// LogAnalyticsOutput logAnalytics output properties 6360type LogAnalyticsOutput struct { 6361 // Output - READ-ONLY; Output file Uri path to blob container. 6362 Output *string `json:"output,omitempty"` 6363} 6364 6365// MaintenanceRedeployStatus maintenance Operation Status. 6366type MaintenanceRedeployStatus struct { 6367 // IsCustomerInitiatedMaintenanceAllowed - True, if customer is allowed to perform Maintenance. 6368 IsCustomerInitiatedMaintenanceAllowed *bool `json:"isCustomerInitiatedMaintenanceAllowed,omitempty"` 6369 // PreMaintenanceWindowStartTime - Start Time for the Pre Maintenance Window. 6370 PreMaintenanceWindowStartTime *date.Time `json:"preMaintenanceWindowStartTime,omitempty"` 6371 // PreMaintenanceWindowEndTime - End Time for the Pre Maintenance Window. 6372 PreMaintenanceWindowEndTime *date.Time `json:"preMaintenanceWindowEndTime,omitempty"` 6373 // MaintenanceWindowStartTime - Start Time for the Maintenance Window. 6374 MaintenanceWindowStartTime *date.Time `json:"maintenanceWindowStartTime,omitempty"` 6375 // MaintenanceWindowEndTime - End Time for the Maintenance Window. 6376 MaintenanceWindowEndTime *date.Time `json:"maintenanceWindowEndTime,omitempty"` 6377 // LastOperationResultCode - The Last Maintenance Operation Result Code. Possible values include: 'MaintenanceOperationResultCodeTypesNone', 'MaintenanceOperationResultCodeTypesRetryLater', 'MaintenanceOperationResultCodeTypesMaintenanceAborted', 'MaintenanceOperationResultCodeTypesMaintenanceCompleted' 6378 LastOperationResultCode MaintenanceOperationResultCodeTypes `json:"lastOperationResultCode,omitempty"` 6379 // LastOperationMessage - Message returned for the last Maintenance Operation. 6380 LastOperationMessage *string `json:"lastOperationMessage,omitempty"` 6381} 6382 6383// ManagedArtifact the managed artifact. 6384type ManagedArtifact struct { 6385 // ID - The managed artifact id. 6386 ID *string `json:"id,omitempty"` 6387} 6388 6389// ManagedDiskParameters the parameters of a managed disk. 6390type ManagedDiskParameters struct { 6391 // 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' 6392 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 6393 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed disk. 6394 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 6395 // ID - Resource Id 6396 ID *string `json:"id,omitempty"` 6397} 6398 6399// NetworkInterfaceReference describes a network interface reference. 6400type NetworkInterfaceReference struct { 6401 *NetworkInterfaceReferenceProperties `json:"properties,omitempty"` 6402 // ID - Resource Id 6403 ID *string `json:"id,omitempty"` 6404} 6405 6406// MarshalJSON is the custom marshaler for NetworkInterfaceReference. 6407func (nir NetworkInterfaceReference) MarshalJSON() ([]byte, error) { 6408 objectMap := make(map[string]interface{}) 6409 if nir.NetworkInterfaceReferenceProperties != nil { 6410 objectMap["properties"] = nir.NetworkInterfaceReferenceProperties 6411 } 6412 if nir.ID != nil { 6413 objectMap["id"] = nir.ID 6414 } 6415 return json.Marshal(objectMap) 6416} 6417 6418// UnmarshalJSON is the custom unmarshaler for NetworkInterfaceReference struct. 6419func (nir *NetworkInterfaceReference) UnmarshalJSON(body []byte) error { 6420 var m map[string]*json.RawMessage 6421 err := json.Unmarshal(body, &m) 6422 if err != nil { 6423 return err 6424 } 6425 for k, v := range m { 6426 switch k { 6427 case "properties": 6428 if v != nil { 6429 var networkInterfaceReferenceProperties NetworkInterfaceReferenceProperties 6430 err = json.Unmarshal(*v, &networkInterfaceReferenceProperties) 6431 if err != nil { 6432 return err 6433 } 6434 nir.NetworkInterfaceReferenceProperties = &networkInterfaceReferenceProperties 6435 } 6436 case "id": 6437 if v != nil { 6438 var ID string 6439 err = json.Unmarshal(*v, &ID) 6440 if err != nil { 6441 return err 6442 } 6443 nir.ID = &ID 6444 } 6445 } 6446 } 6447 6448 return nil 6449} 6450 6451// NetworkInterfaceReferenceProperties describes a network interface reference properties. 6452type NetworkInterfaceReferenceProperties struct { 6453 // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. 6454 Primary *bool `json:"primary,omitempty"` 6455} 6456 6457// NetworkProfile specifies the network interfaces of the virtual machine. 6458type NetworkProfile struct { 6459 // NetworkInterfaces - Specifies the list of resource Ids for the network interfaces associated with the virtual machine. 6460 NetworkInterfaces *[]NetworkInterfaceReference `json:"networkInterfaces,omitempty"` 6461} 6462 6463// OperationListResult the List Compute Operation operation response. 6464type OperationListResult struct { 6465 autorest.Response `json:"-"` 6466 // Value - READ-ONLY; The list of compute operations 6467 Value *[]OperationValue `json:"value,omitempty"` 6468} 6469 6470// OperationValue describes the properties of a Compute Operation value. 6471type OperationValue struct { 6472 // Origin - READ-ONLY; The origin of the compute operation. 6473 Origin *string `json:"origin,omitempty"` 6474 // Name - READ-ONLY; The name of the compute operation. 6475 Name *string `json:"name,omitempty"` 6476 *OperationValueDisplay `json:"display,omitempty"` 6477} 6478 6479// MarshalJSON is the custom marshaler for OperationValue. 6480func (ov OperationValue) MarshalJSON() ([]byte, error) { 6481 objectMap := make(map[string]interface{}) 6482 if ov.OperationValueDisplay != nil { 6483 objectMap["display"] = ov.OperationValueDisplay 6484 } 6485 return json.Marshal(objectMap) 6486} 6487 6488// UnmarshalJSON is the custom unmarshaler for OperationValue struct. 6489func (ov *OperationValue) UnmarshalJSON(body []byte) error { 6490 var m map[string]*json.RawMessage 6491 err := json.Unmarshal(body, &m) 6492 if err != nil { 6493 return err 6494 } 6495 for k, v := range m { 6496 switch k { 6497 case "origin": 6498 if v != nil { 6499 var origin string 6500 err = json.Unmarshal(*v, &origin) 6501 if err != nil { 6502 return err 6503 } 6504 ov.Origin = &origin 6505 } 6506 case "name": 6507 if v != nil { 6508 var name string 6509 err = json.Unmarshal(*v, &name) 6510 if err != nil { 6511 return err 6512 } 6513 ov.Name = &name 6514 } 6515 case "display": 6516 if v != nil { 6517 var operationValueDisplay OperationValueDisplay 6518 err = json.Unmarshal(*v, &operationValueDisplay) 6519 if err != nil { 6520 return err 6521 } 6522 ov.OperationValueDisplay = &operationValueDisplay 6523 } 6524 } 6525 } 6526 6527 return nil 6528} 6529 6530// OperationValueDisplay describes the properties of a Compute Operation Value Display. 6531type OperationValueDisplay struct { 6532 // Operation - READ-ONLY; The display name of the compute operation. 6533 Operation *string `json:"operation,omitempty"` 6534 // Resource - READ-ONLY; The display name of the resource the operation applies to. 6535 Resource *string `json:"resource,omitempty"` 6536 // Description - READ-ONLY; The description of the operation. 6537 Description *string `json:"description,omitempty"` 6538 // Provider - READ-ONLY; The resource provider for the operation. 6539 Provider *string `json:"provider,omitempty"` 6540} 6541 6542// OrchestrationServiceStateInput the input for OrchestrationServiceState 6543type OrchestrationServiceStateInput struct { 6544 // ServiceName - The name of the service. Possible values include: 'AutomaticRepairs' 6545 ServiceName OrchestrationServiceNames `json:"serviceName,omitempty"` 6546 // Action - The action to be performed. Possible values include: 'Resume', 'Suspend' 6547 Action OrchestrationServiceStateAction `json:"action,omitempty"` 6548} 6549 6550// OrchestrationServiceSummary summary for an orchestration service of a virtual machine scale set. 6551type OrchestrationServiceSummary struct { 6552 // ServiceName - READ-ONLY; The name of the service. Possible values include: 'AutomaticRepairs', 'DummyOrchestrationServiceName' 6553 ServiceName OrchestrationServiceNames `json:"serviceName,omitempty"` 6554 // ServiceState - READ-ONLY; The current state of the service. Possible values include: 'NotRunning', 'Running', 'Suspended' 6555 ServiceState OrchestrationServiceState `json:"serviceState,omitempty"` 6556} 6557 6558// OSDisk specifies information about the operating system disk used by the virtual machine. <br><br> For 6559// more information about disks, see [About disks and VHDs for Azure virtual 6560// machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). 6561type OSDisk struct { 6562 // 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' 6563 OsType OperatingSystemTypes `json:"osType,omitempty"` 6564 // EncryptionSettings - Specifies the encryption settings for the OS Disk. <br><br> Minimum api-version: 2015-06-15 6565 EncryptionSettings *DiskEncryptionSettings `json:"encryptionSettings,omitempty"` 6566 // Name - The disk name. 6567 Name *string `json:"name,omitempty"` 6568 // Vhd - The virtual hard disk. 6569 Vhd *VirtualHardDisk `json:"vhd,omitempty"` 6570 // 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. 6571 Image *VirtualHardDisk `json:"image,omitempty"` 6572 // 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' 6573 Caching CachingTypes `json:"caching,omitempty"` 6574 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 6575 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 6576 // DiffDiskSettings - Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine. 6577 DiffDiskSettings *DiffDiskSettings `json:"diffDiskSettings,omitempty"` 6578 // 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' 6579 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 6580 // 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 6581 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 6582 // ManagedDisk - The managed disk parameters. 6583 ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` 6584} 6585 6586// OSDiskImage contains the os disk image information. 6587type OSDiskImage struct { 6588 // OperatingSystem - The operating system of the osDiskImage. Possible values include: 'Windows', 'Linux' 6589 OperatingSystem OperatingSystemTypes `json:"operatingSystem,omitempty"` 6590} 6591 6592// OSDiskImageEncryption contains encryption settings for an OS disk image. 6593type OSDiskImageEncryption struct { 6594 // DiskEncryptionSetID - A relative URI containing the resource ID of the disk encryption set. 6595 DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` 6596} 6597 6598// OSProfile specifies the operating system settings for the virtual machine. Some of the settings cannot 6599// be changed once VM is provisioned. 6600type OSProfile struct { 6601 // 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). 6602 ComputerName *string `json:"computerName,omitempty"` 6603 // 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) 6604 AdminUsername *string `json:"adminUsername,omitempty"` 6605 // 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) 6606 AdminPassword *string `json:"adminPassword,omitempty"` 6607 // 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) 6608 CustomData *string `json:"customData,omitempty"` 6609 // WindowsConfiguration - Specifies Windows operating system settings on the virtual machine. 6610 WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` 6611 // 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). 6612 LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` 6613 // Secrets - Specifies set of certificates that should be installed onto the virtual machine. 6614 Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` 6615 // 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. 6616 AllowExtensionOperations *bool `json:"allowExtensionOperations,omitempty"` 6617 // RequireGuestProvisionSignal - Specifies whether the guest provision signal is required to infer provision success of the virtual machine. **Note: This property is for private testing only, and all customers must not set the property to false.** 6618 RequireGuestProvisionSignal *bool `json:"requireGuestProvisionSignal,omitempty"` 6619} 6620 6621// PatchSettings ... 6622type PatchSettings struct { 6623 // PatchMode - Specifies the mode of in-guest patching to IaaS virtual machine.<br /><br /> Possible values are:<br /><br /> **Manual** - You control the application of patches to a virtual machine. You do this by applying patches manually inside the VM. In this mode, automatic updates are disabled; the property WindowsConfiguration.enableAutomaticUpdates must be false<br /><br /> **AutomaticByOS** - The virtual machine will automatically be updated by the OS. The property WindowsConfiguration.enableAutomaticUpdates must be true. <br /><br /> ** AutomaticByPlatform** - the virtual machine will automatically updated by the platform. The properties provisionVMAgent and WindowsConfiguration.enableAutomaticUpdates must be true. Possible values include: 'Manual', 'AutomaticByOS', 'AutomaticByPlatform' 6624 PatchMode InGuestPatchMode `json:"patchMode,omitempty"` 6625} 6626 6627// Plan specifies information about the marketplace image used to create the virtual machine. This element 6628// is only used for marketplace images. Before you can use a marketplace image from an API, you must enable 6629// the image for programmatic use. In the Azure portal, find the marketplace image that you want to use 6630// and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and 6631// then click **Save**. 6632type Plan struct { 6633 // Name - The plan ID. 6634 Name *string `json:"name,omitempty"` 6635 // Publisher - The publisher ID. 6636 Publisher *string `json:"publisher,omitempty"` 6637 // Product - Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. 6638 Product *string `json:"product,omitempty"` 6639 // PromotionCode - The promotion code. 6640 PromotionCode *string `json:"promotionCode,omitempty"` 6641} 6642 6643// PrivateEndpoint the Private Endpoint resource. 6644type PrivateEndpoint struct { 6645 // ID - READ-ONLY; The ARM identifier for Private Endpoint 6646 ID *string `json:"id,omitempty"` 6647} 6648 6649// PrivateEndpointConnection the Private Endpoint Connection resource. 6650type PrivateEndpointConnection struct { 6651 // PrivateEndpointConnectionProperties - Resource properties. 6652 *PrivateEndpointConnectionProperties `json:"properties,omitempty"` 6653 // ID - READ-ONLY; private endpoint connection Id 6654 ID *string `json:"id,omitempty"` 6655 // Name - READ-ONLY; private endpoint connection name 6656 Name *string `json:"name,omitempty"` 6657 // Type - READ-ONLY; private endpoint connection type 6658 Type *string `json:"type,omitempty"` 6659} 6660 6661// MarshalJSON is the custom marshaler for PrivateEndpointConnection. 6662func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) { 6663 objectMap := make(map[string]interface{}) 6664 if pec.PrivateEndpointConnectionProperties != nil { 6665 objectMap["properties"] = pec.PrivateEndpointConnectionProperties 6666 } 6667 return json.Marshal(objectMap) 6668} 6669 6670// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct. 6671func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error { 6672 var m map[string]*json.RawMessage 6673 err := json.Unmarshal(body, &m) 6674 if err != nil { 6675 return err 6676 } 6677 for k, v := range m { 6678 switch k { 6679 case "properties": 6680 if v != nil { 6681 var privateEndpointConnectionProperties PrivateEndpointConnectionProperties 6682 err = json.Unmarshal(*v, &privateEndpointConnectionProperties) 6683 if err != nil { 6684 return err 6685 } 6686 pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties 6687 } 6688 case "id": 6689 if v != nil { 6690 var ID string 6691 err = json.Unmarshal(*v, &ID) 6692 if err != nil { 6693 return err 6694 } 6695 pec.ID = &ID 6696 } 6697 case "name": 6698 if v != nil { 6699 var name string 6700 err = json.Unmarshal(*v, &name) 6701 if err != nil { 6702 return err 6703 } 6704 pec.Name = &name 6705 } 6706 case "type": 6707 if v != nil { 6708 var typeVar string 6709 err = json.Unmarshal(*v, &typeVar) 6710 if err != nil { 6711 return err 6712 } 6713 pec.Type = &typeVar 6714 } 6715 } 6716 } 6717 6718 return nil 6719} 6720 6721// PrivateEndpointConnectionProperties properties of the PrivateEndpointConnectProperties. 6722type PrivateEndpointConnectionProperties struct { 6723 // PrivateEndpoint - The resource of private end point. 6724 PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` 6725 // PrivateLinkServiceConnectionState - A collection of information about the state of the connection between DiskAccess and Virtual Network. 6726 PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` 6727 // ProvisioningState - The provisioning state of the private endpoint connection resource. Possible values include: 'PrivateEndpointConnectionProvisioningStateSucceeded', 'PrivateEndpointConnectionProvisioningStateCreating', 'PrivateEndpointConnectionProvisioningStateDeleting', 'PrivateEndpointConnectionProvisioningStateFailed' 6728 ProvisioningState PrivateEndpointConnectionProvisioningState `json:"provisioningState,omitempty"` 6729} 6730 6731// PrivateLinkResource a private link resource 6732type PrivateLinkResource struct { 6733 // PrivateLinkResourceProperties - Resource properties. 6734 *PrivateLinkResourceProperties `json:"properties,omitempty"` 6735 // ID - READ-ONLY; private link resource Id 6736 ID *string `json:"id,omitempty"` 6737 // Name - READ-ONLY; private link resource name 6738 Name *string `json:"name,omitempty"` 6739 // Type - READ-ONLY; private link resource type 6740 Type *string `json:"type,omitempty"` 6741} 6742 6743// MarshalJSON is the custom marshaler for PrivateLinkResource. 6744func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) { 6745 objectMap := make(map[string]interface{}) 6746 if plr.PrivateLinkResourceProperties != nil { 6747 objectMap["properties"] = plr.PrivateLinkResourceProperties 6748 } 6749 return json.Marshal(objectMap) 6750} 6751 6752// UnmarshalJSON is the custom unmarshaler for PrivateLinkResource struct. 6753func (plr *PrivateLinkResource) UnmarshalJSON(body []byte) error { 6754 var m map[string]*json.RawMessage 6755 err := json.Unmarshal(body, &m) 6756 if err != nil { 6757 return err 6758 } 6759 for k, v := range m { 6760 switch k { 6761 case "properties": 6762 if v != nil { 6763 var privateLinkResourceProperties PrivateLinkResourceProperties 6764 err = json.Unmarshal(*v, &privateLinkResourceProperties) 6765 if err != nil { 6766 return err 6767 } 6768 plr.PrivateLinkResourceProperties = &privateLinkResourceProperties 6769 } 6770 case "id": 6771 if v != nil { 6772 var ID string 6773 err = json.Unmarshal(*v, &ID) 6774 if err != nil { 6775 return err 6776 } 6777 plr.ID = &ID 6778 } 6779 case "name": 6780 if v != nil { 6781 var name string 6782 err = json.Unmarshal(*v, &name) 6783 if err != nil { 6784 return err 6785 } 6786 plr.Name = &name 6787 } 6788 case "type": 6789 if v != nil { 6790 var typeVar string 6791 err = json.Unmarshal(*v, &typeVar) 6792 if err != nil { 6793 return err 6794 } 6795 plr.Type = &typeVar 6796 } 6797 } 6798 } 6799 6800 return nil 6801} 6802 6803// PrivateLinkResourceListResult a list of private link resources 6804type PrivateLinkResourceListResult struct { 6805 autorest.Response `json:"-"` 6806 // Value - Array of private link resources 6807 Value *[]PrivateLinkResource `json:"value,omitempty"` 6808} 6809 6810// PrivateLinkResourceProperties properties of a private link resource. 6811type PrivateLinkResourceProperties struct { 6812 // GroupID - READ-ONLY; The private link resource group id. 6813 GroupID *string `json:"groupId,omitempty"` 6814 // RequiredMembers - READ-ONLY; The private link resource required member names. 6815 RequiredMembers *[]string `json:"requiredMembers,omitempty"` 6816 // RequiredZoneNames - The private link resource DNS zone name. 6817 RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` 6818} 6819 6820// MarshalJSON is the custom marshaler for PrivateLinkResourceProperties. 6821func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { 6822 objectMap := make(map[string]interface{}) 6823 if plrp.RequiredZoneNames != nil { 6824 objectMap["requiredZoneNames"] = plrp.RequiredZoneNames 6825 } 6826 return json.Marshal(objectMap) 6827} 6828 6829// PrivateLinkServiceConnectionState a collection of information about the state of the connection between 6830// service consumer and provider. 6831type PrivateLinkServiceConnectionState struct { 6832 // Status - Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: 'Pending', 'Approved', 'Rejected' 6833 Status PrivateEndpointServiceConnectionStatus `json:"status,omitempty"` 6834 // Description - The reason for approval/rejection of the connection. 6835 Description *string `json:"description,omitempty"` 6836 // ActionsRequired - A message indicating if changes on the service provider require any updates on the consumer. 6837 ActionsRequired *string `json:"actionsRequired,omitempty"` 6838} 6839 6840// ProximityPlacementGroup specifies information about the proximity placement group. 6841type ProximityPlacementGroup struct { 6842 autorest.Response `json:"-"` 6843 // ProximityPlacementGroupProperties - Describes the properties of a Proximity Placement Group. 6844 *ProximityPlacementGroupProperties `json:"properties,omitempty"` 6845 // ID - READ-ONLY; Resource Id 6846 ID *string `json:"id,omitempty"` 6847 // Name - READ-ONLY; Resource name 6848 Name *string `json:"name,omitempty"` 6849 // Type - READ-ONLY; Resource type 6850 Type *string `json:"type,omitempty"` 6851 // Location - Resource location 6852 Location *string `json:"location,omitempty"` 6853 // Tags - Resource tags 6854 Tags map[string]*string `json:"tags"` 6855} 6856 6857// MarshalJSON is the custom marshaler for ProximityPlacementGroup. 6858func (ppg ProximityPlacementGroup) MarshalJSON() ([]byte, error) { 6859 objectMap := make(map[string]interface{}) 6860 if ppg.ProximityPlacementGroupProperties != nil { 6861 objectMap["properties"] = ppg.ProximityPlacementGroupProperties 6862 } 6863 if ppg.Location != nil { 6864 objectMap["location"] = ppg.Location 6865 } 6866 if ppg.Tags != nil { 6867 objectMap["tags"] = ppg.Tags 6868 } 6869 return json.Marshal(objectMap) 6870} 6871 6872// UnmarshalJSON is the custom unmarshaler for ProximityPlacementGroup struct. 6873func (ppg *ProximityPlacementGroup) UnmarshalJSON(body []byte) error { 6874 var m map[string]*json.RawMessage 6875 err := json.Unmarshal(body, &m) 6876 if err != nil { 6877 return err 6878 } 6879 for k, v := range m { 6880 switch k { 6881 case "properties": 6882 if v != nil { 6883 var proximityPlacementGroupProperties ProximityPlacementGroupProperties 6884 err = json.Unmarshal(*v, &proximityPlacementGroupProperties) 6885 if err != nil { 6886 return err 6887 } 6888 ppg.ProximityPlacementGroupProperties = &proximityPlacementGroupProperties 6889 } 6890 case "id": 6891 if v != nil { 6892 var ID string 6893 err = json.Unmarshal(*v, &ID) 6894 if err != nil { 6895 return err 6896 } 6897 ppg.ID = &ID 6898 } 6899 case "name": 6900 if v != nil { 6901 var name string 6902 err = json.Unmarshal(*v, &name) 6903 if err != nil { 6904 return err 6905 } 6906 ppg.Name = &name 6907 } 6908 case "type": 6909 if v != nil { 6910 var typeVar string 6911 err = json.Unmarshal(*v, &typeVar) 6912 if err != nil { 6913 return err 6914 } 6915 ppg.Type = &typeVar 6916 } 6917 case "location": 6918 if v != nil { 6919 var location string 6920 err = json.Unmarshal(*v, &location) 6921 if err != nil { 6922 return err 6923 } 6924 ppg.Location = &location 6925 } 6926 case "tags": 6927 if v != nil { 6928 var tags map[string]*string 6929 err = json.Unmarshal(*v, &tags) 6930 if err != nil { 6931 return err 6932 } 6933 ppg.Tags = tags 6934 } 6935 } 6936 } 6937 6938 return nil 6939} 6940 6941// ProximityPlacementGroupListResult the List Proximity Placement Group operation response. 6942type ProximityPlacementGroupListResult struct { 6943 autorest.Response `json:"-"` 6944 // Value - The list of proximity placement groups 6945 Value *[]ProximityPlacementGroup `json:"value,omitempty"` 6946 // NextLink - The URI to fetch the next page of proximity placement groups. 6947 NextLink *string `json:"nextLink,omitempty"` 6948} 6949 6950// ProximityPlacementGroupListResultIterator provides access to a complete listing of 6951// ProximityPlacementGroup values. 6952type ProximityPlacementGroupListResultIterator struct { 6953 i int 6954 page ProximityPlacementGroupListResultPage 6955} 6956 6957// NextWithContext advances to the next value. If there was an error making 6958// the request the iterator does not advance and the error is returned. 6959func (iter *ProximityPlacementGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { 6960 if tracing.IsEnabled() { 6961 ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupListResultIterator.NextWithContext") 6962 defer func() { 6963 sc := -1 6964 if iter.Response().Response.Response != nil { 6965 sc = iter.Response().Response.Response.StatusCode 6966 } 6967 tracing.EndSpan(ctx, sc, err) 6968 }() 6969 } 6970 iter.i++ 6971 if iter.i < len(iter.page.Values()) { 6972 return nil 6973 } 6974 err = iter.page.NextWithContext(ctx) 6975 if err != nil { 6976 iter.i-- 6977 return err 6978 } 6979 iter.i = 0 6980 return nil 6981} 6982 6983// Next advances to the next value. If there was an error making 6984// the request the iterator does not advance and the error is returned. 6985// Deprecated: Use NextWithContext() instead. 6986func (iter *ProximityPlacementGroupListResultIterator) Next() error { 6987 return iter.NextWithContext(context.Background()) 6988} 6989 6990// NotDone returns true if the enumeration should be started or is not yet complete. 6991func (iter ProximityPlacementGroupListResultIterator) NotDone() bool { 6992 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6993} 6994 6995// Response returns the raw server response from the last page request. 6996func (iter ProximityPlacementGroupListResultIterator) Response() ProximityPlacementGroupListResult { 6997 return iter.page.Response() 6998} 6999 7000// Value returns the current value or a zero-initialized value if the 7001// iterator has advanced beyond the end of the collection. 7002func (iter ProximityPlacementGroupListResultIterator) Value() ProximityPlacementGroup { 7003 if !iter.page.NotDone() { 7004 return ProximityPlacementGroup{} 7005 } 7006 return iter.page.Values()[iter.i] 7007} 7008 7009// Creates a new instance of the ProximityPlacementGroupListResultIterator type. 7010func NewProximityPlacementGroupListResultIterator(page ProximityPlacementGroupListResultPage) ProximityPlacementGroupListResultIterator { 7011 return ProximityPlacementGroupListResultIterator{page: page} 7012} 7013 7014// IsEmpty returns true if the ListResult contains no values. 7015func (ppglr ProximityPlacementGroupListResult) IsEmpty() bool { 7016 return ppglr.Value == nil || len(*ppglr.Value) == 0 7017} 7018 7019// hasNextLink returns true if the NextLink is not empty. 7020func (ppglr ProximityPlacementGroupListResult) hasNextLink() bool { 7021 return ppglr.NextLink != nil && len(*ppglr.NextLink) != 0 7022} 7023 7024// proximityPlacementGroupListResultPreparer prepares a request to retrieve the next set of results. 7025// It returns nil if no more results exist. 7026func (ppglr ProximityPlacementGroupListResult) proximityPlacementGroupListResultPreparer(ctx context.Context) (*http.Request, error) { 7027 if !ppglr.hasNextLink() { 7028 return nil, nil 7029 } 7030 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7031 autorest.AsJSON(), 7032 autorest.AsGet(), 7033 autorest.WithBaseURL(to.String(ppglr.NextLink))) 7034} 7035 7036// ProximityPlacementGroupListResultPage contains a page of ProximityPlacementGroup values. 7037type ProximityPlacementGroupListResultPage struct { 7038 fn func(context.Context, ProximityPlacementGroupListResult) (ProximityPlacementGroupListResult, error) 7039 ppglr ProximityPlacementGroupListResult 7040} 7041 7042// NextWithContext advances to the next page of values. If there was an error making 7043// the request the page does not advance and the error is returned. 7044func (page *ProximityPlacementGroupListResultPage) NextWithContext(ctx context.Context) (err error) { 7045 if tracing.IsEnabled() { 7046 ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupListResultPage.NextWithContext") 7047 defer func() { 7048 sc := -1 7049 if page.Response().Response.Response != nil { 7050 sc = page.Response().Response.Response.StatusCode 7051 } 7052 tracing.EndSpan(ctx, sc, err) 7053 }() 7054 } 7055 for { 7056 next, err := page.fn(ctx, page.ppglr) 7057 if err != nil { 7058 return err 7059 } 7060 page.ppglr = next 7061 if !next.hasNextLink() || !next.IsEmpty() { 7062 break 7063 } 7064 } 7065 return nil 7066} 7067 7068// Next advances to the next page of values. If there was an error making 7069// the request the page does not advance and the error is returned. 7070// Deprecated: Use NextWithContext() instead. 7071func (page *ProximityPlacementGroupListResultPage) Next() error { 7072 return page.NextWithContext(context.Background()) 7073} 7074 7075// NotDone returns true if the page enumeration should be started or is not yet complete. 7076func (page ProximityPlacementGroupListResultPage) NotDone() bool { 7077 return !page.ppglr.IsEmpty() 7078} 7079 7080// Response returns the raw server response from the last page request. 7081func (page ProximityPlacementGroupListResultPage) Response() ProximityPlacementGroupListResult { 7082 return page.ppglr 7083} 7084 7085// Values returns the slice of values for the current page or nil if there are no values. 7086func (page ProximityPlacementGroupListResultPage) Values() []ProximityPlacementGroup { 7087 if page.ppglr.IsEmpty() { 7088 return nil 7089 } 7090 return *page.ppglr.Value 7091} 7092 7093// Creates a new instance of the ProximityPlacementGroupListResultPage type. 7094func NewProximityPlacementGroupListResultPage(cur ProximityPlacementGroupListResult, getNextPage func(context.Context, ProximityPlacementGroupListResult) (ProximityPlacementGroupListResult, error)) ProximityPlacementGroupListResultPage { 7095 return ProximityPlacementGroupListResultPage{ 7096 fn: getNextPage, 7097 ppglr: cur, 7098 } 7099} 7100 7101// ProximityPlacementGroupProperties describes the properties of a Proximity Placement Group. 7102type ProximityPlacementGroupProperties struct { 7103 // 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' 7104 ProximityPlacementGroupType ProximityPlacementGroupType `json:"proximityPlacementGroupType,omitempty"` 7105 // VirtualMachines - READ-ONLY; A list of references to all virtual machines in the proximity placement group. 7106 VirtualMachines *[]SubResourceWithColocationStatus `json:"virtualMachines,omitempty"` 7107 // VirtualMachineScaleSets - READ-ONLY; A list of references to all virtual machine scale sets in the proximity placement group. 7108 VirtualMachineScaleSets *[]SubResourceWithColocationStatus `json:"virtualMachineScaleSets,omitempty"` 7109 // AvailabilitySets - READ-ONLY; A list of references to all availability sets in the proximity placement group. 7110 AvailabilitySets *[]SubResourceWithColocationStatus `json:"availabilitySets,omitempty"` 7111 // ColocationStatus - Describes colocation status of the Proximity Placement Group. 7112 ColocationStatus *InstanceViewStatus `json:"colocationStatus,omitempty"` 7113} 7114 7115// MarshalJSON is the custom marshaler for ProximityPlacementGroupProperties. 7116func (ppgp ProximityPlacementGroupProperties) MarshalJSON() ([]byte, error) { 7117 objectMap := make(map[string]interface{}) 7118 if ppgp.ProximityPlacementGroupType != "" { 7119 objectMap["proximityPlacementGroupType"] = ppgp.ProximityPlacementGroupType 7120 } 7121 if ppgp.ColocationStatus != nil { 7122 objectMap["colocationStatus"] = ppgp.ColocationStatus 7123 } 7124 return json.Marshal(objectMap) 7125} 7126 7127// ProximityPlacementGroupUpdate specifies information about the proximity placement group. 7128type ProximityPlacementGroupUpdate struct { 7129 // Tags - Resource tags 7130 Tags map[string]*string `json:"tags"` 7131} 7132 7133// MarshalJSON is the custom marshaler for ProximityPlacementGroupUpdate. 7134func (ppgu ProximityPlacementGroupUpdate) MarshalJSON() ([]byte, error) { 7135 objectMap := make(map[string]interface{}) 7136 if ppgu.Tags != nil { 7137 objectMap["tags"] = ppgu.Tags 7138 } 7139 return json.Marshal(objectMap) 7140} 7141 7142// PurchasePlan used for establishing the purchase context of any 3rd Party artifact through MarketPlace. 7143type PurchasePlan struct { 7144 // Publisher - The publisher ID. 7145 Publisher *string `json:"publisher,omitempty"` 7146 // Name - The plan ID. 7147 Name *string `json:"name,omitempty"` 7148 // Product - Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. 7149 Product *string `json:"product,omitempty"` 7150} 7151 7152// RecommendedMachineConfiguration the properties describe the recommended machine configuration for this 7153// Image Definition. These properties are updatable. 7154type RecommendedMachineConfiguration struct { 7155 VCPUs *ResourceRange `json:"vCPUs,omitempty"` 7156 Memory *ResourceRange `json:"memory,omitempty"` 7157} 7158 7159// RecoveryWalkResponse response after calling a manual recovery walk 7160type RecoveryWalkResponse struct { 7161 autorest.Response `json:"-"` 7162 // WalkPerformed - READ-ONLY; Whether the recovery walk was performed 7163 WalkPerformed *bool `json:"walkPerformed,omitempty"` 7164 // NextPlatformUpdateDomain - READ-ONLY; The next update domain that needs to be walked. Null means walk spanning all update domains has been completed 7165 NextPlatformUpdateDomain *int32 `json:"nextPlatformUpdateDomain,omitempty"` 7166} 7167 7168// RegionalReplicationStatus this is the regional replication status. 7169type RegionalReplicationStatus struct { 7170 // Region - READ-ONLY; The region to which the gallery Image Version is being replicated to. 7171 Region *string `json:"region,omitempty"` 7172 // State - READ-ONLY; This is the regional replication state. Possible values include: 'ReplicationStateUnknown', 'ReplicationStateReplicating', 'ReplicationStateCompleted', 'ReplicationStateFailed' 7173 State ReplicationState `json:"state,omitempty"` 7174 // Details - READ-ONLY; The details of the replication status. 7175 Details *string `json:"details,omitempty"` 7176 // Progress - READ-ONLY; It indicates progress of the replication job. 7177 Progress *int32 `json:"progress,omitempty"` 7178} 7179 7180// ReplicationStatus this is the replication status of the gallery Image Version. 7181type ReplicationStatus struct { 7182 // AggregatedState - READ-ONLY; This is the aggregated replication status based on all the regional replication status flags. Possible values include: 'Unknown', 'InProgress', 'Completed', 'Failed' 7183 AggregatedState AggregatedReplicationState `json:"aggregatedState,omitempty"` 7184 // Summary - READ-ONLY; This is a summary of replication status for each region. 7185 Summary *[]RegionalReplicationStatus `json:"summary,omitempty"` 7186} 7187 7188// RequestRateByIntervalInput api request input for LogAnalytics getRequestRateByInterval Api. 7189type RequestRateByIntervalInput struct { 7190 // IntervalLength - Interval value in minutes used to create LogAnalytics call rate logs. Possible values include: 'ThreeMins', 'FiveMins', 'ThirtyMins', 'SixtyMins' 7191 IntervalLength IntervalInMins `json:"intervalLength,omitempty"` 7192 // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. 7193 BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` 7194 // FromTime - From time of the query 7195 FromTime *date.Time `json:"fromTime,omitempty"` 7196 // ToTime - To time of the query 7197 ToTime *date.Time `json:"toTime,omitempty"` 7198 // GroupByThrottlePolicy - Group query result by Throttle Policy applied. 7199 GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` 7200 // GroupByOperationName - Group query result by Operation Name. 7201 GroupByOperationName *bool `json:"groupByOperationName,omitempty"` 7202 // GroupByResourceName - Group query result by Resource Name. 7203 GroupByResourceName *bool `json:"groupByResourceName,omitempty"` 7204} 7205 7206// Resource the Resource model definition. 7207type Resource struct { 7208 // ID - READ-ONLY; Resource Id 7209 ID *string `json:"id,omitempty"` 7210 // Name - READ-ONLY; Resource name 7211 Name *string `json:"name,omitempty"` 7212 // Type - READ-ONLY; Resource type 7213 Type *string `json:"type,omitempty"` 7214 // Location - Resource location 7215 Location *string `json:"location,omitempty"` 7216 // Tags - Resource tags 7217 Tags map[string]*string `json:"tags"` 7218} 7219 7220// MarshalJSON is the custom marshaler for Resource. 7221func (r Resource) MarshalJSON() ([]byte, error) { 7222 objectMap := make(map[string]interface{}) 7223 if r.Location != nil { 7224 objectMap["location"] = r.Location 7225 } 7226 if r.Tags != nil { 7227 objectMap["tags"] = r.Tags 7228 } 7229 return json.Marshal(objectMap) 7230} 7231 7232// ResourceRange describes the resource range. 7233type ResourceRange struct { 7234 // Min - The minimum number of the resource. 7235 Min *int32 `json:"min,omitempty"` 7236 // Max - The maximum number of the resource. 7237 Max *int32 `json:"max,omitempty"` 7238} 7239 7240// ResourceSku describes an available Compute SKU. 7241type ResourceSku struct { 7242 // ResourceType - READ-ONLY; The type of resource the SKU applies to. 7243 ResourceType *string `json:"resourceType,omitempty"` 7244 // Name - READ-ONLY; The name of SKU. 7245 Name *string `json:"name,omitempty"` 7246 // Tier - READ-ONLY; Specifies the tier of virtual machines in a scale set.<br /><br /> Possible Values:<br /><br /> **Standard**<br /><br /> **Basic** 7247 Tier *string `json:"tier,omitempty"` 7248 // Size - READ-ONLY; The Size of the SKU. 7249 Size *string `json:"size,omitempty"` 7250 // Family - READ-ONLY; The Family of this particular SKU. 7251 Family *string `json:"family,omitempty"` 7252 // Kind - READ-ONLY; The Kind of resources that are supported in this SKU. 7253 Kind *string `json:"kind,omitempty"` 7254 // Capacity - READ-ONLY; Specifies the number of virtual machines in the scale set. 7255 Capacity *ResourceSkuCapacity `json:"capacity,omitempty"` 7256 // Locations - READ-ONLY; The set of locations that the SKU is available. 7257 Locations *[]string `json:"locations,omitempty"` 7258 // LocationInfo - READ-ONLY; A list of locations and availability zones in those locations where the SKU is available. 7259 LocationInfo *[]ResourceSkuLocationInfo `json:"locationInfo,omitempty"` 7260 // APIVersions - READ-ONLY; The api versions that support this SKU. 7261 APIVersions *[]string `json:"apiVersions,omitempty"` 7262 // Costs - READ-ONLY; Metadata for retrieving price info. 7263 Costs *[]ResourceSkuCosts `json:"costs,omitempty"` 7264 // Capabilities - READ-ONLY; A name value pair to describe the capability. 7265 Capabilities *[]ResourceSkuCapabilities `json:"capabilities,omitempty"` 7266 // Restrictions - READ-ONLY; The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. 7267 Restrictions *[]ResourceSkuRestrictions `json:"restrictions,omitempty"` 7268} 7269 7270// ResourceSkuCapabilities describes The SKU capabilities object. 7271type ResourceSkuCapabilities struct { 7272 // Name - READ-ONLY; An invariant to describe the feature. 7273 Name *string `json:"name,omitempty"` 7274 // Value - READ-ONLY; An invariant if the feature is measured by quantity. 7275 Value *string `json:"value,omitempty"` 7276} 7277 7278// ResourceSkuCapacity describes scaling information of a SKU. 7279type ResourceSkuCapacity struct { 7280 // Minimum - READ-ONLY; The minimum capacity. 7281 Minimum *int64 `json:"minimum,omitempty"` 7282 // Maximum - READ-ONLY; The maximum capacity that can be set. 7283 Maximum *int64 `json:"maximum,omitempty"` 7284 // Default - READ-ONLY; The default capacity. 7285 Default *int64 `json:"default,omitempty"` 7286 // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'ResourceSkuCapacityScaleTypeAutomatic', 'ResourceSkuCapacityScaleTypeManual', 'ResourceSkuCapacityScaleTypeNone' 7287 ScaleType ResourceSkuCapacityScaleType `json:"scaleType,omitempty"` 7288} 7289 7290// ResourceSkuCosts describes metadata for retrieving price info. 7291type ResourceSkuCosts struct { 7292 // MeterID - READ-ONLY; Used for querying price from commerce. 7293 MeterID *string `json:"meterID,omitempty"` 7294 // Quantity - READ-ONLY; The multiplier is needed to extend the base metered cost. 7295 Quantity *int64 `json:"quantity,omitempty"` 7296 // ExtendedUnit - READ-ONLY; An invariant to show the extended unit. 7297 ExtendedUnit *string `json:"extendedUnit,omitempty"` 7298} 7299 7300// ResourceSkuLocationInfo ... 7301type ResourceSkuLocationInfo struct { 7302 // Location - READ-ONLY; Location of the SKU 7303 Location *string `json:"location,omitempty"` 7304 // Zones - READ-ONLY; List of availability zones where the SKU is supported. 7305 Zones *[]string `json:"zones,omitempty"` 7306 // ZoneDetails - READ-ONLY; Details of capabilities available to a SKU in specific zones. 7307 ZoneDetails *[]ResourceSkuZoneDetails `json:"zoneDetails,omitempty"` 7308} 7309 7310// ResourceSkuRestrictionInfo ... 7311type ResourceSkuRestrictionInfo struct { 7312 // Locations - READ-ONLY; Locations where the SKU is restricted 7313 Locations *[]string `json:"locations,omitempty"` 7314 // Zones - READ-ONLY; List of availability zones where the SKU is restricted. 7315 Zones *[]string `json:"zones,omitempty"` 7316} 7317 7318// ResourceSkuRestrictions describes scaling information of a SKU. 7319type ResourceSkuRestrictions struct { 7320 // Type - READ-ONLY; The type of restrictions. Possible values include: 'Location', 'Zone' 7321 Type ResourceSkuRestrictionsType `json:"type,omitempty"` 7322 // 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. 7323 Values *[]string `json:"values,omitempty"` 7324 // RestrictionInfo - READ-ONLY; The information about the restriction where the SKU cannot be used. 7325 RestrictionInfo *ResourceSkuRestrictionInfo `json:"restrictionInfo,omitempty"` 7326 // ReasonCode - READ-ONLY; The reason for restriction. Possible values include: 'QuotaID', 'NotAvailableForSubscription' 7327 ReasonCode ResourceSkuRestrictionsReasonCode `json:"reasonCode,omitempty"` 7328} 7329 7330// ResourceSkusResult the List Resource Skus operation response. 7331type ResourceSkusResult struct { 7332 autorest.Response `json:"-"` 7333 // Value - The list of skus available for the subscription. 7334 Value *[]ResourceSku `json:"value,omitempty"` 7335 // NextLink - The URI to fetch the next page of Resource Skus. Call ListNext() with this URI to fetch the next page of Resource Skus 7336 NextLink *string `json:"nextLink,omitempty"` 7337} 7338 7339// ResourceSkusResultIterator provides access to a complete listing of ResourceSku values. 7340type ResourceSkusResultIterator struct { 7341 i int 7342 page ResourceSkusResultPage 7343} 7344 7345// NextWithContext advances to the next value. If there was an error making 7346// the request the iterator does not advance and the error is returned. 7347func (iter *ResourceSkusResultIterator) NextWithContext(ctx context.Context) (err error) { 7348 if tracing.IsEnabled() { 7349 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusResultIterator.NextWithContext") 7350 defer func() { 7351 sc := -1 7352 if iter.Response().Response.Response != nil { 7353 sc = iter.Response().Response.Response.StatusCode 7354 } 7355 tracing.EndSpan(ctx, sc, err) 7356 }() 7357 } 7358 iter.i++ 7359 if iter.i < len(iter.page.Values()) { 7360 return nil 7361 } 7362 err = iter.page.NextWithContext(ctx) 7363 if err != nil { 7364 iter.i-- 7365 return err 7366 } 7367 iter.i = 0 7368 return nil 7369} 7370 7371// Next advances to the next value. If there was an error making 7372// the request the iterator does not advance and the error is returned. 7373// Deprecated: Use NextWithContext() instead. 7374func (iter *ResourceSkusResultIterator) Next() error { 7375 return iter.NextWithContext(context.Background()) 7376} 7377 7378// NotDone returns true if the enumeration should be started or is not yet complete. 7379func (iter ResourceSkusResultIterator) NotDone() bool { 7380 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7381} 7382 7383// Response returns the raw server response from the last page request. 7384func (iter ResourceSkusResultIterator) Response() ResourceSkusResult { 7385 return iter.page.Response() 7386} 7387 7388// Value returns the current value or a zero-initialized value if the 7389// iterator has advanced beyond the end of the collection. 7390func (iter ResourceSkusResultIterator) Value() ResourceSku { 7391 if !iter.page.NotDone() { 7392 return ResourceSku{} 7393 } 7394 return iter.page.Values()[iter.i] 7395} 7396 7397// Creates a new instance of the ResourceSkusResultIterator type. 7398func NewResourceSkusResultIterator(page ResourceSkusResultPage) ResourceSkusResultIterator { 7399 return ResourceSkusResultIterator{page: page} 7400} 7401 7402// IsEmpty returns true if the ListResult contains no values. 7403func (rsr ResourceSkusResult) IsEmpty() bool { 7404 return rsr.Value == nil || len(*rsr.Value) == 0 7405} 7406 7407// hasNextLink returns true if the NextLink is not empty. 7408func (rsr ResourceSkusResult) hasNextLink() bool { 7409 return rsr.NextLink != nil && len(*rsr.NextLink) != 0 7410} 7411 7412// resourceSkusResultPreparer prepares a request to retrieve the next set of results. 7413// It returns nil if no more results exist. 7414func (rsr ResourceSkusResult) resourceSkusResultPreparer(ctx context.Context) (*http.Request, error) { 7415 if !rsr.hasNextLink() { 7416 return nil, nil 7417 } 7418 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7419 autorest.AsJSON(), 7420 autorest.AsGet(), 7421 autorest.WithBaseURL(to.String(rsr.NextLink))) 7422} 7423 7424// ResourceSkusResultPage contains a page of ResourceSku values. 7425type ResourceSkusResultPage struct { 7426 fn func(context.Context, ResourceSkusResult) (ResourceSkusResult, error) 7427 rsr ResourceSkusResult 7428} 7429 7430// NextWithContext advances to the next page of values. If there was an error making 7431// the request the page does not advance and the error is returned. 7432func (page *ResourceSkusResultPage) NextWithContext(ctx context.Context) (err error) { 7433 if tracing.IsEnabled() { 7434 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusResultPage.NextWithContext") 7435 defer func() { 7436 sc := -1 7437 if page.Response().Response.Response != nil { 7438 sc = page.Response().Response.Response.StatusCode 7439 } 7440 tracing.EndSpan(ctx, sc, err) 7441 }() 7442 } 7443 for { 7444 next, err := page.fn(ctx, page.rsr) 7445 if err != nil { 7446 return err 7447 } 7448 page.rsr = next 7449 if !next.hasNextLink() || !next.IsEmpty() { 7450 break 7451 } 7452 } 7453 return nil 7454} 7455 7456// Next advances to the next page of values. If there was an error making 7457// the request the page does not advance and the error is returned. 7458// Deprecated: Use NextWithContext() instead. 7459func (page *ResourceSkusResultPage) Next() error { 7460 return page.NextWithContext(context.Background()) 7461} 7462 7463// NotDone returns true if the page enumeration should be started or is not yet complete. 7464func (page ResourceSkusResultPage) NotDone() bool { 7465 return !page.rsr.IsEmpty() 7466} 7467 7468// Response returns the raw server response from the last page request. 7469func (page ResourceSkusResultPage) Response() ResourceSkusResult { 7470 return page.rsr 7471} 7472 7473// Values returns the slice of values for the current page or nil if there are no values. 7474func (page ResourceSkusResultPage) Values() []ResourceSku { 7475 if page.rsr.IsEmpty() { 7476 return nil 7477 } 7478 return *page.rsr.Value 7479} 7480 7481// Creates a new instance of the ResourceSkusResultPage type. 7482func NewResourceSkusResultPage(cur ResourceSkusResult, getNextPage func(context.Context, ResourceSkusResult) (ResourceSkusResult, error)) ResourceSkusResultPage { 7483 return ResourceSkusResultPage{ 7484 fn: getNextPage, 7485 rsr: cur, 7486 } 7487} 7488 7489// ResourceSkuZoneDetails describes The zonal capabilities of a SKU. 7490type ResourceSkuZoneDetails struct { 7491 // Name - READ-ONLY; The set of zones that the SKU is available in with the specified capabilities. 7492 Name *[]string `json:"name,omitempty"` 7493 // Capabilities - READ-ONLY; A list of capabilities that are available for the SKU in the specified list of zones. 7494 Capabilities *[]ResourceSkuCapabilities `json:"capabilities,omitempty"` 7495} 7496 7497// RetrieveBootDiagnosticsDataResult the SAS URIs of the console screenshot and serial log blobs. 7498type RetrieveBootDiagnosticsDataResult struct { 7499 autorest.Response `json:"-"` 7500 // ConsoleScreenshotBlobURI - READ-ONLY; The console screenshot blob URI 7501 ConsoleScreenshotBlobURI *string `json:"consoleScreenshotBlobUri,omitempty"` 7502 // SerialConsoleLogBlobURI - READ-ONLY; The serial console log blob URI. 7503 SerialConsoleLogBlobURI *string `json:"serialConsoleLogBlobUri,omitempty"` 7504} 7505 7506// RollbackStatusInfo information about rollback on failed VM instances after a OS Upgrade operation. 7507type RollbackStatusInfo struct { 7508 // SuccessfullyRolledbackInstanceCount - READ-ONLY; The number of instances which have been successfully rolled back. 7509 SuccessfullyRolledbackInstanceCount *int32 `json:"successfullyRolledbackInstanceCount,omitempty"` 7510 // FailedRolledbackInstanceCount - READ-ONLY; The number of instances which failed to rollback. 7511 FailedRolledbackInstanceCount *int32 `json:"failedRolledbackInstanceCount,omitempty"` 7512 // RollbackError - READ-ONLY; Error details if OS rollback failed. 7513 RollbackError *APIError `json:"rollbackError,omitempty"` 7514} 7515 7516// RollingUpgradePolicy the configuration parameters used while performing a rolling upgrade. 7517type RollingUpgradePolicy struct { 7518 // 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%. 7519 MaxBatchInstancePercent *int32 `json:"maxBatchInstancePercent,omitempty"` 7520 // 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%. 7521 MaxUnhealthyInstancePercent *int32 `json:"maxUnhealthyInstancePercent,omitempty"` 7522 // 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%. 7523 MaxUnhealthyUpgradedInstancePercent *int32 `json:"maxUnhealthyUpgradedInstancePercent,omitempty"` 7524 // 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). 7525 PauseTimeBetweenBatches *string `json:"pauseTimeBetweenBatches,omitempty"` 7526} 7527 7528// RollingUpgradeProgressInfo information about the number of virtual machine instances in each upgrade 7529// state. 7530type RollingUpgradeProgressInfo struct { 7531 // SuccessfulInstanceCount - READ-ONLY; The number of instances that have been successfully upgraded. 7532 SuccessfulInstanceCount *int32 `json:"successfulInstanceCount,omitempty"` 7533 // FailedInstanceCount - READ-ONLY; The number of instances that have failed to be upgraded successfully. 7534 FailedInstanceCount *int32 `json:"failedInstanceCount,omitempty"` 7535 // InProgressInstanceCount - READ-ONLY; The number of instances that are currently being upgraded. 7536 InProgressInstanceCount *int32 `json:"inProgressInstanceCount,omitempty"` 7537 // PendingInstanceCount - READ-ONLY; The number of instances that have not yet begun to be upgraded. 7538 PendingInstanceCount *int32 `json:"pendingInstanceCount,omitempty"` 7539} 7540 7541// RollingUpgradeRunningStatus information about the current running state of the overall upgrade. 7542type RollingUpgradeRunningStatus struct { 7543 // Code - READ-ONLY; Code indicating the current status of the upgrade. Possible values include: 'RollingUpgradeStatusCodeRollingForward', 'RollingUpgradeStatusCodeCancelled', 'RollingUpgradeStatusCodeCompleted', 'RollingUpgradeStatusCodeFaulted' 7544 Code RollingUpgradeStatusCode `json:"code,omitempty"` 7545 // StartTime - READ-ONLY; Start time of the upgrade. 7546 StartTime *date.Time `json:"startTime,omitempty"` 7547 // LastAction - READ-ONLY; The last action performed on the rolling upgrade. Possible values include: 'Start', 'Cancel' 7548 LastAction RollingUpgradeActionType `json:"lastAction,omitempty"` 7549 // LastActionTime - READ-ONLY; Last action time of the upgrade. 7550 LastActionTime *date.Time `json:"lastActionTime,omitempty"` 7551} 7552 7553// RollingUpgradeStatusInfo the status of the latest virtual machine scale set rolling upgrade. 7554type RollingUpgradeStatusInfo struct { 7555 autorest.Response `json:"-"` 7556 *RollingUpgradeStatusInfoProperties `json:"properties,omitempty"` 7557 // ID - READ-ONLY; Resource Id 7558 ID *string `json:"id,omitempty"` 7559 // Name - READ-ONLY; Resource name 7560 Name *string `json:"name,omitempty"` 7561 // Type - READ-ONLY; Resource type 7562 Type *string `json:"type,omitempty"` 7563 // Location - Resource location 7564 Location *string `json:"location,omitempty"` 7565 // Tags - Resource tags 7566 Tags map[string]*string `json:"tags"` 7567} 7568 7569// MarshalJSON is the custom marshaler for RollingUpgradeStatusInfo. 7570func (rusi RollingUpgradeStatusInfo) MarshalJSON() ([]byte, error) { 7571 objectMap := make(map[string]interface{}) 7572 if rusi.RollingUpgradeStatusInfoProperties != nil { 7573 objectMap["properties"] = rusi.RollingUpgradeStatusInfoProperties 7574 } 7575 if rusi.Location != nil { 7576 objectMap["location"] = rusi.Location 7577 } 7578 if rusi.Tags != nil { 7579 objectMap["tags"] = rusi.Tags 7580 } 7581 return json.Marshal(objectMap) 7582} 7583 7584// UnmarshalJSON is the custom unmarshaler for RollingUpgradeStatusInfo struct. 7585func (rusi *RollingUpgradeStatusInfo) UnmarshalJSON(body []byte) error { 7586 var m map[string]*json.RawMessage 7587 err := json.Unmarshal(body, &m) 7588 if err != nil { 7589 return err 7590 } 7591 for k, v := range m { 7592 switch k { 7593 case "properties": 7594 if v != nil { 7595 var rollingUpgradeStatusInfoProperties RollingUpgradeStatusInfoProperties 7596 err = json.Unmarshal(*v, &rollingUpgradeStatusInfoProperties) 7597 if err != nil { 7598 return err 7599 } 7600 rusi.RollingUpgradeStatusInfoProperties = &rollingUpgradeStatusInfoProperties 7601 } 7602 case "id": 7603 if v != nil { 7604 var ID string 7605 err = json.Unmarshal(*v, &ID) 7606 if err != nil { 7607 return err 7608 } 7609 rusi.ID = &ID 7610 } 7611 case "name": 7612 if v != nil { 7613 var name string 7614 err = json.Unmarshal(*v, &name) 7615 if err != nil { 7616 return err 7617 } 7618 rusi.Name = &name 7619 } 7620 case "type": 7621 if v != nil { 7622 var typeVar string 7623 err = json.Unmarshal(*v, &typeVar) 7624 if err != nil { 7625 return err 7626 } 7627 rusi.Type = &typeVar 7628 } 7629 case "location": 7630 if v != nil { 7631 var location string 7632 err = json.Unmarshal(*v, &location) 7633 if err != nil { 7634 return err 7635 } 7636 rusi.Location = &location 7637 } 7638 case "tags": 7639 if v != nil { 7640 var tags map[string]*string 7641 err = json.Unmarshal(*v, &tags) 7642 if err != nil { 7643 return err 7644 } 7645 rusi.Tags = tags 7646 } 7647 } 7648 } 7649 7650 return nil 7651} 7652 7653// RollingUpgradeStatusInfoProperties the status of the latest virtual machine scale set rolling upgrade. 7654type RollingUpgradeStatusInfoProperties struct { 7655 // Policy - READ-ONLY; The rolling upgrade policies applied for this upgrade. 7656 Policy *RollingUpgradePolicy `json:"policy,omitempty"` 7657 // RunningStatus - READ-ONLY; Information about the current running state of the overall upgrade. 7658 RunningStatus *RollingUpgradeRunningStatus `json:"runningStatus,omitempty"` 7659 // Progress - READ-ONLY; Information about the number of virtual machine instances in each upgrade state. 7660 Progress *RollingUpgradeProgressInfo `json:"progress,omitempty"` 7661 // Error - READ-ONLY; Error details for this upgrade, if there are any. 7662 Error *APIError `json:"error,omitempty"` 7663} 7664 7665// RunCommandDocument describes the properties of a Run Command. 7666type RunCommandDocument struct { 7667 autorest.Response `json:"-"` 7668 // Script - The script to be executed. 7669 Script *[]string `json:"script,omitempty"` 7670 // Parameters - The parameters used by the script. 7671 Parameters *[]RunCommandParameterDefinition `json:"parameters,omitempty"` 7672 // Schema - The VM run command schema. 7673 Schema *string `json:"$schema,omitempty"` 7674 // ID - The VM run command id. 7675 ID *string `json:"id,omitempty"` 7676 // OsType - The Operating System type. Possible values include: 'Windows', 'Linux' 7677 OsType OperatingSystemTypes `json:"osType,omitempty"` 7678 // Label - The VM run command label. 7679 Label *string `json:"label,omitempty"` 7680 // Description - The VM run command description. 7681 Description *string `json:"description,omitempty"` 7682} 7683 7684// RunCommandDocumentBase describes the properties of a Run Command metadata. 7685type RunCommandDocumentBase struct { 7686 // Schema - The VM run command schema. 7687 Schema *string `json:"$schema,omitempty"` 7688 // ID - The VM run command id. 7689 ID *string `json:"id,omitempty"` 7690 // OsType - The Operating System type. Possible values include: 'Windows', 'Linux' 7691 OsType OperatingSystemTypes `json:"osType,omitempty"` 7692 // Label - The VM run command label. 7693 Label *string `json:"label,omitempty"` 7694 // Description - The VM run command description. 7695 Description *string `json:"description,omitempty"` 7696} 7697 7698// RunCommandInput capture Virtual Machine parameters. 7699type RunCommandInput struct { 7700 // CommandID - The run command id. 7701 CommandID *string `json:"commandId,omitempty"` 7702 // Script - Optional. The script to be executed. When this value is given, the given script will override the default script of the command. 7703 Script *[]string `json:"script,omitempty"` 7704 // Parameters - The run command parameters. 7705 Parameters *[]RunCommandInputParameter `json:"parameters,omitempty"` 7706} 7707 7708// RunCommandInputParameter describes the properties of a run command parameter. 7709type RunCommandInputParameter struct { 7710 // Name - The run command parameter name. 7711 Name *string `json:"name,omitempty"` 7712 // Value - The run command parameter value. 7713 Value *string `json:"value,omitempty"` 7714} 7715 7716// RunCommandListResult the List Virtual Machine operation response. 7717type RunCommandListResult struct { 7718 autorest.Response `json:"-"` 7719 // Value - The list of virtual machine run commands. 7720 Value *[]RunCommandDocumentBase `json:"value,omitempty"` 7721 // NextLink - The uri to fetch the next page of run commands. Call ListNext() with this to fetch the next page of run commands. 7722 NextLink *string `json:"nextLink,omitempty"` 7723} 7724 7725// RunCommandListResultIterator provides access to a complete listing of RunCommandDocumentBase values. 7726type RunCommandListResultIterator struct { 7727 i int 7728 page RunCommandListResultPage 7729} 7730 7731// NextWithContext advances to the next value. If there was an error making 7732// the request the iterator does not advance and the error is returned. 7733func (iter *RunCommandListResultIterator) NextWithContext(ctx context.Context) (err error) { 7734 if tracing.IsEnabled() { 7735 ctx = tracing.StartSpan(ctx, fqdn+"/RunCommandListResultIterator.NextWithContext") 7736 defer func() { 7737 sc := -1 7738 if iter.Response().Response.Response != nil { 7739 sc = iter.Response().Response.Response.StatusCode 7740 } 7741 tracing.EndSpan(ctx, sc, err) 7742 }() 7743 } 7744 iter.i++ 7745 if iter.i < len(iter.page.Values()) { 7746 return nil 7747 } 7748 err = iter.page.NextWithContext(ctx) 7749 if err != nil { 7750 iter.i-- 7751 return err 7752 } 7753 iter.i = 0 7754 return nil 7755} 7756 7757// Next advances to the next value. If there was an error making 7758// the request the iterator does not advance and the error is returned. 7759// Deprecated: Use NextWithContext() instead. 7760func (iter *RunCommandListResultIterator) Next() error { 7761 return iter.NextWithContext(context.Background()) 7762} 7763 7764// NotDone returns true if the enumeration should be started or is not yet complete. 7765func (iter RunCommandListResultIterator) NotDone() bool { 7766 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7767} 7768 7769// Response returns the raw server response from the last page request. 7770func (iter RunCommandListResultIterator) Response() RunCommandListResult { 7771 return iter.page.Response() 7772} 7773 7774// Value returns the current value or a zero-initialized value if the 7775// iterator has advanced beyond the end of the collection. 7776func (iter RunCommandListResultIterator) Value() RunCommandDocumentBase { 7777 if !iter.page.NotDone() { 7778 return RunCommandDocumentBase{} 7779 } 7780 return iter.page.Values()[iter.i] 7781} 7782 7783// Creates a new instance of the RunCommandListResultIterator type. 7784func NewRunCommandListResultIterator(page RunCommandListResultPage) RunCommandListResultIterator { 7785 return RunCommandListResultIterator{page: page} 7786} 7787 7788// IsEmpty returns true if the ListResult contains no values. 7789func (rclr RunCommandListResult) IsEmpty() bool { 7790 return rclr.Value == nil || len(*rclr.Value) == 0 7791} 7792 7793// hasNextLink returns true if the NextLink is not empty. 7794func (rclr RunCommandListResult) hasNextLink() bool { 7795 return rclr.NextLink != nil && len(*rclr.NextLink) != 0 7796} 7797 7798// runCommandListResultPreparer prepares a request to retrieve the next set of results. 7799// It returns nil if no more results exist. 7800func (rclr RunCommandListResult) runCommandListResultPreparer(ctx context.Context) (*http.Request, error) { 7801 if !rclr.hasNextLink() { 7802 return nil, nil 7803 } 7804 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7805 autorest.AsJSON(), 7806 autorest.AsGet(), 7807 autorest.WithBaseURL(to.String(rclr.NextLink))) 7808} 7809 7810// RunCommandListResultPage contains a page of RunCommandDocumentBase values. 7811type RunCommandListResultPage struct { 7812 fn func(context.Context, RunCommandListResult) (RunCommandListResult, error) 7813 rclr RunCommandListResult 7814} 7815 7816// NextWithContext advances to the next page of values. If there was an error making 7817// the request the page does not advance and the error is returned. 7818func (page *RunCommandListResultPage) NextWithContext(ctx context.Context) (err error) { 7819 if tracing.IsEnabled() { 7820 ctx = tracing.StartSpan(ctx, fqdn+"/RunCommandListResultPage.NextWithContext") 7821 defer func() { 7822 sc := -1 7823 if page.Response().Response.Response != nil { 7824 sc = page.Response().Response.Response.StatusCode 7825 } 7826 tracing.EndSpan(ctx, sc, err) 7827 }() 7828 } 7829 for { 7830 next, err := page.fn(ctx, page.rclr) 7831 if err != nil { 7832 return err 7833 } 7834 page.rclr = next 7835 if !next.hasNextLink() || !next.IsEmpty() { 7836 break 7837 } 7838 } 7839 return nil 7840} 7841 7842// Next advances to the next page of values. If there was an error making 7843// the request the page does not advance and the error is returned. 7844// Deprecated: Use NextWithContext() instead. 7845func (page *RunCommandListResultPage) Next() error { 7846 return page.NextWithContext(context.Background()) 7847} 7848 7849// NotDone returns true if the page enumeration should be started or is not yet complete. 7850func (page RunCommandListResultPage) NotDone() bool { 7851 return !page.rclr.IsEmpty() 7852} 7853 7854// Response returns the raw server response from the last page request. 7855func (page RunCommandListResultPage) Response() RunCommandListResult { 7856 return page.rclr 7857} 7858 7859// Values returns the slice of values for the current page or nil if there are no values. 7860func (page RunCommandListResultPage) Values() []RunCommandDocumentBase { 7861 if page.rclr.IsEmpty() { 7862 return nil 7863 } 7864 return *page.rclr.Value 7865} 7866 7867// Creates a new instance of the RunCommandListResultPage type. 7868func NewRunCommandListResultPage(cur RunCommandListResult, getNextPage func(context.Context, RunCommandListResult) (RunCommandListResult, error)) RunCommandListResultPage { 7869 return RunCommandListResultPage{ 7870 fn: getNextPage, 7871 rclr: cur, 7872 } 7873} 7874 7875// RunCommandParameterDefinition describes the properties of a run command parameter. 7876type RunCommandParameterDefinition struct { 7877 // Name - The run command parameter name. 7878 Name *string `json:"name,omitempty"` 7879 // Type - The run command parameter type. 7880 Type *string `json:"type,omitempty"` 7881 // DefaultValue - The run command parameter default value. 7882 DefaultValue *string `json:"defaultValue,omitempty"` 7883 // Required - The run command parameter required. 7884 Required *bool `json:"required,omitempty"` 7885} 7886 7887// RunCommandResult ... 7888type RunCommandResult struct { 7889 autorest.Response `json:"-"` 7890 // Value - Run command operation response. 7891 Value *[]InstanceViewStatus `json:"value,omitempty"` 7892} 7893 7894// ScaleInPolicy describes a scale-in policy for a virtual machine scale set. 7895type ScaleInPolicy struct { 7896 // 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> 7897 Rules *[]VirtualMachineScaleSetScaleInRules `json:"rules,omitempty"` 7898} 7899 7900// ScheduledEventsProfile ... 7901type ScheduledEventsProfile struct { 7902 // TerminateNotificationProfile - Specifies Terminate Scheduled Event related configurations. 7903 TerminateNotificationProfile *TerminateNotificationProfile `json:"terminateNotificationProfile,omitempty"` 7904} 7905 7906// SecurityProfile specifies the Security profile settings for the virtual machine or virtual machine scale 7907// set. 7908type SecurityProfile struct { 7909 // EncryptionAtHost - This property can be used by user in the request to enable or disable the Host Encryption for the virtual machine or virtual machine scale set. This will enable the encryption for all the disks including Resource/Temp disk at host itself. <br><br> Default: The Encryption at host will be disabled unless this property is set to true for the resource. 7910 EncryptionAtHost *bool `json:"encryptionAtHost,omitempty"` 7911} 7912 7913// ShareInfoElement ... 7914type ShareInfoElement struct { 7915 // VMURI - READ-ONLY; A relative URI containing the ID of the VM that has the disk attached. 7916 VMURI *string `json:"vmUri,omitempty"` 7917} 7918 7919// Sku describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware 7920// the scale set is currently on, you need to deallocate the VMs in the scale set before you modify the SKU 7921// name. 7922type Sku struct { 7923 // Name - The sku name. 7924 Name *string `json:"name,omitempty"` 7925 // Tier - Specifies the tier of virtual machines in a scale set.<br /><br /> Possible Values:<br /><br /> **Standard**<br /><br /> **Basic** 7926 Tier *string `json:"tier,omitempty"` 7927 // Capacity - Specifies the number of virtual machines in the scale set. 7928 Capacity *int64 `json:"capacity,omitempty"` 7929} 7930 7931// Snapshot snapshot resource. 7932type Snapshot struct { 7933 autorest.Response `json:"-"` 7934 // ManagedBy - READ-ONLY; Unused. Always Null. 7935 ManagedBy *string `json:"managedBy,omitempty"` 7936 Sku *SnapshotSku `json:"sku,omitempty"` 7937 *SnapshotProperties `json:"properties,omitempty"` 7938 // ID - READ-ONLY; Resource Id 7939 ID *string `json:"id,omitempty"` 7940 // Name - READ-ONLY; Resource name 7941 Name *string `json:"name,omitempty"` 7942 // Type - READ-ONLY; Resource type 7943 Type *string `json:"type,omitempty"` 7944 // Location - Resource location 7945 Location *string `json:"location,omitempty"` 7946 // Tags - Resource tags 7947 Tags map[string]*string `json:"tags"` 7948} 7949 7950// MarshalJSON is the custom marshaler for Snapshot. 7951func (s Snapshot) MarshalJSON() ([]byte, error) { 7952 objectMap := make(map[string]interface{}) 7953 if s.Sku != nil { 7954 objectMap["sku"] = s.Sku 7955 } 7956 if s.SnapshotProperties != nil { 7957 objectMap["properties"] = s.SnapshotProperties 7958 } 7959 if s.Location != nil { 7960 objectMap["location"] = s.Location 7961 } 7962 if s.Tags != nil { 7963 objectMap["tags"] = s.Tags 7964 } 7965 return json.Marshal(objectMap) 7966} 7967 7968// UnmarshalJSON is the custom unmarshaler for Snapshot struct. 7969func (s *Snapshot) UnmarshalJSON(body []byte) error { 7970 var m map[string]*json.RawMessage 7971 err := json.Unmarshal(body, &m) 7972 if err != nil { 7973 return err 7974 } 7975 for k, v := range m { 7976 switch k { 7977 case "managedBy": 7978 if v != nil { 7979 var managedBy string 7980 err = json.Unmarshal(*v, &managedBy) 7981 if err != nil { 7982 return err 7983 } 7984 s.ManagedBy = &managedBy 7985 } 7986 case "sku": 7987 if v != nil { 7988 var sku SnapshotSku 7989 err = json.Unmarshal(*v, &sku) 7990 if err != nil { 7991 return err 7992 } 7993 s.Sku = &sku 7994 } 7995 case "properties": 7996 if v != nil { 7997 var snapshotProperties SnapshotProperties 7998 err = json.Unmarshal(*v, &snapshotProperties) 7999 if err != nil { 8000 return err 8001 } 8002 s.SnapshotProperties = &snapshotProperties 8003 } 8004 case "id": 8005 if v != nil { 8006 var ID string 8007 err = json.Unmarshal(*v, &ID) 8008 if err != nil { 8009 return err 8010 } 8011 s.ID = &ID 8012 } 8013 case "name": 8014 if v != nil { 8015 var name string 8016 err = json.Unmarshal(*v, &name) 8017 if err != nil { 8018 return err 8019 } 8020 s.Name = &name 8021 } 8022 case "type": 8023 if v != nil { 8024 var typeVar string 8025 err = json.Unmarshal(*v, &typeVar) 8026 if err != nil { 8027 return err 8028 } 8029 s.Type = &typeVar 8030 } 8031 case "location": 8032 if v != nil { 8033 var location string 8034 err = json.Unmarshal(*v, &location) 8035 if err != nil { 8036 return err 8037 } 8038 s.Location = &location 8039 } 8040 case "tags": 8041 if v != nil { 8042 var tags map[string]*string 8043 err = json.Unmarshal(*v, &tags) 8044 if err != nil { 8045 return err 8046 } 8047 s.Tags = tags 8048 } 8049 } 8050 } 8051 8052 return nil 8053} 8054 8055// SnapshotList the List Snapshots operation response. 8056type SnapshotList struct { 8057 autorest.Response `json:"-"` 8058 // Value - A list of snapshots. 8059 Value *[]Snapshot `json:"value,omitempty"` 8060 // NextLink - The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the next page of snapshots. 8061 NextLink *string `json:"nextLink,omitempty"` 8062} 8063 8064// SnapshotListIterator provides access to a complete listing of Snapshot values. 8065type SnapshotListIterator struct { 8066 i int 8067 page SnapshotListPage 8068} 8069 8070// NextWithContext advances to the next value. If there was an error making 8071// the request the iterator does not advance and the error is returned. 8072func (iter *SnapshotListIterator) NextWithContext(ctx context.Context) (err error) { 8073 if tracing.IsEnabled() { 8074 ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotListIterator.NextWithContext") 8075 defer func() { 8076 sc := -1 8077 if iter.Response().Response.Response != nil { 8078 sc = iter.Response().Response.Response.StatusCode 8079 } 8080 tracing.EndSpan(ctx, sc, err) 8081 }() 8082 } 8083 iter.i++ 8084 if iter.i < len(iter.page.Values()) { 8085 return nil 8086 } 8087 err = iter.page.NextWithContext(ctx) 8088 if err != nil { 8089 iter.i-- 8090 return err 8091 } 8092 iter.i = 0 8093 return nil 8094} 8095 8096// Next advances to the next value. If there was an error making 8097// the request the iterator does not advance and the error is returned. 8098// Deprecated: Use NextWithContext() instead. 8099func (iter *SnapshotListIterator) Next() error { 8100 return iter.NextWithContext(context.Background()) 8101} 8102 8103// NotDone returns true if the enumeration should be started or is not yet complete. 8104func (iter SnapshotListIterator) NotDone() bool { 8105 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8106} 8107 8108// Response returns the raw server response from the last page request. 8109func (iter SnapshotListIterator) Response() SnapshotList { 8110 return iter.page.Response() 8111} 8112 8113// Value returns the current value or a zero-initialized value if the 8114// iterator has advanced beyond the end of the collection. 8115func (iter SnapshotListIterator) Value() Snapshot { 8116 if !iter.page.NotDone() { 8117 return Snapshot{} 8118 } 8119 return iter.page.Values()[iter.i] 8120} 8121 8122// Creates a new instance of the SnapshotListIterator type. 8123func NewSnapshotListIterator(page SnapshotListPage) SnapshotListIterator { 8124 return SnapshotListIterator{page: page} 8125} 8126 8127// IsEmpty returns true if the ListResult contains no values. 8128func (sl SnapshotList) IsEmpty() bool { 8129 return sl.Value == nil || len(*sl.Value) == 0 8130} 8131 8132// hasNextLink returns true if the NextLink is not empty. 8133func (sl SnapshotList) hasNextLink() bool { 8134 return sl.NextLink != nil && len(*sl.NextLink) != 0 8135} 8136 8137// snapshotListPreparer prepares a request to retrieve the next set of results. 8138// It returns nil if no more results exist. 8139func (sl SnapshotList) snapshotListPreparer(ctx context.Context) (*http.Request, error) { 8140 if !sl.hasNextLink() { 8141 return nil, nil 8142 } 8143 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8144 autorest.AsJSON(), 8145 autorest.AsGet(), 8146 autorest.WithBaseURL(to.String(sl.NextLink))) 8147} 8148 8149// SnapshotListPage contains a page of Snapshot values. 8150type SnapshotListPage struct { 8151 fn func(context.Context, SnapshotList) (SnapshotList, error) 8152 sl SnapshotList 8153} 8154 8155// NextWithContext advances to the next page of values. If there was an error making 8156// the request the page does not advance and the error is returned. 8157func (page *SnapshotListPage) NextWithContext(ctx context.Context) (err error) { 8158 if tracing.IsEnabled() { 8159 ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotListPage.NextWithContext") 8160 defer func() { 8161 sc := -1 8162 if page.Response().Response.Response != nil { 8163 sc = page.Response().Response.Response.StatusCode 8164 } 8165 tracing.EndSpan(ctx, sc, err) 8166 }() 8167 } 8168 for { 8169 next, err := page.fn(ctx, page.sl) 8170 if err != nil { 8171 return err 8172 } 8173 page.sl = next 8174 if !next.hasNextLink() || !next.IsEmpty() { 8175 break 8176 } 8177 } 8178 return nil 8179} 8180 8181// Next advances to the next page of values. If there was an error making 8182// the request the page does not advance and the error is returned. 8183// Deprecated: Use NextWithContext() instead. 8184func (page *SnapshotListPage) Next() error { 8185 return page.NextWithContext(context.Background()) 8186} 8187 8188// NotDone returns true if the page enumeration should be started or is not yet complete. 8189func (page SnapshotListPage) NotDone() bool { 8190 return !page.sl.IsEmpty() 8191} 8192 8193// Response returns the raw server response from the last page request. 8194func (page SnapshotListPage) Response() SnapshotList { 8195 return page.sl 8196} 8197 8198// Values returns the slice of values for the current page or nil if there are no values. 8199func (page SnapshotListPage) Values() []Snapshot { 8200 if page.sl.IsEmpty() { 8201 return nil 8202 } 8203 return *page.sl.Value 8204} 8205 8206// Creates a new instance of the SnapshotListPage type. 8207func NewSnapshotListPage(cur SnapshotList, getNextPage func(context.Context, SnapshotList) (SnapshotList, error)) SnapshotListPage { 8208 return SnapshotListPage{ 8209 fn: getNextPage, 8210 sl: cur, 8211 } 8212} 8213 8214// SnapshotProperties snapshot resource properties. 8215type SnapshotProperties struct { 8216 // TimeCreated - READ-ONLY; The time when the snapshot was created. 8217 TimeCreated *date.Time `json:"timeCreated,omitempty"` 8218 // OsType - The Operating System type. Possible values include: 'Windows', 'Linux' 8219 OsType OperatingSystemTypes `json:"osType,omitempty"` 8220 // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'V1', 'V2' 8221 HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` 8222 // CreationData - Disk source information. CreationData information cannot be changed after the disk has been created. 8223 CreationData *CreationData `json:"creationData,omitempty"` 8224 // 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. 8225 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 8226 // DiskSizeBytes - READ-ONLY; The size of the disk in bytes. This field is read only. 8227 DiskSizeBytes *int64 `json:"diskSizeBytes,omitempty"` 8228 // UniqueID - READ-ONLY; Unique Guid identifying the resource. 8229 UniqueID *string `json:"uniqueId,omitempty"` 8230 // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. 8231 EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` 8232 // ProvisioningState - READ-ONLY; The disk provisioning state. 8233 ProvisioningState *string `json:"provisioningState,omitempty"` 8234 // Incremental - Whether a snapshot is incremental. Incremental snapshots on the same disk occupy less space than full snapshots and can be diffed. 8235 Incremental *bool `json:"incremental,omitempty"` 8236 // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 8237 Encryption *Encryption `json:"encryption,omitempty"` 8238 // NetworkAccessPolicy - Possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll' 8239 NetworkAccessPolicy NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` 8240 // DiskAccessID - ARM id of the DiskAccess resource for using private endpoints on disks. 8241 DiskAccessID *string `json:"diskAccessId,omitempty"` 8242} 8243 8244// MarshalJSON is the custom marshaler for SnapshotProperties. 8245func (sp SnapshotProperties) MarshalJSON() ([]byte, error) { 8246 objectMap := make(map[string]interface{}) 8247 if sp.OsType != "" { 8248 objectMap["osType"] = sp.OsType 8249 } 8250 if sp.HyperVGeneration != "" { 8251 objectMap["hyperVGeneration"] = sp.HyperVGeneration 8252 } 8253 if sp.CreationData != nil { 8254 objectMap["creationData"] = sp.CreationData 8255 } 8256 if sp.DiskSizeGB != nil { 8257 objectMap["diskSizeGB"] = sp.DiskSizeGB 8258 } 8259 if sp.EncryptionSettingsCollection != nil { 8260 objectMap["encryptionSettingsCollection"] = sp.EncryptionSettingsCollection 8261 } 8262 if sp.Incremental != nil { 8263 objectMap["incremental"] = sp.Incremental 8264 } 8265 if sp.Encryption != nil { 8266 objectMap["encryption"] = sp.Encryption 8267 } 8268 if sp.NetworkAccessPolicy != "" { 8269 objectMap["networkAccessPolicy"] = sp.NetworkAccessPolicy 8270 } 8271 if sp.DiskAccessID != nil { 8272 objectMap["diskAccessId"] = sp.DiskAccessID 8273 } 8274 return json.Marshal(objectMap) 8275} 8276 8277// SnapshotsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 8278// operation. 8279type SnapshotsCreateOrUpdateFuture struct { 8280 azure.FutureAPI 8281 // Result returns the result of the asynchronous operation. 8282 // If the operation has not completed it will return an error. 8283 Result func(SnapshotsClient) (Snapshot, error) 8284} 8285 8286// SnapshotsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 8287// operation. 8288type SnapshotsDeleteFuture struct { 8289 azure.FutureAPI 8290 // Result returns the result of the asynchronous operation. 8291 // If the operation has not completed it will return an error. 8292 Result func(SnapshotsClient) (autorest.Response, error) 8293} 8294 8295// SnapshotsGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running 8296// operation. 8297type SnapshotsGrantAccessFuture struct { 8298 azure.FutureAPI 8299 // Result returns the result of the asynchronous operation. 8300 // If the operation has not completed it will return an error. 8301 Result func(SnapshotsClient) (AccessURI, error) 8302} 8303 8304// SnapshotSku the snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. 8305type SnapshotSku struct { 8306 // Name - The sku name. Possible values include: 'SnapshotStorageAccountTypesStandardLRS', 'SnapshotStorageAccountTypesPremiumLRS', 'SnapshotStorageAccountTypesStandardZRS' 8307 Name SnapshotStorageAccountTypes `json:"name,omitempty"` 8308 // Tier - READ-ONLY; The sku tier. 8309 Tier *string `json:"tier,omitempty"` 8310} 8311 8312// MarshalJSON is the custom marshaler for SnapshotSku. 8313func (ss SnapshotSku) MarshalJSON() ([]byte, error) { 8314 objectMap := make(map[string]interface{}) 8315 if ss.Name != "" { 8316 objectMap["name"] = ss.Name 8317 } 8318 return json.Marshal(objectMap) 8319} 8320 8321// SnapshotsRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running 8322// operation. 8323type SnapshotsRevokeAccessFuture struct { 8324 azure.FutureAPI 8325 // Result returns the result of the asynchronous operation. 8326 // If the operation has not completed it will return an error. 8327 Result func(SnapshotsClient) (autorest.Response, error) 8328} 8329 8330// SnapshotsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 8331// operation. 8332type SnapshotsUpdateFuture struct { 8333 azure.FutureAPI 8334 // Result returns the result of the asynchronous operation. 8335 // If the operation has not completed it will return an error. 8336 Result func(SnapshotsClient) (Snapshot, error) 8337} 8338 8339// SnapshotUpdate snapshot update resource. 8340type SnapshotUpdate struct { 8341 *SnapshotUpdateProperties `json:"properties,omitempty"` 8342 // Tags - Resource tags 8343 Tags map[string]*string `json:"tags"` 8344 Sku *SnapshotSku `json:"sku,omitempty"` 8345} 8346 8347// MarshalJSON is the custom marshaler for SnapshotUpdate. 8348func (su SnapshotUpdate) MarshalJSON() ([]byte, error) { 8349 objectMap := make(map[string]interface{}) 8350 if su.SnapshotUpdateProperties != nil { 8351 objectMap["properties"] = su.SnapshotUpdateProperties 8352 } 8353 if su.Tags != nil { 8354 objectMap["tags"] = su.Tags 8355 } 8356 if su.Sku != nil { 8357 objectMap["sku"] = su.Sku 8358 } 8359 return json.Marshal(objectMap) 8360} 8361 8362// UnmarshalJSON is the custom unmarshaler for SnapshotUpdate struct. 8363func (su *SnapshotUpdate) UnmarshalJSON(body []byte) error { 8364 var m map[string]*json.RawMessage 8365 err := json.Unmarshal(body, &m) 8366 if err != nil { 8367 return err 8368 } 8369 for k, v := range m { 8370 switch k { 8371 case "properties": 8372 if v != nil { 8373 var snapshotUpdateProperties SnapshotUpdateProperties 8374 err = json.Unmarshal(*v, &snapshotUpdateProperties) 8375 if err != nil { 8376 return err 8377 } 8378 su.SnapshotUpdateProperties = &snapshotUpdateProperties 8379 } 8380 case "tags": 8381 if v != nil { 8382 var tags map[string]*string 8383 err = json.Unmarshal(*v, &tags) 8384 if err != nil { 8385 return err 8386 } 8387 su.Tags = tags 8388 } 8389 case "sku": 8390 if v != nil { 8391 var sku SnapshotSku 8392 err = json.Unmarshal(*v, &sku) 8393 if err != nil { 8394 return err 8395 } 8396 su.Sku = &sku 8397 } 8398 } 8399 } 8400 8401 return nil 8402} 8403 8404// SnapshotUpdateProperties snapshot resource update properties. 8405type SnapshotUpdateProperties struct { 8406 // OsType - the Operating System type. Possible values include: 'Windows', 'Linux' 8407 OsType OperatingSystemTypes `json:"osType,omitempty"` 8408 // 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. 8409 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 8410 // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. 8411 EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` 8412 // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. 8413 Encryption *Encryption `json:"encryption,omitempty"` 8414 // NetworkAccessPolicy - Possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll' 8415 NetworkAccessPolicy NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` 8416 // DiskAccessID - ARM id of the DiskAccess resource for using private endpoints on disks. 8417 DiskAccessID *string `json:"diskAccessId,omitempty"` 8418} 8419 8420// SourceVault the vault id is an Azure Resource Manager Resource id in the form 8421// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName} 8422type SourceVault struct { 8423 // ID - Resource Id 8424 ID *string `json:"id,omitempty"` 8425} 8426 8427// SSHConfiguration SSH configuration for Linux based VMs running on Azure 8428type SSHConfiguration struct { 8429 // PublicKeys - The list of SSH public keys used to authenticate with linux based VMs. 8430 PublicKeys *[]SSHPublicKey `json:"publicKeys,omitempty"` 8431} 8432 8433// SSHPublicKey contains information about SSH certificate public key and the path on the Linux VM where 8434// the public key is placed. 8435type SSHPublicKey struct { 8436 // 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 8437 Path *string `json:"path,omitempty"` 8438 // 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). 8439 KeyData *string `json:"keyData,omitempty"` 8440} 8441 8442// SSHPublicKeyGenerateKeyPairResult response from generation of an SSH key pair. 8443type SSHPublicKeyGenerateKeyPairResult struct { 8444 autorest.Response `json:"-"` 8445 // 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. 8446 PrivateKey *string `json:"privateKey,omitempty"` 8447 // 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. 8448 PublicKey *string `json:"publicKey,omitempty"` 8449 // ID - The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{SshPublicKeyName} 8450 ID *string `json:"id,omitempty"` 8451} 8452 8453// SSHPublicKeyResource specifies information about the SSH public key. 8454type SSHPublicKeyResource struct { 8455 autorest.Response `json:"-"` 8456 // SSHPublicKeyResourceProperties - Properties of the SSH public key. 8457 *SSHPublicKeyResourceProperties `json:"properties,omitempty"` 8458 // ID - READ-ONLY; Resource Id 8459 ID *string `json:"id,omitempty"` 8460 // Name - READ-ONLY; Resource name 8461 Name *string `json:"name,omitempty"` 8462 // Type - READ-ONLY; Resource type 8463 Type *string `json:"type,omitempty"` 8464 // Location - Resource location 8465 Location *string `json:"location,omitempty"` 8466 // Tags - Resource tags 8467 Tags map[string]*string `json:"tags"` 8468} 8469 8470// MarshalJSON is the custom marshaler for SSHPublicKeyResource. 8471func (spkr SSHPublicKeyResource) MarshalJSON() ([]byte, error) { 8472 objectMap := make(map[string]interface{}) 8473 if spkr.SSHPublicKeyResourceProperties != nil { 8474 objectMap["properties"] = spkr.SSHPublicKeyResourceProperties 8475 } 8476 if spkr.Location != nil { 8477 objectMap["location"] = spkr.Location 8478 } 8479 if spkr.Tags != nil { 8480 objectMap["tags"] = spkr.Tags 8481 } 8482 return json.Marshal(objectMap) 8483} 8484 8485// UnmarshalJSON is the custom unmarshaler for SSHPublicKeyResource struct. 8486func (spkr *SSHPublicKeyResource) UnmarshalJSON(body []byte) error { 8487 var m map[string]*json.RawMessage 8488 err := json.Unmarshal(body, &m) 8489 if err != nil { 8490 return err 8491 } 8492 for k, v := range m { 8493 switch k { 8494 case "properties": 8495 if v != nil { 8496 var SSHPublicKeyResourceProperties SSHPublicKeyResourceProperties 8497 err = json.Unmarshal(*v, &SSHPublicKeyResourceProperties) 8498 if err != nil { 8499 return err 8500 } 8501 spkr.SSHPublicKeyResourceProperties = &SSHPublicKeyResourceProperties 8502 } 8503 case "id": 8504 if v != nil { 8505 var ID string 8506 err = json.Unmarshal(*v, &ID) 8507 if err != nil { 8508 return err 8509 } 8510 spkr.ID = &ID 8511 } 8512 case "name": 8513 if v != nil { 8514 var name string 8515 err = json.Unmarshal(*v, &name) 8516 if err != nil { 8517 return err 8518 } 8519 spkr.Name = &name 8520 } 8521 case "type": 8522 if v != nil { 8523 var typeVar string 8524 err = json.Unmarshal(*v, &typeVar) 8525 if err != nil { 8526 return err 8527 } 8528 spkr.Type = &typeVar 8529 } 8530 case "location": 8531 if v != nil { 8532 var location string 8533 err = json.Unmarshal(*v, &location) 8534 if err != nil { 8535 return err 8536 } 8537 spkr.Location = &location 8538 } 8539 case "tags": 8540 if v != nil { 8541 var tags map[string]*string 8542 err = json.Unmarshal(*v, &tags) 8543 if err != nil { 8544 return err 8545 } 8546 spkr.Tags = tags 8547 } 8548 } 8549 } 8550 8551 return nil 8552} 8553 8554// SSHPublicKeyResourceProperties properties of the SSH public key. 8555type SSHPublicKeyResourceProperties struct { 8556 // 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. 8557 PublicKey *string `json:"publicKey,omitempty"` 8558} 8559 8560// SSHPublicKeysGroupListResult the list SSH public keys operation response. 8561type SSHPublicKeysGroupListResult struct { 8562 autorest.Response `json:"-"` 8563 // Value - The list of SSH public keys 8564 Value *[]SSHPublicKeyResource `json:"value,omitempty"` 8565 // 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. 8566 NextLink *string `json:"nextLink,omitempty"` 8567} 8568 8569// SSHPublicKeysGroupListResultIterator provides access to a complete listing of SSHPublicKeyResource 8570// values. 8571type SSHPublicKeysGroupListResultIterator struct { 8572 i int 8573 page SSHPublicKeysGroupListResultPage 8574} 8575 8576// NextWithContext advances to the next value. If there was an error making 8577// the request the iterator does not advance and the error is returned. 8578func (iter *SSHPublicKeysGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { 8579 if tracing.IsEnabled() { 8580 ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysGroupListResultIterator.NextWithContext") 8581 defer func() { 8582 sc := -1 8583 if iter.Response().Response.Response != nil { 8584 sc = iter.Response().Response.Response.StatusCode 8585 } 8586 tracing.EndSpan(ctx, sc, err) 8587 }() 8588 } 8589 iter.i++ 8590 if iter.i < len(iter.page.Values()) { 8591 return nil 8592 } 8593 err = iter.page.NextWithContext(ctx) 8594 if err != nil { 8595 iter.i-- 8596 return err 8597 } 8598 iter.i = 0 8599 return nil 8600} 8601 8602// Next advances to the next value. If there was an error making 8603// the request the iterator does not advance and the error is returned. 8604// Deprecated: Use NextWithContext() instead. 8605func (iter *SSHPublicKeysGroupListResultIterator) Next() error { 8606 return iter.NextWithContext(context.Background()) 8607} 8608 8609// NotDone returns true if the enumeration should be started or is not yet complete. 8610func (iter SSHPublicKeysGroupListResultIterator) NotDone() bool { 8611 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8612} 8613 8614// Response returns the raw server response from the last page request. 8615func (iter SSHPublicKeysGroupListResultIterator) Response() SSHPublicKeysGroupListResult { 8616 return iter.page.Response() 8617} 8618 8619// Value returns the current value or a zero-initialized value if the 8620// iterator has advanced beyond the end of the collection. 8621func (iter SSHPublicKeysGroupListResultIterator) Value() SSHPublicKeyResource { 8622 if !iter.page.NotDone() { 8623 return SSHPublicKeyResource{} 8624 } 8625 return iter.page.Values()[iter.i] 8626} 8627 8628// Creates a new instance of the SSHPublicKeysGroupListResultIterator type. 8629func NewSSHPublicKeysGroupListResultIterator(page SSHPublicKeysGroupListResultPage) SSHPublicKeysGroupListResultIterator { 8630 return SSHPublicKeysGroupListResultIterator{page: page} 8631} 8632 8633// IsEmpty returns true if the ListResult contains no values. 8634func (spkglr SSHPublicKeysGroupListResult) IsEmpty() bool { 8635 return spkglr.Value == nil || len(*spkglr.Value) == 0 8636} 8637 8638// hasNextLink returns true if the NextLink is not empty. 8639func (spkglr SSHPublicKeysGroupListResult) hasNextLink() bool { 8640 return spkglr.NextLink != nil && len(*spkglr.NextLink) != 0 8641} 8642 8643// sSHPublicKeysGroupListResultPreparer prepares a request to retrieve the next set of results. 8644// It returns nil if no more results exist. 8645func (spkglr SSHPublicKeysGroupListResult) sSHPublicKeysGroupListResultPreparer(ctx context.Context) (*http.Request, error) { 8646 if !spkglr.hasNextLink() { 8647 return nil, nil 8648 } 8649 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8650 autorest.AsJSON(), 8651 autorest.AsGet(), 8652 autorest.WithBaseURL(to.String(spkglr.NextLink))) 8653} 8654 8655// SSHPublicKeysGroupListResultPage contains a page of SSHPublicKeyResource values. 8656type SSHPublicKeysGroupListResultPage struct { 8657 fn func(context.Context, SSHPublicKeysGroupListResult) (SSHPublicKeysGroupListResult, error) 8658 spkglr SSHPublicKeysGroupListResult 8659} 8660 8661// NextWithContext advances to the next page of values. If there was an error making 8662// the request the page does not advance and the error is returned. 8663func (page *SSHPublicKeysGroupListResultPage) NextWithContext(ctx context.Context) (err error) { 8664 if tracing.IsEnabled() { 8665 ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysGroupListResultPage.NextWithContext") 8666 defer func() { 8667 sc := -1 8668 if page.Response().Response.Response != nil { 8669 sc = page.Response().Response.Response.StatusCode 8670 } 8671 tracing.EndSpan(ctx, sc, err) 8672 }() 8673 } 8674 for { 8675 next, err := page.fn(ctx, page.spkglr) 8676 if err != nil { 8677 return err 8678 } 8679 page.spkglr = next 8680 if !next.hasNextLink() || !next.IsEmpty() { 8681 break 8682 } 8683 } 8684 return nil 8685} 8686 8687// Next advances to the next page of values. If there was an error making 8688// the request the page does not advance and the error is returned. 8689// Deprecated: Use NextWithContext() instead. 8690func (page *SSHPublicKeysGroupListResultPage) Next() error { 8691 return page.NextWithContext(context.Background()) 8692} 8693 8694// NotDone returns true if the page enumeration should be started or is not yet complete. 8695func (page SSHPublicKeysGroupListResultPage) NotDone() bool { 8696 return !page.spkglr.IsEmpty() 8697} 8698 8699// Response returns the raw server response from the last page request. 8700func (page SSHPublicKeysGroupListResultPage) Response() SSHPublicKeysGroupListResult { 8701 return page.spkglr 8702} 8703 8704// Values returns the slice of values for the current page or nil if there are no values. 8705func (page SSHPublicKeysGroupListResultPage) Values() []SSHPublicKeyResource { 8706 if page.spkglr.IsEmpty() { 8707 return nil 8708 } 8709 return *page.spkglr.Value 8710} 8711 8712// Creates a new instance of the SSHPublicKeysGroupListResultPage type. 8713func NewSSHPublicKeysGroupListResultPage(cur SSHPublicKeysGroupListResult, getNextPage func(context.Context, SSHPublicKeysGroupListResult) (SSHPublicKeysGroupListResult, error)) SSHPublicKeysGroupListResultPage { 8714 return SSHPublicKeysGroupListResultPage{ 8715 fn: getNextPage, 8716 spkglr: cur, 8717 } 8718} 8719 8720// SSHPublicKeyUpdateResource specifies information about the SSH public key. 8721type SSHPublicKeyUpdateResource struct { 8722 // SSHPublicKeyResourceProperties - Properties of the SSH public key. 8723 *SSHPublicKeyResourceProperties `json:"properties,omitempty"` 8724 // Tags - Resource tags 8725 Tags map[string]*string `json:"tags"` 8726} 8727 8728// MarshalJSON is the custom marshaler for SSHPublicKeyUpdateResource. 8729func (spkur SSHPublicKeyUpdateResource) MarshalJSON() ([]byte, error) { 8730 objectMap := make(map[string]interface{}) 8731 if spkur.SSHPublicKeyResourceProperties != nil { 8732 objectMap["properties"] = spkur.SSHPublicKeyResourceProperties 8733 } 8734 if spkur.Tags != nil { 8735 objectMap["tags"] = spkur.Tags 8736 } 8737 return json.Marshal(objectMap) 8738} 8739 8740// UnmarshalJSON is the custom unmarshaler for SSHPublicKeyUpdateResource struct. 8741func (spkur *SSHPublicKeyUpdateResource) UnmarshalJSON(body []byte) error { 8742 var m map[string]*json.RawMessage 8743 err := json.Unmarshal(body, &m) 8744 if err != nil { 8745 return err 8746 } 8747 for k, v := range m { 8748 switch k { 8749 case "properties": 8750 if v != nil { 8751 var SSHPublicKeyResourceProperties SSHPublicKeyResourceProperties 8752 err = json.Unmarshal(*v, &SSHPublicKeyResourceProperties) 8753 if err != nil { 8754 return err 8755 } 8756 spkur.SSHPublicKeyResourceProperties = &SSHPublicKeyResourceProperties 8757 } 8758 case "tags": 8759 if v != nil { 8760 var tags map[string]*string 8761 err = json.Unmarshal(*v, &tags) 8762 if err != nil { 8763 return err 8764 } 8765 spkur.Tags = tags 8766 } 8767 } 8768 } 8769 8770 return nil 8771} 8772 8773// StorageProfile specifies the storage settings for the virtual machine disks. 8774type StorageProfile struct { 8775 // 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. 8776 ImageReference *ImageReference `json:"imageReference,omitempty"` 8777 // 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). 8778 OsDisk *OSDisk `json:"osDisk,omitempty"` 8779 // 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). 8780 DataDisks *[]DataDisk `json:"dataDisks,omitempty"` 8781} 8782 8783// SubResource ... 8784type SubResource struct { 8785 // ID - Resource Id 8786 ID *string `json:"id,omitempty"` 8787} 8788 8789// SubResourceReadOnly ... 8790type SubResourceReadOnly struct { 8791 // ID - READ-ONLY; Resource Id 8792 ID *string `json:"id,omitempty"` 8793} 8794 8795// SubResourceWithColocationStatus ... 8796type SubResourceWithColocationStatus struct { 8797 // ColocationStatus - Describes colocation status of a resource in the Proximity Placement Group. 8798 ColocationStatus *InstanceViewStatus `json:"colocationStatus,omitempty"` 8799 // ID - Resource Id 8800 ID *string `json:"id,omitempty"` 8801} 8802 8803// TargetRegion describes the target region information. 8804type TargetRegion struct { 8805 // Name - The name of the region. 8806 Name *string `json:"name,omitempty"` 8807 // RegionalReplicaCount - The number of replicas of the Image Version to be created per region. This property is updatable. 8808 RegionalReplicaCount *int32 `json:"regionalReplicaCount,omitempty"` 8809 // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' 8810 StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` 8811 Encryption *EncryptionImages `json:"encryption,omitempty"` 8812} 8813 8814// TerminateNotificationProfile ... 8815type TerminateNotificationProfile struct { 8816 // 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) 8817 NotBeforeTimeout *string `json:"notBeforeTimeout,omitempty"` 8818 // Enable - Specifies whether the Terminate Scheduled event is enabled or disabled. 8819 Enable *bool `json:"enable,omitempty"` 8820} 8821 8822// ThrottledRequestsInput api request input for LogAnalytics getThrottledRequests Api. 8823type ThrottledRequestsInput struct { 8824 // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. 8825 BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` 8826 // FromTime - From time of the query 8827 FromTime *date.Time `json:"fromTime,omitempty"` 8828 // ToTime - To time of the query 8829 ToTime *date.Time `json:"toTime,omitempty"` 8830 // GroupByThrottlePolicy - Group query result by Throttle Policy applied. 8831 GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` 8832 // GroupByOperationName - Group query result by Operation Name. 8833 GroupByOperationName *bool `json:"groupByOperationName,omitempty"` 8834 // GroupByResourceName - Group query result by Resource Name. 8835 GroupByResourceName *bool `json:"groupByResourceName,omitempty"` 8836} 8837 8838// UpdateResource the Update Resource model definition. 8839type UpdateResource struct { 8840 // Tags - Resource tags 8841 Tags map[string]*string `json:"tags"` 8842} 8843 8844// MarshalJSON is the custom marshaler for UpdateResource. 8845func (ur UpdateResource) MarshalJSON() ([]byte, error) { 8846 objectMap := make(map[string]interface{}) 8847 if ur.Tags != nil { 8848 objectMap["tags"] = ur.Tags 8849 } 8850 return json.Marshal(objectMap) 8851} 8852 8853// UpdateResourceDefinition the Update Resource model definition. 8854type UpdateResourceDefinition struct { 8855 // ID - READ-ONLY; Resource Id 8856 ID *string `json:"id,omitempty"` 8857 // Name - READ-ONLY; Resource name 8858 Name *string `json:"name,omitempty"` 8859 // Type - READ-ONLY; Resource type 8860 Type *string `json:"type,omitempty"` 8861 // Tags - Resource tags 8862 Tags map[string]*string `json:"tags"` 8863} 8864 8865// MarshalJSON is the custom marshaler for UpdateResourceDefinition. 8866func (urd UpdateResourceDefinition) MarshalJSON() ([]byte, error) { 8867 objectMap := make(map[string]interface{}) 8868 if urd.Tags != nil { 8869 objectMap["tags"] = urd.Tags 8870 } 8871 return json.Marshal(objectMap) 8872} 8873 8874// UpgradeOperationHistoricalStatusInfo virtual Machine Scale Set OS Upgrade History operation response. 8875type UpgradeOperationHistoricalStatusInfo struct { 8876 // Properties - READ-ONLY; Information about the properties of the upgrade operation. 8877 Properties *UpgradeOperationHistoricalStatusInfoProperties `json:"properties,omitempty"` 8878 // Type - READ-ONLY; Resource type 8879 Type *string `json:"type,omitempty"` 8880 // Location - READ-ONLY; Resource location 8881 Location *string `json:"location,omitempty"` 8882} 8883 8884// UpgradeOperationHistoricalStatusInfoProperties describes each OS upgrade on the Virtual Machine Scale 8885// Set. 8886type UpgradeOperationHistoricalStatusInfoProperties struct { 8887 // RunningStatus - READ-ONLY; Information about the overall status of the upgrade operation. 8888 RunningStatus *UpgradeOperationHistoryStatus `json:"runningStatus,omitempty"` 8889 // Progress - READ-ONLY; Counts of the VMs in each state. 8890 Progress *RollingUpgradeProgressInfo `json:"progress,omitempty"` 8891 // Error - READ-ONLY; Error Details for this upgrade if there are any. 8892 Error *APIError `json:"error,omitempty"` 8893 // StartedBy - READ-ONLY; Invoker of the Upgrade Operation. Possible values include: 'UpgradeOperationInvokerUnknown', 'UpgradeOperationInvokerUser', 'UpgradeOperationInvokerPlatform' 8894 StartedBy UpgradeOperationInvoker `json:"startedBy,omitempty"` 8895 // TargetImageReference - READ-ONLY; Image Reference details 8896 TargetImageReference *ImageReference `json:"targetImageReference,omitempty"` 8897 // RollbackInfo - READ-ONLY; Information about OS rollback if performed 8898 RollbackInfo *RollbackStatusInfo `json:"rollbackInfo,omitempty"` 8899} 8900 8901// UpgradeOperationHistoryStatus information about the current running state of the overall upgrade. 8902type UpgradeOperationHistoryStatus struct { 8903 // Code - READ-ONLY; Code indicating the current status of the upgrade. Possible values include: 'UpgradeStateRollingForward', 'UpgradeStateCancelled', 'UpgradeStateCompleted', 'UpgradeStateFaulted' 8904 Code UpgradeState `json:"code,omitempty"` 8905 // StartTime - READ-ONLY; Start time of the upgrade. 8906 StartTime *date.Time `json:"startTime,omitempty"` 8907 // EndTime - READ-ONLY; End time of the upgrade. 8908 EndTime *date.Time `json:"endTime,omitempty"` 8909} 8910 8911// UpgradePolicy describes an upgrade policy - automatic, manual, or rolling. 8912type UpgradePolicy struct { 8913 // Mode - Specifies the mode of an upgrade to virtual machines in the scale set.<br /><br /> Possible values are:<br /><br /> **Manual** - You control the application of updates to virtual machines in the scale set. You do this by using the manualUpgrade action.<br /><br /> **Automatic** - All virtual machines in the scale set are automatically updated at the same time. Possible values include: 'UpgradeModeAutomatic', 'UpgradeModeManual', 'UpgradeModeRolling' 8914 Mode UpgradeMode `json:"mode,omitempty"` 8915 // RollingUpgradePolicy - The configuration parameters used while performing a rolling upgrade. 8916 RollingUpgradePolicy *RollingUpgradePolicy `json:"rollingUpgradePolicy,omitempty"` 8917 // AutomaticOSUpgradePolicy - Configuration parameters used for performing automatic OS Upgrade. 8918 AutomaticOSUpgradePolicy *AutomaticOSUpgradePolicy `json:"automaticOSUpgradePolicy,omitempty"` 8919} 8920 8921// Usage describes Compute Resource Usage. 8922type Usage struct { 8923 // Unit - An enum describing the unit of usage measurement. 8924 Unit *string `json:"unit,omitempty"` 8925 // CurrentValue - The current usage of the resource. 8926 CurrentValue *int32 `json:"currentValue,omitempty"` 8927 // Limit - The maximum permitted usage of the resource. 8928 Limit *int64 `json:"limit,omitempty"` 8929 // Name - The name of the type of usage. 8930 Name *UsageName `json:"name,omitempty"` 8931} 8932 8933// UsageName the Usage Names. 8934type UsageName struct { 8935 // Value - The name of the resource. 8936 Value *string `json:"value,omitempty"` 8937 // LocalizedValue - The localized name of the resource. 8938 LocalizedValue *string `json:"localizedValue,omitempty"` 8939} 8940 8941// UserArtifactSource the source image from which the Image Version is going to be created. 8942type UserArtifactSource struct { 8943 // FileName - Required. The fileName of the artifact. 8944 FileName *string `json:"fileName,omitempty"` 8945 // MediaLink - Required. The mediaLink of the artifact, must be a readable storage blob. 8946 MediaLink *string `json:"mediaLink,omitempty"` 8947} 8948 8949// VaultCertificate describes a single certificate reference in a Key Vault, and where the certificate 8950// should reside on the VM. 8951type VaultCertificate struct { 8952 // 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>} 8953 CertificateURL *string `json:"certificateUrl,omitempty"` 8954 // 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. 8955 CertificateStore *string `json:"certificateStore,omitempty"` 8956} 8957 8958// VaultSecretGroup describes a set of certificates which are all in the same Key Vault. 8959type VaultSecretGroup struct { 8960 // SourceVault - The relative URL of the Key Vault containing all of the certificates in VaultCertificates. 8961 SourceVault *SubResource `json:"sourceVault,omitempty"` 8962 // VaultCertificates - The list of key vault references in SourceVault which contain certificates. 8963 VaultCertificates *[]VaultCertificate `json:"vaultCertificates,omitempty"` 8964} 8965 8966// VirtualHardDisk describes the uri of a disk. 8967type VirtualHardDisk struct { 8968 // URI - Specifies the virtual hard disk's uri. 8969 URI *string `json:"uri,omitempty"` 8970} 8971 8972// VirtualMachine describes a Virtual Machine. 8973type VirtualMachine struct { 8974 autorest.Response `json:"-"` 8975 // 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**. 8976 Plan *Plan `json:"plan,omitempty"` 8977 *VirtualMachineProperties `json:"properties,omitempty"` 8978 // Resources - READ-ONLY; The virtual machine child extension resources. 8979 Resources *[]VirtualMachineExtension `json:"resources,omitempty"` 8980 // Identity - The identity of the virtual machine, if configured. 8981 Identity *VirtualMachineIdentity `json:"identity,omitempty"` 8982 // Zones - The virtual machine zones. 8983 Zones *[]string `json:"zones,omitempty"` 8984 // ID - READ-ONLY; Resource Id 8985 ID *string `json:"id,omitempty"` 8986 // Name - READ-ONLY; Resource name 8987 Name *string `json:"name,omitempty"` 8988 // Type - READ-ONLY; Resource type 8989 Type *string `json:"type,omitempty"` 8990 // Location - Resource location 8991 Location *string `json:"location,omitempty"` 8992 // Tags - Resource tags 8993 Tags map[string]*string `json:"tags"` 8994} 8995 8996// MarshalJSON is the custom marshaler for VirtualMachine. 8997func (VM VirtualMachine) MarshalJSON() ([]byte, error) { 8998 objectMap := make(map[string]interface{}) 8999 if VM.Plan != nil { 9000 objectMap["plan"] = VM.Plan 9001 } 9002 if VM.VirtualMachineProperties != nil { 9003 objectMap["properties"] = VM.VirtualMachineProperties 9004 } 9005 if VM.Identity != nil { 9006 objectMap["identity"] = VM.Identity 9007 } 9008 if VM.Zones != nil { 9009 objectMap["zones"] = VM.Zones 9010 } 9011 if VM.Location != nil { 9012 objectMap["location"] = VM.Location 9013 } 9014 if VM.Tags != nil { 9015 objectMap["tags"] = VM.Tags 9016 } 9017 return json.Marshal(objectMap) 9018} 9019 9020// UnmarshalJSON is the custom unmarshaler for VirtualMachine struct. 9021func (VM *VirtualMachine) UnmarshalJSON(body []byte) error { 9022 var m map[string]*json.RawMessage 9023 err := json.Unmarshal(body, &m) 9024 if err != nil { 9025 return err 9026 } 9027 for k, v := range m { 9028 switch k { 9029 case "plan": 9030 if v != nil { 9031 var plan Plan 9032 err = json.Unmarshal(*v, &plan) 9033 if err != nil { 9034 return err 9035 } 9036 VM.Plan = &plan 9037 } 9038 case "properties": 9039 if v != nil { 9040 var virtualMachineProperties VirtualMachineProperties 9041 err = json.Unmarshal(*v, &virtualMachineProperties) 9042 if err != nil { 9043 return err 9044 } 9045 VM.VirtualMachineProperties = &virtualMachineProperties 9046 } 9047 case "resources": 9048 if v != nil { 9049 var resources []VirtualMachineExtension 9050 err = json.Unmarshal(*v, &resources) 9051 if err != nil { 9052 return err 9053 } 9054 VM.Resources = &resources 9055 } 9056 case "identity": 9057 if v != nil { 9058 var identity VirtualMachineIdentity 9059 err = json.Unmarshal(*v, &identity) 9060 if err != nil { 9061 return err 9062 } 9063 VM.Identity = &identity 9064 } 9065 case "zones": 9066 if v != nil { 9067 var zones []string 9068 err = json.Unmarshal(*v, &zones) 9069 if err != nil { 9070 return err 9071 } 9072 VM.Zones = &zones 9073 } 9074 case "id": 9075 if v != nil { 9076 var ID string 9077 err = json.Unmarshal(*v, &ID) 9078 if err != nil { 9079 return err 9080 } 9081 VM.ID = &ID 9082 } 9083 case "name": 9084 if v != nil { 9085 var name string 9086 err = json.Unmarshal(*v, &name) 9087 if err != nil { 9088 return err 9089 } 9090 VM.Name = &name 9091 } 9092 case "type": 9093 if v != nil { 9094 var typeVar string 9095 err = json.Unmarshal(*v, &typeVar) 9096 if err != nil { 9097 return err 9098 } 9099 VM.Type = &typeVar 9100 } 9101 case "location": 9102 if v != nil { 9103 var location string 9104 err = json.Unmarshal(*v, &location) 9105 if err != nil { 9106 return err 9107 } 9108 VM.Location = &location 9109 } 9110 case "tags": 9111 if v != nil { 9112 var tags map[string]*string 9113 err = json.Unmarshal(*v, &tags) 9114 if err != nil { 9115 return err 9116 } 9117 VM.Tags = tags 9118 } 9119 } 9120 } 9121 9122 return nil 9123} 9124 9125// VirtualMachineAgentInstanceView the instance view of the VM Agent running on the virtual machine. 9126type VirtualMachineAgentInstanceView struct { 9127 // VMAgentVersion - The VM Agent full version. 9128 VMAgentVersion *string `json:"vmAgentVersion,omitempty"` 9129 // ExtensionHandlers - The virtual machine extension handler instance view. 9130 ExtensionHandlers *[]VirtualMachineExtensionHandlerInstanceView `json:"extensionHandlers,omitempty"` 9131 // Statuses - The resource status information. 9132 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 9133} 9134 9135// VirtualMachineAssessPatchesResult describes the properties of an AssessPatches result. 9136type VirtualMachineAssessPatchesResult struct { 9137 autorest.Response `json:"-"` 9138 // Status - READ-ONLY; The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Failed", "Succeeded", or "CompletedWithWarnings.". Possible values include: 'PatchOperationStatusInProgress', 'PatchOperationStatusFailed', 'PatchOperationStatusSucceeded', 'PatchOperationStatusCompletedWithWarnings' 9139 Status PatchOperationStatus `json:"status,omitempty"` 9140 // AssessmentActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. 9141 AssessmentActivityID *string `json:"assessmentActivityId,omitempty"` 9142 // RebootPending - READ-ONLY; The overall reboot status of the VM. It will be true when partially installed patches require a reboot to complete installation but the reboot has not yet occurred. 9143 RebootPending *bool `json:"rebootPending,omitempty"` 9144 // CriticalAndSecurityPatchCount - READ-ONLY; The number of critical or security patches that have been detected as available and not yet installed. 9145 CriticalAndSecurityPatchCount *int32 `json:"criticalAndSecurityPatchCount,omitempty"` 9146 // OtherPatchCount - READ-ONLY; The number of all available patches excluding critical and security. 9147 OtherPatchCount *int32 `json:"otherPatchCount,omitempty"` 9148 // StartDateTime - READ-ONLY; The UTC timestamp when the operation began. 9149 StartDateTime *date.Time `json:"startDateTime,omitempty"` 9150 // Patches - READ-ONLY; The list of patches that have been detected as available for installation. 9151 Patches *[]VirtualMachineSoftwarePatchProperties `json:"patches,omitempty"` 9152 // Error - READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. 9153 Error *APIError `json:"error,omitempty"` 9154} 9155 9156// VirtualMachineCaptureParameters capture Virtual Machine parameters. 9157type VirtualMachineCaptureParameters struct { 9158 // VhdPrefix - The captured virtual hard disk's name prefix. 9159 VhdPrefix *string `json:"vhdPrefix,omitempty"` 9160 // DestinationContainerName - The destination container name. 9161 DestinationContainerName *string `json:"destinationContainerName,omitempty"` 9162 // OverwriteVhds - Specifies whether to overwrite the destination virtual hard disk, in case of conflict. 9163 OverwriteVhds *bool `json:"overwriteVhds,omitempty"` 9164} 9165 9166// VirtualMachineCaptureResult output of virtual machine capture operation. 9167type VirtualMachineCaptureResult struct { 9168 autorest.Response `json:"-"` 9169 // Schema - READ-ONLY; the schema of the captured virtual machine 9170 Schema *string `json:"$schema,omitempty"` 9171 // ContentVersion - READ-ONLY; the version of the content 9172 ContentVersion *string `json:"contentVersion,omitempty"` 9173 // Parameters - READ-ONLY; parameters of the captured virtual machine 9174 Parameters interface{} `json:"parameters,omitempty"` 9175 // Resources - READ-ONLY; a list of resource items of the captured virtual machine 9176 Resources *[]interface{} `json:"resources,omitempty"` 9177 // ID - Resource Id 9178 ID *string `json:"id,omitempty"` 9179} 9180 9181// MarshalJSON is the custom marshaler for VirtualMachineCaptureResult. 9182func (vmcr VirtualMachineCaptureResult) MarshalJSON() ([]byte, error) { 9183 objectMap := make(map[string]interface{}) 9184 if vmcr.ID != nil { 9185 objectMap["id"] = vmcr.ID 9186 } 9187 return json.Marshal(objectMap) 9188} 9189 9190// VirtualMachineExtension describes a Virtual Machine Extension. 9191type VirtualMachineExtension struct { 9192 autorest.Response `json:"-"` 9193 *VirtualMachineExtensionProperties `json:"properties,omitempty"` 9194 // ID - READ-ONLY; Resource Id 9195 ID *string `json:"id,omitempty"` 9196 // Name - READ-ONLY; Resource name 9197 Name *string `json:"name,omitempty"` 9198 // Type - READ-ONLY; Resource type 9199 Type *string `json:"type,omitempty"` 9200 // Location - Resource location 9201 Location *string `json:"location,omitempty"` 9202 // Tags - Resource tags 9203 Tags map[string]*string `json:"tags"` 9204} 9205 9206// MarshalJSON is the custom marshaler for VirtualMachineExtension. 9207func (vme VirtualMachineExtension) MarshalJSON() ([]byte, error) { 9208 objectMap := make(map[string]interface{}) 9209 if vme.VirtualMachineExtensionProperties != nil { 9210 objectMap["properties"] = vme.VirtualMachineExtensionProperties 9211 } 9212 if vme.Location != nil { 9213 objectMap["location"] = vme.Location 9214 } 9215 if vme.Tags != nil { 9216 objectMap["tags"] = vme.Tags 9217 } 9218 return json.Marshal(objectMap) 9219} 9220 9221// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtension struct. 9222func (vme *VirtualMachineExtension) UnmarshalJSON(body []byte) error { 9223 var m map[string]*json.RawMessage 9224 err := json.Unmarshal(body, &m) 9225 if err != nil { 9226 return err 9227 } 9228 for k, v := range m { 9229 switch k { 9230 case "properties": 9231 if v != nil { 9232 var virtualMachineExtensionProperties VirtualMachineExtensionProperties 9233 err = json.Unmarshal(*v, &virtualMachineExtensionProperties) 9234 if err != nil { 9235 return err 9236 } 9237 vme.VirtualMachineExtensionProperties = &virtualMachineExtensionProperties 9238 } 9239 case "id": 9240 if v != nil { 9241 var ID string 9242 err = json.Unmarshal(*v, &ID) 9243 if err != nil { 9244 return err 9245 } 9246 vme.ID = &ID 9247 } 9248 case "name": 9249 if v != nil { 9250 var name string 9251 err = json.Unmarshal(*v, &name) 9252 if err != nil { 9253 return err 9254 } 9255 vme.Name = &name 9256 } 9257 case "type": 9258 if v != nil { 9259 var typeVar string 9260 err = json.Unmarshal(*v, &typeVar) 9261 if err != nil { 9262 return err 9263 } 9264 vme.Type = &typeVar 9265 } 9266 case "location": 9267 if v != nil { 9268 var location string 9269 err = json.Unmarshal(*v, &location) 9270 if err != nil { 9271 return err 9272 } 9273 vme.Location = &location 9274 } 9275 case "tags": 9276 if v != nil { 9277 var tags map[string]*string 9278 err = json.Unmarshal(*v, &tags) 9279 if err != nil { 9280 return err 9281 } 9282 vme.Tags = tags 9283 } 9284 } 9285 } 9286 9287 return nil 9288} 9289 9290// VirtualMachineExtensionHandlerInstanceView the instance view of a virtual machine extension handler. 9291type VirtualMachineExtensionHandlerInstanceView struct { 9292 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 9293 Type *string `json:"type,omitempty"` 9294 // TypeHandlerVersion - Specifies the version of the script handler. 9295 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 9296 // Status - The extension handler status. 9297 Status *InstanceViewStatus `json:"status,omitempty"` 9298} 9299 9300// VirtualMachineExtensionImage describes a Virtual Machine Extension Image. 9301type VirtualMachineExtensionImage struct { 9302 autorest.Response `json:"-"` 9303 *VirtualMachineExtensionImageProperties `json:"properties,omitempty"` 9304 // ID - READ-ONLY; Resource Id 9305 ID *string `json:"id,omitempty"` 9306 // Name - READ-ONLY; Resource name 9307 Name *string `json:"name,omitempty"` 9308 // Type - READ-ONLY; Resource type 9309 Type *string `json:"type,omitempty"` 9310 // Location - Resource location 9311 Location *string `json:"location,omitempty"` 9312 // Tags - Resource tags 9313 Tags map[string]*string `json:"tags"` 9314} 9315 9316// MarshalJSON is the custom marshaler for VirtualMachineExtensionImage. 9317func (vmei VirtualMachineExtensionImage) MarshalJSON() ([]byte, error) { 9318 objectMap := make(map[string]interface{}) 9319 if vmei.VirtualMachineExtensionImageProperties != nil { 9320 objectMap["properties"] = vmei.VirtualMachineExtensionImageProperties 9321 } 9322 if vmei.Location != nil { 9323 objectMap["location"] = vmei.Location 9324 } 9325 if vmei.Tags != nil { 9326 objectMap["tags"] = vmei.Tags 9327 } 9328 return json.Marshal(objectMap) 9329} 9330 9331// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtensionImage struct. 9332func (vmei *VirtualMachineExtensionImage) UnmarshalJSON(body []byte) error { 9333 var m map[string]*json.RawMessage 9334 err := json.Unmarshal(body, &m) 9335 if err != nil { 9336 return err 9337 } 9338 for k, v := range m { 9339 switch k { 9340 case "properties": 9341 if v != nil { 9342 var virtualMachineExtensionImageProperties VirtualMachineExtensionImageProperties 9343 err = json.Unmarshal(*v, &virtualMachineExtensionImageProperties) 9344 if err != nil { 9345 return err 9346 } 9347 vmei.VirtualMachineExtensionImageProperties = &virtualMachineExtensionImageProperties 9348 } 9349 case "id": 9350 if v != nil { 9351 var ID string 9352 err = json.Unmarshal(*v, &ID) 9353 if err != nil { 9354 return err 9355 } 9356 vmei.ID = &ID 9357 } 9358 case "name": 9359 if v != nil { 9360 var name string 9361 err = json.Unmarshal(*v, &name) 9362 if err != nil { 9363 return err 9364 } 9365 vmei.Name = &name 9366 } 9367 case "type": 9368 if v != nil { 9369 var typeVar string 9370 err = json.Unmarshal(*v, &typeVar) 9371 if err != nil { 9372 return err 9373 } 9374 vmei.Type = &typeVar 9375 } 9376 case "location": 9377 if v != nil { 9378 var location string 9379 err = json.Unmarshal(*v, &location) 9380 if err != nil { 9381 return err 9382 } 9383 vmei.Location = &location 9384 } 9385 case "tags": 9386 if v != nil { 9387 var tags map[string]*string 9388 err = json.Unmarshal(*v, &tags) 9389 if err != nil { 9390 return err 9391 } 9392 vmei.Tags = tags 9393 } 9394 } 9395 } 9396 9397 return nil 9398} 9399 9400// VirtualMachineExtensionImageProperties describes the properties of a Virtual Machine Extension Image. 9401type VirtualMachineExtensionImageProperties struct { 9402 // OperatingSystem - The operating system this extension supports. 9403 OperatingSystem *string `json:"operatingSystem,omitempty"` 9404 // ComputeRole - The type of role (IaaS or PaaS) this extension supports. 9405 ComputeRole *string `json:"computeRole,omitempty"` 9406 // HandlerSchema - The schema defined by publisher, where extension consumers should provide settings in a matching schema. 9407 HandlerSchema *string `json:"handlerSchema,omitempty"` 9408 // 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. 9409 VMScaleSetEnabled *bool `json:"vmScaleSetEnabled,omitempty"` 9410 // SupportsMultipleExtensions - Whether the handler can support multiple extensions. 9411 SupportsMultipleExtensions *bool `json:"supportsMultipleExtensions,omitempty"` 9412} 9413 9414// VirtualMachineExtensionInstanceView the instance view of a virtual machine extension. 9415type VirtualMachineExtensionInstanceView struct { 9416 // Name - The virtual machine extension name. 9417 Name *string `json:"name,omitempty"` 9418 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 9419 Type *string `json:"type,omitempty"` 9420 // TypeHandlerVersion - Specifies the version of the script handler. 9421 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 9422 // Substatuses - The resource status information. 9423 Substatuses *[]InstanceViewStatus `json:"substatuses,omitempty"` 9424 // Statuses - The resource status information. 9425 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 9426} 9427 9428// VirtualMachineExtensionProperties describes the properties of a Virtual Machine Extension. 9429type VirtualMachineExtensionProperties struct { 9430 // ForceUpdateTag - How the extension handler should be forced to update even if the extension configuration has not changed. 9431 ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` 9432 // Publisher - The name of the extension handler publisher. 9433 Publisher *string `json:"publisher,omitempty"` 9434 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 9435 Type *string `json:"type,omitempty"` 9436 // TypeHandlerVersion - Specifies the version of the script handler. 9437 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 9438 // 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. 9439 AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` 9440 // EnableAutomaticUpgrade - Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. 9441 EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` 9442 // Settings - Json formatted public settings for the extension. 9443 Settings interface{} `json:"settings,omitempty"` 9444 // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. 9445 ProtectedSettings interface{} `json:"protectedSettings,omitempty"` 9446 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 9447 ProvisioningState *string `json:"provisioningState,omitempty"` 9448 // InstanceView - The virtual machine extension instance view. 9449 InstanceView *VirtualMachineExtensionInstanceView `json:"instanceView,omitempty"` 9450} 9451 9452// MarshalJSON is the custom marshaler for VirtualMachineExtensionProperties. 9453func (vmep VirtualMachineExtensionProperties) MarshalJSON() ([]byte, error) { 9454 objectMap := make(map[string]interface{}) 9455 if vmep.ForceUpdateTag != nil { 9456 objectMap["forceUpdateTag"] = vmep.ForceUpdateTag 9457 } 9458 if vmep.Publisher != nil { 9459 objectMap["publisher"] = vmep.Publisher 9460 } 9461 if vmep.Type != nil { 9462 objectMap["type"] = vmep.Type 9463 } 9464 if vmep.TypeHandlerVersion != nil { 9465 objectMap["typeHandlerVersion"] = vmep.TypeHandlerVersion 9466 } 9467 if vmep.AutoUpgradeMinorVersion != nil { 9468 objectMap["autoUpgradeMinorVersion"] = vmep.AutoUpgradeMinorVersion 9469 } 9470 if vmep.EnableAutomaticUpgrade != nil { 9471 objectMap["enableAutomaticUpgrade"] = vmep.EnableAutomaticUpgrade 9472 } 9473 if vmep.Settings != nil { 9474 objectMap["settings"] = vmep.Settings 9475 } 9476 if vmep.ProtectedSettings != nil { 9477 objectMap["protectedSettings"] = vmep.ProtectedSettings 9478 } 9479 if vmep.InstanceView != nil { 9480 objectMap["instanceView"] = vmep.InstanceView 9481 } 9482 return json.Marshal(objectMap) 9483} 9484 9485// VirtualMachineExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of 9486// a long-running operation. 9487type VirtualMachineExtensionsCreateOrUpdateFuture struct { 9488 azure.FutureAPI 9489 // Result returns the result of the asynchronous operation. 9490 // If the operation has not completed it will return an error. 9491 Result func(VirtualMachineExtensionsClient) (VirtualMachineExtension, error) 9492} 9493 9494// VirtualMachineExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of a 9495// long-running operation. 9496type VirtualMachineExtensionsDeleteFuture struct { 9497 azure.FutureAPI 9498 // Result returns the result of the asynchronous operation. 9499 // If the operation has not completed it will return an error. 9500 Result func(VirtualMachineExtensionsClient) (autorest.Response, error) 9501} 9502 9503// VirtualMachineExtensionsListResult the List Extension operation response 9504type VirtualMachineExtensionsListResult struct { 9505 autorest.Response `json:"-"` 9506 // Value - The list of extensions 9507 Value *[]VirtualMachineExtension `json:"value,omitempty"` 9508} 9509 9510// VirtualMachineExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of a 9511// long-running operation. 9512type VirtualMachineExtensionsUpdateFuture struct { 9513 azure.FutureAPI 9514 // Result returns the result of the asynchronous operation. 9515 // If the operation has not completed it will return an error. 9516 Result func(VirtualMachineExtensionsClient) (VirtualMachineExtension, error) 9517} 9518 9519// VirtualMachineExtensionUpdate describes a Virtual Machine Extension. 9520type VirtualMachineExtensionUpdate struct { 9521 *VirtualMachineExtensionUpdateProperties `json:"properties,omitempty"` 9522 // Tags - Resource tags 9523 Tags map[string]*string `json:"tags"` 9524} 9525 9526// MarshalJSON is the custom marshaler for VirtualMachineExtensionUpdate. 9527func (vmeu VirtualMachineExtensionUpdate) MarshalJSON() ([]byte, error) { 9528 objectMap := make(map[string]interface{}) 9529 if vmeu.VirtualMachineExtensionUpdateProperties != nil { 9530 objectMap["properties"] = vmeu.VirtualMachineExtensionUpdateProperties 9531 } 9532 if vmeu.Tags != nil { 9533 objectMap["tags"] = vmeu.Tags 9534 } 9535 return json.Marshal(objectMap) 9536} 9537 9538// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtensionUpdate struct. 9539func (vmeu *VirtualMachineExtensionUpdate) UnmarshalJSON(body []byte) error { 9540 var m map[string]*json.RawMessage 9541 err := json.Unmarshal(body, &m) 9542 if err != nil { 9543 return err 9544 } 9545 for k, v := range m { 9546 switch k { 9547 case "properties": 9548 if v != nil { 9549 var virtualMachineExtensionUpdateProperties VirtualMachineExtensionUpdateProperties 9550 err = json.Unmarshal(*v, &virtualMachineExtensionUpdateProperties) 9551 if err != nil { 9552 return err 9553 } 9554 vmeu.VirtualMachineExtensionUpdateProperties = &virtualMachineExtensionUpdateProperties 9555 } 9556 case "tags": 9557 if v != nil { 9558 var tags map[string]*string 9559 err = json.Unmarshal(*v, &tags) 9560 if err != nil { 9561 return err 9562 } 9563 vmeu.Tags = tags 9564 } 9565 } 9566 } 9567 9568 return nil 9569} 9570 9571// VirtualMachineExtensionUpdateProperties describes the properties of a Virtual Machine Extension. 9572type VirtualMachineExtensionUpdateProperties struct { 9573 // ForceUpdateTag - How the extension handler should be forced to update even if the extension configuration has not changed. 9574 ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` 9575 // Publisher - The name of the extension handler publisher. 9576 Publisher *string `json:"publisher,omitempty"` 9577 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 9578 Type *string `json:"type,omitempty"` 9579 // TypeHandlerVersion - Specifies the version of the script handler. 9580 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 9581 // 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. 9582 AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` 9583 // EnableAutomaticUpgrade - Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. 9584 EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` 9585 // Settings - Json formatted public settings for the extension. 9586 Settings interface{} `json:"settings,omitempty"` 9587 // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. 9588 ProtectedSettings interface{} `json:"protectedSettings,omitempty"` 9589} 9590 9591// VirtualMachineHealthStatus the health status of the VM. 9592type VirtualMachineHealthStatus struct { 9593 // Status - READ-ONLY; The health status information for the VM. 9594 Status *InstanceViewStatus `json:"status,omitempty"` 9595} 9596 9597// VirtualMachineIdentity identity for the virtual machine. 9598type VirtualMachineIdentity struct { 9599 // PrincipalID - READ-ONLY; The principal id of virtual machine identity. This property will only be provided for a system assigned identity. 9600 PrincipalID *string `json:"principalId,omitempty"` 9601 // TenantID - READ-ONLY; The tenant id associated with the virtual machine. This property will only be provided for a system assigned identity. 9602 TenantID *string `json:"tenantId,omitempty"` 9603 // 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' 9604 Type ResourceIdentityType `json:"type,omitempty"` 9605 // 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}'. 9606 UserAssignedIdentities map[string]*VirtualMachineIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` 9607} 9608 9609// MarshalJSON is the custom marshaler for VirtualMachineIdentity. 9610func (vmi VirtualMachineIdentity) MarshalJSON() ([]byte, error) { 9611 objectMap := make(map[string]interface{}) 9612 if vmi.Type != "" { 9613 objectMap["type"] = vmi.Type 9614 } 9615 if vmi.UserAssignedIdentities != nil { 9616 objectMap["userAssignedIdentities"] = vmi.UserAssignedIdentities 9617 } 9618 return json.Marshal(objectMap) 9619} 9620 9621// VirtualMachineIdentityUserAssignedIdentitiesValue ... 9622type VirtualMachineIdentityUserAssignedIdentitiesValue struct { 9623 // PrincipalID - READ-ONLY; The principal id of user assigned identity. 9624 PrincipalID *string `json:"principalId,omitempty"` 9625 // ClientID - READ-ONLY; The client id of user assigned identity. 9626 ClientID *string `json:"clientId,omitempty"` 9627} 9628 9629// VirtualMachineImage describes a Virtual Machine Image. 9630type VirtualMachineImage struct { 9631 autorest.Response `json:"-"` 9632 *VirtualMachineImageProperties `json:"properties,omitempty"` 9633 // Name - The name of the resource. 9634 Name *string `json:"name,omitempty"` 9635 // Location - The supported Azure location of the resource. 9636 Location *string `json:"location,omitempty"` 9637 // 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). 9638 Tags map[string]*string `json:"tags"` 9639 // ID - Resource Id 9640 ID *string `json:"id,omitempty"` 9641} 9642 9643// MarshalJSON is the custom marshaler for VirtualMachineImage. 9644func (vmi VirtualMachineImage) MarshalJSON() ([]byte, error) { 9645 objectMap := make(map[string]interface{}) 9646 if vmi.VirtualMachineImageProperties != nil { 9647 objectMap["properties"] = vmi.VirtualMachineImageProperties 9648 } 9649 if vmi.Name != nil { 9650 objectMap["name"] = vmi.Name 9651 } 9652 if vmi.Location != nil { 9653 objectMap["location"] = vmi.Location 9654 } 9655 if vmi.Tags != nil { 9656 objectMap["tags"] = vmi.Tags 9657 } 9658 if vmi.ID != nil { 9659 objectMap["id"] = vmi.ID 9660 } 9661 return json.Marshal(objectMap) 9662} 9663 9664// UnmarshalJSON is the custom unmarshaler for VirtualMachineImage struct. 9665func (vmi *VirtualMachineImage) UnmarshalJSON(body []byte) error { 9666 var m map[string]*json.RawMessage 9667 err := json.Unmarshal(body, &m) 9668 if err != nil { 9669 return err 9670 } 9671 for k, v := range m { 9672 switch k { 9673 case "properties": 9674 if v != nil { 9675 var virtualMachineImageProperties VirtualMachineImageProperties 9676 err = json.Unmarshal(*v, &virtualMachineImageProperties) 9677 if err != nil { 9678 return err 9679 } 9680 vmi.VirtualMachineImageProperties = &virtualMachineImageProperties 9681 } 9682 case "name": 9683 if v != nil { 9684 var name string 9685 err = json.Unmarshal(*v, &name) 9686 if err != nil { 9687 return err 9688 } 9689 vmi.Name = &name 9690 } 9691 case "location": 9692 if v != nil { 9693 var location string 9694 err = json.Unmarshal(*v, &location) 9695 if err != nil { 9696 return err 9697 } 9698 vmi.Location = &location 9699 } 9700 case "tags": 9701 if v != nil { 9702 var tags map[string]*string 9703 err = json.Unmarshal(*v, &tags) 9704 if err != nil { 9705 return err 9706 } 9707 vmi.Tags = tags 9708 } 9709 case "id": 9710 if v != nil { 9711 var ID string 9712 err = json.Unmarshal(*v, &ID) 9713 if err != nil { 9714 return err 9715 } 9716 vmi.ID = &ID 9717 } 9718 } 9719 } 9720 9721 return nil 9722} 9723 9724// VirtualMachineImageProperties describes the properties of a Virtual Machine Image. 9725type VirtualMachineImageProperties struct { 9726 Plan *PurchasePlan `json:"plan,omitempty"` 9727 OsDiskImage *OSDiskImage `json:"osDiskImage,omitempty"` 9728 DataDiskImages *[]DataDiskImage `json:"dataDiskImages,omitempty"` 9729 AutomaticOSUpgradeProperties *AutomaticOSUpgradeProperties `json:"automaticOSUpgradeProperties,omitempty"` 9730 // HyperVGeneration - Possible values include: 'HyperVGenerationTypesV1', 'HyperVGenerationTypesV2' 9731 HyperVGeneration HyperVGenerationTypes `json:"hyperVGeneration,omitempty"` 9732 // Disallowed - Specifies disallowed configuration for the VirtualMachine created from the image 9733 Disallowed *DisallowedConfiguration `json:"disallowed,omitempty"` 9734} 9735 9736// VirtualMachineImageResource virtual machine image resource information. 9737type VirtualMachineImageResource struct { 9738 // Name - The name of the resource. 9739 Name *string `json:"name,omitempty"` 9740 // Location - The supported Azure location of the resource. 9741 Location *string `json:"location,omitempty"` 9742 // 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). 9743 Tags map[string]*string `json:"tags"` 9744 // ID - Resource Id 9745 ID *string `json:"id,omitempty"` 9746} 9747 9748// MarshalJSON is the custom marshaler for VirtualMachineImageResource. 9749func (vmir VirtualMachineImageResource) MarshalJSON() ([]byte, error) { 9750 objectMap := make(map[string]interface{}) 9751 if vmir.Name != nil { 9752 objectMap["name"] = vmir.Name 9753 } 9754 if vmir.Location != nil { 9755 objectMap["location"] = vmir.Location 9756 } 9757 if vmir.Tags != nil { 9758 objectMap["tags"] = vmir.Tags 9759 } 9760 if vmir.ID != nil { 9761 objectMap["id"] = vmir.ID 9762 } 9763 return json.Marshal(objectMap) 9764} 9765 9766// VirtualMachineInstanceView the instance view of a virtual machine. 9767type VirtualMachineInstanceView struct { 9768 autorest.Response `json:"-"` 9769 // PlatformUpdateDomain - Specifies the update domain of the virtual machine. 9770 PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` 9771 // PlatformFaultDomain - Specifies the fault domain of the virtual machine. 9772 PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` 9773 // ComputerName - The computer name assigned to the virtual machine. 9774 ComputerName *string `json:"computerName,omitempty"` 9775 // OsName - The Operating System running on the virtual machine. 9776 OsName *string `json:"osName,omitempty"` 9777 // OsVersion - The version of Operating System running on the virtual machine. 9778 OsVersion *string `json:"osVersion,omitempty"` 9779 // HyperVGeneration - Specifies the HyperVGeneration Type associated with a resource. Possible values include: 'HyperVGenerationTypeV1', 'HyperVGenerationTypeV2' 9780 HyperVGeneration HyperVGenerationType `json:"hyperVGeneration,omitempty"` 9781 // RdpThumbPrint - The Remote desktop certificate thumbprint. 9782 RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"` 9783 // VMAgent - The VM Agent running on the virtual machine. 9784 VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"` 9785 // MaintenanceRedeployStatus - The Maintenance Operation status on the virtual machine. 9786 MaintenanceRedeployStatus *MaintenanceRedeployStatus `json:"maintenanceRedeployStatus,omitempty"` 9787 // Disks - The virtual machine disk information. 9788 Disks *[]DiskInstanceView `json:"disks,omitempty"` 9789 // Extensions - The extensions information. 9790 Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` 9791 // VMHealth - READ-ONLY; The health status for the VM. 9792 VMHealth *VirtualMachineHealthStatus `json:"vmHealth,omitempty"` 9793 // 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. 9794 BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` 9795 // AssignedHost - READ-ONLY; Resource id of the dedicated host, on which the virtual machine is allocated through automatic placement, when the virtual machine is associated with a dedicated host group that has automatic placement enabled. <br><br>Minimum api-version: 2020-06-01. 9796 AssignedHost *string `json:"assignedHost,omitempty"` 9797 // Statuses - The resource status information. 9798 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 9799 // PatchStatus - The status of virtual machine patch operations. 9800 PatchStatus *VirtualMachinePatchStatus `json:"patchStatus,omitempty"` 9801} 9802 9803// MarshalJSON is the custom marshaler for VirtualMachineInstanceView. 9804func (vmiv VirtualMachineInstanceView) MarshalJSON() ([]byte, error) { 9805 objectMap := make(map[string]interface{}) 9806 if vmiv.PlatformUpdateDomain != nil { 9807 objectMap["platformUpdateDomain"] = vmiv.PlatformUpdateDomain 9808 } 9809 if vmiv.PlatformFaultDomain != nil { 9810 objectMap["platformFaultDomain"] = vmiv.PlatformFaultDomain 9811 } 9812 if vmiv.ComputerName != nil { 9813 objectMap["computerName"] = vmiv.ComputerName 9814 } 9815 if vmiv.OsName != nil { 9816 objectMap["osName"] = vmiv.OsName 9817 } 9818 if vmiv.OsVersion != nil { 9819 objectMap["osVersion"] = vmiv.OsVersion 9820 } 9821 if vmiv.HyperVGeneration != "" { 9822 objectMap["hyperVGeneration"] = vmiv.HyperVGeneration 9823 } 9824 if vmiv.RdpThumbPrint != nil { 9825 objectMap["rdpThumbPrint"] = vmiv.RdpThumbPrint 9826 } 9827 if vmiv.VMAgent != nil { 9828 objectMap["vmAgent"] = vmiv.VMAgent 9829 } 9830 if vmiv.MaintenanceRedeployStatus != nil { 9831 objectMap["maintenanceRedeployStatus"] = vmiv.MaintenanceRedeployStatus 9832 } 9833 if vmiv.Disks != nil { 9834 objectMap["disks"] = vmiv.Disks 9835 } 9836 if vmiv.Extensions != nil { 9837 objectMap["extensions"] = vmiv.Extensions 9838 } 9839 if vmiv.BootDiagnostics != nil { 9840 objectMap["bootDiagnostics"] = vmiv.BootDiagnostics 9841 } 9842 if vmiv.Statuses != nil { 9843 objectMap["statuses"] = vmiv.Statuses 9844 } 9845 if vmiv.PatchStatus != nil { 9846 objectMap["patchStatus"] = vmiv.PatchStatus 9847 } 9848 return json.Marshal(objectMap) 9849} 9850 9851// VirtualMachineListResult the List Virtual Machine operation response. 9852type VirtualMachineListResult struct { 9853 autorest.Response `json:"-"` 9854 // Value - The list of virtual machines. 9855 Value *[]VirtualMachine `json:"value,omitempty"` 9856 // NextLink - The URI to fetch the next page of VMs. Call ListNext() with this URI to fetch the next page of Virtual Machines. 9857 NextLink *string `json:"nextLink,omitempty"` 9858} 9859 9860// VirtualMachineListResultIterator provides access to a complete listing of VirtualMachine values. 9861type VirtualMachineListResultIterator struct { 9862 i int 9863 page VirtualMachineListResultPage 9864} 9865 9866// NextWithContext advances to the next value. If there was an error making 9867// the request the iterator does not advance and the error is returned. 9868func (iter *VirtualMachineListResultIterator) NextWithContext(ctx context.Context) (err error) { 9869 if tracing.IsEnabled() { 9870 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineListResultIterator.NextWithContext") 9871 defer func() { 9872 sc := -1 9873 if iter.Response().Response.Response != nil { 9874 sc = iter.Response().Response.Response.StatusCode 9875 } 9876 tracing.EndSpan(ctx, sc, err) 9877 }() 9878 } 9879 iter.i++ 9880 if iter.i < len(iter.page.Values()) { 9881 return nil 9882 } 9883 err = iter.page.NextWithContext(ctx) 9884 if err != nil { 9885 iter.i-- 9886 return err 9887 } 9888 iter.i = 0 9889 return nil 9890} 9891 9892// Next advances to the next value. If there was an error making 9893// the request the iterator does not advance and the error is returned. 9894// Deprecated: Use NextWithContext() instead. 9895func (iter *VirtualMachineListResultIterator) Next() error { 9896 return iter.NextWithContext(context.Background()) 9897} 9898 9899// NotDone returns true if the enumeration should be started or is not yet complete. 9900func (iter VirtualMachineListResultIterator) NotDone() bool { 9901 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9902} 9903 9904// Response returns the raw server response from the last page request. 9905func (iter VirtualMachineListResultIterator) Response() VirtualMachineListResult { 9906 return iter.page.Response() 9907} 9908 9909// Value returns the current value or a zero-initialized value if the 9910// iterator has advanced beyond the end of the collection. 9911func (iter VirtualMachineListResultIterator) Value() VirtualMachine { 9912 if !iter.page.NotDone() { 9913 return VirtualMachine{} 9914 } 9915 return iter.page.Values()[iter.i] 9916} 9917 9918// Creates a new instance of the VirtualMachineListResultIterator type. 9919func NewVirtualMachineListResultIterator(page VirtualMachineListResultPage) VirtualMachineListResultIterator { 9920 return VirtualMachineListResultIterator{page: page} 9921} 9922 9923// IsEmpty returns true if the ListResult contains no values. 9924func (vmlr VirtualMachineListResult) IsEmpty() bool { 9925 return vmlr.Value == nil || len(*vmlr.Value) == 0 9926} 9927 9928// hasNextLink returns true if the NextLink is not empty. 9929func (vmlr VirtualMachineListResult) hasNextLink() bool { 9930 return vmlr.NextLink != nil && len(*vmlr.NextLink) != 0 9931} 9932 9933// virtualMachineListResultPreparer prepares a request to retrieve the next set of results. 9934// It returns nil if no more results exist. 9935func (vmlr VirtualMachineListResult) virtualMachineListResultPreparer(ctx context.Context) (*http.Request, error) { 9936 if !vmlr.hasNextLink() { 9937 return nil, nil 9938 } 9939 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9940 autorest.AsJSON(), 9941 autorest.AsGet(), 9942 autorest.WithBaseURL(to.String(vmlr.NextLink))) 9943} 9944 9945// VirtualMachineListResultPage contains a page of VirtualMachine values. 9946type VirtualMachineListResultPage struct { 9947 fn func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error) 9948 vmlr VirtualMachineListResult 9949} 9950 9951// NextWithContext advances to the next page of values. If there was an error making 9952// the request the page does not advance and the error is returned. 9953func (page *VirtualMachineListResultPage) NextWithContext(ctx context.Context) (err error) { 9954 if tracing.IsEnabled() { 9955 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineListResultPage.NextWithContext") 9956 defer func() { 9957 sc := -1 9958 if page.Response().Response.Response != nil { 9959 sc = page.Response().Response.Response.StatusCode 9960 } 9961 tracing.EndSpan(ctx, sc, err) 9962 }() 9963 } 9964 for { 9965 next, err := page.fn(ctx, page.vmlr) 9966 if err != nil { 9967 return err 9968 } 9969 page.vmlr = next 9970 if !next.hasNextLink() || !next.IsEmpty() { 9971 break 9972 } 9973 } 9974 return nil 9975} 9976 9977// Next advances to the next page of values. If there was an error making 9978// the request the page does not advance and the error is returned. 9979// Deprecated: Use NextWithContext() instead. 9980func (page *VirtualMachineListResultPage) Next() error { 9981 return page.NextWithContext(context.Background()) 9982} 9983 9984// NotDone returns true if the page enumeration should be started or is not yet complete. 9985func (page VirtualMachineListResultPage) NotDone() bool { 9986 return !page.vmlr.IsEmpty() 9987} 9988 9989// Response returns the raw server response from the last page request. 9990func (page VirtualMachineListResultPage) Response() VirtualMachineListResult { 9991 return page.vmlr 9992} 9993 9994// Values returns the slice of values for the current page or nil if there are no values. 9995func (page VirtualMachineListResultPage) Values() []VirtualMachine { 9996 if page.vmlr.IsEmpty() { 9997 return nil 9998 } 9999 return *page.vmlr.Value 10000} 10001 10002// Creates a new instance of the VirtualMachineListResultPage type. 10003func NewVirtualMachineListResultPage(cur VirtualMachineListResult, getNextPage func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error)) VirtualMachineListResultPage { 10004 return VirtualMachineListResultPage{ 10005 fn: getNextPage, 10006 vmlr: cur, 10007 } 10008} 10009 10010// VirtualMachinePatchStatus the status of virtual machine patch operations. 10011type VirtualMachinePatchStatus struct { 10012 // AvailablePatchSummary - The available patch summary of the latest assessment operation for the virtual machine. 10013 AvailablePatchSummary *AvailablePatchSummary `json:"availablePatchSummary,omitempty"` 10014 // LastPatchInstallationSummary - The installation summary of the latest installation operation for the virtual machine. 10015 LastPatchInstallationSummary *LastPatchInstallationSummary `json:"lastPatchInstallationSummary,omitempty"` 10016} 10017 10018// VirtualMachineProperties describes the properties of a Virtual Machine. 10019type VirtualMachineProperties struct { 10020 // HardwareProfile - Specifies the hardware settings for the virtual machine. 10021 HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` 10022 // StorageProfile - Specifies the storage settings for the virtual machine disks. 10023 StorageProfile *StorageProfile `json:"storageProfile,omitempty"` 10024 // AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the virtual machine. 10025 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 10026 // OsProfile - Specifies the operating system settings used while creating the virtual machine. Some of the settings cannot be changed once VM is provisioned. 10027 OsProfile *OSProfile `json:"osProfile,omitempty"` 10028 // NetworkProfile - Specifies the network interfaces of the virtual machine. 10029 NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` 10030 // SecurityProfile - Specifies the Security related profile settings for the virtual machine. 10031 SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` 10032 // DiagnosticsProfile - Specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. 10033 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 10034 // 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. 10035 AvailabilitySet *SubResource `json:"availabilitySet,omitempty"` 10036 // 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 10037 VirtualMachineScaleSet *SubResource `json:"virtualMachineScaleSet,omitempty"` 10038 // ProximityPlacementGroup - Specifies information about the proximity placement group that the virtual machine should be assigned to. <br><br>Minimum api-version: 2018-04-01. 10039 ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` 10040 // Priority - Specifies the priority for the virtual machine. <br><br>Minimum api-version: 2019-03-01. Possible values include: 'Regular', 'Low', 'Spot' 10041 Priority VirtualMachinePriorityTypes `json:"priority,omitempty"` 10042 // 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' 10043 EvictionPolicy VirtualMachineEvictionPolicyTypes `json:"evictionPolicy,omitempty"` 10044 // BillingProfile - Specifies the billing related details of a Azure Spot virtual machine. <br><br>Minimum api-version: 2019-03-01. 10045 BillingProfile *BillingProfile `json:"billingProfile,omitempty"` 10046 // Host - Specifies information about the dedicated host that the virtual machine resides in. <br><br>Minimum api-version: 2018-10-01. 10047 Host *SubResource `json:"host,omitempty"` 10048 // HostGroup - Specifies information about the dedicated host group that the virtual machine resides in. <br><br>Minimum api-version: 2020-06-01. <br><br>NOTE: User cannot specify both host and hostGroup properties. 10049 HostGroup *SubResource `json:"hostGroup,omitempty"` 10050 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 10051 ProvisioningState *string `json:"provisioningState,omitempty"` 10052 // InstanceView - READ-ONLY; The virtual machine instance view. 10053 InstanceView *VirtualMachineInstanceView `json:"instanceView,omitempty"` 10054 // LicenseType - Specifies that the image or disk that is being used was licensed on-premises. <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) <br><br> [Azure Hybrid Use Benefit for Linux Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> Minimum api-version: 2015-06-15 10055 LicenseType *string `json:"licenseType,omitempty"` 10056 // 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. 10057 VMID *string `json:"vmId,omitempty"` 10058 // ExtensionsTimeBudget - Specifies the time alloted for all extensions to start. The time duration should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. The default value is 90 minutes (PT1H30M). <br><br> Minimum api-version: 2020-06-01 10059 ExtensionsTimeBudget *string `json:"extensionsTimeBudget,omitempty"` 10060} 10061 10062// MarshalJSON is the custom marshaler for VirtualMachineProperties. 10063func (vmp VirtualMachineProperties) MarshalJSON() ([]byte, error) { 10064 objectMap := make(map[string]interface{}) 10065 if vmp.HardwareProfile != nil { 10066 objectMap["hardwareProfile"] = vmp.HardwareProfile 10067 } 10068 if vmp.StorageProfile != nil { 10069 objectMap["storageProfile"] = vmp.StorageProfile 10070 } 10071 if vmp.AdditionalCapabilities != nil { 10072 objectMap["additionalCapabilities"] = vmp.AdditionalCapabilities 10073 } 10074 if vmp.OsProfile != nil { 10075 objectMap["osProfile"] = vmp.OsProfile 10076 } 10077 if vmp.NetworkProfile != nil { 10078 objectMap["networkProfile"] = vmp.NetworkProfile 10079 } 10080 if vmp.SecurityProfile != nil { 10081 objectMap["securityProfile"] = vmp.SecurityProfile 10082 } 10083 if vmp.DiagnosticsProfile != nil { 10084 objectMap["diagnosticsProfile"] = vmp.DiagnosticsProfile 10085 } 10086 if vmp.AvailabilitySet != nil { 10087 objectMap["availabilitySet"] = vmp.AvailabilitySet 10088 } 10089 if vmp.VirtualMachineScaleSet != nil { 10090 objectMap["virtualMachineScaleSet"] = vmp.VirtualMachineScaleSet 10091 } 10092 if vmp.ProximityPlacementGroup != nil { 10093 objectMap["proximityPlacementGroup"] = vmp.ProximityPlacementGroup 10094 } 10095 if vmp.Priority != "" { 10096 objectMap["priority"] = vmp.Priority 10097 } 10098 if vmp.EvictionPolicy != "" { 10099 objectMap["evictionPolicy"] = vmp.EvictionPolicy 10100 } 10101 if vmp.BillingProfile != nil { 10102 objectMap["billingProfile"] = vmp.BillingProfile 10103 } 10104 if vmp.Host != nil { 10105 objectMap["host"] = vmp.Host 10106 } 10107 if vmp.HostGroup != nil { 10108 objectMap["hostGroup"] = vmp.HostGroup 10109 } 10110 if vmp.LicenseType != nil { 10111 objectMap["licenseType"] = vmp.LicenseType 10112 } 10113 if vmp.ExtensionsTimeBudget != nil { 10114 objectMap["extensionsTimeBudget"] = vmp.ExtensionsTimeBudget 10115 } 10116 return json.Marshal(objectMap) 10117} 10118 10119// VirtualMachineReimageParameters parameters for Reimaging Virtual Machine. NOTE: Virtual Machine OS disk 10120// will always be reimaged 10121type VirtualMachineReimageParameters struct { 10122 // 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. 10123 TempDisk *bool `json:"tempDisk,omitempty"` 10124} 10125 10126// VirtualMachineRunCommand describes a Virtual Machine run command. 10127type VirtualMachineRunCommand struct { 10128 autorest.Response `json:"-"` 10129 *VirtualMachineRunCommandProperties `json:"properties,omitempty"` 10130 // ID - READ-ONLY; Resource Id 10131 ID *string `json:"id,omitempty"` 10132 // Name - READ-ONLY; Resource name 10133 Name *string `json:"name,omitempty"` 10134 // Type - READ-ONLY; Resource type 10135 Type *string `json:"type,omitempty"` 10136 // Location - Resource location 10137 Location *string `json:"location,omitempty"` 10138 // Tags - Resource tags 10139 Tags map[string]*string `json:"tags"` 10140} 10141 10142// MarshalJSON is the custom marshaler for VirtualMachineRunCommand. 10143func (vmrc VirtualMachineRunCommand) MarshalJSON() ([]byte, error) { 10144 objectMap := make(map[string]interface{}) 10145 if vmrc.VirtualMachineRunCommandProperties != nil { 10146 objectMap["properties"] = vmrc.VirtualMachineRunCommandProperties 10147 } 10148 if vmrc.Location != nil { 10149 objectMap["location"] = vmrc.Location 10150 } 10151 if vmrc.Tags != nil { 10152 objectMap["tags"] = vmrc.Tags 10153 } 10154 return json.Marshal(objectMap) 10155} 10156 10157// UnmarshalJSON is the custom unmarshaler for VirtualMachineRunCommand struct. 10158func (vmrc *VirtualMachineRunCommand) UnmarshalJSON(body []byte) error { 10159 var m map[string]*json.RawMessage 10160 err := json.Unmarshal(body, &m) 10161 if err != nil { 10162 return err 10163 } 10164 for k, v := range m { 10165 switch k { 10166 case "properties": 10167 if v != nil { 10168 var virtualMachineRunCommandProperties VirtualMachineRunCommandProperties 10169 err = json.Unmarshal(*v, &virtualMachineRunCommandProperties) 10170 if err != nil { 10171 return err 10172 } 10173 vmrc.VirtualMachineRunCommandProperties = &virtualMachineRunCommandProperties 10174 } 10175 case "id": 10176 if v != nil { 10177 var ID string 10178 err = json.Unmarshal(*v, &ID) 10179 if err != nil { 10180 return err 10181 } 10182 vmrc.ID = &ID 10183 } 10184 case "name": 10185 if v != nil { 10186 var name string 10187 err = json.Unmarshal(*v, &name) 10188 if err != nil { 10189 return err 10190 } 10191 vmrc.Name = &name 10192 } 10193 case "type": 10194 if v != nil { 10195 var typeVar string 10196 err = json.Unmarshal(*v, &typeVar) 10197 if err != nil { 10198 return err 10199 } 10200 vmrc.Type = &typeVar 10201 } 10202 case "location": 10203 if v != nil { 10204 var location string 10205 err = json.Unmarshal(*v, &location) 10206 if err != nil { 10207 return err 10208 } 10209 vmrc.Location = &location 10210 } 10211 case "tags": 10212 if v != nil { 10213 var tags map[string]*string 10214 err = json.Unmarshal(*v, &tags) 10215 if err != nil { 10216 return err 10217 } 10218 vmrc.Tags = tags 10219 } 10220 } 10221 } 10222 10223 return nil 10224} 10225 10226// VirtualMachineRunCommandInstanceView the instance view of a virtual machine run command. 10227type VirtualMachineRunCommandInstanceView struct { 10228 // ExecutionState - Script execution status. Possible values include: 'ExecutionStateUnknown', 'ExecutionStatePending', 'ExecutionStateRunning', 'ExecutionStateFailed', 'ExecutionStateSucceeded', 'ExecutionStateTimedOut', 'ExecutionStateCanceled' 10229 ExecutionState ExecutionState `json:"executionState,omitempty"` 10230 // ExecutionMessage - Communicate script configuration errors or execution messages. 10231 ExecutionMessage *string `json:"executionMessage,omitempty"` 10232 // ExitCode - Exit code returned from script execution. 10233 ExitCode *int32 `json:"exitCode,omitempty"` 10234 // Output - Script output stream. 10235 Output *string `json:"output,omitempty"` 10236 // Error - Script error stream. 10237 Error *string `json:"error,omitempty"` 10238 // StartTime - Script start time. 10239 StartTime *date.Time `json:"startTime,omitempty"` 10240 // EndTime - Script end time. 10241 EndTime *date.Time `json:"endTime,omitempty"` 10242 // Statuses - The resource status information. 10243 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 10244} 10245 10246// VirtualMachineRunCommandProperties describes the properties of a Virtual Machine run command. 10247type VirtualMachineRunCommandProperties struct { 10248 // Source - The source of the run command script. 10249 Source *VirtualMachineRunCommandScriptSource `json:"source,omitempty"` 10250 // Parameters - The parameters used by the script. 10251 Parameters *[]RunCommandInputParameter `json:"parameters,omitempty"` 10252 // ProtectedParameters - The parameters used by the script. 10253 ProtectedParameters *[]RunCommandInputParameter `json:"protectedParameters,omitempty"` 10254 // AsyncExecution - Optional. If set to true, provisioning will complete as soon as the script starts and will not wait for script to complete. 10255 AsyncExecution *bool `json:"asyncExecution,omitempty"` 10256 // RunAsUser - Specifies the user account on the VM when executing the run command. 10257 RunAsUser *string `json:"runAsUser,omitempty"` 10258 // RunAsPassword - Specifies the user account password on the VM when executing the run command. 10259 RunAsPassword *string `json:"runAsPassword,omitempty"` 10260 // TimeoutInSeconds - The timeout in seconds to execute the run command. 10261 TimeoutInSeconds *int32 `json:"timeoutInSeconds,omitempty"` 10262 // OutputBlobURI - Specifies the Azure storage blob where script output stream will be uploaded. 10263 OutputBlobURI *string `json:"outputBlobUri,omitempty"` 10264 // ErrorBlobURI - Specifies the Azure storage blob where script error stream will be uploaded. 10265 ErrorBlobURI *string `json:"errorBlobUri,omitempty"` 10266 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 10267 ProvisioningState *string `json:"provisioningState,omitempty"` 10268 // InstanceView - READ-ONLY; The virtual machine run command instance view. 10269 InstanceView *VirtualMachineRunCommandInstanceView `json:"instanceView,omitempty"` 10270} 10271 10272// MarshalJSON is the custom marshaler for VirtualMachineRunCommandProperties. 10273func (vmrcp VirtualMachineRunCommandProperties) MarshalJSON() ([]byte, error) { 10274 objectMap := make(map[string]interface{}) 10275 if vmrcp.Source != nil { 10276 objectMap["source"] = vmrcp.Source 10277 } 10278 if vmrcp.Parameters != nil { 10279 objectMap["parameters"] = vmrcp.Parameters 10280 } 10281 if vmrcp.ProtectedParameters != nil { 10282 objectMap["protectedParameters"] = vmrcp.ProtectedParameters 10283 } 10284 if vmrcp.AsyncExecution != nil { 10285 objectMap["asyncExecution"] = vmrcp.AsyncExecution 10286 } 10287 if vmrcp.RunAsUser != nil { 10288 objectMap["runAsUser"] = vmrcp.RunAsUser 10289 } 10290 if vmrcp.RunAsPassword != nil { 10291 objectMap["runAsPassword"] = vmrcp.RunAsPassword 10292 } 10293 if vmrcp.TimeoutInSeconds != nil { 10294 objectMap["timeoutInSeconds"] = vmrcp.TimeoutInSeconds 10295 } 10296 if vmrcp.OutputBlobURI != nil { 10297 objectMap["outputBlobUri"] = vmrcp.OutputBlobURI 10298 } 10299 if vmrcp.ErrorBlobURI != nil { 10300 objectMap["errorBlobUri"] = vmrcp.ErrorBlobURI 10301 } 10302 return json.Marshal(objectMap) 10303} 10304 10305// VirtualMachineRunCommandsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results 10306// of a long-running operation. 10307type VirtualMachineRunCommandsCreateOrUpdateFuture struct { 10308 azure.FutureAPI 10309 // Result returns the result of the asynchronous operation. 10310 // If the operation has not completed it will return an error. 10311 Result func(VirtualMachineRunCommandsClient) (VirtualMachineRunCommand, error) 10312} 10313 10314// VirtualMachineRunCommandScriptSource describes the script sources for run command. 10315type VirtualMachineRunCommandScriptSource struct { 10316 // Script - Specifies the script content to be executed on the VM. 10317 Script *string `json:"script,omitempty"` 10318 // ScriptURI - Specifies the script download location. 10319 ScriptURI *string `json:"scriptUri,omitempty"` 10320 // CommandID - Specifies a commandId of predefined built-in script. 10321 CommandID *string `json:"commandId,omitempty"` 10322} 10323 10324// VirtualMachineRunCommandsDeleteFuture an abstraction for monitoring and retrieving the results of a 10325// long-running operation. 10326type VirtualMachineRunCommandsDeleteFuture struct { 10327 azure.FutureAPI 10328 // Result returns the result of the asynchronous operation. 10329 // If the operation has not completed it will return an error. 10330 Result func(VirtualMachineRunCommandsClient) (autorest.Response, error) 10331} 10332 10333// VirtualMachineRunCommandsListResult the List run command operation response 10334type VirtualMachineRunCommandsListResult struct { 10335 autorest.Response `json:"-"` 10336 // Value - The list of run commands 10337 Value *[]VirtualMachineRunCommand `json:"value,omitempty"` 10338 // NextLink - The uri to fetch the next page of run commands. 10339 NextLink *string `json:"nextLink,omitempty"` 10340} 10341 10342// VirtualMachineRunCommandsListResultIterator provides access to a complete listing of 10343// VirtualMachineRunCommand values. 10344type VirtualMachineRunCommandsListResultIterator struct { 10345 i int 10346 page VirtualMachineRunCommandsListResultPage 10347} 10348 10349// NextWithContext advances to the next value. If there was an error making 10350// the request the iterator does not advance and the error is returned. 10351func (iter *VirtualMachineRunCommandsListResultIterator) NextWithContext(ctx context.Context) (err error) { 10352 if tracing.IsEnabled() { 10353 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsListResultIterator.NextWithContext") 10354 defer func() { 10355 sc := -1 10356 if iter.Response().Response.Response != nil { 10357 sc = iter.Response().Response.Response.StatusCode 10358 } 10359 tracing.EndSpan(ctx, sc, err) 10360 }() 10361 } 10362 iter.i++ 10363 if iter.i < len(iter.page.Values()) { 10364 return nil 10365 } 10366 err = iter.page.NextWithContext(ctx) 10367 if err != nil { 10368 iter.i-- 10369 return err 10370 } 10371 iter.i = 0 10372 return nil 10373} 10374 10375// Next advances to the next value. If there was an error making 10376// the request the iterator does not advance and the error is returned. 10377// Deprecated: Use NextWithContext() instead. 10378func (iter *VirtualMachineRunCommandsListResultIterator) Next() error { 10379 return iter.NextWithContext(context.Background()) 10380} 10381 10382// NotDone returns true if the enumeration should be started or is not yet complete. 10383func (iter VirtualMachineRunCommandsListResultIterator) NotDone() bool { 10384 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10385} 10386 10387// Response returns the raw server response from the last page request. 10388func (iter VirtualMachineRunCommandsListResultIterator) Response() VirtualMachineRunCommandsListResult { 10389 return iter.page.Response() 10390} 10391 10392// Value returns the current value or a zero-initialized value if the 10393// iterator has advanced beyond the end of the collection. 10394func (iter VirtualMachineRunCommandsListResultIterator) Value() VirtualMachineRunCommand { 10395 if !iter.page.NotDone() { 10396 return VirtualMachineRunCommand{} 10397 } 10398 return iter.page.Values()[iter.i] 10399} 10400 10401// Creates a new instance of the VirtualMachineRunCommandsListResultIterator type. 10402func NewVirtualMachineRunCommandsListResultIterator(page VirtualMachineRunCommandsListResultPage) VirtualMachineRunCommandsListResultIterator { 10403 return VirtualMachineRunCommandsListResultIterator{page: page} 10404} 10405 10406// IsEmpty returns true if the ListResult contains no values. 10407func (vmrclr VirtualMachineRunCommandsListResult) IsEmpty() bool { 10408 return vmrclr.Value == nil || len(*vmrclr.Value) == 0 10409} 10410 10411// hasNextLink returns true if the NextLink is not empty. 10412func (vmrclr VirtualMachineRunCommandsListResult) hasNextLink() bool { 10413 return vmrclr.NextLink != nil && len(*vmrclr.NextLink) != 0 10414} 10415 10416// virtualMachineRunCommandsListResultPreparer prepares a request to retrieve the next set of results. 10417// It returns nil if no more results exist. 10418func (vmrclr VirtualMachineRunCommandsListResult) virtualMachineRunCommandsListResultPreparer(ctx context.Context) (*http.Request, error) { 10419 if !vmrclr.hasNextLink() { 10420 return nil, nil 10421 } 10422 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10423 autorest.AsJSON(), 10424 autorest.AsGet(), 10425 autorest.WithBaseURL(to.String(vmrclr.NextLink))) 10426} 10427 10428// VirtualMachineRunCommandsListResultPage contains a page of VirtualMachineRunCommand values. 10429type VirtualMachineRunCommandsListResultPage struct { 10430 fn func(context.Context, VirtualMachineRunCommandsListResult) (VirtualMachineRunCommandsListResult, error) 10431 vmrclr VirtualMachineRunCommandsListResult 10432} 10433 10434// NextWithContext advances to the next page of values. If there was an error making 10435// the request the page does not advance and the error is returned. 10436func (page *VirtualMachineRunCommandsListResultPage) NextWithContext(ctx context.Context) (err error) { 10437 if tracing.IsEnabled() { 10438 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsListResultPage.NextWithContext") 10439 defer func() { 10440 sc := -1 10441 if page.Response().Response.Response != nil { 10442 sc = page.Response().Response.Response.StatusCode 10443 } 10444 tracing.EndSpan(ctx, sc, err) 10445 }() 10446 } 10447 for { 10448 next, err := page.fn(ctx, page.vmrclr) 10449 if err != nil { 10450 return err 10451 } 10452 page.vmrclr = next 10453 if !next.hasNextLink() || !next.IsEmpty() { 10454 break 10455 } 10456 } 10457 return nil 10458} 10459 10460// Next advances to the next page of values. If there was an error making 10461// the request the page does not advance and the error is returned. 10462// Deprecated: Use NextWithContext() instead. 10463func (page *VirtualMachineRunCommandsListResultPage) Next() error { 10464 return page.NextWithContext(context.Background()) 10465} 10466 10467// NotDone returns true if the page enumeration should be started or is not yet complete. 10468func (page VirtualMachineRunCommandsListResultPage) NotDone() bool { 10469 return !page.vmrclr.IsEmpty() 10470} 10471 10472// Response returns the raw server response from the last page request. 10473func (page VirtualMachineRunCommandsListResultPage) Response() VirtualMachineRunCommandsListResult { 10474 return page.vmrclr 10475} 10476 10477// Values returns the slice of values for the current page or nil if there are no values. 10478func (page VirtualMachineRunCommandsListResultPage) Values() []VirtualMachineRunCommand { 10479 if page.vmrclr.IsEmpty() { 10480 return nil 10481 } 10482 return *page.vmrclr.Value 10483} 10484 10485// Creates a new instance of the VirtualMachineRunCommandsListResultPage type. 10486func NewVirtualMachineRunCommandsListResultPage(cur VirtualMachineRunCommandsListResult, getNextPage func(context.Context, VirtualMachineRunCommandsListResult) (VirtualMachineRunCommandsListResult, error)) VirtualMachineRunCommandsListResultPage { 10487 return VirtualMachineRunCommandsListResultPage{ 10488 fn: getNextPage, 10489 vmrclr: cur, 10490 } 10491} 10492 10493// VirtualMachineRunCommandsUpdateFuture an abstraction for monitoring and retrieving the results of a 10494// long-running operation. 10495type VirtualMachineRunCommandsUpdateFuture struct { 10496 azure.FutureAPI 10497 // Result returns the result of the asynchronous operation. 10498 // If the operation has not completed it will return an error. 10499 Result func(VirtualMachineRunCommandsClient) (VirtualMachineRunCommand, error) 10500} 10501 10502// VirtualMachineRunCommandUpdate describes a Virtual Machine run command. 10503type VirtualMachineRunCommandUpdate struct { 10504 *VirtualMachineRunCommandProperties `json:"properties,omitempty"` 10505 // Tags - Resource tags 10506 Tags map[string]*string `json:"tags"` 10507} 10508 10509// MarshalJSON is the custom marshaler for VirtualMachineRunCommandUpdate. 10510func (vmrcu VirtualMachineRunCommandUpdate) MarshalJSON() ([]byte, error) { 10511 objectMap := make(map[string]interface{}) 10512 if vmrcu.VirtualMachineRunCommandProperties != nil { 10513 objectMap["properties"] = vmrcu.VirtualMachineRunCommandProperties 10514 } 10515 if vmrcu.Tags != nil { 10516 objectMap["tags"] = vmrcu.Tags 10517 } 10518 return json.Marshal(objectMap) 10519} 10520 10521// UnmarshalJSON is the custom unmarshaler for VirtualMachineRunCommandUpdate struct. 10522func (vmrcu *VirtualMachineRunCommandUpdate) UnmarshalJSON(body []byte) error { 10523 var m map[string]*json.RawMessage 10524 err := json.Unmarshal(body, &m) 10525 if err != nil { 10526 return err 10527 } 10528 for k, v := range m { 10529 switch k { 10530 case "properties": 10531 if v != nil { 10532 var virtualMachineRunCommandProperties VirtualMachineRunCommandProperties 10533 err = json.Unmarshal(*v, &virtualMachineRunCommandProperties) 10534 if err != nil { 10535 return err 10536 } 10537 vmrcu.VirtualMachineRunCommandProperties = &virtualMachineRunCommandProperties 10538 } 10539 case "tags": 10540 if v != nil { 10541 var tags map[string]*string 10542 err = json.Unmarshal(*v, &tags) 10543 if err != nil { 10544 return err 10545 } 10546 vmrcu.Tags = tags 10547 } 10548 } 10549 } 10550 10551 return nil 10552} 10553 10554// VirtualMachinesAssessPatchesFuture an abstraction for monitoring and retrieving the results of a 10555// long-running operation. 10556type VirtualMachinesAssessPatchesFuture struct { 10557 azure.FutureAPI 10558 // Result returns the result of the asynchronous operation. 10559 // If the operation has not completed it will return an error. 10560 Result func(VirtualMachinesClient) (VirtualMachineAssessPatchesResult, error) 10561} 10562 10563// VirtualMachineScaleSet describes a Virtual Machine Scale Set. 10564type VirtualMachineScaleSet struct { 10565 autorest.Response `json:"-"` 10566 // Sku - The virtual machine scale set sku. 10567 Sku *Sku `json:"sku,omitempty"` 10568 // 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**. 10569 Plan *Plan `json:"plan,omitempty"` 10570 *VirtualMachineScaleSetProperties `json:"properties,omitempty"` 10571 // Identity - The identity of the virtual machine scale set, if configured. 10572 Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"` 10573 // Zones - The virtual machine scale set zones. NOTE: Availability zones can only be set when you create the scale set 10574 Zones *[]string `json:"zones,omitempty"` 10575 // ID - READ-ONLY; Resource Id 10576 ID *string `json:"id,omitempty"` 10577 // Name - READ-ONLY; Resource name 10578 Name *string `json:"name,omitempty"` 10579 // Type - READ-ONLY; Resource type 10580 Type *string `json:"type,omitempty"` 10581 // Location - Resource location 10582 Location *string `json:"location,omitempty"` 10583 // Tags - Resource tags 10584 Tags map[string]*string `json:"tags"` 10585} 10586 10587// MarshalJSON is the custom marshaler for VirtualMachineScaleSet. 10588func (vmss VirtualMachineScaleSet) MarshalJSON() ([]byte, error) { 10589 objectMap := make(map[string]interface{}) 10590 if vmss.Sku != nil { 10591 objectMap["sku"] = vmss.Sku 10592 } 10593 if vmss.Plan != nil { 10594 objectMap["plan"] = vmss.Plan 10595 } 10596 if vmss.VirtualMachineScaleSetProperties != nil { 10597 objectMap["properties"] = vmss.VirtualMachineScaleSetProperties 10598 } 10599 if vmss.Identity != nil { 10600 objectMap["identity"] = vmss.Identity 10601 } 10602 if vmss.Zones != nil { 10603 objectMap["zones"] = vmss.Zones 10604 } 10605 if vmss.Location != nil { 10606 objectMap["location"] = vmss.Location 10607 } 10608 if vmss.Tags != nil { 10609 objectMap["tags"] = vmss.Tags 10610 } 10611 return json.Marshal(objectMap) 10612} 10613 10614// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSet struct. 10615func (vmss *VirtualMachineScaleSet) UnmarshalJSON(body []byte) error { 10616 var m map[string]*json.RawMessage 10617 err := json.Unmarshal(body, &m) 10618 if err != nil { 10619 return err 10620 } 10621 for k, v := range m { 10622 switch k { 10623 case "sku": 10624 if v != nil { 10625 var sku Sku 10626 err = json.Unmarshal(*v, &sku) 10627 if err != nil { 10628 return err 10629 } 10630 vmss.Sku = &sku 10631 } 10632 case "plan": 10633 if v != nil { 10634 var plan Plan 10635 err = json.Unmarshal(*v, &plan) 10636 if err != nil { 10637 return err 10638 } 10639 vmss.Plan = &plan 10640 } 10641 case "properties": 10642 if v != nil { 10643 var virtualMachineScaleSetProperties VirtualMachineScaleSetProperties 10644 err = json.Unmarshal(*v, &virtualMachineScaleSetProperties) 10645 if err != nil { 10646 return err 10647 } 10648 vmss.VirtualMachineScaleSetProperties = &virtualMachineScaleSetProperties 10649 } 10650 case "identity": 10651 if v != nil { 10652 var identity VirtualMachineScaleSetIdentity 10653 err = json.Unmarshal(*v, &identity) 10654 if err != nil { 10655 return err 10656 } 10657 vmss.Identity = &identity 10658 } 10659 case "zones": 10660 if v != nil { 10661 var zones []string 10662 err = json.Unmarshal(*v, &zones) 10663 if err != nil { 10664 return err 10665 } 10666 vmss.Zones = &zones 10667 } 10668 case "id": 10669 if v != nil { 10670 var ID string 10671 err = json.Unmarshal(*v, &ID) 10672 if err != nil { 10673 return err 10674 } 10675 vmss.ID = &ID 10676 } 10677 case "name": 10678 if v != nil { 10679 var name string 10680 err = json.Unmarshal(*v, &name) 10681 if err != nil { 10682 return err 10683 } 10684 vmss.Name = &name 10685 } 10686 case "type": 10687 if v != nil { 10688 var typeVar string 10689 err = json.Unmarshal(*v, &typeVar) 10690 if err != nil { 10691 return err 10692 } 10693 vmss.Type = &typeVar 10694 } 10695 case "location": 10696 if v != nil { 10697 var location string 10698 err = json.Unmarshal(*v, &location) 10699 if err != nil { 10700 return err 10701 } 10702 vmss.Location = &location 10703 } 10704 case "tags": 10705 if v != nil { 10706 var tags map[string]*string 10707 err = json.Unmarshal(*v, &tags) 10708 if err != nil { 10709 return err 10710 } 10711 vmss.Tags = tags 10712 } 10713 } 10714 } 10715 10716 return nil 10717} 10718 10719// VirtualMachineScaleSetDataDisk describes a virtual machine scale set data disk. 10720type VirtualMachineScaleSetDataDisk struct { 10721 // Name - The disk name. 10722 Name *string `json:"name,omitempty"` 10723 // 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. 10724 Lun *int32 `json:"lun,omitempty"` 10725 // 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' 10726 Caching CachingTypes `json:"caching,omitempty"` 10727 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 10728 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 10729 // CreateOption - The create option. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' 10730 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 10731 // 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 10732 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 10733 // ManagedDisk - The managed disk parameters. 10734 ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` 10735 // 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. 10736 DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` 10737 // 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. 10738 DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` 10739} 10740 10741// VirtualMachineScaleSetExtension describes a Virtual Machine Scale Set Extension. 10742type VirtualMachineScaleSetExtension struct { 10743 autorest.Response `json:"-"` 10744 // Name - The name of the extension. 10745 Name *string `json:"name,omitempty"` 10746 // Type - READ-ONLY; Resource type 10747 Type *string `json:"type,omitempty"` 10748 *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"` 10749 // ID - READ-ONLY; Resource Id 10750 ID *string `json:"id,omitempty"` 10751} 10752 10753// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtension. 10754func (vmsse VirtualMachineScaleSetExtension) MarshalJSON() ([]byte, error) { 10755 objectMap := make(map[string]interface{}) 10756 if vmsse.Name != nil { 10757 objectMap["name"] = vmsse.Name 10758 } 10759 if vmsse.VirtualMachineScaleSetExtensionProperties != nil { 10760 objectMap["properties"] = vmsse.VirtualMachineScaleSetExtensionProperties 10761 } 10762 return json.Marshal(objectMap) 10763} 10764 10765// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetExtension struct. 10766func (vmsse *VirtualMachineScaleSetExtension) UnmarshalJSON(body []byte) error { 10767 var m map[string]*json.RawMessage 10768 err := json.Unmarshal(body, &m) 10769 if err != nil { 10770 return err 10771 } 10772 for k, v := range m { 10773 switch k { 10774 case "name": 10775 if v != nil { 10776 var name string 10777 err = json.Unmarshal(*v, &name) 10778 if err != nil { 10779 return err 10780 } 10781 vmsse.Name = &name 10782 } 10783 case "type": 10784 if v != nil { 10785 var typeVar string 10786 err = json.Unmarshal(*v, &typeVar) 10787 if err != nil { 10788 return err 10789 } 10790 vmsse.Type = &typeVar 10791 } 10792 case "properties": 10793 if v != nil { 10794 var virtualMachineScaleSetExtensionProperties VirtualMachineScaleSetExtensionProperties 10795 err = json.Unmarshal(*v, &virtualMachineScaleSetExtensionProperties) 10796 if err != nil { 10797 return err 10798 } 10799 vmsse.VirtualMachineScaleSetExtensionProperties = &virtualMachineScaleSetExtensionProperties 10800 } 10801 case "id": 10802 if v != nil { 10803 var ID string 10804 err = json.Unmarshal(*v, &ID) 10805 if err != nil { 10806 return err 10807 } 10808 vmsse.ID = &ID 10809 } 10810 } 10811 } 10812 10813 return nil 10814} 10815 10816// VirtualMachineScaleSetExtensionListResult the List VM scale set extension operation response. 10817type VirtualMachineScaleSetExtensionListResult struct { 10818 autorest.Response `json:"-"` 10819 // Value - The list of VM scale set extensions. 10820 Value *[]VirtualMachineScaleSetExtension `json:"value,omitempty"` 10821 // 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. 10822 NextLink *string `json:"nextLink,omitempty"` 10823} 10824 10825// VirtualMachineScaleSetExtensionListResultIterator provides access to a complete listing of 10826// VirtualMachineScaleSetExtension values. 10827type VirtualMachineScaleSetExtensionListResultIterator struct { 10828 i int 10829 page VirtualMachineScaleSetExtensionListResultPage 10830} 10831 10832// NextWithContext advances to the next value. If there was an error making 10833// the request the iterator does not advance and the error is returned. 10834func (iter *VirtualMachineScaleSetExtensionListResultIterator) NextWithContext(ctx context.Context) (err error) { 10835 if tracing.IsEnabled() { 10836 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionListResultIterator.NextWithContext") 10837 defer func() { 10838 sc := -1 10839 if iter.Response().Response.Response != nil { 10840 sc = iter.Response().Response.Response.StatusCode 10841 } 10842 tracing.EndSpan(ctx, sc, err) 10843 }() 10844 } 10845 iter.i++ 10846 if iter.i < len(iter.page.Values()) { 10847 return nil 10848 } 10849 err = iter.page.NextWithContext(ctx) 10850 if err != nil { 10851 iter.i-- 10852 return err 10853 } 10854 iter.i = 0 10855 return nil 10856} 10857 10858// Next advances to the next value. If there was an error making 10859// the request the iterator does not advance and the error is returned. 10860// Deprecated: Use NextWithContext() instead. 10861func (iter *VirtualMachineScaleSetExtensionListResultIterator) Next() error { 10862 return iter.NextWithContext(context.Background()) 10863} 10864 10865// NotDone returns true if the enumeration should be started or is not yet complete. 10866func (iter VirtualMachineScaleSetExtensionListResultIterator) NotDone() bool { 10867 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10868} 10869 10870// Response returns the raw server response from the last page request. 10871func (iter VirtualMachineScaleSetExtensionListResultIterator) Response() VirtualMachineScaleSetExtensionListResult { 10872 return iter.page.Response() 10873} 10874 10875// Value returns the current value or a zero-initialized value if the 10876// iterator has advanced beyond the end of the collection. 10877func (iter VirtualMachineScaleSetExtensionListResultIterator) Value() VirtualMachineScaleSetExtension { 10878 if !iter.page.NotDone() { 10879 return VirtualMachineScaleSetExtension{} 10880 } 10881 return iter.page.Values()[iter.i] 10882} 10883 10884// Creates a new instance of the VirtualMachineScaleSetExtensionListResultIterator type. 10885func NewVirtualMachineScaleSetExtensionListResultIterator(page VirtualMachineScaleSetExtensionListResultPage) VirtualMachineScaleSetExtensionListResultIterator { 10886 return VirtualMachineScaleSetExtensionListResultIterator{page: page} 10887} 10888 10889// IsEmpty returns true if the ListResult contains no values. 10890func (vmsselr VirtualMachineScaleSetExtensionListResult) IsEmpty() bool { 10891 return vmsselr.Value == nil || len(*vmsselr.Value) == 0 10892} 10893 10894// hasNextLink returns true if the NextLink is not empty. 10895func (vmsselr VirtualMachineScaleSetExtensionListResult) hasNextLink() bool { 10896 return vmsselr.NextLink != nil && len(*vmsselr.NextLink) != 0 10897} 10898 10899// virtualMachineScaleSetExtensionListResultPreparer prepares a request to retrieve the next set of results. 10900// It returns nil if no more results exist. 10901func (vmsselr VirtualMachineScaleSetExtensionListResult) virtualMachineScaleSetExtensionListResultPreparer(ctx context.Context) (*http.Request, error) { 10902 if !vmsselr.hasNextLink() { 10903 return nil, nil 10904 } 10905 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10906 autorest.AsJSON(), 10907 autorest.AsGet(), 10908 autorest.WithBaseURL(to.String(vmsselr.NextLink))) 10909} 10910 10911// VirtualMachineScaleSetExtensionListResultPage contains a page of VirtualMachineScaleSetExtension values. 10912type VirtualMachineScaleSetExtensionListResultPage struct { 10913 fn func(context.Context, VirtualMachineScaleSetExtensionListResult) (VirtualMachineScaleSetExtensionListResult, error) 10914 vmsselr VirtualMachineScaleSetExtensionListResult 10915} 10916 10917// NextWithContext advances to the next page of values. If there was an error making 10918// the request the page does not advance and the error is returned. 10919func (page *VirtualMachineScaleSetExtensionListResultPage) NextWithContext(ctx context.Context) (err error) { 10920 if tracing.IsEnabled() { 10921 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionListResultPage.NextWithContext") 10922 defer func() { 10923 sc := -1 10924 if page.Response().Response.Response != nil { 10925 sc = page.Response().Response.Response.StatusCode 10926 } 10927 tracing.EndSpan(ctx, sc, err) 10928 }() 10929 } 10930 for { 10931 next, err := page.fn(ctx, page.vmsselr) 10932 if err != nil { 10933 return err 10934 } 10935 page.vmsselr = next 10936 if !next.hasNextLink() || !next.IsEmpty() { 10937 break 10938 } 10939 } 10940 return nil 10941} 10942 10943// Next advances to the next page of values. If there was an error making 10944// the request the page does not advance and the error is returned. 10945// Deprecated: Use NextWithContext() instead. 10946func (page *VirtualMachineScaleSetExtensionListResultPage) Next() error { 10947 return page.NextWithContext(context.Background()) 10948} 10949 10950// NotDone returns true if the page enumeration should be started or is not yet complete. 10951func (page VirtualMachineScaleSetExtensionListResultPage) NotDone() bool { 10952 return !page.vmsselr.IsEmpty() 10953} 10954 10955// Response returns the raw server response from the last page request. 10956func (page VirtualMachineScaleSetExtensionListResultPage) Response() VirtualMachineScaleSetExtensionListResult { 10957 return page.vmsselr 10958} 10959 10960// Values returns the slice of values for the current page or nil if there are no values. 10961func (page VirtualMachineScaleSetExtensionListResultPage) Values() []VirtualMachineScaleSetExtension { 10962 if page.vmsselr.IsEmpty() { 10963 return nil 10964 } 10965 return *page.vmsselr.Value 10966} 10967 10968// Creates a new instance of the VirtualMachineScaleSetExtensionListResultPage type. 10969func NewVirtualMachineScaleSetExtensionListResultPage(cur VirtualMachineScaleSetExtensionListResult, getNextPage func(context.Context, VirtualMachineScaleSetExtensionListResult) (VirtualMachineScaleSetExtensionListResult, error)) VirtualMachineScaleSetExtensionListResultPage { 10970 return VirtualMachineScaleSetExtensionListResultPage{ 10971 fn: getNextPage, 10972 vmsselr: cur, 10973 } 10974} 10975 10976// VirtualMachineScaleSetExtensionProfile describes a virtual machine scale set extension profile. 10977type VirtualMachineScaleSetExtensionProfile struct { 10978 // Extensions - The virtual machine scale set child extension resources. 10979 Extensions *[]VirtualMachineScaleSetExtension `json:"extensions,omitempty"` 10980 // ExtensionsTimeBudget - Specifies the time alloted for all extensions to start. The time duration should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. The default value is 90 minutes (PT1H30M). <br><br> Minimum api-version: 2020-06-01 10981 ExtensionsTimeBudget *string `json:"extensionsTimeBudget,omitempty"` 10982} 10983 10984// VirtualMachineScaleSetExtensionProperties describes the properties of a Virtual Machine Scale Set 10985// Extension. 10986type VirtualMachineScaleSetExtensionProperties struct { 10987 // 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. 10988 ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` 10989 // Publisher - The name of the extension handler publisher. 10990 Publisher *string `json:"publisher,omitempty"` 10991 // Type - Specifies the type of the extension; an example is "CustomScriptExtension". 10992 Type *string `json:"type,omitempty"` 10993 // TypeHandlerVersion - Specifies the version of the script handler. 10994 TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` 10995 // 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. 10996 AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` 10997 // EnableAutomaticUpgrade - Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. 10998 EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` 10999 // Settings - Json formatted public settings for the extension. 11000 Settings interface{} `json:"settings,omitempty"` 11001 // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. 11002 ProtectedSettings interface{} `json:"protectedSettings,omitempty"` 11003 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 11004 ProvisioningState *string `json:"provisioningState,omitempty"` 11005 // ProvisionAfterExtensions - Collection of extension names after which this extension needs to be provisioned. 11006 ProvisionAfterExtensions *[]string `json:"provisionAfterExtensions,omitempty"` 11007} 11008 11009// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtensionProperties. 11010func (vmssep VirtualMachineScaleSetExtensionProperties) MarshalJSON() ([]byte, error) { 11011 objectMap := make(map[string]interface{}) 11012 if vmssep.ForceUpdateTag != nil { 11013 objectMap["forceUpdateTag"] = vmssep.ForceUpdateTag 11014 } 11015 if vmssep.Publisher != nil { 11016 objectMap["publisher"] = vmssep.Publisher 11017 } 11018 if vmssep.Type != nil { 11019 objectMap["type"] = vmssep.Type 11020 } 11021 if vmssep.TypeHandlerVersion != nil { 11022 objectMap["typeHandlerVersion"] = vmssep.TypeHandlerVersion 11023 } 11024 if vmssep.AutoUpgradeMinorVersion != nil { 11025 objectMap["autoUpgradeMinorVersion"] = vmssep.AutoUpgradeMinorVersion 11026 } 11027 if vmssep.EnableAutomaticUpgrade != nil { 11028 objectMap["enableAutomaticUpgrade"] = vmssep.EnableAutomaticUpgrade 11029 } 11030 if vmssep.Settings != nil { 11031 objectMap["settings"] = vmssep.Settings 11032 } 11033 if vmssep.ProtectedSettings != nil { 11034 objectMap["protectedSettings"] = vmssep.ProtectedSettings 11035 } 11036 if vmssep.ProvisionAfterExtensions != nil { 11037 objectMap["provisionAfterExtensions"] = vmssep.ProvisionAfterExtensions 11038 } 11039 return json.Marshal(objectMap) 11040} 11041 11042// VirtualMachineScaleSetExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the 11043// results of a long-running operation. 11044type VirtualMachineScaleSetExtensionsCreateOrUpdateFuture struct { 11045 azure.FutureAPI 11046 // Result returns the result of the asynchronous operation. 11047 // If the operation has not completed it will return an error. 11048 Result func(VirtualMachineScaleSetExtensionsClient) (VirtualMachineScaleSetExtension, error) 11049} 11050 11051// VirtualMachineScaleSetExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of 11052// a long-running operation. 11053type VirtualMachineScaleSetExtensionsDeleteFuture struct { 11054 azure.FutureAPI 11055 // Result returns the result of the asynchronous operation. 11056 // If the operation has not completed it will return an error. 11057 Result func(VirtualMachineScaleSetExtensionsClient) (autorest.Response, error) 11058} 11059 11060// VirtualMachineScaleSetExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of 11061// a long-running operation. 11062type VirtualMachineScaleSetExtensionsUpdateFuture struct { 11063 azure.FutureAPI 11064 // Result returns the result of the asynchronous operation. 11065 // If the operation has not completed it will return an error. 11066 Result func(VirtualMachineScaleSetExtensionsClient) (VirtualMachineScaleSetExtension, error) 11067} 11068 11069// VirtualMachineScaleSetExtensionUpdate describes a Virtual Machine Scale Set Extension. 11070type VirtualMachineScaleSetExtensionUpdate struct { 11071 // Name - READ-ONLY; The name of the extension. 11072 Name *string `json:"name,omitempty"` 11073 // Type - READ-ONLY; Resource type 11074 Type *string `json:"type,omitempty"` 11075 *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"` 11076 // ID - READ-ONLY; Resource Id 11077 ID *string `json:"id,omitempty"` 11078} 11079 11080// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtensionUpdate. 11081func (vmsseu VirtualMachineScaleSetExtensionUpdate) MarshalJSON() ([]byte, error) { 11082 objectMap := make(map[string]interface{}) 11083 if vmsseu.VirtualMachineScaleSetExtensionProperties != nil { 11084 objectMap["properties"] = vmsseu.VirtualMachineScaleSetExtensionProperties 11085 } 11086 return json.Marshal(objectMap) 11087} 11088 11089// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetExtensionUpdate struct. 11090func (vmsseu *VirtualMachineScaleSetExtensionUpdate) UnmarshalJSON(body []byte) error { 11091 var m map[string]*json.RawMessage 11092 err := json.Unmarshal(body, &m) 11093 if err != nil { 11094 return err 11095 } 11096 for k, v := range m { 11097 switch k { 11098 case "name": 11099 if v != nil { 11100 var name string 11101 err = json.Unmarshal(*v, &name) 11102 if err != nil { 11103 return err 11104 } 11105 vmsseu.Name = &name 11106 } 11107 case "type": 11108 if v != nil { 11109 var typeVar string 11110 err = json.Unmarshal(*v, &typeVar) 11111 if err != nil { 11112 return err 11113 } 11114 vmsseu.Type = &typeVar 11115 } 11116 case "properties": 11117 if v != nil { 11118 var virtualMachineScaleSetExtensionProperties VirtualMachineScaleSetExtensionProperties 11119 err = json.Unmarshal(*v, &virtualMachineScaleSetExtensionProperties) 11120 if err != nil { 11121 return err 11122 } 11123 vmsseu.VirtualMachineScaleSetExtensionProperties = &virtualMachineScaleSetExtensionProperties 11124 } 11125 case "id": 11126 if v != nil { 11127 var ID string 11128 err = json.Unmarshal(*v, &ID) 11129 if err != nil { 11130 return err 11131 } 11132 vmsseu.ID = &ID 11133 } 11134 } 11135 } 11136 11137 return nil 11138} 11139 11140// VirtualMachineScaleSetIdentity identity for the virtual machine scale set. 11141type VirtualMachineScaleSetIdentity struct { 11142 // PrincipalID - READ-ONLY; The principal id of virtual machine scale set identity. This property will only be provided for a system assigned identity. 11143 PrincipalID *string `json:"principalId,omitempty"` 11144 // TenantID - READ-ONLY; The tenant id associated with the virtual machine scale set. This property will only be provided for a system assigned identity. 11145 TenantID *string `json:"tenantId,omitempty"` 11146 // 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' 11147 Type ResourceIdentityType `json:"type,omitempty"` 11148 // 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}'. 11149 UserAssignedIdentities map[string]*VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` 11150} 11151 11152// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIdentity. 11153func (vmssi VirtualMachineScaleSetIdentity) MarshalJSON() ([]byte, error) { 11154 objectMap := make(map[string]interface{}) 11155 if vmssi.Type != "" { 11156 objectMap["type"] = vmssi.Type 11157 } 11158 if vmssi.UserAssignedIdentities != nil { 11159 objectMap["userAssignedIdentities"] = vmssi.UserAssignedIdentities 11160 } 11161 return json.Marshal(objectMap) 11162} 11163 11164// VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue ... 11165type VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue struct { 11166 // PrincipalID - READ-ONLY; The principal id of user assigned identity. 11167 PrincipalID *string `json:"principalId,omitempty"` 11168 // ClientID - READ-ONLY; The client id of user assigned identity. 11169 ClientID *string `json:"clientId,omitempty"` 11170} 11171 11172// VirtualMachineScaleSetInstanceView the instance view of a virtual machine scale set. 11173type VirtualMachineScaleSetInstanceView struct { 11174 autorest.Response `json:"-"` 11175 // VirtualMachine - READ-ONLY; The instance view status summary for the virtual machine scale set. 11176 VirtualMachine *VirtualMachineScaleSetInstanceViewStatusesSummary `json:"virtualMachine,omitempty"` 11177 // Extensions - READ-ONLY; The extensions information. 11178 Extensions *[]VirtualMachineScaleSetVMExtensionsSummary `json:"extensions,omitempty"` 11179 // Statuses - The resource status information. 11180 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 11181 // OrchestrationServices - READ-ONLY; The orchestration services information. 11182 OrchestrationServices *[]OrchestrationServiceSummary `json:"orchestrationServices,omitempty"` 11183} 11184 11185// MarshalJSON is the custom marshaler for VirtualMachineScaleSetInstanceView. 11186func (vmssiv VirtualMachineScaleSetInstanceView) MarshalJSON() ([]byte, error) { 11187 objectMap := make(map[string]interface{}) 11188 if vmssiv.Statuses != nil { 11189 objectMap["statuses"] = vmssiv.Statuses 11190 } 11191 return json.Marshal(objectMap) 11192} 11193 11194// VirtualMachineScaleSetInstanceViewStatusesSummary instance view statuses summary for virtual machines of 11195// a virtual machine scale set. 11196type VirtualMachineScaleSetInstanceViewStatusesSummary struct { 11197 // StatusesSummary - READ-ONLY; The extensions information. 11198 StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` 11199} 11200 11201// VirtualMachineScaleSetIPConfiguration describes a virtual machine scale set network profile's IP 11202// configuration. 11203type VirtualMachineScaleSetIPConfiguration struct { 11204 // Name - The IP configuration name. 11205 Name *string `json:"name,omitempty"` 11206 *VirtualMachineScaleSetIPConfigurationProperties `json:"properties,omitempty"` 11207 // ID - Resource Id 11208 ID *string `json:"id,omitempty"` 11209} 11210 11211// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIPConfiguration. 11212func (vmssic VirtualMachineScaleSetIPConfiguration) MarshalJSON() ([]byte, error) { 11213 objectMap := make(map[string]interface{}) 11214 if vmssic.Name != nil { 11215 objectMap["name"] = vmssic.Name 11216 } 11217 if vmssic.VirtualMachineScaleSetIPConfigurationProperties != nil { 11218 objectMap["properties"] = vmssic.VirtualMachineScaleSetIPConfigurationProperties 11219 } 11220 if vmssic.ID != nil { 11221 objectMap["id"] = vmssic.ID 11222 } 11223 return json.Marshal(objectMap) 11224} 11225 11226// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetIPConfiguration struct. 11227func (vmssic *VirtualMachineScaleSetIPConfiguration) UnmarshalJSON(body []byte) error { 11228 var m map[string]*json.RawMessage 11229 err := json.Unmarshal(body, &m) 11230 if err != nil { 11231 return err 11232 } 11233 for k, v := range m { 11234 switch k { 11235 case "name": 11236 if v != nil { 11237 var name string 11238 err = json.Unmarshal(*v, &name) 11239 if err != nil { 11240 return err 11241 } 11242 vmssic.Name = &name 11243 } 11244 case "properties": 11245 if v != nil { 11246 var virtualMachineScaleSetIPConfigurationProperties VirtualMachineScaleSetIPConfigurationProperties 11247 err = json.Unmarshal(*v, &virtualMachineScaleSetIPConfigurationProperties) 11248 if err != nil { 11249 return err 11250 } 11251 vmssic.VirtualMachineScaleSetIPConfigurationProperties = &virtualMachineScaleSetIPConfigurationProperties 11252 } 11253 case "id": 11254 if v != nil { 11255 var ID string 11256 err = json.Unmarshal(*v, &ID) 11257 if err != nil { 11258 return err 11259 } 11260 vmssic.ID = &ID 11261 } 11262 } 11263 } 11264 11265 return nil 11266} 11267 11268// VirtualMachineScaleSetIPConfigurationProperties describes a virtual machine scale set network profile's 11269// IP configuration properties. 11270type VirtualMachineScaleSetIPConfigurationProperties struct { 11271 // Subnet - Specifies the identifier of the subnet. 11272 Subnet *APIEntityReference `json:"subnet,omitempty"` 11273 // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. 11274 Primary *bool `json:"primary,omitempty"` 11275 // PublicIPAddressConfiguration - The publicIPAddressConfiguration. 11276 PublicIPAddressConfiguration *VirtualMachineScaleSetPublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` 11277 // 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' 11278 PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` 11279 // 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. 11280 ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` 11281 // ApplicationSecurityGroups - Specifies an array of references to application security group. 11282 ApplicationSecurityGroups *[]SubResource `json:"applicationSecurityGroups,omitempty"` 11283 // 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. 11284 LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` 11285 // 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. 11286 LoadBalancerInboundNatPools *[]SubResource `json:"loadBalancerInboundNatPools,omitempty"` 11287} 11288 11289// VirtualMachineScaleSetIPTag contains the IP tag associated with the public IP address. 11290type VirtualMachineScaleSetIPTag struct { 11291 // IPTagType - IP tag type. Example: FirstPartyUsage. 11292 IPTagType *string `json:"ipTagType,omitempty"` 11293 // Tag - IP tag associated with the public IP. Example: SQL, Storage etc. 11294 Tag *string `json:"tag,omitempty"` 11295} 11296 11297// VirtualMachineScaleSetListOSUpgradeHistory list of Virtual Machine Scale Set OS Upgrade History 11298// operation response. 11299type VirtualMachineScaleSetListOSUpgradeHistory struct { 11300 autorest.Response `json:"-"` 11301 // Value - The list of OS upgrades performed on the virtual machine scale set. 11302 Value *[]UpgradeOperationHistoricalStatusInfo `json:"value,omitempty"` 11303 // 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. 11304 NextLink *string `json:"nextLink,omitempty"` 11305} 11306 11307// VirtualMachineScaleSetListOSUpgradeHistoryIterator provides access to a complete listing of 11308// UpgradeOperationHistoricalStatusInfo values. 11309type VirtualMachineScaleSetListOSUpgradeHistoryIterator struct { 11310 i int 11311 page VirtualMachineScaleSetListOSUpgradeHistoryPage 11312} 11313 11314// NextWithContext advances to the next value. If there was an error making 11315// the request the iterator does not advance and the error is returned. 11316func (iter *VirtualMachineScaleSetListOSUpgradeHistoryIterator) NextWithContext(ctx context.Context) (err error) { 11317 if tracing.IsEnabled() { 11318 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListOSUpgradeHistoryIterator.NextWithContext") 11319 defer func() { 11320 sc := -1 11321 if iter.Response().Response.Response != nil { 11322 sc = iter.Response().Response.Response.StatusCode 11323 } 11324 tracing.EndSpan(ctx, sc, err) 11325 }() 11326 } 11327 iter.i++ 11328 if iter.i < len(iter.page.Values()) { 11329 return nil 11330 } 11331 err = iter.page.NextWithContext(ctx) 11332 if err != nil { 11333 iter.i-- 11334 return err 11335 } 11336 iter.i = 0 11337 return nil 11338} 11339 11340// Next advances to the next value. If there was an error making 11341// the request the iterator does not advance and the error is returned. 11342// Deprecated: Use NextWithContext() instead. 11343func (iter *VirtualMachineScaleSetListOSUpgradeHistoryIterator) Next() error { 11344 return iter.NextWithContext(context.Background()) 11345} 11346 11347// NotDone returns true if the enumeration should be started or is not yet complete. 11348func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) NotDone() bool { 11349 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11350} 11351 11352// Response returns the raw server response from the last page request. 11353func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) Response() VirtualMachineScaleSetListOSUpgradeHistory { 11354 return iter.page.Response() 11355} 11356 11357// Value returns the current value or a zero-initialized value if the 11358// iterator has advanced beyond the end of the collection. 11359func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) Value() UpgradeOperationHistoricalStatusInfo { 11360 if !iter.page.NotDone() { 11361 return UpgradeOperationHistoricalStatusInfo{} 11362 } 11363 return iter.page.Values()[iter.i] 11364} 11365 11366// Creates a new instance of the VirtualMachineScaleSetListOSUpgradeHistoryIterator type. 11367func NewVirtualMachineScaleSetListOSUpgradeHistoryIterator(page VirtualMachineScaleSetListOSUpgradeHistoryPage) VirtualMachineScaleSetListOSUpgradeHistoryIterator { 11368 return VirtualMachineScaleSetListOSUpgradeHistoryIterator{page: page} 11369} 11370 11371// IsEmpty returns true if the ListResult contains no values. 11372func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) IsEmpty() bool { 11373 return vmsslouh.Value == nil || len(*vmsslouh.Value) == 0 11374} 11375 11376// hasNextLink returns true if the NextLink is not empty. 11377func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) hasNextLink() bool { 11378 return vmsslouh.NextLink != nil && len(*vmsslouh.NextLink) != 0 11379} 11380 11381// virtualMachineScaleSetListOSUpgradeHistoryPreparer prepares a request to retrieve the next set of results. 11382// It returns nil if no more results exist. 11383func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) virtualMachineScaleSetListOSUpgradeHistoryPreparer(ctx context.Context) (*http.Request, error) { 11384 if !vmsslouh.hasNextLink() { 11385 return nil, nil 11386 } 11387 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11388 autorest.AsJSON(), 11389 autorest.AsGet(), 11390 autorest.WithBaseURL(to.String(vmsslouh.NextLink))) 11391} 11392 11393// VirtualMachineScaleSetListOSUpgradeHistoryPage contains a page of UpgradeOperationHistoricalStatusInfo 11394// values. 11395type VirtualMachineScaleSetListOSUpgradeHistoryPage struct { 11396 fn func(context.Context, VirtualMachineScaleSetListOSUpgradeHistory) (VirtualMachineScaleSetListOSUpgradeHistory, error) 11397 vmsslouh VirtualMachineScaleSetListOSUpgradeHistory 11398} 11399 11400// NextWithContext advances to the next page of values. If there was an error making 11401// the request the page does not advance and the error is returned. 11402func (page *VirtualMachineScaleSetListOSUpgradeHistoryPage) NextWithContext(ctx context.Context) (err error) { 11403 if tracing.IsEnabled() { 11404 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListOSUpgradeHistoryPage.NextWithContext") 11405 defer func() { 11406 sc := -1 11407 if page.Response().Response.Response != nil { 11408 sc = page.Response().Response.Response.StatusCode 11409 } 11410 tracing.EndSpan(ctx, sc, err) 11411 }() 11412 } 11413 for { 11414 next, err := page.fn(ctx, page.vmsslouh) 11415 if err != nil { 11416 return err 11417 } 11418 page.vmsslouh = next 11419 if !next.hasNextLink() || !next.IsEmpty() { 11420 break 11421 } 11422 } 11423 return nil 11424} 11425 11426// Next advances to the next page of values. If there was an error making 11427// the request the page does not advance and the error is returned. 11428// Deprecated: Use NextWithContext() instead. 11429func (page *VirtualMachineScaleSetListOSUpgradeHistoryPage) Next() error { 11430 return page.NextWithContext(context.Background()) 11431} 11432 11433// NotDone returns true if the page enumeration should be started or is not yet complete. 11434func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) NotDone() bool { 11435 return !page.vmsslouh.IsEmpty() 11436} 11437 11438// Response returns the raw server response from the last page request. 11439func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) Response() VirtualMachineScaleSetListOSUpgradeHistory { 11440 return page.vmsslouh 11441} 11442 11443// Values returns the slice of values for the current page or nil if there are no values. 11444func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) Values() []UpgradeOperationHistoricalStatusInfo { 11445 if page.vmsslouh.IsEmpty() { 11446 return nil 11447 } 11448 return *page.vmsslouh.Value 11449} 11450 11451// Creates a new instance of the VirtualMachineScaleSetListOSUpgradeHistoryPage type. 11452func NewVirtualMachineScaleSetListOSUpgradeHistoryPage(cur VirtualMachineScaleSetListOSUpgradeHistory, getNextPage func(context.Context, VirtualMachineScaleSetListOSUpgradeHistory) (VirtualMachineScaleSetListOSUpgradeHistory, error)) VirtualMachineScaleSetListOSUpgradeHistoryPage { 11453 return VirtualMachineScaleSetListOSUpgradeHistoryPage{ 11454 fn: getNextPage, 11455 vmsslouh: cur, 11456 } 11457} 11458 11459// VirtualMachineScaleSetListResult the List Virtual Machine operation response. 11460type VirtualMachineScaleSetListResult struct { 11461 autorest.Response `json:"-"` 11462 // Value - The list of virtual machine scale sets. 11463 Value *[]VirtualMachineScaleSet `json:"value,omitempty"` 11464 // NextLink - The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with this to fetch the next page of VMSS. 11465 NextLink *string `json:"nextLink,omitempty"` 11466} 11467 11468// VirtualMachineScaleSetListResultIterator provides access to a complete listing of VirtualMachineScaleSet 11469// values. 11470type VirtualMachineScaleSetListResultIterator struct { 11471 i int 11472 page VirtualMachineScaleSetListResultPage 11473} 11474 11475// NextWithContext advances to the next value. If there was an error making 11476// the request the iterator does not advance and the error is returned. 11477func (iter *VirtualMachineScaleSetListResultIterator) NextWithContext(ctx context.Context) (err error) { 11478 if tracing.IsEnabled() { 11479 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListResultIterator.NextWithContext") 11480 defer func() { 11481 sc := -1 11482 if iter.Response().Response.Response != nil { 11483 sc = iter.Response().Response.Response.StatusCode 11484 } 11485 tracing.EndSpan(ctx, sc, err) 11486 }() 11487 } 11488 iter.i++ 11489 if iter.i < len(iter.page.Values()) { 11490 return nil 11491 } 11492 err = iter.page.NextWithContext(ctx) 11493 if err != nil { 11494 iter.i-- 11495 return err 11496 } 11497 iter.i = 0 11498 return nil 11499} 11500 11501// Next advances to the next value. If there was an error making 11502// the request the iterator does not advance and the error is returned. 11503// Deprecated: Use NextWithContext() instead. 11504func (iter *VirtualMachineScaleSetListResultIterator) Next() error { 11505 return iter.NextWithContext(context.Background()) 11506} 11507 11508// NotDone returns true if the enumeration should be started or is not yet complete. 11509func (iter VirtualMachineScaleSetListResultIterator) NotDone() bool { 11510 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11511} 11512 11513// Response returns the raw server response from the last page request. 11514func (iter VirtualMachineScaleSetListResultIterator) Response() VirtualMachineScaleSetListResult { 11515 return iter.page.Response() 11516} 11517 11518// Value returns the current value or a zero-initialized value if the 11519// iterator has advanced beyond the end of the collection. 11520func (iter VirtualMachineScaleSetListResultIterator) Value() VirtualMachineScaleSet { 11521 if !iter.page.NotDone() { 11522 return VirtualMachineScaleSet{} 11523 } 11524 return iter.page.Values()[iter.i] 11525} 11526 11527// Creates a new instance of the VirtualMachineScaleSetListResultIterator type. 11528func NewVirtualMachineScaleSetListResultIterator(page VirtualMachineScaleSetListResultPage) VirtualMachineScaleSetListResultIterator { 11529 return VirtualMachineScaleSetListResultIterator{page: page} 11530} 11531 11532// IsEmpty returns true if the ListResult contains no values. 11533func (vmsslr VirtualMachineScaleSetListResult) IsEmpty() bool { 11534 return vmsslr.Value == nil || len(*vmsslr.Value) == 0 11535} 11536 11537// hasNextLink returns true if the NextLink is not empty. 11538func (vmsslr VirtualMachineScaleSetListResult) hasNextLink() bool { 11539 return vmsslr.NextLink != nil && len(*vmsslr.NextLink) != 0 11540} 11541 11542// virtualMachineScaleSetListResultPreparer prepares a request to retrieve the next set of results. 11543// It returns nil if no more results exist. 11544func (vmsslr VirtualMachineScaleSetListResult) virtualMachineScaleSetListResultPreparer(ctx context.Context) (*http.Request, error) { 11545 if !vmsslr.hasNextLink() { 11546 return nil, nil 11547 } 11548 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11549 autorest.AsJSON(), 11550 autorest.AsGet(), 11551 autorest.WithBaseURL(to.String(vmsslr.NextLink))) 11552} 11553 11554// VirtualMachineScaleSetListResultPage contains a page of VirtualMachineScaleSet values. 11555type VirtualMachineScaleSetListResultPage struct { 11556 fn func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error) 11557 vmsslr VirtualMachineScaleSetListResult 11558} 11559 11560// NextWithContext advances to the next page of values. If there was an error making 11561// the request the page does not advance and the error is returned. 11562func (page *VirtualMachineScaleSetListResultPage) NextWithContext(ctx context.Context) (err error) { 11563 if tracing.IsEnabled() { 11564 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListResultPage.NextWithContext") 11565 defer func() { 11566 sc := -1 11567 if page.Response().Response.Response != nil { 11568 sc = page.Response().Response.Response.StatusCode 11569 } 11570 tracing.EndSpan(ctx, sc, err) 11571 }() 11572 } 11573 for { 11574 next, err := page.fn(ctx, page.vmsslr) 11575 if err != nil { 11576 return err 11577 } 11578 page.vmsslr = next 11579 if !next.hasNextLink() || !next.IsEmpty() { 11580 break 11581 } 11582 } 11583 return nil 11584} 11585 11586// Next advances to the next page of values. If there was an error making 11587// the request the page does not advance and the error is returned. 11588// Deprecated: Use NextWithContext() instead. 11589func (page *VirtualMachineScaleSetListResultPage) Next() error { 11590 return page.NextWithContext(context.Background()) 11591} 11592 11593// NotDone returns true if the page enumeration should be started or is not yet complete. 11594func (page VirtualMachineScaleSetListResultPage) NotDone() bool { 11595 return !page.vmsslr.IsEmpty() 11596} 11597 11598// Response returns the raw server response from the last page request. 11599func (page VirtualMachineScaleSetListResultPage) Response() VirtualMachineScaleSetListResult { 11600 return page.vmsslr 11601} 11602 11603// Values returns the slice of values for the current page or nil if there are no values. 11604func (page VirtualMachineScaleSetListResultPage) Values() []VirtualMachineScaleSet { 11605 if page.vmsslr.IsEmpty() { 11606 return nil 11607 } 11608 return *page.vmsslr.Value 11609} 11610 11611// Creates a new instance of the VirtualMachineScaleSetListResultPage type. 11612func NewVirtualMachineScaleSetListResultPage(cur VirtualMachineScaleSetListResult, getNextPage func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error)) VirtualMachineScaleSetListResultPage { 11613 return VirtualMachineScaleSetListResultPage{ 11614 fn: getNextPage, 11615 vmsslr: cur, 11616 } 11617} 11618 11619// VirtualMachineScaleSetListSkusResult the Virtual Machine Scale Set List Skus operation response. 11620type VirtualMachineScaleSetListSkusResult struct { 11621 autorest.Response `json:"-"` 11622 // Value - The list of skus available for the virtual machine scale set. 11623 Value *[]VirtualMachineScaleSetSku `json:"value,omitempty"` 11624 // 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. 11625 NextLink *string `json:"nextLink,omitempty"` 11626} 11627 11628// VirtualMachineScaleSetListSkusResultIterator provides access to a complete listing of 11629// VirtualMachineScaleSetSku values. 11630type VirtualMachineScaleSetListSkusResultIterator struct { 11631 i int 11632 page VirtualMachineScaleSetListSkusResultPage 11633} 11634 11635// NextWithContext advances to the next value. If there was an error making 11636// the request the iterator does not advance and the error is returned. 11637func (iter *VirtualMachineScaleSetListSkusResultIterator) NextWithContext(ctx context.Context) (err error) { 11638 if tracing.IsEnabled() { 11639 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListSkusResultIterator.NextWithContext") 11640 defer func() { 11641 sc := -1 11642 if iter.Response().Response.Response != nil { 11643 sc = iter.Response().Response.Response.StatusCode 11644 } 11645 tracing.EndSpan(ctx, sc, err) 11646 }() 11647 } 11648 iter.i++ 11649 if iter.i < len(iter.page.Values()) { 11650 return nil 11651 } 11652 err = iter.page.NextWithContext(ctx) 11653 if err != nil { 11654 iter.i-- 11655 return err 11656 } 11657 iter.i = 0 11658 return nil 11659} 11660 11661// Next advances to the next value. If there was an error making 11662// the request the iterator does not advance and the error is returned. 11663// Deprecated: Use NextWithContext() instead. 11664func (iter *VirtualMachineScaleSetListSkusResultIterator) Next() error { 11665 return iter.NextWithContext(context.Background()) 11666} 11667 11668// NotDone returns true if the enumeration should be started or is not yet complete. 11669func (iter VirtualMachineScaleSetListSkusResultIterator) NotDone() bool { 11670 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11671} 11672 11673// Response returns the raw server response from the last page request. 11674func (iter VirtualMachineScaleSetListSkusResultIterator) Response() VirtualMachineScaleSetListSkusResult { 11675 return iter.page.Response() 11676} 11677 11678// Value returns the current value or a zero-initialized value if the 11679// iterator has advanced beyond the end of the collection. 11680func (iter VirtualMachineScaleSetListSkusResultIterator) Value() VirtualMachineScaleSetSku { 11681 if !iter.page.NotDone() { 11682 return VirtualMachineScaleSetSku{} 11683 } 11684 return iter.page.Values()[iter.i] 11685} 11686 11687// Creates a new instance of the VirtualMachineScaleSetListSkusResultIterator type. 11688func NewVirtualMachineScaleSetListSkusResultIterator(page VirtualMachineScaleSetListSkusResultPage) VirtualMachineScaleSetListSkusResultIterator { 11689 return VirtualMachineScaleSetListSkusResultIterator{page: page} 11690} 11691 11692// IsEmpty returns true if the ListResult contains no values. 11693func (vmsslsr VirtualMachineScaleSetListSkusResult) IsEmpty() bool { 11694 return vmsslsr.Value == nil || len(*vmsslsr.Value) == 0 11695} 11696 11697// hasNextLink returns true if the NextLink is not empty. 11698func (vmsslsr VirtualMachineScaleSetListSkusResult) hasNextLink() bool { 11699 return vmsslsr.NextLink != nil && len(*vmsslsr.NextLink) != 0 11700} 11701 11702// virtualMachineScaleSetListSkusResultPreparer prepares a request to retrieve the next set of results. 11703// It returns nil if no more results exist. 11704func (vmsslsr VirtualMachineScaleSetListSkusResult) virtualMachineScaleSetListSkusResultPreparer(ctx context.Context) (*http.Request, error) { 11705 if !vmsslsr.hasNextLink() { 11706 return nil, nil 11707 } 11708 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11709 autorest.AsJSON(), 11710 autorest.AsGet(), 11711 autorest.WithBaseURL(to.String(vmsslsr.NextLink))) 11712} 11713 11714// VirtualMachineScaleSetListSkusResultPage contains a page of VirtualMachineScaleSetSku values. 11715type VirtualMachineScaleSetListSkusResultPage struct { 11716 fn func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error) 11717 vmsslsr VirtualMachineScaleSetListSkusResult 11718} 11719 11720// NextWithContext advances to the next page of values. If there was an error making 11721// the request the page does not advance and the error is returned. 11722func (page *VirtualMachineScaleSetListSkusResultPage) NextWithContext(ctx context.Context) (err error) { 11723 if tracing.IsEnabled() { 11724 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListSkusResultPage.NextWithContext") 11725 defer func() { 11726 sc := -1 11727 if page.Response().Response.Response != nil { 11728 sc = page.Response().Response.Response.StatusCode 11729 } 11730 tracing.EndSpan(ctx, sc, err) 11731 }() 11732 } 11733 for { 11734 next, err := page.fn(ctx, page.vmsslsr) 11735 if err != nil { 11736 return err 11737 } 11738 page.vmsslsr = next 11739 if !next.hasNextLink() || !next.IsEmpty() { 11740 break 11741 } 11742 } 11743 return nil 11744} 11745 11746// Next advances to the next page of values. If there was an error making 11747// the request the page does not advance and the error is returned. 11748// Deprecated: Use NextWithContext() instead. 11749func (page *VirtualMachineScaleSetListSkusResultPage) Next() error { 11750 return page.NextWithContext(context.Background()) 11751} 11752 11753// NotDone returns true if the page enumeration should be started or is not yet complete. 11754func (page VirtualMachineScaleSetListSkusResultPage) NotDone() bool { 11755 return !page.vmsslsr.IsEmpty() 11756} 11757 11758// Response returns the raw server response from the last page request. 11759func (page VirtualMachineScaleSetListSkusResultPage) Response() VirtualMachineScaleSetListSkusResult { 11760 return page.vmsslsr 11761} 11762 11763// Values returns the slice of values for the current page or nil if there are no values. 11764func (page VirtualMachineScaleSetListSkusResultPage) Values() []VirtualMachineScaleSetSku { 11765 if page.vmsslsr.IsEmpty() { 11766 return nil 11767 } 11768 return *page.vmsslsr.Value 11769} 11770 11771// Creates a new instance of the VirtualMachineScaleSetListSkusResultPage type. 11772func NewVirtualMachineScaleSetListSkusResultPage(cur VirtualMachineScaleSetListSkusResult, getNextPage func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error)) VirtualMachineScaleSetListSkusResultPage { 11773 return VirtualMachineScaleSetListSkusResultPage{ 11774 fn: getNextPage, 11775 vmsslsr: cur, 11776 } 11777} 11778 11779// VirtualMachineScaleSetListWithLinkResult the List Virtual Machine operation response. 11780type VirtualMachineScaleSetListWithLinkResult struct { 11781 autorest.Response `json:"-"` 11782 // Value - The list of virtual machine scale sets. 11783 Value *[]VirtualMachineScaleSet `json:"value,omitempty"` 11784 // 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. 11785 NextLink *string `json:"nextLink,omitempty"` 11786} 11787 11788// VirtualMachineScaleSetListWithLinkResultIterator provides access to a complete listing of 11789// VirtualMachineScaleSet values. 11790type VirtualMachineScaleSetListWithLinkResultIterator struct { 11791 i int 11792 page VirtualMachineScaleSetListWithLinkResultPage 11793} 11794 11795// NextWithContext advances to the next value. If there was an error making 11796// the request the iterator does not advance and the error is returned. 11797func (iter *VirtualMachineScaleSetListWithLinkResultIterator) NextWithContext(ctx context.Context) (err error) { 11798 if tracing.IsEnabled() { 11799 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListWithLinkResultIterator.NextWithContext") 11800 defer func() { 11801 sc := -1 11802 if iter.Response().Response.Response != nil { 11803 sc = iter.Response().Response.Response.StatusCode 11804 } 11805 tracing.EndSpan(ctx, sc, err) 11806 }() 11807 } 11808 iter.i++ 11809 if iter.i < len(iter.page.Values()) { 11810 return nil 11811 } 11812 err = iter.page.NextWithContext(ctx) 11813 if err != nil { 11814 iter.i-- 11815 return err 11816 } 11817 iter.i = 0 11818 return nil 11819} 11820 11821// Next advances to the next value. If there was an error making 11822// the request the iterator does not advance and the error is returned. 11823// Deprecated: Use NextWithContext() instead. 11824func (iter *VirtualMachineScaleSetListWithLinkResultIterator) Next() error { 11825 return iter.NextWithContext(context.Background()) 11826} 11827 11828// NotDone returns true if the enumeration should be started or is not yet complete. 11829func (iter VirtualMachineScaleSetListWithLinkResultIterator) NotDone() bool { 11830 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11831} 11832 11833// Response returns the raw server response from the last page request. 11834func (iter VirtualMachineScaleSetListWithLinkResultIterator) Response() VirtualMachineScaleSetListWithLinkResult { 11835 return iter.page.Response() 11836} 11837 11838// Value returns the current value or a zero-initialized value if the 11839// iterator has advanced beyond the end of the collection. 11840func (iter VirtualMachineScaleSetListWithLinkResultIterator) Value() VirtualMachineScaleSet { 11841 if !iter.page.NotDone() { 11842 return VirtualMachineScaleSet{} 11843 } 11844 return iter.page.Values()[iter.i] 11845} 11846 11847// Creates a new instance of the VirtualMachineScaleSetListWithLinkResultIterator type. 11848func NewVirtualMachineScaleSetListWithLinkResultIterator(page VirtualMachineScaleSetListWithLinkResultPage) VirtualMachineScaleSetListWithLinkResultIterator { 11849 return VirtualMachineScaleSetListWithLinkResultIterator{page: page} 11850} 11851 11852// IsEmpty returns true if the ListResult contains no values. 11853func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) IsEmpty() bool { 11854 return vmsslwlr.Value == nil || len(*vmsslwlr.Value) == 0 11855} 11856 11857// hasNextLink returns true if the NextLink is not empty. 11858func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) hasNextLink() bool { 11859 return vmsslwlr.NextLink != nil && len(*vmsslwlr.NextLink) != 0 11860} 11861 11862// virtualMachineScaleSetListWithLinkResultPreparer prepares a request to retrieve the next set of results. 11863// It returns nil if no more results exist. 11864func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) virtualMachineScaleSetListWithLinkResultPreparer(ctx context.Context) (*http.Request, error) { 11865 if !vmsslwlr.hasNextLink() { 11866 return nil, nil 11867 } 11868 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11869 autorest.AsJSON(), 11870 autorest.AsGet(), 11871 autorest.WithBaseURL(to.String(vmsslwlr.NextLink))) 11872} 11873 11874// VirtualMachineScaleSetListWithLinkResultPage contains a page of VirtualMachineScaleSet values. 11875type VirtualMachineScaleSetListWithLinkResultPage struct { 11876 fn func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error) 11877 vmsslwlr VirtualMachineScaleSetListWithLinkResult 11878} 11879 11880// NextWithContext advances to the next page of values. If there was an error making 11881// the request the page does not advance and the error is returned. 11882func (page *VirtualMachineScaleSetListWithLinkResultPage) NextWithContext(ctx context.Context) (err error) { 11883 if tracing.IsEnabled() { 11884 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListWithLinkResultPage.NextWithContext") 11885 defer func() { 11886 sc := -1 11887 if page.Response().Response.Response != nil { 11888 sc = page.Response().Response.Response.StatusCode 11889 } 11890 tracing.EndSpan(ctx, sc, err) 11891 }() 11892 } 11893 for { 11894 next, err := page.fn(ctx, page.vmsslwlr) 11895 if err != nil { 11896 return err 11897 } 11898 page.vmsslwlr = next 11899 if !next.hasNextLink() || !next.IsEmpty() { 11900 break 11901 } 11902 } 11903 return nil 11904} 11905 11906// Next advances to the next page of values. If there was an error making 11907// the request the page does not advance and the error is returned. 11908// Deprecated: Use NextWithContext() instead. 11909func (page *VirtualMachineScaleSetListWithLinkResultPage) Next() error { 11910 return page.NextWithContext(context.Background()) 11911} 11912 11913// NotDone returns true if the page enumeration should be started or is not yet complete. 11914func (page VirtualMachineScaleSetListWithLinkResultPage) NotDone() bool { 11915 return !page.vmsslwlr.IsEmpty() 11916} 11917 11918// Response returns the raw server response from the last page request. 11919func (page VirtualMachineScaleSetListWithLinkResultPage) Response() VirtualMachineScaleSetListWithLinkResult { 11920 return page.vmsslwlr 11921} 11922 11923// Values returns the slice of values for the current page or nil if there are no values. 11924func (page VirtualMachineScaleSetListWithLinkResultPage) Values() []VirtualMachineScaleSet { 11925 if page.vmsslwlr.IsEmpty() { 11926 return nil 11927 } 11928 return *page.vmsslwlr.Value 11929} 11930 11931// Creates a new instance of the VirtualMachineScaleSetListWithLinkResultPage type. 11932func NewVirtualMachineScaleSetListWithLinkResultPage(cur VirtualMachineScaleSetListWithLinkResult, getNextPage func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error)) VirtualMachineScaleSetListWithLinkResultPage { 11933 return VirtualMachineScaleSetListWithLinkResultPage{ 11934 fn: getNextPage, 11935 vmsslwlr: cur, 11936 } 11937} 11938 11939// VirtualMachineScaleSetManagedDiskParameters describes the parameters of a ScaleSet managed disk. 11940type VirtualMachineScaleSetManagedDiskParameters struct { 11941 // 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' 11942 StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` 11943 // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed disk. 11944 DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` 11945} 11946 11947// VirtualMachineScaleSetNetworkConfiguration describes a virtual machine scale set network profile's 11948// network configurations. 11949type VirtualMachineScaleSetNetworkConfiguration struct { 11950 // Name - The network configuration name. 11951 Name *string `json:"name,omitempty"` 11952 *VirtualMachineScaleSetNetworkConfigurationProperties `json:"properties,omitempty"` 11953 // ID - Resource Id 11954 ID *string `json:"id,omitempty"` 11955} 11956 11957// MarshalJSON is the custom marshaler for VirtualMachineScaleSetNetworkConfiguration. 11958func (vmssnc VirtualMachineScaleSetNetworkConfiguration) MarshalJSON() ([]byte, error) { 11959 objectMap := make(map[string]interface{}) 11960 if vmssnc.Name != nil { 11961 objectMap["name"] = vmssnc.Name 11962 } 11963 if vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties != nil { 11964 objectMap["properties"] = vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties 11965 } 11966 if vmssnc.ID != nil { 11967 objectMap["id"] = vmssnc.ID 11968 } 11969 return json.Marshal(objectMap) 11970} 11971 11972// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetNetworkConfiguration struct. 11973func (vmssnc *VirtualMachineScaleSetNetworkConfiguration) UnmarshalJSON(body []byte) error { 11974 var m map[string]*json.RawMessage 11975 err := json.Unmarshal(body, &m) 11976 if err != nil { 11977 return err 11978 } 11979 for k, v := range m { 11980 switch k { 11981 case "name": 11982 if v != nil { 11983 var name string 11984 err = json.Unmarshal(*v, &name) 11985 if err != nil { 11986 return err 11987 } 11988 vmssnc.Name = &name 11989 } 11990 case "properties": 11991 if v != nil { 11992 var virtualMachineScaleSetNetworkConfigurationProperties VirtualMachineScaleSetNetworkConfigurationProperties 11993 err = json.Unmarshal(*v, &virtualMachineScaleSetNetworkConfigurationProperties) 11994 if err != nil { 11995 return err 11996 } 11997 vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties = &virtualMachineScaleSetNetworkConfigurationProperties 11998 } 11999 case "id": 12000 if v != nil { 12001 var ID string 12002 err = json.Unmarshal(*v, &ID) 12003 if err != nil { 12004 return err 12005 } 12006 vmssnc.ID = &ID 12007 } 12008 } 12009 } 12010 12011 return nil 12012} 12013 12014// VirtualMachineScaleSetNetworkConfigurationDNSSettings describes a virtual machines scale sets network 12015// configuration's DNS settings. 12016type VirtualMachineScaleSetNetworkConfigurationDNSSettings struct { 12017 // DNSServers - List of DNS servers IP addresses 12018 DNSServers *[]string `json:"dnsServers,omitempty"` 12019} 12020 12021// VirtualMachineScaleSetNetworkConfigurationProperties describes a virtual machine scale set network 12022// profile's IP configuration. 12023type VirtualMachineScaleSetNetworkConfigurationProperties struct { 12024 // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. 12025 Primary *bool `json:"primary,omitempty"` 12026 // EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled. 12027 EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` 12028 // NetworkSecurityGroup - The network security group. 12029 NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` 12030 // DNSSettings - The dns settings to be applied on the network interfaces. 12031 DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings `json:"dnsSettings,omitempty"` 12032 // IPConfigurations - Specifies the IP configurations of the network interface. 12033 IPConfigurations *[]VirtualMachineScaleSetIPConfiguration `json:"ipConfigurations,omitempty"` 12034 // EnableIPForwarding - Whether IP forwarding enabled on this NIC. 12035 EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` 12036} 12037 12038// VirtualMachineScaleSetNetworkProfile describes a virtual machine scale set network profile. 12039type VirtualMachineScaleSetNetworkProfile struct { 12040 // 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}'. 12041 HealthProbe *APIEntityReference `json:"healthProbe,omitempty"` 12042 // NetworkInterfaceConfigurations - The list of network configurations. 12043 NetworkInterfaceConfigurations *[]VirtualMachineScaleSetNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` 12044} 12045 12046// VirtualMachineScaleSetOSDisk describes a virtual machine scale set operating system disk. 12047type VirtualMachineScaleSetOSDisk struct { 12048 // Name - The disk name. 12049 Name *string `json:"name,omitempty"` 12050 // 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' 12051 Caching CachingTypes `json:"caching,omitempty"` 12052 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 12053 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 12054 // 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' 12055 CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` 12056 // DiffDiskSettings - Specifies the ephemeral disk Settings for the operating system disk used by the virtual machine scale set. 12057 DiffDiskSettings *DiffDiskSettings `json:"diffDiskSettings,omitempty"` 12058 // 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 12059 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 12060 // 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' 12061 OsType OperatingSystemTypes `json:"osType,omitempty"` 12062 // Image - Specifies information about the unmanaged user image to base the scale set on. 12063 Image *VirtualHardDisk `json:"image,omitempty"` 12064 // VhdContainers - Specifies the container urls that are used to store operating system disks for the scale set. 12065 VhdContainers *[]string `json:"vhdContainers,omitempty"` 12066 // ManagedDisk - The managed disk parameters. 12067 ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` 12068} 12069 12070// VirtualMachineScaleSetOSProfile describes a virtual machine scale set OS profile. 12071type VirtualMachineScaleSetOSProfile struct { 12072 // 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. 12073 ComputerNamePrefix *string `json:"computerNamePrefix,omitempty"` 12074 // 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) 12075 AdminUsername *string `json:"adminUsername,omitempty"` 12076 // 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) 12077 AdminPassword *string `json:"adminPassword,omitempty"` 12078 // 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) 12079 CustomData *string `json:"customData,omitempty"` 12080 // WindowsConfiguration - Specifies Windows operating system settings on the virtual machine. 12081 WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` 12082 // 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). 12083 LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` 12084 // Secrets - Specifies set of certificates that should be installed onto the virtual machines in the scale set. 12085 Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` 12086} 12087 12088// VirtualMachineScaleSetProperties describes the properties of a Virtual Machine Scale Set. 12089type VirtualMachineScaleSetProperties struct { 12090 // UpgradePolicy - The upgrade policy. 12091 UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` 12092 // AutomaticRepairsPolicy - Policy for automatic repairs. 12093 AutomaticRepairsPolicy *AutomaticRepairsPolicy `json:"automaticRepairsPolicy,omitempty"` 12094 // VirtualMachineProfile - The virtual machine profile. 12095 VirtualMachineProfile *VirtualMachineScaleSetVMProfile `json:"virtualMachineProfile,omitempty"` 12096 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 12097 ProvisioningState *string `json:"provisioningState,omitempty"` 12098 // Overprovision - Specifies whether the Virtual Machine Scale Set should be overprovisioned. 12099 Overprovision *bool `json:"overprovision,omitempty"` 12100 // 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. 12101 DoNotRunExtensionsOnOverprovisionedVMs *bool `json:"doNotRunExtensionsOnOverprovisionedVMs,omitempty"` 12102 // UniqueID - READ-ONLY; Specifies the ID which uniquely identifies a Virtual Machine Scale Set. 12103 UniqueID *string `json:"uniqueId,omitempty"` 12104 // 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. 12105 SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"` 12106 // ZoneBalance - Whether to force strictly even Virtual Machine distribution cross x-zones in case there is zone outage. 12107 ZoneBalance *bool `json:"zoneBalance,omitempty"` 12108 // PlatformFaultDomainCount - Fault Domain count for each placement group. 12109 PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` 12110 // 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. 12111 ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` 12112 // HostGroup - Specifies information about the dedicated host group that the virtual machine scale set resides in. <br><br>Minimum api-version: 2020-06-01. 12113 HostGroup *SubResource `json:"hostGroup,omitempty"` 12114 // 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. 12115 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 12116 // ScaleInPolicy - Specifies the scale-in policy that decides which virtual machines are chosen for removal when a Virtual Machine Scale Set is scaled-in. 12117 ScaleInPolicy *ScaleInPolicy `json:"scaleInPolicy,omitempty"` 12118} 12119 12120// MarshalJSON is the custom marshaler for VirtualMachineScaleSetProperties. 12121func (vmssp VirtualMachineScaleSetProperties) MarshalJSON() ([]byte, error) { 12122 objectMap := make(map[string]interface{}) 12123 if vmssp.UpgradePolicy != nil { 12124 objectMap["upgradePolicy"] = vmssp.UpgradePolicy 12125 } 12126 if vmssp.AutomaticRepairsPolicy != nil { 12127 objectMap["automaticRepairsPolicy"] = vmssp.AutomaticRepairsPolicy 12128 } 12129 if vmssp.VirtualMachineProfile != nil { 12130 objectMap["virtualMachineProfile"] = vmssp.VirtualMachineProfile 12131 } 12132 if vmssp.Overprovision != nil { 12133 objectMap["overprovision"] = vmssp.Overprovision 12134 } 12135 if vmssp.DoNotRunExtensionsOnOverprovisionedVMs != nil { 12136 objectMap["doNotRunExtensionsOnOverprovisionedVMs"] = vmssp.DoNotRunExtensionsOnOverprovisionedVMs 12137 } 12138 if vmssp.SinglePlacementGroup != nil { 12139 objectMap["singlePlacementGroup"] = vmssp.SinglePlacementGroup 12140 } 12141 if vmssp.ZoneBalance != nil { 12142 objectMap["zoneBalance"] = vmssp.ZoneBalance 12143 } 12144 if vmssp.PlatformFaultDomainCount != nil { 12145 objectMap["platformFaultDomainCount"] = vmssp.PlatformFaultDomainCount 12146 } 12147 if vmssp.ProximityPlacementGroup != nil { 12148 objectMap["proximityPlacementGroup"] = vmssp.ProximityPlacementGroup 12149 } 12150 if vmssp.HostGroup != nil { 12151 objectMap["hostGroup"] = vmssp.HostGroup 12152 } 12153 if vmssp.AdditionalCapabilities != nil { 12154 objectMap["additionalCapabilities"] = vmssp.AdditionalCapabilities 12155 } 12156 if vmssp.ScaleInPolicy != nil { 12157 objectMap["scaleInPolicy"] = vmssp.ScaleInPolicy 12158 } 12159 return json.Marshal(objectMap) 12160} 12161 12162// VirtualMachineScaleSetPublicIPAddressConfiguration describes a virtual machines scale set IP 12163// Configuration's PublicIPAddress configuration 12164type VirtualMachineScaleSetPublicIPAddressConfiguration struct { 12165 // Name - The publicIP address configuration name. 12166 Name *string `json:"name,omitempty"` 12167 *VirtualMachineScaleSetPublicIPAddressConfigurationProperties `json:"properties,omitempty"` 12168} 12169 12170// MarshalJSON is the custom marshaler for VirtualMachineScaleSetPublicIPAddressConfiguration. 12171func (vmsspiac VirtualMachineScaleSetPublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { 12172 objectMap := make(map[string]interface{}) 12173 if vmsspiac.Name != nil { 12174 objectMap["name"] = vmsspiac.Name 12175 } 12176 if vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties != nil { 12177 objectMap["properties"] = vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties 12178 } 12179 return json.Marshal(objectMap) 12180} 12181 12182// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetPublicIPAddressConfiguration struct. 12183func (vmsspiac *VirtualMachineScaleSetPublicIPAddressConfiguration) UnmarshalJSON(body []byte) error { 12184 var m map[string]*json.RawMessage 12185 err := json.Unmarshal(body, &m) 12186 if err != nil { 12187 return err 12188 } 12189 for k, v := range m { 12190 switch k { 12191 case "name": 12192 if v != nil { 12193 var name string 12194 err = json.Unmarshal(*v, &name) 12195 if err != nil { 12196 return err 12197 } 12198 vmsspiac.Name = &name 12199 } 12200 case "properties": 12201 if v != nil { 12202 var virtualMachineScaleSetPublicIPAddressConfigurationProperties VirtualMachineScaleSetPublicIPAddressConfigurationProperties 12203 err = json.Unmarshal(*v, &virtualMachineScaleSetPublicIPAddressConfigurationProperties) 12204 if err != nil { 12205 return err 12206 } 12207 vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties = &virtualMachineScaleSetPublicIPAddressConfigurationProperties 12208 } 12209 } 12210 } 12211 12212 return nil 12213} 12214 12215// VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings describes a virtual machines scale sets 12216// network configuration's DNS settings. 12217type VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings struct { 12218 // 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 12219 DomainNameLabel *string `json:"domainNameLabel,omitempty"` 12220} 12221 12222// VirtualMachineScaleSetPublicIPAddressConfigurationProperties describes a virtual machines scale set IP 12223// Configuration's PublicIPAddress configuration 12224type VirtualMachineScaleSetPublicIPAddressConfigurationProperties struct { 12225 // IdleTimeoutInMinutes - The idle timeout of the public IP address. 12226 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` 12227 // DNSSettings - The dns settings to be applied on the publicIP addresses . 12228 DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings `json:"dnsSettings,omitempty"` 12229 // IPTags - The list of IP tags associated with the public IP address. 12230 IPTags *[]VirtualMachineScaleSetIPTag `json:"ipTags,omitempty"` 12231 // PublicIPPrefix - The PublicIPPrefix from which to allocate publicIP addresses. 12232 PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` 12233 // 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' 12234 PublicIPAddressVersion IPVersion `json:"publicIPAddressVersion,omitempty"` 12235} 12236 12237// VirtualMachineScaleSetReimageParameters describes a Virtual Machine Scale Set VM Reimage Parameters. 12238type VirtualMachineScaleSetReimageParameters struct { 12239 // 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. 12240 InstanceIds *[]string `json:"instanceIds,omitempty"` 12241 // 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. 12242 TempDisk *bool `json:"tempDisk,omitempty"` 12243} 12244 12245// VirtualMachineScaleSetRollingUpgradesCancelFuture an abstraction for monitoring and retrieving the 12246// results of a long-running operation. 12247type VirtualMachineScaleSetRollingUpgradesCancelFuture struct { 12248 azure.FutureAPI 12249 // Result returns the result of the asynchronous operation. 12250 // If the operation has not completed it will return an error. 12251 Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) 12252} 12253 12254// VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture an abstraction for monitoring and 12255// retrieving the results of a long-running operation. 12256type VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture struct { 12257 azure.FutureAPI 12258 // Result returns the result of the asynchronous operation. 12259 // If the operation has not completed it will return an error. 12260 Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) 12261} 12262 12263// VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture an abstraction for monitoring and retrieving 12264// the results of a long-running operation. 12265type VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture struct { 12266 azure.FutureAPI 12267 // Result returns the result of the asynchronous operation. 12268 // If the operation has not completed it will return an error. 12269 Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) 12270} 12271 12272// VirtualMachineScaleSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of 12273// a long-running operation. 12274type VirtualMachineScaleSetsCreateOrUpdateFuture struct { 12275 azure.FutureAPI 12276 // Result returns the result of the asynchronous operation. 12277 // If the operation has not completed it will return an error. 12278 Result func(VirtualMachineScaleSetsClient) (VirtualMachineScaleSet, error) 12279} 12280 12281// VirtualMachineScaleSetsDeallocateFuture an abstraction for monitoring and retrieving the results of a 12282// long-running operation. 12283type VirtualMachineScaleSetsDeallocateFuture struct { 12284 azure.FutureAPI 12285 // Result returns the result of the asynchronous operation. 12286 // If the operation has not completed it will return an error. 12287 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 12288} 12289 12290// VirtualMachineScaleSetsDeleteFuture an abstraction for monitoring and retrieving the results of a 12291// long-running operation. 12292type VirtualMachineScaleSetsDeleteFuture struct { 12293 azure.FutureAPI 12294 // Result returns the result of the asynchronous operation. 12295 // If the operation has not completed it will return an error. 12296 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 12297} 12298 12299// VirtualMachineScaleSetsDeleteInstancesFuture an abstraction for monitoring and retrieving the results of 12300// a long-running operation. 12301type VirtualMachineScaleSetsDeleteInstancesFuture struct { 12302 azure.FutureAPI 12303 // Result returns the result of the asynchronous operation. 12304 // If the operation has not completed it will return an error. 12305 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 12306} 12307 12308// VirtualMachineScaleSetSku describes an available virtual machine scale set sku. 12309type VirtualMachineScaleSetSku struct { 12310 // ResourceType - READ-ONLY; The type of resource the sku applies to. 12311 ResourceType *string `json:"resourceType,omitempty"` 12312 // Sku - READ-ONLY; The Sku. 12313 Sku *Sku `json:"sku,omitempty"` 12314 // Capacity - READ-ONLY; Specifies the number of virtual machines in the scale set. 12315 Capacity *VirtualMachineScaleSetSkuCapacity `json:"capacity,omitempty"` 12316} 12317 12318// VirtualMachineScaleSetSkuCapacity describes scaling information of a sku. 12319type VirtualMachineScaleSetSkuCapacity struct { 12320 // Minimum - READ-ONLY; The minimum capacity. 12321 Minimum *int64 `json:"minimum,omitempty"` 12322 // Maximum - READ-ONLY; The maximum capacity that can be set. 12323 Maximum *int64 `json:"maximum,omitempty"` 12324 // DefaultCapacity - READ-ONLY; The default capacity. 12325 DefaultCapacity *int64 `json:"defaultCapacity,omitempty"` 12326 // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'VirtualMachineScaleSetSkuScaleTypeAutomatic', 'VirtualMachineScaleSetSkuScaleTypeNone' 12327 ScaleType VirtualMachineScaleSetSkuScaleType `json:"scaleType,omitempty"` 12328} 12329 12330// VirtualMachineScaleSetsPerformMaintenanceFuture an abstraction for monitoring and retrieving the results 12331// of a long-running operation. 12332type VirtualMachineScaleSetsPerformMaintenanceFuture struct { 12333 azure.FutureAPI 12334 // Result returns the result of the asynchronous operation. 12335 // If the operation has not completed it will return an error. 12336 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 12337} 12338 12339// VirtualMachineScaleSetsPowerOffFuture an abstraction for monitoring and retrieving the results of a 12340// long-running operation. 12341type VirtualMachineScaleSetsPowerOffFuture struct { 12342 azure.FutureAPI 12343 // Result returns the result of the asynchronous operation. 12344 // If the operation has not completed it will return an error. 12345 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 12346} 12347 12348// VirtualMachineScaleSetsRedeployFuture an abstraction for monitoring and retrieving the results of a 12349// long-running operation. 12350type VirtualMachineScaleSetsRedeployFuture struct { 12351 azure.FutureAPI 12352 // Result returns the result of the asynchronous operation. 12353 // If the operation has not completed it will return an error. 12354 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 12355} 12356 12357// VirtualMachineScaleSetsReimageAllFuture an abstraction for monitoring and retrieving the results of a 12358// long-running operation. 12359type VirtualMachineScaleSetsReimageAllFuture struct { 12360 azure.FutureAPI 12361 // Result returns the result of the asynchronous operation. 12362 // If the operation has not completed it will return an error. 12363 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 12364} 12365 12366// VirtualMachineScaleSetsReimageFuture an abstraction for monitoring and retrieving the results of a 12367// long-running operation. 12368type VirtualMachineScaleSetsReimageFuture struct { 12369 azure.FutureAPI 12370 // Result returns the result of the asynchronous operation. 12371 // If the operation has not completed it will return an error. 12372 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 12373} 12374 12375// VirtualMachineScaleSetsRestartFuture an abstraction for monitoring and retrieving the results of a 12376// long-running operation. 12377type VirtualMachineScaleSetsRestartFuture struct { 12378 azure.FutureAPI 12379 // Result returns the result of the asynchronous operation. 12380 // If the operation has not completed it will return an error. 12381 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 12382} 12383 12384// VirtualMachineScaleSetsSetOrchestrationServiceStateFuture an abstraction for monitoring and retrieving 12385// the results of a long-running operation. 12386type VirtualMachineScaleSetsSetOrchestrationServiceStateFuture struct { 12387 azure.FutureAPI 12388 // Result returns the result of the asynchronous operation. 12389 // If the operation has not completed it will return an error. 12390 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 12391} 12392 12393// VirtualMachineScaleSetsStartFuture an abstraction for monitoring and retrieving the results of a 12394// long-running operation. 12395type VirtualMachineScaleSetsStartFuture struct { 12396 azure.FutureAPI 12397 // Result returns the result of the asynchronous operation. 12398 // If the operation has not completed it will return an error. 12399 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 12400} 12401 12402// VirtualMachineScaleSetStorageProfile describes a virtual machine scale set storage profile. 12403type VirtualMachineScaleSetStorageProfile struct { 12404 // 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. 12405 ImageReference *ImageReference `json:"imageReference,omitempty"` 12406 // 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). 12407 OsDisk *VirtualMachineScaleSetOSDisk `json:"osDisk,omitempty"` 12408 // 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). 12409 DataDisks *[]VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"` 12410} 12411 12412// VirtualMachineScaleSetsUpdateFuture an abstraction for monitoring and retrieving the results of a 12413// long-running operation. 12414type VirtualMachineScaleSetsUpdateFuture struct { 12415 azure.FutureAPI 12416 // Result returns the result of the asynchronous operation. 12417 // If the operation has not completed it will return an error. 12418 Result func(VirtualMachineScaleSetsClient) (VirtualMachineScaleSet, error) 12419} 12420 12421// VirtualMachineScaleSetsUpdateInstancesFuture an abstraction for monitoring and retrieving the results of 12422// a long-running operation. 12423type VirtualMachineScaleSetsUpdateInstancesFuture struct { 12424 azure.FutureAPI 12425 // Result returns the result of the asynchronous operation. 12426 // If the operation has not completed it will return an error. 12427 Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) 12428} 12429 12430// VirtualMachineScaleSetUpdate describes a Virtual Machine Scale Set. 12431type VirtualMachineScaleSetUpdate struct { 12432 // Sku - The virtual machine scale set sku. 12433 Sku *Sku `json:"sku,omitempty"` 12434 // Plan - The purchase plan when deploying a virtual machine scale set from VM Marketplace images. 12435 Plan *Plan `json:"plan,omitempty"` 12436 *VirtualMachineScaleSetUpdateProperties `json:"properties,omitempty"` 12437 // Identity - The identity of the virtual machine scale set, if configured. 12438 Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"` 12439 // Tags - Resource tags 12440 Tags map[string]*string `json:"tags"` 12441} 12442 12443// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdate. 12444func (vmssu VirtualMachineScaleSetUpdate) MarshalJSON() ([]byte, error) { 12445 objectMap := make(map[string]interface{}) 12446 if vmssu.Sku != nil { 12447 objectMap["sku"] = vmssu.Sku 12448 } 12449 if vmssu.Plan != nil { 12450 objectMap["plan"] = vmssu.Plan 12451 } 12452 if vmssu.VirtualMachineScaleSetUpdateProperties != nil { 12453 objectMap["properties"] = vmssu.VirtualMachineScaleSetUpdateProperties 12454 } 12455 if vmssu.Identity != nil { 12456 objectMap["identity"] = vmssu.Identity 12457 } 12458 if vmssu.Tags != nil { 12459 objectMap["tags"] = vmssu.Tags 12460 } 12461 return json.Marshal(objectMap) 12462} 12463 12464// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdate struct. 12465func (vmssu *VirtualMachineScaleSetUpdate) UnmarshalJSON(body []byte) error { 12466 var m map[string]*json.RawMessage 12467 err := json.Unmarshal(body, &m) 12468 if err != nil { 12469 return err 12470 } 12471 for k, v := range m { 12472 switch k { 12473 case "sku": 12474 if v != nil { 12475 var sku Sku 12476 err = json.Unmarshal(*v, &sku) 12477 if err != nil { 12478 return err 12479 } 12480 vmssu.Sku = &sku 12481 } 12482 case "plan": 12483 if v != nil { 12484 var plan Plan 12485 err = json.Unmarshal(*v, &plan) 12486 if err != nil { 12487 return err 12488 } 12489 vmssu.Plan = &plan 12490 } 12491 case "properties": 12492 if v != nil { 12493 var virtualMachineScaleSetUpdateProperties VirtualMachineScaleSetUpdateProperties 12494 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateProperties) 12495 if err != nil { 12496 return err 12497 } 12498 vmssu.VirtualMachineScaleSetUpdateProperties = &virtualMachineScaleSetUpdateProperties 12499 } 12500 case "identity": 12501 if v != nil { 12502 var identity VirtualMachineScaleSetIdentity 12503 err = json.Unmarshal(*v, &identity) 12504 if err != nil { 12505 return err 12506 } 12507 vmssu.Identity = &identity 12508 } 12509 case "tags": 12510 if v != nil { 12511 var tags map[string]*string 12512 err = json.Unmarshal(*v, &tags) 12513 if err != nil { 12514 return err 12515 } 12516 vmssu.Tags = tags 12517 } 12518 } 12519 } 12520 12521 return nil 12522} 12523 12524// VirtualMachineScaleSetUpdateIPConfiguration describes a virtual machine scale set network profile's IP 12525// configuration. NOTE: The subnet of a scale set may be modified as long as the original subnet and the 12526// new subnet are in the same virtual network 12527type VirtualMachineScaleSetUpdateIPConfiguration struct { 12528 // Name - The IP configuration name. 12529 Name *string `json:"name,omitempty"` 12530 *VirtualMachineScaleSetUpdateIPConfigurationProperties `json:"properties,omitempty"` 12531 // ID - Resource Id 12532 ID *string `json:"id,omitempty"` 12533} 12534 12535// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdateIPConfiguration. 12536func (vmssuic VirtualMachineScaleSetUpdateIPConfiguration) MarshalJSON() ([]byte, error) { 12537 objectMap := make(map[string]interface{}) 12538 if vmssuic.Name != nil { 12539 objectMap["name"] = vmssuic.Name 12540 } 12541 if vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties != nil { 12542 objectMap["properties"] = vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties 12543 } 12544 if vmssuic.ID != nil { 12545 objectMap["id"] = vmssuic.ID 12546 } 12547 return json.Marshal(objectMap) 12548} 12549 12550// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdateIPConfiguration struct. 12551func (vmssuic *VirtualMachineScaleSetUpdateIPConfiguration) UnmarshalJSON(body []byte) error { 12552 var m map[string]*json.RawMessage 12553 err := json.Unmarshal(body, &m) 12554 if err != nil { 12555 return err 12556 } 12557 for k, v := range m { 12558 switch k { 12559 case "name": 12560 if v != nil { 12561 var name string 12562 err = json.Unmarshal(*v, &name) 12563 if err != nil { 12564 return err 12565 } 12566 vmssuic.Name = &name 12567 } 12568 case "properties": 12569 if v != nil { 12570 var virtualMachineScaleSetUpdateIPConfigurationProperties VirtualMachineScaleSetUpdateIPConfigurationProperties 12571 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateIPConfigurationProperties) 12572 if err != nil { 12573 return err 12574 } 12575 vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties = &virtualMachineScaleSetUpdateIPConfigurationProperties 12576 } 12577 case "id": 12578 if v != nil { 12579 var ID string 12580 err = json.Unmarshal(*v, &ID) 12581 if err != nil { 12582 return err 12583 } 12584 vmssuic.ID = &ID 12585 } 12586 } 12587 } 12588 12589 return nil 12590} 12591 12592// VirtualMachineScaleSetUpdateIPConfigurationProperties describes a virtual machine scale set network 12593// profile's IP configuration properties. 12594type VirtualMachineScaleSetUpdateIPConfigurationProperties struct { 12595 // Subnet - The subnet. 12596 Subnet *APIEntityReference `json:"subnet,omitempty"` 12597 // Primary - Specifies the primary IP Configuration in case the network interface has more than one IP Configuration. 12598 Primary *bool `json:"primary,omitempty"` 12599 // PublicIPAddressConfiguration - The publicIPAddressConfiguration. 12600 PublicIPAddressConfiguration *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` 12601 // 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' 12602 PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` 12603 // ApplicationGatewayBackendAddressPools - The application gateway backend address pools. 12604 ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` 12605 // ApplicationSecurityGroups - Specifies an array of references to application security group. 12606 ApplicationSecurityGroups *[]SubResource `json:"applicationSecurityGroups,omitempty"` 12607 // LoadBalancerBackendAddressPools - The load balancer backend address pools. 12608 LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` 12609 // LoadBalancerInboundNatPools - The load balancer inbound nat pools. 12610 LoadBalancerInboundNatPools *[]SubResource `json:"loadBalancerInboundNatPools,omitempty"` 12611} 12612 12613// VirtualMachineScaleSetUpdateNetworkConfiguration describes a virtual machine scale set network profile's 12614// network configurations. 12615type VirtualMachineScaleSetUpdateNetworkConfiguration struct { 12616 // Name - The network configuration name. 12617 Name *string `json:"name,omitempty"` 12618 *VirtualMachineScaleSetUpdateNetworkConfigurationProperties `json:"properties,omitempty"` 12619 // ID - Resource Id 12620 ID *string `json:"id,omitempty"` 12621} 12622 12623// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdateNetworkConfiguration. 12624func (vmssunc VirtualMachineScaleSetUpdateNetworkConfiguration) MarshalJSON() ([]byte, error) { 12625 objectMap := make(map[string]interface{}) 12626 if vmssunc.Name != nil { 12627 objectMap["name"] = vmssunc.Name 12628 } 12629 if vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties != nil { 12630 objectMap["properties"] = vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties 12631 } 12632 if vmssunc.ID != nil { 12633 objectMap["id"] = vmssunc.ID 12634 } 12635 return json.Marshal(objectMap) 12636} 12637 12638// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdateNetworkConfiguration struct. 12639func (vmssunc *VirtualMachineScaleSetUpdateNetworkConfiguration) UnmarshalJSON(body []byte) error { 12640 var m map[string]*json.RawMessage 12641 err := json.Unmarshal(body, &m) 12642 if err != nil { 12643 return err 12644 } 12645 for k, v := range m { 12646 switch k { 12647 case "name": 12648 if v != nil { 12649 var name string 12650 err = json.Unmarshal(*v, &name) 12651 if err != nil { 12652 return err 12653 } 12654 vmssunc.Name = &name 12655 } 12656 case "properties": 12657 if v != nil { 12658 var virtualMachineScaleSetUpdateNetworkConfigurationProperties VirtualMachineScaleSetUpdateNetworkConfigurationProperties 12659 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateNetworkConfigurationProperties) 12660 if err != nil { 12661 return err 12662 } 12663 vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties = &virtualMachineScaleSetUpdateNetworkConfigurationProperties 12664 } 12665 case "id": 12666 if v != nil { 12667 var ID string 12668 err = json.Unmarshal(*v, &ID) 12669 if err != nil { 12670 return err 12671 } 12672 vmssunc.ID = &ID 12673 } 12674 } 12675 } 12676 12677 return nil 12678} 12679 12680// VirtualMachineScaleSetUpdateNetworkConfigurationProperties describes a virtual machine scale set 12681// updatable network profile's IP configuration.Use this object for updating network profile's IP 12682// Configuration. 12683type VirtualMachineScaleSetUpdateNetworkConfigurationProperties struct { 12684 // Primary - Whether this is a primary NIC on a virtual machine. 12685 Primary *bool `json:"primary,omitempty"` 12686 // EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled. 12687 EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` 12688 // NetworkSecurityGroup - The network security group. 12689 NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` 12690 // DNSSettings - The dns settings to be applied on the network interfaces. 12691 DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings `json:"dnsSettings,omitempty"` 12692 // IPConfigurations - The virtual machine scale set IP Configuration. 12693 IPConfigurations *[]VirtualMachineScaleSetUpdateIPConfiguration `json:"ipConfigurations,omitempty"` 12694 // EnableIPForwarding - Whether IP forwarding enabled on this NIC. 12695 EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` 12696} 12697 12698// VirtualMachineScaleSetUpdateNetworkProfile describes a virtual machine scale set network profile. 12699type VirtualMachineScaleSetUpdateNetworkProfile struct { 12700 // 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}'. 12701 HealthProbe *APIEntityReference `json:"healthProbe,omitempty"` 12702 // NetworkInterfaceConfigurations - The list of network configurations. 12703 NetworkInterfaceConfigurations *[]VirtualMachineScaleSetUpdateNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` 12704} 12705 12706// VirtualMachineScaleSetUpdateOSDisk describes virtual machine scale set operating system disk Update 12707// Object. This should be used for Updating VMSS OS Disk. 12708type VirtualMachineScaleSetUpdateOSDisk struct { 12709 // Caching - The caching type. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' 12710 Caching CachingTypes `json:"caching,omitempty"` 12711 // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. 12712 WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` 12713 // 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 12714 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 12715 // 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. 12716 Image *VirtualHardDisk `json:"image,omitempty"` 12717 // VhdContainers - The list of virtual hard disk container uris. 12718 VhdContainers *[]string `json:"vhdContainers,omitempty"` 12719 // ManagedDisk - The managed disk parameters. 12720 ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` 12721} 12722 12723// VirtualMachineScaleSetUpdateOSProfile describes a virtual machine scale set OS profile. 12724type VirtualMachineScaleSetUpdateOSProfile struct { 12725 // CustomData - A base-64 encoded string of custom data. 12726 CustomData *string `json:"customData,omitempty"` 12727 // WindowsConfiguration - The Windows Configuration of the OS profile. 12728 WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` 12729 // LinuxConfiguration - The Linux Configuration of the OS profile. 12730 LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` 12731 // Secrets - The List of certificates for addition to the VM. 12732 Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` 12733} 12734 12735// VirtualMachineScaleSetUpdateProperties describes the properties of a Virtual Machine Scale Set. 12736type VirtualMachineScaleSetUpdateProperties struct { 12737 // UpgradePolicy - The upgrade policy. 12738 UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` 12739 // AutomaticRepairsPolicy - Policy for automatic repairs. 12740 AutomaticRepairsPolicy *AutomaticRepairsPolicy `json:"automaticRepairsPolicy,omitempty"` 12741 // VirtualMachineProfile - The virtual machine profile. 12742 VirtualMachineProfile *VirtualMachineScaleSetUpdateVMProfile `json:"virtualMachineProfile,omitempty"` 12743 // Overprovision - Specifies whether the Virtual Machine Scale Set should be overprovisioned. 12744 Overprovision *bool `json:"overprovision,omitempty"` 12745 // 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. 12746 DoNotRunExtensionsOnOverprovisionedVMs *bool `json:"doNotRunExtensionsOnOverprovisionedVMs,omitempty"` 12747 // 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. 12748 SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"` 12749 // 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. 12750 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 12751 // ScaleInPolicy - Specifies the scale-in policy that decides which virtual machines are chosen for removal when a Virtual Machine Scale Set is scaled-in. 12752 ScaleInPolicy *ScaleInPolicy `json:"scaleInPolicy,omitempty"` 12753 // 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. 12754 ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` 12755} 12756 12757// VirtualMachineScaleSetUpdatePublicIPAddressConfiguration describes a virtual machines scale set IP 12758// Configuration's PublicIPAddress configuration 12759type VirtualMachineScaleSetUpdatePublicIPAddressConfiguration struct { 12760 // Name - The publicIP address configuration name. 12761 Name *string `json:"name,omitempty"` 12762 *VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties `json:"properties,omitempty"` 12763} 12764 12765// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdatePublicIPAddressConfiguration. 12766func (vmssupiac VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { 12767 objectMap := make(map[string]interface{}) 12768 if vmssupiac.Name != nil { 12769 objectMap["name"] = vmssupiac.Name 12770 } 12771 if vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties != nil { 12772 objectMap["properties"] = vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties 12773 } 12774 return json.Marshal(objectMap) 12775} 12776 12777// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdatePublicIPAddressConfiguration struct. 12778func (vmssupiac *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) UnmarshalJSON(body []byte) error { 12779 var m map[string]*json.RawMessage 12780 err := json.Unmarshal(body, &m) 12781 if err != nil { 12782 return err 12783 } 12784 for k, v := range m { 12785 switch k { 12786 case "name": 12787 if v != nil { 12788 var name string 12789 err = json.Unmarshal(*v, &name) 12790 if err != nil { 12791 return err 12792 } 12793 vmssupiac.Name = &name 12794 } 12795 case "properties": 12796 if v != nil { 12797 var virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties 12798 err = json.Unmarshal(*v, &virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties) 12799 if err != nil { 12800 return err 12801 } 12802 vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties = &virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties 12803 } 12804 } 12805 } 12806 12807 return nil 12808} 12809 12810// VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties describes a virtual machines scale 12811// set IP Configuration's PublicIPAddress configuration 12812type VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties struct { 12813 // IdleTimeoutInMinutes - The idle timeout of the public IP address. 12814 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` 12815 // DNSSettings - The dns settings to be applied on the publicIP addresses . 12816 DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings `json:"dnsSettings,omitempty"` 12817} 12818 12819// VirtualMachineScaleSetUpdateStorageProfile describes a virtual machine scale set storage profile. 12820type VirtualMachineScaleSetUpdateStorageProfile struct { 12821 // ImageReference - The image reference. 12822 ImageReference *ImageReference `json:"imageReference,omitempty"` 12823 // OsDisk - The OS disk. 12824 OsDisk *VirtualMachineScaleSetUpdateOSDisk `json:"osDisk,omitempty"` 12825 // DataDisks - The data disks. 12826 DataDisks *[]VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"` 12827} 12828 12829// VirtualMachineScaleSetUpdateVMProfile describes a virtual machine scale set virtual machine profile. 12830type VirtualMachineScaleSetUpdateVMProfile struct { 12831 // OsProfile - The virtual machine scale set OS profile. 12832 OsProfile *VirtualMachineScaleSetUpdateOSProfile `json:"osProfile,omitempty"` 12833 // StorageProfile - The virtual machine scale set storage profile. 12834 StorageProfile *VirtualMachineScaleSetUpdateStorageProfile `json:"storageProfile,omitempty"` 12835 // NetworkProfile - The virtual machine scale set network profile. 12836 NetworkProfile *VirtualMachineScaleSetUpdateNetworkProfile `json:"networkProfile,omitempty"` 12837 // SecurityProfile - The virtual machine scale set Security profile 12838 SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` 12839 // DiagnosticsProfile - The virtual machine scale set diagnostics profile. 12840 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 12841 // ExtensionProfile - The virtual machine scale set extension profile. 12842 ExtensionProfile *VirtualMachineScaleSetExtensionProfile `json:"extensionProfile,omitempty"` 12843 // LicenseType - The license type, which is for bring your own license scenario. 12844 LicenseType *string `json:"licenseType,omitempty"` 12845 // BillingProfile - Specifies the billing related details of a Azure Spot VMSS. <br><br>Minimum api-version: 2019-03-01. 12846 BillingProfile *BillingProfile `json:"billingProfile,omitempty"` 12847 // ScheduledEventsProfile - Specifies Scheduled Event related configurations. 12848 ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` 12849} 12850 12851// VirtualMachineScaleSetVM describes a virtual machine scale set virtual machine. 12852type VirtualMachineScaleSetVM struct { 12853 autorest.Response `json:"-"` 12854 // InstanceID - READ-ONLY; The virtual machine instance ID. 12855 InstanceID *string `json:"instanceId,omitempty"` 12856 // Sku - READ-ONLY; The virtual machine SKU. 12857 Sku *Sku `json:"sku,omitempty"` 12858 *VirtualMachineScaleSetVMProperties `json:"properties,omitempty"` 12859 // 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**. 12860 Plan *Plan `json:"plan,omitempty"` 12861 // Resources - READ-ONLY; The virtual machine child extension resources. 12862 Resources *[]VirtualMachineExtension `json:"resources,omitempty"` 12863 // Zones - READ-ONLY; The virtual machine zones. 12864 Zones *[]string `json:"zones,omitempty"` 12865 // ID - READ-ONLY; Resource Id 12866 ID *string `json:"id,omitempty"` 12867 // Name - READ-ONLY; Resource name 12868 Name *string `json:"name,omitempty"` 12869 // Type - READ-ONLY; Resource type 12870 Type *string `json:"type,omitempty"` 12871 // Location - Resource location 12872 Location *string `json:"location,omitempty"` 12873 // Tags - Resource tags 12874 Tags map[string]*string `json:"tags"` 12875} 12876 12877// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVM. 12878func (vmssv VirtualMachineScaleSetVM) MarshalJSON() ([]byte, error) { 12879 objectMap := make(map[string]interface{}) 12880 if vmssv.VirtualMachineScaleSetVMProperties != nil { 12881 objectMap["properties"] = vmssv.VirtualMachineScaleSetVMProperties 12882 } 12883 if vmssv.Plan != nil { 12884 objectMap["plan"] = vmssv.Plan 12885 } 12886 if vmssv.Location != nil { 12887 objectMap["location"] = vmssv.Location 12888 } 12889 if vmssv.Tags != nil { 12890 objectMap["tags"] = vmssv.Tags 12891 } 12892 return json.Marshal(objectMap) 12893} 12894 12895// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetVM struct. 12896func (vmssv *VirtualMachineScaleSetVM) UnmarshalJSON(body []byte) error { 12897 var m map[string]*json.RawMessage 12898 err := json.Unmarshal(body, &m) 12899 if err != nil { 12900 return err 12901 } 12902 for k, v := range m { 12903 switch k { 12904 case "instanceId": 12905 if v != nil { 12906 var instanceID string 12907 err = json.Unmarshal(*v, &instanceID) 12908 if err != nil { 12909 return err 12910 } 12911 vmssv.InstanceID = &instanceID 12912 } 12913 case "sku": 12914 if v != nil { 12915 var sku Sku 12916 err = json.Unmarshal(*v, &sku) 12917 if err != nil { 12918 return err 12919 } 12920 vmssv.Sku = &sku 12921 } 12922 case "properties": 12923 if v != nil { 12924 var virtualMachineScaleSetVMProperties VirtualMachineScaleSetVMProperties 12925 err = json.Unmarshal(*v, &virtualMachineScaleSetVMProperties) 12926 if err != nil { 12927 return err 12928 } 12929 vmssv.VirtualMachineScaleSetVMProperties = &virtualMachineScaleSetVMProperties 12930 } 12931 case "plan": 12932 if v != nil { 12933 var plan Plan 12934 err = json.Unmarshal(*v, &plan) 12935 if err != nil { 12936 return err 12937 } 12938 vmssv.Plan = &plan 12939 } 12940 case "resources": 12941 if v != nil { 12942 var resources []VirtualMachineExtension 12943 err = json.Unmarshal(*v, &resources) 12944 if err != nil { 12945 return err 12946 } 12947 vmssv.Resources = &resources 12948 } 12949 case "zones": 12950 if v != nil { 12951 var zones []string 12952 err = json.Unmarshal(*v, &zones) 12953 if err != nil { 12954 return err 12955 } 12956 vmssv.Zones = &zones 12957 } 12958 case "id": 12959 if v != nil { 12960 var ID string 12961 err = json.Unmarshal(*v, &ID) 12962 if err != nil { 12963 return err 12964 } 12965 vmssv.ID = &ID 12966 } 12967 case "name": 12968 if v != nil { 12969 var name string 12970 err = json.Unmarshal(*v, &name) 12971 if err != nil { 12972 return err 12973 } 12974 vmssv.Name = &name 12975 } 12976 case "type": 12977 if v != nil { 12978 var typeVar string 12979 err = json.Unmarshal(*v, &typeVar) 12980 if err != nil { 12981 return err 12982 } 12983 vmssv.Type = &typeVar 12984 } 12985 case "location": 12986 if v != nil { 12987 var location string 12988 err = json.Unmarshal(*v, &location) 12989 if err != nil { 12990 return err 12991 } 12992 vmssv.Location = &location 12993 } 12994 case "tags": 12995 if v != nil { 12996 var tags map[string]*string 12997 err = json.Unmarshal(*v, &tags) 12998 if err != nil { 12999 return err 13000 } 13001 vmssv.Tags = tags 13002 } 13003 } 13004 } 13005 13006 return nil 13007} 13008 13009// VirtualMachineScaleSetVMExtension describes a VMSS VM Extension. 13010type VirtualMachineScaleSetVMExtension struct { 13011 autorest.Response `json:"-"` 13012 // Name - READ-ONLY; The name of the extension. 13013 Name *string `json:"name,omitempty"` 13014 // Type - READ-ONLY; Resource type 13015 Type *string `json:"type,omitempty"` 13016 *VirtualMachineExtensionProperties `json:"properties,omitempty"` 13017 // ID - READ-ONLY; Resource Id 13018 ID *string `json:"id,omitempty"` 13019} 13020 13021// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMExtension. 13022func (vmssve VirtualMachineScaleSetVMExtension) MarshalJSON() ([]byte, error) { 13023 objectMap := make(map[string]interface{}) 13024 if vmssve.VirtualMachineExtensionProperties != nil { 13025 objectMap["properties"] = vmssve.VirtualMachineExtensionProperties 13026 } 13027 return json.Marshal(objectMap) 13028} 13029 13030// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetVMExtension struct. 13031func (vmssve *VirtualMachineScaleSetVMExtension) UnmarshalJSON(body []byte) error { 13032 var m map[string]*json.RawMessage 13033 err := json.Unmarshal(body, &m) 13034 if err != nil { 13035 return err 13036 } 13037 for k, v := range m { 13038 switch k { 13039 case "name": 13040 if v != nil { 13041 var name string 13042 err = json.Unmarshal(*v, &name) 13043 if err != nil { 13044 return err 13045 } 13046 vmssve.Name = &name 13047 } 13048 case "type": 13049 if v != nil { 13050 var typeVar string 13051 err = json.Unmarshal(*v, &typeVar) 13052 if err != nil { 13053 return err 13054 } 13055 vmssve.Type = &typeVar 13056 } 13057 case "properties": 13058 if v != nil { 13059 var virtualMachineExtensionProperties VirtualMachineExtensionProperties 13060 err = json.Unmarshal(*v, &virtualMachineExtensionProperties) 13061 if err != nil { 13062 return err 13063 } 13064 vmssve.VirtualMachineExtensionProperties = &virtualMachineExtensionProperties 13065 } 13066 case "id": 13067 if v != nil { 13068 var ID string 13069 err = json.Unmarshal(*v, &ID) 13070 if err != nil { 13071 return err 13072 } 13073 vmssve.ID = &ID 13074 } 13075 } 13076 } 13077 13078 return nil 13079} 13080 13081// VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the 13082// results of a long-running operation. 13083type VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture struct { 13084 azure.FutureAPI 13085 // Result returns the result of the asynchronous operation. 13086 // If the operation has not completed it will return an error. 13087 Result func(VirtualMachineScaleSetVMExtensionsClient) (VirtualMachineScaleSetVMExtension, error) 13088} 13089 13090// VirtualMachineScaleSetVMExtensionsDeleteFuture an abstraction for monitoring and retrieving the results 13091// of a long-running operation. 13092type VirtualMachineScaleSetVMExtensionsDeleteFuture struct { 13093 azure.FutureAPI 13094 // Result returns the result of the asynchronous operation. 13095 // If the operation has not completed it will return an error. 13096 Result func(VirtualMachineScaleSetVMExtensionsClient) (autorest.Response, error) 13097} 13098 13099// VirtualMachineScaleSetVMExtensionsListResult the List VMSS VM Extension operation response 13100type VirtualMachineScaleSetVMExtensionsListResult struct { 13101 autorest.Response `json:"-"` 13102 // Value - The list of VMSS VM extensions 13103 Value *[]VirtualMachineScaleSetVMExtension `json:"value,omitempty"` 13104} 13105 13106// VirtualMachineScaleSetVMExtensionsSummary extensions summary for virtual machines of a virtual machine 13107// scale set. 13108type VirtualMachineScaleSetVMExtensionsSummary struct { 13109 // Name - READ-ONLY; The extension name. 13110 Name *string `json:"name,omitempty"` 13111 // StatusesSummary - READ-ONLY; The extensions information. 13112 StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` 13113} 13114 13115// VirtualMachineScaleSetVMExtensionsUpdateFuture an abstraction for monitoring and retrieving the results 13116// of a long-running operation. 13117type VirtualMachineScaleSetVMExtensionsUpdateFuture struct { 13118 azure.FutureAPI 13119 // Result returns the result of the asynchronous operation. 13120 // If the operation has not completed it will return an error. 13121 Result func(VirtualMachineScaleSetVMExtensionsClient) (VirtualMachineScaleSetVMExtension, error) 13122} 13123 13124// VirtualMachineScaleSetVMExtensionUpdate describes a VMSS VM Extension. 13125type VirtualMachineScaleSetVMExtensionUpdate struct { 13126 // Name - READ-ONLY; The name of the extension. 13127 Name *string `json:"name,omitempty"` 13128 // Type - READ-ONLY; Resource type 13129 Type *string `json:"type,omitempty"` 13130 *VirtualMachineExtensionUpdateProperties `json:"properties,omitempty"` 13131 // ID - READ-ONLY; Resource Id 13132 ID *string `json:"id,omitempty"` 13133} 13134 13135// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMExtensionUpdate. 13136func (vmssveu VirtualMachineScaleSetVMExtensionUpdate) MarshalJSON() ([]byte, error) { 13137 objectMap := make(map[string]interface{}) 13138 if vmssveu.VirtualMachineExtensionUpdateProperties != nil { 13139 objectMap["properties"] = vmssveu.VirtualMachineExtensionUpdateProperties 13140 } 13141 return json.Marshal(objectMap) 13142} 13143 13144// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetVMExtensionUpdate struct. 13145func (vmssveu *VirtualMachineScaleSetVMExtensionUpdate) UnmarshalJSON(body []byte) error { 13146 var m map[string]*json.RawMessage 13147 err := json.Unmarshal(body, &m) 13148 if err != nil { 13149 return err 13150 } 13151 for k, v := range m { 13152 switch k { 13153 case "name": 13154 if v != nil { 13155 var name string 13156 err = json.Unmarshal(*v, &name) 13157 if err != nil { 13158 return err 13159 } 13160 vmssveu.Name = &name 13161 } 13162 case "type": 13163 if v != nil { 13164 var typeVar string 13165 err = json.Unmarshal(*v, &typeVar) 13166 if err != nil { 13167 return err 13168 } 13169 vmssveu.Type = &typeVar 13170 } 13171 case "properties": 13172 if v != nil { 13173 var virtualMachineExtensionUpdateProperties VirtualMachineExtensionUpdateProperties 13174 err = json.Unmarshal(*v, &virtualMachineExtensionUpdateProperties) 13175 if err != nil { 13176 return err 13177 } 13178 vmssveu.VirtualMachineExtensionUpdateProperties = &virtualMachineExtensionUpdateProperties 13179 } 13180 case "id": 13181 if v != nil { 13182 var ID string 13183 err = json.Unmarshal(*v, &ID) 13184 if err != nil { 13185 return err 13186 } 13187 vmssveu.ID = &ID 13188 } 13189 } 13190 } 13191 13192 return nil 13193} 13194 13195// VirtualMachineScaleSetVMInstanceIDs specifies a list of virtual machine instance IDs from the VM scale 13196// set. 13197type VirtualMachineScaleSetVMInstanceIDs struct { 13198 // 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. 13199 InstanceIds *[]string `json:"instanceIds,omitempty"` 13200} 13201 13202// VirtualMachineScaleSetVMInstanceRequiredIDs specifies a list of virtual machine instance IDs from the VM 13203// scale set. 13204type VirtualMachineScaleSetVMInstanceRequiredIDs struct { 13205 // InstanceIds - The virtual machine scale set instance ids. 13206 InstanceIds *[]string `json:"instanceIds,omitempty"` 13207} 13208 13209// VirtualMachineScaleSetVMInstanceView the instance view of a virtual machine scale set VM. 13210type VirtualMachineScaleSetVMInstanceView struct { 13211 autorest.Response `json:"-"` 13212 // PlatformUpdateDomain - The Update Domain count. 13213 PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` 13214 // PlatformFaultDomain - The Fault Domain count. 13215 PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` 13216 // RdpThumbPrint - The Remote desktop certificate thumbprint. 13217 RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"` 13218 // VMAgent - The VM Agent running on the virtual machine. 13219 VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"` 13220 // MaintenanceRedeployStatus - The Maintenance Operation status on the virtual machine. 13221 MaintenanceRedeployStatus *MaintenanceRedeployStatus `json:"maintenanceRedeployStatus,omitempty"` 13222 // Disks - The disks information. 13223 Disks *[]DiskInstanceView `json:"disks,omitempty"` 13224 // Extensions - The extensions information. 13225 Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` 13226 // VMHealth - READ-ONLY; The health status for the VM. 13227 VMHealth *VirtualMachineHealthStatus `json:"vmHealth,omitempty"` 13228 // 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. 13229 BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` 13230 // Statuses - The resource status information. 13231 Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` 13232 // AssignedHost - READ-ONLY; Resource id of the dedicated host, on which the virtual machine is allocated through automatic placement, when the virtual machine is associated with a dedicated host group that has automatic placement enabled. <br><br>Minimum api-version: 2020-06-01. 13233 AssignedHost *string `json:"assignedHost,omitempty"` 13234 // PlacementGroupID - The placement group in which the VM is running. If the VM is deallocated it will not have a placementGroupId. 13235 PlacementGroupID *string `json:"placementGroupId,omitempty"` 13236} 13237 13238// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMInstanceView. 13239func (vmssviv VirtualMachineScaleSetVMInstanceView) MarshalJSON() ([]byte, error) { 13240 objectMap := make(map[string]interface{}) 13241 if vmssviv.PlatformUpdateDomain != nil { 13242 objectMap["platformUpdateDomain"] = vmssviv.PlatformUpdateDomain 13243 } 13244 if vmssviv.PlatformFaultDomain != nil { 13245 objectMap["platformFaultDomain"] = vmssviv.PlatformFaultDomain 13246 } 13247 if vmssviv.RdpThumbPrint != nil { 13248 objectMap["rdpThumbPrint"] = vmssviv.RdpThumbPrint 13249 } 13250 if vmssviv.VMAgent != nil { 13251 objectMap["vmAgent"] = vmssviv.VMAgent 13252 } 13253 if vmssviv.MaintenanceRedeployStatus != nil { 13254 objectMap["maintenanceRedeployStatus"] = vmssviv.MaintenanceRedeployStatus 13255 } 13256 if vmssviv.Disks != nil { 13257 objectMap["disks"] = vmssviv.Disks 13258 } 13259 if vmssviv.Extensions != nil { 13260 objectMap["extensions"] = vmssviv.Extensions 13261 } 13262 if vmssviv.BootDiagnostics != nil { 13263 objectMap["bootDiagnostics"] = vmssviv.BootDiagnostics 13264 } 13265 if vmssviv.Statuses != nil { 13266 objectMap["statuses"] = vmssviv.Statuses 13267 } 13268 if vmssviv.PlacementGroupID != nil { 13269 objectMap["placementGroupId"] = vmssviv.PlacementGroupID 13270 } 13271 return json.Marshal(objectMap) 13272} 13273 13274// VirtualMachineScaleSetVMListResult the List Virtual Machine Scale Set VMs operation response. 13275type VirtualMachineScaleSetVMListResult struct { 13276 autorest.Response `json:"-"` 13277 // Value - The list of virtual machine scale sets VMs. 13278 Value *[]VirtualMachineScaleSetVM `json:"value,omitempty"` 13279 // 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 13280 NextLink *string `json:"nextLink,omitempty"` 13281} 13282 13283// VirtualMachineScaleSetVMListResultIterator provides access to a complete listing of 13284// VirtualMachineScaleSetVM values. 13285type VirtualMachineScaleSetVMListResultIterator struct { 13286 i int 13287 page VirtualMachineScaleSetVMListResultPage 13288} 13289 13290// NextWithContext advances to the next value. If there was an error making 13291// the request the iterator does not advance and the error is returned. 13292func (iter *VirtualMachineScaleSetVMListResultIterator) NextWithContext(ctx context.Context) (err error) { 13293 if tracing.IsEnabled() { 13294 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMListResultIterator.NextWithContext") 13295 defer func() { 13296 sc := -1 13297 if iter.Response().Response.Response != nil { 13298 sc = iter.Response().Response.Response.StatusCode 13299 } 13300 tracing.EndSpan(ctx, sc, err) 13301 }() 13302 } 13303 iter.i++ 13304 if iter.i < len(iter.page.Values()) { 13305 return nil 13306 } 13307 err = iter.page.NextWithContext(ctx) 13308 if err != nil { 13309 iter.i-- 13310 return err 13311 } 13312 iter.i = 0 13313 return nil 13314} 13315 13316// Next advances to the next value. If there was an error making 13317// the request the iterator does not advance and the error is returned. 13318// Deprecated: Use NextWithContext() instead. 13319func (iter *VirtualMachineScaleSetVMListResultIterator) Next() error { 13320 return iter.NextWithContext(context.Background()) 13321} 13322 13323// NotDone returns true if the enumeration should be started or is not yet complete. 13324func (iter VirtualMachineScaleSetVMListResultIterator) NotDone() bool { 13325 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 13326} 13327 13328// Response returns the raw server response from the last page request. 13329func (iter VirtualMachineScaleSetVMListResultIterator) Response() VirtualMachineScaleSetVMListResult { 13330 return iter.page.Response() 13331} 13332 13333// Value returns the current value or a zero-initialized value if the 13334// iterator has advanced beyond the end of the collection. 13335func (iter VirtualMachineScaleSetVMListResultIterator) Value() VirtualMachineScaleSetVM { 13336 if !iter.page.NotDone() { 13337 return VirtualMachineScaleSetVM{} 13338 } 13339 return iter.page.Values()[iter.i] 13340} 13341 13342// Creates a new instance of the VirtualMachineScaleSetVMListResultIterator type. 13343func NewVirtualMachineScaleSetVMListResultIterator(page VirtualMachineScaleSetVMListResultPage) VirtualMachineScaleSetVMListResultIterator { 13344 return VirtualMachineScaleSetVMListResultIterator{page: page} 13345} 13346 13347// IsEmpty returns true if the ListResult contains no values. 13348func (vmssvlr VirtualMachineScaleSetVMListResult) IsEmpty() bool { 13349 return vmssvlr.Value == nil || len(*vmssvlr.Value) == 0 13350} 13351 13352// hasNextLink returns true if the NextLink is not empty. 13353func (vmssvlr VirtualMachineScaleSetVMListResult) hasNextLink() bool { 13354 return vmssvlr.NextLink != nil && len(*vmssvlr.NextLink) != 0 13355} 13356 13357// virtualMachineScaleSetVMListResultPreparer prepares a request to retrieve the next set of results. 13358// It returns nil if no more results exist. 13359func (vmssvlr VirtualMachineScaleSetVMListResult) virtualMachineScaleSetVMListResultPreparer(ctx context.Context) (*http.Request, error) { 13360 if !vmssvlr.hasNextLink() { 13361 return nil, nil 13362 } 13363 return autorest.Prepare((&http.Request{}).WithContext(ctx), 13364 autorest.AsJSON(), 13365 autorest.AsGet(), 13366 autorest.WithBaseURL(to.String(vmssvlr.NextLink))) 13367} 13368 13369// VirtualMachineScaleSetVMListResultPage contains a page of VirtualMachineScaleSetVM values. 13370type VirtualMachineScaleSetVMListResultPage struct { 13371 fn func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error) 13372 vmssvlr VirtualMachineScaleSetVMListResult 13373} 13374 13375// NextWithContext advances to the next page of values. If there was an error making 13376// the request the page does not advance and the error is returned. 13377func (page *VirtualMachineScaleSetVMListResultPage) NextWithContext(ctx context.Context) (err error) { 13378 if tracing.IsEnabled() { 13379 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMListResultPage.NextWithContext") 13380 defer func() { 13381 sc := -1 13382 if page.Response().Response.Response != nil { 13383 sc = page.Response().Response.Response.StatusCode 13384 } 13385 tracing.EndSpan(ctx, sc, err) 13386 }() 13387 } 13388 for { 13389 next, err := page.fn(ctx, page.vmssvlr) 13390 if err != nil { 13391 return err 13392 } 13393 page.vmssvlr = next 13394 if !next.hasNextLink() || !next.IsEmpty() { 13395 break 13396 } 13397 } 13398 return nil 13399} 13400 13401// Next advances to the next page of values. If there was an error making 13402// the request the page does not advance and the error is returned. 13403// Deprecated: Use NextWithContext() instead. 13404func (page *VirtualMachineScaleSetVMListResultPage) Next() error { 13405 return page.NextWithContext(context.Background()) 13406} 13407 13408// NotDone returns true if the page enumeration should be started or is not yet complete. 13409func (page VirtualMachineScaleSetVMListResultPage) NotDone() bool { 13410 return !page.vmssvlr.IsEmpty() 13411} 13412 13413// Response returns the raw server response from the last page request. 13414func (page VirtualMachineScaleSetVMListResultPage) Response() VirtualMachineScaleSetVMListResult { 13415 return page.vmssvlr 13416} 13417 13418// Values returns the slice of values for the current page or nil if there are no values. 13419func (page VirtualMachineScaleSetVMListResultPage) Values() []VirtualMachineScaleSetVM { 13420 if page.vmssvlr.IsEmpty() { 13421 return nil 13422 } 13423 return *page.vmssvlr.Value 13424} 13425 13426// Creates a new instance of the VirtualMachineScaleSetVMListResultPage type. 13427func NewVirtualMachineScaleSetVMListResultPage(cur VirtualMachineScaleSetVMListResult, getNextPage func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error)) VirtualMachineScaleSetVMListResultPage { 13428 return VirtualMachineScaleSetVMListResultPage{ 13429 fn: getNextPage, 13430 vmssvlr: cur, 13431 } 13432} 13433 13434// VirtualMachineScaleSetVMNetworkProfileConfiguration describes a virtual machine scale set VM network 13435// profile. 13436type VirtualMachineScaleSetVMNetworkProfileConfiguration struct { 13437 // NetworkInterfaceConfigurations - The list of network configurations. 13438 NetworkInterfaceConfigurations *[]VirtualMachineScaleSetNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` 13439} 13440 13441// VirtualMachineScaleSetVMProfile describes a virtual machine scale set virtual machine profile. 13442type VirtualMachineScaleSetVMProfile struct { 13443 // OsProfile - Specifies the operating system settings for the virtual machines in the scale set. 13444 OsProfile *VirtualMachineScaleSetOSProfile `json:"osProfile,omitempty"` 13445 // StorageProfile - Specifies the storage settings for the virtual machine disks. 13446 StorageProfile *VirtualMachineScaleSetStorageProfile `json:"storageProfile,omitempty"` 13447 // NetworkProfile - Specifies properties of the network interfaces of the virtual machines in the scale set. 13448 NetworkProfile *VirtualMachineScaleSetNetworkProfile `json:"networkProfile,omitempty"` 13449 // SecurityProfile - Specifies the Security related profile settings for the virtual machines in the scale set. 13450 SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` 13451 // DiagnosticsProfile - Specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. 13452 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 13453 // ExtensionProfile - Specifies a collection of settings for extensions installed on virtual machines in the scale set. 13454 ExtensionProfile *VirtualMachineScaleSetExtensionProfile `json:"extensionProfile,omitempty"` 13455 // LicenseType - Specifies that the image or disk that is being used was licensed on-premises. <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) <br><br> [Azure Hybrid Use Benefit for Linux Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> Minimum api-version: 2015-06-15 13456 LicenseType *string `json:"licenseType,omitempty"` 13457 // 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' 13458 Priority VirtualMachinePriorityTypes `json:"priority,omitempty"` 13459 // 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' 13460 EvictionPolicy VirtualMachineEvictionPolicyTypes `json:"evictionPolicy,omitempty"` 13461 // BillingProfile - Specifies the billing related details of a Azure Spot VMSS. <br><br>Minimum api-version: 2019-03-01. 13462 BillingProfile *BillingProfile `json:"billingProfile,omitempty"` 13463 // ScheduledEventsProfile - Specifies Scheduled Event related configurations. 13464 ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` 13465} 13466 13467// VirtualMachineScaleSetVMProperties describes the properties of a virtual machine scale set virtual 13468// machine. 13469type VirtualMachineScaleSetVMProperties struct { 13470 // LatestModelApplied - READ-ONLY; Specifies whether the latest model has been applied to the virtual machine. 13471 LatestModelApplied *bool `json:"latestModelApplied,omitempty"` 13472 // VMID - READ-ONLY; Azure VM unique ID. 13473 VMID *string `json:"vmId,omitempty"` 13474 // InstanceView - READ-ONLY; The virtual machine instance view. 13475 InstanceView *VirtualMachineScaleSetVMInstanceView `json:"instanceView,omitempty"` 13476 // HardwareProfile - Specifies the hardware settings for the virtual machine. 13477 HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` 13478 // StorageProfile - Specifies the storage settings for the virtual machine disks. 13479 StorageProfile *StorageProfile `json:"storageProfile,omitempty"` 13480 // 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. 13481 AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` 13482 // OsProfile - Specifies the operating system settings for the virtual machine. 13483 OsProfile *OSProfile `json:"osProfile,omitempty"` 13484 // SecurityProfile - Specifies the Security related profile settings for the virtual machine. 13485 SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` 13486 // NetworkProfile - Specifies the network interfaces of the virtual machine. 13487 NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` 13488 // NetworkProfileConfiguration - Specifies the network profile configuration of the virtual machine. 13489 NetworkProfileConfiguration *VirtualMachineScaleSetVMNetworkProfileConfiguration `json:"networkProfileConfiguration,omitempty"` 13490 // DiagnosticsProfile - Specifies the boot diagnostic settings state. <br><br>Minimum api-version: 2015-06-15. 13491 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 13492 // 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. 13493 AvailabilitySet *SubResource `json:"availabilitySet,omitempty"` 13494 // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. 13495 ProvisioningState *string `json:"provisioningState,omitempty"` 13496 // LicenseType - Specifies that the image or disk that is being used was licensed on-premises. <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) <br><br> [Azure Hybrid Use Benefit for Linux Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> Minimum api-version: 2015-06-15 13497 LicenseType *string `json:"licenseType,omitempty"` 13498 // 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. 13499 ModelDefinitionApplied *string `json:"modelDefinitionApplied,omitempty"` 13500 // ProtectionPolicy - Specifies the protection policy of the virtual machine. 13501 ProtectionPolicy *VirtualMachineScaleSetVMProtectionPolicy `json:"protectionPolicy,omitempty"` 13502} 13503 13504// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMProperties. 13505func (vmssvp VirtualMachineScaleSetVMProperties) MarshalJSON() ([]byte, error) { 13506 objectMap := make(map[string]interface{}) 13507 if vmssvp.HardwareProfile != nil { 13508 objectMap["hardwareProfile"] = vmssvp.HardwareProfile 13509 } 13510 if vmssvp.StorageProfile != nil { 13511 objectMap["storageProfile"] = vmssvp.StorageProfile 13512 } 13513 if vmssvp.AdditionalCapabilities != nil { 13514 objectMap["additionalCapabilities"] = vmssvp.AdditionalCapabilities 13515 } 13516 if vmssvp.OsProfile != nil { 13517 objectMap["osProfile"] = vmssvp.OsProfile 13518 } 13519 if vmssvp.SecurityProfile != nil { 13520 objectMap["securityProfile"] = vmssvp.SecurityProfile 13521 } 13522 if vmssvp.NetworkProfile != nil { 13523 objectMap["networkProfile"] = vmssvp.NetworkProfile 13524 } 13525 if vmssvp.NetworkProfileConfiguration != nil { 13526 objectMap["networkProfileConfiguration"] = vmssvp.NetworkProfileConfiguration 13527 } 13528 if vmssvp.DiagnosticsProfile != nil { 13529 objectMap["diagnosticsProfile"] = vmssvp.DiagnosticsProfile 13530 } 13531 if vmssvp.AvailabilitySet != nil { 13532 objectMap["availabilitySet"] = vmssvp.AvailabilitySet 13533 } 13534 if vmssvp.LicenseType != nil { 13535 objectMap["licenseType"] = vmssvp.LicenseType 13536 } 13537 if vmssvp.ProtectionPolicy != nil { 13538 objectMap["protectionPolicy"] = vmssvp.ProtectionPolicy 13539 } 13540 return json.Marshal(objectMap) 13541} 13542 13543// VirtualMachineScaleSetVMProtectionPolicy the protection policy of a virtual machine scale set VM. 13544type VirtualMachineScaleSetVMProtectionPolicy struct { 13545 // ProtectFromScaleIn - Indicates that the virtual machine scale set VM shouldn't be considered for deletion during a scale-in operation. 13546 ProtectFromScaleIn *bool `json:"protectFromScaleIn,omitempty"` 13547 // 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. 13548 ProtectFromScaleSetActions *bool `json:"protectFromScaleSetActions,omitempty"` 13549} 13550 13551// VirtualMachineScaleSetVMReimageParameters describes a Virtual Machine Scale Set VM Reimage Parameters. 13552type VirtualMachineScaleSetVMReimageParameters struct { 13553 // 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. 13554 TempDisk *bool `json:"tempDisk,omitempty"` 13555} 13556 13557// VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture an abstraction for monitoring and retrieving the 13558// results of a long-running operation. 13559type VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture struct { 13560 azure.FutureAPI 13561 // Result returns the result of the asynchronous operation. 13562 // If the operation has not completed it will return an error. 13563 Result func(VirtualMachineScaleSetVMRunCommandsClient) (VirtualMachineRunCommand, error) 13564} 13565 13566// VirtualMachineScaleSetVMRunCommandsDeleteFuture an abstraction for monitoring and retrieving the results 13567// of a long-running operation. 13568type VirtualMachineScaleSetVMRunCommandsDeleteFuture struct { 13569 azure.FutureAPI 13570 // Result returns the result of the asynchronous operation. 13571 // If the operation has not completed it will return an error. 13572 Result func(VirtualMachineScaleSetVMRunCommandsClient) (autorest.Response, error) 13573} 13574 13575// VirtualMachineScaleSetVMRunCommandsUpdateFuture an abstraction for monitoring and retrieving the results 13576// of a long-running operation. 13577type VirtualMachineScaleSetVMRunCommandsUpdateFuture struct { 13578 azure.FutureAPI 13579 // Result returns the result of the asynchronous operation. 13580 // If the operation has not completed it will return an error. 13581 Result func(VirtualMachineScaleSetVMRunCommandsClient) (VirtualMachineRunCommand, error) 13582} 13583 13584// VirtualMachineScaleSetVMsDeallocateFuture an abstraction for monitoring and retrieving the results of a 13585// long-running operation. 13586type VirtualMachineScaleSetVMsDeallocateFuture struct { 13587 azure.FutureAPI 13588 // Result returns the result of the asynchronous operation. 13589 // If the operation has not completed it will return an error. 13590 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 13591} 13592 13593// VirtualMachineScaleSetVMsDeleteFuture an abstraction for monitoring and retrieving the results of a 13594// long-running operation. 13595type VirtualMachineScaleSetVMsDeleteFuture struct { 13596 azure.FutureAPI 13597 // Result returns the result of the asynchronous operation. 13598 // If the operation has not completed it will return an error. 13599 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 13600} 13601 13602// VirtualMachineScaleSetVMsPerformMaintenanceFuture an abstraction for monitoring and retrieving the 13603// results of a long-running operation. 13604type VirtualMachineScaleSetVMsPerformMaintenanceFuture struct { 13605 azure.FutureAPI 13606 // Result returns the result of the asynchronous operation. 13607 // If the operation has not completed it will return an error. 13608 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 13609} 13610 13611// VirtualMachineScaleSetVMsPowerOffFuture an abstraction for monitoring and retrieving the results of a 13612// long-running operation. 13613type VirtualMachineScaleSetVMsPowerOffFuture struct { 13614 azure.FutureAPI 13615 // Result returns the result of the asynchronous operation. 13616 // If the operation has not completed it will return an error. 13617 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 13618} 13619 13620// VirtualMachineScaleSetVMsRedeployFuture an abstraction for monitoring and retrieving the results of a 13621// long-running operation. 13622type VirtualMachineScaleSetVMsRedeployFuture struct { 13623 azure.FutureAPI 13624 // Result returns the result of the asynchronous operation. 13625 // If the operation has not completed it will return an error. 13626 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 13627} 13628 13629// VirtualMachineScaleSetVMsReimageAllFuture an abstraction for monitoring and retrieving the results of a 13630// long-running operation. 13631type VirtualMachineScaleSetVMsReimageAllFuture struct { 13632 azure.FutureAPI 13633 // Result returns the result of the asynchronous operation. 13634 // If the operation has not completed it will return an error. 13635 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 13636} 13637 13638// VirtualMachineScaleSetVMsReimageFuture an abstraction for monitoring and retrieving the results of a 13639// long-running operation. 13640type VirtualMachineScaleSetVMsReimageFuture struct { 13641 azure.FutureAPI 13642 // Result returns the result of the asynchronous operation. 13643 // If the operation has not completed it will return an error. 13644 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 13645} 13646 13647// VirtualMachineScaleSetVMsRestartFuture an abstraction for monitoring and retrieving the results of a 13648// long-running operation. 13649type VirtualMachineScaleSetVMsRestartFuture struct { 13650 azure.FutureAPI 13651 // Result returns the result of the asynchronous operation. 13652 // If the operation has not completed it will return an error. 13653 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 13654} 13655 13656// VirtualMachineScaleSetVMsRunCommandFuture an abstraction for monitoring and retrieving the results of a 13657// long-running operation. 13658type VirtualMachineScaleSetVMsRunCommandFuture struct { 13659 azure.FutureAPI 13660 // Result returns the result of the asynchronous operation. 13661 // If the operation has not completed it will return an error. 13662 Result func(VirtualMachineScaleSetVMsClient) (RunCommandResult, error) 13663} 13664 13665// VirtualMachineScaleSetVMsStartFuture an abstraction for monitoring and retrieving the results of a 13666// long-running operation. 13667type VirtualMachineScaleSetVMsStartFuture struct { 13668 azure.FutureAPI 13669 // Result returns the result of the asynchronous operation. 13670 // If the operation has not completed it will return an error. 13671 Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) 13672} 13673 13674// VirtualMachineScaleSetVMsUpdateFuture an abstraction for monitoring and retrieving the results of a 13675// long-running operation. 13676type VirtualMachineScaleSetVMsUpdateFuture struct { 13677 azure.FutureAPI 13678 // Result returns the result of the asynchronous operation. 13679 // If the operation has not completed it will return an error. 13680 Result func(VirtualMachineScaleSetVMsClient) (VirtualMachineScaleSetVM, error) 13681} 13682 13683// VirtualMachinesCaptureFuture an abstraction for monitoring and retrieving the results of a long-running 13684// operation. 13685type VirtualMachinesCaptureFuture struct { 13686 azure.FutureAPI 13687 // Result returns the result of the asynchronous operation. 13688 // If the operation has not completed it will return an error. 13689 Result func(VirtualMachinesClient) (VirtualMachineCaptureResult, error) 13690} 13691 13692// VirtualMachinesConvertToManagedDisksFuture an abstraction for monitoring and retrieving the results of a 13693// long-running operation. 13694type VirtualMachinesConvertToManagedDisksFuture struct { 13695 azure.FutureAPI 13696 // Result returns the result of the asynchronous operation. 13697 // If the operation has not completed it will return an error. 13698 Result func(VirtualMachinesClient) (autorest.Response, error) 13699} 13700 13701// VirtualMachinesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 13702// long-running operation. 13703type VirtualMachinesCreateOrUpdateFuture struct { 13704 azure.FutureAPI 13705 // Result returns the result of the asynchronous operation. 13706 // If the operation has not completed it will return an error. 13707 Result func(VirtualMachinesClient) (VirtualMachine, error) 13708} 13709 13710// VirtualMachinesDeallocateFuture an abstraction for monitoring and retrieving the results of a 13711// long-running operation. 13712type VirtualMachinesDeallocateFuture struct { 13713 azure.FutureAPI 13714 // Result returns the result of the asynchronous operation. 13715 // If the operation has not completed it will return an error. 13716 Result func(VirtualMachinesClient) (autorest.Response, error) 13717} 13718 13719// VirtualMachinesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 13720// operation. 13721type VirtualMachinesDeleteFuture struct { 13722 azure.FutureAPI 13723 // Result returns the result of the asynchronous operation. 13724 // If the operation has not completed it will return an error. 13725 Result func(VirtualMachinesClient) (autorest.Response, error) 13726} 13727 13728// VirtualMachineSize describes the properties of a VM size. 13729type VirtualMachineSize struct { 13730 // Name - The name of the virtual machine size. 13731 Name *string `json:"name,omitempty"` 13732 // NumberOfCores - The number of cores supported by the virtual machine size. 13733 NumberOfCores *int32 `json:"numberOfCores,omitempty"` 13734 // OsDiskSizeInMB - The OS disk size, in MB, allowed by the virtual machine size. 13735 OsDiskSizeInMB *int32 `json:"osDiskSizeInMB,omitempty"` 13736 // ResourceDiskSizeInMB - The resource disk size, in MB, allowed by the virtual machine size. 13737 ResourceDiskSizeInMB *int32 `json:"resourceDiskSizeInMB,omitempty"` 13738 // MemoryInMB - The amount of memory, in MB, supported by the virtual machine size. 13739 MemoryInMB *int32 `json:"memoryInMB,omitempty"` 13740 // MaxDataDiskCount - The maximum number of data disks that can be attached to the virtual machine size. 13741 MaxDataDiskCount *int32 `json:"maxDataDiskCount,omitempty"` 13742} 13743 13744// VirtualMachineSizeListResult the List Virtual Machine operation response. 13745type VirtualMachineSizeListResult struct { 13746 autorest.Response `json:"-"` 13747 // Value - The list of virtual machine sizes. 13748 Value *[]VirtualMachineSize `json:"value,omitempty"` 13749} 13750 13751// VirtualMachineSoftwarePatchProperties describes the properties of a Virtual Machine software patch. 13752type VirtualMachineSoftwarePatchProperties struct { 13753 // PatchID - READ-ONLY; A unique identifier for the patch. 13754 PatchID *string `json:"patchId,omitempty"` 13755 // Name - READ-ONLY; The friendly name of the patch. 13756 Name *string `json:"name,omitempty"` 13757 // Version - READ-ONLY; The version number of the patch. This property applies only to Linux patches. 13758 Version *string `json:"version,omitempty"` 13759 // Kbid - READ-ONLY; The KBID of the patch. Only applies to Windows patches. 13760 Kbid *string `json:"kbid,omitempty"` 13761 // Classifications - READ-ONLY; The classification(s) of the patch as provided by the patch publisher. 13762 Classifications *[]string `json:"classifications,omitempty"` 13763 // RebootBehavior - READ-ONLY; Describes the reboot requirements of the patch. Possible values include: 'NeverReboots', 'AlwaysRequiresReboot', 'CanRequestReboot' 13764 RebootBehavior SoftwareUpdateRebootBehavior `json:"rebootBehavior,omitempty"` 13765 // ActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. 13766 ActivityID *string `json:"activityId,omitempty"` 13767 // PublishedDate - READ-ONLY; The UTC timestamp when the repository published this patch. 13768 PublishedDate *date.Time `json:"publishedDate,omitempty"` 13769 // LastModifiedDateTime - READ-ONLY; The UTC timestamp of the last update to this patch record. 13770 LastModifiedDateTime *date.Time `json:"lastModifiedDateTime,omitempty"` 13771 // AssessmentState - READ-ONLY; Describes the outcome of an install operation for a given patch. Possible values include: 'PatchAssessmentStateInstalled', 'PatchAssessmentStateFailed', 'PatchAssessmentStateExcluded', 'PatchAssessmentStateNotSelected', 'PatchAssessmentStatePending', 'PatchAssessmentStateAvailable' 13772 AssessmentState PatchAssessmentState `json:"assessmentState,omitempty"` 13773} 13774 13775// VirtualMachinesPerformMaintenanceFuture an abstraction for monitoring and retrieving the results of a 13776// long-running operation. 13777type VirtualMachinesPerformMaintenanceFuture struct { 13778 azure.FutureAPI 13779 // Result returns the result of the asynchronous operation. 13780 // If the operation has not completed it will return an error. 13781 Result func(VirtualMachinesClient) (autorest.Response, error) 13782} 13783 13784// VirtualMachinesPowerOffFuture an abstraction for monitoring and retrieving the results of a long-running 13785// operation. 13786type VirtualMachinesPowerOffFuture struct { 13787 azure.FutureAPI 13788 // Result returns the result of the asynchronous operation. 13789 // If the operation has not completed it will return an error. 13790 Result func(VirtualMachinesClient) (autorest.Response, error) 13791} 13792 13793// VirtualMachinesReapplyFuture an abstraction for monitoring and retrieving the results of a long-running 13794// operation. 13795type VirtualMachinesReapplyFuture struct { 13796 azure.FutureAPI 13797 // Result returns the result of the asynchronous operation. 13798 // If the operation has not completed it will return an error. 13799 Result func(VirtualMachinesClient) (autorest.Response, error) 13800} 13801 13802// VirtualMachinesRedeployFuture an abstraction for monitoring and retrieving the results of a long-running 13803// operation. 13804type VirtualMachinesRedeployFuture struct { 13805 azure.FutureAPI 13806 // Result returns the result of the asynchronous operation. 13807 // If the operation has not completed it will return an error. 13808 Result func(VirtualMachinesClient) (autorest.Response, error) 13809} 13810 13811// VirtualMachinesReimageFuture an abstraction for monitoring and retrieving the results of a long-running 13812// operation. 13813type VirtualMachinesReimageFuture struct { 13814 azure.FutureAPI 13815 // Result returns the result of the asynchronous operation. 13816 // If the operation has not completed it will return an error. 13817 Result func(VirtualMachinesClient) (autorest.Response, error) 13818} 13819 13820// VirtualMachinesRestartFuture an abstraction for monitoring and retrieving the results of a long-running 13821// operation. 13822type VirtualMachinesRestartFuture struct { 13823 azure.FutureAPI 13824 // Result returns the result of the asynchronous operation. 13825 // If the operation has not completed it will return an error. 13826 Result func(VirtualMachinesClient) (autorest.Response, error) 13827} 13828 13829// VirtualMachinesRunCommandFuture an abstraction for monitoring and retrieving the results of a 13830// long-running operation. 13831type VirtualMachinesRunCommandFuture struct { 13832 azure.FutureAPI 13833 // Result returns the result of the asynchronous operation. 13834 // If the operation has not completed it will return an error. 13835 Result func(VirtualMachinesClient) (RunCommandResult, error) 13836} 13837 13838// VirtualMachinesStartFuture an abstraction for monitoring and retrieving the results of a long-running 13839// operation. 13840type VirtualMachinesStartFuture struct { 13841 azure.FutureAPI 13842 // Result returns the result of the asynchronous operation. 13843 // If the operation has not completed it will return an error. 13844 Result func(VirtualMachinesClient) (autorest.Response, error) 13845} 13846 13847// VirtualMachineStatusCodeCount the status code and count of the virtual machine scale set instance view 13848// status summary. 13849type VirtualMachineStatusCodeCount struct { 13850 // Code - READ-ONLY; The instance view status code. 13851 Code *string `json:"code,omitempty"` 13852 // Count - READ-ONLY; The number of instances having a particular status code. 13853 Count *int32 `json:"count,omitempty"` 13854} 13855 13856// VirtualMachinesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 13857// operation. 13858type VirtualMachinesUpdateFuture struct { 13859 azure.FutureAPI 13860 // Result returns the result of the asynchronous operation. 13861 // If the operation has not completed it will return an error. 13862 Result func(VirtualMachinesClient) (VirtualMachine, error) 13863} 13864 13865// VirtualMachineUpdate describes a Virtual Machine Update. 13866type VirtualMachineUpdate struct { 13867 // 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**. 13868 Plan *Plan `json:"plan,omitempty"` 13869 *VirtualMachineProperties `json:"properties,omitempty"` 13870 // Identity - The identity of the virtual machine, if configured. 13871 Identity *VirtualMachineIdentity `json:"identity,omitempty"` 13872 // Zones - The virtual machine zones. 13873 Zones *[]string `json:"zones,omitempty"` 13874 // Tags - Resource tags 13875 Tags map[string]*string `json:"tags"` 13876} 13877 13878// MarshalJSON is the custom marshaler for VirtualMachineUpdate. 13879func (vmu VirtualMachineUpdate) MarshalJSON() ([]byte, error) { 13880 objectMap := make(map[string]interface{}) 13881 if vmu.Plan != nil { 13882 objectMap["plan"] = vmu.Plan 13883 } 13884 if vmu.VirtualMachineProperties != nil { 13885 objectMap["properties"] = vmu.VirtualMachineProperties 13886 } 13887 if vmu.Identity != nil { 13888 objectMap["identity"] = vmu.Identity 13889 } 13890 if vmu.Zones != nil { 13891 objectMap["zones"] = vmu.Zones 13892 } 13893 if vmu.Tags != nil { 13894 objectMap["tags"] = vmu.Tags 13895 } 13896 return json.Marshal(objectMap) 13897} 13898 13899// UnmarshalJSON is the custom unmarshaler for VirtualMachineUpdate struct. 13900func (vmu *VirtualMachineUpdate) UnmarshalJSON(body []byte) error { 13901 var m map[string]*json.RawMessage 13902 err := json.Unmarshal(body, &m) 13903 if err != nil { 13904 return err 13905 } 13906 for k, v := range m { 13907 switch k { 13908 case "plan": 13909 if v != nil { 13910 var plan Plan 13911 err = json.Unmarshal(*v, &plan) 13912 if err != nil { 13913 return err 13914 } 13915 vmu.Plan = &plan 13916 } 13917 case "properties": 13918 if v != nil { 13919 var virtualMachineProperties VirtualMachineProperties 13920 err = json.Unmarshal(*v, &virtualMachineProperties) 13921 if err != nil { 13922 return err 13923 } 13924 vmu.VirtualMachineProperties = &virtualMachineProperties 13925 } 13926 case "identity": 13927 if v != nil { 13928 var identity VirtualMachineIdentity 13929 err = json.Unmarshal(*v, &identity) 13930 if err != nil { 13931 return err 13932 } 13933 vmu.Identity = &identity 13934 } 13935 case "zones": 13936 if v != nil { 13937 var zones []string 13938 err = json.Unmarshal(*v, &zones) 13939 if err != nil { 13940 return err 13941 } 13942 vmu.Zones = &zones 13943 } 13944 case "tags": 13945 if v != nil { 13946 var tags map[string]*string 13947 err = json.Unmarshal(*v, &tags) 13948 if err != nil { 13949 return err 13950 } 13951 vmu.Tags = tags 13952 } 13953 } 13954 } 13955 13956 return nil 13957} 13958 13959// VMScaleSetConvertToSinglePlacementGroupInput ... 13960type VMScaleSetConvertToSinglePlacementGroupInput struct { 13961 // 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. 13962 ActivePlacementGroupID *string `json:"activePlacementGroupId,omitempty"` 13963} 13964 13965// WindowsConfiguration specifies Windows operating system settings on the virtual machine. 13966type WindowsConfiguration struct { 13967 // 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. 13968 ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` 13969 // 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. 13970 EnableAutomaticUpdates *bool `json:"enableAutomaticUpdates,omitempty"` 13971 // 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). 13972 TimeZone *string `json:"timeZone,omitempty"` 13973 // AdditionalUnattendContent - Specifies additional base-64 encoded XML formatted information that can be included in the Unattend.xml file, which is used by Windows Setup. 13974 AdditionalUnattendContent *[]AdditionalUnattendContent `json:"additionalUnattendContent,omitempty"` 13975 // PatchSettings - Specifies settings related to in-guest patching (KBs). 13976 PatchSettings *PatchSettings `json:"patchSettings,omitempty"` 13977 // WinRM - Specifies the Windows Remote Management listeners. This enables remote Windows PowerShell. 13978 WinRM *WinRMConfiguration `json:"winRM,omitempty"` 13979} 13980 13981// WinRMConfiguration describes Windows Remote Management configuration of the VM 13982type WinRMConfiguration struct { 13983 // Listeners - The list of Windows Remote Management listeners 13984 Listeners *[]WinRMListener `json:"listeners,omitempty"` 13985} 13986 13987// WinRMListener describes Protocol and thumbprint of Windows Remote Management listener 13988type WinRMListener struct { 13989 // Protocol - Specifies the protocol of WinRM listener. <br><br> Possible values are: <br>**http** <br><br> **https**. Possible values include: 'HTTP', 'HTTPS' 13990 Protocol ProtocolTypes `json:"protocol,omitempty"` 13991 // 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>} 13992 CertificateURL *string `json:"certificateUrl,omitempty"` 13993} 13994