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

ucloud.getLabelResources

Explore with Pulumi AI

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

    Provides a list of labels.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ucloud from "@pulumi/ucloud";
    
    const foo = ucloud.getLabelResources({
        key: "key",
        projectIds: ["org-xxx"],
        resourceTypes: ["vip"],
        value: "value",
    });
    
    import pulumi
    import pulumi_ucloud as ucloud
    
    foo = ucloud.get_label_resources(key="key",
        project_ids=["org-xxx"],
        resource_types=["vip"],
        value="value")
    
    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 {
    		_, err := ucloud.GetLabelResources(ctx, &ucloud.GetLabelResourcesArgs{
    			Key: "key",
    			ProjectIds: []string{
    				"org-xxx",
    			},
    			ResourceTypes: []string{
    				"vip",
    			},
    			Value: "value",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ucloud = Pulumi.Ucloud;
    
    return await Deployment.RunAsync(() => 
    {
        var foo = Ucloud.GetLabelResources.Invoke(new()
        {
            Key = "key",
            ProjectIds = new[]
            {
                "org-xxx",
            },
            ResourceTypes = new[]
            {
                "vip",
            },
            Value = "value",
        });
    
    });
    
    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.GetLabelResourcesArgs;
    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 foo = UcloudFunctions.getLabelResources(GetLabelResourcesArgs.builder()
                .key("key")
                .projectIds("org-xxx")
                .resourceTypes("vip")
                .value("value")
                .build());
    
        }
    }
    
    variables:
      foo:
        fn::invoke:
          function: ucloud:getLabelResources
          arguments:
            key: key
            projectIds:
              - org-xxx
            resourceTypes:
              - vip
            value: value
    

    Using getLabelResources

    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 getLabelResources(args: GetLabelResourcesArgs, opts?: InvokeOptions): Promise<GetLabelResourcesResult>
    function getLabelResourcesOutput(args: GetLabelResourcesOutputArgs, opts?: InvokeOptions): Output<GetLabelResourcesResult>
    def get_label_resources(id: Optional[str] = None,
                            key: Optional[str] = None,
                            output_file: Optional[str] = None,
                            project_ids: Optional[Sequence[str]] = None,
                            resource_types: Optional[Sequence[str]] = None,
                            value: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetLabelResourcesResult
    def get_label_resources_output(id: Optional[pulumi.Input[str]] = None,
                            key: Optional[pulumi.Input[str]] = None,
                            output_file: Optional[pulumi.Input[str]] = None,
                            project_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                            resource_types: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                            value: Optional[pulumi.Input[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetLabelResourcesResult]
    func GetLabelResources(ctx *Context, args *GetLabelResourcesArgs, opts ...InvokeOption) (*GetLabelResourcesResult, error)
    func GetLabelResourcesOutput(ctx *Context, args *GetLabelResourcesOutputArgs, opts ...InvokeOption) GetLabelResourcesResultOutput

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

    public static class GetLabelResources 
    {
        public static Task<GetLabelResourcesResult> InvokeAsync(GetLabelResourcesArgs args, InvokeOptions? opts = null)
        public static Output<GetLabelResourcesResult> Invoke(GetLabelResourcesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetLabelResourcesResult> getLabelResources(GetLabelResourcesArgs args, InvokeOptions options)
    public static Output<GetLabelResourcesResult> getLabelResources(GetLabelResourcesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ucloud:index/getLabelResources:getLabelResources
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Key string
    key of the label.s
    ProjectIds List<string>
    projects that own the attached resources, for example org-xxx.*
    ResourceTypes List<string>
    types of the attached resources, for example uhost.
    Value string
    value of the label
    Id string
    ID of the resource
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Key string
    key of the label.s
    ProjectIds []string
    projects that own the attached resources, for example org-xxx.*
    ResourceTypes []string
    types of the attached resources, for example uhost.
    Value string
    value of the label
    Id string
    ID of the resource
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    key String
    key of the label.s
    projectIds List<String>
    projects that own the attached resources, for example org-xxx.*
    resourceTypes List<String>
    types of the attached resources, for example uhost.
    value String
    value of the label
    id String
    ID of the resource
    outputFile String
    File name where to save data source results (after running pulumi preview).
    key string
    key of the label.s
    projectIds string[]
    projects that own the attached resources, for example org-xxx.*
    resourceTypes string[]
    types of the attached resources, for example uhost.
    value string
    value of the label
    id string
    ID of the resource
    outputFile string
    File name where to save data source results (after running pulumi preview).
    key str
    key of the label.s
    project_ids Sequence[str]
    projects that own the attached resources, for example org-xxx.*
    resource_types Sequence[str]
    types of the attached resources, for example uhost.
    value str
    value of the label
    id str
    ID of the resource
    output_file str
    File name where to save data source results (after running pulumi preview).
    key String
    key of the label.s
    projectIds List<String>
    projects that own the attached resources, for example org-xxx.*
    resourceTypes List<String>
    types of the attached resources, for example uhost.
    value String
    value of the label
    id String
    ID of the resource
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getLabelResources Result

    The following output properties are available:

    Id string
    ID of the resource
    Key string
    ProjectIds List<string>
    ResourceTypes List<string>
    Resources List<GetLabelResourcesResource>
    Resources with specific label and consists of following attribute
    TotalCount double
    Value string
    OutputFile string
    Id string
    ID of the resource
    Key string
    ProjectIds []string
    ResourceTypes []string
    Resources []GetLabelResourcesResource
    Resources with specific label and consists of following attribute
    TotalCount float64
    Value string
    OutputFile string
    id String
    ID of the resource
    key String
    projectIds List<String>
    resourceTypes List<String>
    resources List<GetLabelResourcesResource>
    Resources with specific label and consists of following attribute
    totalCount Double
    value String
    outputFile String
    id string
    ID of the resource
    key string
    projectIds string[]
    resourceTypes string[]
    resources GetLabelResourcesResource[]
    Resources with specific label and consists of following attribute
    totalCount number
    value string
    outputFile string
    id str
    ID of the resource
    key str
    project_ids Sequence[str]
    resource_types Sequence[str]
    resources Sequence[GetLabelResourcesResource]
    Resources with specific label and consists of following attribute
    total_count float
    value str
    output_file str
    id String
    ID of the resource
    key String
    projectIds List<String>
    resourceTypes List<String>
    resources List<Property Map>
    Resources with specific label and consists of following attribute
    totalCount Number
    value String
    outputFile String

    Supporting Types

    GetLabelResourcesResource

    Id string
    ID of the resource
    Name string
    Name of the resource
    Type string
    Id string
    ID of the resource
    Name string
    Name of the resource
    Type string
    id String
    ID of the resource
    name String
    Name of the resource
    type String
    id string
    ID of the resource
    name string
    Name of the resource
    type string
    id str
    ID of the resource
    name str
    Name of the resource
    type str
    id String
    ID of the resource
    name String
    Name of the resource
    type String

    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