Skip to content

Commit

Permalink
add client side implementation
Browse files Browse the repository at this point in the history
Signed-off-by: Rewant Soni <resoni@redhat.com>

add generated changes

Signed-off-by: Rewant Soni <resoni@redhat.com>
  • Loading branch information
rewantsoni committed Nov 13, 2024
1 parent 2d3b9a4 commit 85fc46b
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
32 changes: 32 additions & 0 deletions services/provider/api/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 85fc46b

Please sign in to comment.