-
Notifications
You must be signed in to change notification settings - Fork 839
/
models.go
3933 lines (3648 loc) · 165 KB
/
models.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package containerservice
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"context"
"encoding/json"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/date"
"github.com/Azure/go-autorest/autorest/to"
"github.com/Azure/go-autorest/tracing"
"net/http"
)
// The package's fully qualified name.
const fqdn = "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2021-08-01/containerservice"
// AccessProfile profile for enabling a user to access a managed cluster.
type AccessProfile struct {
// KubeConfig - Base64-encoded Kubernetes configuration file.
KubeConfig *[]byte `json:"kubeConfig,omitempty"`
}
// AgentPool agent Pool.
type AgentPool struct {
autorest.Response `json:"-"`
// ManagedClusterAgentPoolProfileProperties - Properties of an agent pool.
*ManagedClusterAgentPoolProfileProperties `json:"properties,omitempty"`
// ID - READ-ONLY; Resource ID.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; The name of the resource that is unique within a resource group. This name can be used to access the resource.
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; Resource type
Type *string `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for AgentPool.
func (ap AgentPool) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if ap.ManagedClusterAgentPoolProfileProperties != nil {
objectMap["properties"] = ap.ManagedClusterAgentPoolProfileProperties
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for AgentPool struct.
func (ap *AgentPool) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "properties":
if v != nil {
var managedClusterAgentPoolProfileProperties ManagedClusterAgentPoolProfileProperties
err = json.Unmarshal(*v, &managedClusterAgentPoolProfileProperties)
if err != nil {
return err
}
ap.ManagedClusterAgentPoolProfileProperties = &managedClusterAgentPoolProfileProperties
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
ap.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
ap.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
ap.Type = &typeVar
}
}
}
return nil
}
// AgentPoolAvailableVersions the list of available versions for an agent pool.
type AgentPoolAvailableVersions struct {
autorest.Response `json:"-"`
// ID - READ-ONLY; The ID of the agent pool version list.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; The name of the agent pool version list.
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; Type of the agent pool version list.
Type *string `json:"type,omitempty"`
// AgentPoolAvailableVersionsProperties - Properties of agent pool available versions.
*AgentPoolAvailableVersionsProperties `json:"properties,omitempty"`
}
// MarshalJSON is the custom marshaler for AgentPoolAvailableVersions.
func (apav AgentPoolAvailableVersions) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if apav.AgentPoolAvailableVersionsProperties != nil {
objectMap["properties"] = apav.AgentPoolAvailableVersionsProperties
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for AgentPoolAvailableVersions struct.
func (apav *AgentPoolAvailableVersions) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
apav.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
apav.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
apav.Type = &typeVar
}
case "properties":
if v != nil {
var agentPoolAvailableVersionsProperties AgentPoolAvailableVersionsProperties
err = json.Unmarshal(*v, &agentPoolAvailableVersionsProperties)
if err != nil {
return err
}
apav.AgentPoolAvailableVersionsProperties = &agentPoolAvailableVersionsProperties
}
}
}
return nil
}
// AgentPoolAvailableVersionsProperties the list of available agent pool versions.
type AgentPoolAvailableVersionsProperties struct {
// AgentPoolVersions - List of versions available for agent pool.
AgentPoolVersions *[]AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem `json:"agentPoolVersions,omitempty"`
}
// AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem ...
type AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem struct {
// Default - Whether this version is the default agent pool version.
Default *bool `json:"default,omitempty"`
// KubernetesVersion - The Kubernetes version (major.minor.patch).
KubernetesVersion *string `json:"kubernetesVersion,omitempty"`
// IsPreview - Whether Kubernetes version is currently in preview.
IsPreview *bool `json:"isPreview,omitempty"`
}
// AgentPoolListResult the response from the List Agent Pools operation.
type AgentPoolListResult struct {
autorest.Response `json:"-"`
// Value - The list of agent pools.
Value *[]AgentPool `json:"value,omitempty"`
// NextLink - READ-ONLY; The URL to get the next set of agent pool results.
NextLink *string `json:"nextLink,omitempty"`
}
// MarshalJSON is the custom marshaler for AgentPoolListResult.
func (aplr AgentPoolListResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if aplr.Value != nil {
objectMap["value"] = aplr.Value
}
return json.Marshal(objectMap)
}
// AgentPoolListResultIterator provides access to a complete listing of AgentPool values.
type AgentPoolListResultIterator struct {
i int
page AgentPoolListResultPage
}
// NextWithContext advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *AgentPoolListResultIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolListResultIterator.NextWithContext")
defer func() {
sc := -1
if iter.Response().Response.Response != nil {
sc = iter.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
iter.i++
if iter.i < len(iter.page.Values()) {
return nil
}
err = iter.page.NextWithContext(ctx)
if err != nil {
iter.i--
return err
}
iter.i = 0
return nil
}
// Next advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *AgentPoolListResultIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter AgentPoolListResultIterator) NotDone() bool {
return iter.page.NotDone() && iter.i < len(iter.page.Values())
}
// Response returns the raw server response from the last page request.
func (iter AgentPoolListResultIterator) Response() AgentPoolListResult {
return iter.page.Response()
}
// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter AgentPoolListResultIterator) Value() AgentPool {
if !iter.page.NotDone() {
return AgentPool{}
}
return iter.page.Values()[iter.i]
}
// Creates a new instance of the AgentPoolListResultIterator type.
func NewAgentPoolListResultIterator(page AgentPoolListResultPage) AgentPoolListResultIterator {
return AgentPoolListResultIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
func (aplr AgentPoolListResult) IsEmpty() bool {
return aplr.Value == nil || len(*aplr.Value) == 0
}
// hasNextLink returns true if the NextLink is not empty.
func (aplr AgentPoolListResult) hasNextLink() bool {
return aplr.NextLink != nil && len(*aplr.NextLink) != 0
}
// agentPoolListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (aplr AgentPoolListResult) agentPoolListResultPreparer(ctx context.Context) (*http.Request, error) {
if !aplr.hasNextLink() {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(aplr.NextLink)))
}
// AgentPoolListResultPage contains a page of AgentPool values.
type AgentPoolListResultPage struct {
fn func(context.Context, AgentPoolListResult) (AgentPoolListResult, error)
aplr AgentPoolListResult
}
// NextWithContext advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
func (page *AgentPoolListResultPage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolListResultPage.NextWithContext")
defer func() {
sc := -1
if page.Response().Response.Response != nil {
sc = page.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
for {
next, err := page.fn(ctx, page.aplr)
if err != nil {
return err
}
page.aplr = next
if !next.hasNextLink() || !next.IsEmpty() {
break
}
}
return nil
}
// Next advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *AgentPoolListResultPage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page AgentPoolListResultPage) NotDone() bool {
return !page.aplr.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page AgentPoolListResultPage) Response() AgentPoolListResult {
return page.aplr
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page AgentPoolListResultPage) Values() []AgentPool {
if page.aplr.IsEmpty() {
return nil
}
return *page.aplr.Value
}
// Creates a new instance of the AgentPoolListResultPage type.
func NewAgentPoolListResultPage(cur AgentPoolListResult, getNextPage func(context.Context, AgentPoolListResult) (AgentPoolListResult, error)) AgentPoolListResultPage {
return AgentPoolListResultPage{
fn: getNextPage,
aplr: cur,
}
}
// AgentPoolsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type AgentPoolsCreateOrUpdateFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(AgentPoolsClient) (AgentPool, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *AgentPoolsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
var azFuture azure.Future
if err := json.Unmarshal(body, &azFuture); err != nil {
return err
}
future.FutureAPI = &azFuture
future.Result = future.result
return nil
}
// result is the default implementation for AgentPoolsCreateOrUpdateFuture.Result.
func (future *AgentPoolsCreateOrUpdateFuture) result(client AgentPoolsClient) (ap AgentPool, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
ap.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("containerservice.AgentPoolsCreateOrUpdateFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if ap.Response.Response, err = future.GetResult(sender); err == nil && ap.Response.Response.StatusCode != http.StatusNoContent {
ap, err = client.CreateOrUpdateResponder(ap.Response.Response)
if err != nil {
err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsCreateOrUpdateFuture", "Result", ap.Response.Response, "Failure responding to request")
}
}
return
}
// AgentPoolsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type AgentPoolsDeleteFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(AgentPoolsClient) (autorest.Response, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *AgentPoolsDeleteFuture) UnmarshalJSON(body []byte) error {
var azFuture azure.Future
if err := json.Unmarshal(body, &azFuture); err != nil {
return err
}
future.FutureAPI = &azFuture
future.Result = future.result
return nil
}
// result is the default implementation for AgentPoolsDeleteFuture.Result.
func (future *AgentPoolsDeleteFuture) result(client AgentPoolsClient) (ar autorest.Response, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsDeleteFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
ar.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("containerservice.AgentPoolsDeleteFuture")
return
}
ar.Response = future.Response()
return
}
// AgentPoolsUpgradeNodeImageVersionFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type AgentPoolsUpgradeNodeImageVersionFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(AgentPoolsClient) (AgentPool, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *AgentPoolsUpgradeNodeImageVersionFuture) UnmarshalJSON(body []byte) error {
var azFuture azure.Future
if err := json.Unmarshal(body, &azFuture); err != nil {
return err
}
future.FutureAPI = &azFuture
future.Result = future.result
return nil
}
// result is the default implementation for AgentPoolsUpgradeNodeImageVersionFuture.Result.
func (future *AgentPoolsUpgradeNodeImageVersionFuture) result(client AgentPoolsClient) (ap AgentPool, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsUpgradeNodeImageVersionFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
ap.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("containerservice.AgentPoolsUpgradeNodeImageVersionFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if ap.Response.Response, err = future.GetResult(sender); err == nil && ap.Response.Response.StatusCode != http.StatusNoContent {
ap, err = client.UpgradeNodeImageVersionResponder(ap.Response.Response)
if err != nil {
err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsUpgradeNodeImageVersionFuture", "Result", ap.Response.Response, "Failure responding to request")
}
}
return
}
// AgentPoolUpgradeProfile the list of available upgrades for an agent pool.
type AgentPoolUpgradeProfile struct {
autorest.Response `json:"-"`
// ID - READ-ONLY; The ID of the agent pool upgrade profile.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; The name of the agent pool upgrade profile.
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; The type of the agent pool upgrade profile.
Type *string `json:"type,omitempty"`
// AgentPoolUpgradeProfileProperties - The properties of the agent pool upgrade profile.
*AgentPoolUpgradeProfileProperties `json:"properties,omitempty"`
}
// MarshalJSON is the custom marshaler for AgentPoolUpgradeProfile.
func (apup AgentPoolUpgradeProfile) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if apup.AgentPoolUpgradeProfileProperties != nil {
objectMap["properties"] = apup.AgentPoolUpgradeProfileProperties
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for AgentPoolUpgradeProfile struct.
func (apup *AgentPoolUpgradeProfile) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
apup.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
apup.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
apup.Type = &typeVar
}
case "properties":
if v != nil {
var agentPoolUpgradeProfileProperties AgentPoolUpgradeProfileProperties
err = json.Unmarshal(*v, &agentPoolUpgradeProfileProperties)
if err != nil {
return err
}
apup.AgentPoolUpgradeProfileProperties = &agentPoolUpgradeProfileProperties
}
}
}
return nil
}
// AgentPoolUpgradeProfileProperties the list of available upgrade versions.
type AgentPoolUpgradeProfileProperties struct {
// KubernetesVersion - The Kubernetes version (major.minor.patch).
KubernetesVersion *string `json:"kubernetesVersion,omitempty"`
// OsType - Possible values include: 'OSTypeLinux', 'OSTypeWindows'
OsType OSType `json:"osType,omitempty"`
// Upgrades - List of orchestrator types and versions available for upgrade.
Upgrades *[]AgentPoolUpgradeProfilePropertiesUpgradesItem `json:"upgrades,omitempty"`
// LatestNodeImageVersion - The latest AKS supported node image version.
LatestNodeImageVersion *string `json:"latestNodeImageVersion,omitempty"`
}
// AgentPoolUpgradeProfilePropertiesUpgradesItem ...
type AgentPoolUpgradeProfilePropertiesUpgradesItem struct {
// KubernetesVersion - The Kubernetes version (major.minor.patch).
KubernetesVersion *string `json:"kubernetesVersion,omitempty"`
// IsPreview - Whether the Kubernetes version is currently in preview.
IsPreview *bool `json:"isPreview,omitempty"`
}
// AgentPoolUpgradeSettings settings for upgrading an agentpool
type AgentPoolUpgradeSettings struct {
// MaxSurge - This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified, the default is 1. For more information, including best practices, see: https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade
MaxSurge *string `json:"maxSurge,omitempty"`
}
// CloudError an error response from the Container service.
type CloudError struct {
// Error - Details about the error.
Error *CloudErrorBody `json:"error,omitempty"`
}
// CloudErrorBody an error response from the Container service.
type CloudErrorBody struct {
// Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically.
Code *string `json:"code,omitempty"`
// Message - A message describing the error, intended to be suitable for display in a user interface.
Message *string `json:"message,omitempty"`
// Target - The target of the particular error. For example, the name of the property in error.
Target *string `json:"target,omitempty"`
// Details - A list of additional details about the error.
Details *[]CloudErrorBody `json:"details,omitempty"`
}
// CommandResultProperties the results of a run command
type CommandResultProperties struct {
// ProvisioningState - READ-ONLY; provisioning State
ProvisioningState *string `json:"provisioningState,omitempty"`
// ExitCode - READ-ONLY; The exit code of the command
ExitCode *int32 `json:"exitCode,omitempty"`
// StartedAt - READ-ONLY; The time when the command started.
StartedAt *date.Time `json:"startedAt,omitempty"`
// FinishedAt - READ-ONLY; The time when the command finished.
FinishedAt *date.Time `json:"finishedAt,omitempty"`
// Logs - READ-ONLY; The command output.
Logs *string `json:"logs,omitempty"`
// Reason - READ-ONLY; An explanation of why provisioningState is set to failed (if so).
Reason *string `json:"reason,omitempty"`
}
// MarshalJSON is the custom marshaler for CommandResultProperties.
func (crp CommandResultProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// CreationData data used when creating a target resource from a source resource.
type CreationData struct {
// SourceResourceID - This is the ARM ID of the source object to be used to create the target object.
SourceResourceID *string `json:"sourceResourceId,omitempty"`
}
// CredentialResult the credential result response.
type CredentialResult struct {
// Name - READ-ONLY; The name of the credential.
Name *string `json:"name,omitempty"`
// Value - READ-ONLY; Base64-encoded Kubernetes configuration file.
Value *[]byte `json:"value,omitempty"`
}
// MarshalJSON is the custom marshaler for CredentialResult.
func (cr CredentialResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// CredentialResults the list credential result response.
type CredentialResults struct {
autorest.Response `json:"-"`
// Kubeconfigs - READ-ONLY; Base64-encoded Kubernetes configuration file.
Kubeconfigs *[]CredentialResult `json:"kubeconfigs,omitempty"`
}
// MarshalJSON is the custom marshaler for CredentialResults.
func (cr CredentialResults) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// DiagnosticsProfile profile for diagnostics on the container service cluster.
type DiagnosticsProfile struct {
// VMDiagnostics - Profile for diagnostics on the container service VMs.
VMDiagnostics *VMDiagnostics `json:"vmDiagnostics,omitempty"`
}
// EndpointDependency a domain name that AKS agent nodes are reaching at.
type EndpointDependency struct {
// DomainName - The domain name of the dependency.
DomainName *string `json:"domainName,omitempty"`
// EndpointDetails - The Ports and Protocols used when connecting to domainName.
EndpointDetails *[]EndpointDetail `json:"endpointDetails,omitempty"`
}
// EndpointDetail connect information from the AKS agent nodes to a single endpoint.
type EndpointDetail struct {
// IPAddress - An IP Address that Domain Name currently resolves to.
IPAddress *string `json:"ipAddress,omitempty"`
// Port - The port an endpoint is connected to.
Port *int32 `json:"port,omitempty"`
// Protocol - The protocol used for connection
Protocol *string `json:"protocol,omitempty"`
// Description - Description of the detail
Description *string `json:"description,omitempty"`
}
// ExtendedLocation the complex type of the extended location.
type ExtendedLocation struct {
// Name - The name of the extended location.
Name *string `json:"name,omitempty"`
// Type - The type of the extended location. Possible values include: 'ExtendedLocationTypesEdgeZone'
Type ExtendedLocationTypes `json:"type,omitempty"`
}
// KubeletConfig see [AKS custom node
// configuration](https://docs.microsoft.com/azure/aks/custom-node-configuration) for more details.
type KubeletConfig struct {
// CPUManagerPolicy - The default is 'none'. See [Kubernetes CPU management policies](https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/#cpu-management-policies) for more information. Allowed values are 'none' and 'static'.
CPUManagerPolicy *string `json:"cpuManagerPolicy,omitempty"`
// CPUCfsQuota - The default is true.
CPUCfsQuota *bool `json:"cpuCfsQuota,omitempty"`
// CPUCfsQuotaPeriod - The default is '100ms.' Valid values are a sequence of decimal numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported units are 'ns', 'us', 'ms', 's', 'm', and 'h'.
CPUCfsQuotaPeriod *string `json:"cpuCfsQuotaPeriod,omitempty"`
// ImageGcHighThreshold - To disable image garbage collection, set to 100. The default is 85%
ImageGcHighThreshold *int32 `json:"imageGcHighThreshold,omitempty"`
// ImageGcLowThreshold - This cannot be set higher than imageGcHighThreshold. The default is 80%
ImageGcLowThreshold *int32 `json:"imageGcLowThreshold,omitempty"`
// TopologyManagerPolicy - For more information see [Kubernetes Topology Manager](https://kubernetes.io/docs/tasks/administer-cluster/topology-manager). The default is 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'.
TopologyManagerPolicy *string `json:"topologyManagerPolicy,omitempty"`
// AllowedUnsafeSysctls - Allowed list of unsafe sysctls or unsafe sysctl patterns (ending in `*`).
AllowedUnsafeSysctls *[]string `json:"allowedUnsafeSysctls,omitempty"`
// FailSwapOn - If set to true it will make the Kubelet fail to start if swap is enabled on the node.
FailSwapOn *bool `json:"failSwapOn,omitempty"`
// ContainerLogMaxSizeMB - The maximum size (e.g. 10Mi) of container log file before it is rotated.
ContainerLogMaxSizeMB *int32 `json:"containerLogMaxSizeMB,omitempty"`
// ContainerLogMaxFiles - The maximum number of container log files that can be present for a container. The number must be ≥ 2.
ContainerLogMaxFiles *int32 `json:"containerLogMaxFiles,omitempty"`
// PodMaxPids - The maximum number of processes per pod.
PodMaxPids *int32 `json:"podMaxPids,omitempty"`
}
// LinuxOSConfig see [AKS custom node
// configuration](https://docs.microsoft.com/azure/aks/custom-node-configuration) for more details.
type LinuxOSConfig struct {
// Sysctls - Sysctl settings for Linux agent nodes.
Sysctls *SysctlConfig `json:"sysctls,omitempty"`
// TransparentHugePageEnabled - Valid values are 'always', 'madvise', and 'never'. The default is 'always'. For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge).
TransparentHugePageEnabled *string `json:"transparentHugePageEnabled,omitempty"`
// TransparentHugePageDefrag - Valid values are 'always', 'defer', 'defer+madvise', 'madvise' and 'never'. The default is 'madvise'. For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge).
TransparentHugePageDefrag *string `json:"transparentHugePageDefrag,omitempty"`
// SwapFileSizeMB - The size in MB of a swap file that will be created on each node.
SwapFileSizeMB *int32 `json:"swapFileSizeMB,omitempty"`
}
// LinuxProfile profile for Linux VMs in the container service cluster.
type LinuxProfile struct {
// AdminUsername - The administrator username to use for Linux VMs.
AdminUsername *string `json:"adminUsername,omitempty"`
// SSH - The SSH configuration for Linux-based VMs running on Azure.
SSH *SSHConfiguration `json:"ssh,omitempty"`
}
// MaintenanceConfiguration see [planned
// maintenance](https://docs.microsoft.com/azure/aks/planned-maintenance) for more information about
// planned maintenance.
type MaintenanceConfiguration struct {
autorest.Response `json:"-"`
// SystemData - READ-ONLY; The system metadata relating to this resource.
SystemData *SystemData `json:"systemData,omitempty"`
// MaintenanceConfigurationProperties - Properties of a default maintenance configuration.
*MaintenanceConfigurationProperties `json:"properties,omitempty"`
// ID - READ-ONLY; Resource ID.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; The name of the resource that is unique within a resource group. This name can be used to access the resource.
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; Resource type
Type *string `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for MaintenanceConfiguration.
func (mc MaintenanceConfiguration) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if mc.MaintenanceConfigurationProperties != nil {
objectMap["properties"] = mc.MaintenanceConfigurationProperties
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for MaintenanceConfiguration struct.
func (mc *MaintenanceConfiguration) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "systemData":
if v != nil {
var systemData SystemData
err = json.Unmarshal(*v, &systemData)
if err != nil {
return err
}
mc.SystemData = &systemData
}
case "properties":
if v != nil {
var maintenanceConfigurationProperties MaintenanceConfigurationProperties
err = json.Unmarshal(*v, &maintenanceConfigurationProperties)
if err != nil {
return err
}
mc.MaintenanceConfigurationProperties = &maintenanceConfigurationProperties
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
mc.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
mc.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
mc.Type = &typeVar
}
}
}
return nil
}
// MaintenanceConfigurationListResult the response from the List maintenance configurations operation.
type MaintenanceConfigurationListResult struct {
autorest.Response `json:"-"`
// Value - The list of maintenance configurations.
Value *[]MaintenanceConfiguration `json:"value,omitempty"`
// NextLink - READ-ONLY; The URL to get the next set of maintenance configuration results.
NextLink *string `json:"nextLink,omitempty"`
}
// MarshalJSON is the custom marshaler for MaintenanceConfigurationListResult.
func (mclr MaintenanceConfigurationListResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if mclr.Value != nil {
objectMap["value"] = mclr.Value
}
return json.Marshal(objectMap)
}
// MaintenanceConfigurationListResultIterator provides access to a complete listing of
// MaintenanceConfiguration values.
type MaintenanceConfigurationListResultIterator struct {
i int
page MaintenanceConfigurationListResultPage
}
// NextWithContext advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *MaintenanceConfigurationListResultIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/MaintenanceConfigurationListResultIterator.NextWithContext")
defer func() {
sc := -1
if iter.Response().Response.Response != nil {
sc = iter.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
iter.i++
if iter.i < len(iter.page.Values()) {
return nil
}
err = iter.page.NextWithContext(ctx)
if err != nil {
iter.i--
return err
}
iter.i = 0
return nil
}
// Next advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *MaintenanceConfigurationListResultIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter MaintenanceConfigurationListResultIterator) NotDone() bool {
return iter.page.NotDone() && iter.i < len(iter.page.Values())
}
// Response returns the raw server response from the last page request.
func (iter MaintenanceConfigurationListResultIterator) Response() MaintenanceConfigurationListResult {
return iter.page.Response()
}
// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter MaintenanceConfigurationListResultIterator) Value() MaintenanceConfiguration {
if !iter.page.NotDone() {
return MaintenanceConfiguration{}
}
return iter.page.Values()[iter.i]
}
// Creates a new instance of the MaintenanceConfigurationListResultIterator type.
func NewMaintenanceConfigurationListResultIterator(page MaintenanceConfigurationListResultPage) MaintenanceConfigurationListResultIterator {
return MaintenanceConfigurationListResultIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
func (mclr MaintenanceConfigurationListResult) IsEmpty() bool {
return mclr.Value == nil || len(*mclr.Value) == 0
}
// hasNextLink returns true if the NextLink is not empty.
func (mclr MaintenanceConfigurationListResult) hasNextLink() bool {
return mclr.NextLink != nil && len(*mclr.NextLink) != 0
}
// maintenanceConfigurationListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (mclr MaintenanceConfigurationListResult) maintenanceConfigurationListResultPreparer(ctx context.Context) (*http.Request, error) {
if !mclr.hasNextLink() {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(mclr.NextLink)))
}
// MaintenanceConfigurationListResultPage contains a page of MaintenanceConfiguration values.
type MaintenanceConfigurationListResultPage struct {
fn func(context.Context, MaintenanceConfigurationListResult) (MaintenanceConfigurationListResult, error)
mclr MaintenanceConfigurationListResult
}
// NextWithContext advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
func (page *MaintenanceConfigurationListResultPage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/MaintenanceConfigurationListResultPage.NextWithContext")
defer func() {
sc := -1
if page.Response().Response.Response != nil {
sc = page.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
for {
next, err := page.fn(ctx, page.mclr)
if err != nil {
return err
}
page.mclr = next
if !next.hasNextLink() || !next.IsEmpty() {
break
}
}
return nil
}
// Next advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *MaintenanceConfigurationListResultPage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page MaintenanceConfigurationListResultPage) NotDone() bool {
return !page.mclr.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page MaintenanceConfigurationListResultPage) Response() MaintenanceConfigurationListResult {
return page.mclr
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page MaintenanceConfigurationListResultPage) Values() []MaintenanceConfiguration {
if page.mclr.IsEmpty() {
return nil
}
return *page.mclr.Value
}
// Creates a new instance of the MaintenanceConfigurationListResultPage type.
func NewMaintenanceConfigurationListResultPage(cur MaintenanceConfigurationListResult, getNextPage func(context.Context, MaintenanceConfigurationListResult) (MaintenanceConfigurationListResult, error)) MaintenanceConfigurationListResultPage {
return MaintenanceConfigurationListResultPage{
fn: getNextPage,
mclr: cur,
}
}
// MaintenanceConfigurationProperties properties used to configure planned maintenance for a Managed
// Cluster.
type MaintenanceConfigurationProperties struct {
// TimeInWeek - If two array entries specify the same day of the week, the applied configuration is the union of times in both entries.
TimeInWeek *[]TimeInWeek `json:"timeInWeek,omitempty"`
// NotAllowedTime - Time slots on which upgrade is not allowed.
NotAllowedTime *[]TimeSpan `json:"notAllowedTime,omitempty"`
}
// ManagedCluster managed cluster.