Closed ojongerius closed 9 years ago
Damn, rereading the API, the above not applicable at all.
It actually is just a list of dicts with:
template_variables [optional, default=None]
A list of template variables for using Dashboard templating. Template variable definitions follow this form:
name [required]
The name of the variable.
prefix [optional, default=None]
The tag prefix associated with the variable. Only tags with this prefix will appear in the variable dropdown.
default [optional, default=None]
The default value for the template variable on dashboard load
``
All done. Did add TODO to implement an acceptance test for changes.
Related upstream PR: https://github.com/zorkian/go-datadog-api/pull/12
Template variables are comparable to tags in the builtin AWS provider in the way that they are dictionaries where key and values are defined by the user.
In the AWS provider tags are mostly handled outside of the resource specific files.
tags.go
, has a convenience functiontagsSchema()
and resources that have different connections and structs (ELB, EC) have specific helper files.Having at least some shared variable helper functions makes sense for us too, as we will reuse 'template variables' between Timeboards and Screenboards
There are similar helper functions split up between tags.go, tagsEC.go etc. They all have:
The difference between these is that they each handle getting, setting and diffing based on the structs they operate on, and connections they operate on.
Going through the AWS route table resource you'll notice all the work is offloaded to the helpers. The only references are:
resourceAwsRouteTable()
):"tags": tagsSchema()
resourceAwsRouteTableRead
):d.Set("tags", tagsToMap(rt.Tags))
resourceAwsRouteTableUpdate
):d.setTags(conn, d)