diff --git a/services/provider/api/client/client.go b/services/provider/api/client/client.go index 490c97b036..342495c2ea 100644 --- a/services/provider/api/client/client.go +++ b/services/provider/api/client/client.go @@ -227,3 +227,35 @@ func (cc *OCSProviderClient) PeerStorageCluster(ctx context.Context, onboardingT return cc.Client.PeerStorageCluster(apiCtx, req) } + +func (cc *OCSProviderClient) GetStorageClientsInfo(ctx context.Context, storageClusterUID string, clientIDs []string) (*pb.StorageClientsInfoResponse, error) { + if cc.Client == nil || cc.clientConn == nil { + return nil, fmt.Errorf("connection to Peer OCS is closed") + } + + req := &pb.StorageClientsInfoRequest{ + StorageClusterUID: storageClusterUID, + ClientIDs: clientIDs, + } + + apiCtx, cancel := context.WithTimeout(ctx, cc.timeout) + defer cancel() + + return cc.Client.GetStorageClientsInfo(apiCtx, req) +} + +func (cc *OCSProviderClient) GetBlockPoolsInfo(ctx context.Context, storageClusterUID string, blockPoolNames []string) (*pb.BlockPoolsInfoResponse, error) { + if cc.Client == nil || cc.clientConn == nil { + return nil, fmt.Errorf("connection to Peer OCS is closed") + } + + req := &pb.BlockPoolsInfoRequest{ + StorageClusterUID: storageClusterUID, + BlockPoolNames: blockPoolNames, + } + + apiCtx, cancel := context.WithTimeout(ctx, cc.timeout) + defer cancel() + + return cc.Client.GetBlockPoolsInfo(apiCtx, req) +} diff --git a/vendor/github.com/red-hat-storage/ocs-operator/services/provider/api/v4/client/client.go b/vendor/github.com/red-hat-storage/ocs-operator/services/provider/api/v4/client/client.go index 490c97b036..342495c2ea 100644 --- a/vendor/github.com/red-hat-storage/ocs-operator/services/provider/api/v4/client/client.go +++ b/vendor/github.com/red-hat-storage/ocs-operator/services/provider/api/v4/client/client.go @@ -227,3 +227,35 @@ func (cc *OCSProviderClient) PeerStorageCluster(ctx context.Context, onboardingT return cc.Client.PeerStorageCluster(apiCtx, req) } + +func (cc *OCSProviderClient) GetStorageClientsInfo(ctx context.Context, storageClusterUID string, clientIDs []string) (*pb.StorageClientsInfoResponse, error) { + if cc.Client == nil || cc.clientConn == nil { + return nil, fmt.Errorf("connection to Peer OCS is closed") + } + + req := &pb.StorageClientsInfoRequest{ + StorageClusterUID: storageClusterUID, + ClientIDs: clientIDs, + } + + apiCtx, cancel := context.WithTimeout(ctx, cc.timeout) + defer cancel() + + return cc.Client.GetStorageClientsInfo(apiCtx, req) +} + +func (cc *OCSProviderClient) GetBlockPoolsInfo(ctx context.Context, storageClusterUID string, blockPoolNames []string) (*pb.BlockPoolsInfoResponse, error) { + if cc.Client == nil || cc.clientConn == nil { + return nil, fmt.Errorf("connection to Peer OCS is closed") + } + + req := &pb.BlockPoolsInfoRequest{ + StorageClusterUID: storageClusterUID, + BlockPoolNames: blockPoolNames, + } + + apiCtx, cancel := context.WithTimeout(ctx, cc.timeout) + defer cancel() + + return cc.Client.GetBlockPoolsInfo(apiCtx, req) +}