コード例 #1
0
    def update(self):
        self.parser.add_argument('--name', help='Name of the dashboard',
                                 required=True)
        self.parser.add_argument('--metrics-list', 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))
        galaxia_api_endpoint = os.getenv("galaxia_api_endpoint")
        target_url = client.concatenate_url(galaxia_api_endpoint, self.url)
        try:
            resp = client.http_request('POST', target_url, self.headers,
                                       json_data)
            print resp.text
        except Exception as ex:
            pass
コード例 #2
0
ファイル: galaxia.py プロジェクト: aravindkpv/galaxia
    def update(self):
        self.parser.add_argument('--name',
                                 help='Name of the dashboard',
                                 required=True)
        self.parser.add_argument('--metrics-list',
                                 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))
        galaxia_api_endpoint = os.getenv("galaxia_api_endpoint")
        target_url = client.concatenate_url(galaxia_api_endpoint, self.url)
        try:
            resp = client.http_request('POST', target_url, self.headers,
                                       json_data)
            print resp.text
        except Exception as ex:
            pass
コード例 #3
0
ファイル: galaxia.py プロジェクト: aravindkpv/galaxia
    def create(self):
        self.parser.add_argument('--source-system',
                                 help='Source system',
                                 required=True)
        self.parser.add_argument('--target-system',
                                 help='Target system',
                                 required=True)
        self.parser.add_argument('--metrics-list',
                                 help='List of metrics to\
                                                        export',
                                 required=True)
        self.parser.add_argument('--time-interval',
                                 help='Time interval\
                                        in which to push metrics to target\
                                                         system',
                                 required=True)
        self.parser.add_argument('--unit-type',
                                 help='Type of unit valid value\
                                                     is docker',
                                 required=True)
        self.parser.add_argument('--exporter-name',
                                 help='Unique Name for\
                                                    exporter',
                                 required=True)

        args = self.parser.parse_args()
        json_data = client.create_request_data(**vars(args))
        galaxia_api_endpoint = os.getenv("galaxia_api_endpoint")
        target_url = client.concatenate_url(galaxia_api_endpoint,
                                            self.exporter_uri)
        resp = client.http_request('POST', target_url, self.headers, json_data)
        print resp.text
コード例 #4
0
 def delete(self):
     self.parser.add_argument('--name', help='Name of the dashboard',
                              required=True)
     args = self.parser.parse_args()
     json_data = client.create_request_data(**vars(args))
     galaxia_api_endpoint = os.getenv("galaxia_api_endpoint")
     target_url = client.concatenate_url(galaxia_api_endpoint, self.url)
     try:
         resp = client.http_request('DELETE', target_url, self.headers,
                                    json_data)
         print resp.text
     except Exception as ex:
         pass
コード例 #5
0
ファイル: galaxia.py プロジェクト: KenzK/galaxia
 def delete(self):
     self.parser.add_argument('--name', help='Name of the dashboard',
                              required=True)
     args = self.parser.parse_args()
     json_data = client.create_request_data(**vars(args))
     galaxia_api_endpoint = os.getenv("galaxia_api_endpoint")
     target_url = client.concatenate_url(galaxia_api_endpoint, self.url)
     try:
         resp = client.http_request('DELETE', target_url, self.headers,
                                    json_data)
         print resp.text
     except Exception as ex:
         pass
コード例 #6
0
    def create(self):
        self.parser.add_argument('--source-system', help='Source system',
                                 required=True)
        self.parser.add_argument('--target-system', help='Target system',
                                 required=True)
        self.parser.add_argument('--metrics-list', help='List of metrics to\
                                                        export', required=True)
        self.parser.add_argument('--time-interval', help='Time interval\
                                        in which to push metrics to target\
                                                         system', required=True)
        self.parser.add_argument('--unit-type', help='Type of unit valid value\
                                                     is docker', required=True)
        self.parser.add_argument('--exporter-name', help='Unique Name for\
                                                    exporter', required=True)

        args = self.parser.parse_args()
        json_data = client.create_request_data(**vars(args))
        galaxia_api_endpoint = os.getenv("galaxia_api_endpoint")
        target_url = client.concatenate_url(galaxia_api_endpoint,
                                            self.exporter_uri)
        resp = client.http_request('POST', target_url, self.headers,
                                   json_data)
        print resp.text