galaxia.py 文件源码

python
阅读 39 收藏 0 点赞 0 评论 0

项目:galaxia 作者: WiproOpenSourcePractice 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号