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 <[email protected]>

add generated changes

Signed-off-by: Rewant Soni <[email protected]>
  • Loading branch information
rewantsoni committed Nov 12, 2024
1 parent 46040ae commit a2f7e66
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 a2f7e66

Please sign in to comment.