1. Packages
  2. Harness
  3. API Docs
  4. platform
  5. getEnvironmentList
Harness v0.3.2 published on Monday, Sep 16, 2024 by Pulumi

harness.platform.getEnvironmentList

Explore with Pulumi AI

harness logo
Harness v0.3.2 published on Monday, Sep 16, 2024 by Pulumi

    Data source for retrieving Harness environment list.

    Example Usage

    Project Level Environment List

    import * as pulumi from "@pulumi/pulumi";
    import * as harness from "@pulumi/harness";
    
    const example = harness.platform.getEnvironmentList({
        orgId: "org_id",
        projectId: "project_id",
    });
    
    import pulumi
    import pulumi_harness as harness
    
    example = harness.platform.get_environment_list(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.GetEnvironmentList(ctx, &platform.GetEnvironmentListArgs{
    			OrgId:     pulumi.StringRef("org_id"),
    			ProjectId: pulumi.StringRef("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 example = Harness.Platform.GetEnvironmentList.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.GetEnvironmentListArgs;
    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 example = PlatformFunctions.getEnvironmentList(GetEnvironmentListArgs.builder()
                .orgId("org_id")
                .projectId("project_id")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: harness:platform:getEnvironmentList
          Arguments:
            orgId: org_id
            projectId: project_id
    

    Organisation Level Environment List

    import * as pulumi from "@pulumi/pulumi";
    import * as harness from "@pulumi/harness";
    
    const example = harness.platform.getEnvironmentList({
        orgId: "org_id",
    });
    
    import pulumi
    import pulumi_harness as harness
    
    example = harness.platform.get_environment_list(org_id="org_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.GetEnvironmentList(ctx, &platform.GetEnvironmentListArgs{
    			OrgId: pulumi.StringRef("org_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 example = Harness.Platform.GetEnvironmentList.Invoke(new()
        {
            OrgId = "org_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.GetEnvironmentListArgs;
    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 example = PlatformFunctions.getEnvironmentList(GetEnvironmentListArgs.builder()
                .orgId("org_id")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: harness:platform:getEnvironmentList
          Arguments:
            orgId: org_id
    

    Account Level Environment List

    import * as pulumi from "@pulumi/pulumi";
    import * as harness from "@pulumi/harness";
    
    const example = harness.platform.getEnvironmentList({});
    
    import pulumi
    import pulumi_harness as harness
    
    example = harness.platform.get_environment_list()
    
    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.GetEnvironmentList(ctx, nil, 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 example = Harness.Platform.GetEnvironmentList.Invoke();
    
    });
    
    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.GetEnvironmentListArgs;
    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 example = PlatformFunctions.getEnvironmentList();
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: harness:platform:getEnvironmentList
          Arguments: {}
    

    Using getEnvironmentList

    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 getEnvironmentList(args: GetEnvironmentListArgs, opts?: InvokeOptions): Promise<GetEnvironmentListResult>
    function getEnvironmentListOutput(args: GetEnvironmentListOutputArgs, opts?: InvokeOptions): Output<GetEnvironmentListResult>
    def get_environment_list(org_id: Optional[str] = None,
                             project_id: Optional[str] = None,
                             opts: Optional[InvokeOptions] = None) -> GetEnvironmentListResult
    def get_environment_list_output(org_id: Optional[pulumi.Input[str]] = None,
                             project_id: Optional[pulumi.Input[str]] = None,
                             opts: Optional[InvokeOptions] = None) -> Output[GetEnvironmentListResult]
    func GetEnvironmentList(ctx *Context, args *GetEnvironmentListArgs, opts ...InvokeOption) (*GetEnvironmentListResult, error)
    func GetEnvironmentListOutput(ctx *Context, args *GetEnvironmentListOutputArgs, opts ...InvokeOption) GetEnvironmentListResultOutput

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

    public static class GetEnvironmentList 
    {
        public static Task<GetEnvironmentListResult> InvokeAsync(GetEnvironmentListArgs args, InvokeOptions? opts = null)
        public static Output<GetEnvironmentListResult> Invoke(GetEnvironmentListInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetEnvironmentListResult> getEnvironmentList(GetEnvironmentListArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: harness:platform/getEnvironmentList:getEnvironmentList
      arguments:
        # arguments dictionary

    The following arguments are supported:

    OrgId string
    ProjectId string
    OrgId string
    ProjectId string
    orgId String
    projectId String
    orgId string
    projectId string
    orgId String
    projectId String

    getEnvironmentList Result

    The following output properties are available:

    Environments List<GetEnvironmentListEnvironment>
    Id string
    The provider-assigned unique ID for this managed resource.
    OrgId string
    ProjectId string
    Environments []GetEnvironmentListEnvironment
    Id string
    The provider-assigned unique ID for this managed resource.
    OrgId string
    ProjectId string
    environments List<GetEnvironmentListEnvironment>
    id String
    The provider-assigned unique ID for this managed resource.
    orgId String
    projectId String
    environments GetEnvironmentListEnvironment[]
    id string
    The provider-assigned unique ID for this managed resource.
    orgId string
    projectId string
    environments Sequence[GetEnvironmentListEnvironment]
    id str
    The provider-assigned unique ID for this managed resource.
    org_id str
    project_id str
    environments List<Property Map>
    id String
    The provider-assigned unique ID for this managed resource.
    orgId String
    projectId String

    Supporting Types

    GetEnvironmentListEnvironment

    Identifier string
    Name string
    Identifier string
    Name string
    identifier String
    name String
    identifier string
    name string
    identifier String
    name String

    Package Details

    Repository
    harness pulumi/pulumi-harness
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the harness Terraform Provider.
    harness logo
    Harness v0.3.2 published on Monday, Sep 16, 2024 by Pulumi