galaxia.py 文件源码

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

项目:galaxia 作者: WiproOpenSourcePractice 项目源码 文件源码
def sample(self):
        resp = None
        self.parser.add_argument('--type', help="Type of unit valid values are\
                                containers, nodes", required=True)
        self.parser.add_argument('--search-string', help='Search String', required=False)
        self.parser.add_argument('--search-type', help='Search String', required=False)
        self.parser.add_argument('--meter-name', help='Name of the meter', required=True)
        args = self.parser.parse_args()
        data = {"type": vars(args)['type'], "search_string": vars(args)['search_string'],
                "search_type": vars(args)['search_type'] , "meter_name": vars(args)['meter_name']}
        galaxia_api_endpoint = os.getenv("galaxia_api_endpoint")
        target_url = client.concatenate_url(galaxia_api_endpoint, self.sample_uri)
        try:
            resp = client.http_request('GET', target_url, self.headers, data)
            headers = ["NAME", "VALUE"]
            print "Current "+ vars(args)['meter_name']
            #print "Current "+unit_type
            format_print.format_dict(resp.json(), headers)
        except Exception as ex:
            pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号