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

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",
});
Copy
import pulumi
import pulumi_ucloud as ucloud

foo = ucloud.get_label_resources(key="key",
    project_ids=["org-xxx"],
    resource_types=["vip"],
    value="value")
Copy
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
	})
}
Copy
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",
    });

});
Copy
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());

    }
}
Copy
variables:
  foo:
    fn::invoke:
      function: ucloud:getLabelResources
      arguments:
        key: key
        projectIds:
          - org-xxx
        resourceTypes:
          - vip
        value: value
Copy

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>
Copy
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]
Copy
func GetLabelResources(ctx *Context, args *GetLabelResourcesArgs, opts ...InvokeOption) (*GetLabelResourcesResult, error)
func GetLabelResourcesOutput(ctx *Context, args *GetLabelResourcesOutputArgs, opts ...InvokeOption) GetLabelResourcesResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetLabelResourcesResult> getLabelResources(GetLabelResourcesArgs args, InvokeOptions options)
public static Output<GetLabelResourcesResult> getLabelResources(GetLabelResourcesArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: ucloud:index/getLabelResources:getLabelResources
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Key This property is required. string
key of the label.s
ProjectIds This property is required. List<string>
projects that own the attached resources, for example org-xxx.*
ResourceTypes This property is required. List<string>
types of the attached resources, for example uhost.
Value This property is required. 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 This property is required. string
key of the label.s
ProjectIds This property is required. []string
projects that own the attached resources, for example org-xxx.*
ResourceTypes This property is required. []string
types of the attached resources, for example uhost.
Value This property is required. 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 This property is required. String
key of the label.s
projectIds This property is required. List<String>
projects that own the attached resources, for example org-xxx.*
resourceTypes This property is required. List<String>
types of the attached resources, for example uhost.
value This property is required. 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 This property is required. string
key of the label.s
projectIds This property is required. string[]
projects that own the attached resources, for example org-xxx.*
resourceTypes This property is required. string[]
types of the attached resources, for example uhost.
value This property is required. 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 This property is required. str
key of the label.s
project_ids This property is required. Sequence[str]
projects that own the attached resources, for example org-xxx.*
resource_types This property is required. Sequence[str]
types of the attached resources, for example uhost.
value This property is required. 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 This property is required. String
key of the label.s
projectIds This property is required. List<String>
projects that own the attached resources, for example org-xxx.*
resourceTypes This property is required. List<String>
types of the attached resources, for example uhost.
value This property is required. 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 This property is required. string
ID of the resource
Name This property is required. string
Name of the resource
Type This property is required. string
Id This property is required. string
ID of the resource
Name This property is required. string
Name of the resource
Type This property is required. string
id This property is required. String
ID of the resource
name This property is required. String
Name of the resource
type This property is required. String
id This property is required. string
ID of the resource
name This property is required. string
Name of the resource
type This property is required. string
id This property is required. str
ID of the resource
name This property is required. str
Name of the resource
type This property is required. str
id This property is required. String
ID of the resource
name This property is required. String
Name of the resource
type This property is required. String

Package Details

Repository
ucloud ucloud/terraform-provider-ucloud
License
Notes
This Pulumi package is based on the ucloud Terraform Provider.