1. Packages
  2. Ucloud Provider
  3. API Docs
  4. getProjects
ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud

ucloud.getProjects

Explore with Pulumi AI

ucloud logo
ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud

    This data source providers a list of projects owned by user according to finance permission and name.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ucloud from "@pulumi/ucloud";
    
    const example = ucloud.getProjects({
        isFinance: false,
    });
    export const first = example.then(example => example.projects?.[0]?.id);
    
    import pulumi
    import pulumi_ucloud as ucloud
    
    example = ucloud.get_projects(is_finance=False)
    pulumi.export("first", example.projects[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ucloud/ucloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := ucloud.GetProjects(ctx, &ucloud.GetProjectsArgs{
    			IsFinance: pulumi.BoolRef(false),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("first", example.Projects[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ucloud = Pulumi.Ucloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Ucloud.GetProjects.Invoke(new()
        {
            IsFinance = false,
        });
    
        return new Dictionary<string, object?>
        {
            ["first"] = example.Apply(getProjectsResult => getProjectsResult.Projects[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ucloud.UcloudFunctions;
    import com.pulumi.ucloud.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 example = UcloudFunctions.getProjects(GetProjectsArgs.builder()
                .isFinance(false)
                .build());
    
            ctx.export("first", example.applyValue(getProjectsResult -> getProjectsResult.projects()[0].id()));
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ucloud:getProjects
          arguments:
            isFinance: false
    outputs:
      first: ${example.projects[0].id}
    

    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(id: Optional[str] = None,
                     is_finance: Optional[bool] = None,
                     name_regex: Optional[str] = None,
                     output_file: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetProjectsResult
    def get_projects_output(id: Optional[pulumi.Input[str]] = None,
                     is_finance: Optional[pulumi.Input[bool]] = None,
                     name_regex: Optional[pulumi.Input[str]] = None,
                     output_file: 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)
    public static Output<GetProjectsResult> getProjects(GetProjectsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ucloud:index/getProjects:getProjects
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Id string
    The ID of project defined.
    IsFinance bool
    To identify if the current account is granted with financial permission.
    NameRegex string
    A regex string to filter resulting projects by name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Id string
    The ID of project defined.
    IsFinance bool
    To identify if the current account is granted with financial permission.
    NameRegex string
    A regex string to filter resulting projects by name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    id String
    The ID of project defined.
    isFinance Boolean
    To identify if the current account is granted with financial permission.
    nameRegex String
    A regex string to filter resulting projects by name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    id string
    The ID of project defined.
    isFinance boolean
    To identify if the current account is granted with financial permission.
    nameRegex string
    A regex string to filter resulting projects by name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    id str
    The ID of project defined.
    is_finance bool
    To identify if the current account is granted with financial permission.
    name_regex str
    A regex string to filter resulting projects by name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    id String
    The ID of project defined.
    isFinance Boolean
    To identify if the current account is granted with financial permission.
    nameRegex String
    A regex string to filter resulting projects by name.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getProjects Result

    The following output properties are available:

    Id string
    The ID of project defined.
    Projects List<GetProjectsProject>
    It is a nested type which documented below.
    TotalCount double
    Total number of projects that satisfy the condition.
    IsFinance bool
    NameRegex string
    OutputFile string
    Id string
    The ID of project defined.
    Projects []GetProjectsProject
    It is a nested type which documented below.
    TotalCount float64
    Total number of projects that satisfy the condition.
    IsFinance bool
    NameRegex string
    OutputFile string
    id String
    The ID of project defined.
    projects List<GetProjectsProject>
    It is a nested type which documented below.
    totalCount Double
    Total number of projects that satisfy the condition.
    isFinance Boolean
    nameRegex String
    outputFile String
    id string
    The ID of project defined.
    projects GetProjectsProject[]
    It is a nested type which documented below.
    totalCount number
    Total number of projects that satisfy the condition.
    isFinance boolean
    nameRegex string
    outputFile string
    id str
    The ID of project defined.
    projects Sequence[GetProjectsProject]
    It is a nested type which documented below.
    total_count float
    Total number of projects that satisfy the condition.
    is_finance bool
    name_regex str
    output_file str
    id String
    The ID of project defined.
    projects List<Property Map>
    It is a nested type which documented below.
    totalCount Number
    Total number of projects that satisfy the condition.
    isFinance Boolean
    nameRegex String
    outputFile String

    Supporting Types

    GetProjectsProject

    CreateTime string
    The time of creation for instance, formatted in RFC3339 time string.
    Id string
    The ID of project defined.
    MemberCount double
    The number of members belongs to the defined project.
    Name string
    The name of the defined project.
    ParentId string
    The ID of the parent project where the sub project belongs to.
    ParentName string
    The name of the parent project where the sub project belongs to.
    ResourceCount double
    The number of the resounce instance belong/s to the defined project.
    CreateTime string
    The time of creation for instance, formatted in RFC3339 time string.
    Id string
    The ID of project defined.
    MemberCount float64
    The number of members belongs to the defined project.
    Name string
    The name of the defined project.
    ParentId string
    The ID of the parent project where the sub project belongs to.
    ParentName string
    The name of the parent project where the sub project belongs to.
    ResourceCount float64
    The number of the resounce instance belong/s to the defined project.
    createTime String
    The time of creation for instance, formatted in RFC3339 time string.
    id String
    The ID of project defined.
    memberCount Double
    The number of members belongs to the defined project.
    name String
    The name of the defined project.
    parentId String
    The ID of the parent project where the sub project belongs to.
    parentName String
    The name of the parent project where the sub project belongs to.
    resourceCount Double
    The number of the resounce instance belong/s to the defined project.
    createTime string
    The time of creation for instance, formatted in RFC3339 time string.
    id string
    The ID of project defined.
    memberCount number
    The number of members belongs to the defined project.
    name string
    The name of the defined project.
    parentId string
    The ID of the parent project where the sub project belongs to.
    parentName string
    The name of the parent project where the sub project belongs to.
    resourceCount number
    The number of the resounce instance belong/s to the defined project.
    create_time str
    The time of creation for instance, formatted in RFC3339 time string.
    id str
    The ID of project defined.
    member_count float
    The number of members belongs to the defined project.
    name str
    The name of the defined project.
    parent_id str
    The ID of the parent project where the sub project belongs to.
    parent_name str
    The name of the parent project where the sub project belongs to.
    resource_count float
    The number of the resounce instance belong/s to the defined project.
    createTime String
    The time of creation for instance, formatted in RFC3339 time string.
    id String
    The ID of project defined.
    memberCount Number
    The number of members belongs to the defined project.
    name String
    The name of the defined project.
    parentId String
    The ID of the parent project where the sub project belongs to.
    parentName String
    The name of the parent project where the sub project belongs to.
    resourceCount Number
    The number of the resounce instance belong/s to the defined project.

    Package Details

    Repository
    ucloud ucloud/terraform-provider-ucloud
    License
    Notes
    This Pulumi package is based on the ucloud Terraform Provider.
    ucloud logo
    ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud