Merge "Remove query variable refresh deprecation"
This commit is contained in:
commit
5b98241e36
@ -23,18 +23,13 @@ LOG = logging.getLogger(__name__)
|
||||
|
||||
class Query(Base):
|
||||
|
||||
def validate_refresh(self, data):
|
||||
v.Schema(v.Any(v.All(int, v.Range(min=0, max=2)), bool))(data)
|
||||
if isinstance(data, bool):
|
||||
LOG.warn('templating query refresh type bool is deprecated')
|
||||
return data
|
||||
|
||||
def get_schema(self):
|
||||
query = {
|
||||
v.Required('includeAll', default=False): v.All(bool),
|
||||
v.Required('multi', default=False): v.All(bool),
|
||||
v.Required('query', default=''): v.All(str),
|
||||
v.Required('refresh', default=0): self.validate_refresh,
|
||||
v.Required('refresh', default=1): \
|
||||
v.All(int, v.Range(min=0, max=2)),
|
||||
v.Optional('datasource'): v.All(str),
|
||||
v.Optional('hide'): v.All(int, v.Range(min=0, max=2)),
|
||||
}
|
||||
|
@ -10,7 +10,7 @@
|
||||
"multi": false,
|
||||
"name": "foobar",
|
||||
"query": "foobar.*",
|
||||
"refresh": 0,
|
||||
"refresh": 1,
|
||||
"type": "query"
|
||||
}
|
||||
]
|
||||
|
@ -45,7 +45,7 @@
|
||||
"multi": false,
|
||||
"name": "hostname",
|
||||
"query": "node*",
|
||||
"refresh": true,
|
||||
"refresh": 1,
|
||||
"type": "query"
|
||||
}
|
||||
]
|
||||
|
@ -7,7 +7,7 @@ dashboard:
|
||||
type: query
|
||||
datasource: graphite
|
||||
query: node*
|
||||
refresh: true
|
||||
refresh: 1
|
||||
title: New dashboard
|
||||
rows:
|
||||
- title: New row
|
||||
|
@ -59,7 +59,7 @@
|
||||
"multi": false,
|
||||
"name": "hostname",
|
||||
"query": "node*",
|
||||
"refresh": true,
|
||||
"refresh": 1,
|
||||
"type": "query"
|
||||
}
|
||||
]
|
||||
|
@ -4,7 +4,7 @@ dashboard:
|
||||
type: query
|
||||
datasource: graphite
|
||||
query: node*
|
||||
refresh: true
|
||||
refresh: 1
|
||||
hide: 0
|
||||
title: New dashboard
|
||||
rows:
|
||||
|
Loading…
Reference in New Issue
Block a user