1. Packages
  2. Packages
  3. Harness Provider
  4. API Docs
  5. platform
  6. getWorkspaces
Viewing docs for Harness v0.12.0
published on Tuesday, Apr 21, 2026 by Pulumi
harness logo
Viewing docs for Harness v0.12.0
published on Tuesday, Apr 21, 2026 by Pulumi

    Data source for listing workspaces.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as harness from "@pulumi/harness";
    
    const all = harness.platform.getWorkspaces({
        orgId: "org_id",
        projectId: "project_id",
    });
    
    import pulumi
    import pulumi_harness as harness
    
    all = harness.platform.get_workspaces(org_id="org_id",
        project_id="project_id")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-harness/sdk/go/harness/platform"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := platform.GetWorkspaces(ctx, &platform.GetWorkspacesArgs{
    			OrgId:     "org_id",
    			ProjectId: "project_id",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Harness = Pulumi.Harness;
    
    return await Deployment.RunAsync(() => 
    {
        var all = Harness.Platform.GetWorkspaces.Invoke(new()
        {
            OrgId = "org_id",
            ProjectId = "project_id",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.harness.platform.PlatformFunctions;
    import com.pulumi.harness.platform.inputs.GetWorkspacesArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var all = PlatformFunctions.getWorkspaces(GetWorkspacesArgs.builder()
                .orgId("org_id")
                .projectId("project_id")
                .build());
    
        }
    }
    
    variables:
      all:
        fn::invoke:
          function: harness:platform:getWorkspaces
          arguments:
            orgId: org_id
            projectId: project_id
    

    Using getWorkspaces

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getWorkspaces(args: GetWorkspacesArgs, opts?: InvokeOptions): Promise<GetWorkspacesResult>
    function getWorkspacesOutput(args: GetWorkspacesOutputArgs, opts?: InvokeOptions): Output<GetWorkspacesResult>
    def get_workspaces(org_id: Optional[str] = None,
                       project_id: Optional[str] = None,
                       search_term: Optional[str] = None,
                       opts: Optional[InvokeOptions] = None) -> GetWorkspacesResult
    def get_workspaces_output(org_id: pulumi.Input[Optional[str]] = None,
                       project_id: pulumi.Input[Optional[str]] = None,
                       search_term: pulumi.Input[Optional[str]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetWorkspacesResult]
    func GetWorkspaces(ctx *Context, args *GetWorkspacesArgs, opts ...InvokeOption) (*GetWorkspacesResult, error)
    func GetWorkspacesOutput(ctx *Context, args *GetWorkspacesOutputArgs, opts ...InvokeOption) GetWorkspacesResultOutput

    > Note: This function is named GetWorkspaces in the Go SDK.

    public static class GetWorkspaces 
    {
        public static Task<GetWorkspacesResult> InvokeAsync(GetWorkspacesArgs args, InvokeOptions? opts = null)
        public static Output<GetWorkspacesResult> Invoke(GetWorkspacesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetWorkspacesResult> getWorkspaces(GetWorkspacesArgs args, InvokeOptions options)
    public static Output<GetWorkspacesResult> getWorkspaces(GetWorkspacesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: harness:platform/getWorkspaces:getWorkspaces
      arguments:
        # arguments dictionary

    The following arguments are supported:

    OrgId string
    Organization Identifier
    ProjectId string
    Project Identifier
    SearchTerm string
    Filter results by partial name match when listing workspaces.
    OrgId string
    Organization Identifier
    ProjectId string
    Project Identifier
    SearchTerm string
    Filter results by partial name match when listing workspaces.
    orgId String
    Organization Identifier
    projectId String
    Project Identifier
    searchTerm String
    Filter results by partial name match when listing workspaces.
    orgId string
    Organization Identifier
    projectId string
    Project Identifier
    searchTerm string
    Filter results by partial name match when listing workspaces.
    org_id str
    Organization Identifier
    project_id str
    Project Identifier
    search_term str
    Filter results by partial name match when listing workspaces.
    orgId String
    Organization Identifier
    projectId String
    Project Identifier
    searchTerm String
    Filter results by partial name match when listing workspaces.

    getWorkspaces Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Identifiers List<string>
    List of workspace identifiers matching the filters.
    OrgId string
    Organization Identifier
    ProjectId string
    Project Identifier
    Workspaces List<GetWorkspacesWorkspace>
    List of workspaces matching the filters.
    SearchTerm string
    Filter results by partial name match when listing workspaces.
    Id string
    The provider-assigned unique ID for this managed resource.
    Identifiers []string
    List of workspace identifiers matching the filters.
    OrgId string
    Organization Identifier
    ProjectId string
    Project Identifier
    Workspaces []GetWorkspacesWorkspace
    List of workspaces matching the filters.
    SearchTerm string
    Filter results by partial name match when listing workspaces.
    id String
    The provider-assigned unique ID for this managed resource.
    identifiers List<String>
    List of workspace identifiers matching the filters.
    orgId String
    Organization Identifier
    projectId String
    Project Identifier
    workspaces List<GetWorkspacesWorkspace>
    List of workspaces matching the filters.
    searchTerm String
    Filter results by partial name match when listing workspaces.
    id string
    The provider-assigned unique ID for this managed resource.
    identifiers string[]
    List of workspace identifiers matching the filters.
    orgId string
    Organization Identifier
    projectId string
    Project Identifier
    workspaces GetWorkspacesWorkspace[]
    List of workspaces matching the filters.
    searchTerm string
    Filter results by partial name match when listing workspaces.
    id str
    The provider-assigned unique ID for this managed resource.
    identifiers Sequence[str]
    List of workspace identifiers matching the filters.
    org_id str
    Organization Identifier
    project_id str
    Project Identifier
    workspaces Sequence[GetWorkspacesWorkspace]
    List of workspaces matching the filters.
    search_term str
    Filter results by partial name match when listing workspaces.
    id String
    The provider-assigned unique ID for this managed resource.
    identifiers List<String>
    List of workspace identifiers matching the filters.
    orgId String
    Organization Identifier
    projectId String
    Project Identifier
    workspaces List<Property Map>
    List of workspaces matching the filters.
    searchTerm String
    Filter results by partial name match when listing workspaces.

    Supporting Types

    GetWorkspacesWorkspace

    AccountId string
    Created int
    Description string
    Identifier string
    Name string
    OrgId string
    ProjectId string
    Status string
    Updated int
    AccountId string
    Created int
    Description string
    Identifier string
    Name string
    OrgId string
    ProjectId string
    Status string
    Updated int
    accountId String
    created Integer
    description String
    identifier String
    name String
    orgId String
    projectId String
    status String
    updated Integer
    accountId string
    created number
    description string
    identifier string
    name string
    orgId string
    projectId string
    status string
    updated number
    accountId String
    created Number
    description String
    identifier String
    name String
    orgId String
    projectId String
    status String
    updated Number

    Package Details

    Repository
    harness pulumi/pulumi-harness
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the harness Terraform Provider.
    harness logo
    Viewing docs for Harness v0.12.0
    published on Tuesday, Apr 21, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.