@@ -62,21 +62,16 @@ func LoadPlanId(planName, version string, offerings *opensearch.ListOfferingsRes
6262 }
6363}
6464
65- type OpenSearchClient interface {
66- GetInstance (ctx context.Context , projectId , region , instanceId string ) opensearch.ApiGetInstanceRequest
67- GetCredentials (ctx context.Context , projectId , region , instanceId , credentialsId string ) opensearch.ApiGetCredentialsRequest
68- }
69-
70- func GetInstanceName (ctx context.Context , apiClient OpenSearchClient , projectId , region , instanceId string ) (string , error ) {
65+ func GetInstanceName (ctx context.Context , apiClient opensearch.DefaultAPI , projectId , region , instanceId string ) (string , error ) {
7166 resp , err := apiClient .GetInstance (ctx , projectId , region , instanceId ).Execute ()
7267 if err != nil {
7368 return "" , fmt .Errorf ("get OpenSearch instance: %w" , err )
7469 }
7570 return resp .Name , nil
7671}
7772
78- func GetCredentialsUsername (ctx context.Context , apiClient OpenSearchClient , projectId , region , instanceId , credentialsId string ) (string , error ) {
79- resp , err := apiClient .GetCredentials (ctx , projectId , instanceId , region , credentialsId ).Execute ()
73+ func GetCredentialsUsername (ctx context.Context , apiClient opensearch. DefaultAPI , projectId , region , instanceId , credentialsId string ) (string , error ) {
74+ resp , err := apiClient .GetCredentials (ctx , projectId , region , instanceId , credentialsId ).Execute ()
8075 if err != nil {
8176 return "" , fmt .Errorf ("get OpenSearch credentials: %w" , err )
8277 }
0 commit comments