1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. DevOps
  5. getProjects
Oracle Cloud Infrastructure v1.37.0 published on Friday, May 24, 2024 by Pulumi

oci.DevOps.getProjects

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v1.37.0 published on Friday, May 24, 2024 by Pulumi

    This data source provides the list of Projects in Oracle Cloud Infrastructure Devops service.

    Returns a list of projects.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testProjects = oci.DevOps.getProjects({
        compartmentId: compartmentId,
        id: projectId,
        name: projectName,
        state: projectState,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_projects = oci.DevOps.get_projects(compartment_id=compartment_id,
        id=project_id,
        name=project_name,
        state=project_state)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/go/oci/DevOps"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := DevOps.GetProjects(ctx, &devops.GetProjectsArgs{
    			CompartmentId: compartmentId,
    			Id:            pulumi.StringRef(projectId),
    			Name:          pulumi.StringRef(projectName),
    			State:         pulumi.StringRef(projectState),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Oci = Pulumi.Oci;
    
    return await Deployment.RunAsync(() => 
    {
        var testProjects = Oci.DevOps.GetProjects.Invoke(new()
        {
            CompartmentId = compartmentId,
            Id = projectId,
            Name = projectName,
            State = projectState,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.DevOps.DevOpsFunctions;
    import com.pulumi.oci.DevOps.inputs.GetProjectsArgs;
    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 testProjects = DevOpsFunctions.getProjects(GetProjectsArgs.builder()
                .compartmentId(compartmentId)
                .id(projectId)
                .name(projectName)
                .state(projectState)
                .build());
    
        }
    }
    
    variables:
      testProjects:
        fn::invoke:
          Function: oci:DevOps:getProjects
          Arguments:
            compartmentId: ${compartmentId}
            id: ${projectId}
            name: ${projectName}
            state: ${projectState}
    

    Using getProjects

    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 getProjects(args: GetProjectsArgs, opts?: InvokeOptions): Promise<GetProjectsResult>
    function getProjectsOutput(args: GetProjectsOutputArgs, opts?: InvokeOptions): Output<GetProjectsResult>
    def get_projects(compartment_id: Optional[str] = None,
                     filters: Optional[Sequence[_devops.GetProjectsFilter]] = None,
                     id: Optional[str] = None,
                     name: Optional[str] = None,
                     state: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetProjectsResult
    def get_projects_output(compartment_id: Optional[pulumi.Input[str]] = None,
                     filters: Optional[pulumi.Input[Sequence[pulumi.Input[_devops.GetProjectsFilterArgs]]]] = None,
                     id: Optional[pulumi.Input[str]] = None,
                     name: Optional[pulumi.Input[str]] = None,
                     state: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetProjectsResult]
    func GetProjects(ctx *Context, args *GetProjectsArgs, opts ...InvokeOption) (*GetProjectsResult, error)
    func GetProjectsOutput(ctx *Context, args *GetProjectsOutputArgs, opts ...InvokeOption) GetProjectsResultOutput

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

    public static class GetProjects 
    {
        public static Task<GetProjectsResult> InvokeAsync(GetProjectsArgs args, InvokeOptions? opts = null)
        public static Output<GetProjectsResult> Invoke(GetProjectsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetProjectsResult> getProjects(GetProjectsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: oci:DevOps/getProjects:getProjects
      arguments:
        # arguments dictionary

    The following arguments are supported:

    CompartmentId string
    The OCID of the compartment in which to list resources.
    Filters List<GetProjectsFilter>
    Id string
    Unique identifier or OCID for listing a single resource by ID.
    Name string
    A filter to return only resources that match the entire name given.
    State string
    A filter to return only Projects that matches the given lifecycleState.
    CompartmentId string
    The OCID of the compartment in which to list resources.
    Filters []GetProjectsFilter
    Id string
    Unique identifier or OCID for listing a single resource by ID.
    Name string
    A filter to return only resources that match the entire name given.
    State string
    A filter to return only Projects that matches the given lifecycleState.
    compartmentId String
    The OCID of the compartment in which to list resources.
    filters List<GetProjectsFilter>
    id String
    Unique identifier or OCID for listing a single resource by ID.
    name String
    A filter to return only resources that match the entire name given.
    state String
    A filter to return only Projects that matches the given lifecycleState.
    compartmentId string
    The OCID of the compartment in which to list resources.
    filters GetProjectsFilter[]
    id string
    Unique identifier or OCID for listing a single resource by ID.
    name string
    A filter to return only resources that match the entire name given.
    state string
    A filter to return only Projects that matches the given lifecycleState.
    compartment_id str
    The OCID of the compartment in which to list resources.
    filters Sequence[devops.GetProjectsFilter]
    id str
    Unique identifier or OCID for listing a single resource by ID.
    name str
    A filter to return only resources that match the entire name given.
    state str
    A filter to return only Projects that matches the given lifecycleState.
    compartmentId String
    The OCID of the compartment in which to list resources.
    filters List<Property Map>
    id String
    Unique identifier or OCID for listing a single resource by ID.
    name String
    A filter to return only resources that match the entire name given.
    state String
    A filter to return only Projects that matches the given lifecycleState.

    getProjects Result

    The following output properties are available:

    CompartmentId string
    The OCID of the compartment where the project is created.
    ProjectCollections List<GetProjectsProjectCollection>
    The list of project_collection.
    Filters List<GetProjectsFilter>
    Id string
    Unique identifier that is immutable on creation.
    Name string
    Project name (case-sensitive).
    State string
    The current state of the project.
    CompartmentId string
    The OCID of the compartment where the project is created.
    ProjectCollections []GetProjectsProjectCollection
    The list of project_collection.
    Filters []GetProjectsFilter
    Id string
    Unique identifier that is immutable on creation.
    Name string
    Project name (case-sensitive).
    State string
    The current state of the project.
    compartmentId String
    The OCID of the compartment where the project is created.
    projectCollections List<GetProjectsProjectCollection>
    The list of project_collection.
    filters List<GetProjectsFilter>
    id String
    Unique identifier that is immutable on creation.
    name String
    Project name (case-sensitive).
    state String
    The current state of the project.
    compartmentId string
    The OCID of the compartment where the project is created.
    projectCollections GetProjectsProjectCollection[]
    The list of project_collection.
    filters GetProjectsFilter[]
    id string
    Unique identifier that is immutable on creation.
    name string
    Project name (case-sensitive).
    state string
    The current state of the project.
    compartment_id str
    The OCID of the compartment where the project is created.
    project_collections Sequence[devops.GetProjectsProjectCollection]
    The list of project_collection.
    filters Sequence[devops.GetProjectsFilter]
    id str
    Unique identifier that is immutable on creation.
    name str
    Project name (case-sensitive).
    state str
    The current state of the project.
    compartmentId String
    The OCID of the compartment where the project is created.
    projectCollections List<Property Map>
    The list of project_collection.
    filters List<Property Map>
    id String
    Unique identifier that is immutable on creation.
    name String
    Project name (case-sensitive).
    state String
    The current state of the project.

    Supporting Types

    GetProjectsFilter

    Name string
    A filter to return only resources that match the entire name given.
    Values List<string>
    Regex bool
    Name string
    A filter to return only resources that match the entire name given.
    Values []string
    Regex bool
    name String
    A filter to return only resources that match the entire name given.
    values List<String>
    regex Boolean
    name string
    A filter to return only resources that match the entire name given.
    values string[]
    regex boolean
    name str
    A filter to return only resources that match the entire name given.
    values Sequence[str]
    regex bool
    name String
    A filter to return only resources that match the entire name given.
    values List<String>
    regex Boolean

    GetProjectsProjectCollection

    GetProjectsProjectCollectionItem

    CompartmentId string
    The OCID of the compartment in which to list resources.
    DefinedTags Dictionary<string, object>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags. Example: {"foo-namespace.bar-key": "value"}
    Description string
    Project description.
    FreeformTags Dictionary<string, object>
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. See Resource Tags. Example: {"bar-key": "value"}
    Id string
    Unique identifier or OCID for listing a single resource by ID.
    LifecycleDetails string
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state.
    Name string
    A filter to return only resources that match the entire name given.
    Namespace string
    Namespace associated with the project.
    NotificationConfigs List<GetProjectsProjectCollectionItemNotificationConfig>
    Notification configuration for the project.
    State string
    A filter to return only Projects that matches the given lifecycleState.
    SystemTags Dictionary<string, object>
    Usage of system tag keys. These predefined keys are scoped to namespaces. See Resource Tags. Example: {"orcl-cloud.free-tier-retained": "true"}
    TimeCreated string
    Time the project was created. Format defined by RFC3339.
    TimeUpdated string
    Time the project was updated. Format defined by RFC3339.
    CompartmentId string
    The OCID of the compartment in which to list resources.
    DefinedTags map[string]interface{}
    Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags. Example: {"foo-namespace.bar-key": "value"}
    Description string
    Project description.
    FreeformTags map[string]interface{}
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. See Resource Tags. Example: {"bar-key": "value"}
    Id string
    Unique identifier or OCID for listing a single resource by ID.
    LifecycleDetails string
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state.
    Name string
    A filter to return only resources that match the entire name given.
    Namespace string
    Namespace associated with the project.
    NotificationConfigs []GetProjectsProjectCollectionItemNotificationConfig
    Notification configuration for the project.
    State string
    A filter to return only Projects that matches the given lifecycleState.
    SystemTags map[string]interface{}
    Usage of system tag keys. These predefined keys are scoped to namespaces. See Resource Tags. Example: {"orcl-cloud.free-tier-retained": "true"}
    TimeCreated string
    Time the project was created. Format defined by RFC3339.
    TimeUpdated string
    Time the project was updated. Format defined by RFC3339.
    compartmentId String
    The OCID of the compartment in which to list resources.
    definedTags Map<String,Object>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags. Example: {"foo-namespace.bar-key": "value"}
    description String
    Project description.
    freeformTags Map<String,Object>
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. See Resource Tags. Example: {"bar-key": "value"}
    id String
    Unique identifier or OCID for listing a single resource by ID.
    lifecycleDetails String
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state.
    name String
    A filter to return only resources that match the entire name given.
    namespace String
    Namespace associated with the project.
    notificationConfigs List<GetProjectsProjectCollectionItemNotificationConfig>
    Notification configuration for the project.
    state String
    A filter to return only Projects that matches the given lifecycleState.
    systemTags Map<String,Object>
    Usage of system tag keys. These predefined keys are scoped to namespaces. See Resource Tags. Example: {"orcl-cloud.free-tier-retained": "true"}
    timeCreated String
    Time the project was created. Format defined by RFC3339.
    timeUpdated String
    Time the project was updated. Format defined by RFC3339.
    compartmentId string
    The OCID of the compartment in which to list resources.
    definedTags {[key: string]: any}
    Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags. Example: {"foo-namespace.bar-key": "value"}
    description string
    Project description.
    freeformTags {[key: string]: any}
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. See Resource Tags. Example: {"bar-key": "value"}
    id string
    Unique identifier or OCID for listing a single resource by ID.
    lifecycleDetails string
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state.
    name string
    A filter to return only resources that match the entire name given.
    namespace string
    Namespace associated with the project.
    notificationConfigs GetProjectsProjectCollectionItemNotificationConfig[]
    Notification configuration for the project.
    state string
    A filter to return only Projects that matches the given lifecycleState.
    systemTags {[key: string]: any}
    Usage of system tag keys. These predefined keys are scoped to namespaces. See Resource Tags. Example: {"orcl-cloud.free-tier-retained": "true"}
    timeCreated string
    Time the project was created. Format defined by RFC3339.
    timeUpdated string
    Time the project was updated. Format defined by RFC3339.
    compartment_id str
    The OCID of the compartment in which to list resources.
    defined_tags Mapping[str, Any]
    Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags. Example: {"foo-namespace.bar-key": "value"}
    description str
    Project description.
    freeform_tags Mapping[str, Any]
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. See Resource Tags. Example: {"bar-key": "value"}
    id str
    Unique identifier or OCID for listing a single resource by ID.
    lifecycle_details str
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state.
    name str
    A filter to return only resources that match the entire name given.
    namespace str
    Namespace associated with the project.
    notification_configs Sequence[devops.GetProjectsProjectCollectionItemNotificationConfig]
    Notification configuration for the project.
    state str
    A filter to return only Projects that matches the given lifecycleState.
    system_tags Mapping[str, Any]
    Usage of system tag keys. These predefined keys are scoped to namespaces. See Resource Tags. Example: {"orcl-cloud.free-tier-retained": "true"}
    time_created str
    Time the project was created. Format defined by RFC3339.
    time_updated str
    Time the project was updated. Format defined by RFC3339.
    compartmentId String
    The OCID of the compartment in which to list resources.
    definedTags Map<Any>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags. Example: {"foo-namespace.bar-key": "value"}
    description String
    Project description.
    freeformTags Map<Any>
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. See Resource Tags. Example: {"bar-key": "value"}
    id String
    Unique identifier or OCID for listing a single resource by ID.
    lifecycleDetails String
    A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state.
    name String
    A filter to return only resources that match the entire name given.
    namespace String
    Namespace associated with the project.
    notificationConfigs List<Property Map>
    Notification configuration for the project.
    state String
    A filter to return only Projects that matches the given lifecycleState.
    systemTags Map<Any>
    Usage of system tag keys. These predefined keys are scoped to namespaces. See Resource Tags. Example: {"orcl-cloud.free-tier-retained": "true"}
    timeCreated String
    Time the project was created. Format defined by RFC3339.
    timeUpdated String
    Time the project was updated. Format defined by RFC3339.

    GetProjectsProjectCollectionItemNotificationConfig

    TopicId string
    The topic ID for notifications.
    TopicId string
    The topic ID for notifications.
    topicId String
    The topic ID for notifications.
    topicId string
    The topic ID for notifications.
    topic_id str
    The topic ID for notifications.
    topicId String
    The topic ID for notifications.

    Package Details

    Repository
    oci pulumi/pulumi-oci
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the oci Terraform Provider.
    oci logo
    Oracle Cloud Infrastructure v1.37.0 published on Friday, May 24, 2024 by Pulumi