netbox 3.10.0 published on Monday, Apr 14, 2025 by e-breuninger
netbox.getTags
Explore with Pulumi AI
netbox 3.10.0 published on Monday, Apr 14, 2025 by e-breuninger
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as netbox from "@pulumi/netbox";
const allTags = netbox.getTags({});
const ansibleTags = netbox.getTags({
    filters: [{
        name: "name__isw",
        value: "ansible_",
    }],
});
const notAnsibleTags = netbox.getTags({
    filters: [{
        name: "name__nisw",
        value: "ansible_",
    }],
});
import pulumi
import pulumi_netbox as netbox
all_tags = netbox.get_tags()
ansible_tags = netbox.get_tags(filters=[{
    "name": "name__isw",
    "value": "ansible_",
}])
not_ansible_tags = netbox.get_tags(filters=[{
    "name": "name__nisw",
    "value": "ansible_",
}])
package main
import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/netbox/v3/netbox"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := netbox.GetTags(ctx, &netbox.GetTagsArgs{}, nil)
		if err != nil {
			return err
		}
		_, err = netbox.GetTags(ctx, &netbox.GetTagsArgs{
			Filters: []netbox.GetTagsFilter{
				{
					Name:  "name__isw",
					Value: "ansible_",
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		_, err = netbox.GetTags(ctx, &netbox.GetTagsArgs{
			Filters: []netbox.GetTagsFilter{
				{
					Name:  "name__nisw",
					Value: "ansible_",
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Netbox = Pulumi.Netbox;
return await Deployment.RunAsync(() => 
{
    var allTags = Netbox.GetTags.Invoke();
    var ansibleTags = Netbox.GetTags.Invoke(new()
    {
        Filters = new[]
        {
            new Netbox.Inputs.GetTagsFilterInputArgs
            {
                Name = "name__isw",
                Value = "ansible_",
            },
        },
    });
    var notAnsibleTags = Netbox.GetTags.Invoke(new()
    {
        Filters = new[]
        {
            new Netbox.Inputs.GetTagsFilterInputArgs
            {
                Name = "name__nisw",
                Value = "ansible_",
            },
        },
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.netbox.NetboxFunctions;
import com.pulumi.netbox.inputs.GetTagsArgs;
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 allTags = NetboxFunctions.getTags();
        final var ansibleTags = NetboxFunctions.getTags(GetTagsArgs.builder()
            .filters(GetTagsFilterArgs.builder()
                .name("name__isw")
                .value("ansible_")
                .build())
            .build());
        final var notAnsibleTags = NetboxFunctions.getTags(GetTagsArgs.builder()
            .filters(GetTagsFilterArgs.builder()
                .name("name__nisw")
                .value("ansible_")
                .build())
            .build());
    }
}
variables:
  allTags:
    fn::invoke:
      function: netbox:getTags
      arguments: {}
  ansibleTags:
    fn::invoke:
      function: netbox:getTags
      arguments:
        filters:
          - name: name__isw
            value: ansible_
  notAnsibleTags:
    fn::invoke:
      function: netbox:getTags
      arguments:
        filters:
          - name: name__nisw
            value: ansible_
Using getTags
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 getTags(args: GetTagsArgs, opts?: InvokeOptions): Promise<GetTagsResult>
function getTagsOutput(args: GetTagsOutputArgs, opts?: InvokeOptions): Output<GetTagsResult>def get_tags(filters: Optional[Sequence[GetTagsFilter]] = None,
             id: Optional[str] = None,
             limit: Optional[float] = None,
             opts: Optional[InvokeOptions] = None) -> GetTagsResult
def get_tags_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetTagsFilterArgs]]]] = None,
             id: Optional[pulumi.Input[str]] = None,
             limit: Optional[pulumi.Input[float]] = None,
             opts: Optional[InvokeOptions] = None) -> Output[GetTagsResult]func GetTags(ctx *Context, args *GetTagsArgs, opts ...InvokeOption) (*GetTagsResult, error)
func GetTagsOutput(ctx *Context, args *GetTagsOutputArgs, opts ...InvokeOption) GetTagsResultOutput> Note: This function is named GetTags in the Go SDK.
public static class GetTags 
{
    public static Task<GetTagsResult> InvokeAsync(GetTagsArgs args, InvokeOptions? opts = null)
    public static Output<GetTagsResult> Invoke(GetTagsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetTagsResult> getTags(GetTagsArgs args, InvokeOptions options)
public static Output<GetTagsResult> getTags(GetTagsArgs args, InvokeOptions options)
fn::invoke:
  function: netbox:index/getTags:getTags
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Filters
List<GetTags Filter> 
- Id string
- The ID of this resource.
- Limit double
- Defaults to 0.
- Filters
[]GetTags Filter 
- Id string
- The ID of this resource.
- Limit float64
- Defaults to 0.
- filters
List<GetTags Filter> 
- id String
- The ID of this resource.
- limit Double
- Defaults to 0.
- filters
GetTags Filter[] 
- id string
- The ID of this resource.
- limit number
- Defaults to 0.
- filters
Sequence[GetTags Filter] 
- id str
- The ID of this resource.
- limit float
- Defaults to 0.
- filters List<Property Map>
- id String
- The ID of this resource.
- limit Number
- Defaults to 0.
getTags Result
The following output properties are available:
- Id string
- The ID of this resource.
- 
List<GetTags Tag> 
- Filters
List<GetTags Filter> 
- Limit double
- Defaults to 0.
- Id string
- The ID of this resource.
- 
[]GetTags Tag 
- Filters
[]GetTags Filter 
- Limit float64
- Defaults to 0.
- id String
- The ID of this resource.
- 
List<GetTags Tag> 
- filters
List<GetTags Filter> 
- limit Double
- Defaults to 0.
- id string
- The ID of this resource.
- 
GetTags Tag[] 
- filters
GetTags Filter[] 
- limit number
- Defaults to 0.
- id str
- The ID of this resource.
- 
Sequence[GetTags Tag] 
- filters
Sequence[GetTags Filter] 
- limit float
- Defaults to 0.
- id String
- The ID of this resource.
- List<Property Map>
- filters List<Property Map>
- limit Number
- Defaults to 0.
Supporting Types
GetTagsFilter  
GetTagsTag  
- Color string
- Description string
- Name string
- Slug string
- TagId double
- Color string
- Description string
- Name string
- Slug string
- TagId float64
- color String
- description String
- name String
- slug String
- tagId Double
- color string
- description string
- name string
- slug string
- tagId number
- color str
- description str
- name str
- slug str
- tag_id float
- color String
- description String
- name String
- slug String
- tagId Number
Package Details
- Repository
- netbox e-breuninger/terraform-provider-netbox
- License
- Notes
- This Pulumi package is based on the netboxTerraform Provider.
netbox 3.10.0 published on Monday, Apr 14, 2025 by e-breuninger