Skip to content

Commit

Permalink
Add resize method to client
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron Dewes <[email protected]>
  • Loading branch information
AaronDewes committed Feb 25, 2024
1 parent 41c03e2 commit 76c425f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions pkg/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,22 @@ func (c *SPDKClient) EngineReplicaDelete(engineName, replicaName, replicaAddress
return errors.Wrapf(err, "failed to delete replica %s with address %s to engine %s", replicaName, replicaAddress, engineName)
}

func (c* SPDKClient) EngineVolumeResize(engineName string, size uint64) error {
if engineName == "" {
return fmt.Errorf("failed to resize volume for SPDK engine: missing required parameter engine name")
}

client := c.getSPDKServiceClient()
ctx, cancel := context.WithTimeout(context.Background(), GRPCServiceTimeout)
defer cancel()

_, err := client.EngineVolumeResize(ctx, &spdkrpc.EngineVolumeResizeRequest{
EngineName: engineName,
Size: size,
})
return errors.Wrapf(err, "failed to resize volume for engine %s", engineName)
}

func (c *SPDKClient) EngineBackupCreate(req *BackupCreateRequest) (*spdkrpc.BackupCreateResponse, error) {
client := c.getSPDKServiceClient()
ctx, cancel := context.WithTimeout(context.Background(), GRPCServiceTimeout)
Expand Down

0 comments on commit 76c425f

Please sign in to comment.