1package containerservice 2 3// Copyright (c) Microsoft Corporation. All rights reserved. 4// Licensed under the MIT License. See License.txt in the project root for license information. 5// 6// Code generated by Microsoft (R) AutoRest Code Generator. 7// Changes may cause incorrect behavior and will be lost if the code is regenerated. 8 9import ( 10 "context" 11 "encoding/json" 12 "github.com/Azure/go-autorest/autorest" 13 "github.com/Azure/go-autorest/autorest/azure" 14 "github.com/Azure/go-autorest/autorest/to" 15 "github.com/Azure/go-autorest/tracing" 16 "net/http" 17) 18 19// The package's fully qualified name. 20const fqdn = "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2017-09-30/containerservice" 21 22// AccessProfile profile for enabling a user to access a managed cluster. 23type AccessProfile struct { 24 // KubeConfig - Base64-encoded Kubernetes configuration file. 25 KubeConfig *[]byte `json:"kubeConfig,omitempty"` 26} 27 28// AgentPoolProfile profile for the container service agent pool. 29type AgentPoolProfile struct { 30 // Name - Unique name of the agent pool profile in the context of the subscription and resource group. 31 Name *string `json:"name,omitempty"` 32 // 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. 33 Count *int32 `json:"count,omitempty"` 34 // VMSize - Size of agent VMs. Possible values include: 'StandardA1', 'StandardA10', 'StandardA11', 'StandardA1V2', 'StandardA2', 'StandardA2V2', 'StandardA2mV2', 'StandardA3', 'StandardA4', 'StandardA4V2', 'StandardA4mV2', 'StandardA5', 'StandardA6', 'StandardA7', 'StandardA8', 'StandardA8V2', 'StandardA8mV2', 'StandardA9', 'StandardB2ms', 'StandardB2s', 'StandardB4ms', 'StandardB8ms', 'StandardD1', 'StandardD11', 'StandardD11V2', 'StandardD11V2Promo', 'StandardD12', 'StandardD12V2', 'StandardD12V2Promo', 'StandardD13', 'StandardD13V2', 'StandardD13V2Promo', 'StandardD14', 'StandardD14V2', 'StandardD14V2Promo', 'StandardD15V2', 'StandardD16V3', 'StandardD16sV3', 'StandardD1V2', 'StandardD2', 'StandardD2V2', 'StandardD2V2Promo', 'StandardD2V3', 'StandardD2sV3', 'StandardD3', 'StandardD32V3', 'StandardD32sV3', 'StandardD3V2', 'StandardD3V2Promo', 'StandardD4', 'StandardD4V2', 'StandardD4V2Promo', 'StandardD4V3', 'StandardD4sV3', 'StandardD5V2', 'StandardD5V2Promo', 'StandardD64V3', 'StandardD64sV3', 'StandardD8V3', 'StandardD8sV3', 'StandardDS1', 'StandardDS11', 'StandardDS11V2', 'StandardDS11V2Promo', 'StandardDS12', 'StandardDS12V2', 'StandardDS12V2Promo', 'StandardDS13', 'StandardDS132V2', 'StandardDS134V2', 'StandardDS13V2', 'StandardDS13V2Promo', 'StandardDS14', 'StandardDS144V2', 'StandardDS148V2', 'StandardDS14V2', 'StandardDS14V2Promo', 'StandardDS15V2', 'StandardDS1V2', 'StandardDS2', 'StandardDS2V2', 'StandardDS2V2Promo', 'StandardDS3', 'StandardDS3V2', 'StandardDS3V2Promo', 'StandardDS4', 'StandardDS4V2', 'StandardDS4V2Promo', 'StandardDS5V2', 'StandardDS5V2Promo', 'StandardE16V3', 'StandardE16sV3', 'StandardE2V3', 'StandardE2sV3', 'StandardE3216sV3', 'StandardE328sV3', 'StandardE32V3', 'StandardE32sV3', 'StandardE4V3', 'StandardE4sV3', 'StandardE6416sV3', 'StandardE6432sV3', 'StandardE64V3', 'StandardE64sV3', 'StandardE8V3', 'StandardE8sV3', 'StandardF1', 'StandardF16', 'StandardF16s', 'StandardF16sV2', 'StandardF1s', 'StandardF2', 'StandardF2s', 'StandardF2sV2', 'StandardF32sV2', 'StandardF4', 'StandardF4s', 'StandardF4sV2', 'StandardF64sV2', 'StandardF72sV2', 'StandardF8', 'StandardF8s', 'StandardF8sV2', 'StandardG1', 'StandardG2', 'StandardG3', 'StandardG4', 'StandardG5', 'StandardGS1', 'StandardGS2', 'StandardGS3', 'StandardGS4', 'StandardGS44', 'StandardGS48', 'StandardGS5', 'StandardGS516', 'StandardGS58', 'StandardH16', 'StandardH16m', 'StandardH16mr', 'StandardH16r', 'StandardH8', 'StandardH8m', 'StandardL16s', 'StandardL32s', 'StandardL4s', 'StandardL8s', 'StandardM12832ms', 'StandardM12864ms', 'StandardM128ms', 'StandardM128s', 'StandardM6416ms', 'StandardM6432ms', 'StandardM64ms', 'StandardM64s', 'StandardNC12', 'StandardNC12sV2', 'StandardNC12sV3', 'StandardNC24', 'StandardNC24r', 'StandardNC24rsV2', 'StandardNC24rsV3', 'StandardNC24sV2', 'StandardNC24sV3', 'StandardNC6', 'StandardNC6sV2', 'StandardNC6sV3', 'StandardND12s', 'StandardND24rs', 'StandardND24s', 'StandardND6s', 'StandardNV12', 'StandardNV24', 'StandardNV6' 35 VMSize VMSizeTypes `json:"vmSize,omitempty"` 36 // OsDiskSizeGB - OS Disk Size in GB to be used to specify the disk size for every machine in this master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. 37 OsDiskSizeGB *int32 `json:"osDiskSizeGB,omitempty"` 38 // DNSPrefix - DNS prefix to be used to create the FQDN for the agent pool. 39 DNSPrefix *string `json:"dnsPrefix,omitempty"` 40 // Fqdn - READ-ONLY; FQDN for the agent pool. 41 Fqdn *string `json:"fqdn,omitempty"` 42 // Ports - Ports number array used to expose on this agent pool. The default opened ports are different based on your choice of orchestrator. 43 Ports *[]int32 `json:"ports,omitempty"` 44 // StorageProfile - Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. Possible values include: 'StorageAccount', 'ManagedDisks' 45 StorageProfile StorageProfileTypes `json:"storageProfile,omitempty"` 46 // VnetSubnetID - VNet SubnetID specifies the VNet's subnet identifier. 47 VnetSubnetID *string `json:"vnetSubnetID,omitempty"` 48 // OsType - OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: 'Linux', 'Windows' 49 OsType OSType `json:"osType,omitempty"` 50} 51 52// MarshalJSON is the custom marshaler for AgentPoolProfile. 53func (app AgentPoolProfile) MarshalJSON() ([]byte, error) { 54 objectMap := make(map[string]interface{}) 55 if app.Name != nil { 56 objectMap["name"] = app.Name 57 } 58 if app.Count != nil { 59 objectMap["count"] = app.Count 60 } 61 if app.VMSize != "" { 62 objectMap["vmSize"] = app.VMSize 63 } 64 if app.OsDiskSizeGB != nil { 65 objectMap["osDiskSizeGB"] = app.OsDiskSizeGB 66 } 67 if app.DNSPrefix != nil { 68 objectMap["dnsPrefix"] = app.DNSPrefix 69 } 70 if app.Ports != nil { 71 objectMap["ports"] = app.Ports 72 } 73 if app.StorageProfile != "" { 74 objectMap["storageProfile"] = app.StorageProfile 75 } 76 if app.VnetSubnetID != nil { 77 objectMap["vnetSubnetID"] = app.VnetSubnetID 78 } 79 if app.OsType != "" { 80 objectMap["osType"] = app.OsType 81 } 82 return json.Marshal(objectMap) 83} 84 85// ContainerService container service. 86type ContainerService struct { 87 autorest.Response `json:"-"` 88 // Properties - Properties of the container service. 89 *Properties `json:"properties,omitempty"` 90 // ID - READ-ONLY; Resource Id 91 ID *string `json:"id,omitempty"` 92 // Name - READ-ONLY; Resource name 93 Name *string `json:"name,omitempty"` 94 // Type - READ-ONLY; Resource type 95 Type *string `json:"type,omitempty"` 96 // Location - Resource location 97 Location *string `json:"location,omitempty"` 98 // Tags - Resource tags 99 Tags map[string]*string `json:"tags"` 100} 101 102// MarshalJSON is the custom marshaler for ContainerService. 103func (cs ContainerService) MarshalJSON() ([]byte, error) { 104 objectMap := make(map[string]interface{}) 105 if cs.Properties != nil { 106 objectMap["properties"] = cs.Properties 107 } 108 if cs.Location != nil { 109 objectMap["location"] = cs.Location 110 } 111 if cs.Tags != nil { 112 objectMap["tags"] = cs.Tags 113 } 114 return json.Marshal(objectMap) 115} 116 117// UnmarshalJSON is the custom unmarshaler for ContainerService struct. 118func (cs *ContainerService) UnmarshalJSON(body []byte) error { 119 var m map[string]*json.RawMessage 120 err := json.Unmarshal(body, &m) 121 if err != nil { 122 return err 123 } 124 for k, v := range m { 125 switch k { 126 case "properties": 127 if v != nil { 128 var properties Properties 129 err = json.Unmarshal(*v, &properties) 130 if err != nil { 131 return err 132 } 133 cs.Properties = &properties 134 } 135 case "id": 136 if v != nil { 137 var ID string 138 err = json.Unmarshal(*v, &ID) 139 if err != nil { 140 return err 141 } 142 cs.ID = &ID 143 } 144 case "name": 145 if v != nil { 146 var name string 147 err = json.Unmarshal(*v, &name) 148 if err != nil { 149 return err 150 } 151 cs.Name = &name 152 } 153 case "type": 154 if v != nil { 155 var typeVar string 156 err = json.Unmarshal(*v, &typeVar) 157 if err != nil { 158 return err 159 } 160 cs.Type = &typeVar 161 } 162 case "location": 163 if v != nil { 164 var location string 165 err = json.Unmarshal(*v, &location) 166 if err != nil { 167 return err 168 } 169 cs.Location = &location 170 } 171 case "tags": 172 if v != nil { 173 var tags map[string]*string 174 err = json.Unmarshal(*v, &tags) 175 if err != nil { 176 return err 177 } 178 cs.Tags = tags 179 } 180 } 181 } 182 183 return nil 184} 185 186// ContainerServicesCreateOrUpdateFutureType an abstraction for monitoring and retrieving the results of a 187// long-running operation. 188type ContainerServicesCreateOrUpdateFutureType struct { 189 azure.FutureAPI 190 // Result returns the result of the asynchronous operation. 191 // If the operation has not completed it will return an error. 192 Result func(ContainerServicesClient) (ContainerService, error) 193} 194 195// UnmarshalJSON is the custom unmarshaller for CreateFuture. 196func (future *ContainerServicesCreateOrUpdateFutureType) UnmarshalJSON(body []byte) error { 197 var azFuture azure.Future 198 if err := json.Unmarshal(body, &azFuture); err != nil { 199 return err 200 } 201 future.FutureAPI = &azFuture 202 future.Result = future.result 203 return nil 204} 205 206// result is the default implementation for ContainerServicesCreateOrUpdateFutureType.Result. 207func (future *ContainerServicesCreateOrUpdateFutureType) result(client ContainerServicesClient) (cs ContainerService, err error) { 208 var done bool 209 done, err = future.DoneWithContext(context.Background(), client) 210 if err != nil { 211 err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesCreateOrUpdateFutureType", "Result", future.Response(), "Polling failure") 212 return 213 } 214 if !done { 215 cs.Response.Response = future.Response() 216 err = azure.NewAsyncOpIncompleteError("containerservice.ContainerServicesCreateOrUpdateFutureType") 217 return 218 } 219 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 220 if cs.Response.Response, err = future.GetResult(sender); err == nil && cs.Response.Response.StatusCode != http.StatusNoContent { 221 cs, err = client.CreateOrUpdateResponder(cs.Response.Response) 222 if err != nil { 223 err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesCreateOrUpdateFutureType", "Result", cs.Response.Response, "Failure responding to request") 224 } 225 } 226 return 227} 228 229// ContainerServicesDeleteFutureType an abstraction for monitoring and retrieving the results of a 230// long-running operation. 231type ContainerServicesDeleteFutureType struct { 232 azure.FutureAPI 233 // Result returns the result of the asynchronous operation. 234 // If the operation has not completed it will return an error. 235 Result func(ContainerServicesClient) (autorest.Response, error) 236} 237 238// UnmarshalJSON is the custom unmarshaller for CreateFuture. 239func (future *ContainerServicesDeleteFutureType) UnmarshalJSON(body []byte) error { 240 var azFuture azure.Future 241 if err := json.Unmarshal(body, &azFuture); err != nil { 242 return err 243 } 244 future.FutureAPI = &azFuture 245 future.Result = future.result 246 return nil 247} 248 249// result is the default implementation for ContainerServicesDeleteFutureType.Result. 250func (future *ContainerServicesDeleteFutureType) result(client ContainerServicesClient) (ar autorest.Response, err error) { 251 var done bool 252 done, err = future.DoneWithContext(context.Background(), client) 253 if err != nil { 254 err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesDeleteFutureType", "Result", future.Response(), "Polling failure") 255 return 256 } 257 if !done { 258 ar.Response = future.Response() 259 err = azure.NewAsyncOpIncompleteError("containerservice.ContainerServicesDeleteFutureType") 260 return 261 } 262 ar.Response = future.Response() 263 return 264} 265 266// CustomProfile properties to configure a custom container service cluster. 267type CustomProfile struct { 268 // Orchestrator - The name of the custom orchestrator to use. 269 Orchestrator *string `json:"orchestrator,omitempty"` 270} 271 272// DiagnosticsProfile profile for diagnostics on the container service cluster. 273type DiagnosticsProfile struct { 274 // VMDiagnostics - Profile for diagnostics on the container service VMs. 275 VMDiagnostics *VMDiagnostics `json:"vmDiagnostics,omitempty"` 276} 277 278// KeyVaultSecretRef reference to a secret stored in Azure Key Vault. 279type KeyVaultSecretRef struct { 280 // VaultID - Key vault identifier. 281 VaultID *string `json:"vaultID,omitempty"` 282 // SecretName - The secret name. 283 SecretName *string `json:"secretName,omitempty"` 284 // Version - The secret version. 285 Version *string `json:"version,omitempty"` 286} 287 288// LinuxProfile profile for Linux VMs in the container service cluster. 289type LinuxProfile struct { 290 // AdminUsername - The administrator username to use for Linux VMs. 291 AdminUsername *string `json:"adminUsername,omitempty"` 292 // SSH - SSH configuration for Linux-based VMs running on Azure. 293 SSH *SSHConfiguration `json:"ssh,omitempty"` 294} 295 296// ListResult the response from the List Container Services operation. 297type ListResult struct { 298 autorest.Response `json:"-"` 299 // Value - The list of container services. 300 Value *[]ContainerService `json:"value,omitempty"` 301 // NextLink - READ-ONLY; The URL to get the next set of container service results. 302 NextLink *string `json:"nextLink,omitempty"` 303} 304 305// MarshalJSON is the custom marshaler for ListResult. 306func (lr ListResult) MarshalJSON() ([]byte, error) { 307 objectMap := make(map[string]interface{}) 308 if lr.Value != nil { 309 objectMap["value"] = lr.Value 310 } 311 return json.Marshal(objectMap) 312} 313 314// ListResultIterator provides access to a complete listing of ContainerService values. 315type ListResultIterator struct { 316 i int 317 page ListResultPage 318} 319 320// NextWithContext advances to the next value. If there was an error making 321// the request the iterator does not advance and the error is returned. 322func (iter *ListResultIterator) NextWithContext(ctx context.Context) (err error) { 323 if tracing.IsEnabled() { 324 ctx = tracing.StartSpan(ctx, fqdn+"/ListResultIterator.NextWithContext") 325 defer func() { 326 sc := -1 327 if iter.Response().Response.Response != nil { 328 sc = iter.Response().Response.Response.StatusCode 329 } 330 tracing.EndSpan(ctx, sc, err) 331 }() 332 } 333 iter.i++ 334 if iter.i < len(iter.page.Values()) { 335 return nil 336 } 337 err = iter.page.NextWithContext(ctx) 338 if err != nil { 339 iter.i-- 340 return err 341 } 342 iter.i = 0 343 return nil 344} 345 346// Next advances to the next value. If there was an error making 347// the request the iterator does not advance and the error is returned. 348// Deprecated: Use NextWithContext() instead. 349func (iter *ListResultIterator) Next() error { 350 return iter.NextWithContext(context.Background()) 351} 352 353// NotDone returns true if the enumeration should be started or is not yet complete. 354func (iter ListResultIterator) NotDone() bool { 355 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 356} 357 358// Response returns the raw server response from the last page request. 359func (iter ListResultIterator) Response() ListResult { 360 return iter.page.Response() 361} 362 363// Value returns the current value or a zero-initialized value if the 364// iterator has advanced beyond the end of the collection. 365func (iter ListResultIterator) Value() ContainerService { 366 if !iter.page.NotDone() { 367 return ContainerService{} 368 } 369 return iter.page.Values()[iter.i] 370} 371 372// Creates a new instance of the ListResultIterator type. 373func NewListResultIterator(page ListResultPage) ListResultIterator { 374 return ListResultIterator{page: page} 375} 376 377// IsEmpty returns true if the ListResult contains no values. 378func (lr ListResult) IsEmpty() bool { 379 return lr.Value == nil || len(*lr.Value) == 0 380} 381 382// hasNextLink returns true if the NextLink is not empty. 383func (lr ListResult) hasNextLink() bool { 384 return lr.NextLink != nil && len(*lr.NextLink) != 0 385} 386 387// listResultPreparer prepares a request to retrieve the next set of results. 388// It returns nil if no more results exist. 389func (lr ListResult) listResultPreparer(ctx context.Context) (*http.Request, error) { 390 if !lr.hasNextLink() { 391 return nil, nil 392 } 393 return autorest.Prepare((&http.Request{}).WithContext(ctx), 394 autorest.AsJSON(), 395 autorest.AsGet(), 396 autorest.WithBaseURL(to.String(lr.NextLink))) 397} 398 399// ListResultPage contains a page of ContainerService values. 400type ListResultPage struct { 401 fn func(context.Context, ListResult) (ListResult, error) 402 lr ListResult 403} 404 405// NextWithContext advances to the next page of values. If there was an error making 406// the request the page does not advance and the error is returned. 407func (page *ListResultPage) NextWithContext(ctx context.Context) (err error) { 408 if tracing.IsEnabled() { 409 ctx = tracing.StartSpan(ctx, fqdn+"/ListResultPage.NextWithContext") 410 defer func() { 411 sc := -1 412 if page.Response().Response.Response != nil { 413 sc = page.Response().Response.Response.StatusCode 414 } 415 tracing.EndSpan(ctx, sc, err) 416 }() 417 } 418 for { 419 next, err := page.fn(ctx, page.lr) 420 if err != nil { 421 return err 422 } 423 page.lr = next 424 if !next.hasNextLink() || !next.IsEmpty() { 425 break 426 } 427 } 428 return nil 429} 430 431// Next advances to the next page of values. If there was an error making 432// the request the page does not advance and the error is returned. 433// Deprecated: Use NextWithContext() instead. 434func (page *ListResultPage) Next() error { 435 return page.NextWithContext(context.Background()) 436} 437 438// NotDone returns true if the page enumeration should be started or is not yet complete. 439func (page ListResultPage) NotDone() bool { 440 return !page.lr.IsEmpty() 441} 442 443// Response returns the raw server response from the last page request. 444func (page ListResultPage) Response() ListResult { 445 return page.lr 446} 447 448// Values returns the slice of values for the current page or nil if there are no values. 449func (page ListResultPage) Values() []ContainerService { 450 if page.lr.IsEmpty() { 451 return nil 452 } 453 return *page.lr.Value 454} 455 456// Creates a new instance of the ListResultPage type. 457func NewListResultPage(cur ListResult, getNextPage func(context.Context, ListResult) (ListResult, error)) ListResultPage { 458 return ListResultPage{ 459 fn: getNextPage, 460 lr: cur, 461 } 462} 463 464// ManagedCluster managed cluster. 465type ManagedCluster struct { 466 autorest.Response `json:"-"` 467 // ManagedClusterProperties - Properties of a managed cluster. 468 *ManagedClusterProperties `json:"properties,omitempty"` 469 // ID - READ-ONLY; Resource Id 470 ID *string `json:"id,omitempty"` 471 // Name - READ-ONLY; Resource name 472 Name *string `json:"name,omitempty"` 473 // Type - READ-ONLY; Resource type 474 Type *string `json:"type,omitempty"` 475 // Location - Resource location 476 Location *string `json:"location,omitempty"` 477 // Tags - Resource tags 478 Tags map[string]*string `json:"tags"` 479} 480 481// MarshalJSON is the custom marshaler for ManagedCluster. 482func (mc ManagedCluster) MarshalJSON() ([]byte, error) { 483 objectMap := make(map[string]interface{}) 484 if mc.ManagedClusterProperties != nil { 485 objectMap["properties"] = mc.ManagedClusterProperties 486 } 487 if mc.Location != nil { 488 objectMap["location"] = mc.Location 489 } 490 if mc.Tags != nil { 491 objectMap["tags"] = mc.Tags 492 } 493 return json.Marshal(objectMap) 494} 495 496// UnmarshalJSON is the custom unmarshaler for ManagedCluster struct. 497func (mc *ManagedCluster) UnmarshalJSON(body []byte) error { 498 var m map[string]*json.RawMessage 499 err := json.Unmarshal(body, &m) 500 if err != nil { 501 return err 502 } 503 for k, v := range m { 504 switch k { 505 case "properties": 506 if v != nil { 507 var managedClusterProperties ManagedClusterProperties 508 err = json.Unmarshal(*v, &managedClusterProperties) 509 if err != nil { 510 return err 511 } 512 mc.ManagedClusterProperties = &managedClusterProperties 513 } 514 case "id": 515 if v != nil { 516 var ID string 517 err = json.Unmarshal(*v, &ID) 518 if err != nil { 519 return err 520 } 521 mc.ID = &ID 522 } 523 case "name": 524 if v != nil { 525 var name string 526 err = json.Unmarshal(*v, &name) 527 if err != nil { 528 return err 529 } 530 mc.Name = &name 531 } 532 case "type": 533 if v != nil { 534 var typeVar string 535 err = json.Unmarshal(*v, &typeVar) 536 if err != nil { 537 return err 538 } 539 mc.Type = &typeVar 540 } 541 case "location": 542 if v != nil { 543 var location string 544 err = json.Unmarshal(*v, &location) 545 if err != nil { 546 return err 547 } 548 mc.Location = &location 549 } 550 case "tags": 551 if v != nil { 552 var tags map[string]*string 553 err = json.Unmarshal(*v, &tags) 554 if err != nil { 555 return err 556 } 557 mc.Tags = tags 558 } 559 } 560 } 561 562 return nil 563} 564 565// ManagedClusterAccessProfile managed cluster Access Profile. 566type ManagedClusterAccessProfile struct { 567 autorest.Response `json:"-"` 568 // AccessProfile - AccessProfile of a managed cluster. 569 *AccessProfile `json:"properties,omitempty"` 570 // ID - READ-ONLY; Resource Id 571 ID *string `json:"id,omitempty"` 572 // Name - READ-ONLY; Resource name 573 Name *string `json:"name,omitempty"` 574 // Type - READ-ONLY; Resource type 575 Type *string `json:"type,omitempty"` 576 // Location - Resource location 577 Location *string `json:"location,omitempty"` 578 // Tags - Resource tags 579 Tags map[string]*string `json:"tags"` 580} 581 582// MarshalJSON is the custom marshaler for ManagedClusterAccessProfile. 583func (mcap ManagedClusterAccessProfile) MarshalJSON() ([]byte, error) { 584 objectMap := make(map[string]interface{}) 585 if mcap.AccessProfile != nil { 586 objectMap["properties"] = mcap.AccessProfile 587 } 588 if mcap.Location != nil { 589 objectMap["location"] = mcap.Location 590 } 591 if mcap.Tags != nil { 592 objectMap["tags"] = mcap.Tags 593 } 594 return json.Marshal(objectMap) 595} 596 597// UnmarshalJSON is the custom unmarshaler for ManagedClusterAccessProfile struct. 598func (mcap *ManagedClusterAccessProfile) UnmarshalJSON(body []byte) error { 599 var m map[string]*json.RawMessage 600 err := json.Unmarshal(body, &m) 601 if err != nil { 602 return err 603 } 604 for k, v := range m { 605 switch k { 606 case "properties": 607 if v != nil { 608 var accessProfile AccessProfile 609 err = json.Unmarshal(*v, &accessProfile) 610 if err != nil { 611 return err 612 } 613 mcap.AccessProfile = &accessProfile 614 } 615 case "id": 616 if v != nil { 617 var ID string 618 err = json.Unmarshal(*v, &ID) 619 if err != nil { 620 return err 621 } 622 mcap.ID = &ID 623 } 624 case "name": 625 if v != nil { 626 var name string 627 err = json.Unmarshal(*v, &name) 628 if err != nil { 629 return err 630 } 631 mcap.Name = &name 632 } 633 case "type": 634 if v != nil { 635 var typeVar string 636 err = json.Unmarshal(*v, &typeVar) 637 if err != nil { 638 return err 639 } 640 mcap.Type = &typeVar 641 } 642 case "location": 643 if v != nil { 644 var location string 645 err = json.Unmarshal(*v, &location) 646 if err != nil { 647 return err 648 } 649 mcap.Location = &location 650 } 651 case "tags": 652 if v != nil { 653 var tags map[string]*string 654 err = json.Unmarshal(*v, &tags) 655 if err != nil { 656 return err 657 } 658 mcap.Tags = tags 659 } 660 } 661 } 662 663 return nil 664} 665 666// ManagedClusterListResult the response from the List Managed Clusters operation. 667type ManagedClusterListResult struct { 668 autorest.Response `json:"-"` 669 // Value - The list of managed clusters. 670 Value *[]ManagedCluster `json:"value,omitempty"` 671 // NextLink - READ-ONLY; The URL to get the next set of managed cluster results. 672 NextLink *string `json:"nextLink,omitempty"` 673} 674 675// MarshalJSON is the custom marshaler for ManagedClusterListResult. 676func (mclr ManagedClusterListResult) MarshalJSON() ([]byte, error) { 677 objectMap := make(map[string]interface{}) 678 if mclr.Value != nil { 679 objectMap["value"] = mclr.Value 680 } 681 return json.Marshal(objectMap) 682} 683 684// ManagedClusterListResultIterator provides access to a complete listing of ManagedCluster values. 685type ManagedClusterListResultIterator struct { 686 i int 687 page ManagedClusterListResultPage 688} 689 690// NextWithContext advances to the next value. If there was an error making 691// the request the iterator does not advance and the error is returned. 692func (iter *ManagedClusterListResultIterator) NextWithContext(ctx context.Context) (err error) { 693 if tracing.IsEnabled() { 694 ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClusterListResultIterator.NextWithContext") 695 defer func() { 696 sc := -1 697 if iter.Response().Response.Response != nil { 698 sc = iter.Response().Response.Response.StatusCode 699 } 700 tracing.EndSpan(ctx, sc, err) 701 }() 702 } 703 iter.i++ 704 if iter.i < len(iter.page.Values()) { 705 return nil 706 } 707 err = iter.page.NextWithContext(ctx) 708 if err != nil { 709 iter.i-- 710 return err 711 } 712 iter.i = 0 713 return nil 714} 715 716// Next advances to the next value. If there was an error making 717// the request the iterator does not advance and the error is returned. 718// Deprecated: Use NextWithContext() instead. 719func (iter *ManagedClusterListResultIterator) Next() error { 720 return iter.NextWithContext(context.Background()) 721} 722 723// NotDone returns true if the enumeration should be started or is not yet complete. 724func (iter ManagedClusterListResultIterator) NotDone() bool { 725 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 726} 727 728// Response returns the raw server response from the last page request. 729func (iter ManagedClusterListResultIterator) Response() ManagedClusterListResult { 730 return iter.page.Response() 731} 732 733// Value returns the current value or a zero-initialized value if the 734// iterator has advanced beyond the end of the collection. 735func (iter ManagedClusterListResultIterator) Value() ManagedCluster { 736 if !iter.page.NotDone() { 737 return ManagedCluster{} 738 } 739 return iter.page.Values()[iter.i] 740} 741 742// Creates a new instance of the ManagedClusterListResultIterator type. 743func NewManagedClusterListResultIterator(page ManagedClusterListResultPage) ManagedClusterListResultIterator { 744 return ManagedClusterListResultIterator{page: page} 745} 746 747// IsEmpty returns true if the ListResult contains no values. 748func (mclr ManagedClusterListResult) IsEmpty() bool { 749 return mclr.Value == nil || len(*mclr.Value) == 0 750} 751 752// hasNextLink returns true if the NextLink is not empty. 753func (mclr ManagedClusterListResult) hasNextLink() bool { 754 return mclr.NextLink != nil && len(*mclr.NextLink) != 0 755} 756 757// managedClusterListResultPreparer prepares a request to retrieve the next set of results. 758// It returns nil if no more results exist. 759func (mclr ManagedClusterListResult) managedClusterListResultPreparer(ctx context.Context) (*http.Request, error) { 760 if !mclr.hasNextLink() { 761 return nil, nil 762 } 763 return autorest.Prepare((&http.Request{}).WithContext(ctx), 764 autorest.AsJSON(), 765 autorest.AsGet(), 766 autorest.WithBaseURL(to.String(mclr.NextLink))) 767} 768 769// ManagedClusterListResultPage contains a page of ManagedCluster values. 770type ManagedClusterListResultPage struct { 771 fn func(context.Context, ManagedClusterListResult) (ManagedClusterListResult, error) 772 mclr ManagedClusterListResult 773} 774 775// NextWithContext advances to the next page of values. If there was an error making 776// the request the page does not advance and the error is returned. 777func (page *ManagedClusterListResultPage) NextWithContext(ctx context.Context) (err error) { 778 if tracing.IsEnabled() { 779 ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClusterListResultPage.NextWithContext") 780 defer func() { 781 sc := -1 782 if page.Response().Response.Response != nil { 783 sc = page.Response().Response.Response.StatusCode 784 } 785 tracing.EndSpan(ctx, sc, err) 786 }() 787 } 788 for { 789 next, err := page.fn(ctx, page.mclr) 790 if err != nil { 791 return err 792 } 793 page.mclr = next 794 if !next.hasNextLink() || !next.IsEmpty() { 795 break 796 } 797 } 798 return nil 799} 800 801// Next 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. 803// Deprecated: Use NextWithContext() instead. 804func (page *ManagedClusterListResultPage) Next() error { 805 return page.NextWithContext(context.Background()) 806} 807 808// NotDone returns true if the page enumeration should be started or is not yet complete. 809func (page ManagedClusterListResultPage) NotDone() bool { 810 return !page.mclr.IsEmpty() 811} 812 813// Response returns the raw server response from the last page request. 814func (page ManagedClusterListResultPage) Response() ManagedClusterListResult { 815 return page.mclr 816} 817 818// Values returns the slice of values for the current page or nil if there are no values. 819func (page ManagedClusterListResultPage) Values() []ManagedCluster { 820 if page.mclr.IsEmpty() { 821 return nil 822 } 823 return *page.mclr.Value 824} 825 826// Creates a new instance of the ManagedClusterListResultPage type. 827func NewManagedClusterListResultPage(cur ManagedClusterListResult, getNextPage func(context.Context, ManagedClusterListResult) (ManagedClusterListResult, error)) ManagedClusterListResultPage { 828 return ManagedClusterListResultPage{ 829 fn: getNextPage, 830 mclr: cur, 831 } 832} 833 834// ManagedClusterPoolUpgradeProfile the list of available upgrade versions. 835type ManagedClusterPoolUpgradeProfile struct { 836 // KubernetesVersion - Kubernetes version (major, minor, patch). 837 KubernetesVersion *string `json:"kubernetesVersion,omitempty"` 838 // Name - Pool name. 839 Name *string `json:"name,omitempty"` 840 // OsType - OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: 'Linux', 'Windows' 841 OsType OSType `json:"osType,omitempty"` 842 // Upgrades - List of orchestrator types and versions available for upgrade. 843 Upgrades *[]string `json:"upgrades,omitempty"` 844} 845 846// ManagedClusterProperties properties of the managed cluster. 847type ManagedClusterProperties struct { 848 // ProvisioningState - READ-ONLY; The current deployment or provisioning state, which only appears in the response. 849 ProvisioningState *string `json:"provisioningState,omitempty"` 850 // DNSPrefix - DNS prefix specified when creating the managed cluster. 851 DNSPrefix *string `json:"dnsPrefix,omitempty"` 852 // Fqdn - READ-ONLY; FQDN for the master pool. 853 Fqdn *string `json:"fqdn,omitempty"` 854 // KubernetesVersion - Version of Kubernetes specified when creating the managed cluster. 855 KubernetesVersion *string `json:"kubernetesVersion,omitempty"` 856 // AgentPoolProfiles - Properties of the agent pool. 857 AgentPoolProfiles *[]AgentPoolProfile `json:"agentPoolProfiles,omitempty"` 858 // LinuxProfile - Profile for Linux VMs in the container service cluster. 859 LinuxProfile *LinuxProfile `json:"linuxProfile,omitempty"` 860 // ServicePrincipalProfile - Information about a service principal identity for the cluster to use for manipulating Azure APIs. Either secret or keyVaultSecretRef must be specified. 861 ServicePrincipalProfile *ServicePrincipalProfile `json:"servicePrincipalProfile,omitempty"` 862} 863 864// MarshalJSON is the custom marshaler for ManagedClusterProperties. 865func (mcp ManagedClusterProperties) MarshalJSON() ([]byte, error) { 866 objectMap := make(map[string]interface{}) 867 if mcp.DNSPrefix != nil { 868 objectMap["dnsPrefix"] = mcp.DNSPrefix 869 } 870 if mcp.KubernetesVersion != nil { 871 objectMap["kubernetesVersion"] = mcp.KubernetesVersion 872 } 873 if mcp.AgentPoolProfiles != nil { 874 objectMap["agentPoolProfiles"] = mcp.AgentPoolProfiles 875 } 876 if mcp.LinuxProfile != nil { 877 objectMap["linuxProfile"] = mcp.LinuxProfile 878 } 879 if mcp.ServicePrincipalProfile != nil { 880 objectMap["servicePrincipalProfile"] = mcp.ServicePrincipalProfile 881 } 882 return json.Marshal(objectMap) 883} 884 885// ManagedClustersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 886// long-running operation. 887type ManagedClustersCreateOrUpdateFuture struct { 888 azure.FutureAPI 889 // Result returns the result of the asynchronous operation. 890 // If the operation has not completed it will return an error. 891 Result func(ManagedClustersClient) (ManagedCluster, error) 892} 893 894// UnmarshalJSON is the custom unmarshaller for CreateFuture. 895func (future *ManagedClustersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 896 var azFuture azure.Future 897 if err := json.Unmarshal(body, &azFuture); err != nil { 898 return err 899 } 900 future.FutureAPI = &azFuture 901 future.Result = future.result 902 return nil 903} 904 905// result is the default implementation for ManagedClustersCreateOrUpdateFuture.Result. 906func (future *ManagedClustersCreateOrUpdateFuture) result(client ManagedClustersClient) (mc ManagedCluster, err error) { 907 var done bool 908 done, err = future.DoneWithContext(context.Background(), client) 909 if err != nil { 910 err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 911 return 912 } 913 if !done { 914 mc.Response.Response = future.Response() 915 err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersCreateOrUpdateFuture") 916 return 917 } 918 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 919 if mc.Response.Response, err = future.GetResult(sender); err == nil && mc.Response.Response.StatusCode != http.StatusNoContent { 920 mc, err = client.CreateOrUpdateResponder(mc.Response.Response) 921 if err != nil { 922 err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersCreateOrUpdateFuture", "Result", mc.Response.Response, "Failure responding to request") 923 } 924 } 925 return 926} 927 928// ManagedClustersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 929// operation. 930type ManagedClustersDeleteFuture struct { 931 azure.FutureAPI 932 // Result returns the result of the asynchronous operation. 933 // If the operation has not completed it will return an error. 934 Result func(ManagedClustersClient) (autorest.Response, error) 935} 936 937// UnmarshalJSON is the custom unmarshaller for CreateFuture. 938func (future *ManagedClustersDeleteFuture) UnmarshalJSON(body []byte) error { 939 var azFuture azure.Future 940 if err := json.Unmarshal(body, &azFuture); err != nil { 941 return err 942 } 943 future.FutureAPI = &azFuture 944 future.Result = future.result 945 return nil 946} 947 948// result is the default implementation for ManagedClustersDeleteFuture.Result. 949func (future *ManagedClustersDeleteFuture) result(client ManagedClustersClient) (ar autorest.Response, err error) { 950 var done bool 951 done, err = future.DoneWithContext(context.Background(), client) 952 if err != nil { 953 err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersDeleteFuture", "Result", future.Response(), "Polling failure") 954 return 955 } 956 if !done { 957 ar.Response = future.Response() 958 err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersDeleteFuture") 959 return 960 } 961 ar.Response = future.Response() 962 return 963} 964 965// ManagedClusterUpgradeProfile the list of available upgrades for compute pools. 966type ManagedClusterUpgradeProfile struct { 967 autorest.Response `json:"-"` 968 // ID - READ-ONLY; Id of upgrade profile. 969 ID *string `json:"id,omitempty"` 970 // Name - READ-ONLY; Name of upgrade profile. 971 Name *string `json:"name,omitempty"` 972 // Type - READ-ONLY; Type of upgrade profile. 973 Type *string `json:"type,omitempty"` 974 // ManagedClusterUpgradeProfileProperties - Properties of upgrade profile. 975 *ManagedClusterUpgradeProfileProperties `json:"properties,omitempty"` 976} 977 978// MarshalJSON is the custom marshaler for ManagedClusterUpgradeProfile. 979func (mcup ManagedClusterUpgradeProfile) MarshalJSON() ([]byte, error) { 980 objectMap := make(map[string]interface{}) 981 if mcup.ManagedClusterUpgradeProfileProperties != nil { 982 objectMap["properties"] = mcup.ManagedClusterUpgradeProfileProperties 983 } 984 return json.Marshal(objectMap) 985} 986 987// UnmarshalJSON is the custom unmarshaler for ManagedClusterUpgradeProfile struct. 988func (mcup *ManagedClusterUpgradeProfile) UnmarshalJSON(body []byte) error { 989 var m map[string]*json.RawMessage 990 err := json.Unmarshal(body, &m) 991 if err != nil { 992 return err 993 } 994 for k, v := range m { 995 switch k { 996 case "id": 997 if v != nil { 998 var ID string 999 err = json.Unmarshal(*v, &ID) 1000 if err != nil { 1001 return err 1002 } 1003 mcup.ID = &ID 1004 } 1005 case "name": 1006 if v != nil { 1007 var name string 1008 err = json.Unmarshal(*v, &name) 1009 if err != nil { 1010 return err 1011 } 1012 mcup.Name = &name 1013 } 1014 case "type": 1015 if v != nil { 1016 var typeVar string 1017 err = json.Unmarshal(*v, &typeVar) 1018 if err != nil { 1019 return err 1020 } 1021 mcup.Type = &typeVar 1022 } 1023 case "properties": 1024 if v != nil { 1025 var managedClusterUpgradeProfileProperties ManagedClusterUpgradeProfileProperties 1026 err = json.Unmarshal(*v, &managedClusterUpgradeProfileProperties) 1027 if err != nil { 1028 return err 1029 } 1030 mcup.ManagedClusterUpgradeProfileProperties = &managedClusterUpgradeProfileProperties 1031 } 1032 } 1033 } 1034 1035 return nil 1036} 1037 1038// ManagedClusterUpgradeProfileProperties control plane and agent pool upgrade profiles. 1039type ManagedClusterUpgradeProfileProperties struct { 1040 // ControlPlaneProfile - The list of available upgrade versions for the control plane. 1041 ControlPlaneProfile *ManagedClusterPoolUpgradeProfile `json:"controlPlaneProfile,omitempty"` 1042 // AgentPoolProfiles - The list of available upgrade versions for agent pools. 1043 AgentPoolProfiles *[]ManagedClusterPoolUpgradeProfile `json:"agentPoolProfiles,omitempty"` 1044} 1045 1046// MasterProfile profile for the container service master. 1047type MasterProfile struct { 1048 // Count - Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. 1049 Count *int32 `json:"count,omitempty"` 1050 // DNSPrefix - DNS prefix to be used to create the FQDN for the master pool. 1051 DNSPrefix *string `json:"dnsPrefix,omitempty"` 1052 // VMSize - Size of agent VMs. Possible values include: 'StandardA1', 'StandardA10', 'StandardA11', 'StandardA1V2', 'StandardA2', 'StandardA2V2', 'StandardA2mV2', 'StandardA3', 'StandardA4', 'StandardA4V2', 'StandardA4mV2', 'StandardA5', 'StandardA6', 'StandardA7', 'StandardA8', 'StandardA8V2', 'StandardA8mV2', 'StandardA9', 'StandardB2ms', 'StandardB2s', 'StandardB4ms', 'StandardB8ms', 'StandardD1', 'StandardD11', 'StandardD11V2', 'StandardD11V2Promo', 'StandardD12', 'StandardD12V2', 'StandardD12V2Promo', 'StandardD13', 'StandardD13V2', 'StandardD13V2Promo', 'StandardD14', 'StandardD14V2', 'StandardD14V2Promo', 'StandardD15V2', 'StandardD16V3', 'StandardD16sV3', 'StandardD1V2', 'StandardD2', 'StandardD2V2', 'StandardD2V2Promo', 'StandardD2V3', 'StandardD2sV3', 'StandardD3', 'StandardD32V3', 'StandardD32sV3', 'StandardD3V2', 'StandardD3V2Promo', 'StandardD4', 'StandardD4V2', 'StandardD4V2Promo', 'StandardD4V3', 'StandardD4sV3', 'StandardD5V2', 'StandardD5V2Promo', 'StandardD64V3', 'StandardD64sV3', 'StandardD8V3', 'StandardD8sV3', 'StandardDS1', 'StandardDS11', 'StandardDS11V2', 'StandardDS11V2Promo', 'StandardDS12', 'StandardDS12V2', 'StandardDS12V2Promo', 'StandardDS13', 'StandardDS132V2', 'StandardDS134V2', 'StandardDS13V2', 'StandardDS13V2Promo', 'StandardDS14', 'StandardDS144V2', 'StandardDS148V2', 'StandardDS14V2', 'StandardDS14V2Promo', 'StandardDS15V2', 'StandardDS1V2', 'StandardDS2', 'StandardDS2V2', 'StandardDS2V2Promo', 'StandardDS3', 'StandardDS3V2', 'StandardDS3V2Promo', 'StandardDS4', 'StandardDS4V2', 'StandardDS4V2Promo', 'StandardDS5V2', 'StandardDS5V2Promo', 'StandardE16V3', 'StandardE16sV3', 'StandardE2V3', 'StandardE2sV3', 'StandardE3216sV3', 'StandardE328sV3', 'StandardE32V3', 'StandardE32sV3', 'StandardE4V3', 'StandardE4sV3', 'StandardE6416sV3', 'StandardE6432sV3', 'StandardE64V3', 'StandardE64sV3', 'StandardE8V3', 'StandardE8sV3', 'StandardF1', 'StandardF16', 'StandardF16s', 'StandardF16sV2', 'StandardF1s', 'StandardF2', 'StandardF2s', 'StandardF2sV2', 'StandardF32sV2', 'StandardF4', 'StandardF4s', 'StandardF4sV2', 'StandardF64sV2', 'StandardF72sV2', 'StandardF8', 'StandardF8s', 'StandardF8sV2', 'StandardG1', 'StandardG2', 'StandardG3', 'StandardG4', 'StandardG5', 'StandardGS1', 'StandardGS2', 'StandardGS3', 'StandardGS4', 'StandardGS44', 'StandardGS48', 'StandardGS5', 'StandardGS516', 'StandardGS58', 'StandardH16', 'StandardH16m', 'StandardH16mr', 'StandardH16r', 'StandardH8', 'StandardH8m', 'StandardL16s', 'StandardL32s', 'StandardL4s', 'StandardL8s', 'StandardM12832ms', 'StandardM12864ms', 'StandardM128ms', 'StandardM128s', 'StandardM6416ms', 'StandardM6432ms', 'StandardM64ms', 'StandardM64s', 'StandardNC12', 'StandardNC12sV2', 'StandardNC12sV3', 'StandardNC24', 'StandardNC24r', 'StandardNC24rsV2', 'StandardNC24rsV3', 'StandardNC24sV2', 'StandardNC24sV3', 'StandardNC6', 'StandardNC6sV2', 'StandardNC6sV3', 'StandardND12s', 'StandardND24rs', 'StandardND24s', 'StandardND6s', 'StandardNV12', 'StandardNV24', 'StandardNV6' 1053 VMSize VMSizeTypes `json:"vmSize,omitempty"` 1054 // OsDiskSizeGB - OS Disk Size in GB to be used to specify the disk size for every machine in this master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. 1055 OsDiskSizeGB *int32 `json:"osDiskSizeGB,omitempty"` 1056 // VnetSubnetID - VNet SubnetID specifies the VNet's subnet identifier. 1057 VnetSubnetID *string `json:"vnetSubnetID,omitempty"` 1058 // FirstConsecutiveStaticIP - FirstConsecutiveStaticIP used to specify the first static ip of masters. 1059 FirstConsecutiveStaticIP *string `json:"firstConsecutiveStaticIP,omitempty"` 1060 // StorageProfile - Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. Possible values include: 'StorageAccount', 'ManagedDisks' 1061 StorageProfile StorageProfileTypes `json:"storageProfile,omitempty"` 1062 // Fqdn - READ-ONLY; FQDN for the master pool. 1063 Fqdn *string `json:"fqdn,omitempty"` 1064} 1065 1066// MarshalJSON is the custom marshaler for MasterProfile. 1067func (mp MasterProfile) MarshalJSON() ([]byte, error) { 1068 objectMap := make(map[string]interface{}) 1069 if mp.Count != nil { 1070 objectMap["count"] = mp.Count 1071 } 1072 if mp.DNSPrefix != nil { 1073 objectMap["dnsPrefix"] = mp.DNSPrefix 1074 } 1075 if mp.VMSize != "" { 1076 objectMap["vmSize"] = mp.VMSize 1077 } 1078 if mp.OsDiskSizeGB != nil { 1079 objectMap["osDiskSizeGB"] = mp.OsDiskSizeGB 1080 } 1081 if mp.VnetSubnetID != nil { 1082 objectMap["vnetSubnetID"] = mp.VnetSubnetID 1083 } 1084 if mp.FirstConsecutiveStaticIP != nil { 1085 objectMap["firstConsecutiveStaticIP"] = mp.FirstConsecutiveStaticIP 1086 } 1087 if mp.StorageProfile != "" { 1088 objectMap["storageProfile"] = mp.StorageProfile 1089 } 1090 return json.Marshal(objectMap) 1091} 1092 1093// OrchestratorProfile contains information about orchestrator. 1094type OrchestratorProfile struct { 1095 // OrchestratorType - Orchestrator type. 1096 OrchestratorType *string `json:"orchestratorType,omitempty"` 1097 // OrchestratorVersion - Orchestrator version (major, minor, patch). 1098 OrchestratorVersion *string `json:"orchestratorVersion,omitempty"` 1099} 1100 1101// OrchestratorProfileType profile for the container service orchestrator. 1102type OrchestratorProfileType struct { 1103 // OrchestratorType - The orchestrator to use to manage container service cluster resources. Valid values are Kubernetes, Swarm, DCOS, DockerCE and Custom. Possible values include: 'Kubernetes', 'Swarm', 'DCOS', 'DockerCE', 'Custom' 1104 OrchestratorType OrchestratorTypes `json:"orchestratorType,omitempty"` 1105 // OrchestratorVersion - The version of the orchestrator to use. You can specify the major.minor.patch part of the actual version.For example, you can specify version as "1.6.11". 1106 OrchestratorVersion *string `json:"orchestratorVersion,omitempty"` 1107} 1108 1109// OrchestratorVersionProfile the profile of an orchestrator and its available versions. 1110type OrchestratorVersionProfile struct { 1111 // OrchestratorType - Orchestrator type. 1112 OrchestratorType *string `json:"orchestratorType,omitempty"` 1113 // OrchestratorVersion - Orchestrator version (major, minor, patch). 1114 OrchestratorVersion *string `json:"orchestratorVersion,omitempty"` 1115 // Default - Installed by default if version is not specified. 1116 Default *bool `json:"default,omitempty"` 1117 // Upgrades - The list of available upgrade versions. 1118 Upgrades *[]OrchestratorProfile `json:"upgrades,omitempty"` 1119} 1120 1121// OrchestratorVersionProfileListResult the list of versions for supported orchestrators. 1122type OrchestratorVersionProfileListResult struct { 1123 autorest.Response `json:"-"` 1124 // ID - READ-ONLY; Id of the orchestrator version profile list result. 1125 ID *string `json:"id,omitempty"` 1126 // Name - READ-ONLY; Name of the orchestrator version profile list result. 1127 Name *string `json:"name,omitempty"` 1128 // Type - READ-ONLY; Type of the orchestrator version profile list result. 1129 Type *string `json:"type,omitempty"` 1130 // OrchestratorVersionProfileProperties - The properties of an orchestrator version profile. 1131 *OrchestratorVersionProfileProperties `json:"properties,omitempty"` 1132} 1133 1134// MarshalJSON is the custom marshaler for OrchestratorVersionProfileListResult. 1135func (ovplr OrchestratorVersionProfileListResult) MarshalJSON() ([]byte, error) { 1136 objectMap := make(map[string]interface{}) 1137 if ovplr.OrchestratorVersionProfileProperties != nil { 1138 objectMap["properties"] = ovplr.OrchestratorVersionProfileProperties 1139 } 1140 return json.Marshal(objectMap) 1141} 1142 1143// UnmarshalJSON is the custom unmarshaler for OrchestratorVersionProfileListResult struct. 1144func (ovplr *OrchestratorVersionProfileListResult) UnmarshalJSON(body []byte) error { 1145 var m map[string]*json.RawMessage 1146 err := json.Unmarshal(body, &m) 1147 if err != nil { 1148 return err 1149 } 1150 for k, v := range m { 1151 switch k { 1152 case "id": 1153 if v != nil { 1154 var ID string 1155 err = json.Unmarshal(*v, &ID) 1156 if err != nil { 1157 return err 1158 } 1159 ovplr.ID = &ID 1160 } 1161 case "name": 1162 if v != nil { 1163 var name string 1164 err = json.Unmarshal(*v, &name) 1165 if err != nil { 1166 return err 1167 } 1168 ovplr.Name = &name 1169 } 1170 case "type": 1171 if v != nil { 1172 var typeVar string 1173 err = json.Unmarshal(*v, &typeVar) 1174 if err != nil { 1175 return err 1176 } 1177 ovplr.Type = &typeVar 1178 } 1179 case "properties": 1180 if v != nil { 1181 var orchestratorVersionProfileProperties OrchestratorVersionProfileProperties 1182 err = json.Unmarshal(*v, &orchestratorVersionProfileProperties) 1183 if err != nil { 1184 return err 1185 } 1186 ovplr.OrchestratorVersionProfileProperties = &orchestratorVersionProfileProperties 1187 } 1188 } 1189 } 1190 1191 return nil 1192} 1193 1194// OrchestratorVersionProfileProperties the properties of an orchestrator version profile. 1195type OrchestratorVersionProfileProperties struct { 1196 // Orchestrators - List of orchestrator version profiles. 1197 Orchestrators *[]OrchestratorVersionProfile `json:"orchestrators,omitempty"` 1198} 1199 1200// Properties properties of the container service. 1201type Properties struct { 1202 // ProvisioningState - READ-ONLY; The current deployment or provisioning state, which only appears in the response. 1203 ProvisioningState *string `json:"provisioningState,omitempty"` 1204 // OrchestratorProfile - Profile for the container service orchestrator. 1205 OrchestratorProfile *OrchestratorProfileType `json:"orchestratorProfile,omitempty"` 1206 // CustomProfile - Properties to configure a custom container service cluster. 1207 CustomProfile *CustomProfile `json:"customProfile,omitempty"` 1208 // ServicePrincipalProfile - Information about a service principal identity for the cluster to use for manipulating Azure APIs. Exact one of secret or keyVaultSecretRef need to be specified. 1209 ServicePrincipalProfile *ServicePrincipalProfile `json:"servicePrincipalProfile,omitempty"` 1210 // MasterProfile - Profile for the container service master. 1211 MasterProfile *MasterProfile `json:"masterProfile,omitempty"` 1212 // AgentPoolProfiles - Properties of the agent pool. 1213 AgentPoolProfiles *[]AgentPoolProfile `json:"agentPoolProfiles,omitempty"` 1214 // WindowsProfile - Profile for Windows VMs in the container service cluster. 1215 WindowsProfile *WindowsProfile `json:"windowsProfile,omitempty"` 1216 // LinuxProfile - Profile for Linux VMs in the container service cluster. 1217 LinuxProfile *LinuxProfile `json:"linuxProfile,omitempty"` 1218 // DiagnosticsProfile - Profile for diagnostics in the container service cluster. 1219 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 1220} 1221 1222// MarshalJSON is the custom marshaler for Properties. 1223func (p Properties) MarshalJSON() ([]byte, error) { 1224 objectMap := make(map[string]interface{}) 1225 if p.OrchestratorProfile != nil { 1226 objectMap["orchestratorProfile"] = p.OrchestratorProfile 1227 } 1228 if p.CustomProfile != nil { 1229 objectMap["customProfile"] = p.CustomProfile 1230 } 1231 if p.ServicePrincipalProfile != nil { 1232 objectMap["servicePrincipalProfile"] = p.ServicePrincipalProfile 1233 } 1234 if p.MasterProfile != nil { 1235 objectMap["masterProfile"] = p.MasterProfile 1236 } 1237 if p.AgentPoolProfiles != nil { 1238 objectMap["agentPoolProfiles"] = p.AgentPoolProfiles 1239 } 1240 if p.WindowsProfile != nil { 1241 objectMap["windowsProfile"] = p.WindowsProfile 1242 } 1243 if p.LinuxProfile != nil { 1244 objectMap["linuxProfile"] = p.LinuxProfile 1245 } 1246 if p.DiagnosticsProfile != nil { 1247 objectMap["diagnosticsProfile"] = p.DiagnosticsProfile 1248 } 1249 return json.Marshal(objectMap) 1250} 1251 1252// Resource the Resource model definition. 1253type Resource struct { 1254 // ID - READ-ONLY; Resource Id 1255 ID *string `json:"id,omitempty"` 1256 // Name - READ-ONLY; Resource name 1257 Name *string `json:"name,omitempty"` 1258 // Type - READ-ONLY; Resource type 1259 Type *string `json:"type,omitempty"` 1260 // Location - Resource location 1261 Location *string `json:"location,omitempty"` 1262 // Tags - Resource tags 1263 Tags map[string]*string `json:"tags"` 1264} 1265 1266// MarshalJSON is the custom marshaler for Resource. 1267func (r Resource) MarshalJSON() ([]byte, error) { 1268 objectMap := make(map[string]interface{}) 1269 if r.Location != nil { 1270 objectMap["location"] = r.Location 1271 } 1272 if r.Tags != nil { 1273 objectMap["tags"] = r.Tags 1274 } 1275 return json.Marshal(objectMap) 1276} 1277 1278// ServicePrincipalProfile information about a service principal identity for the cluster to use for 1279// manipulating Azure APIs. Either secret or keyVaultSecretRef must be specified. 1280type ServicePrincipalProfile struct { 1281 // ClientID - The ID for the service principal. 1282 ClientID *string `json:"clientId,omitempty"` 1283 // Secret - The secret password associated with the service principal in plain text. 1284 Secret *string `json:"secret,omitempty"` 1285 // KeyVaultSecretRef - Reference to a secret stored in Azure Key Vault. 1286 KeyVaultSecretRef *KeyVaultSecretRef `json:"keyVaultSecretRef,omitempty"` 1287} 1288 1289// SSHConfiguration SSH configuration for Linux-based VMs running on Azure. 1290type SSHConfiguration struct { 1291 // PublicKeys - The list of SSH public keys used to authenticate with Linux-based VMs. Only expect one key specified. 1292 PublicKeys *[]SSHPublicKey `json:"publicKeys,omitempty"` 1293} 1294 1295// SSHPublicKey contains information about SSH certificate public key data. 1296type SSHPublicKey struct { 1297 // KeyData - Certificate public key used to authenticate with VMs through SSH. The certificate must be in PEM format with or without headers. 1298 KeyData *string `json:"keyData,omitempty"` 1299} 1300 1301// VMDiagnostics profile for diagnostics on the container service VMs. 1302type VMDiagnostics struct { 1303 // Enabled - Whether the VM diagnostic agent is provisioned on the VM. 1304 Enabled *bool `json:"enabled,omitempty"` 1305 // StorageURI - READ-ONLY; The URI of the storage account where diagnostics are stored. 1306 StorageURI *string `json:"storageUri,omitempty"` 1307} 1308 1309// MarshalJSON is the custom marshaler for VMDiagnostics. 1310func (vd VMDiagnostics) MarshalJSON() ([]byte, error) { 1311 objectMap := make(map[string]interface{}) 1312 if vd.Enabled != nil { 1313 objectMap["enabled"] = vd.Enabled 1314 } 1315 return json.Marshal(objectMap) 1316} 1317 1318// WindowsProfile profile for Windows VMs in the container service cluster. 1319type WindowsProfile struct { 1320 // AdminUsername - The administrator username to use for Windows VMs. 1321 AdminUsername *string `json:"adminUsername,omitempty"` 1322 // AdminPassword - The administrator password to use for Windows VMs. 1323 AdminPassword *string `json:"adminPassword,omitempty"` 1324} 1325