snap_plugin.v1.namespace_element module

class snap_plugin.v1.namespace_element.NamespaceElement(name='', description='', value='', **kwargs)

Bases: object

Namespace element of a metric.

A namespace element is static when the value attribute is set and where the name attribute is not set. This is the case when the namespace does not change based on what is being collected.

A dynamic namespace element is defined by an element that contains non-static data relative to the metric being collected. For instance, when collecting metrics for a given virtual machine the namespace element that contains the virtual-machine-id would be dynamic. This is modeled by the NamespaceElement when its name attribute contains the value ‘virtual-machine-id’. In this example the value attribute would be set to the ID of the virtual machine when the metric is collected and ‘*’ when the metric catalog is updated.

Parameters:
  • value (str) – The value of an element.
  • name (str) – The name of an element.
  • description (str) – A short description of the element.
description
classmethod dynamic_namespace_element(name, description)

Returns a dynamic namespace_element.

A dynamic namespace element is one whose value attribute is set while the name attribute is not.

Parameters:
  • name (str) – Name of the namespace element
  • description (str) – Decription of the namespace element
Returns:

NamespaceElement

Return type:

NamespaceElement

name
classmethod static_namespace_element(value)

Returns a static namespace_element.

A static namespace element is one whose value attribute is set and the name attribute is not.

Parameters:value (str) – Value of the namespace element
Returns:NamespaceElement
Return type:NamespaceElement
value