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 21, 2024
1 parent 6c33336 commit c669cad
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 @@ -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)
}

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

0 comments on commit c669cad

Please sign in to comment.