-
Notifications
You must be signed in to change notification settings - Fork 669
/
config.go
3564 lines (3206 loc) · 145 KB
/
config.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
// Copyright IBM Corp. 2017, 2021 All Rights Reserved.
// Licensed under the Mozilla Public License v2.0
package conns
import (
"crypto/tls"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"log"
"net"
gohttp "net/http"
"os"
"strings"
"time"
// Added code for the Power Colo Offering
"github.com/IBM-Cloud/container-services-go-sdk/kubernetesserviceapiv1"
"github.com/IBM-Cloud/container-services-go-sdk/satellitelinkv1"
"github.com/IBM-Cloud/terraform-provider-ibm/version"
apigateway "github.com/IBM/apigateway-go-sdk/apigatewaycontrollerapiv1"
"github.com/IBM/appconfiguration-go-admin-sdk/appconfigurationv1"
appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4"
"github.com/IBM/cloud-databases-go-sdk/clouddatabasesv5"
"github.com/IBM/container-registry-go-sdk/containerregistryv1"
"github.com/IBM/go-sdk-core/v5/core"
cosconfig "github.com/IBM/ibm-cos-sdk-go-config/resourceconfigurationv1"
kp "github.com/IBM/keyprotect-go-client"
"github.com/IBM/mqcloud-go-sdk/mqcloudv1"
cisalertsv1 "github.com/IBM/networking-go-sdk/alertsv1"
cisoriginpull "github.com/IBM/networking-go-sdk/authenticatedoriginpullapiv1"
cisbotanalyticsv1 "github.com/IBM/networking-go-sdk/botanalyticsv1"
cisbotmanagementv1 "github.com/IBM/networking-go-sdk/botmanagementv1"
ciscachev1 "github.com/IBM/networking-go-sdk/cachingapiv1"
cisipv1 "github.com/IBM/networking-go-sdk/cisipapiv1"
ciscustompagev1 "github.com/IBM/networking-go-sdk/custompagesv1"
dlProviderV2 "github.com/IBM/networking-go-sdk/directlinkproviderv2"
dl "github.com/IBM/networking-go-sdk/directlinkv1"
cisdnsbulkv1 "github.com/IBM/networking-go-sdk/dnsrecordbulkv1"
cisdnsrecordsv1 "github.com/IBM/networking-go-sdk/dnsrecordsv1"
dns "github.com/IBM/networking-go-sdk/dnssvcsv1"
cisedgefunctionv1 "github.com/IBM/networking-go-sdk/edgefunctionsapiv1"
cisfiltersv1 "github.com/IBM/networking-go-sdk/filtersv1"
cisfirewallrulesv1 "github.com/IBM/networking-go-sdk/firewallrulesv1"
cisglbhealthcheckv1 "github.com/IBM/networking-go-sdk/globalloadbalancermonitorv1"
cisglbpoolv0 "github.com/IBM/networking-go-sdk/globalloadbalancerpoolsv0"
cisglbv1 "github.com/IBM/networking-go-sdk/globalloadbalancerv1"
cislogpushjobsapiv1 "github.com/IBM/networking-go-sdk/logpushjobsapiv1"
cismtlsv1 "github.com/IBM/networking-go-sdk/mtlsv1"
cispagerulev1 "github.com/IBM/networking-go-sdk/pageruleapiv1"
cisrangeappv1 "github.com/IBM/networking-go-sdk/rangeapplicationsv1"
cisroutingv1 "github.com/IBM/networking-go-sdk/routingv1"
cissslv1 "github.com/IBM/networking-go-sdk/sslcertificateapiv1"
tg "github.com/IBM/networking-go-sdk/transitgatewayapisv1"
cisuarulev1 "github.com/IBM/networking-go-sdk/useragentblockingrulesv1"
ciswafgroupv1 "github.com/IBM/networking-go-sdk/wafrulegroupsapiv1"
ciswafpackagev1 "github.com/IBM/networking-go-sdk/wafrulepackagesapiv1"
ciswafrulev1 "github.com/IBM/networking-go-sdk/wafrulesapiv1"
ciswebhooksv1 "github.com/IBM/networking-go-sdk/webhooksv1"
cisaccessrulev1 "github.com/IBM/networking-go-sdk/zonefirewallaccessrulesv1"
cislockdownv1 "github.com/IBM/networking-go-sdk/zonelockdownv1"
cisratelimitv1 "github.com/IBM/networking-go-sdk/zoneratelimitsv1"
cisdomainsettingsv1 "github.com/IBM/networking-go-sdk/zonessettingsv1"
ciszonesv1 "github.com/IBM/networking-go-sdk/zonesv1"
"github.com/IBM/platform-services-go-sdk/atrackerv2"
"github.com/IBM/platform-services-go-sdk/catalogmanagementv1"
"github.com/IBM/platform-services-go-sdk/contextbasedrestrictionsv1"
"github.com/IBM/platform-services-go-sdk/enterprisemanagementv1"
searchv2 "github.com/IBM/platform-services-go-sdk/globalsearchv2"
"github.com/IBM/platform-services-go-sdk/globaltaggingv1"
iamaccessgroups "github.com/IBM/platform-services-go-sdk/iamaccessgroupsv2"
iamidentity "github.com/IBM/platform-services-go-sdk/iamidentityv1"
iampolicymanagement "github.com/IBM/platform-services-go-sdk/iampolicymanagementv1"
ibmcloudshellv1 "github.com/IBM/platform-services-go-sdk/ibmcloudshellv1"
"github.com/IBM/platform-services-go-sdk/metricsrouterv3"
resourcecontroller "github.com/IBM/platform-services-go-sdk/resourcecontrollerv2"
resourcemanager "github.com/IBM/platform-services-go-sdk/resourcemanagerv2"
"github.com/IBM/platform-services-go-sdk/usagereportsv4"
project "github.com/IBM/project-go-sdk/projectv1"
"github.com/IBM/push-notifications-go-sdk/pushservicev1"
schematicsv1 "github.com/IBM/schematics-go-sdk/schematicsv1"
vpcbeta "github.com/IBM/vpc-beta-go-sdk/vpcbetav1"
"github.com/IBM/vpc-go-sdk/common"
vpc "github.com/IBM/vpc-go-sdk/vpcv1"
"github.com/apache/openwhisk-client-go/whisk"
jwt "github.com/golang-jwt/jwt"
slsession "github.com/softlayer/softlayer-go/session"
bluemix "github.com/IBM-Cloud/bluemix-go"
"github.com/IBM-Cloud/bluemix-go/api/account/accountv1"
"github.com/IBM-Cloud/bluemix-go/api/account/accountv2"
"github.com/IBM-Cloud/bluemix-go/api/cis/cisv1"
"github.com/IBM-Cloud/bluemix-go/api/container/containerv1"
"github.com/IBM-Cloud/bluemix-go/api/container/containerv2"
"github.com/IBM-Cloud/bluemix-go/api/functions"
"github.com/IBM-Cloud/bluemix-go/api/globalsearch/globalsearchv2"
"github.com/IBM-Cloud/bluemix-go/api/globaltagging/globaltaggingv3"
"github.com/IBM-Cloud/bluemix-go/api/hpcs"
"github.com/IBM-Cloud/bluemix-go/api/icd/icdv4"
"github.com/IBM-Cloud/bluemix-go/api/mccp/mccpv2"
"github.com/IBM-Cloud/bluemix-go/api/resource/resourcev1/catalog"
"github.com/IBM-Cloud/bluemix-go/api/resource/resourcev1/controller"
"github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/controllerv2"
"github.com/IBM-Cloud/bluemix-go/api/resource/resourcev2/managementv2"
"github.com/IBM-Cloud/bluemix-go/api/usermanagement/usermanagementv2"
"github.com/IBM-Cloud/bluemix-go/authentication"
"github.com/IBM-Cloud/bluemix-go/bmxerror"
"github.com/IBM-Cloud/bluemix-go/http"
"github.com/IBM-Cloud/bluemix-go/rest"
bxsession "github.com/IBM-Cloud/bluemix-go/session"
ibmpisession "github.com/IBM-Cloud/power-go-client/ibmpisession"
codeengine "github.com/IBM/code-engine-go-sdk/codeenginev2"
"github.com/IBM/continuous-delivery-go-sdk/cdtektonpipelinev2"
"github.com/IBM/continuous-delivery-go-sdk/cdtoolchainv2"
"github.com/IBM/event-notifications-go-admin-sdk/eventnotificationsv1"
"github.com/IBM/eventstreams-go-sdk/pkg/schemaregistryv1"
"github.com/IBM/ibm-hpcs-uko-sdk/ukov4"
scc "github.com/IBM/scc-go-sdk/v5/securityandcompliancecenterapiv3"
"github.com/IBM/secrets-manager-go-sdk/v2/secretsmanagerv1"
"github.com/IBM/secrets-manager-go-sdk/v2/secretsmanagerv2"
)
// RetryAPIDelay - retry api delay
const RetryAPIDelay = 5 * time.Second
// BluemixRegion ...
var BluemixRegion string
var errEmptyBluemixCredentials = errors.New("ibmcloud_api_key or bluemix_api_key or iam_token and iam_refresh_token must be provided. Please see the documentation on how to configure it")
// UserConfig ...
type UserConfig struct {
UserID string
UserEmail string
UserAccount string
CloudName string `default:"bluemix"`
cloudType string `default:"public"`
generation int `default:"2"`
}
// Config stores user provider input
type Config struct {
// BluemixAPIKey is the Bluemix api key
BluemixAPIKey string
// Bluemix region
Region string
// Resource group id
ResourceGroup string
// Bluemix API timeout
BluemixTimeout time.Duration
// Softlayer end point url
SoftLayerEndpointURL string
// Softlayer API timeout
SoftLayerTimeout time.Duration
// Softlayer User Name
SoftLayerUserName string
// Softlayer API Key
SoftLayerAPIKey string
// Retry Count for API calls
// Unexposed in the schema at this point as they are used only during session creation for a few calls
// When sdk implements it we an expose them for expected behaviour
// https://github.com/softlayer/softlayer-go/issues/41
RetryCount int
// Constant Retry Delay for API calls
RetryDelay time.Duration
// FunctionNameSpace ...
FunctionNameSpace string
// Riaas End point
RiaasEndPoint string
// Generation
Generation int
// IAM Token
IAMToken string
// TrustedProfileToken Token
IAMTrustedProfileID string
// IAM Refresh Token
IAMRefreshToken string
// Zone
Zone string
Visibility string
EndpointsFile string
}
// Session stores the information required for communication with the SoftLayer and Bluemix API
type Session struct {
// SoftLayerSesssion is the the SoftLayer session used to connect to the SoftLayer API
SoftLayerSession *slsession.Session
// BluemixSession is the the Bluemix session used to connect to the Bluemix API
BluemixSession *bxsession.Session
}
// ClientSession ...
type ClientSession interface {
AppIDAPI() (*appid.AppIDManagementV4, error)
BluemixSession() (*bxsession.Session, error)
BluemixAcccountAPI() (accountv2.AccountServiceAPI, error)
BluemixAcccountv1API() (accountv1.AccountServiceAPI, error)
BluemixUserDetails() (*UserConfig, error)
ContainerAPI() (containerv1.ContainerServiceAPI, error)
VpcContainerAPI() (containerv2.ContainerServiceAPI, error)
ContainerRegistryV1() (*containerregistryv1.ContainerRegistryV1, error)
FunctionClient() (*whisk.Client, error)
GlobalSearchAPI() (globalsearchv2.GlobalSearchServiceAPI, error)
GlobalTaggingAPI() (globaltaggingv3.GlobalTaggingServiceAPI, error)
GlobalTaggingAPIv1() (globaltaggingv1.GlobalTaggingV1, error)
GlobalSearchAPIV2() (searchv2.GlobalSearchV2, error)
ICDAPI() (icdv4.ICDServiceAPI, error)
CloudDatabasesV5() (*clouddatabasesv5.CloudDatabasesV5, error)
IAMPolicyManagementV1API() (*iampolicymanagement.IamPolicyManagementV1, error)
IAMAccessGroupsV2() (*iamaccessgroups.IamAccessGroupsV2, error)
MccpAPI() (mccpv2.MccpServiceAPI, error)
ResourceCatalogAPI() (catalog.ResourceCatalogAPI, error)
ResourceManagementAPIv2() (managementv2.ResourceManagementAPIv2, error)
ResourceControllerAPI() (controller.ResourceControllerAPI, error)
ResourceControllerAPIV2() (controllerv2.ResourceControllerAPIV2, error)
SoftLayerSession() *slsession.Session
IBMPISession() (*ibmpisession.IBMPISession, error)
UserManagementAPI() (usermanagementv2.UserManagementAPI, error)
PushServiceV1() (*pushservicev1.PushServiceV1, error)
EventNotificationsApiV1() (*eventnotificationsv1.EventNotificationsV1, error)
AppConfigurationV1() (*appconfigurationv1.AppConfigurationV1, error)
KeyProtectAPI() (*kp.Client, error)
KeyManagementAPI() (*kp.Client, error)
VpcV1API() (*vpc.VpcV1, error)
VpcV1BetaAPI() (*vpcbeta.VpcbetaV1, error)
APIGateway() (*apigateway.ApiGatewayControllerApiV1, error)
PrivateDNSClientSession() (*dns.DnsSvcsV1, error)
CosConfigV1API() (*cosconfig.ResourceConfigurationV1, error)
DirectlinkV1API() (*dl.DirectLinkV1, error)
DirectlinkProviderV2API() (*dlProviderV2.DirectLinkProviderV2, error)
TransitGatewayV1API() (*tg.TransitGatewayApisV1, error)
HpcsEndpointAPI() (hpcs.HPCSV2, error)
UkoV4() (*ukov4.UkoV4, error)
FunctionIAMNamespaceAPI() (functions.FunctionServiceAPI, error)
CisZonesV1ClientSession() (*ciszonesv1.ZonesV1, error)
CisAlertsSession() (*cisalertsv1.AlertsV1, error)
CisOrigAuthSession() (*cisoriginpull.AuthenticatedOriginPullApiV1, error)
CisDNSRecordClientSession() (*cisdnsrecordsv1.DnsRecordsV1, error)
CisDNSRecordBulkClientSession() (*cisdnsbulkv1.DnsRecordBulkV1, error)
CisGLBClientSession() (*cisglbv1.GlobalLoadBalancerV1, error)
CisGLBPoolClientSession() (*cisglbpoolv0.GlobalLoadBalancerPoolsV0, error)
CisGLBHealthCheckClientSession() (*cisglbhealthcheckv1.GlobalLoadBalancerMonitorV1, error)
CisIPClientSession() (*cisipv1.CisIpApiV1, error)
CisPageRuleClientSession() (*cispagerulev1.PageRuleApiV1, error)
CisLogpushJobsSession() (*cislogpushjobsapiv1.LogpushJobsApiV1, error)
CisRLClientSession() (*cisratelimitv1.ZoneRateLimitsV1, error)
CisEdgeFunctionClientSession() (*cisedgefunctionv1.EdgeFunctionsApiV1, error)
CisSSLClientSession() (*cissslv1.SslCertificateApiV1, error)
CisWAFPackageClientSession() (*ciswafpackagev1.WafRulePackagesApiV1, error)
CisDomainSettingsClientSession() (*cisdomainsettingsv1.ZonesSettingsV1, error)
CisRoutingClientSession() (*cisroutingv1.RoutingV1, error)
CisWAFGroupClientSession() (*ciswafgroupv1.WafRuleGroupsApiV1, error)
CisCacheClientSession() (*ciscachev1.CachingApiV1, error)
CisMtlsSession() (*cismtlsv1.MtlsV1, error)
CisBotManagementSession() (*cisbotmanagementv1.BotManagementV1, error)
CisBotAnalyticsSession() (*cisbotanalyticsv1.BotAnalyticsV1, error)
CisWebhookSession() (*ciswebhooksv1.WebhooksV1, error)
CisCustomPageClientSession() (*ciscustompagev1.CustomPagesV1, error)
CisAccessRuleClientSession() (*cisaccessrulev1.ZoneFirewallAccessRulesV1, error)
CisUARuleClientSession() (*cisuarulev1.UserAgentBlockingRulesV1, error)
CisLockdownClientSession() (*cislockdownv1.ZoneLockdownV1, error)
CisRangeAppClientSession() (*cisrangeappv1.RangeApplicationsV1, error)
CisWAFRuleClientSession() (*ciswafrulev1.WafRulesApiV1, error)
IAMIdentityV1API() (*iamidentity.IamIdentityV1, error)
IBMCloudShellV1() (*ibmcloudshellv1.IBMCloudShellV1, error)
ResourceManagerV2API() (*resourcemanager.ResourceManagerV2, error)
CatalogManagementV1() (*catalogmanagementv1.CatalogManagementV1, error)
EnterpriseManagementV1() (*enterprisemanagementv1.EnterpriseManagementV1, error)
ResourceControllerV2API() (*resourcecontroller.ResourceControllerV2, error)
SecretsManagerV1() (*secretsmanagerv1.SecretsManagerV1, error)
SecretsManagerV2() (*secretsmanagerv2.SecretsManagerV2, error)
SchematicsV1() (*schematicsv1.SchematicsV1, error)
SatelliteClientSession() (*kubernetesserviceapiv1.KubernetesServiceApiV1, error)
SatellitLinkClientSession() (*satellitelinkv1.SatelliteLinkV1, error)
CisFiltersSession() (*cisfiltersv1.FiltersV1, error)
CisFirewallRulesSession() (*cisfirewallrulesv1.FirewallRulesV1, error)
AtrackerV2() (*atrackerv2.AtrackerV2, error)
MetricsRouterV3() (*metricsrouterv3.MetricsRouterV3, error)
ESschemaRegistrySession() (*schemaregistryv1.SchemaregistryV1, error)
ContextBasedRestrictionsV1() (*contextbasedrestrictionsv1.ContextBasedRestrictionsV1, error)
SecurityAndComplianceCenterV3() (*scc.SecurityAndComplianceCenterApiV3, error)
CdToolchainV2() (*cdtoolchainv2.CdToolchainV2, error)
CdTektonPipelineV2() (*cdtektonpipelinev2.CdTektonPipelineV2, error)
CodeEngineV2() (*codeengine.CodeEngineV2, error)
ProjectV1() (*project.ProjectV1, error)
UsageReportsV4() (*usagereportsv4.UsageReportsV4, error)
MqcloudV1() (*mqcloudv1.MqcloudV1, error)
}
type clientSession struct {
session *Session
appidErr error
appidAPI *appid.AppIDManagementV4
apigatewayErr error
apigatewayAPI *apigateway.ApiGatewayControllerApiV1
accountConfigErr error
bmxAccountServiceAPI accountv2.AccountServiceAPI
accountV1ConfigErr error
bmxAccountv1ServiceAPI accountv1.AccountServiceAPI
bmxUserDetails *UserConfig
bmxUserFetchErr error
csConfigErr error
csServiceAPI containerv1.ContainerServiceAPI
csv2ConfigErr error
csv2ServiceAPI containerv2.ContainerServiceAPI
containerRegistryClientErr error
containerRegistryClient *containerregistryv1.ContainerRegistryV1
cfConfigErr error
cfServiceAPI mccpv2.MccpServiceAPI
cisConfigErr error
cisServiceAPI cisv1.CisServiceAPI
functionConfigErr error
functionClient *whisk.Client
globalSearchConfigErr error
globalSearchServiceAPI globalsearchv2.GlobalSearchServiceAPI
globalTaggingConfigErr error
globalTaggingServiceAPI globaltaggingv3.GlobalTaggingServiceAPI
globalTaggingConfigErrV1 error
globalTaggingServiceAPIV1 globaltaggingv1.GlobalTaggingV1
globalSearchConfigErrV2 error
globalSearchServiceAPIV2 searchv2.GlobalSearchV2
ibmCloudShellClient *ibmcloudshellv1.IBMCloudShellV1
ibmCloudShellClientErr error
userManagementErr error
userManagementAPI usermanagementv2.UserManagementAPI
icdConfigErr error
icdServiceAPI icdv4.ICDServiceAPI
cloudDatabasesClientErr error
cloudDatabasesClient *clouddatabasesv5.CloudDatabasesV5
resourceControllerConfigErr error
resourceControllerServiceAPI controller.ResourceControllerAPI
resourceControllerConfigErrv2 error
resourceControllerServiceAPIv2 controllerv2.ResourceControllerAPIV2
resourceManagementConfigErrv2 error
resourceManagementServiceAPIv2 managementv2.ResourceManagementAPIv2
resourceCatalogConfigErr error
resourceCatalogServiceAPI catalog.ResourceCatalogAPI
ibmpiConfigErr error
ibmpiSession *ibmpisession.IBMPISession
kpErr error
kpAPI *kp.API
kmsErr error
kmsAPI *kp.API
hpcsEndpointErr error
hpcsEndpointAPI hpcs.HPCSV2
ukoClient *ukov4.UkoV4
ukoClientErr error
pDNSClient *dns.DnsSvcsV1
pDNSErr error
bluemixSessionErr error
pushServiceClient *pushservicev1.PushServiceV1
pushServiceClientErr error
eventNotificationsApiClient *eventnotificationsv1.EventNotificationsV1
eventNotificationsApiClientErr error
appConfigurationClient *appconfigurationv1.AppConfigurationV1
appConfigurationClientErr error
vpcErr error
vpcAPI *vpc.VpcV1
vpcbetaErr error
vpcBetaAPI *vpcbeta.VpcbetaV1
directlinkAPI *dl.DirectLinkV1
directlinkErr error
dlProviderAPI *dlProviderV2.DirectLinkProviderV2
dlProviderErr error
cosConfigErr error
cosConfigAPI *cosconfig.ResourceConfigurationV1
transitgatewayAPI *tg.TransitGatewayApisV1
transitgatewayErr error
functionIAMNamespaceAPI functions.FunctionServiceAPI
functionIAMNamespaceErr error
// CIS Zones
cisZonesErr error
cisZonesV1Client *ciszonesv1.ZonesV1
// CIS Alerts
cisAlertsClient *cisalertsv1.AlertsV1
cisAlertsErr error
// CIS Authenticated Origin Pull
cisOriginAuthClient *cisoriginpull.AuthenticatedOriginPullApiV1
cisOriginAuthPullErr error
// CIS dns service options
cisDNSErr error
cisDNSRecordsClient *cisdnsrecordsv1.DnsRecordsV1
// CIS dns bulk service options
cisDNSBulkErr error
cisDNSRecordBulkClient *cisdnsbulkv1.DnsRecordBulkV1
// CIS Global Load Balancer Pool service options
cisGLBPoolErr error
cisGLBPoolClient *cisglbpoolv0.GlobalLoadBalancerPoolsV0
// CIS GLB service options
cisGLBErr error
cisGLBClient *cisglbv1.GlobalLoadBalancerV1
// CIS GLB health check service options
cisGLBHealthCheckErr error
cisGLBHealthCheckClient *cisglbhealthcheckv1.GlobalLoadBalancerMonitorV1
// CIS IP service options
cisIPErr error
cisIPClient *cisipv1.CisIpApiV1
// CIS Zone Rate Limits service options
cisRLErr error
cisRLClient *cisratelimitv1.ZoneRateLimitsV1
// CIS Page Rules service options
cisPageRuleErr error
cisPageRuleClient *cispagerulev1.PageRuleApiV1
// CIS Edge Functions service options
cisEdgeFunctionErr error
cisEdgeFunctionClient *cisedgefunctionv1.EdgeFunctionsApiV1
// CIS SSL certificate service options
cisSSLErr error
cisSSLClient *cissslv1.SslCertificateApiV1
// CIS WAF Package service options
cisWAFPackageErr error
cisWAFPackageClient *ciswafpackagev1.WafRulePackagesApiV1
// CIS Zone Setting service options
cisDomainSettingsErr error
cisDomainSettingsClient *cisdomainsettingsv1.ZonesSettingsV1
// CIS Routing service options
cisRoutingErr error
cisRoutingClient *cisroutingv1.RoutingV1
// CIS WAF Group service options
cisWAFGroupErr error
cisWAFGroupClient *ciswafgroupv1.WafRuleGroupsApiV1
// CIS Caching service options
cisCacheErr error
cisCacheClient *ciscachev1.CachingApiV1
// CIS Custom Pages service options
cisCustomPageErr error
cisCustomPageClient *ciscustompagev1.CustomPagesV1
// CIS Firewall Access rule service option
cisAccessRuleErr error
cisAccessRuleClient *cisaccessrulev1.ZoneFirewallAccessRulesV1
// CIS User Agent Blocking Rule service option
cisUARuleErr error
cisUARuleClient *cisuarulev1.UserAgentBlockingRulesV1
// CIS Firewall Lockdwon Rule service option
cisLockdownErr error
cisLockdownClient *cislockdownv1.ZoneLockdownV1
// CIS LogpushJobs service option
cisLogpushJobsClient *cislogpushjobsapiv1.LogpushJobsApiV1
cisLogpushJobsErr error
// CIS Range app service option
cisRangeAppErr error
cisRangeAppClient *cisrangeappv1.RangeApplicationsV1
// CIS WAF rule service options
cisWAFRuleErr error
cisWAFRuleClient *ciswafrulev1.WafRulesApiV1
// IAM Identity Option
iamIdentityErr error
iamIdentityAPI *iamidentity.IamIdentityV1
// Resource Manager Option
resourceManagerErr error
resourceManagerAPI *resourcemanager.ResourceManagerV2
// Catalog Management Option
catalogManagementClient *catalogmanagementv1.CatalogManagementV1
catalogManagementClientErr error
enterpriseManagementClient *enterprisemanagementv1.EnterpriseManagementV1
enterpriseManagementClientErr error
// Resource Controller Option
resourceControllerErr error
resourceControllerAPI *resourcecontroller.ResourceControllerV2
secretsManagerClientV1 *secretsmanagerv1.SecretsManagerV1
secretsManagerClient *secretsmanagerv2.SecretsManagerV2
secretsManagerClientErr error
// Schematics service options
schematicsClient *schematicsv1.SchematicsV1
schematicsClientErr error
// Satellite service
satelliteClient *kubernetesserviceapiv1.KubernetesServiceApiV1
satelliteClientErr error
// IAM Policy Management
iamPolicyManagementErr error
iamPolicyManagementAPI *iampolicymanagement.IamPolicyManagementV1
// IAM Access Groups
iamAccessGroupsErr error
iamAccessGroupsAPI *iamaccessgroups.IamAccessGroupsV2
// MTLS Session options
cisMtlsClient *cismtlsv1.MtlsV1
cisMtlsErr error
// Bot Management options
cisBotManagementClient *cisbotmanagementv1.BotManagementV1
cisBotManagementErr error
// Bot Analytics options
cisBotAnalyticsClient *cisbotanalyticsv1.BotAnalyticsV1
cisBotAnalyticsErr error
// CIS Webhooks options
cisWebhooksClient *ciswebhooksv1.WebhooksV1
cisWebhooksErr error
// CIS Filters options
cisFiltersClient *cisfiltersv1.FiltersV1
cisFiltersErr error
// CIS FirewallRules options
cisFirewallRulesClient *cisfirewallrulesv1.FirewallRulesV1
cisFirewallRulesErr error
// Atracker
atrackerClientV2 *atrackerv2.AtrackerV2
atrackerClientV2Err error
// Metrics Router
metricsRouterClient *metricsrouterv3.MetricsRouterV3
metricsRouterClientErr error
// Satellite link service
satelliteLinkClient *satellitelinkv1.SatelliteLinkV1
satelliteLinkClientErr error
esSchemaRegistryClient *schemaregistryv1.SchemaregistryV1
esSchemaRegistryErr error
// Security and Compliance Center (SCC)
securityAndComplianceCenterClient *scc.SecurityAndComplianceCenterApiV3
securityAndComplianceCenterClientErr error
// context Based Restrictions (CBR)
contextBasedRestrictionsClient *contextbasedrestrictionsv1.ContextBasedRestrictionsV1
contextBasedRestrictionsClientErr error
// CD Toolchain
cdToolchainClient *cdtoolchainv2.CdToolchainV2
cdToolchainClientErr error
// CD Tekton Pipeline
cdTektonPipelineClient *cdtektonpipelinev2.CdTektonPipelineV2
cdTektonPipelineClientErr error
// Code Engine options
codeEngineClient *codeengine.CodeEngineV2
codeEngineClientErr error
// Project options
projectClient *project.ProjectV1
projectClientErr error
// Usage Reports options
usageReportsClient *usagereportsv4.UsageReportsV4
usageReportsClientErr error
mqcloudClient *mqcloudv1.MqcloudV1
mqcloudClientErr error
}
// Usage Reports
func (session clientSession) UsageReportsV4() (*usagereportsv4.UsageReportsV4, error) {
return session.usageReportsClient, session.usageReportsClientErr
}
// AppIDAPI provides AppID Service APIs ...
func (session clientSession) AppIDAPI() (*appid.AppIDManagementV4, error) {
return session.appidAPI, session.appidErr
}
func (session clientSession) CatalogManagementV1() (*catalogmanagementv1.CatalogManagementV1, error) {
return session.catalogManagementClient, session.catalogManagementClientErr
}
// BluemixAcccountAPI ...
func (sess clientSession) BluemixAcccountAPI() (accountv2.AccountServiceAPI, error) {
return sess.bmxAccountServiceAPI, sess.accountConfigErr
}
// BluemixAcccountAPI ...
func (sess clientSession) BluemixAcccountv1API() (accountv1.AccountServiceAPI, error) {
return sess.bmxAccountv1ServiceAPI, sess.accountV1ConfigErr
}
// BluemixSession to provide the Bluemix Session
func (sess clientSession) BluemixSession() (*bxsession.Session, error) {
return sess.session.BluemixSession, sess.bluemixSessionErr
}
// BluemixUserDetails ...
func (sess clientSession) BluemixUserDetails() (*UserConfig, error) {
return sess.bmxUserDetails, sess.bmxUserFetchErr
}
// ContainerAPI provides Container Service APIs ...
func (sess clientSession) ContainerAPI() (containerv1.ContainerServiceAPI, error) {
return sess.csServiceAPI, sess.csConfigErr
}
// VpcContainerAPI provides v2Container Service APIs ...
func (sess clientSession) VpcContainerAPI() (containerv2.ContainerServiceAPI, error) {
return sess.csv2ServiceAPI, sess.csv2ConfigErr
}
// ContainerRegistryV1 provides Container Registry Service APIs ...
func (session clientSession) ContainerRegistryV1() (*containerregistryv1.ContainerRegistryV1, error) {
return session.containerRegistryClient, session.containerRegistryClientErr
}
// SchematicsAPI provides schematics Service APIs ...
func (sess clientSession) SchematicsV1() (*schematicsv1.SchematicsV1, error) {
if sess.schematicsClientErr != nil {
return sess.schematicsClient, sess.schematicsClientErr
}
return sess.schematicsClient.Clone(), nil
// return sess.schematicsClient, sess.schematicsClientErr
}
// FunctionClient ...
func (sess clientSession) FunctionClient() (*whisk.Client, error) {
return sess.functionClient, sess.functionConfigErr
}
// GlobalSearchAPI provides Global Search APIs ...
func (sess clientSession) GlobalSearchAPI() (globalsearchv2.GlobalSearchServiceAPI, error) {
return sess.globalSearchServiceAPI, sess.globalSearchConfigErr
}
// GlobalTaggingAPI provides Global Search APIs ...
func (sess clientSession) GlobalTaggingAPI() (globaltaggingv3.GlobalTaggingServiceAPI, error) {
return sess.globalTaggingServiceAPI, sess.globalTaggingConfigErr
}
// GlobalTaggingAPIV1 provides Platform-go Global Tagging APIs ...
func (sess clientSession) GlobalTaggingAPIv1() (globaltaggingv1.GlobalTaggingV1, error) {
return sess.globalTaggingServiceAPIV1, sess.globalTaggingConfigErrV1
}
// GlobalSearchAPIV2 provides Platform-go Global Search APIs ...
func (sess clientSession) GlobalSearchAPIV2() (searchv2.GlobalSearchV2, error) {
return sess.globalSearchServiceAPIV2, sess.globalSearchConfigErrV2
}
// HpcsEndpointAPI provides Hpcs Endpoint generator APIs ...
func (sess clientSession) HpcsEndpointAPI() (hpcs.HPCSV2, error) {
return sess.hpcsEndpointAPI, sess.hpcsEndpointErr
}
// UKO
func (session clientSession) UkoV4() (*ukov4.UkoV4, error) {
return session.ukoClient, session.ukoClientErr
}
// UserManagementAPI provides User management APIs ...
func (sess clientSession) UserManagementAPI() (usermanagementv2.UserManagementAPI, error) {
return sess.userManagementAPI, sess.userManagementErr
}
// IAM Policy Management
func (sess clientSession) IAMPolicyManagementV1API() (*iampolicymanagement.IamPolicyManagementV1, error) {
return sess.iamPolicyManagementAPI, sess.iamPolicyManagementErr
}
// IAMAccessGroupsV2 provides IAM AG APIs ...
func (sess clientSession) IAMAccessGroupsV2() (*iamaccessgroups.IamAccessGroupsV2, error) {
return sess.iamAccessGroupsAPI, sess.iamAccessGroupsErr
}
// IBM Cloud Shell
func (session clientSession) IBMCloudShellV1() (*ibmcloudshellv1.IBMCloudShellV1, error) {
return session.ibmCloudShellClient, session.ibmCloudShellClientErr
}
// IcdAPI provides IBM Cloud Databases APIs ...
func (sess clientSession) ICDAPI() (icdv4.ICDServiceAPI, error) {
return sess.icdServiceAPI, sess.icdConfigErr
}
// The IBM Cloud Databases API
func (session clientSession) CloudDatabasesV5() (*clouddatabasesv5.CloudDatabasesV5, error) {
return session.cloudDatabasesClient, session.cloudDatabasesClientErr
}
// MccpAPI provides Multi Cloud Controller Proxy APIs ...
func (sess clientSession) MccpAPI() (mccpv2.MccpServiceAPI, error) {
return sess.cfServiceAPI, sess.cfConfigErr
}
// ResourceCatalogAPI ...
func (sess clientSession) ResourceCatalogAPI() (catalog.ResourceCatalogAPI, error) {
return sess.resourceCatalogServiceAPI, sess.resourceCatalogConfigErr
}
// ResourceManagementAPIv2 ...
func (sess clientSession) ResourceManagementAPIv2() (managementv2.ResourceManagementAPIv2, error) {
return sess.resourceManagementServiceAPIv2, sess.resourceManagementConfigErrv2
}
// ResourceControllerAPI ...
func (sess clientSession) ResourceControllerAPI() (controller.ResourceControllerAPI, error) {
return sess.resourceControllerServiceAPI, sess.resourceControllerConfigErr
}
// ResourceControllerAPIv2 ...
func (sess clientSession) ResourceControllerAPIV2() (controllerv2.ResourceControllerAPIV2, error) {
return sess.resourceControllerServiceAPIv2, sess.resourceControllerConfigErrv2
}
// SoftLayerSession providers SoftLayer Session
func (sess clientSession) SoftLayerSession() *slsession.Session {
return sess.session.SoftLayerSession
}
// apigatewayAPI provides API Gateway APIs
func (sess clientSession) APIGateway() (*apigateway.ApiGatewayControllerApiV1, error) {
return sess.apigatewayAPI, sess.apigatewayErr
}
func (session clientSession) PushServiceV1() (*pushservicev1.PushServiceV1, error) {
return session.pushServiceClient, session.pushServiceClientErr
}
func (session clientSession) EventNotificationsApiV1() (*eventnotificationsv1.EventNotificationsV1, error) {
return session.eventNotificationsApiClient, session.eventNotificationsApiClientErr
}
func (session clientSession) AppConfigurationV1() (*appconfigurationv1.AppConfigurationV1, error) {
return session.appConfigurationClient, session.appConfigurationClientErr
}
func (sess clientSession) KeyProtectAPI() (*kp.Client, error) {
return sess.kpAPI, sess.kpErr
}
func (sess clientSession) KeyManagementAPI() (*kp.Client, error) {
if sess.kmsErr == nil {
var clientConfig *kp.ClientConfig
if sess.kmsAPI.Config.APIKey != "" {
clientConfig = &kp.ClientConfig{
BaseURL: EnvFallBack([]string{"IBMCLOUD_KP_API_ENDPOINT"}, sess.kmsAPI.Config.BaseURL),
APIKey: sess.kmsAPI.Config.APIKey, // pragma: allowlist secret
Verbose: kp.VerboseFailOnly,
TokenURL: sess.kmsAPI.Config.TokenURL,
}
} else {
clientConfig = &kp.ClientConfig{
BaseURL: EnvFallBack([]string{"IBMCLOUD_KP_API_ENDPOINT"}, sess.kmsAPI.Config.BaseURL),
Authorization: sess.session.BluemixSession.Config.IAMAccessToken, // pragma: allowlist secret
Verbose: kp.VerboseFailOnly,
TokenURL: sess.kmsAPI.Config.TokenURL,
}
}
kpClient, err := kp.New(*clientConfig, DefaultTransport())
if err != nil {
sess.kpErr = fmt.Errorf("[ERROR] Error occured while configuring Key Protect Service: %q", err)
}
return kpClient, nil
}
return sess.kmsAPI, sess.kmsErr
}
func (sess clientSession) VpcV1API() (*vpc.VpcV1, error) {
return sess.vpcAPI, sess.vpcErr
}
func (sess clientSession) VpcV1BetaAPI() (*vpcbeta.VpcbetaV1, error) {
return sess.vpcBetaAPI, sess.vpcbetaErr
}
func (sess clientSession) DirectlinkV1API() (*dl.DirectLinkV1, error) {
return sess.directlinkAPI, sess.directlinkErr
}
func (sess clientSession) DirectlinkProviderV2API() (*dlProviderV2.DirectLinkProviderV2, error) {
return sess.dlProviderAPI, sess.dlProviderErr
}
func (sess clientSession) CosConfigV1API() (*cosconfig.ResourceConfigurationV1, error) {
return sess.cosConfigAPI, sess.cosConfigErr
}
func (sess clientSession) TransitGatewayV1API() (*tg.TransitGatewayApisV1, error) {
return sess.transitgatewayAPI, sess.transitgatewayErr
}
// Session to the Power Colo Service
func (sess clientSession) IBMPISession() (*ibmpisession.IBMPISession, error) {
return sess.ibmpiSession, sess.ibmpiConfigErr
}
// Private DNS Service
func (sess clientSession) PrivateDNSClientSession() (*dns.DnsSvcsV1, error) {
return sess.pDNSClient, sess.pDNSErr
}
// Session to the Namespace cloud function
func (sess clientSession) FunctionIAMNamespaceAPI() (functions.FunctionServiceAPI, error) {
return sess.functionIAMNamespaceAPI, sess.functionIAMNamespaceErr
}
// CIS Zones Service
func (sess clientSession) CisZonesV1ClientSession() (*ciszonesv1.ZonesV1, error) {
if sess.cisZonesErr != nil {
return sess.cisZonesV1Client, sess.cisZonesErr
}
return sess.cisZonesV1Client.Clone(), nil
}
// CIS DNS Service
func (sess clientSession) CisDNSRecordClientSession() (*cisdnsrecordsv1.DnsRecordsV1, error) {
if sess.cisDNSErr != nil {
return sess.cisDNSRecordsClient, sess.cisDNSErr
}
return sess.cisDNSRecordsClient.Clone(), nil
}
// CIS DNS Bulk Service
func (sess clientSession) CisDNSRecordBulkClientSession() (*cisdnsbulkv1.DnsRecordBulkV1, error) {
if sess.cisDNSBulkErr != nil {
return sess.cisDNSRecordBulkClient, sess.cisDNSBulkErr
}
return sess.cisDNSRecordBulkClient.Clone(), nil
}
// CIS GLB Pool
func (sess clientSession) CisGLBPoolClientSession() (*cisglbpoolv0.GlobalLoadBalancerPoolsV0, error) {
if sess.cisGLBPoolErr != nil {
return sess.cisGLBPoolClient, sess.cisGLBPoolErr
}
return sess.cisGLBPoolClient.Clone(), nil
}
// CIS GLB
func (sess clientSession) CisGLBClientSession() (*cisglbv1.GlobalLoadBalancerV1, error) {
if sess.cisGLBErr != nil {
return sess.cisGLBClient, sess.cisGLBErr
}
return sess.cisGLBClient.Clone(), nil
}
// CIS GLB Health Check/Monitor
func (sess clientSession) CisGLBHealthCheckClientSession() (*cisglbhealthcheckv1.GlobalLoadBalancerMonitorV1, error) {
if sess.cisGLBHealthCheckErr != nil {
return sess.cisGLBHealthCheckClient, sess.cisGLBHealthCheckErr
}
return sess.cisGLBHealthCheckClient.Clone(), nil
}
// CIS Zone Rate Limits
func (sess clientSession) CisRLClientSession() (*cisratelimitv1.ZoneRateLimitsV1, error) {
if sess.cisRLErr != nil {
return sess.cisRLClient, sess.cisRLErr
}
return sess.cisRLClient.Clone(), nil
}
// CIS IP
func (sess clientSession) CisIPClientSession() (*cisipv1.CisIpApiV1, error) {
if sess.cisIPErr != nil {
return sess.cisIPClient, sess.cisIPErr
}
return sess.cisIPClient.Clone(), nil
}
// CIS Page Rules
func (sess clientSession) CisPageRuleClientSession() (*cispagerulev1.PageRuleApiV1, error) {
if sess.cisPageRuleErr != nil {
return sess.cisPageRuleClient, sess.cisPageRuleErr
}
return sess.cisPageRuleClient.Clone(), nil
}
// CIS Edge Function
func (sess clientSession) CisEdgeFunctionClientSession() (*cisedgefunctionv1.EdgeFunctionsApiV1, error) {
if sess.cisEdgeFunctionErr != nil {
return sess.cisEdgeFunctionClient, sess.cisEdgeFunctionErr
}
return sess.cisEdgeFunctionClient.Clone(), nil
}
// CIS SSL certificate
func (sess clientSession) CisSSLClientSession() (*cissslv1.SslCertificateApiV1, error) {
if sess.cisSSLErr != nil {
return sess.cisSSLClient, sess.cisSSLErr
}
return sess.cisSSLClient.Clone(), nil
}
// CIS WAF Packages
func (sess clientSession) CisWAFPackageClientSession() (*ciswafpackagev1.WafRulePackagesApiV1, error) {
if sess.cisWAFPackageErr != nil {
return sess.cisWAFPackageClient, sess.cisWAFPackageErr
}
return sess.cisWAFPackageClient.Clone(), nil
}
// CIS Zone Settings
func (sess clientSession) CisDomainSettingsClientSession() (*cisdomainsettingsv1.ZonesSettingsV1, error) {
if sess.cisDomainSettingsErr != nil {
return sess.cisDomainSettingsClient, sess.cisDomainSettingsErr
}
return sess.cisDomainSettingsClient.Clone(), nil
}
// CIS Alerts
func (sess clientSession) CisAlertsSession() (*cisalertsv1.AlertsV1, error) {
if sess.cisAlertsErr != nil {
return sess.cisAlertsClient, sess.cisAlertsErr
}
return sess.cisAlertsClient.Clone(), nil
}
// CIS Routing
func (sess clientSession) CisRoutingClientSession() (*cisroutingv1.RoutingV1, error) {
if sess.cisRoutingErr != nil {
return sess.cisRoutingClient, sess.cisRoutingErr
}
return sess.cisRoutingClient.Clone(), nil
}
// CIS WAF Group
func (sess clientSession) CisWAFGroupClientSession() (*ciswafgroupv1.WafRuleGroupsApiV1, error) {
if sess.cisWAFGroupErr != nil {