@@ -11,7 +11,8 @@ const (
11
11
cloudAccountsWithExternalIDPath = "%s/api/cloud/v2/accounts?includeExternalID=true&upsert=true"
12
12
cloudAccountPath = "%s/api/cloud/v2/accounts/%s"
13
13
cloudAccountWithExternalIDPath = "%s/api/cloud/v2/accounts/%s?includeExternalID=true"
14
- trustedCloudIdentityPath = "%s/api/cloud/v2/%s/trustedIdentity"
14
+ onboardingTrustedIdentityPath = "%s/api/secure/onboarding/v2/trustedIdentity?provider=%s"
15
+ onboardingTenantExternaIDPath = "%s/api/secure/onboarding/v2/externalID"
15
16
providersPath = "%v/api/v2/providers"
16
17
)
17
18
@@ -22,6 +23,7 @@ type CloudAccountSecureInterface interface {
22
23
DeleteCloudAccountSecure (ctx context.Context , accountID string ) error
23
24
UpdateCloudAccountSecure (ctx context.Context , accountID string , cloudAccount * CloudAccountSecure ) (* CloudAccountSecure , error )
24
25
GetTrustedCloudIdentitySecure (ctx context.Context , provider string ) (string , error )
26
+ GetTenantExternalIDSecure (ctx context.Context ) (string , error )
25
27
}
26
28
27
29
type CloudAccountMonitorInterface interface {
@@ -100,7 +102,21 @@ func (client *Client) UpdateCloudAccountSecure(ctx context.Context, accountID st
100
102
}
101
103
102
104
func (client * Client ) GetTrustedCloudIdentitySecure (ctx context.Context , provider string ) (string , error ) {
103
- response , err := client .requester .Request (ctx , http .MethodGet , client .trustedCloudIdentityURL (provider ), nil )
105
+ response , err := client .requester .Request (ctx , http .MethodGet , fmt .Sprintf (onboardingTrustedIdentityPath , client .config .url , provider ), nil )
106
+ if err != nil {
107
+ return "" , err
108
+ }
109
+ defer response .Body .Close ()
110
+
111
+ if response .StatusCode != http .StatusOK {
112
+ return "" , client .ErrorFromResponse (response )
113
+ }
114
+
115
+ return Unmarshal [string ](response .Body )
116
+ }
117
+
118
+ func (client * Client ) GetTenantExternalIDSecure (ctx context.Context ) (string , error ) {
119
+ response , err := client .requester .Request (ctx , http .MethodGet , fmt .Sprintf (onboardingTenantExternaIDPath , client .config .url ), nil )
104
120
if err != nil {
105
121
return "" , err
106
122
}
@@ -127,10 +143,6 @@ func (client *Client) cloudAccountURL(accountID string, includeExternalID bool)
127
143
return fmt .Sprintf (cloudAccountPath , client .config .url , accountID )
128
144
}
129
145
130
- func (client * Client ) trustedCloudIdentityURL (provider string ) string {
131
- return fmt .Sprintf (trustedCloudIdentityPath , client .config .url , provider )
132
- }
133
-
134
146
func (client * Client ) CreateCloudAccountMonitor (ctx context.Context , provider * CloudAccountMonitor ) (* CloudAccountMonitor , error ) {
135
147
payload , err := Marshal (provider )
136
148
if err != nil {
0 commit comments