1. Packages
  2. Vsphere Provider
  3. API Docs
  4. getTagCategory
vSphere v4.12.1 published on Tuesday, Oct 22, 2024 by Pulumi

vsphere.getTagCategory

Explore with Pulumi AI

vsphere logo
vSphere v4.12.1 published on Tuesday, Oct 22, 2024 by Pulumi

    The vsphere.TagCategory data source can be used to reference tag categories that are not managed by this provider. Its attributes are the same as the vsphere.TagCategory resource, and, like importing, the data source uses a name and category as search criteria. The id and other attributes are populated with the data found by the search.

    NOTE: Tagging is not supported on direct ESXi hosts connections and requires vCenter Server.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as vsphere from "@pulumi/vsphere";
    
    const category = vsphere.getTagCategory({
        name: "example-category",
    });
    
    import pulumi
    import pulumi_vsphere as vsphere
    
    category = vsphere.get_tag_category(name="example-category")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-vsphere/sdk/v4/go/vsphere"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := vsphere.LookupTagCategory(ctx, &vsphere.LookupTagCategoryArgs{
    			Name: "example-category",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using VSphere = Pulumi.VSphere;
    
    return await Deployment.RunAsync(() => 
    {
        var category = VSphere.GetTagCategory.Invoke(new()
        {
            Name = "example-category",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vsphere.VsphereFunctions;
    import com.pulumi.vsphere.inputs.GetTagCategoryArgs;
    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 category = VsphereFunctions.getTagCategory(GetTagCategoryArgs.builder()
                .name("example-category")
                .build());
    
        }
    }
    
    variables:
      category:
        fn::invoke:
          Function: vsphere:getTagCategory
          Arguments:
            name: example-category
    

    Using getTagCategory

    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 getTagCategory(args: GetTagCategoryArgs, opts?: InvokeOptions): Promise<GetTagCategoryResult>
    function getTagCategoryOutput(args: GetTagCategoryOutputArgs, opts?: InvokeOptions): Output<GetTagCategoryResult>
    def get_tag_category(name: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetTagCategoryResult
    def get_tag_category_output(name: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetTagCategoryResult]
    func LookupTagCategory(ctx *Context, args *LookupTagCategoryArgs, opts ...InvokeOption) (*LookupTagCategoryResult, error)
    func LookupTagCategoryOutput(ctx *Context, args *LookupTagCategoryOutputArgs, opts ...InvokeOption) LookupTagCategoryResultOutput

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

    public static class GetTagCategory 
    {
        public static Task<GetTagCategoryResult> InvokeAsync(GetTagCategoryArgs args, InvokeOptions? opts = null)
        public static Output<GetTagCategoryResult> Invoke(GetTagCategoryInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetTagCategoryResult> getTagCategory(GetTagCategoryArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: vsphere:index/getTagCategory:getTagCategory
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The name of the tag category.
    Name string
    The name of the tag category.
    name String
    The name of the tag category.
    name string
    The name of the tag category.
    name str
    The name of the tag category.
    name String
    The name of the tag category.

    getTagCategory Result

    The following output properties are available:

    AssociableTypes List<string>
    Cardinality string
    Description string
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    AssociableTypes []string
    Cardinality string
    Description string
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    associableTypes List<String>
    cardinality String
    description String
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    associableTypes string[]
    cardinality string
    description string
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    associable_types Sequence[str]
    cardinality str
    description str
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    associableTypes List<String>
    cardinality String
    description String
    id String
    The provider-assigned unique ID for this managed resource.
    name String

    Package Details

    Repository
    vSphere pulumi/pulumi-vsphere
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the vsphere Terraform Provider.
    vsphere logo
    vSphere v4.12.1 published on Tuesday, Oct 22, 2024 by Pulumi