@@ -13,7 +13,6 @@ import (
1313
1414 survey "github.com/AlecAivazis/survey/v2"
1515 "github.com/IBM-Cloud/bluemix-go"
16- "github.com/IBM-Cloud/bluemix-go/api/account/accountv2"
1716 "github.com/IBM-Cloud/bluemix-go/authentication"
1817 "github.com/IBM-Cloud/bluemix-go/http"
1918 "github.com/IBM-Cloud/bluemix-go/rest"
@@ -40,7 +39,6 @@ type BxClient struct {
4039 Zone string
4140 PISession * ibmpisession.IBMPISession
4241 User * User
43- AccountAPIV2 accountv2.Accounts
4442 PowerVSResourceGroup string
4543}
4644
@@ -145,12 +143,6 @@ func NewBxClient(survey bool) (*BxClient, error) {
145143 return nil , err
146144 }
147145
148- accClient , err := accountv2 .New (bxSess )
149- if err != nil {
150- return nil , err
151- }
152-
153- c .AccountAPIV2 = accClient .Accounts ()
154146 c .Session .Config .Region = powervs .Regions [sv .Region ].VPCRegion
155147
156148 return c , nil
@@ -227,28 +219,6 @@ func getSessionVars(survey bool) (SessionVars, error) {
227219 return sv , nil
228220}
229221
230- // GetAccountType func return the type of account TRAIL/PAID
231- func (c * BxClient ) GetAccountType () (string , error ) {
232- myAccount , err := c .AccountAPIV2 .Get ((* c .User ).Account )
233- if err != nil {
234- return "" , err
235- }
236-
237- return myAccount .Type , nil
238- }
239-
240- // ValidateAccountPermissions Checks permission for provisioning Power VS resources
241- func (c * BxClient ) ValidateAccountPermissions () error {
242- accType , err := c .GetAccountType ()
243- if err != nil {
244- return err
245- }
246- if accType == "TRIAL" {
247- return fmt .Errorf ("account type must be of Pay-As-You-Go/Subscription type for provision Power VS resources" )
248- }
249- return nil
250- }
251-
252222// NewPISession updates pisession details, return error on fail.
253223func (c * BxClient ) NewPISession () error {
254224 var authenticator core.Authenticator = & core.IamAuthenticator {
0 commit comments