diff --git a/client/building_block_runner.go b/client/building_block_runner.go index 421c5be..f7a9c5b 100644 --- a/client/building_block_runner.go +++ b/client/building_block_runner.go @@ -5,6 +5,7 @@ import ( "errors" "github.com/meshcloud/meshstack-cli/client/internal" + "github.com/meshcloud/meshstack-cli/internal/http" ) type MeshBuildingBlockRunnerImplementationType string @@ -71,10 +72,15 @@ type MeshRunnerWifProviderConfig struct { type MeshBuildingBlockRunnerClient interface { Create(ctx context.Context, runner MeshBuildingBlockRunner) (*MeshBuildingBlockRunner, error) Read(ctx context.Context, uuid string) (*MeshBuildingBlockRunner, error) + List(ctx context.Context, filter MeshBuildingBlockRunnerFilter) ([]MeshBuildingBlockRunner, error) Update(ctx context.Context, runner MeshBuildingBlockRunner) (*MeshBuildingBlockRunner, error) Delete(ctx context.Context, uuid string) error } +type MeshBuildingBlockRunnerFilter struct { + WorkspaceIdentifier *string `json:"workspaceIdentifier"` +} + type meshBuildingBlockRunnerClient struct { meshObject internal.MeshObjectClient[MeshBuildingBlockRunner] } @@ -91,6 +97,10 @@ func (c meshBuildingBlockRunnerClient) Read(ctx context.Context, uuid string) (* return c.meshObject.Get(ctx, uuid) } +func (c meshBuildingBlockRunnerClient) List(ctx context.Context, filter MeshBuildingBlockRunnerFilter) ([]MeshBuildingBlockRunner, error) { + return c.meshObject.List(ctx, http.WithUrlQuery(filter)) +} + func (c meshBuildingBlockRunnerClient) Update(ctx context.Context, runner MeshBuildingBlockRunner) (*MeshBuildingBlockRunner, error) { if runner.Metadata.Uuid == nil || *runner.Metadata.Uuid == "" { return nil, errors.New("missing metadata.uuid")