1. Packages
  2. Octopusdeploy Provider
  3. API Docs
  4. getEnvironments
octopusdeploy 0.43.1 published on Wednesday, Apr 30, 2025 by octopusdeploylabs

octopusdeploy.getEnvironments

Explore with Pulumi AI

octopusdeploy logo
octopusdeploy 0.43.1 published on Wednesday, Apr 30, 2025 by octopusdeploylabs

    Provides information about existing environments.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as octopusdeploy from "@pulumi/octopusdeploy";
    
    const example = octopusdeploy.getEnvironments({
        ids: [
            "Environments-123",
            "Environments-321",
        ],
        name: "Production",
        partialName: "Produc",
        skip: 5,
        take: 100,
    });
    
    import pulumi
    import pulumi_octopusdeploy as octopusdeploy
    
    example = octopusdeploy.get_environments(ids=[
            "Environments-123",
            "Environments-321",
        ],
        name="Production",
        partial_name="Produc",
        skip=5,
        take=100)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/octopusdeploy/octopusdeploy"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := octopusdeploy.GetEnvironments(ctx, &octopusdeploy.GetEnvironmentsArgs{
    			Ids: []string{
    				"Environments-123",
    				"Environments-321",
    			},
    			Name:        pulumi.StringRef("Production"),
    			PartialName: pulumi.StringRef("Produc"),
    			Skip:        pulumi.Float64Ref(5),
    			Take:        pulumi.Float64Ref(100),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Octopusdeploy = Pulumi.Octopusdeploy;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Octopusdeploy.GetEnvironments.Invoke(new()
        {
            Ids = new[]
            {
                "Environments-123",
                "Environments-321",
            },
            Name = "Production",
            PartialName = "Produc",
            Skip = 5,
            Take = 100,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.octopusdeploy.OctopusdeployFunctions;
    import com.pulumi.octopusdeploy.inputs.GetEnvironmentsArgs;
    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 = OctopusdeployFunctions.getEnvironments(GetEnvironmentsArgs.builder()
                .ids(            
                    "Environments-123",
                    "Environments-321")
                .name("Production")
                .partialName("Produc")
                .skip(5)
                .take(100)
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: octopusdeploy:getEnvironments
          arguments:
            ids:
              - Environments-123
              - Environments-321
            name: Production
            partialName: Produc
            skip: 5
            take: 100
    

    Using getEnvironments

    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 getEnvironments(args: GetEnvironmentsArgs, opts?: InvokeOptions): Promise<GetEnvironmentsResult>
    function getEnvironmentsOutput(args: GetEnvironmentsOutputArgs, opts?: InvokeOptions): Output<GetEnvironmentsResult>
    def get_environments(ids: Optional[Sequence[str]] = None,
                         name: Optional[str] = None,
                         partial_name: Optional[str] = None,
                         skip: Optional[float] = None,
                         space_id: Optional[str] = None,
                         take: Optional[float] = None,
                         opts: Optional[InvokeOptions] = None) -> GetEnvironmentsResult
    def get_environments_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                         name: Optional[pulumi.Input[str]] = None,
                         partial_name: Optional[pulumi.Input[str]] = None,
                         skip: Optional[pulumi.Input[float]] = None,
                         space_id: Optional[pulumi.Input[str]] = None,
                         take: Optional[pulumi.Input[float]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetEnvironmentsResult]
    func GetEnvironments(ctx *Context, args *GetEnvironmentsArgs, opts ...InvokeOption) (*GetEnvironmentsResult, error)
    func GetEnvironmentsOutput(ctx *Context, args *GetEnvironmentsOutputArgs, opts ...InvokeOption) GetEnvironmentsResultOutput

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

    public static class GetEnvironments 
    {
        public static Task<GetEnvironmentsResult> InvokeAsync(GetEnvironmentsArgs args, InvokeOptions? opts = null)
        public static Output<GetEnvironmentsResult> Invoke(GetEnvironmentsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetEnvironmentsResult> getEnvironments(GetEnvironmentsArgs args, InvokeOptions options)
    public static Output<GetEnvironmentsResult> getEnvironments(GetEnvironmentsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: octopusdeploy:index/getEnvironments:getEnvironments
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Ids List<string>
    A filter to search by a list of IDs.
    Name string
    A filter search by exact name
    PartialName string
    A filter to search by a partial name.
    Skip double
    A filter to specify the number of items to skip in the response.
    SpaceId string
    The space ID associated with this environment.
    Take double
    A filter to specify the number of items to take (or return) in the response.
    Ids []string
    A filter to search by a list of IDs.
    Name string
    A filter search by exact name
    PartialName string
    A filter to search by a partial name.
    Skip float64
    A filter to specify the number of items to skip in the response.
    SpaceId string
    The space ID associated with this environment.
    Take float64
    A filter to specify the number of items to take (or return) in the response.
    ids List<String>
    A filter to search by a list of IDs.
    name String
    A filter search by exact name
    partialName String
    A filter to search by a partial name.
    skip Double
    A filter to specify the number of items to skip in the response.
    spaceId String
    The space ID associated with this environment.
    take Double
    A filter to specify the number of items to take (or return) in the response.
    ids string[]
    A filter to search by a list of IDs.
    name string
    A filter search by exact name
    partialName string
    A filter to search by a partial name.
    skip number
    A filter to specify the number of items to skip in the response.
    spaceId string
    The space ID associated with this environment.
    take number
    A filter to specify the number of items to take (or return) in the response.
    ids Sequence[str]
    A filter to search by a list of IDs.
    name str
    A filter search by exact name
    partial_name str
    A filter to search by a partial name.
    skip float
    A filter to specify the number of items to skip in the response.
    space_id str
    The space ID associated with this environment.
    take float
    A filter to specify the number of items to take (or return) in the response.
    ids List<String>
    A filter to search by a list of IDs.
    name String
    A filter search by exact name
    partialName String
    A filter to search by a partial name.
    skip Number
    A filter to specify the number of items to skip in the response.
    spaceId String
    The space ID associated with this environment.
    take Number
    A filter to specify the number of items to take (or return) in the response.

    getEnvironments Result

    The following output properties are available:

    Environments List<GetEnvironmentsEnvironment>
    Id string
    The unique ID for this resource.
    SpaceId string
    The space ID associated with this environment.
    Ids List<string>
    A filter to search by a list of IDs.
    Name string
    A filter search by exact name
    PartialName string
    A filter to search by a partial name.
    Skip double
    A filter to specify the number of items to skip in the response.
    Take double
    A filter to specify the number of items to take (or return) in the response.
    Environments []GetEnvironmentsEnvironment
    Id string
    The unique ID for this resource.
    SpaceId string
    The space ID associated with this environment.
    Ids []string
    A filter to search by a list of IDs.
    Name string
    A filter search by exact name
    PartialName string
    A filter to search by a partial name.
    Skip float64
    A filter to specify the number of items to skip in the response.
    Take float64
    A filter to specify the number of items to take (or return) in the response.
    environments List<GetEnvironmentsEnvironment>
    id String
    The unique ID for this resource.
    spaceId String
    The space ID associated with this environment.
    ids List<String>
    A filter to search by a list of IDs.
    name String
    A filter search by exact name
    partialName String
    A filter to search by a partial name.
    skip Double
    A filter to specify the number of items to skip in the response.
    take Double
    A filter to specify the number of items to take (or return) in the response.
    environments GetEnvironmentsEnvironment[]
    id string
    The unique ID for this resource.
    spaceId string
    The space ID associated with this environment.
    ids string[]
    A filter to search by a list of IDs.
    name string
    A filter search by exact name
    partialName string
    A filter to search by a partial name.
    skip number
    A filter to specify the number of items to skip in the response.
    take number
    A filter to specify the number of items to take (or return) in the response.
    environments Sequence[GetEnvironmentsEnvironment]
    id str
    The unique ID for this resource.
    space_id str
    The space ID associated with this environment.
    ids Sequence[str]
    A filter to search by a list of IDs.
    name str
    A filter search by exact name
    partial_name str
    A filter to search by a partial name.
    skip float
    A filter to specify the number of items to skip in the response.
    take float
    A filter to specify the number of items to take (or return) in the response.
    environments List<Property Map>
    id String
    The unique ID for this resource.
    spaceId String
    The space ID associated with this environment.
    ids List<String>
    A filter to search by a list of IDs.
    name String
    A filter search by exact name
    partialName String
    A filter to search by a partial name.
    skip Number
    A filter to specify the number of items to skip in the response.
    take Number
    A filter to specify the number of items to take (or return) in the response.

    Supporting Types

    GetEnvironmentsEnvironment

    AllowDynamicInfrastructure bool
    Description string
    The description of this environment.
    Id string
    The unique ID for this resource.
    JiraExtensionSettings List<GetEnvironmentsEnvironmentJiraExtensionSetting>
    Provides extension settings for the Jira integration for this environment.
    JiraServiceManagementExtensionSettings List<GetEnvironmentsEnvironmentJiraServiceManagementExtensionSetting>
    Provides extension settings for the Jira Service Management (JSM) integration for this environment.
    Name string
    The name of this resource.
    ServicenowExtensionSettings List<GetEnvironmentsEnvironmentServicenowExtensionSetting>
    Provides extension settings for the ServiceNow integration for this environment.
    Slug string
    The unique slug of this environment
    SortOrder double
    The order number to sort an environment
    SpaceId string
    The space ID associated with this environment.
    UseGuidedFailure bool
    AllowDynamicInfrastructure bool
    Description string
    The description of this environment.
    Id string
    The unique ID for this resource.
    JiraExtensionSettings []GetEnvironmentsEnvironmentJiraExtensionSetting
    Provides extension settings for the Jira integration for this environment.
    JiraServiceManagementExtensionSettings []GetEnvironmentsEnvironmentJiraServiceManagementExtensionSetting
    Provides extension settings for the Jira Service Management (JSM) integration for this environment.
    Name string
    The name of this resource.
    ServicenowExtensionSettings []GetEnvironmentsEnvironmentServicenowExtensionSetting
    Provides extension settings for the ServiceNow integration for this environment.
    Slug string
    The unique slug of this environment
    SortOrder float64
    The order number to sort an environment
    SpaceId string
    The space ID associated with this environment.
    UseGuidedFailure bool
    allowDynamicInfrastructure Boolean
    description String
    The description of this environment.
    id String
    The unique ID for this resource.
    jiraExtensionSettings List<GetEnvironmentsEnvironmentJiraExtensionSetting>
    Provides extension settings for the Jira integration for this environment.
    jiraServiceManagementExtensionSettings List<GetEnvironmentsEnvironmentJiraServiceManagementExtensionSetting>
    Provides extension settings for the Jira Service Management (JSM) integration for this environment.
    name String
    The name of this resource.
    servicenowExtensionSettings List<GetEnvironmentsEnvironmentServicenowExtensionSetting>
    Provides extension settings for the ServiceNow integration for this environment.
    slug String
    The unique slug of this environment
    sortOrder Double
    The order number to sort an environment
    spaceId String
    The space ID associated with this environment.
    useGuidedFailure Boolean
    allowDynamicInfrastructure boolean
    description string
    The description of this environment.
    id string
    The unique ID for this resource.
    jiraExtensionSettings GetEnvironmentsEnvironmentJiraExtensionSetting[]
    Provides extension settings for the Jira integration for this environment.
    jiraServiceManagementExtensionSettings GetEnvironmentsEnvironmentJiraServiceManagementExtensionSetting[]
    Provides extension settings for the Jira Service Management (JSM) integration for this environment.
    name string
    The name of this resource.
    servicenowExtensionSettings GetEnvironmentsEnvironmentServicenowExtensionSetting[]
    Provides extension settings for the ServiceNow integration for this environment.
    slug string
    The unique slug of this environment
    sortOrder number
    The order number to sort an environment
    spaceId string
    The space ID associated with this environment.
    useGuidedFailure boolean
    allow_dynamic_infrastructure bool
    description str
    The description of this environment.
    id str
    The unique ID for this resource.
    jira_extension_settings Sequence[GetEnvironmentsEnvironmentJiraExtensionSetting]
    Provides extension settings for the Jira integration for this environment.
    jira_service_management_extension_settings Sequence[GetEnvironmentsEnvironmentJiraServiceManagementExtensionSetting]
    Provides extension settings for the Jira Service Management (JSM) integration for this environment.
    name str
    The name of this resource.
    servicenow_extension_settings Sequence[GetEnvironmentsEnvironmentServicenowExtensionSetting]
    Provides extension settings for the ServiceNow integration for this environment.
    slug str
    The unique slug of this environment
    sort_order float
    The order number to sort an environment
    space_id str
    The space ID associated with this environment.
    use_guided_failure bool
    allowDynamicInfrastructure Boolean
    description String
    The description of this environment.
    id String
    The unique ID for this resource.
    jiraExtensionSettings List<Property Map>
    Provides extension settings for the Jira integration for this environment.
    jiraServiceManagementExtensionSettings List<Property Map>
    Provides extension settings for the Jira Service Management (JSM) integration for this environment.
    name String
    The name of this resource.
    servicenowExtensionSettings List<Property Map>
    Provides extension settings for the ServiceNow integration for this environment.
    slug String
    The unique slug of this environment
    sortOrder Number
    The order number to sort an environment
    spaceId String
    The space ID associated with this environment.
    useGuidedFailure Boolean

    GetEnvironmentsEnvironmentJiraExtensionSetting

    GetEnvironmentsEnvironmentJiraServiceManagementExtensionSetting

    isEnabled Boolean
    isEnabled boolean
    isEnabled Boolean

    GetEnvironmentsEnvironmentServicenowExtensionSetting

    isEnabled Boolean
    isEnabled boolean
    isEnabled Boolean

    Package Details

    Repository
    octopusdeploy octopusdeploylabs/terraform-provider-octopusdeploy
    License
    Notes
    This Pulumi package is based on the octopusdeploy Terraform Provider.
    octopusdeploy logo
    octopusdeploy 0.43.1 published on Wednesday, Apr 30, 2025 by octopusdeploylabs