diff --git a/services/provider/api/client/client.go b/services/provider/api/client/client.go index 568964922e..4a2db6d72b 100644 --- a/services/provider/api/client/client.go +++ b/services/provider/api/client/client.go @@ -243,3 +243,35 @@ func (cc *OCSProviderClient) RequestMaintenanceMode(ctx context.Context, consume return cc.Client.RequestMaintenanceMode(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 568964922e..4a2db6d72b 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 @@ -243,3 +243,35 @@ func (cc *OCSProviderClient) RequestMaintenanceMode(ctx context.Context, consume return cc.Client.RequestMaintenanceMode(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) +}