Jennifer Pinkham > WebService-DataDog-0.8.0 > WebService::DataDog::Tag

Download:
WebService-DataDog-0.8.0.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: v0.8.0   Source   Latest Release: WebService-DataDog-1.0.0

NAME ^

WebService::DataDog::Tag - Interface to Tag functions in DataDog's API.

VERSION ^

Version 0.8.0

SYNOPSIS ^

This module allows you interact with the Tag endpoint of the DataDog API.

Per DataDog: "The tag end point allows you to tag hosts with keywords meaningful to you - like role:database. All metrics sent from a host will have its tags applied. When fetching and applying tags to a particular host, you can refer to hosts by name (yourhost.example.com) or id (12345)."

NOTE: all methods, except retrieve_all(), operate on a per-host basis rather than on a per-tag basis. You cannot rename a tag or delete a tag from all hosts, through the DataDog API.

METHODS ^

retrieve_all()

Retrieve a mapping of tags to hosts.

        my $tag = $datadog->build('Tag');
        my $tag_host_list = $tag->retrieve_all();

Parameters: None

retrieve()

Return a list of tags for the specified host. NOTE: a 404 response typically indicates you specified an incorrect/unknown host name/id

        my $tag = $datadog->build('Tag');
        my $tag_list = $tag->retrieve( host => $host_name_or_id );

Parameters:

update()

Update tags for specified host. NOTE: a 404 response typically indicates you specified an incorrect host name/id. WARNING: you must specify all tags that you want attached to this host, not simply new ones you want to add ( use add() for that, instead ).

        my $tag = $datadog->build('Tag');
        $tag->update(
                host => $host,  # name/ID of host to modify
                tags => $tag_list, # Updated full list of tags to apply to host
        );
        
        Example:
        $tag->update(
                host => 'my.example.com',
                tags => [ 'tag1', 'tag2', 'tag3:val' ],
        );

Parameters:

add()

Add tags to specified host. NOTE: a 404 response typically indicates you specified an incorrect host name/id.

        my $tag = $datadog->build('Tag');
        $tag->add(
                host => $host,  # name/ID of host to modify
                tags => $tag_list, # Updated full list of tags to apply to host
        );
        
        Example:
        $tag->add(
                host => 'my.example.com',
                tags => [ 'tag3:val' ],
        );

Parameters:

delete()

Delete all tags from the specified host.

        my $tag = $datadog->build('Tag');
        $tag->delete( host => $host );

Parameters:

INTERNAL FUNCTIONS ^

_error_checks()

Common error checking for adding/updating tags.

syntax highlighting: