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

ucloud.getLabels

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.getLabels({
        keyRegex: "^key$",
    });
    
    import pulumi
    import pulumi_ucloud as ucloud
    
    foo = ucloud.get_labels(key_regex="^key$")
    
    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.GetLabels(ctx, &ucloud.GetLabelsArgs{
    			KeyRegex: pulumi.StringRef("^key$"),
    		}, 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.GetLabels.Invoke(new()
        {
            KeyRegex = "^key$",
        });
    
    });
    
    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.GetLabelsArgs;
    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.getLabels(GetLabelsArgs.builder()
                .keyRegex("^key$")
                .build());
    
        }
    }
    
    variables:
      foo:
        fn::invoke:
          function: ucloud:getLabels
          arguments:
            keyRegex: ^key$
    

    Using getLabels

    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 getLabels(args: GetLabelsArgs, opts?: InvokeOptions): Promise<GetLabelsResult>
    function getLabelsOutput(args: GetLabelsOutputArgs, opts?: InvokeOptions): Output<GetLabelsResult>
    def get_labels(id: Optional[str] = None,
                   key_regex: Optional[str] = None,
                   output_file: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetLabelsResult
    def get_labels_output(id: Optional[pulumi.Input[str]] = None,
                   key_regex: Optional[pulumi.Input[str]] = None,
                   output_file: Optional[pulumi.Input[str]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetLabelsResult]
    func GetLabels(ctx *Context, args *GetLabelsArgs, opts ...InvokeOption) (*GetLabelsResult, error)
    func GetLabelsOutput(ctx *Context, args *GetLabelsOutputArgs, opts ...InvokeOption) GetLabelsResultOutput

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

    public static class GetLabels 
    {
        public static Task<GetLabelsResult> InvokeAsync(GetLabelsArgs args, InvokeOptions? opts = null)
        public static Output<GetLabelsResult> Invoke(GetLabelsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetLabelsResult> getLabels(GetLabelsArgs args, InvokeOptions options)
    public static Output<GetLabelsResult> getLabels(GetLabelsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ucloud:index/getLabels:getLabels
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Id string
    ID of the project
    KeyRegex string
    A regex string to filter the returned users by their keys.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Id string
    ID of the project
    KeyRegex string
    A regex string to filter the returned users by their keys.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    id String
    ID of the project
    keyRegex String
    A regex string to filter the returned users by their keys.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    id string
    ID of the project
    keyRegex string
    A regex string to filter the returned users by their keys.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    id str
    ID of the project
    key_regex str
    A regex string to filter the returned users by their keys.
    output_file str
    File name where to save data source results (after running pulumi preview).
    id String
    ID of the project
    keyRegex String
    A regex string to filter the returned users by their keys.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getLabels Result

    The following output properties are available:

    Id string
    ID of the project
    Labels List<GetLabelsLabel>
    TotalCount double
    KeyRegex string
    OutputFile string
    Id string
    ID of the project
    Labels []GetLabelsLabel
    TotalCount float64
    KeyRegex string
    OutputFile string
    id String
    ID of the project
    labels List<GetLabelsLabel>
    totalCount Double
    keyRegex String
    outputFile String
    id string
    ID of the project
    labels GetLabelsLabel[]
    totalCount number
    keyRegex string
    outputFile string
    id String
    ID of the project
    labels List<Property Map>
    totalCount Number
    keyRegex String
    outputFile String

    Supporting Types

    GetLabelsLabel

    Key string
    Key of the label
    Projects List<GetLabelsLabelProject>
    Projects which have attached resources and consists of following attribute
    Value string
    Value of the label
    Key string
    Key of the label
    Projects []GetLabelsLabelProject
    Projects which have attached resources and consists of following attribute
    Value string
    Value of the label
    key String
    Key of the label
    projects List<GetLabelsLabelProject>
    Projects which have attached resources and consists of following attribute
    value String
    Value of the label
    key string
    Key of the label
    projects GetLabelsLabelProject[]
    Projects which have attached resources and consists of following attribute
    value string
    Value of the label
    key str
    Key of the label
    projects Sequence[GetLabelsLabelProject]
    Projects which have attached resources and consists of following attribute
    value str
    Value of the label
    key String
    Key of the label
    projects List<Property Map>
    Projects which have attached resources and consists of following attribute
    value String
    Value of the label

    GetLabelsLabelProject

    DisabledResourceTypes List<string>
    Array of strings, which are resource types without query permission for current account
    Id string
    ID of the project
    Name string
    Name of the project
    ResourceTypes List<string>
    Array of strings, which are resource types with query permission for current account
    DisabledResourceTypes []string
    Array of strings, which are resource types without query permission for current account
    Id string
    ID of the project
    Name string
    Name of the project
    ResourceTypes []string
    Array of strings, which are resource types with query permission for current account
    disabledResourceTypes List<String>
    Array of strings, which are resource types without query permission for current account
    id String
    ID of the project
    name String
    Name of the project
    resourceTypes List<String>
    Array of strings, which are resource types with query permission for current account
    disabledResourceTypes string[]
    Array of strings, which are resource types without query permission for current account
    id string
    ID of the project
    name string
    Name of the project
    resourceTypes string[]
    Array of strings, which are resource types with query permission for current account
    disabled_resource_types Sequence[str]
    Array of strings, which are resource types without query permission for current account
    id str
    ID of the project
    name str
    Name of the project
    resource_types Sequence[str]
    Array of strings, which are resource types with query permission for current account
    disabledResourceTypes List<String>
    Array of strings, which are resource types without query permission for current account
    id String
    ID of the project
    name String
    Name of the project
    resourceTypes List<String>
    Array of strings, which are resource types with query permission for current account

    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