WebService::DataDog::Tag - Interface to Tag functions in DataDog's API.
Version 1.0.0
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.
Retrieve a mapping of tags to hosts.
my $tag = $datadog->build('Tag'); my $tag_host_list = $tag->retrieve_all();
Parameters: None
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:
host
Hostname/host id you want to retrieve the tags for.
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' ], );
Host name/id whose tags you want to modify.
tags
List of tags to apply to host. This must be the full list you want applied, including any already applied.
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' ], );
List of new tags to apply to existing tags on specified host.
Delete all tags from the specified host.
my $tag = $datadog->build('Tag'); $tag->delete( host => $host );
Host name/id whose tags you want to delete.
Common error checking for adding/updating tags.
To install WebService::DataDog, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::DataDog
CPAN shell
perl -MCPAN -e shell install WebService::DataDog
For more information on module installation, please visit the detailed CPAN module installation guide.