%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/modules/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/modules/grafana4.pyc

�
���^c@@s7dZddlmZmZmZyddlZeZWnek
rQe	ZnXddl
mZdZd�Z
d�Zd�Zd	d
�Zd	d�Zd	d�Zd	d
�Zd	d�Zd	d�Zd	d�Zd	d�Zd	d�Zd	d�Zd	d�Zd	d�Zd	d�Zdd	d�Zdd	d�Zdd	d�Z dd	d�Z!dd	d�Z"dd	d�Z#dd	d�Z$dd	d�Z%d	d�Z&d	d �Z'd	d!�Z(dd	d"�Z)dd	d#�Z*dd	d$�Z+dd	d%�Z,dd	d&�Z-dd	d'�Z.dd	d(�Z/dd	d)�Z0dS(*u�
Module for working with the Grafana v4 API

.. versionadded:: 2017.7.0

:depends: requests

:configuration: This module requires a configuration profile to be configured
    in the minion config, minion pillar, or master config.
    The module will use the 'grafana' key by default, if defined.

    For example:

    .. code-block:: yaml

        grafana:
            grafana_url: http://grafana.localhost
            grafana_user: admin
            grafana_password: admin
            grafana_timeout: 3
i(tabsolute_importtprint_functiontunicode_literalsN(tstring_typesugrafana4cC@s!tr
tStdjt�fSdS(u,
    Only load if requests is installed
    uBThe "{0}" module could not be loaded: "requests" is not installed.N(tHAS_LIBSt__virtualname__tFalsetformat(((s9/usr/lib/python2.7/site-packages/salt/modules/grafana4.pyt__virtual__%s	cC@s=idd6}|jdt�r9dj|d�|d<n|S(Nuapplication/jsonuContent-typeu
grafana_tokenu
Bearer {0}u
Authorization(tgetRR(tprofiletheaders((s9/usr/lib/python2.7/site-packages/salt/modules/grafana4.pyt_get_headers0s

cC@s1|jdt�rdStjj|d|d�S(Nu
grafana_tokenugrafana_userugrafana_password(R	RtNonetrequeststautht
HTTPBasicAuth(R
((s9/usr/lib/python2.7/site-packages/salt/modules/grafana4.pyt	_get_auth8s
	ugrafanac
C@s�t|t�r"td|�}ntjdj|d�dt|�dt|�d|jdd��}|jd	kr�|j	�n|j
�S(
u�
    List all users.

    profile
        Configuration profile used to connect to the Grafana instance.
        Default is 'grafana'.

    CLI Example:

    .. code-block:: bash

        salt '*' grafana4.get_users
    u
config.optionu
{0}/api/usersugrafana_urlRRttimeoutugrafana_timeoutii�(t
isinstanceRt__salt__RR	RRRtstatus_codetraise_for_statustjson(R
tresponse((s9/usr/lib/python2.7/site-packages/salt/modules/grafana4.pyt	get_usersAs
cC@s5t|�}x"|D]}|d|kr|SqWdS(u

    Show a single user.

    login
        Login of the user.

    profile
        Configuration profile used to connect to the Grafana instance.
        Default is 'grafana'.

    CLI Example:

    .. code-block:: bash

        salt '*' grafana4.get_user <login>
    uloginN(RR
(tloginR
tdatatuser((s9/usr/lib/python2.7/site-packages/salt/modules/grafana4.pytget_user\s

c
C@s�t|t�r"td|�}ntjdj|d|�dt|�dt|�d|jdd��}|jd	kr�|j	�n|j
�S(
u

    Get user data.

    userid
        Id of the user.

    profile
        Configuration profile used to connect to the Grafana instance.
        Default is 'grafana'.

    CLI Example:

    .. code-block:: bash

        salt '*' grafana4.get_user_data <user_id>
    u
config.optionu{0}/api/users/{1}ugrafana_urlRRRugrafana_timeoutii�(RRRRR	RRRRRR(tuseridR
R((s9/usr/lib/python2.7/site-packages/salt/modules/grafana4.pyt
get_user_datats
cK@s�t|t�r"td|�}ntjdj|d�d|dt|�dt|�d|jdd	��}|j	d
kr�|j
�n|j�S(u�
    Create a new user.

    login
        Login of the new user.

    password
        Password of the new user.

    email
        Email of the new user.

    name
        Optional - Full name of the new user.

    profile
        Configuration profile used to connect to the Grafana instance.
        Default is 'grafana'.

    CLI Example:

    .. code-block:: bash

        salt '*' grafana4.create_user login=<login> password=<password> email=<email>
    u
config.optionu{0}/api/admin/usersugrafana_urlRRRRugrafana_timeoutii�(RRRRtpostRRRR	RRR(R
tkwargsR((s9/usr/lib/python2.7/site-packages/salt/modules/grafana4.pytcreate_user�s
cK@s�t|t�r"td|�}ntjdj|d|�d|dt|�dt|�d|jdd	��}|j	d
kr�|j
�n|j�S(u�
    Update an existing user.

    userid
        Id of the user.

    login
        Optional - Login of the user.

    email
        Optional - Email of the user.

    name
        Optional - Full name of the user.

    profile
        Configuration profile used to connect to the Grafana instance.
        Default is 'grafana'.

    CLI Example:

    .. code-block:: bash

        salt '*' grafana4.update_user <user_id> login=<login> email=<email>
    u
config.optionu{0}/api/users/{1}ugrafana_urlRRRRugrafana_timeoutii�(RRRRtputRRRR	RRR(RR
R!R((s9/usr/lib/python2.7/site-packages/salt/modules/grafana4.pytupdate_user�s
cK@s�t|t�r"td|�}ntjdj|d|�d|dt|�dt|�d|jdd	��}|j	d
kr�|j
�n|j�S(ua
    Update a user password.

    userid
        Id of the user.

    password
        New password of the user.

    profile
        Configuration profile used to connect to the Grafana instance.
        Default is 'grafana'.

    CLI Example:

    .. code-block:: bash

        salt '*' grafana4.update_user_password <user_id> password=<password>
    u
config.optionu {0}/api/admin/users/{1}/passwordugrafana_urlRRRRugrafana_timeoutii�(RRRRR#RRRR	RRR(RR
R!R((s9/usr/lib/python2.7/site-packages/salt/modules/grafana4.pytupdate_user_password�s
cK@s�t|t�r"td|�}ntjdj|d|�d|dt|�dt|�d|jdd	��}|j	d
kr�|j
�n|j�S(uy
    Update a user password.

    userid
        Id of the user.

    isGrafanaAdmin
        Whether user is a Grafana admin.

    profile
        Configuration profile used to connect to the Grafana instance.
        Default is 'grafana'.

    CLI Example:

    .. code-block:: bash

        salt '*' grafana4.update_user_permissions <user_id> isGrafanaAdmin=<true|false>
    u
config.optionu#{0}/api/admin/users/{1}/permissionsugrafana_urlRRRRugrafana_timeoutii�(RRRRR#RRRR	RRR(RR
R!R((s9/usr/lib/python2.7/site-packages/salt/modules/grafana4.pytupdate_user_permissionss
c
C@s�t|t�r"td|�}ntjdj|d|�dt|�dt|�d|jdd��}|j	d	kr�|j
�n|j�S(
u
    Delete a user.

    userid
        Id of the user.

    profile
        Configuration profile used to connect to the Grafana instance.
        Default is 'grafana'.

    CLI Example:

    .. code-block:: bash

        salt '*' grafana4.delete_user <user_id>
    u
config.optionu{0}/api/admin/users/{1}ugrafana_urlRRRugrafana_timeoutii�(RRRRtdeleteRRRR	RRR(RR
R((s9/usr/lib/python2.7/site-packages/salt/modules/grafana4.pytdelete_user(s
c
C@s�t|t�r"td|�}ntjdj|d|�dt|�dt|�d|jdd��}|jd	kr�|j	�n|j
�S(
u.
    Get the list of organisations a user belong to.

    userid
        Id of the user.

    profile
        Configuration profile used to connect to the Grafana instance.
        Default is 'grafana'.

    CLI Example:

    .. code-block:: bash

        salt '*' grafana4.get_user_orgs <user_id>
    u
config.optionu{0}/api/users/{1}/orgsugrafana_urlRRRugrafana_timeoutii�(RRRRR	RRRRRR(RR
R((s9/usr/lib/python2.7/site-packages/salt/modules/grafana4.pyt
get_user_orgsFs
c
C@s�t|t�r"td|�}ntjdj|d||�dt|�dt|�d|jdd��}|j	d	kr�|j
�n|j�S(
uX
    Remove a user from an organization.

    userid
        Id of the user.

    orgid
        Id of the organization.

    profile
        Configuration profile used to connect to the Grafana instance.
        Default is 'grafana'.

    CLI Example:

    .. code-block:: bash

        salt '*' grafana4.delete_user_org <user_id> <org_id>
    u
config.optionu{0}/api/orgs/{1}/users/{2}ugrafana_urlRRRugrafana_timeoutii�(RRRRR'RRRR	RRR(RtorgidR
R((s9/usr/lib/python2.7/site-packages/salt/modules/grafana4.pytdelete_user_orgds
c
C@s�t|t�r"td|�}ntjdj|d�dt|�dt|�d|jdd��}|jd	kr�|j	�n|j
�S(
u�
    List all organizations.

    profile
        Configuration profile used to connect to the Grafana instance.
        Default is 'grafana'.

    CLI Example:

    .. code-block:: bash

        salt '*' grafana4.get_orgs
    u
config.optionu{0}/api/orgsugrafana_urlRRRugrafana_timeoutii�(RRRRR	RRRRRR(R
R((s9/usr/lib/python2.7/site-packages/salt/modules/grafana4.pytget_orgs�s
c
C@s�t|t�r"td|�}ntjdj|d|�dt|�dt|�d|jdd��}|jd	kr�|j	�n|j
�S(
u
    Show a single organization.

    name
        Name of the organization.

    profile
        Configuration profile used to connect to the Grafana instance.
        Default is 'grafana'.

    CLI Example:

    .. code-block:: bash

        salt '*' grafana4.get_org <name>
    u
config.optionu{0}/api/orgs/name/{1}ugrafana_urlRRRugrafana_timeoutii�(RRRRR	RRRRRR(tnameR
R((s9/usr/lib/python2.7/site-packages/salt/modules/grafana4.pytget_org�s
c
C@s�t|t�r"td|�}nt||�}tjdj|d|d�dt|�dt|�d|j	dd	��}|j
d
kr�|j�n|S(u.
    Switch the current organization.

    name
        Name of the organization to switch to.

    profile
        Configuration profile used to connect to the Grafana instance.
        Default is 'grafana'.

    CLI Example:

    .. code-block:: bash

        salt '*' grafana4.switch_org <name>
    u
config.optionu{0}/api/user/using/{1}ugrafana_urluidRRRugrafana_timeoutii�(RRRR.RR RRRR	RR(torgnameR
torgR((s9/usr/lib/python2.7/site-packages/salt/modules/grafana4.pyt
switch_org�s
c
C@s�t|t�r"td|�}n|r8t||�ntjdj|d�dt|�dt|�d|jdd��}|j	d	kr�|j
�n|j�S(
u@
    Get the list of users that belong to the organization.

    orgname
        Name of the organization.

    profile
        Configuration profile used to connect to the Grafana instance.
        Default is 'grafana'.

    CLI Example:

    .. code-block:: bash

        salt '*' grafana4.get_org_users <orgname>
    u
config.optionu{0}/api/org/usersugrafana_urlRRRugrafana_timeoutii�(RRRR1RR	RRRRRR(R/R
R((s9/usr/lib/python2.7/site-packages/salt/modules/grafana4.pyt
get_org_users�s
cK@s�t|t�r"td|�}n|r8t||�ntjdj|d�d|dt|�dt|�d|j	dd	��}|j
d
kr�|j�n|j�S(uI
    Add user to the organization.

    loginOrEmail
        Login or email of the user.

    role
        Role of the user for this organization. Should be one of:
            - Admin
            - Editor
            - Read Only Editor
            - Viewer

    orgname
        Name of the organization in which users are added.

    profile
        Configuration profile used to connect to the Grafana instance.
        Default is 'grafana'.

    CLI Example:

    .. code-block:: bash

        salt '*' grafana4.create_org_user <orgname> loginOrEmail=<loginOrEmail> role=<role>
    u
config.optionu{0}/api/org/usersugrafana_urlRRRRugrafana_timeoutii�(
RRRR1RR RRRR	RRR(R/R
R!R((s9/usr/lib/python2.7/site-packages/salt/modules/grafana4.pytcreate_org_user�s
cK@s�t|t�r"td|�}n|r8t||�ntjdj|d|�d|dt|�dt|�d|j	dd	��}|j
d
kr�|j�n|j�S(u�
    Update user role in the organization.

    userid
        Id of the user.

    loginOrEmail
        Login or email of the user.

    role
        Role of the user for this organization. Should be one of:
            - Admin
            - Editor
            - Read Only Editor
            - Viewer

    orgname
        Name of the organization in which users are updated.

    profile
        Configuration profile used to connect to the Grafana instance.
        Default is 'grafana'.

    CLI Example:

    .. code-block:: bash

        salt '*' grafana4.update_org_user <user_id> <orgname> loginOrEmail=<loginOrEmail> role=<role>
    u
config.optionu{0}/api/org/users/{1}ugrafana_urlRRRRugrafana_timeoutii�(
RRRR1RtpatchRRRR	RRR(RR/R
R!R((s9/usr/lib/python2.7/site-packages/salt/modules/grafana4.pytupdate_org_user)s
c
C@s�t|t�r"td|�}n|r8t||�ntjdj|d|�dt|�dt|�d|j	dd��}|j
d	kr�|j�n|j�S(
uw
    Remove user from the organization.

    userid
        Id of the user.

    orgname
        Name of the organization in which users are updated.

    profile
        Configuration profile used to connect to the Grafana instance.
        Default is 'grafana'.

    CLI Example:

    .. code-block:: bash

        salt '*' grafana4.delete_org_user <user_id> <orgname>
    u
config.optionu{0}/api/org/users/{1}ugrafana_urlRRRugrafana_timeoutii�(
RRRR1RR'RRRR	RRR(RR/R
R((s9/usr/lib/python2.7/site-packages/salt/modules/grafana4.pytdelete_org_userWs
c
C@s�t|t�r"td|�}n|r8t||�ntjdj|d�dt|�dt|�d|jdd��}|j	d	kr�|j
�n|j�S(
uD
    Get the organization address.

    orgname
        Name of the organization in which users are updated.

    profile
        Configuration profile used to connect to the Grafana instance.
        Default is 'grafana'.

    CLI Example:

    .. code-block:: bash

        salt '*' grafana4.get_org_address <orgname>
    u
config.optionu{0}/api/org/addressugrafana_urlRRRugrafana_timeoutii�(RRRR1RR	RRRRRR(R/R
R((s9/usr/lib/python2.7/site-packages/salt/modules/grafana4.pytget_org_addresszs
cK@s�t|t�r"td|�}n|r8t||�ntjdj|d�d|dt|�dt|�d|j	dd	��}|j
d
kr�|j�n|j�S(u�
    Update the organization address.

    orgname
        Name of the organization in which users are updated.

    address1
        Optional - address1 of the org.

    address2
        Optional - address2 of the org.

    city
        Optional - city of the org.

    zip_code
        Optional - zip_code of the org.

    state
        Optional - state of the org.

    country
        Optional - country of the org.

    profile
        Configuration profile used to connect to the Grafana instance.
        Default is 'grafana'.

    CLI Example:

    .. code-block:: bash

        salt '*' grafana4.update_org_address <orgname> country=<country>
    u
config.optionu{0}/api/org/addressugrafana_urlRRRRugrafana_timeoutii�(
RRRR1RR#RRRR	RRR(R/R
R!R((s9/usr/lib/python2.7/site-packages/salt/modules/grafana4.pytupdate_org_address�s#
c
C@s�t|t�r"td|�}n|r8t||�ntjdj|d�dt|�dt|�d|jdd��}|j	d	kr�|j
�n|j�S(
uF
    Get the organization preferences.

    orgname
        Name of the organization in which users are updated.

    profile
        Configuration profile used to connect to the Grafana instance.
        Default is 'grafana'.

    CLI Example:

    .. code-block:: bash

        salt '*' grafana4.get_org_prefs <orgname>
    u
config.optionu{0}/api/org/preferencesugrafana_urlRRRugrafana_timeoutii�(RRRR1RR	RRRRRR(R/R
R((s9/usr/lib/python2.7/site-packages/salt/modules/grafana4.pyt
get_org_prefs�s
cK@s�t|t�r"td|�}n|r8t||�ntjdj|d�d|dt|�dt|�d|j	dd	��}|j
d
kr�|j�n|j�S(u$
    Update the organization preferences.

    orgname
        Name of the organization in which users are updated.

    theme
        Selected theme for the org.

    homeDashboardId
        Home dashboard for the org.

    timezone
        Timezone for the org (one of: "browser", "utc", or "").

    profile
        Configuration profile used to connect to the Grafana instance.
        Default is 'grafana'.

    CLI Example:

    .. code-block:: bash

        salt '*' grafana4.update_org_prefs <orgname> theme=<theme> timezone=<timezone>
    u
config.optionu{0}/api/org/preferencesugrafana_urlRRRRugrafana_timeoutii�(
RRRR1RR#RRRR	RRR(R/R
R!R((s9/usr/lib/python2.7/site-packages/salt/modules/grafana4.pytupdate_org_prefs�s
cK@s�t|t�r"td|�}ntjdj|d�d|dt|�dt|�d|jdd	��}|j	d
kr�|j
�n|j�S(u
    Create a new organization.

    name
        Name of the organization.

    profile
        Configuration profile used to connect to the Grafana instance.
        Default is 'grafana'.

    CLI Example:

    .. code-block:: bash

        salt '*' grafana4.create_org <name>
    u
config.optionu{0}/api/orgsugrafana_urlRRRRugrafana_timeoutii�(RRRRR RRRR	RRR(R
R!R((s9/usr/lib/python2.7/site-packages/salt/modules/grafana4.pyt
create_orgs
cK@s�t|t�r"td|�}ntjdj|d|�d|dt|�dt|�d|jdd	��}|j	d
kr�|j
�n|j�S(u^
    Update an existing organization.

    orgid
        Id of the organization.

    name
        New name of the organization.

    profile
        Configuration profile used to connect to the Grafana instance.
        Default is 'grafana'.

    CLI Example:

    .. code-block:: bash

        salt '*' grafana4.update_org <org_id> name=<name>
    u
config.optionu{0}/api/orgs/{1}ugrafana_urlRRRRugrafana_timeoutii�(RRRRR#RRRR	RRR(R*R
R!R((s9/usr/lib/python2.7/site-packages/salt/modules/grafana4.pyt
update_org6s
c
C@s�t|t�r"td|�}ntjdj|d|�dt|�dt|�d|jdd��}|j	d	kr�|j
�n|j�S(
u
    Delete an organization.

    orgid
        Id of the organization.

    profile
        Configuration profile used to connect to the Grafana instance.
        Default is 'grafana'.

    CLI Example:

    .. code-block:: bash

        salt '*' grafana4.delete_org <org_id>
    u
config.optionu{0}/api/orgs/{1}ugrafana_urlRRRugrafana_timeoutii�(RRRRR'RRRR	RRR(R*R
R((s9/usr/lib/python2.7/site-packages/salt/modules/grafana4.pyt
delete_orgXs
c
C@s�t|t�r"td|�}n|r8t||�ntjdj|d�dt|�dt|�d|jdd��}|j	d	kr�|j
�n|j�S(
u4
    List all datasources in an organisation.

    orgname
        Name of the organization.

    profile
        Configuration profile used to connect to the Grafana instance.
        Default is 'grafana'.

    CLI Example:

    .. code-block:: bash

        salt '*' grafana4.get_datasources <orgname>
    u
config.optionu{0}/api/datasourcesugrafana_urlRRRugrafana_timeoutii�(RRRR1RR	RRRRRR(R/R
R((s9/usr/lib/python2.7/site-packages/salt/modules/grafana4.pytget_datasourcesvs
cC@s>td|d|�}x"|D]}|d|kr|SqWdS(uh
    Show a single datasource in an organisation.

    name
        Name of the datasource.

    orgname
        Name of the organization.

    profile
        Configuration profile used to connect to the Grafana instance.
        Default is 'grafana'.

    CLI Example:

    .. code-block:: bash

        salt '*' grafana4.get_datasource <name> <orgname>
    R/R
unameN(R>R
(R-R/R
Rt
datasource((s9/usr/lib/python2.7/site-packages/salt/modules/grafana4.pytget_datasource�s

cK@s�t|t�r"td|�}n|r8t||�ntjdj|d�d|dt|�dt|�d|j	dd	��}|j
d
kr�|j�n|j�S(ub
    Create a new datasource in an organisation.

    name
        Name of the data source.

    type
        Type of the datasource ('graphite', 'influxdb' etc.).

    access
        Use proxy or direct.

    url
        The URL to the data source API.

    user
        Optional - user to authenticate with the data source.

    password
        Optional - password to authenticate with the data source.

    database
        Optional - database to use with the data source.

    basicAuth
        Optional - set to True to use HTTP basic auth to authenticate with the
        data source.

    basicAuthUser
        Optional - HTTP basic auth username.

    basicAuthPassword
        Optional - HTTP basic auth password.

    jsonData
        Optional - additional json data to post (eg. "timeInterval").

    isDefault
        Optional - set data source as default.

    withCredentials
        Optional - Whether credentials such as cookies or auth headers should
        be sent with cross-site requests.

    typeLogoUrl
        Optional - Logo to use for this datasource.

    orgname
        Name of the organization in which the data source should be created.

    profile
        Configuration profile used to connect to the Grafana instance.
        Default is 'grafana'.

    CLI Example:

    .. code-block:: bash

        salt '*' grafana4.create_datasource

    u
config.optionu{0}/api/datasourcesugrafana_urlRRRRugrafana_timeoutii�(
RRRR1RR RRRR	RRR(R/R
R!R((s9/usr/lib/python2.7/site-packages/salt/modules/grafana4.pytcreate_datasource�s>
cK@s�t|t�r"td|�}ntjdj|d|�d|dt|�dt|�d|jdd	��}|j	d
kr�|j
�niS(u0
    Update a datasource.

    datasourceid
        Id of the datasource.

    name
        Name of the data source.

    type
        Type of the datasource ('graphite', 'influxdb' etc.).

    access
        Use proxy or direct.

    url
        The URL to the data source API.

    user
        Optional - user to authenticate with the data source.

    password
        Optional - password to authenticate with the data source.

    database
        Optional - database to use with the data source.

    basicAuth
        Optional - set to True to use HTTP basic auth to authenticate with the
        data source.

    basicAuthUser
        Optional - HTTP basic auth username.

    basicAuthPassword
        Optional - HTTP basic auth password.

    jsonData
        Optional - additional json data to post (eg. "timeInterval").

    isDefault
        Optional - set data source as default.

    withCredentials
        Optional - Whether credentials such as cookies or auth headers should
        be sent with cross-site requests.

    typeLogoUrl
        Optional - Logo to use for this datasource.

    profile
        Configuration profile used to connect to the Grafana instance.
        Default is 'grafana'.

    CLI Example:

    .. code-block:: bash

        salt '*' grafana4.update_datasource <datasourceid>

    u
config.optionu{0}/api/datasources/{1}ugrafana_urlRRRRugrafana_timeoutii�(RRRRR#RRRR	RR(tdatasourceidR/R
R!R((s9/usr/lib/python2.7/site-packages/salt/modules/grafana4.pytupdate_datasource�s>
c
C@s�t|t�r"td|�}ntjdj|d|�dt|�dt|�d|jdd��}|j	d	kr�|j
�n|j�S(
u)
    Delete a datasource.

    datasourceid
        Id of the datasource.

    profile
        Configuration profile used to connect to the Grafana instance.
        Default is 'grafana'.

    CLI Example:

    .. code-block:: bash

        salt '*' grafana4.delete_datasource <datasource_id>
    u
config.optionu{0}/api/datasources/{1}ugrafana_urlRRRugrafana_timeoutii�(RRRRR'RRRR	RRR(RBR/R
R((s9/usr/lib/python2.7/site-packages/salt/modules/grafana4.pytdelete_datasourceMs
c
C@s�t|t�r"td|�}n|r8t||�ntjdj|d|�dt|�dt|�d|jdd��}|j	�}|j
d	kr�dS|j
d
kr�|j�n|jd�S(
uG
    Get a dashboard.

    slug
        Slug (name) of the dashboard.

    orgname
        Name of the organization.

    profile
        Configuration profile used to connect to the Grafana instance.
        Default is 'grafana'.

    CLI Example:

    .. code-block:: bash

        salt '*' grafana4.get_dashboard <slug>
    u
config.optionu{0}/api/dashboards/db/{1}ugrafana_urlRRRugrafana_timeoutii�i�u	dashboardN(
RRRR1RR	RRRRRR
R(tslugR/R
RR((s9/usr/lib/python2.7/site-packages/salt/modules/grafana4.pyt
get_dashboardks
c
C@s�t|t�r"td|�}n|r8t||�ntjdj|d|�dt|�dt|�d|j	dd��}|j
d	kr�|j�n|j�S(
uM
    Delete a dashboard.

    slug
        Slug (name) of the dashboard.

    orgname
        Name of the organization.

    profile
        Configuration profile used to connect to the Grafana instance.
        Default is 'grafana'.

    CLI Example:

    .. code-block:: bash

        salt '*' grafana4.delete_dashboard <slug>
    u
config.optionu{0}/api/dashboards/db/{1}ugrafana_urlRRRugrafana_timeoutii�(
RRRR1RR'RRRR	RRR(RER/R
R((s9/usr/lib/python2.7/site-packages/salt/modules/grafana4.pytdelete_dashboard�s
cK@s�t|t�r"td|�}n|r8t||�ntjdj|jd��d|dt|�dt	|�d|jdd	��}|j
d
kr�|j�n|j�S(u
    Create or update a dashboard.

    dashboard
        A dict that defines the dashboard to create/update.

    overwrite
        Whether the dashboard should be overwritten if already existing.

    orgname
        Name of the organization.

    profile
        Configuration profile used to connect to the Grafana instance.
        Default is 'grafana'.

    CLI Example:

    .. code-block:: bash

        salt '*' grafana4.create_update_dashboard dashboard=<dashboard> overwrite=True orgname=<orgname>
    u
config.optionu{0}/api/dashboards/dbugrafana_urlRRRRugrafana_timeoutii�(
RRRR1RR RR	RRRRR(R/R
R!R((s9/usr/lib/python2.7/site-packages/salt/modules/grafana4.pytcreate_update_dashboard�s
(1t__doc__t
__future__RRRRtTrueRtImportErrorRtsalt.ext.sixRRRRRRRRR"R$R%R&R(R)R+R,R.R1R
R2R3R5R6R7R8R9R:R;R<R=R>R@RARCRDRFRGRH(((s9/usr/lib/python2.7/site-packages/salt/modules/grafana4.pyt<module>sV


				((##" +.# 3 *" NN&#

Zerion Mini Shell 1.0