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/preview/containerservice/mgmt/2018-09-30-preview/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: 'VMSizeTypesStandardA1', 'VMSizeTypesStandardA10', 'VMSizeTypesStandardA11', 'VMSizeTypesStandardA1V2', 'VMSizeTypesStandardA2', 'VMSizeTypesStandardA2V2', 'VMSizeTypesStandardA2mV2', 'VMSizeTypesStandardA3', 'VMSizeTypesStandardA4', 'VMSizeTypesStandardA4V2', 'VMSizeTypesStandardA4mV2', 'VMSizeTypesStandardA5', 'VMSizeTypesStandardA6', 'VMSizeTypesStandardA7', 'VMSizeTypesStandardA8', 'VMSizeTypesStandardA8V2', 'VMSizeTypesStandardA8mV2', 'VMSizeTypesStandardA9', 'VMSizeTypesStandardB2ms', 'VMSizeTypesStandardB2s', 'VMSizeTypesStandardB4ms', 'VMSizeTypesStandardB8ms', 'VMSizeTypesStandardD1', 'VMSizeTypesStandardD11', 'VMSizeTypesStandardD11V2', 'VMSizeTypesStandardD11V2Promo', 'VMSizeTypesStandardD12', 'VMSizeTypesStandardD12V2', 'VMSizeTypesStandardD12V2Promo', 'VMSizeTypesStandardD13', 'VMSizeTypesStandardD13V2', 'VMSizeTypesStandardD13V2Promo', 'VMSizeTypesStandardD14', 'VMSizeTypesStandardD14V2', 'VMSizeTypesStandardD14V2Promo', 'VMSizeTypesStandardD15V2', 'VMSizeTypesStandardD16V3', 'VMSizeTypesStandardD16sV3', 'VMSizeTypesStandardD1V2', 'VMSizeTypesStandardD2', 'VMSizeTypesStandardD2V2', 'VMSizeTypesStandardD2V2Promo', 'VMSizeTypesStandardD2V3', 'VMSizeTypesStandardD2sV3', 'VMSizeTypesStandardD3', 'VMSizeTypesStandardD32V3', 'VMSizeTypesStandardD32sV3', 'VMSizeTypesStandardD3V2', 'VMSizeTypesStandardD3V2Promo', 'VMSizeTypesStandardD4', 'VMSizeTypesStandardD4V2', 'VMSizeTypesStandardD4V2Promo', 'VMSizeTypesStandardD4V3', 'VMSizeTypesStandardD4sV3', 'VMSizeTypesStandardD5V2', 'VMSizeTypesStandardD5V2Promo', 'VMSizeTypesStandardD64V3', 'VMSizeTypesStandardD64sV3', 'VMSizeTypesStandardD8V3', 'VMSizeTypesStandardD8sV3', 'VMSizeTypesStandardDS1', 'VMSizeTypesStandardDS11', 'VMSizeTypesStandardDS11V2', 'VMSizeTypesStandardDS11V2Promo', 'VMSizeTypesStandardDS12', 'VMSizeTypesStandardDS12V2', 'VMSizeTypesStandardDS12V2Promo', 'VMSizeTypesStandardDS13', 'VMSizeTypesStandardDS132V2', 'VMSizeTypesStandardDS134V2', 'VMSizeTypesStandardDS13V2', 'VMSizeTypesStandardDS13V2Promo', 'VMSizeTypesStandardDS14', 'VMSizeTypesStandardDS144V2', 'VMSizeTypesStandardDS148V2', 'VMSizeTypesStandardDS14V2', 'VMSizeTypesStandardDS14V2Promo', 'VMSizeTypesStandardDS15V2', 'VMSizeTypesStandardDS1V2', 'VMSizeTypesStandardDS2', 'VMSizeTypesStandardDS2V2', 'VMSizeTypesStandardDS2V2Promo', 'VMSizeTypesStandardDS3', 'VMSizeTypesStandardDS3V2', 'VMSizeTypesStandardDS3V2Promo', 'VMSizeTypesStandardDS4', 'VMSizeTypesStandardDS4V2', 'VMSizeTypesStandardDS4V2Promo', 'VMSizeTypesStandardDS5V2', 'VMSizeTypesStandardDS5V2Promo', 'VMSizeTypesStandardE16V3', 'VMSizeTypesStandardE16sV3', 'VMSizeTypesStandardE2V3', 'VMSizeTypesStandardE2sV3', 'VMSizeTypesStandardE3216sV3', 'VMSizeTypesStandardE328sV3', 'VMSizeTypesStandardE32V3', 'VMSizeTypesStandardE32sV3', 'VMSizeTypesStandardE4V3', 'VMSizeTypesStandardE4sV3', 'VMSizeTypesStandardE6416sV3', 'VMSizeTypesStandardE6432sV3', 'VMSizeTypesStandardE64V3', 'VMSizeTypesStandardE64sV3', 'VMSizeTypesStandardE8V3', 'VMSizeTypesStandardE8sV3', 'VMSizeTypesStandardF1', 'VMSizeTypesStandardF16', 'VMSizeTypesStandardF16s', 'VMSizeTypesStandardF16sV2', 'VMSizeTypesStandardF1s', 'VMSizeTypesStandardF2', 'VMSizeTypesStandardF2s', 'VMSizeTypesStandardF2sV2', 'VMSizeTypesStandardF32sV2', 'VMSizeTypesStandardF4', 'VMSizeTypesStandardF4s', 'VMSizeTypesStandardF4sV2', 'VMSizeTypesStandardF64sV2', 'VMSizeTypesStandardF72sV2', 'VMSizeTypesStandardF8', 'VMSizeTypesStandardF8s', 'VMSizeTypesStandardF8sV2', 'VMSizeTypesStandardG1', 'VMSizeTypesStandardG2', 'VMSizeTypesStandardG3', 'VMSizeTypesStandardG4', 'VMSizeTypesStandardG5', 'VMSizeTypesStandardGS1', 'VMSizeTypesStandardGS2', 'VMSizeTypesStandardGS3', 'VMSizeTypesStandardGS4', 'VMSizeTypesStandardGS44', 'VMSizeTypesStandardGS48', 'VMSizeTypesStandardGS5', 'VMSizeTypesStandardGS516', 'VMSizeTypesStandardGS58', 'VMSizeTypesStandardH16', 'VMSizeTypesStandardH16m', 'VMSizeTypesStandardH16mr', 'VMSizeTypesStandardH16r', 'VMSizeTypesStandardH8', 'VMSizeTypesStandardH8m', 'VMSizeTypesStandardL16s', 'VMSizeTypesStandardL32s', 'VMSizeTypesStandardL4s', 'VMSizeTypesStandardL8s', 'VMSizeTypesStandardM12832ms', 'VMSizeTypesStandardM12864ms', 'VMSizeTypesStandardM128ms', 'VMSizeTypesStandardM128s', 'VMSizeTypesStandardM6416ms', 'VMSizeTypesStandardM6432ms', 'VMSizeTypesStandardM64ms', 'VMSizeTypesStandardM64s', 'VMSizeTypesStandardNC12', 'VMSizeTypesStandardNC12sV2', 'VMSizeTypesStandardNC12sV3', 'VMSizeTypesStandardNC24', 'VMSizeTypesStandardNC24r', 'VMSizeTypesStandardNC24rsV2', 'VMSizeTypesStandardNC24rsV3', 'VMSizeTypesStandardNC24sV2', 'VMSizeTypesStandardNC24sV3', 'VMSizeTypesStandardNC6', 'VMSizeTypesStandardNC6sV2', 'VMSizeTypesStandardNC6sV3', 'VMSizeTypesStandardND12s', 'VMSizeTypesStandardND24rs', 'VMSizeTypesStandardND24s', 'VMSizeTypesStandardND6s', 'VMSizeTypesStandardNV12', 'VMSizeTypesStandardNV24', 'VMSizeTypesStandardNV6' 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// CloudError an error response from the Container service. 86type CloudError struct { 87 // Error - Details about the error. 88 Error *CloudErrorBody `json:"error,omitempty"` 89} 90 91// CloudErrorBody an error response from the Container service. 92type CloudErrorBody struct { 93 // Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically. 94 Code *string `json:"code,omitempty"` 95 // Message - A message describing the error, intended to be suitable for display in a user interface. 96 Message *string `json:"message,omitempty"` 97 // Target - The target of the particular error. For example, the name of the property in error. 98 Target *string `json:"target,omitempty"` 99 // Details - A list of additional details about the error. 100 Details *[]CloudErrorBody `json:"details,omitempty"` 101} 102 103// ContainerService container service. 104type ContainerService struct { 105 autorest.Response `json:"-"` 106 // Properties - Properties of the container service. 107 *Properties `json:"properties,omitempty"` 108 // ID - READ-ONLY; Resource Id 109 ID *string `json:"id,omitempty"` 110 // Name - READ-ONLY; Resource name 111 Name *string `json:"name,omitempty"` 112 // Type - READ-ONLY; Resource type 113 Type *string `json:"type,omitempty"` 114 // Location - Resource location 115 Location *string `json:"location,omitempty"` 116 // Tags - Resource tags 117 Tags map[string]*string `json:"tags"` 118} 119 120// MarshalJSON is the custom marshaler for ContainerService. 121func (cs ContainerService) MarshalJSON() ([]byte, error) { 122 objectMap := make(map[string]interface{}) 123 if cs.Properties != nil { 124 objectMap["properties"] = cs.Properties 125 } 126 if cs.Location != nil { 127 objectMap["location"] = cs.Location 128 } 129 if cs.Tags != nil { 130 objectMap["tags"] = cs.Tags 131 } 132 return json.Marshal(objectMap) 133} 134 135// UnmarshalJSON is the custom unmarshaler for ContainerService struct. 136func (cs *ContainerService) UnmarshalJSON(body []byte) error { 137 var m map[string]*json.RawMessage 138 err := json.Unmarshal(body, &m) 139 if err != nil { 140 return err 141 } 142 for k, v := range m { 143 switch k { 144 case "properties": 145 if v != nil { 146 var properties Properties 147 err = json.Unmarshal(*v, &properties) 148 if err != nil { 149 return err 150 } 151 cs.Properties = &properties 152 } 153 case "id": 154 if v != nil { 155 var ID string 156 err = json.Unmarshal(*v, &ID) 157 if err != nil { 158 return err 159 } 160 cs.ID = &ID 161 } 162 case "name": 163 if v != nil { 164 var name string 165 err = json.Unmarshal(*v, &name) 166 if err != nil { 167 return err 168 } 169 cs.Name = &name 170 } 171 case "type": 172 if v != nil { 173 var typeVar string 174 err = json.Unmarshal(*v, &typeVar) 175 if err != nil { 176 return err 177 } 178 cs.Type = &typeVar 179 } 180 case "location": 181 if v != nil { 182 var location string 183 err = json.Unmarshal(*v, &location) 184 if err != nil { 185 return err 186 } 187 cs.Location = &location 188 } 189 case "tags": 190 if v != nil { 191 var tags map[string]*string 192 err = json.Unmarshal(*v, &tags) 193 if err != nil { 194 return err 195 } 196 cs.Tags = tags 197 } 198 } 199 } 200 201 return nil 202} 203 204// ContainerServicesCreateOrUpdateFutureType an abstraction for monitoring and retrieving the results of a 205// long-running operation. 206type ContainerServicesCreateOrUpdateFutureType struct { 207 azure.FutureAPI 208 // Result returns the result of the asynchronous operation. 209 // If the operation has not completed it will return an error. 210 Result func(ContainerServicesClient) (ContainerService, error) 211} 212 213// UnmarshalJSON is the custom unmarshaller for CreateFuture. 214func (future *ContainerServicesCreateOrUpdateFutureType) UnmarshalJSON(body []byte) error { 215 var azFuture azure.Future 216 if err := json.Unmarshal(body, &azFuture); err != nil { 217 return err 218 } 219 future.FutureAPI = &azFuture 220 future.Result = future.result 221 return nil 222} 223 224// result is the default implementation for ContainerServicesCreateOrUpdateFutureType.Result. 225func (future *ContainerServicesCreateOrUpdateFutureType) result(client ContainerServicesClient) (cs ContainerService, err error) { 226 var done bool 227 done, err = future.DoneWithContext(context.Background(), client) 228 if err != nil { 229 err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesCreateOrUpdateFutureType", "Result", future.Response(), "Polling failure") 230 return 231 } 232 if !done { 233 cs.Response.Response = future.Response() 234 err = azure.NewAsyncOpIncompleteError("containerservice.ContainerServicesCreateOrUpdateFutureType") 235 return 236 } 237 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 238 if cs.Response.Response, err = future.GetResult(sender); err == nil && cs.Response.Response.StatusCode != http.StatusNoContent { 239 cs, err = client.CreateOrUpdateResponder(cs.Response.Response) 240 if err != nil { 241 err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesCreateOrUpdateFutureType", "Result", cs.Response.Response, "Failure responding to request") 242 } 243 } 244 return 245} 246 247// ContainerServicesDeleteFutureType an abstraction for monitoring and retrieving the results of a 248// long-running operation. 249type ContainerServicesDeleteFutureType struct { 250 azure.FutureAPI 251 // Result returns the result of the asynchronous operation. 252 // If the operation has not completed it will return an error. 253 Result func(ContainerServicesClient) (autorest.Response, error) 254} 255 256// UnmarshalJSON is the custom unmarshaller for CreateFuture. 257func (future *ContainerServicesDeleteFutureType) UnmarshalJSON(body []byte) error { 258 var azFuture azure.Future 259 if err := json.Unmarshal(body, &azFuture); err != nil { 260 return err 261 } 262 future.FutureAPI = &azFuture 263 future.Result = future.result 264 return nil 265} 266 267// result is the default implementation for ContainerServicesDeleteFutureType.Result. 268func (future *ContainerServicesDeleteFutureType) result(client ContainerServicesClient) (ar autorest.Response, err error) { 269 var done bool 270 done, err = future.DoneWithContext(context.Background(), client) 271 if err != nil { 272 err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesDeleteFutureType", "Result", future.Response(), "Polling failure") 273 return 274 } 275 if !done { 276 ar.Response = future.Response() 277 err = azure.NewAsyncOpIncompleteError("containerservice.ContainerServicesDeleteFutureType") 278 return 279 } 280 ar.Response = future.Response() 281 return 282} 283 284// CredentialResult the credential result response. 285type CredentialResult struct { 286 // Name - READ-ONLY; The name of the credential. 287 Name *string `json:"name,omitempty"` 288 // Value - READ-ONLY; Base64-encoded Kubernetes configuration file. 289 Value *[]byte `json:"value,omitempty"` 290} 291 292// MarshalJSON is the custom marshaler for CredentialResult. 293func (cr CredentialResult) MarshalJSON() ([]byte, error) { 294 objectMap := make(map[string]interface{}) 295 return json.Marshal(objectMap) 296} 297 298// CredentialResults the list of credential result response. 299type CredentialResults struct { 300 autorest.Response `json:"-"` 301 // Kubeconfigs - READ-ONLY; Base64-encoded Kubernetes configuration file. 302 Kubeconfigs *[]CredentialResult `json:"kubeconfigs,omitempty"` 303} 304 305// MarshalJSON is the custom marshaler for CredentialResults. 306func (cr CredentialResults) MarshalJSON() ([]byte, error) { 307 objectMap := make(map[string]interface{}) 308 return json.Marshal(objectMap) 309} 310 311// CustomProfile properties to configure a custom container service cluster. 312type CustomProfile struct { 313 // Orchestrator - The name of the custom orchestrator to use. 314 Orchestrator *string `json:"orchestrator,omitempty"` 315} 316 317// DiagnosticsProfile profile for diagnostics on the container service cluster. 318type DiagnosticsProfile struct { 319 // VMDiagnostics - Profile for diagnostics on the container service VMs. 320 VMDiagnostics *VMDiagnostics `json:"vmDiagnostics,omitempty"` 321} 322 323// KeyVaultSecretRef reference to a secret stored in Azure Key Vault. 324type KeyVaultSecretRef struct { 325 // VaultID - Key vault identifier. 326 VaultID *string `json:"vaultID,omitempty"` 327 // SecretName - The secret name. 328 SecretName *string `json:"secretName,omitempty"` 329 // Version - The secret version. 330 Version *string `json:"version,omitempty"` 331} 332 333// LinuxProfile profile for Linux VMs in the container service cluster. 334type LinuxProfile struct { 335 // AdminUsername - The administrator username to use for Linux VMs. 336 AdminUsername *string `json:"adminUsername,omitempty"` 337 // SSH - SSH configuration for Linux-based VMs running on Azure. 338 SSH *SSHConfiguration `json:"ssh,omitempty"` 339} 340 341// ListResult the response from the List Container Services operation. 342type ListResult struct { 343 autorest.Response `json:"-"` 344 // Value - The list of container services. 345 Value *[]ContainerService `json:"value,omitempty"` 346 // NextLink - READ-ONLY; The URL to get the next set of container service results. 347 NextLink *string `json:"nextLink,omitempty"` 348} 349 350// MarshalJSON is the custom marshaler for ListResult. 351func (lr ListResult) MarshalJSON() ([]byte, error) { 352 objectMap := make(map[string]interface{}) 353 if lr.Value != nil { 354 objectMap["value"] = lr.Value 355 } 356 return json.Marshal(objectMap) 357} 358 359// ListResultIterator provides access to a complete listing of ContainerService values. 360type ListResultIterator struct { 361 i int 362 page ListResultPage 363} 364 365// NextWithContext advances to the next value. If there was an error making 366// the request the iterator does not advance and the error is returned. 367func (iter *ListResultIterator) NextWithContext(ctx context.Context) (err error) { 368 if tracing.IsEnabled() { 369 ctx = tracing.StartSpan(ctx, fqdn+"/ListResultIterator.NextWithContext") 370 defer func() { 371 sc := -1 372 if iter.Response().Response.Response != nil { 373 sc = iter.Response().Response.Response.StatusCode 374 } 375 tracing.EndSpan(ctx, sc, err) 376 }() 377 } 378 iter.i++ 379 if iter.i < len(iter.page.Values()) { 380 return nil 381 } 382 err = iter.page.NextWithContext(ctx) 383 if err != nil { 384 iter.i-- 385 return err 386 } 387 iter.i = 0 388 return nil 389} 390 391// Next advances to the next value. If there was an error making 392// the request the iterator does not advance and the error is returned. 393// Deprecated: Use NextWithContext() instead. 394func (iter *ListResultIterator) Next() error { 395 return iter.NextWithContext(context.Background()) 396} 397 398// NotDone returns true if the enumeration should be started or is not yet complete. 399func (iter ListResultIterator) NotDone() bool { 400 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 401} 402 403// Response returns the raw server response from the last page request. 404func (iter ListResultIterator) Response() ListResult { 405 return iter.page.Response() 406} 407 408// Value returns the current value or a zero-initialized value if the 409// iterator has advanced beyond the end of the collection. 410func (iter ListResultIterator) Value() ContainerService { 411 if !iter.page.NotDone() { 412 return ContainerService{} 413 } 414 return iter.page.Values()[iter.i] 415} 416 417// Creates a new instance of the ListResultIterator type. 418func NewListResultIterator(page ListResultPage) ListResultIterator { 419 return ListResultIterator{page: page} 420} 421 422// IsEmpty returns true if the ListResult contains no values. 423func (lr ListResult) IsEmpty() bool { 424 return lr.Value == nil || len(*lr.Value) == 0 425} 426 427// hasNextLink returns true if the NextLink is not empty. 428func (lr ListResult) hasNextLink() bool { 429 return lr.NextLink != nil && len(*lr.NextLink) != 0 430} 431 432// listResultPreparer prepares a request to retrieve the next set of results. 433// It returns nil if no more results exist. 434func (lr ListResult) listResultPreparer(ctx context.Context) (*http.Request, error) { 435 if !lr.hasNextLink() { 436 return nil, nil 437 } 438 return autorest.Prepare((&http.Request{}).WithContext(ctx), 439 autorest.AsJSON(), 440 autorest.AsGet(), 441 autorest.WithBaseURL(to.String(lr.NextLink))) 442} 443 444// ListResultPage contains a page of ContainerService values. 445type ListResultPage struct { 446 fn func(context.Context, ListResult) (ListResult, error) 447 lr ListResult 448} 449 450// NextWithContext advances to the next page of values. If there was an error making 451// the request the page does not advance and the error is returned. 452func (page *ListResultPage) NextWithContext(ctx context.Context) (err error) { 453 if tracing.IsEnabled() { 454 ctx = tracing.StartSpan(ctx, fqdn+"/ListResultPage.NextWithContext") 455 defer func() { 456 sc := -1 457 if page.Response().Response.Response != nil { 458 sc = page.Response().Response.Response.StatusCode 459 } 460 tracing.EndSpan(ctx, sc, err) 461 }() 462 } 463 for { 464 next, err := page.fn(ctx, page.lr) 465 if err != nil { 466 return err 467 } 468 page.lr = next 469 if !next.hasNextLink() || !next.IsEmpty() { 470 break 471 } 472 } 473 return nil 474} 475 476// Next advances to the next page of values. If there was an error making 477// the request the page does not advance and the error is returned. 478// Deprecated: Use NextWithContext() instead. 479func (page *ListResultPage) Next() error { 480 return page.NextWithContext(context.Background()) 481} 482 483// NotDone returns true if the page enumeration should be started or is not yet complete. 484func (page ListResultPage) NotDone() bool { 485 return !page.lr.IsEmpty() 486} 487 488// Response returns the raw server response from the last page request. 489func (page ListResultPage) Response() ListResult { 490 return page.lr 491} 492 493// Values returns the slice of values for the current page or nil if there are no values. 494func (page ListResultPage) Values() []ContainerService { 495 if page.lr.IsEmpty() { 496 return nil 497 } 498 return *page.lr.Value 499} 500 501// Creates a new instance of the ListResultPage type. 502func NewListResultPage(cur ListResult, getNextPage func(context.Context, ListResult) (ListResult, error)) ListResultPage { 503 return ListResultPage{ 504 fn: getNextPage, 505 lr: cur, 506 } 507} 508 509// ManagedCluster managed cluster. 510type ManagedCluster struct { 511 autorest.Response `json:"-"` 512 // ManagedClusterProperties - Properties of a managed cluster. 513 *ManagedClusterProperties `json:"properties,omitempty"` 514 // ID - READ-ONLY; Resource Id 515 ID *string `json:"id,omitempty"` 516 // Name - READ-ONLY; Resource name 517 Name *string `json:"name,omitempty"` 518 // Type - READ-ONLY; Resource type 519 Type *string `json:"type,omitempty"` 520 // Location - Resource location 521 Location *string `json:"location,omitempty"` 522 // Tags - Resource tags 523 Tags map[string]*string `json:"tags"` 524} 525 526// MarshalJSON is the custom marshaler for ManagedCluster. 527func (mc ManagedCluster) MarshalJSON() ([]byte, error) { 528 objectMap := make(map[string]interface{}) 529 if mc.ManagedClusterProperties != nil { 530 objectMap["properties"] = mc.ManagedClusterProperties 531 } 532 if mc.Location != nil { 533 objectMap["location"] = mc.Location 534 } 535 if mc.Tags != nil { 536 objectMap["tags"] = mc.Tags 537 } 538 return json.Marshal(objectMap) 539} 540 541// UnmarshalJSON is the custom unmarshaler for ManagedCluster struct. 542func (mc *ManagedCluster) UnmarshalJSON(body []byte) error { 543 var m map[string]*json.RawMessage 544 err := json.Unmarshal(body, &m) 545 if err != nil { 546 return err 547 } 548 for k, v := range m { 549 switch k { 550 case "properties": 551 if v != nil { 552 var managedClusterProperties ManagedClusterProperties 553 err = json.Unmarshal(*v, &managedClusterProperties) 554 if err != nil { 555 return err 556 } 557 mc.ManagedClusterProperties = &managedClusterProperties 558 } 559 case "id": 560 if v != nil { 561 var ID string 562 err = json.Unmarshal(*v, &ID) 563 if err != nil { 564 return err 565 } 566 mc.ID = &ID 567 } 568 case "name": 569 if v != nil { 570 var name string 571 err = json.Unmarshal(*v, &name) 572 if err != nil { 573 return err 574 } 575 mc.Name = &name 576 } 577 case "type": 578 if v != nil { 579 var typeVar string 580 err = json.Unmarshal(*v, &typeVar) 581 if err != nil { 582 return err 583 } 584 mc.Type = &typeVar 585 } 586 case "location": 587 if v != nil { 588 var location string 589 err = json.Unmarshal(*v, &location) 590 if err != nil { 591 return err 592 } 593 mc.Location = &location 594 } 595 case "tags": 596 if v != nil { 597 var tags map[string]*string 598 err = json.Unmarshal(*v, &tags) 599 if err != nil { 600 return err 601 } 602 mc.Tags = tags 603 } 604 } 605 } 606 607 return nil 608} 609 610// ManagedClusterAADProfile aADProfile specifies attributes for Azure Active Directory integration. 611type ManagedClusterAADProfile struct { 612 // ClientAppID - The client AAD application ID. 613 ClientAppID *string `json:"clientAppID,omitempty"` 614 // ServerAppID - The server AAD application ID. 615 ServerAppID *string `json:"serverAppID,omitempty"` 616 // ServerAppSecret - The server AAD application secret. 617 ServerAppSecret *string `json:"serverAppSecret,omitempty"` 618 // TenantID - The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. 619 TenantID *string `json:"tenantID,omitempty"` 620} 621 622// ManagedClusterAccessProfile managed cluster Access Profile. 623type ManagedClusterAccessProfile struct { 624 autorest.Response `json:"-"` 625 // AccessProfile - AccessProfile of a managed cluster. 626 *AccessProfile `json:"properties,omitempty"` 627 // ID - READ-ONLY; Resource Id 628 ID *string `json:"id,omitempty"` 629 // Name - READ-ONLY; Resource name 630 Name *string `json:"name,omitempty"` 631 // Type - READ-ONLY; Resource type 632 Type *string `json:"type,omitempty"` 633 // Location - Resource location 634 Location *string `json:"location,omitempty"` 635 // Tags - Resource tags 636 Tags map[string]*string `json:"tags"` 637} 638 639// MarshalJSON is the custom marshaler for ManagedClusterAccessProfile. 640func (mcap ManagedClusterAccessProfile) MarshalJSON() ([]byte, error) { 641 objectMap := make(map[string]interface{}) 642 if mcap.AccessProfile != nil { 643 objectMap["properties"] = mcap.AccessProfile 644 } 645 if mcap.Location != nil { 646 objectMap["location"] = mcap.Location 647 } 648 if mcap.Tags != nil { 649 objectMap["tags"] = mcap.Tags 650 } 651 return json.Marshal(objectMap) 652} 653 654// UnmarshalJSON is the custom unmarshaler for ManagedClusterAccessProfile struct. 655func (mcap *ManagedClusterAccessProfile) UnmarshalJSON(body []byte) error { 656 var m map[string]*json.RawMessage 657 err := json.Unmarshal(body, &m) 658 if err != nil { 659 return err 660 } 661 for k, v := range m { 662 switch k { 663 case "properties": 664 if v != nil { 665 var accessProfile AccessProfile 666 err = json.Unmarshal(*v, &accessProfile) 667 if err != nil { 668 return err 669 } 670 mcap.AccessProfile = &accessProfile 671 } 672 case "id": 673 if v != nil { 674 var ID string 675 err = json.Unmarshal(*v, &ID) 676 if err != nil { 677 return err 678 } 679 mcap.ID = &ID 680 } 681 case "name": 682 if v != nil { 683 var name string 684 err = json.Unmarshal(*v, &name) 685 if err != nil { 686 return err 687 } 688 mcap.Name = &name 689 } 690 case "type": 691 if v != nil { 692 var typeVar string 693 err = json.Unmarshal(*v, &typeVar) 694 if err != nil { 695 return err 696 } 697 mcap.Type = &typeVar 698 } 699 case "location": 700 if v != nil { 701 var location string 702 err = json.Unmarshal(*v, &location) 703 if err != nil { 704 return err 705 } 706 mcap.Location = &location 707 } 708 case "tags": 709 if v != nil { 710 var tags map[string]*string 711 err = json.Unmarshal(*v, &tags) 712 if err != nil { 713 return err 714 } 715 mcap.Tags = tags 716 } 717 } 718 } 719 720 return nil 721} 722 723// ManagedClusterAddonProfile a Kubernetes add-on profile for a managed cluster. 724type ManagedClusterAddonProfile struct { 725 // Enabled - Whether the add-on is enabled or not. 726 Enabled *bool `json:"enabled,omitempty"` 727 // Config - Key-value pairs for configuring an add-on. 728 Config map[string]*string `json:"config"` 729} 730 731// MarshalJSON is the custom marshaler for ManagedClusterAddonProfile. 732func (mcap ManagedClusterAddonProfile) MarshalJSON() ([]byte, error) { 733 objectMap := make(map[string]interface{}) 734 if mcap.Enabled != nil { 735 objectMap["enabled"] = mcap.Enabled 736 } 737 if mcap.Config != nil { 738 objectMap["config"] = mcap.Config 739 } 740 return json.Marshal(objectMap) 741} 742 743// ManagedClusterAgentPoolProfile profile for the container service agent pool. 744type ManagedClusterAgentPoolProfile struct { 745 // Name - Unique name of the agent pool profile in the context of the subscription and resource group. 746 Name *string `json:"name,omitempty"` 747 // 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. 748 Count *int32 `json:"count,omitempty"` 749 // VMSize - Size of agent VMs. Possible values include: 'VMSizeTypesStandardA1', 'VMSizeTypesStandardA10', 'VMSizeTypesStandardA11', 'VMSizeTypesStandardA1V2', 'VMSizeTypesStandardA2', 'VMSizeTypesStandardA2V2', 'VMSizeTypesStandardA2mV2', 'VMSizeTypesStandardA3', 'VMSizeTypesStandardA4', 'VMSizeTypesStandardA4V2', 'VMSizeTypesStandardA4mV2', 'VMSizeTypesStandardA5', 'VMSizeTypesStandardA6', 'VMSizeTypesStandardA7', 'VMSizeTypesStandardA8', 'VMSizeTypesStandardA8V2', 'VMSizeTypesStandardA8mV2', 'VMSizeTypesStandardA9', 'VMSizeTypesStandardB2ms', 'VMSizeTypesStandardB2s', 'VMSizeTypesStandardB4ms', 'VMSizeTypesStandardB8ms', 'VMSizeTypesStandardD1', 'VMSizeTypesStandardD11', 'VMSizeTypesStandardD11V2', 'VMSizeTypesStandardD11V2Promo', 'VMSizeTypesStandardD12', 'VMSizeTypesStandardD12V2', 'VMSizeTypesStandardD12V2Promo', 'VMSizeTypesStandardD13', 'VMSizeTypesStandardD13V2', 'VMSizeTypesStandardD13V2Promo', 'VMSizeTypesStandardD14', 'VMSizeTypesStandardD14V2', 'VMSizeTypesStandardD14V2Promo', 'VMSizeTypesStandardD15V2', 'VMSizeTypesStandardD16V3', 'VMSizeTypesStandardD16sV3', 'VMSizeTypesStandardD1V2', 'VMSizeTypesStandardD2', 'VMSizeTypesStandardD2V2', 'VMSizeTypesStandardD2V2Promo', 'VMSizeTypesStandardD2V3', 'VMSizeTypesStandardD2sV3', 'VMSizeTypesStandardD3', 'VMSizeTypesStandardD32V3', 'VMSizeTypesStandardD32sV3', 'VMSizeTypesStandardD3V2', 'VMSizeTypesStandardD3V2Promo', 'VMSizeTypesStandardD4', 'VMSizeTypesStandardD4V2', 'VMSizeTypesStandardD4V2Promo', 'VMSizeTypesStandardD4V3', 'VMSizeTypesStandardD4sV3', 'VMSizeTypesStandardD5V2', 'VMSizeTypesStandardD5V2Promo', 'VMSizeTypesStandardD64V3', 'VMSizeTypesStandardD64sV3', 'VMSizeTypesStandardD8V3', 'VMSizeTypesStandardD8sV3', 'VMSizeTypesStandardDS1', 'VMSizeTypesStandardDS11', 'VMSizeTypesStandardDS11V2', 'VMSizeTypesStandardDS11V2Promo', 'VMSizeTypesStandardDS12', 'VMSizeTypesStandardDS12V2', 'VMSizeTypesStandardDS12V2Promo', 'VMSizeTypesStandardDS13', 'VMSizeTypesStandardDS132V2', 'VMSizeTypesStandardDS134V2', 'VMSizeTypesStandardDS13V2', 'VMSizeTypesStandardDS13V2Promo', 'VMSizeTypesStandardDS14', 'VMSizeTypesStandardDS144V2', 'VMSizeTypesStandardDS148V2', 'VMSizeTypesStandardDS14V2', 'VMSizeTypesStandardDS14V2Promo', 'VMSizeTypesStandardDS15V2', 'VMSizeTypesStandardDS1V2', 'VMSizeTypesStandardDS2', 'VMSizeTypesStandardDS2V2', 'VMSizeTypesStandardDS2V2Promo', 'VMSizeTypesStandardDS3', 'VMSizeTypesStandardDS3V2', 'VMSizeTypesStandardDS3V2Promo', 'VMSizeTypesStandardDS4', 'VMSizeTypesStandardDS4V2', 'VMSizeTypesStandardDS4V2Promo', 'VMSizeTypesStandardDS5V2', 'VMSizeTypesStandardDS5V2Promo', 'VMSizeTypesStandardE16V3', 'VMSizeTypesStandardE16sV3', 'VMSizeTypesStandardE2V3', 'VMSizeTypesStandardE2sV3', 'VMSizeTypesStandardE3216sV3', 'VMSizeTypesStandardE328sV3', 'VMSizeTypesStandardE32V3', 'VMSizeTypesStandardE32sV3', 'VMSizeTypesStandardE4V3', 'VMSizeTypesStandardE4sV3', 'VMSizeTypesStandardE6416sV3', 'VMSizeTypesStandardE6432sV3', 'VMSizeTypesStandardE64V3', 'VMSizeTypesStandardE64sV3', 'VMSizeTypesStandardE8V3', 'VMSizeTypesStandardE8sV3', 'VMSizeTypesStandardF1', 'VMSizeTypesStandardF16', 'VMSizeTypesStandardF16s', 'VMSizeTypesStandardF16sV2', 'VMSizeTypesStandardF1s', 'VMSizeTypesStandardF2', 'VMSizeTypesStandardF2s', 'VMSizeTypesStandardF2sV2', 'VMSizeTypesStandardF32sV2', 'VMSizeTypesStandardF4', 'VMSizeTypesStandardF4s', 'VMSizeTypesStandardF4sV2', 'VMSizeTypesStandardF64sV2', 'VMSizeTypesStandardF72sV2', 'VMSizeTypesStandardF8', 'VMSizeTypesStandardF8s', 'VMSizeTypesStandardF8sV2', 'VMSizeTypesStandardG1', 'VMSizeTypesStandardG2', 'VMSizeTypesStandardG3', 'VMSizeTypesStandardG4', 'VMSizeTypesStandardG5', 'VMSizeTypesStandardGS1', 'VMSizeTypesStandardGS2', 'VMSizeTypesStandardGS3', 'VMSizeTypesStandardGS4', 'VMSizeTypesStandardGS44', 'VMSizeTypesStandardGS48', 'VMSizeTypesStandardGS5', 'VMSizeTypesStandardGS516', 'VMSizeTypesStandardGS58', 'VMSizeTypesStandardH16', 'VMSizeTypesStandardH16m', 'VMSizeTypesStandardH16mr', 'VMSizeTypesStandardH16r', 'VMSizeTypesStandardH8', 'VMSizeTypesStandardH8m', 'VMSizeTypesStandardL16s', 'VMSizeTypesStandardL32s', 'VMSizeTypesStandardL4s', 'VMSizeTypesStandardL8s', 'VMSizeTypesStandardM12832ms', 'VMSizeTypesStandardM12864ms', 'VMSizeTypesStandardM128ms', 'VMSizeTypesStandardM128s', 'VMSizeTypesStandardM6416ms', 'VMSizeTypesStandardM6432ms', 'VMSizeTypesStandardM64ms', 'VMSizeTypesStandardM64s', 'VMSizeTypesStandardNC12', 'VMSizeTypesStandardNC12sV2', 'VMSizeTypesStandardNC12sV3', 'VMSizeTypesStandardNC24', 'VMSizeTypesStandardNC24r', 'VMSizeTypesStandardNC24rsV2', 'VMSizeTypesStandardNC24rsV3', 'VMSizeTypesStandardNC24sV2', 'VMSizeTypesStandardNC24sV3', 'VMSizeTypesStandardNC6', 'VMSizeTypesStandardNC6sV2', 'VMSizeTypesStandardNC6sV3', 'VMSizeTypesStandardND12s', 'VMSizeTypesStandardND24rs', 'VMSizeTypesStandardND24s', 'VMSizeTypesStandardND6s', 'VMSizeTypesStandardNV12', 'VMSizeTypesStandardNV24', 'VMSizeTypesStandardNV6' 750 VMSize VMSizeTypes `json:"vmSize,omitempty"` 751 // 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. 752 OsDiskSizeGB *int32 `json:"osDiskSizeGB,omitempty"` 753 // StorageProfile - READ-ONLY; Storage profile specifies what kind of storage used. Defaults to ManagedDisks. Possible values include: 'StorageAccount', 'ManagedDisks' 754 StorageProfile StorageProfileTypes `json:"storageProfile,omitempty"` 755 // VnetSubnetID - VNet SubnetID specifies the VNet's subnet identifier. 756 VnetSubnetID *string `json:"vnetSubnetID,omitempty"` 757 // MaxPods - Maximum number of pods that can run on a node. 758 MaxPods *int32 `json:"maxPods,omitempty"` 759 // OsType - OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: 'Linux', 'Windows' 760 OsType OSType `json:"osType,omitempty"` 761} 762 763// MarshalJSON is the custom marshaler for ManagedClusterAgentPoolProfile. 764func (mcapp ManagedClusterAgentPoolProfile) MarshalJSON() ([]byte, error) { 765 objectMap := make(map[string]interface{}) 766 if mcapp.Name != nil { 767 objectMap["name"] = mcapp.Name 768 } 769 if mcapp.Count != nil { 770 objectMap["count"] = mcapp.Count 771 } 772 if mcapp.VMSize != "" { 773 objectMap["vmSize"] = mcapp.VMSize 774 } 775 if mcapp.OsDiskSizeGB != nil { 776 objectMap["osDiskSizeGB"] = mcapp.OsDiskSizeGB 777 } 778 if mcapp.VnetSubnetID != nil { 779 objectMap["vnetSubnetID"] = mcapp.VnetSubnetID 780 } 781 if mcapp.MaxPods != nil { 782 objectMap["maxPods"] = mcapp.MaxPods 783 } 784 if mcapp.OsType != "" { 785 objectMap["osType"] = mcapp.OsType 786 } 787 return json.Marshal(objectMap) 788} 789 790// ManagedClusterListResult the response from the List Managed Clusters operation. 791type ManagedClusterListResult struct { 792 autorest.Response `json:"-"` 793 // Value - The list of managed clusters. 794 Value *[]ManagedCluster `json:"value,omitempty"` 795 // NextLink - READ-ONLY; The URL to get the next set of managed cluster results. 796 NextLink *string `json:"nextLink,omitempty"` 797} 798 799// MarshalJSON is the custom marshaler for ManagedClusterListResult. 800func (mclr ManagedClusterListResult) MarshalJSON() ([]byte, error) { 801 objectMap := make(map[string]interface{}) 802 if mclr.Value != nil { 803 objectMap["value"] = mclr.Value 804 } 805 return json.Marshal(objectMap) 806} 807 808// ManagedClusterListResultIterator provides access to a complete listing of ManagedCluster values. 809type ManagedClusterListResultIterator struct { 810 i int 811 page ManagedClusterListResultPage 812} 813 814// NextWithContext advances to the next value. If there was an error making 815// the request the iterator does not advance and the error is returned. 816func (iter *ManagedClusterListResultIterator) NextWithContext(ctx context.Context) (err error) { 817 if tracing.IsEnabled() { 818 ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClusterListResultIterator.NextWithContext") 819 defer func() { 820 sc := -1 821 if iter.Response().Response.Response != nil { 822 sc = iter.Response().Response.Response.StatusCode 823 } 824 tracing.EndSpan(ctx, sc, err) 825 }() 826 } 827 iter.i++ 828 if iter.i < len(iter.page.Values()) { 829 return nil 830 } 831 err = iter.page.NextWithContext(ctx) 832 if err != nil { 833 iter.i-- 834 return err 835 } 836 iter.i = 0 837 return nil 838} 839 840// Next advances to the next value. If there was an error making 841// the request the iterator does not advance and the error is returned. 842// Deprecated: Use NextWithContext() instead. 843func (iter *ManagedClusterListResultIterator) Next() error { 844 return iter.NextWithContext(context.Background()) 845} 846 847// NotDone returns true if the enumeration should be started or is not yet complete. 848func (iter ManagedClusterListResultIterator) NotDone() bool { 849 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 850} 851 852// Response returns the raw server response from the last page request. 853func (iter ManagedClusterListResultIterator) Response() ManagedClusterListResult { 854 return iter.page.Response() 855} 856 857// Value returns the current value or a zero-initialized value if the 858// iterator has advanced beyond the end of the collection. 859func (iter ManagedClusterListResultIterator) Value() ManagedCluster { 860 if !iter.page.NotDone() { 861 return ManagedCluster{} 862 } 863 return iter.page.Values()[iter.i] 864} 865 866// Creates a new instance of the ManagedClusterListResultIterator type. 867func NewManagedClusterListResultIterator(page ManagedClusterListResultPage) ManagedClusterListResultIterator { 868 return ManagedClusterListResultIterator{page: page} 869} 870 871// IsEmpty returns true if the ListResult contains no values. 872func (mclr ManagedClusterListResult) IsEmpty() bool { 873 return mclr.Value == nil || len(*mclr.Value) == 0 874} 875 876// hasNextLink returns true if the NextLink is not empty. 877func (mclr ManagedClusterListResult) hasNextLink() bool { 878 return mclr.NextLink != nil && len(*mclr.NextLink) != 0 879} 880 881// managedClusterListResultPreparer prepares a request to retrieve the next set of results. 882// It returns nil if no more results exist. 883func (mclr ManagedClusterListResult) managedClusterListResultPreparer(ctx context.Context) (*http.Request, error) { 884 if !mclr.hasNextLink() { 885 return nil, nil 886 } 887 return autorest.Prepare((&http.Request{}).WithContext(ctx), 888 autorest.AsJSON(), 889 autorest.AsGet(), 890 autorest.WithBaseURL(to.String(mclr.NextLink))) 891} 892 893// ManagedClusterListResultPage contains a page of ManagedCluster values. 894type ManagedClusterListResultPage struct { 895 fn func(context.Context, ManagedClusterListResult) (ManagedClusterListResult, error) 896 mclr ManagedClusterListResult 897} 898 899// NextWithContext advances to the next page of values. If there was an error making 900// the request the page does not advance and the error is returned. 901func (page *ManagedClusterListResultPage) NextWithContext(ctx context.Context) (err error) { 902 if tracing.IsEnabled() { 903 ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClusterListResultPage.NextWithContext") 904 defer func() { 905 sc := -1 906 if page.Response().Response.Response != nil { 907 sc = page.Response().Response.Response.StatusCode 908 } 909 tracing.EndSpan(ctx, sc, err) 910 }() 911 } 912 for { 913 next, err := page.fn(ctx, page.mclr) 914 if err != nil { 915 return err 916 } 917 page.mclr = next 918 if !next.hasNextLink() || !next.IsEmpty() { 919 break 920 } 921 } 922 return nil 923} 924 925// Next advances to the next page of values. If there was an error making 926// the request the page does not advance and the error is returned. 927// Deprecated: Use NextWithContext() instead. 928func (page *ManagedClusterListResultPage) Next() error { 929 return page.NextWithContext(context.Background()) 930} 931 932// NotDone returns true if the page enumeration should be started or is not yet complete. 933func (page ManagedClusterListResultPage) NotDone() bool { 934 return !page.mclr.IsEmpty() 935} 936 937// Response returns the raw server response from the last page request. 938func (page ManagedClusterListResultPage) Response() ManagedClusterListResult { 939 return page.mclr 940} 941 942// Values returns the slice of values for the current page or nil if there are no values. 943func (page ManagedClusterListResultPage) Values() []ManagedCluster { 944 if page.mclr.IsEmpty() { 945 return nil 946 } 947 return *page.mclr.Value 948} 949 950// Creates a new instance of the ManagedClusterListResultPage type. 951func NewManagedClusterListResultPage(cur ManagedClusterListResult, getNextPage func(context.Context, ManagedClusterListResult) (ManagedClusterListResult, error)) ManagedClusterListResultPage { 952 return ManagedClusterListResultPage{ 953 fn: getNextPage, 954 mclr: cur, 955 } 956} 957 958// ManagedClusterPoolUpgradeProfile the list of available upgrade versions. 959type ManagedClusterPoolUpgradeProfile struct { 960 // KubernetesVersion - Kubernetes version (major, minor, patch). 961 KubernetesVersion *string `json:"kubernetesVersion,omitempty"` 962 // Name - Pool name. 963 Name *string `json:"name,omitempty"` 964 // OsType - OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: 'Linux', 'Windows' 965 OsType OSType `json:"osType,omitempty"` 966 // Upgrades - List of orchestrator types and versions available for upgrade. 967 Upgrades *[]string `json:"upgrades,omitempty"` 968} 969 970// ManagedClusterProperties properties of the managed cluster. 971type ManagedClusterProperties struct { 972 // ProvisioningState - READ-ONLY; The current deployment or provisioning state, which only appears in the response. 973 ProvisioningState *string `json:"provisioningState,omitempty"` 974 // KubernetesVersion - Version of Kubernetes specified when creating the managed cluster. 975 KubernetesVersion *string `json:"kubernetesVersion,omitempty"` 976 // DNSPrefix - DNS prefix specified when creating the managed cluster. 977 DNSPrefix *string `json:"dnsPrefix,omitempty"` 978 // Fqdn - READ-ONLY; FQDN for the master pool. 979 Fqdn *string `json:"fqdn,omitempty"` 980 // AgentPoolProfiles - Properties of the agent pool. Currently only one agent pool can exist. 981 AgentPoolProfiles *[]ManagedClusterAgentPoolProfile `json:"agentPoolProfiles,omitempty"` 982 // LinuxProfile - Profile for Linux VMs in the container service cluster. 983 LinuxProfile *LinuxProfile `json:"linuxProfile,omitempty"` 984 // ServicePrincipalProfile - Information about a service principal identity for the cluster to use for manipulating Azure APIs. 985 ServicePrincipalProfile *ManagedClusterServicePrincipalProfile `json:"servicePrincipalProfile,omitempty"` 986 // AddonProfiles - Profile of managed cluster add-on. 987 AddonProfiles map[string]*ManagedClusterAddonProfile `json:"addonProfiles"` 988 // NodeResourceGroup - READ-ONLY; Name of the resource group containing agent pool nodes. 989 NodeResourceGroup *string `json:"nodeResourceGroup,omitempty"` 990 // EnableRBAC - Whether to enable Kubernetes Role-Based Access Control. 991 EnableRBAC *bool `json:"enableRBAC,omitempty"` 992 // NetworkProfile - Profile of network configuration. 993 NetworkProfile *NetworkProfileType `json:"networkProfile,omitempty"` 994 // AadProfile - Profile of Azure Active Directory configuration. 995 AadProfile *ManagedClusterAADProfile `json:"aadProfile,omitempty"` 996} 997 998// MarshalJSON is the custom marshaler for ManagedClusterProperties. 999func (mcp ManagedClusterProperties) MarshalJSON() ([]byte, error) { 1000 objectMap := make(map[string]interface{}) 1001 if mcp.KubernetesVersion != nil { 1002 objectMap["kubernetesVersion"] = mcp.KubernetesVersion 1003 } 1004 if mcp.DNSPrefix != nil { 1005 objectMap["dnsPrefix"] = mcp.DNSPrefix 1006 } 1007 if mcp.AgentPoolProfiles != nil { 1008 objectMap["agentPoolProfiles"] = mcp.AgentPoolProfiles 1009 } 1010 if mcp.LinuxProfile != nil { 1011 objectMap["linuxProfile"] = mcp.LinuxProfile 1012 } 1013 if mcp.ServicePrincipalProfile != nil { 1014 objectMap["servicePrincipalProfile"] = mcp.ServicePrincipalProfile 1015 } 1016 if mcp.AddonProfiles != nil { 1017 objectMap["addonProfiles"] = mcp.AddonProfiles 1018 } 1019 if mcp.EnableRBAC != nil { 1020 objectMap["enableRBAC"] = mcp.EnableRBAC 1021 } 1022 if mcp.NetworkProfile != nil { 1023 objectMap["networkProfile"] = mcp.NetworkProfile 1024 } 1025 if mcp.AadProfile != nil { 1026 objectMap["aadProfile"] = mcp.AadProfile 1027 } 1028 return json.Marshal(objectMap) 1029} 1030 1031// ManagedClustersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 1032// long-running operation. 1033type ManagedClustersCreateOrUpdateFuture struct { 1034 azure.FutureAPI 1035 // Result returns the result of the asynchronous operation. 1036 // If the operation has not completed it will return an error. 1037 Result func(ManagedClustersClient) (ManagedCluster, error) 1038} 1039 1040// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1041func (future *ManagedClustersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 1042 var azFuture azure.Future 1043 if err := json.Unmarshal(body, &azFuture); err != nil { 1044 return err 1045 } 1046 future.FutureAPI = &azFuture 1047 future.Result = future.result 1048 return nil 1049} 1050 1051// result is the default implementation for ManagedClustersCreateOrUpdateFuture.Result. 1052func (future *ManagedClustersCreateOrUpdateFuture) result(client ManagedClustersClient) (mc ManagedCluster, err error) { 1053 var done bool 1054 done, err = future.DoneWithContext(context.Background(), client) 1055 if err != nil { 1056 err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 1057 return 1058 } 1059 if !done { 1060 mc.Response.Response = future.Response() 1061 err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersCreateOrUpdateFuture") 1062 return 1063 } 1064 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1065 if mc.Response.Response, err = future.GetResult(sender); err == nil && mc.Response.Response.StatusCode != http.StatusNoContent { 1066 mc, err = client.CreateOrUpdateResponder(mc.Response.Response) 1067 if err != nil { 1068 err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersCreateOrUpdateFuture", "Result", mc.Response.Response, "Failure responding to request") 1069 } 1070 } 1071 return 1072} 1073 1074// ManagedClustersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 1075// operation. 1076type ManagedClustersDeleteFuture struct { 1077 azure.FutureAPI 1078 // Result returns the result of the asynchronous operation. 1079 // If the operation has not completed it will return an error. 1080 Result func(ManagedClustersClient) (autorest.Response, error) 1081} 1082 1083// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1084func (future *ManagedClustersDeleteFuture) UnmarshalJSON(body []byte) error { 1085 var azFuture azure.Future 1086 if err := json.Unmarshal(body, &azFuture); err != nil { 1087 return err 1088 } 1089 future.FutureAPI = &azFuture 1090 future.Result = future.result 1091 return nil 1092} 1093 1094// result is the default implementation for ManagedClustersDeleteFuture.Result. 1095func (future *ManagedClustersDeleteFuture) result(client ManagedClustersClient) (ar autorest.Response, err error) { 1096 var done bool 1097 done, err = future.DoneWithContext(context.Background(), client) 1098 if err != nil { 1099 err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersDeleteFuture", "Result", future.Response(), "Polling failure") 1100 return 1101 } 1102 if !done { 1103 ar.Response = future.Response() 1104 err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersDeleteFuture") 1105 return 1106 } 1107 ar.Response = future.Response() 1108 return 1109} 1110 1111// ManagedClusterServicePrincipalProfile information about a service principal identity for the cluster to 1112// use for manipulating Azure APIs. 1113type ManagedClusterServicePrincipalProfile struct { 1114 // ClientID - The ID for the service principal. 1115 ClientID *string `json:"clientId,omitempty"` 1116 // Secret - The secret password associated with the service principal in plain text. 1117 Secret *string `json:"secret,omitempty"` 1118} 1119 1120// ManagedClustersResetAADProfileFuture an abstraction for monitoring and retrieving the results of a 1121// long-running operation. 1122type ManagedClustersResetAADProfileFuture struct { 1123 azure.FutureAPI 1124 // Result returns the result of the asynchronous operation. 1125 // If the operation has not completed it will return an error. 1126 Result func(ManagedClustersClient) (autorest.Response, error) 1127} 1128 1129// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1130func (future *ManagedClustersResetAADProfileFuture) UnmarshalJSON(body []byte) error { 1131 var azFuture azure.Future 1132 if err := json.Unmarshal(body, &azFuture); err != nil { 1133 return err 1134 } 1135 future.FutureAPI = &azFuture 1136 future.Result = future.result 1137 return nil 1138} 1139 1140// result is the default implementation for ManagedClustersResetAADProfileFuture.Result. 1141func (future *ManagedClustersResetAADProfileFuture) result(client ManagedClustersClient) (ar autorest.Response, err error) { 1142 var done bool 1143 done, err = future.DoneWithContext(context.Background(), client) 1144 if err != nil { 1145 err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersResetAADProfileFuture", "Result", future.Response(), "Polling failure") 1146 return 1147 } 1148 if !done { 1149 ar.Response = future.Response() 1150 err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersResetAADProfileFuture") 1151 return 1152 } 1153 ar.Response = future.Response() 1154 return 1155} 1156 1157// ManagedClustersResetServicePrincipalProfileFuture an abstraction for monitoring and retrieving the 1158// results of a long-running operation. 1159type ManagedClustersResetServicePrincipalProfileFuture struct { 1160 azure.FutureAPI 1161 // Result returns the result of the asynchronous operation. 1162 // If the operation has not completed it will return an error. 1163 Result func(ManagedClustersClient) (autorest.Response, error) 1164} 1165 1166// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1167func (future *ManagedClustersResetServicePrincipalProfileFuture) UnmarshalJSON(body []byte) error { 1168 var azFuture azure.Future 1169 if err := json.Unmarshal(body, &azFuture); err != nil { 1170 return err 1171 } 1172 future.FutureAPI = &azFuture 1173 future.Result = future.result 1174 return nil 1175} 1176 1177// result is the default implementation for ManagedClustersResetServicePrincipalProfileFuture.Result. 1178func (future *ManagedClustersResetServicePrincipalProfileFuture) result(client ManagedClustersClient) (ar autorest.Response, err error) { 1179 var done bool 1180 done, err = future.DoneWithContext(context.Background(), client) 1181 if err != nil { 1182 err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersResetServicePrincipalProfileFuture", "Result", future.Response(), "Polling failure") 1183 return 1184 } 1185 if !done { 1186 ar.Response = future.Response() 1187 err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersResetServicePrincipalProfileFuture") 1188 return 1189 } 1190 ar.Response = future.Response() 1191 return 1192} 1193 1194// ManagedClustersUpdateTagsFuture an abstraction for monitoring and retrieving the results of a 1195// long-running operation. 1196type ManagedClustersUpdateTagsFuture struct { 1197 azure.FutureAPI 1198 // Result returns the result of the asynchronous operation. 1199 // If the operation has not completed it will return an error. 1200 Result func(ManagedClustersClient) (ManagedCluster, error) 1201} 1202 1203// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1204func (future *ManagedClustersUpdateTagsFuture) UnmarshalJSON(body []byte) error { 1205 var azFuture azure.Future 1206 if err := json.Unmarshal(body, &azFuture); err != nil { 1207 return err 1208 } 1209 future.FutureAPI = &azFuture 1210 future.Result = future.result 1211 return nil 1212} 1213 1214// result is the default implementation for ManagedClustersUpdateTagsFuture.Result. 1215func (future *ManagedClustersUpdateTagsFuture) result(client ManagedClustersClient) (mc ManagedCluster, err error) { 1216 var done bool 1217 done, err = future.DoneWithContext(context.Background(), client) 1218 if err != nil { 1219 err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersUpdateTagsFuture", "Result", future.Response(), "Polling failure") 1220 return 1221 } 1222 if !done { 1223 mc.Response.Response = future.Response() 1224 err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersUpdateTagsFuture") 1225 return 1226 } 1227 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1228 if mc.Response.Response, err = future.GetResult(sender); err == nil && mc.Response.Response.StatusCode != http.StatusNoContent { 1229 mc, err = client.UpdateTagsResponder(mc.Response.Response) 1230 if err != nil { 1231 err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersUpdateTagsFuture", "Result", mc.Response.Response, "Failure responding to request") 1232 } 1233 } 1234 return 1235} 1236 1237// ManagedClusterUpgradeProfile the list of available upgrades for compute pools. 1238type ManagedClusterUpgradeProfile struct { 1239 autorest.Response `json:"-"` 1240 // ID - READ-ONLY; Id of upgrade profile. 1241 ID *string `json:"id,omitempty"` 1242 // Name - READ-ONLY; Name of upgrade profile. 1243 Name *string `json:"name,omitempty"` 1244 // Type - READ-ONLY; Type of upgrade profile. 1245 Type *string `json:"type,omitempty"` 1246 // ManagedClusterUpgradeProfileProperties - Properties of upgrade profile. 1247 *ManagedClusterUpgradeProfileProperties `json:"properties,omitempty"` 1248} 1249 1250// MarshalJSON is the custom marshaler for ManagedClusterUpgradeProfile. 1251func (mcup ManagedClusterUpgradeProfile) MarshalJSON() ([]byte, error) { 1252 objectMap := make(map[string]interface{}) 1253 if mcup.ManagedClusterUpgradeProfileProperties != nil { 1254 objectMap["properties"] = mcup.ManagedClusterUpgradeProfileProperties 1255 } 1256 return json.Marshal(objectMap) 1257} 1258 1259// UnmarshalJSON is the custom unmarshaler for ManagedClusterUpgradeProfile struct. 1260func (mcup *ManagedClusterUpgradeProfile) UnmarshalJSON(body []byte) error { 1261 var m map[string]*json.RawMessage 1262 err := json.Unmarshal(body, &m) 1263 if err != nil { 1264 return err 1265 } 1266 for k, v := range m { 1267 switch k { 1268 case "id": 1269 if v != nil { 1270 var ID string 1271 err = json.Unmarshal(*v, &ID) 1272 if err != nil { 1273 return err 1274 } 1275 mcup.ID = &ID 1276 } 1277 case "name": 1278 if v != nil { 1279 var name string 1280 err = json.Unmarshal(*v, &name) 1281 if err != nil { 1282 return err 1283 } 1284 mcup.Name = &name 1285 } 1286 case "type": 1287 if v != nil { 1288 var typeVar string 1289 err = json.Unmarshal(*v, &typeVar) 1290 if err != nil { 1291 return err 1292 } 1293 mcup.Type = &typeVar 1294 } 1295 case "properties": 1296 if v != nil { 1297 var managedClusterUpgradeProfileProperties ManagedClusterUpgradeProfileProperties 1298 err = json.Unmarshal(*v, &managedClusterUpgradeProfileProperties) 1299 if err != nil { 1300 return err 1301 } 1302 mcup.ManagedClusterUpgradeProfileProperties = &managedClusterUpgradeProfileProperties 1303 } 1304 } 1305 } 1306 1307 return nil 1308} 1309 1310// ManagedClusterUpgradeProfileProperties control plane and agent pool upgrade profiles. 1311type ManagedClusterUpgradeProfileProperties struct { 1312 // ControlPlaneProfile - The list of available upgrade versions for the control plane. 1313 ControlPlaneProfile *ManagedClusterPoolUpgradeProfile `json:"controlPlaneProfile,omitempty"` 1314 // AgentPoolProfiles - The list of available upgrade versions for agent pools. 1315 AgentPoolProfiles *[]ManagedClusterPoolUpgradeProfile `json:"agentPoolProfiles,omitempty"` 1316} 1317 1318// MasterProfile profile for the container service master. 1319type MasterProfile struct { 1320 // Count - Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. 1321 Count *int32 `json:"count,omitempty"` 1322 // DNSPrefix - DNS prefix to be used to create the FQDN for the master pool. 1323 DNSPrefix *string `json:"dnsPrefix,omitempty"` 1324 // VMSize - Size of agent VMs. Possible values include: 'VMSizeTypesStandardA1', 'VMSizeTypesStandardA10', 'VMSizeTypesStandardA11', 'VMSizeTypesStandardA1V2', 'VMSizeTypesStandardA2', 'VMSizeTypesStandardA2V2', 'VMSizeTypesStandardA2mV2', 'VMSizeTypesStandardA3', 'VMSizeTypesStandardA4', 'VMSizeTypesStandardA4V2', 'VMSizeTypesStandardA4mV2', 'VMSizeTypesStandardA5', 'VMSizeTypesStandardA6', 'VMSizeTypesStandardA7', 'VMSizeTypesStandardA8', 'VMSizeTypesStandardA8V2', 'VMSizeTypesStandardA8mV2', 'VMSizeTypesStandardA9', 'VMSizeTypesStandardB2ms', 'VMSizeTypesStandardB2s', 'VMSizeTypesStandardB4ms', 'VMSizeTypesStandardB8ms', 'VMSizeTypesStandardD1', 'VMSizeTypesStandardD11', 'VMSizeTypesStandardD11V2', 'VMSizeTypesStandardD11V2Promo', 'VMSizeTypesStandardD12', 'VMSizeTypesStandardD12V2', 'VMSizeTypesStandardD12V2Promo', 'VMSizeTypesStandardD13', 'VMSizeTypesStandardD13V2', 'VMSizeTypesStandardD13V2Promo', 'VMSizeTypesStandardD14', 'VMSizeTypesStandardD14V2', 'VMSizeTypesStandardD14V2Promo', 'VMSizeTypesStandardD15V2', 'VMSizeTypesStandardD16V3', 'VMSizeTypesStandardD16sV3', 'VMSizeTypesStandardD1V2', 'VMSizeTypesStandardD2', 'VMSizeTypesStandardD2V2', 'VMSizeTypesStandardD2V2Promo', 'VMSizeTypesStandardD2V3', 'VMSizeTypesStandardD2sV3', 'VMSizeTypesStandardD3', 'VMSizeTypesStandardD32V3', 'VMSizeTypesStandardD32sV3', 'VMSizeTypesStandardD3V2', 'VMSizeTypesStandardD3V2Promo', 'VMSizeTypesStandardD4', 'VMSizeTypesStandardD4V2', 'VMSizeTypesStandardD4V2Promo', 'VMSizeTypesStandardD4V3', 'VMSizeTypesStandardD4sV3', 'VMSizeTypesStandardD5V2', 'VMSizeTypesStandardD5V2Promo', 'VMSizeTypesStandardD64V3', 'VMSizeTypesStandardD64sV3', 'VMSizeTypesStandardD8V3', 'VMSizeTypesStandardD8sV3', 'VMSizeTypesStandardDS1', 'VMSizeTypesStandardDS11', 'VMSizeTypesStandardDS11V2', 'VMSizeTypesStandardDS11V2Promo', 'VMSizeTypesStandardDS12', 'VMSizeTypesStandardDS12V2', 'VMSizeTypesStandardDS12V2Promo', 'VMSizeTypesStandardDS13', 'VMSizeTypesStandardDS132V2', 'VMSizeTypesStandardDS134V2', 'VMSizeTypesStandardDS13V2', 'VMSizeTypesStandardDS13V2Promo', 'VMSizeTypesStandardDS14', 'VMSizeTypesStandardDS144V2', 'VMSizeTypesStandardDS148V2', 'VMSizeTypesStandardDS14V2', 'VMSizeTypesStandardDS14V2Promo', 'VMSizeTypesStandardDS15V2', 'VMSizeTypesStandardDS1V2', 'VMSizeTypesStandardDS2', 'VMSizeTypesStandardDS2V2', 'VMSizeTypesStandardDS2V2Promo', 'VMSizeTypesStandardDS3', 'VMSizeTypesStandardDS3V2', 'VMSizeTypesStandardDS3V2Promo', 'VMSizeTypesStandardDS4', 'VMSizeTypesStandardDS4V2', 'VMSizeTypesStandardDS4V2Promo', 'VMSizeTypesStandardDS5V2', 'VMSizeTypesStandardDS5V2Promo', 'VMSizeTypesStandardE16V3', 'VMSizeTypesStandardE16sV3', 'VMSizeTypesStandardE2V3', 'VMSizeTypesStandardE2sV3', 'VMSizeTypesStandardE3216sV3', 'VMSizeTypesStandardE328sV3', 'VMSizeTypesStandardE32V3', 'VMSizeTypesStandardE32sV3', 'VMSizeTypesStandardE4V3', 'VMSizeTypesStandardE4sV3', 'VMSizeTypesStandardE6416sV3', 'VMSizeTypesStandardE6432sV3', 'VMSizeTypesStandardE64V3', 'VMSizeTypesStandardE64sV3', 'VMSizeTypesStandardE8V3', 'VMSizeTypesStandardE8sV3', 'VMSizeTypesStandardF1', 'VMSizeTypesStandardF16', 'VMSizeTypesStandardF16s', 'VMSizeTypesStandardF16sV2', 'VMSizeTypesStandardF1s', 'VMSizeTypesStandardF2', 'VMSizeTypesStandardF2s', 'VMSizeTypesStandardF2sV2', 'VMSizeTypesStandardF32sV2', 'VMSizeTypesStandardF4', 'VMSizeTypesStandardF4s', 'VMSizeTypesStandardF4sV2', 'VMSizeTypesStandardF64sV2', 'VMSizeTypesStandardF72sV2', 'VMSizeTypesStandardF8', 'VMSizeTypesStandardF8s', 'VMSizeTypesStandardF8sV2', 'VMSizeTypesStandardG1', 'VMSizeTypesStandardG2', 'VMSizeTypesStandardG3', 'VMSizeTypesStandardG4', 'VMSizeTypesStandardG5', 'VMSizeTypesStandardGS1', 'VMSizeTypesStandardGS2', 'VMSizeTypesStandardGS3', 'VMSizeTypesStandardGS4', 'VMSizeTypesStandardGS44', 'VMSizeTypesStandardGS48', 'VMSizeTypesStandardGS5', 'VMSizeTypesStandardGS516', 'VMSizeTypesStandardGS58', 'VMSizeTypesStandardH16', 'VMSizeTypesStandardH16m', 'VMSizeTypesStandardH16mr', 'VMSizeTypesStandardH16r', 'VMSizeTypesStandardH8', 'VMSizeTypesStandardH8m', 'VMSizeTypesStandardL16s', 'VMSizeTypesStandardL32s', 'VMSizeTypesStandardL4s', 'VMSizeTypesStandardL8s', 'VMSizeTypesStandardM12832ms', 'VMSizeTypesStandardM12864ms', 'VMSizeTypesStandardM128ms', 'VMSizeTypesStandardM128s', 'VMSizeTypesStandardM6416ms', 'VMSizeTypesStandardM6432ms', 'VMSizeTypesStandardM64ms', 'VMSizeTypesStandardM64s', 'VMSizeTypesStandardNC12', 'VMSizeTypesStandardNC12sV2', 'VMSizeTypesStandardNC12sV3', 'VMSizeTypesStandardNC24', 'VMSizeTypesStandardNC24r', 'VMSizeTypesStandardNC24rsV2', 'VMSizeTypesStandardNC24rsV3', 'VMSizeTypesStandardNC24sV2', 'VMSizeTypesStandardNC24sV3', 'VMSizeTypesStandardNC6', 'VMSizeTypesStandardNC6sV2', 'VMSizeTypesStandardNC6sV3', 'VMSizeTypesStandardND12s', 'VMSizeTypesStandardND24rs', 'VMSizeTypesStandardND24s', 'VMSizeTypesStandardND6s', 'VMSizeTypesStandardNV12', 'VMSizeTypesStandardNV24', 'VMSizeTypesStandardNV6' 1325 VMSize VMSizeTypes `json:"vmSize,omitempty"` 1326 // 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. 1327 OsDiskSizeGB *int32 `json:"osDiskSizeGB,omitempty"` 1328 // VnetSubnetID - VNet SubnetID specifies the VNet's subnet identifier. 1329 VnetSubnetID *string `json:"vnetSubnetID,omitempty"` 1330 // FirstConsecutiveStaticIP - FirstConsecutiveStaticIP used to specify the first static ip of masters. 1331 FirstConsecutiveStaticIP *string `json:"firstConsecutiveStaticIP,omitempty"` 1332 // 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' 1333 StorageProfile StorageProfileTypes `json:"storageProfile,omitempty"` 1334 // Fqdn - READ-ONLY; FQDN for the master pool. 1335 Fqdn *string `json:"fqdn,omitempty"` 1336} 1337 1338// MarshalJSON is the custom marshaler for MasterProfile. 1339func (mp MasterProfile) MarshalJSON() ([]byte, error) { 1340 objectMap := make(map[string]interface{}) 1341 if mp.Count != nil { 1342 objectMap["count"] = mp.Count 1343 } 1344 if mp.DNSPrefix != nil { 1345 objectMap["dnsPrefix"] = mp.DNSPrefix 1346 } 1347 if mp.VMSize != "" { 1348 objectMap["vmSize"] = mp.VMSize 1349 } 1350 if mp.OsDiskSizeGB != nil { 1351 objectMap["osDiskSizeGB"] = mp.OsDiskSizeGB 1352 } 1353 if mp.VnetSubnetID != nil { 1354 objectMap["vnetSubnetID"] = mp.VnetSubnetID 1355 } 1356 if mp.FirstConsecutiveStaticIP != nil { 1357 objectMap["firstConsecutiveStaticIP"] = mp.FirstConsecutiveStaticIP 1358 } 1359 if mp.StorageProfile != "" { 1360 objectMap["storageProfile"] = mp.StorageProfile 1361 } 1362 return json.Marshal(objectMap) 1363} 1364 1365// NetworkProfile represents the OpenShift networking configuration 1366type NetworkProfile struct { 1367 // VnetCidr - CIDR for the OpenShift Vnet. 1368 VnetCidr *string `json:"vnetCidr,omitempty"` 1369 // PeerVnetID - CIDR of the Vnet to peer. 1370 PeerVnetID *string `json:"peerVnetId,omitempty"` 1371} 1372 1373// NetworkProfileType profile of network configuration. 1374type NetworkProfileType struct { 1375 // NetworkPlugin - Network plugin used for building Kubernetes network. Possible values include: 'Azure', 'Kubenet' 1376 NetworkPlugin NetworkPlugin `json:"networkPlugin,omitempty"` 1377 // NetworkPolicy - Network policy used for building Kubernetes network. Possible values include: 'Calico' 1378 NetworkPolicy NetworkPolicy `json:"networkPolicy,omitempty"` 1379 // PodCidr - A CIDR notation IP range from which to assign pod IPs when kubenet is used. 1380 PodCidr *string `json:"podCidr,omitempty"` 1381 // ServiceCidr - A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. 1382 ServiceCidr *string `json:"serviceCidr,omitempty"` 1383 // DNSServiceIP - An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. 1384 DNSServiceIP *string `json:"dnsServiceIP,omitempty"` 1385 // DockerBridgeCidr - A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range. 1386 DockerBridgeCidr *string `json:"dockerBridgeCidr,omitempty"` 1387} 1388 1389// OpenShiftManagedCluster openShift Managed cluster. 1390type OpenShiftManagedCluster struct { 1391 autorest.Response `json:"-"` 1392 // Plan - Define the resource plan as required by ARM for billing purposes 1393 Plan *PurchasePlan `json:"plan,omitempty"` 1394 // OpenShiftManagedClusterProperties - Properties of a OpenShift managed cluster. 1395 *OpenShiftManagedClusterProperties `json:"properties,omitempty"` 1396 // ID - READ-ONLY; Resource Id 1397 ID *string `json:"id,omitempty"` 1398 // Name - READ-ONLY; Resource name 1399 Name *string `json:"name,omitempty"` 1400 // Type - READ-ONLY; Resource type 1401 Type *string `json:"type,omitempty"` 1402 // Location - Resource location 1403 Location *string `json:"location,omitempty"` 1404 // Tags - Resource tags 1405 Tags map[string]*string `json:"tags"` 1406} 1407 1408// MarshalJSON is the custom marshaler for OpenShiftManagedCluster. 1409func (osmc OpenShiftManagedCluster) MarshalJSON() ([]byte, error) { 1410 objectMap := make(map[string]interface{}) 1411 if osmc.Plan != nil { 1412 objectMap["plan"] = osmc.Plan 1413 } 1414 if osmc.OpenShiftManagedClusterProperties != nil { 1415 objectMap["properties"] = osmc.OpenShiftManagedClusterProperties 1416 } 1417 if osmc.Location != nil { 1418 objectMap["location"] = osmc.Location 1419 } 1420 if osmc.Tags != nil { 1421 objectMap["tags"] = osmc.Tags 1422 } 1423 return json.Marshal(objectMap) 1424} 1425 1426// UnmarshalJSON is the custom unmarshaler for OpenShiftManagedCluster struct. 1427func (osmc *OpenShiftManagedCluster) UnmarshalJSON(body []byte) error { 1428 var m map[string]*json.RawMessage 1429 err := json.Unmarshal(body, &m) 1430 if err != nil { 1431 return err 1432 } 1433 for k, v := range m { 1434 switch k { 1435 case "plan": 1436 if v != nil { 1437 var plan PurchasePlan 1438 err = json.Unmarshal(*v, &plan) 1439 if err != nil { 1440 return err 1441 } 1442 osmc.Plan = &plan 1443 } 1444 case "properties": 1445 if v != nil { 1446 var openShiftManagedClusterProperties OpenShiftManagedClusterProperties 1447 err = json.Unmarshal(*v, &openShiftManagedClusterProperties) 1448 if err != nil { 1449 return err 1450 } 1451 osmc.OpenShiftManagedClusterProperties = &openShiftManagedClusterProperties 1452 } 1453 case "id": 1454 if v != nil { 1455 var ID string 1456 err = json.Unmarshal(*v, &ID) 1457 if err != nil { 1458 return err 1459 } 1460 osmc.ID = &ID 1461 } 1462 case "name": 1463 if v != nil { 1464 var name string 1465 err = json.Unmarshal(*v, &name) 1466 if err != nil { 1467 return err 1468 } 1469 osmc.Name = &name 1470 } 1471 case "type": 1472 if v != nil { 1473 var typeVar string 1474 err = json.Unmarshal(*v, &typeVar) 1475 if err != nil { 1476 return err 1477 } 1478 osmc.Type = &typeVar 1479 } 1480 case "location": 1481 if v != nil { 1482 var location string 1483 err = json.Unmarshal(*v, &location) 1484 if err != nil { 1485 return err 1486 } 1487 osmc.Location = &location 1488 } 1489 case "tags": 1490 if v != nil { 1491 var tags map[string]*string 1492 err = json.Unmarshal(*v, &tags) 1493 if err != nil { 1494 return err 1495 } 1496 osmc.Tags = tags 1497 } 1498 } 1499 } 1500 1501 return nil 1502} 1503 1504// OpenShiftManagedClusterAADIdentityProvider defines the Identity provider for MS AAD. 1505type OpenShiftManagedClusterAADIdentityProvider struct { 1506 // ClientID - The clientId password associated with the provider. 1507 ClientID *string `json:"clientId,omitempty"` 1508 // Secret - The secret password associated with the provider. 1509 Secret *string `json:"secret,omitempty"` 1510 // TenantID - The tenantId associated with the provider. 1511 TenantID *string `json:"tenantId,omitempty"` 1512 // CustomerAdminGroupID - The groupId to be granted cluster admin role. 1513 CustomerAdminGroupID *string `json:"customerAdminGroupId,omitempty"` 1514 // Kind - Possible values include: 'KindOpenShiftManagedClusterBaseIdentityProvider', 'KindAADIdentityProvider' 1515 Kind Kind `json:"kind,omitempty"` 1516} 1517 1518// MarshalJSON is the custom marshaler for OpenShiftManagedClusterAADIdentityProvider. 1519func (osmcaip OpenShiftManagedClusterAADIdentityProvider) MarshalJSON() ([]byte, error) { 1520 osmcaip.Kind = KindAADIdentityProvider 1521 objectMap := make(map[string]interface{}) 1522 if osmcaip.ClientID != nil { 1523 objectMap["clientId"] = osmcaip.ClientID 1524 } 1525 if osmcaip.Secret != nil { 1526 objectMap["secret"] = osmcaip.Secret 1527 } 1528 if osmcaip.TenantID != nil { 1529 objectMap["tenantId"] = osmcaip.TenantID 1530 } 1531 if osmcaip.CustomerAdminGroupID != nil { 1532 objectMap["customerAdminGroupId"] = osmcaip.CustomerAdminGroupID 1533 } 1534 if osmcaip.Kind != "" { 1535 objectMap["kind"] = osmcaip.Kind 1536 } 1537 return json.Marshal(objectMap) 1538} 1539 1540// AsOpenShiftManagedClusterAADIdentityProvider is the BasicOpenShiftManagedClusterBaseIdentityProvider implementation for OpenShiftManagedClusterAADIdentityProvider. 1541func (osmcaip OpenShiftManagedClusterAADIdentityProvider) AsOpenShiftManagedClusterAADIdentityProvider() (*OpenShiftManagedClusterAADIdentityProvider, bool) { 1542 return &osmcaip, true 1543} 1544 1545// AsOpenShiftManagedClusterBaseIdentityProvider is the BasicOpenShiftManagedClusterBaseIdentityProvider implementation for OpenShiftManagedClusterAADIdentityProvider. 1546func (osmcaip OpenShiftManagedClusterAADIdentityProvider) AsOpenShiftManagedClusterBaseIdentityProvider() (*OpenShiftManagedClusterBaseIdentityProvider, bool) { 1547 return nil, false 1548} 1549 1550// AsBasicOpenShiftManagedClusterBaseIdentityProvider is the BasicOpenShiftManagedClusterBaseIdentityProvider implementation for OpenShiftManagedClusterAADIdentityProvider. 1551func (osmcaip OpenShiftManagedClusterAADIdentityProvider) AsBasicOpenShiftManagedClusterBaseIdentityProvider() (BasicOpenShiftManagedClusterBaseIdentityProvider, bool) { 1552 return &osmcaip, true 1553} 1554 1555// OpenShiftManagedClusterAgentPoolProfile defines the configuration of the OpenShift cluster VMs. 1556type OpenShiftManagedClusterAgentPoolProfile struct { 1557 // Name - Unique name of the pool profile in the context of the subscription and resource group. 1558 Name *string `json:"name,omitempty"` 1559 // Count - Number of agents (VMs) to host docker containers. 1560 Count *int32 `json:"count,omitempty"` 1561 // VMSize - Size of agent VMs. Possible values include: 'StandardD2sV3', 'StandardD4sV3', 'StandardD8sV3', 'StandardD16sV3', 'StandardD32sV3', 'StandardD64sV3', 'StandardDS4V2', 'StandardDS5V2', 'StandardF8sV2', 'StandardF16sV2', 'StandardF32sV2', 'StandardF64sV2', 'StandardF72sV2', 'StandardF8s', 'StandardF16s', 'StandardE4sV3', 'StandardE8sV3', 'StandardE16sV3', 'StandardE20sV3', 'StandardE32sV3', 'StandardE64sV3', 'StandardGS2', 'StandardGS3', 'StandardGS4', 'StandardGS5', 'StandardDS12V2', 'StandardDS13V2', 'StandardDS14V2', 'StandardDS15V2', 'StandardL4s', 'StandardL8s', 'StandardL16s', 'StandardL32s' 1562 VMSize OpenShiftContainerServiceVMSize `json:"vmSize,omitempty"` 1563 // SubnetCidr - Subnet CIDR for the peering. 1564 SubnetCidr *string `json:"subnetCidr,omitempty"` 1565 // OsType - OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: 'Linux', 'Windows' 1566 OsType OSType `json:"osType,omitempty"` 1567 // Role - Define the role of the AgentPoolProfile. Possible values include: 'Compute', 'Infra' 1568 Role OpenShiftAgentPoolProfileRole `json:"role,omitempty"` 1569} 1570 1571// OpenShiftManagedClusterAuthProfile defines all possible authentication profiles for the OpenShift 1572// cluster. 1573type OpenShiftManagedClusterAuthProfile struct { 1574 // IdentityProviders - Type of authentication profile to use. 1575 IdentityProviders *[]OpenShiftManagedClusterIdentityProvider `json:"identityProviders,omitempty"` 1576} 1577 1578// BasicOpenShiftManagedClusterBaseIdentityProvider structure for any Identity provider. 1579type BasicOpenShiftManagedClusterBaseIdentityProvider interface { 1580 AsOpenShiftManagedClusterAADIdentityProvider() (*OpenShiftManagedClusterAADIdentityProvider, bool) 1581 AsOpenShiftManagedClusterBaseIdentityProvider() (*OpenShiftManagedClusterBaseIdentityProvider, bool) 1582} 1583 1584// OpenShiftManagedClusterBaseIdentityProvider structure for any Identity provider. 1585type OpenShiftManagedClusterBaseIdentityProvider struct { 1586 // Kind - Possible values include: 'KindOpenShiftManagedClusterBaseIdentityProvider', 'KindAADIdentityProvider' 1587 Kind Kind `json:"kind,omitempty"` 1588} 1589 1590func unmarshalBasicOpenShiftManagedClusterBaseIdentityProvider(body []byte) (BasicOpenShiftManagedClusterBaseIdentityProvider, error) { 1591 var m map[string]interface{} 1592 err := json.Unmarshal(body, &m) 1593 if err != nil { 1594 return nil, err 1595 } 1596 1597 switch m["kind"] { 1598 case string(KindAADIdentityProvider): 1599 var osmcaip OpenShiftManagedClusterAADIdentityProvider 1600 err := json.Unmarshal(body, &osmcaip) 1601 return osmcaip, err 1602 default: 1603 var osmcbip OpenShiftManagedClusterBaseIdentityProvider 1604 err := json.Unmarshal(body, &osmcbip) 1605 return osmcbip, err 1606 } 1607} 1608func unmarshalBasicOpenShiftManagedClusterBaseIdentityProviderArray(body []byte) ([]BasicOpenShiftManagedClusterBaseIdentityProvider, error) { 1609 var rawMessages []*json.RawMessage 1610 err := json.Unmarshal(body, &rawMessages) 1611 if err != nil { 1612 return nil, err 1613 } 1614 1615 osmcbipArray := make([]BasicOpenShiftManagedClusterBaseIdentityProvider, len(rawMessages)) 1616 1617 for index, rawMessage := range rawMessages { 1618 osmcbip, err := unmarshalBasicOpenShiftManagedClusterBaseIdentityProvider(*rawMessage) 1619 if err != nil { 1620 return nil, err 1621 } 1622 osmcbipArray[index] = osmcbip 1623 } 1624 return osmcbipArray, nil 1625} 1626 1627// MarshalJSON is the custom marshaler for OpenShiftManagedClusterBaseIdentityProvider. 1628func (osmcbip OpenShiftManagedClusterBaseIdentityProvider) MarshalJSON() ([]byte, error) { 1629 osmcbip.Kind = KindOpenShiftManagedClusterBaseIdentityProvider 1630 objectMap := make(map[string]interface{}) 1631 if osmcbip.Kind != "" { 1632 objectMap["kind"] = osmcbip.Kind 1633 } 1634 return json.Marshal(objectMap) 1635} 1636 1637// AsOpenShiftManagedClusterAADIdentityProvider is the BasicOpenShiftManagedClusterBaseIdentityProvider implementation for OpenShiftManagedClusterBaseIdentityProvider. 1638func (osmcbip OpenShiftManagedClusterBaseIdentityProvider) AsOpenShiftManagedClusterAADIdentityProvider() (*OpenShiftManagedClusterAADIdentityProvider, bool) { 1639 return nil, false 1640} 1641 1642// AsOpenShiftManagedClusterBaseIdentityProvider is the BasicOpenShiftManagedClusterBaseIdentityProvider implementation for OpenShiftManagedClusterBaseIdentityProvider. 1643func (osmcbip OpenShiftManagedClusterBaseIdentityProvider) AsOpenShiftManagedClusterBaseIdentityProvider() (*OpenShiftManagedClusterBaseIdentityProvider, bool) { 1644 return &osmcbip, true 1645} 1646 1647// AsBasicOpenShiftManagedClusterBaseIdentityProvider is the BasicOpenShiftManagedClusterBaseIdentityProvider implementation for OpenShiftManagedClusterBaseIdentityProvider. 1648func (osmcbip OpenShiftManagedClusterBaseIdentityProvider) AsBasicOpenShiftManagedClusterBaseIdentityProvider() (BasicOpenShiftManagedClusterBaseIdentityProvider, bool) { 1649 return &osmcbip, true 1650} 1651 1652// OpenShiftManagedClusterIdentityProvider defines the configuration of the identity providers to be used 1653// in the OpenShift cluster. 1654type OpenShiftManagedClusterIdentityProvider struct { 1655 // Name - Name of the provider. 1656 Name *string `json:"name,omitempty"` 1657 // Provider - Configuration of the provider. 1658 Provider BasicOpenShiftManagedClusterBaseIdentityProvider `json:"provider,omitempty"` 1659} 1660 1661// UnmarshalJSON is the custom unmarshaler for OpenShiftManagedClusterIdentityProvider struct. 1662func (osmcip *OpenShiftManagedClusterIdentityProvider) UnmarshalJSON(body []byte) error { 1663 var m map[string]*json.RawMessage 1664 err := json.Unmarshal(body, &m) 1665 if err != nil { 1666 return err 1667 } 1668 for k, v := range m { 1669 switch k { 1670 case "name": 1671 if v != nil { 1672 var name string 1673 err = json.Unmarshal(*v, &name) 1674 if err != nil { 1675 return err 1676 } 1677 osmcip.Name = &name 1678 } 1679 case "provider": 1680 if v != nil { 1681 provider, err := unmarshalBasicOpenShiftManagedClusterBaseIdentityProvider(*v) 1682 if err != nil { 1683 return err 1684 } 1685 osmcip.Provider = provider 1686 } 1687 } 1688 } 1689 1690 return nil 1691} 1692 1693// OpenShiftManagedClusterListResult the response from the List OpenShift Managed Clusters operation. 1694type OpenShiftManagedClusterListResult struct { 1695 autorest.Response `json:"-"` 1696 // Value - The list of OpenShift managed clusters. 1697 Value *[]OpenShiftManagedCluster `json:"value,omitempty"` 1698 // NextLink - READ-ONLY; The URL to get the next set of OpenShift managed cluster results. 1699 NextLink *string `json:"nextLink,omitempty"` 1700} 1701 1702// MarshalJSON is the custom marshaler for OpenShiftManagedClusterListResult. 1703func (osmclr OpenShiftManagedClusterListResult) MarshalJSON() ([]byte, error) { 1704 objectMap := make(map[string]interface{}) 1705 if osmclr.Value != nil { 1706 objectMap["value"] = osmclr.Value 1707 } 1708 return json.Marshal(objectMap) 1709} 1710 1711// OpenShiftManagedClusterListResultIterator provides access to a complete listing of 1712// OpenShiftManagedCluster values. 1713type OpenShiftManagedClusterListResultIterator struct { 1714 i int 1715 page OpenShiftManagedClusterListResultPage 1716} 1717 1718// NextWithContext advances to the next value. If there was an error making 1719// the request the iterator does not advance and the error is returned. 1720func (iter *OpenShiftManagedClusterListResultIterator) NextWithContext(ctx context.Context) (err error) { 1721 if tracing.IsEnabled() { 1722 ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftManagedClusterListResultIterator.NextWithContext") 1723 defer func() { 1724 sc := -1 1725 if iter.Response().Response.Response != nil { 1726 sc = iter.Response().Response.Response.StatusCode 1727 } 1728 tracing.EndSpan(ctx, sc, err) 1729 }() 1730 } 1731 iter.i++ 1732 if iter.i < len(iter.page.Values()) { 1733 return nil 1734 } 1735 err = iter.page.NextWithContext(ctx) 1736 if err != nil { 1737 iter.i-- 1738 return err 1739 } 1740 iter.i = 0 1741 return nil 1742} 1743 1744// Next advances to the next value. If there was an error making 1745// the request the iterator does not advance and the error is returned. 1746// Deprecated: Use NextWithContext() instead. 1747func (iter *OpenShiftManagedClusterListResultIterator) Next() error { 1748 return iter.NextWithContext(context.Background()) 1749} 1750 1751// NotDone returns true if the enumeration should be started or is not yet complete. 1752func (iter OpenShiftManagedClusterListResultIterator) NotDone() bool { 1753 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1754} 1755 1756// Response returns the raw server response from the last page request. 1757func (iter OpenShiftManagedClusterListResultIterator) Response() OpenShiftManagedClusterListResult { 1758 return iter.page.Response() 1759} 1760 1761// Value returns the current value or a zero-initialized value if the 1762// iterator has advanced beyond the end of the collection. 1763func (iter OpenShiftManagedClusterListResultIterator) Value() OpenShiftManagedCluster { 1764 if !iter.page.NotDone() { 1765 return OpenShiftManagedCluster{} 1766 } 1767 return iter.page.Values()[iter.i] 1768} 1769 1770// Creates a new instance of the OpenShiftManagedClusterListResultIterator type. 1771func NewOpenShiftManagedClusterListResultIterator(page OpenShiftManagedClusterListResultPage) OpenShiftManagedClusterListResultIterator { 1772 return OpenShiftManagedClusterListResultIterator{page: page} 1773} 1774 1775// IsEmpty returns true if the ListResult contains no values. 1776func (osmclr OpenShiftManagedClusterListResult) IsEmpty() bool { 1777 return osmclr.Value == nil || len(*osmclr.Value) == 0 1778} 1779 1780// hasNextLink returns true if the NextLink is not empty. 1781func (osmclr OpenShiftManagedClusterListResult) hasNextLink() bool { 1782 return osmclr.NextLink != nil && len(*osmclr.NextLink) != 0 1783} 1784 1785// openShiftManagedClusterListResultPreparer prepares a request to retrieve the next set of results. 1786// It returns nil if no more results exist. 1787func (osmclr OpenShiftManagedClusterListResult) openShiftManagedClusterListResultPreparer(ctx context.Context) (*http.Request, error) { 1788 if !osmclr.hasNextLink() { 1789 return nil, nil 1790 } 1791 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1792 autorest.AsJSON(), 1793 autorest.AsGet(), 1794 autorest.WithBaseURL(to.String(osmclr.NextLink))) 1795} 1796 1797// OpenShiftManagedClusterListResultPage contains a page of OpenShiftManagedCluster values. 1798type OpenShiftManagedClusterListResultPage struct { 1799 fn func(context.Context, OpenShiftManagedClusterListResult) (OpenShiftManagedClusterListResult, error) 1800 osmclr OpenShiftManagedClusterListResult 1801} 1802 1803// NextWithContext 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. 1805func (page *OpenShiftManagedClusterListResultPage) NextWithContext(ctx context.Context) (err error) { 1806 if tracing.IsEnabled() { 1807 ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftManagedClusterListResultPage.NextWithContext") 1808 defer func() { 1809 sc := -1 1810 if page.Response().Response.Response != nil { 1811 sc = page.Response().Response.Response.StatusCode 1812 } 1813 tracing.EndSpan(ctx, sc, err) 1814 }() 1815 } 1816 for { 1817 next, err := page.fn(ctx, page.osmclr) 1818 if err != nil { 1819 return err 1820 } 1821 page.osmclr = next 1822 if !next.hasNextLink() || !next.IsEmpty() { 1823 break 1824 } 1825 } 1826 return nil 1827} 1828 1829// Next advances to the next page of values. If there was an error making 1830// the request the page does not advance and the error is returned. 1831// Deprecated: Use NextWithContext() instead. 1832func (page *OpenShiftManagedClusterListResultPage) Next() error { 1833 return page.NextWithContext(context.Background()) 1834} 1835 1836// NotDone returns true if the page enumeration should be started or is not yet complete. 1837func (page OpenShiftManagedClusterListResultPage) NotDone() bool { 1838 return !page.osmclr.IsEmpty() 1839} 1840 1841// Response returns the raw server response from the last page request. 1842func (page OpenShiftManagedClusterListResultPage) Response() OpenShiftManagedClusterListResult { 1843 return page.osmclr 1844} 1845 1846// Values returns the slice of values for the current page or nil if there are no values. 1847func (page OpenShiftManagedClusterListResultPage) Values() []OpenShiftManagedCluster { 1848 if page.osmclr.IsEmpty() { 1849 return nil 1850 } 1851 return *page.osmclr.Value 1852} 1853 1854// Creates a new instance of the OpenShiftManagedClusterListResultPage type. 1855func NewOpenShiftManagedClusterListResultPage(cur OpenShiftManagedClusterListResult, getNextPage func(context.Context, OpenShiftManagedClusterListResult) (OpenShiftManagedClusterListResult, error)) OpenShiftManagedClusterListResultPage { 1856 return OpenShiftManagedClusterListResultPage{ 1857 fn: getNextPage, 1858 osmclr: cur, 1859 } 1860} 1861 1862// OpenShiftManagedClusterMasterPoolProfile openShiftManagedClusterMaterPoolProfile contains configuration 1863// for OpenShift master VMs. 1864type OpenShiftManagedClusterMasterPoolProfile struct { 1865 // Name - Unique name of the master pool profile in the context of the subscription and resource group. 1866 Name *string `json:"name,omitempty"` 1867 // Count - Number of masters (VMs) to host docker containers. The default value is 3. 1868 Count *int32 `json:"count,omitempty"` 1869 // VMSize - Size of agent VMs. Possible values include: 'StandardD2sV3', 'StandardD4sV3', 'StandardD8sV3', 'StandardD16sV3', 'StandardD32sV3', 'StandardD64sV3', 'StandardDS4V2', 'StandardDS5V2', 'StandardF8sV2', 'StandardF16sV2', 'StandardF32sV2', 'StandardF64sV2', 'StandardF72sV2', 'StandardF8s', 'StandardF16s', 'StandardE4sV3', 'StandardE8sV3', 'StandardE16sV3', 'StandardE20sV3', 'StandardE32sV3', 'StandardE64sV3', 'StandardGS2', 'StandardGS3', 'StandardGS4', 'StandardGS5', 'StandardDS12V2', 'StandardDS13V2', 'StandardDS14V2', 'StandardDS15V2', 'StandardL4s', 'StandardL8s', 'StandardL16s', 'StandardL32s' 1870 VMSize OpenShiftContainerServiceVMSize `json:"vmSize,omitempty"` 1871 // SubnetCidr - Subnet CIDR for the peering. 1872 SubnetCidr *string `json:"subnetCidr,omitempty"` 1873 // OsType - OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: 'Linux', 'Windows' 1874 OsType OSType `json:"osType,omitempty"` 1875} 1876 1877// OpenShiftManagedClusterProperties properties of the OpenShift managed cluster. 1878type OpenShiftManagedClusterProperties struct { 1879 // ProvisioningState - READ-ONLY; The current deployment or provisioning state, which only appears in the response. 1880 ProvisioningState *string `json:"provisioningState,omitempty"` 1881 // OpenShiftVersion - Version of OpenShift specified when creating the cluster. 1882 OpenShiftVersion *string `json:"openShiftVersion,omitempty"` 1883 // PublicHostname - Optional user-specified FQDN for OpenShift API server. 1884 PublicHostname *string `json:"publicHostname,omitempty"` 1885 // Fqdn - User-specified FQDN for OpenShift API server loadbalancer internal hostname. 1886 Fqdn *string `json:"fqdn,omitempty"` 1887 // NetworkProfile - Configuration for OpenShift networking. 1888 NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` 1889 // RouterProfiles - Configuration for OpenShift router(s). 1890 RouterProfiles *[]OpenShiftRouterProfile `json:"routerProfiles,omitempty"` 1891 // MasterPoolProfile - Configuration for OpenShift master VMs. 1892 MasterPoolProfile *OpenShiftManagedClusterMasterPoolProfile `json:"masterPoolProfile,omitempty"` 1893 // AgentPoolProfiles - Configuration of OpenShift cluster VMs. 1894 AgentPoolProfiles *[]OpenShiftManagedClusterAgentPoolProfile `json:"agentPoolProfiles,omitempty"` 1895 // AuthProfile - Configures OpenShift authentication. 1896 AuthProfile *OpenShiftManagedClusterAuthProfile `json:"authProfile,omitempty"` 1897} 1898 1899// MarshalJSON is the custom marshaler for OpenShiftManagedClusterProperties. 1900func (osmcp OpenShiftManagedClusterProperties) MarshalJSON() ([]byte, error) { 1901 objectMap := make(map[string]interface{}) 1902 if osmcp.OpenShiftVersion != nil { 1903 objectMap["openShiftVersion"] = osmcp.OpenShiftVersion 1904 } 1905 if osmcp.PublicHostname != nil { 1906 objectMap["publicHostname"] = osmcp.PublicHostname 1907 } 1908 if osmcp.Fqdn != nil { 1909 objectMap["fqdn"] = osmcp.Fqdn 1910 } 1911 if osmcp.NetworkProfile != nil { 1912 objectMap["networkProfile"] = osmcp.NetworkProfile 1913 } 1914 if osmcp.RouterProfiles != nil { 1915 objectMap["routerProfiles"] = osmcp.RouterProfiles 1916 } 1917 if osmcp.MasterPoolProfile != nil { 1918 objectMap["masterPoolProfile"] = osmcp.MasterPoolProfile 1919 } 1920 if osmcp.AgentPoolProfiles != nil { 1921 objectMap["agentPoolProfiles"] = osmcp.AgentPoolProfiles 1922 } 1923 if osmcp.AuthProfile != nil { 1924 objectMap["authProfile"] = osmcp.AuthProfile 1925 } 1926 return json.Marshal(objectMap) 1927} 1928 1929// OpenShiftManagedClustersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of 1930// a long-running operation. 1931type OpenShiftManagedClustersCreateOrUpdateFuture struct { 1932 azure.FutureAPI 1933 // Result returns the result of the asynchronous operation. 1934 // If the operation has not completed it will return an error. 1935 Result func(OpenShiftManagedClustersClient) (OpenShiftManagedCluster, error) 1936} 1937 1938// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1939func (future *OpenShiftManagedClustersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 1940 var azFuture azure.Future 1941 if err := json.Unmarshal(body, &azFuture); err != nil { 1942 return err 1943 } 1944 future.FutureAPI = &azFuture 1945 future.Result = future.result 1946 return nil 1947} 1948 1949// result is the default implementation for OpenShiftManagedClustersCreateOrUpdateFuture.Result. 1950func (future *OpenShiftManagedClustersCreateOrUpdateFuture) result(client OpenShiftManagedClustersClient) (osmc OpenShiftManagedCluster, err error) { 1951 var done bool 1952 done, err = future.DoneWithContext(context.Background(), client) 1953 if err != nil { 1954 err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 1955 return 1956 } 1957 if !done { 1958 osmc.Response.Response = future.Response() 1959 err = azure.NewAsyncOpIncompleteError("containerservice.OpenShiftManagedClustersCreateOrUpdateFuture") 1960 return 1961 } 1962 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1963 if osmc.Response.Response, err = future.GetResult(sender); err == nil && osmc.Response.Response.StatusCode != http.StatusNoContent { 1964 osmc, err = client.CreateOrUpdateResponder(osmc.Response.Response) 1965 if err != nil { 1966 err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersCreateOrUpdateFuture", "Result", osmc.Response.Response, "Failure responding to request") 1967 } 1968 } 1969 return 1970} 1971 1972// OpenShiftManagedClustersDeleteFuture an abstraction for monitoring and retrieving the results of a 1973// long-running operation. 1974type OpenShiftManagedClustersDeleteFuture struct { 1975 azure.FutureAPI 1976 // Result returns the result of the asynchronous operation. 1977 // If the operation has not completed it will return an error. 1978 Result func(OpenShiftManagedClustersClient) (autorest.Response, error) 1979} 1980 1981// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1982func (future *OpenShiftManagedClustersDeleteFuture) UnmarshalJSON(body []byte) error { 1983 var azFuture azure.Future 1984 if err := json.Unmarshal(body, &azFuture); err != nil { 1985 return err 1986 } 1987 future.FutureAPI = &azFuture 1988 future.Result = future.result 1989 return nil 1990} 1991 1992// result is the default implementation for OpenShiftManagedClustersDeleteFuture.Result. 1993func (future *OpenShiftManagedClustersDeleteFuture) result(client OpenShiftManagedClustersClient) (ar autorest.Response, err error) { 1994 var done bool 1995 done, err = future.DoneWithContext(context.Background(), client) 1996 if err != nil { 1997 err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersDeleteFuture", "Result", future.Response(), "Polling failure") 1998 return 1999 } 2000 if !done { 2001 ar.Response = future.Response() 2002 err = azure.NewAsyncOpIncompleteError("containerservice.OpenShiftManagedClustersDeleteFuture") 2003 return 2004 } 2005 ar.Response = future.Response() 2006 return 2007} 2008 2009// OpenShiftManagedClustersUpdateTagsFuture an abstraction for monitoring and retrieving the results of a 2010// long-running operation. 2011type OpenShiftManagedClustersUpdateTagsFuture struct { 2012 azure.FutureAPI 2013 // Result returns the result of the asynchronous operation. 2014 // If the operation has not completed it will return an error. 2015 Result func(OpenShiftManagedClustersClient) (OpenShiftManagedCluster, error) 2016} 2017 2018// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2019func (future *OpenShiftManagedClustersUpdateTagsFuture) UnmarshalJSON(body []byte) error { 2020 var azFuture azure.Future 2021 if err := json.Unmarshal(body, &azFuture); err != nil { 2022 return err 2023 } 2024 future.FutureAPI = &azFuture 2025 future.Result = future.result 2026 return nil 2027} 2028 2029// result is the default implementation for OpenShiftManagedClustersUpdateTagsFuture.Result. 2030func (future *OpenShiftManagedClustersUpdateTagsFuture) result(client OpenShiftManagedClustersClient) (osmc OpenShiftManagedCluster, err error) { 2031 var done bool 2032 done, err = future.DoneWithContext(context.Background(), client) 2033 if err != nil { 2034 err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersUpdateTagsFuture", "Result", future.Response(), "Polling failure") 2035 return 2036 } 2037 if !done { 2038 osmc.Response.Response = future.Response() 2039 err = azure.NewAsyncOpIncompleteError("containerservice.OpenShiftManagedClustersUpdateTagsFuture") 2040 return 2041 } 2042 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2043 if osmc.Response.Response, err = future.GetResult(sender); err == nil && osmc.Response.Response.StatusCode != http.StatusNoContent { 2044 osmc, err = client.UpdateTagsResponder(osmc.Response.Response) 2045 if err != nil { 2046 err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersUpdateTagsFuture", "Result", osmc.Response.Response, "Failure responding to request") 2047 } 2048 } 2049 return 2050} 2051 2052// OpenShiftRouterProfile represents an OpenShift router 2053type OpenShiftRouterProfile struct { 2054 // Name - Name of the router profile. 2055 Name *string `json:"name,omitempty"` 2056 // PublicSubdomain - DNS subdomain for OpenShift router. 2057 PublicSubdomain *string `json:"publicSubdomain,omitempty"` 2058 // Fqdn - READ-ONLY; Auto-allocated FQDN for the OpenShift router. 2059 Fqdn *string `json:"fqdn,omitempty"` 2060} 2061 2062// MarshalJSON is the custom marshaler for OpenShiftRouterProfile. 2063func (osrp OpenShiftRouterProfile) MarshalJSON() ([]byte, error) { 2064 objectMap := make(map[string]interface{}) 2065 if osrp.Name != nil { 2066 objectMap["name"] = osrp.Name 2067 } 2068 if osrp.PublicSubdomain != nil { 2069 objectMap["publicSubdomain"] = osrp.PublicSubdomain 2070 } 2071 return json.Marshal(objectMap) 2072} 2073 2074// OperationListResult the List Compute Operation operation response. 2075type OperationListResult struct { 2076 autorest.Response `json:"-"` 2077 // Value - READ-ONLY; The list of compute operations 2078 Value *[]OperationValue `json:"value,omitempty"` 2079} 2080 2081// MarshalJSON is the custom marshaler for OperationListResult. 2082func (olr OperationListResult) MarshalJSON() ([]byte, error) { 2083 objectMap := make(map[string]interface{}) 2084 return json.Marshal(objectMap) 2085} 2086 2087// OperationValue describes the properties of a Compute Operation value. 2088type OperationValue struct { 2089 // Origin - READ-ONLY; The origin of the compute operation. 2090 Origin *string `json:"origin,omitempty"` 2091 // Name - READ-ONLY; The name of the compute operation. 2092 Name *string `json:"name,omitempty"` 2093 // OperationValueDisplay - Describes the properties of a Compute Operation Value Display. 2094 *OperationValueDisplay `json:"display,omitempty"` 2095} 2096 2097// MarshalJSON is the custom marshaler for OperationValue. 2098func (ov OperationValue) MarshalJSON() ([]byte, error) { 2099 objectMap := make(map[string]interface{}) 2100 if ov.OperationValueDisplay != nil { 2101 objectMap["display"] = ov.OperationValueDisplay 2102 } 2103 return json.Marshal(objectMap) 2104} 2105 2106// UnmarshalJSON is the custom unmarshaler for OperationValue struct. 2107func (ov *OperationValue) UnmarshalJSON(body []byte) error { 2108 var m map[string]*json.RawMessage 2109 err := json.Unmarshal(body, &m) 2110 if err != nil { 2111 return err 2112 } 2113 for k, v := range m { 2114 switch k { 2115 case "origin": 2116 if v != nil { 2117 var origin string 2118 err = json.Unmarshal(*v, &origin) 2119 if err != nil { 2120 return err 2121 } 2122 ov.Origin = &origin 2123 } 2124 case "name": 2125 if v != nil { 2126 var name string 2127 err = json.Unmarshal(*v, &name) 2128 if err != nil { 2129 return err 2130 } 2131 ov.Name = &name 2132 } 2133 case "display": 2134 if v != nil { 2135 var operationValueDisplay OperationValueDisplay 2136 err = json.Unmarshal(*v, &operationValueDisplay) 2137 if err != nil { 2138 return err 2139 } 2140 ov.OperationValueDisplay = &operationValueDisplay 2141 } 2142 } 2143 } 2144 2145 return nil 2146} 2147 2148// OperationValueDisplay describes the properties of a Compute Operation Value Display. 2149type OperationValueDisplay struct { 2150 // Operation - READ-ONLY; The display name of the compute operation. 2151 Operation *string `json:"operation,omitempty"` 2152 // Resource - READ-ONLY; The display name of the resource the operation applies to. 2153 Resource *string `json:"resource,omitempty"` 2154 // Description - READ-ONLY; The description of the operation. 2155 Description *string `json:"description,omitempty"` 2156 // Provider - READ-ONLY; The resource provider for the operation. 2157 Provider *string `json:"provider,omitempty"` 2158} 2159 2160// MarshalJSON is the custom marshaler for OperationValueDisplay. 2161func (ovd OperationValueDisplay) MarshalJSON() ([]byte, error) { 2162 objectMap := make(map[string]interface{}) 2163 return json.Marshal(objectMap) 2164} 2165 2166// OrchestratorProfile contains information about orchestrator. 2167type OrchestratorProfile struct { 2168 // OrchestratorType - Orchestrator type. 2169 OrchestratorType *string `json:"orchestratorType,omitempty"` 2170 // OrchestratorVersion - Orchestrator version (major, minor, patch). 2171 OrchestratorVersion *string `json:"orchestratorVersion,omitempty"` 2172} 2173 2174// OrchestratorProfileType profile for the container service orchestrator. 2175type OrchestratorProfileType struct { 2176 // 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' 2177 OrchestratorType OrchestratorTypes `json:"orchestratorType,omitempty"` 2178 // 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". 2179 OrchestratorVersion *string `json:"orchestratorVersion,omitempty"` 2180} 2181 2182// OrchestratorVersionProfile the profile of an orchestrator and its available versions. 2183type OrchestratorVersionProfile struct { 2184 // OrchestratorType - Orchestrator type. 2185 OrchestratorType *string `json:"orchestratorType,omitempty"` 2186 // OrchestratorVersion - Orchestrator version (major, minor, patch). 2187 OrchestratorVersion *string `json:"orchestratorVersion,omitempty"` 2188 // Default - Installed by default if version is not specified. 2189 Default *bool `json:"default,omitempty"` 2190 // Upgrades - The list of available upgrade versions. 2191 Upgrades *[]OrchestratorProfile `json:"upgrades,omitempty"` 2192} 2193 2194// OrchestratorVersionProfileListResult the list of versions for supported orchestrators. 2195type OrchestratorVersionProfileListResult struct { 2196 autorest.Response `json:"-"` 2197 // ID - READ-ONLY; Id of the orchestrator version profile list result. 2198 ID *string `json:"id,omitempty"` 2199 // Name - READ-ONLY; Name of the orchestrator version profile list result. 2200 Name *string `json:"name,omitempty"` 2201 // Type - READ-ONLY; Type of the orchestrator version profile list result. 2202 Type *string `json:"type,omitempty"` 2203 // OrchestratorVersionProfileProperties - The properties of an orchestrator version profile. 2204 *OrchestratorVersionProfileProperties `json:"properties,omitempty"` 2205} 2206 2207// MarshalJSON is the custom marshaler for OrchestratorVersionProfileListResult. 2208func (ovplr OrchestratorVersionProfileListResult) MarshalJSON() ([]byte, error) { 2209 objectMap := make(map[string]interface{}) 2210 if ovplr.OrchestratorVersionProfileProperties != nil { 2211 objectMap["properties"] = ovplr.OrchestratorVersionProfileProperties 2212 } 2213 return json.Marshal(objectMap) 2214} 2215 2216// UnmarshalJSON is the custom unmarshaler for OrchestratorVersionProfileListResult struct. 2217func (ovplr *OrchestratorVersionProfileListResult) UnmarshalJSON(body []byte) error { 2218 var m map[string]*json.RawMessage 2219 err := json.Unmarshal(body, &m) 2220 if err != nil { 2221 return err 2222 } 2223 for k, v := range m { 2224 switch k { 2225 case "id": 2226 if v != nil { 2227 var ID string 2228 err = json.Unmarshal(*v, &ID) 2229 if err != nil { 2230 return err 2231 } 2232 ovplr.ID = &ID 2233 } 2234 case "name": 2235 if v != nil { 2236 var name string 2237 err = json.Unmarshal(*v, &name) 2238 if err != nil { 2239 return err 2240 } 2241 ovplr.Name = &name 2242 } 2243 case "type": 2244 if v != nil { 2245 var typeVar string 2246 err = json.Unmarshal(*v, &typeVar) 2247 if err != nil { 2248 return err 2249 } 2250 ovplr.Type = &typeVar 2251 } 2252 case "properties": 2253 if v != nil { 2254 var orchestratorVersionProfileProperties OrchestratorVersionProfileProperties 2255 err = json.Unmarshal(*v, &orchestratorVersionProfileProperties) 2256 if err != nil { 2257 return err 2258 } 2259 ovplr.OrchestratorVersionProfileProperties = &orchestratorVersionProfileProperties 2260 } 2261 } 2262 } 2263 2264 return nil 2265} 2266 2267// OrchestratorVersionProfileProperties the properties of an orchestrator version profile. 2268type OrchestratorVersionProfileProperties struct { 2269 // Orchestrators - List of orchestrator version profiles. 2270 Orchestrators *[]OrchestratorVersionProfile `json:"orchestrators,omitempty"` 2271} 2272 2273// Properties properties of the container service. 2274type Properties struct { 2275 // ProvisioningState - READ-ONLY; The current deployment or provisioning state, which only appears in the response. 2276 ProvisioningState *string `json:"provisioningState,omitempty"` 2277 // OrchestratorProfile - Profile for the container service orchestrator. 2278 OrchestratorProfile *OrchestratorProfileType `json:"orchestratorProfile,omitempty"` 2279 // CustomProfile - Properties to configure a custom container service cluster. 2280 CustomProfile *CustomProfile `json:"customProfile,omitempty"` 2281 // 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. 2282 ServicePrincipalProfile *ServicePrincipalProfile `json:"servicePrincipalProfile,omitempty"` 2283 // MasterProfile - Profile for the container service master. 2284 MasterProfile *MasterProfile `json:"masterProfile,omitempty"` 2285 // AgentPoolProfiles - Properties of the agent pool. 2286 AgentPoolProfiles *[]AgentPoolProfile `json:"agentPoolProfiles,omitempty"` 2287 // WindowsProfile - Profile for Windows VMs in the container service cluster. 2288 WindowsProfile *WindowsProfile `json:"windowsProfile,omitempty"` 2289 // LinuxProfile - Profile for Linux VMs in the container service cluster. 2290 LinuxProfile *LinuxProfile `json:"linuxProfile,omitempty"` 2291 // DiagnosticsProfile - Profile for diagnostics in the container service cluster. 2292 DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` 2293} 2294 2295// MarshalJSON is the custom marshaler for Properties. 2296func (p Properties) MarshalJSON() ([]byte, error) { 2297 objectMap := make(map[string]interface{}) 2298 if p.OrchestratorProfile != nil { 2299 objectMap["orchestratorProfile"] = p.OrchestratorProfile 2300 } 2301 if p.CustomProfile != nil { 2302 objectMap["customProfile"] = p.CustomProfile 2303 } 2304 if p.ServicePrincipalProfile != nil { 2305 objectMap["servicePrincipalProfile"] = p.ServicePrincipalProfile 2306 } 2307 if p.MasterProfile != nil { 2308 objectMap["masterProfile"] = p.MasterProfile 2309 } 2310 if p.AgentPoolProfiles != nil { 2311 objectMap["agentPoolProfiles"] = p.AgentPoolProfiles 2312 } 2313 if p.WindowsProfile != nil { 2314 objectMap["windowsProfile"] = p.WindowsProfile 2315 } 2316 if p.LinuxProfile != nil { 2317 objectMap["linuxProfile"] = p.LinuxProfile 2318 } 2319 if p.DiagnosticsProfile != nil { 2320 objectMap["diagnosticsProfile"] = p.DiagnosticsProfile 2321 } 2322 return json.Marshal(objectMap) 2323} 2324 2325// PurchasePlan used for establishing the purchase context of any 3rd Party artifact through MarketPlace. 2326type PurchasePlan struct { 2327 // Name - The plan ID. 2328 Name *string `json:"name,omitempty"` 2329 // Product - Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. 2330 Product *string `json:"product,omitempty"` 2331 // PromotionCode - The promotion code. 2332 PromotionCode *string `json:"promotionCode,omitempty"` 2333 // Publisher - The plan ID. 2334 Publisher *string `json:"publisher,omitempty"` 2335} 2336 2337// Resource the Resource model definition. 2338type Resource struct { 2339 // ID - READ-ONLY; Resource Id 2340 ID *string `json:"id,omitempty"` 2341 // Name - READ-ONLY; Resource name 2342 Name *string `json:"name,omitempty"` 2343 // Type - READ-ONLY; Resource type 2344 Type *string `json:"type,omitempty"` 2345 // Location - Resource location 2346 Location *string `json:"location,omitempty"` 2347 // Tags - Resource tags 2348 Tags map[string]*string `json:"tags"` 2349} 2350 2351// MarshalJSON is the custom marshaler for Resource. 2352func (r Resource) MarshalJSON() ([]byte, error) { 2353 objectMap := make(map[string]interface{}) 2354 if r.Location != nil { 2355 objectMap["location"] = r.Location 2356 } 2357 if r.Tags != nil { 2358 objectMap["tags"] = r.Tags 2359 } 2360 return json.Marshal(objectMap) 2361} 2362 2363// ServicePrincipalProfile information about a service principal identity for the cluster to use for 2364// manipulating Azure APIs. Either secret or keyVaultSecretRef must be specified. 2365type ServicePrincipalProfile struct { 2366 // ClientID - The ID for the service principal. 2367 ClientID *string `json:"clientId,omitempty"` 2368 // Secret - The secret password associated with the service principal in plain text. 2369 Secret *string `json:"secret,omitempty"` 2370 // KeyVaultSecretRef - Reference to a secret stored in Azure Key Vault. 2371 KeyVaultSecretRef *KeyVaultSecretRef `json:"keyVaultSecretRef,omitempty"` 2372} 2373 2374// SSHConfiguration SSH configuration for Linux-based VMs running on Azure. 2375type SSHConfiguration struct { 2376 // PublicKeys - The list of SSH public keys used to authenticate with Linux-based VMs. Only expect one key specified. 2377 PublicKeys *[]SSHPublicKey `json:"publicKeys,omitempty"` 2378} 2379 2380// SSHPublicKey contains information about SSH certificate public key data. 2381type SSHPublicKey struct { 2382 // KeyData - Certificate public key used to authenticate with VMs through SSH. The certificate must be in PEM format with or without headers. 2383 KeyData *string `json:"keyData,omitempty"` 2384} 2385 2386// TagsObject tags object for patch operations. 2387type TagsObject struct { 2388 // Tags - Resource tags. 2389 Tags map[string]*string `json:"tags"` 2390} 2391 2392// MarshalJSON is the custom marshaler for TagsObject. 2393func (toVar TagsObject) MarshalJSON() ([]byte, error) { 2394 objectMap := make(map[string]interface{}) 2395 if toVar.Tags != nil { 2396 objectMap["tags"] = toVar.Tags 2397 } 2398 return json.Marshal(objectMap) 2399} 2400 2401// VMDiagnostics profile for diagnostics on the container service VMs. 2402type VMDiagnostics struct { 2403 // Enabled - Whether the VM diagnostic agent is provisioned on the VM. 2404 Enabled *bool `json:"enabled,omitempty"` 2405 // StorageURI - READ-ONLY; The URI of the storage account where diagnostics are stored. 2406 StorageURI *string `json:"storageUri,omitempty"` 2407} 2408 2409// MarshalJSON is the custom marshaler for VMDiagnostics. 2410func (vd VMDiagnostics) MarshalJSON() ([]byte, error) { 2411 objectMap := make(map[string]interface{}) 2412 if vd.Enabled != nil { 2413 objectMap["enabled"] = vd.Enabled 2414 } 2415 return json.Marshal(objectMap) 2416} 2417 2418// WindowsProfile profile for Windows VMs in the container service cluster. 2419type WindowsProfile struct { 2420 // AdminUsername - The administrator username to use for Windows VMs. 2421 AdminUsername *string `json:"adminUsername,omitempty"` 2422 // AdminPassword - The administrator password to use for Windows VMs. 2423 AdminPassword *string `json:"adminPassword,omitempty"` 2424} 2425