def create(self):
self.parser.add_argument('--name', help='Name of the dashboard', required=True)
self.parser.add_argument('--metrics-list', nargs='+')#help='List of \
# metrics to be displayed on the dashboard',
# required=True)
self.parser.add_argument('--names-list', help='Names list of \
units to plot in dashboard')
self.parser.add_argument('--search-string', help='Search String')
self.parser.add_argument('--search-type', help='Search String')
self.parser.add_argument('--unit-type', help='Type of unit, valid value is docker')
self.parser.add_argument('--exclude', help='Search excluding search string', required=False)
args = self.parser.parse_args()
if not (args.names_list or (args.search_string and args.search_type)):
self.parser.error('add --names-list or (--search-string and --search-type)')
json_data = client.create_request_data(**vars(args))
print json_data
galaxia_api_endpoint = os.getenv("galaxia_api_endpoint")
target_url = client.concatenate_url(galaxia_api_endpoint, self.url)
try:
resp = client.http_request('PUT', target_url, self.headers, json_data)
print resp.text
except Exception as ex:
pass
评论列表
文章目录