forked from Azure/azure-sdk-for-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.go
2108 lines (1911 loc) · 78 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 servicefabricmesh
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// 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/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/preview/servicefabricmesh/mgmt/2018-07-01-preview/servicefabricmesh"
// ApplicationResourceStatus enumerates the values for application resource status.
type ApplicationResourceStatus string
const (
// Creating ...
Creating ApplicationResourceStatus = "Creating"
// Deleting ...
Deleting ApplicationResourceStatus = "Deleting"
// Failed ...
Failed ApplicationResourceStatus = "Failed"
// Invalid ...
Invalid ApplicationResourceStatus = "Invalid"
// Ready ...
Ready ApplicationResourceStatus = "Ready"
// Upgrading ...
Upgrading ApplicationResourceStatus = "Upgrading"
)
// PossibleApplicationResourceStatusValues returns an array of possible values for the ApplicationResourceStatus const type.
func PossibleApplicationResourceStatusValues() []ApplicationResourceStatus {
return []ApplicationResourceStatus{Creating, Deleting, Failed, Invalid, Ready, Upgrading}
}
// DiagnosticsSinkKind enumerates the values for diagnostics sink kind.
type DiagnosticsSinkKind string
const (
// DiagnosticsSinkKindAzureInternalMonitoringPipeline Diagnostics settings for Geneva.
DiagnosticsSinkKindAzureInternalMonitoringPipeline DiagnosticsSinkKind = "AzureInternalMonitoringPipeline"
// DiagnosticsSinkKindInvalid Indicates an invalid sink kind. All Service Fabric enumerations have the
// invalid type.
DiagnosticsSinkKindInvalid DiagnosticsSinkKind = "Invalid"
)
// PossibleDiagnosticsSinkKindValues returns an array of possible values for the DiagnosticsSinkKind const type.
func PossibleDiagnosticsSinkKindValues() []DiagnosticsSinkKind {
return []DiagnosticsSinkKind{DiagnosticsSinkKindAzureInternalMonitoringPipeline, DiagnosticsSinkKindInvalid}
}
// HealthState enumerates the values for health state.
type HealthState string
const (
// HealthStateError Indicates the health state is at an error level. Error health state should be
// investigated, as they can impact the correct functionality of the cluster. The value is 3.
HealthStateError HealthState = "Error"
// HealthStateInvalid Indicates an invalid health state. All Service Fabric enumerations have the invalid
// type. The value is zero.
HealthStateInvalid HealthState = "Invalid"
// HealthStateOk Indicates the health state is okay. The value is 1.
HealthStateOk HealthState = "Ok"
// HealthStateUnknown Indicates an unknown health status. The value is 65535.
HealthStateUnknown HealthState = "Unknown"
// HealthStateWarning Indicates the health state is at a warning level. The value is 2.
HealthStateWarning HealthState = "Warning"
)
// PossibleHealthStateValues returns an array of possible values for the HealthState const type.
func PossibleHealthStateValues() []HealthState {
return []HealthState{HealthStateError, HealthStateInvalid, HealthStateOk, HealthStateUnknown, HealthStateWarning}
}
// IngressQoSLevel enumerates the values for ingress qo s level.
type IngressQoSLevel string
const (
// Bronze ...
Bronze IngressQoSLevel = "Bronze"
)
// PossibleIngressQoSLevelValues returns an array of possible values for the IngressQoSLevel const type.
func PossibleIngressQoSLevelValues() []IngressQoSLevel {
return []IngressQoSLevel{Bronze}
}
// Kind enumerates the values for kind.
type Kind string
const (
// KindAzureInternalMonitoringPipeline ...
KindAzureInternalMonitoringPipeline Kind = "AzureInternalMonitoringPipeline"
// KindDiagnosticsSinkProperties ...
KindDiagnosticsSinkProperties Kind = "DiagnosticsSinkProperties"
)
// PossibleKindValues returns an array of possible values for the Kind const type.
func PossibleKindValues() []Kind {
return []Kind{KindAzureInternalMonitoringPipeline, KindDiagnosticsSinkProperties}
}
// OperatingSystemTypes enumerates the values for operating system types.
type OperatingSystemTypes string
const (
// Linux ...
Linux OperatingSystemTypes = "Linux"
// Windows ...
Windows OperatingSystemTypes = "Windows"
)
// PossibleOperatingSystemTypesValues returns an array of possible values for the OperatingSystemTypes const type.
func PossibleOperatingSystemTypesValues() []OperatingSystemTypes {
return []OperatingSystemTypes{Linux, Windows}
}
// ServiceResourceStatus enumerates the values for service resource status.
type ServiceResourceStatus string
const (
// ServiceResourceStatusActive ...
ServiceResourceStatusActive ServiceResourceStatus = "Active"
// ServiceResourceStatusCreating ...
ServiceResourceStatusCreating ServiceResourceStatus = "Creating"
// ServiceResourceStatusDeleting ...
ServiceResourceStatusDeleting ServiceResourceStatus = "Deleting"
// ServiceResourceStatusFailed ...
ServiceResourceStatusFailed ServiceResourceStatus = "Failed"
// ServiceResourceStatusUnknown ...
ServiceResourceStatusUnknown ServiceResourceStatus = "Unknown"
// ServiceResourceStatusUpgrading ...
ServiceResourceStatusUpgrading ServiceResourceStatus = "Upgrading"
)
// PossibleServiceResourceStatusValues returns an array of possible values for the ServiceResourceStatus const type.
func PossibleServiceResourceStatusValues() []ServiceResourceStatus {
return []ServiceResourceStatus{ServiceResourceStatusActive, ServiceResourceStatusCreating, ServiceResourceStatusDeleting, ServiceResourceStatusFailed, ServiceResourceStatusUnknown, ServiceResourceStatusUpgrading}
}
// ApplicationProperties this type describes properties of an application resource.
type ApplicationProperties struct {
// Description - User readable description of the application.
Description *string `json:"description,omitempty"`
// DebugParams - Internal use.
DebugParams *string `json:"debugParams,omitempty"`
// Services - describes the services in the application.
Services *[]ServiceResourceDescription `json:"services,omitempty"`
// HealthState - Describes the health state of an application resource. Possible values include: 'HealthStateInvalid', 'HealthStateOk', 'HealthStateWarning', 'HealthStateError', 'HealthStateUnknown'
HealthState HealthState `json:"healthState,omitempty"`
// UnhealthyEvaluation - When the application's health state is not 'Ok', this additional details from service fabric Health Manager for the user to know why the application is marked unhealthy.
UnhealthyEvaluation *string `json:"unhealthyEvaluation,omitempty"`
// Status - Status of the application resource. Possible values include: 'Invalid', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed'
Status ApplicationResourceStatus `json:"status,omitempty"`
// StatusDetails - Gives additional information about the current status of the application deployment.
StatusDetails *string `json:"statusDetails,omitempty"`
// ServiceNames - Names of the services in the application.
ServiceNames *[]string `json:"serviceNames,omitempty"`
// Diagnostics - Describes the diagnostics definition and usage for an application resource.
Diagnostics *DiagnosticsDescription `json:"diagnostics,omitempty"`
}
// ApplicationResourceDescription this type describes an application resource.
type ApplicationResourceDescription struct {
autorest.Response `json:"-"`
// ApplicationResourceProperties - This type describes properties of an application resource.
*ApplicationResourceProperties `json:"properties,omitempty"`
// Tags - Resource tags.
Tags map[string]*string `json:"tags"`
// ID - Fully qualified identifier for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
ID *string `json:"id,omitempty"`
// Name - The name of the resource
Name *string `json:"name,omitempty"`
// Type - The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
Type *string `json:"type,omitempty"`
// Location - The geo-location where the resource lives
Location *string `json:"location,omitempty"`
}
// MarshalJSON is the custom marshaler for ApplicationResourceDescription.
func (ard ApplicationResourceDescription) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if ard.ApplicationResourceProperties != nil {
objectMap["properties"] = ard.ApplicationResourceProperties
}
if ard.Tags != nil {
objectMap["tags"] = ard.Tags
}
if ard.ID != nil {
objectMap["id"] = ard.ID
}
if ard.Name != nil {
objectMap["name"] = ard.Name
}
if ard.Type != nil {
objectMap["type"] = ard.Type
}
if ard.Location != nil {
objectMap["location"] = ard.Location
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for ApplicationResourceDescription struct.
func (ard *ApplicationResourceDescription) 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 applicationResourceProperties ApplicationResourceProperties
err = json.Unmarshal(*v, &applicationResourceProperties)
if err != nil {
return err
}
ard.ApplicationResourceProperties = &applicationResourceProperties
}
case "tags":
if v != nil {
var tags map[string]*string
err = json.Unmarshal(*v, &tags)
if err != nil {
return err
}
ard.Tags = tags
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
ard.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
ard.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
ard.Type = &typeVar
}
case "location":
if v != nil {
var location string
err = json.Unmarshal(*v, &location)
if err != nil {
return err
}
ard.Location = &location
}
}
}
return nil
}
// ApplicationResourceDescriptionList a pageable list of application resources.
type ApplicationResourceDescriptionList struct {
autorest.Response `json:"-"`
// Value - One page of the list.
Value *[]ApplicationResourceDescription `json:"value,omitempty"`
// NextLink - URI to fetch the next page of the list.
NextLink *string `json:"nextLink,omitempty"`
}
// ApplicationResourceDescriptionListIterator provides access to a complete listing of
// ApplicationResourceDescription values.
type ApplicationResourceDescriptionListIterator struct {
i int
page ApplicationResourceDescriptionListPage
}
// 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 *ApplicationResourceDescriptionListIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationResourceDescriptionListIterator.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 *ApplicationResourceDescriptionListIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter ApplicationResourceDescriptionListIterator) 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 ApplicationResourceDescriptionListIterator) Response() ApplicationResourceDescriptionList {
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 ApplicationResourceDescriptionListIterator) Value() ApplicationResourceDescription {
if !iter.page.NotDone() {
return ApplicationResourceDescription{}
}
return iter.page.Values()[iter.i]
}
// Creates a new instance of the ApplicationResourceDescriptionListIterator type.
func NewApplicationResourceDescriptionListIterator(page ApplicationResourceDescriptionListPage) ApplicationResourceDescriptionListIterator {
return ApplicationResourceDescriptionListIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
func (ardl ApplicationResourceDescriptionList) IsEmpty() bool {
return ardl.Value == nil || len(*ardl.Value) == 0
}
// applicationResourceDescriptionListPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (ardl ApplicationResourceDescriptionList) applicationResourceDescriptionListPreparer(ctx context.Context) (*http.Request, error) {
if ardl.NextLink == nil || len(to.String(ardl.NextLink)) < 1 {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(ardl.NextLink)))
}
// ApplicationResourceDescriptionListPage contains a page of ApplicationResourceDescription values.
type ApplicationResourceDescriptionListPage struct {
fn func(context.Context, ApplicationResourceDescriptionList) (ApplicationResourceDescriptionList, error)
ardl ApplicationResourceDescriptionList
}
// 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 *ApplicationResourceDescriptionListPage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationResourceDescriptionListPage.NextWithContext")
defer func() {
sc := -1
if page.Response().Response.Response != nil {
sc = page.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
next, err := page.fn(ctx, page.ardl)
if err != nil {
return err
}
page.ardl = next
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 *ApplicationResourceDescriptionListPage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page ApplicationResourceDescriptionListPage) NotDone() bool {
return !page.ardl.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page ApplicationResourceDescriptionListPage) Response() ApplicationResourceDescriptionList {
return page.ardl
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page ApplicationResourceDescriptionListPage) Values() []ApplicationResourceDescription {
if page.ardl.IsEmpty() {
return nil
}
return *page.ardl.Value
}
// Creates a new instance of the ApplicationResourceDescriptionListPage type.
func NewApplicationResourceDescriptionListPage(getNextPage func(context.Context, ApplicationResourceDescriptionList) (ApplicationResourceDescriptionList, error)) ApplicationResourceDescriptionListPage {
return ApplicationResourceDescriptionListPage{fn: getNextPage}
}
// ApplicationResourceProperties this type describes properties of an application resource.
type ApplicationResourceProperties struct {
// ProvisioningState - State of the resource.
ProvisioningState *string `json:"provisioningState,omitempty"`
// Description - User readable description of the application.
Description *string `json:"description,omitempty"`
// DebugParams - Internal use.
DebugParams *string `json:"debugParams,omitempty"`
// Services - describes the services in the application.
Services *[]ServiceResourceDescription `json:"services,omitempty"`
// HealthState - Describes the health state of an application resource. Possible values include: 'HealthStateInvalid', 'HealthStateOk', 'HealthStateWarning', 'HealthStateError', 'HealthStateUnknown'
HealthState HealthState `json:"healthState,omitempty"`
// UnhealthyEvaluation - When the application's health state is not 'Ok', this additional details from service fabric Health Manager for the user to know why the application is marked unhealthy.
UnhealthyEvaluation *string `json:"unhealthyEvaluation,omitempty"`
// Status - Status of the application resource. Possible values include: 'Invalid', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed'
Status ApplicationResourceStatus `json:"status,omitempty"`
// StatusDetails - Gives additional information about the current status of the application deployment.
StatusDetails *string `json:"statusDetails,omitempty"`
// ServiceNames - Names of the services in the application.
ServiceNames *[]string `json:"serviceNames,omitempty"`
// Diagnostics - Describes the diagnostics definition and usage for an application resource.
Diagnostics *DiagnosticsDescription `json:"diagnostics,omitempty"`
}
// AvailableOperationDisplay an operation available at the listed Azure resource provider.
type AvailableOperationDisplay struct {
// Provider - Name of the operation provider.
Provider *string `json:"provider,omitempty"`
// Resource - Name of the resource on which the operation is available.
Resource *string `json:"resource,omitempty"`
// Operation - Name of the available operation.
Operation *string `json:"operation,omitempty"`
// Description - Description of the available operation.
Description *string `json:"description,omitempty"`
}
// AzureInternalMonitoringPipelineSinkDescription diagnostics settings for Geneva.
type AzureInternalMonitoringPipelineSinkDescription struct {
// AccountName - Azure Internal monitoring pipeline account.
AccountName *string `json:"accountName,omitempty"`
// Namespace - Azure Internal monitoring pipeline account namespace.
Namespace *string `json:"namespace,omitempty"`
// MaConfigURL - Azure Internal monitoring agent configuration.
MaConfigURL *string `json:"maConfigUrl,omitempty"`
// FluentdConfigURL - Azure Internal monitoring agent fluentd configuration.
FluentdConfigURL interface{} `json:"fluentdConfigUrl,omitempty"`
// AutoKeyConfigURL - Azure Internal monitoring pipeline autokey associated with the certificate.
AutoKeyConfigURL *string `json:"autoKeyConfigUrl,omitempty"`
// Name - Name of the sink. This value is referenced by DiagnosticsReferenceDescription
Name *string `json:"name,omitempty"`
// Description - A description of the sink.
Description *string `json:"description,omitempty"`
// Kind - Possible values include: 'KindDiagnosticsSinkProperties', 'KindAzureInternalMonitoringPipeline'
Kind Kind `json:"kind,omitempty"`
}
// MarshalJSON is the custom marshaler for AzureInternalMonitoringPipelineSinkDescription.
func (aimpsd AzureInternalMonitoringPipelineSinkDescription) MarshalJSON() ([]byte, error) {
aimpsd.Kind = KindAzureInternalMonitoringPipeline
objectMap := make(map[string]interface{})
if aimpsd.AccountName != nil {
objectMap["accountName"] = aimpsd.AccountName
}
if aimpsd.Namespace != nil {
objectMap["namespace"] = aimpsd.Namespace
}
if aimpsd.MaConfigURL != nil {
objectMap["maConfigUrl"] = aimpsd.MaConfigURL
}
if aimpsd.FluentdConfigURL != nil {
objectMap["fluentdConfigUrl"] = aimpsd.FluentdConfigURL
}
if aimpsd.AutoKeyConfigURL != nil {
objectMap["autoKeyConfigUrl"] = aimpsd.AutoKeyConfigURL
}
if aimpsd.Name != nil {
objectMap["name"] = aimpsd.Name
}
if aimpsd.Description != nil {
objectMap["description"] = aimpsd.Description
}
if aimpsd.Kind != "" {
objectMap["kind"] = aimpsd.Kind
}
return json.Marshal(objectMap)
}
// AsAzureInternalMonitoringPipelineSinkDescription is the BasicDiagnosticsSinkProperties implementation for AzureInternalMonitoringPipelineSinkDescription.
func (aimpsd AzureInternalMonitoringPipelineSinkDescription) AsAzureInternalMonitoringPipelineSinkDescription() (*AzureInternalMonitoringPipelineSinkDescription, bool) {
return &aimpsd, true
}
// AsDiagnosticsSinkProperties is the BasicDiagnosticsSinkProperties implementation for AzureInternalMonitoringPipelineSinkDescription.
func (aimpsd AzureInternalMonitoringPipelineSinkDescription) AsDiagnosticsSinkProperties() (*DiagnosticsSinkProperties, bool) {
return nil, false
}
// AsBasicDiagnosticsSinkProperties is the BasicDiagnosticsSinkProperties implementation for AzureInternalMonitoringPipelineSinkDescription.
func (aimpsd AzureInternalMonitoringPipelineSinkDescription) AsBasicDiagnosticsSinkProperties() (BasicDiagnosticsSinkProperties, bool) {
return &aimpsd, true
}
// ContainerCodePackageProperties describes a container and its runtime properties.
type ContainerCodePackageProperties struct {
// Name - The name of the code package.
Name *string `json:"name,omitempty"`
// Image - The Container image to use.
Image *string `json:"image,omitempty"`
// ImageRegistryCredential - Image registry credential.
ImageRegistryCredential *ImageRegistryCredential `json:"imageRegistryCredential,omitempty"`
// Entrypoint - Override for the default entry point in the container.
Entrypoint *string `json:"entrypoint,omitempty"`
// Commands - Command array to execute within the container in exec form.
Commands *[]string `json:"commands,omitempty"`
// EnvironmentVariables - The environment variables to set in this container
EnvironmentVariables *[]EnvironmentVariable `json:"environmentVariables,omitempty"`
// Settings - The settings to set in this container. The setting file path can be fetched from environment variable "Fabric_SettingPath". The path for Windows container is "C:\\secrets". The path for Linux container is "/var/secrets".
Settings *[]Setting `json:"settings,omitempty"`
// Labels - The labels to set in this container.
Labels *[]ContainerLabel `json:"labels,omitempty"`
// Endpoints - The endpoints exposed by this container.
Endpoints *[]EndpointProperties `json:"endpoints,omitempty"`
// Resources - This type describes the resource requirements for a container or a service.
Resources *ResourceRequirements `json:"resources,omitempty"`
// VolumeRefs - The volumes to be attached to the container.
VolumeRefs *[]ContainerVolume `json:"volumeRefs,omitempty"`
// InstanceView - Runtime information of a container instance.
InstanceView *ContainerInstanceView `json:"instanceView,omitempty"`
// Diagnostics - Reference to sinks in DiagnosticsDescription.
Diagnostics *DiagnosticsRef `json:"diagnostics,omitempty"`
}
// ContainerEvent a container event.
type ContainerEvent struct {
// Name - The name of the container event.
Name *string `json:"name,omitempty"`
// Count - The count of the event.
Count *int32 `json:"count,omitempty"`
// FirstTimestamp - Date/time of the first event.
FirstTimestamp *string `json:"firstTimestamp,omitempty"`
// LastTimestamp - Date/time of the last event.
LastTimestamp *string `json:"lastTimestamp,omitempty"`
// Message - The event message
Message *string `json:"message,omitempty"`
// Type - The event type.
Type *string `json:"type,omitempty"`
}
// ContainerInstanceView runtime information of a container instance.
type ContainerInstanceView struct {
// RestartCount - The number of times the container has been restarted.
RestartCount *int32 `json:"restartCount,omitempty"`
// CurrentState - Current container instance state.
CurrentState *ContainerState `json:"currentState,omitempty"`
// PreviousState - Previous container instance state.
PreviousState *ContainerState `json:"previousState,omitempty"`
// Events - The events of this container instance.
Events *[]ContainerEvent `json:"events,omitempty"`
}
// ContainerLabel describes a container label.
type ContainerLabel struct {
// Name - The name of the container label.
Name *string `json:"name,omitempty"`
// Value - The value of the container label.
Value *string `json:"value,omitempty"`
}
// ContainerLogs the logs of the container.
type ContainerLogs struct {
autorest.Response `json:"-"`
// Content - content of the log.
Content *string `json:"content,omitempty"`
}
// ContainerState the container state.
type ContainerState struct {
// State - The state of this container
State *string `json:"state,omitempty"`
// StartTime - Date/time when the container state started.
StartTime *date.Time `json:"startTime,omitempty"`
// ExitCode - The container exit code.
ExitCode *string `json:"exitCode,omitempty"`
// FinishTime - Date/time when the container state finished.
FinishTime *date.Time `json:"finishTime,omitempty"`
// DetailStatus - Human-readable status of this state.
DetailStatus *string `json:"detailStatus,omitempty"`
}
// ContainerVolume describes how a volume is attached to a container.
type ContainerVolume struct {
// Name - Name of the volume.
Name *string `json:"name,omitempty"`
// ReadOnly - The flag indicating whether the volume is read only. Default is 'false'.
ReadOnly *bool `json:"readOnly,omitempty"`
// DestinationPath - The path within the container at which the volume should be mounted. Only valid path characters are allowed.
DestinationPath *string `json:"destinationPath,omitempty"`
}
// DiagnosticsDescription describes the diagnostics options available
type DiagnosticsDescription struct {
// Sinks - List of supported sinks that can be referenced.
Sinks *[]BasicDiagnosticsSinkProperties `json:"sinks,omitempty"`
// Enabled - Status of whether or not sinks are enabled.
Enabled *bool `json:"enabled,omitempty"`
// DefaultSinkRefs - The sinks to be used if diagnostics is enabled. Sink choices can be overridden at the service and code package level.
DefaultSinkRefs *[]string `json:"defaultSinkRefs,omitempty"`
}
// UnmarshalJSON is the custom unmarshaler for DiagnosticsDescription struct.
func (dd *DiagnosticsDescription) 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 "sinks":
if v != nil {
sinks, err := unmarshalBasicDiagnosticsSinkPropertiesArray(*v)
if err != nil {
return err
}
dd.Sinks = &sinks
}
case "enabled":
if v != nil {
var enabled bool
err = json.Unmarshal(*v, &enabled)
if err != nil {
return err
}
dd.Enabled = &enabled
}
case "defaultSinkRefs":
if v != nil {
var defaultSinkRefs []string
err = json.Unmarshal(*v, &defaultSinkRefs)
if err != nil {
return err
}
dd.DefaultSinkRefs = &defaultSinkRefs
}
}
}
return nil
}
// DiagnosticsRef reference to sinks in DiagnosticsDescription.
type DiagnosticsRef struct {
// Enabled - Status of whether or not sinks are enabled.
Enabled *bool `json:"enabled,omitempty"`
// SinkRefs - List of sinks to be used if enabled. References the list of sinks in DiagnosticsDescription.
SinkRefs *[]string `json:"sinkRefs,omitempty"`
}
// BasicDiagnosticsSinkProperties properties of a DiagnosticsSink.
type BasicDiagnosticsSinkProperties interface {
AsAzureInternalMonitoringPipelineSinkDescription() (*AzureInternalMonitoringPipelineSinkDescription, bool)
AsDiagnosticsSinkProperties() (*DiagnosticsSinkProperties, bool)
}
// DiagnosticsSinkProperties properties of a DiagnosticsSink.
type DiagnosticsSinkProperties struct {
// Name - Name of the sink. This value is referenced by DiagnosticsReferenceDescription
Name *string `json:"name,omitempty"`
// Description - A description of the sink.
Description *string `json:"description,omitempty"`
// Kind - Possible values include: 'KindDiagnosticsSinkProperties', 'KindAzureInternalMonitoringPipeline'
Kind Kind `json:"kind,omitempty"`
}
func unmarshalBasicDiagnosticsSinkProperties(body []byte) (BasicDiagnosticsSinkProperties, error) {
var m map[string]interface{}
err := json.Unmarshal(body, &m)
if err != nil {
return nil, err
}
switch m["kind"] {
case string(KindAzureInternalMonitoringPipeline):
var aimpsd AzureInternalMonitoringPipelineSinkDescription
err := json.Unmarshal(body, &aimpsd)
return aimpsd, err
default:
var dsp DiagnosticsSinkProperties
err := json.Unmarshal(body, &dsp)
return dsp, err
}
}
func unmarshalBasicDiagnosticsSinkPropertiesArray(body []byte) ([]BasicDiagnosticsSinkProperties, error) {
var rawMessages []*json.RawMessage
err := json.Unmarshal(body, &rawMessages)
if err != nil {
return nil, err
}
dspArray := make([]BasicDiagnosticsSinkProperties, len(rawMessages))
for index, rawMessage := range rawMessages {
dsp, err := unmarshalBasicDiagnosticsSinkProperties(*rawMessage)
if err != nil {
return nil, err
}
dspArray[index] = dsp
}
return dspArray, nil
}
// MarshalJSON is the custom marshaler for DiagnosticsSinkProperties.
func (dsp DiagnosticsSinkProperties) MarshalJSON() ([]byte, error) {
dsp.Kind = KindDiagnosticsSinkProperties
objectMap := make(map[string]interface{})
if dsp.Name != nil {
objectMap["name"] = dsp.Name
}
if dsp.Description != nil {
objectMap["description"] = dsp.Description
}
if dsp.Kind != "" {
objectMap["kind"] = dsp.Kind
}
return json.Marshal(objectMap)
}
// AsAzureInternalMonitoringPipelineSinkDescription is the BasicDiagnosticsSinkProperties implementation for DiagnosticsSinkProperties.
func (dsp DiagnosticsSinkProperties) AsAzureInternalMonitoringPipelineSinkDescription() (*AzureInternalMonitoringPipelineSinkDescription, bool) {
return nil, false
}
// AsDiagnosticsSinkProperties is the BasicDiagnosticsSinkProperties implementation for DiagnosticsSinkProperties.
func (dsp DiagnosticsSinkProperties) AsDiagnosticsSinkProperties() (*DiagnosticsSinkProperties, bool) {
return &dsp, true
}
// AsBasicDiagnosticsSinkProperties is the BasicDiagnosticsSinkProperties implementation for DiagnosticsSinkProperties.
func (dsp DiagnosticsSinkProperties) AsBasicDiagnosticsSinkProperties() (BasicDiagnosticsSinkProperties, bool) {
return &dsp, true
}
// EndpointProperties describes a container endpoint.
type EndpointProperties struct {
// Name - The name of the endpoint.
Name *string `json:"name,omitempty"`
// Port - Port used by the container.
Port *int32 `json:"port,omitempty"`
}
// EnvironmentVariable describes an environment variable for the container.
type EnvironmentVariable struct {
// Name - The name of the environment variable.
Name *string `json:"name,omitempty"`
// Value - The value of the environment variable.
Value *string `json:"value,omitempty"`
}
// ErrorModel the error details.
type ErrorModel struct {
// Code - The error code.
Code *string `json:"code,omitempty"`
// Message - The error message.
Message *string `json:"message,omitempty"`
}
// ImageRegistryCredential image registry credential.
type ImageRegistryCredential struct {
// Server - Docker image registry server, without protocol such as `http` and `https`.
Server *string `json:"server,omitempty"`
// Username - The username for the private registry.
Username *string `json:"username,omitempty"`
// Password - The password for the private registry.
Password *string `json:"password,omitempty"`
}
// IngressConfig describes public connectivity configuration for the network.
type IngressConfig struct {
// QosLevel - The QoS tier for ingress. Possible values include: 'Bronze'
QosLevel IngressQoSLevel `json:"qosLevel,omitempty"`
// Layer4 - Configuration for layer4 public connectivity for this network.
Layer4 *[]Layer4IngressConfig `json:"layer4,omitempty"`
// PublicIPAddress - The public IP address for reaching this network.
PublicIPAddress *string `json:"publicIPAddress,omitempty"`
}
// Layer4IngressConfig describes the layer4 configuration for public connectivity for this network.
type Layer4IngressConfig struct {
// Name - Layer4 ingress config name.
Name *string `json:"name,omitempty"`
// PublicPort - Specifies the public port at which the service endpoint below needs to be exposed.
PublicPort *int32 `json:"publicPort,omitempty"`
// ApplicationName - The application name which contains the service to be exposed.
ApplicationName *string `json:"applicationName,omitempty"`
// ServiceName - The service whose endpoint needs to be exposed at the public port.
ServiceName *string `json:"serviceName,omitempty"`
// EndpointName - The service endpoint that needs to be exposed.
EndpointName *string `json:"endpointName,omitempty"`
}
// ManagedProxyResource the resource model definition for Azure Resource Manager proxy resource. It will
// have everything other than required location and tags. This proxy resource is explicitly created or
// updated by including it in the parent resource.
type ManagedProxyResource struct {
// ID - Fully qualified identifier for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
ID *string `json:"id,omitempty"`
// Name - The name of the resource
Name *string `json:"name,omitempty"`
// Type - The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
Type *string `json:"type,omitempty"`
}
// NetworkProperties describes a network.
type NetworkProperties struct {
// Description - User readable description of the network.
Description *string `json:"description,omitempty"`
// AddressPrefix - the address prefix for this network.
AddressPrefix *string `json:"addressPrefix,omitempty"`
// IngressConfig - Configuration for public connectivity for this network.
IngressConfig *IngressConfig `json:"ingressConfig,omitempty"`
}
// NetworkRef describes a network reference in a service.
type NetworkRef struct {
// Name - Name of the network.
Name *string `json:"name,omitempty"`
}
// NetworkResourceDescription this type describes a network resource.
type NetworkResourceDescription struct {
autorest.Response `json:"-"`
// NetworkResourceProperties - Describes properties of a network resource.
*NetworkResourceProperties `json:"properties,omitempty"`
// Tags - Resource tags.
Tags map[string]*string `json:"tags"`
// ID - Fully qualified identifier for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
ID *string `json:"id,omitempty"`
// Name - The name of the resource
Name *string `json:"name,omitempty"`
// Type - The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
Type *string `json:"type,omitempty"`
// Location - The geo-location where the resource lives
Location *string `json:"location,omitempty"`
}
// MarshalJSON is the custom marshaler for NetworkResourceDescription.
func (nrd NetworkResourceDescription) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if nrd.NetworkResourceProperties != nil {
objectMap["properties"] = nrd.NetworkResourceProperties
}
if nrd.Tags != nil {
objectMap["tags"] = nrd.Tags
}
if nrd.ID != nil {
objectMap["id"] = nrd.ID
}
if nrd.Name != nil {
objectMap["name"] = nrd.Name
}
if nrd.Type != nil {
objectMap["type"] = nrd.Type
}
if nrd.Location != nil {
objectMap["location"] = nrd.Location
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for NetworkResourceDescription struct.
func (nrd *NetworkResourceDescription) 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 networkResourceProperties NetworkResourceProperties
err = json.Unmarshal(*v, &networkResourceProperties)
if err != nil {
return err
}
nrd.NetworkResourceProperties = &networkResourceProperties
}
case "tags":
if v != nil {
var tags map[string]*string
err = json.Unmarshal(*v, &tags)
if err != nil {
return err
}
nrd.Tags = tags
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
nrd.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
nrd.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
nrd.Type = &typeVar
}
case "location":
if v != nil {
var location string
err = json.Unmarshal(*v, &location)
if err != nil {
return err
}
nrd.Location = &location
}
}
}
return nil
}
// NetworkResourceDescriptionList a pageable list of network resources.
type NetworkResourceDescriptionList struct {
autorest.Response `json:"-"`
// Value - One page of the list.
Value *[]NetworkResourceDescription `json:"value,omitempty"`
// NextLink - URI to fetch the next page of the list.
NextLink *string `json:"nextLink,omitempty"`
}
// NetworkResourceDescriptionListIterator provides access to a complete listing of
// NetworkResourceDescription values.
type NetworkResourceDescriptionListIterator struct {
i int
page NetworkResourceDescriptionListPage
}
// 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 *NetworkResourceDescriptionListIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/NetworkResourceDescriptionListIterator.NextWithContext")
defer func() {
sc := -1