python-observabilityclient 0.2.0__py3-none-any.whl → 0.3.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,7 +15,6 @@
15
15
  import logging
16
16
 
17
17
  import requests
18
- import simplejson
19
18
 
20
19
 
21
20
  LOG = logging.getLogger(__name__)
@@ -32,7 +31,7 @@ class PrometheusAPIClientError(Exception):
32
31
  decoded = self.resp.json()
33
32
  if 'error' in decoded:
34
33
  return f'[{self.resp.status_code}] {decoded["error"]}'
35
- except simplejson.errors.JSONDecodeError:
34
+ except requests.JSONDecodeError:
36
35
  # If an https endpoint is accessed as http,
37
36
  # we get 400 status with plain text instead of
38
37
  # json and decoding it raises exception.
@@ -43,15 +42,7 @@ class PrometheusAPIClientError(Exception):
43
42
  return f'[{decoded.status}]'
44
43
 
45
44
  def __repr__(self) -> str:
46
- if self.resp.status_code != requests.codes.ok:
47
- if self.resp.status_code != 204:
48
- decoded = self.resp.json()
49
- if 'error' in decoded:
50
- return f'[{self.resp.status_code}] {decoded["error"]}'
51
- return f'[{self.resp.status_code}] {self.resp.reason}'
52
- else:
53
- decoded = self.resp.json()
54
- return f'[{decoded.status}]'
45
+ return self.__str__()
55
46
 
56
47
 
57
48
  class PrometheusMetric(object):
@@ -23,17 +23,6 @@ class ObservabilityBaseCommand(command.Command):
23
23
 
24
24
  def get_parser(self, prog_name):
25
25
  parser = super().get_parser(prog_name)
26
- parser.add_argument(
27
- '--dev',
28
- action='store_true',
29
- help=_("Enable development output.")
30
- )
31
- parser.add_argument(
32
- '--messy',
33
- action='store_true',
34
- help=_("Disable cleanup of temporary files.")
35
- )
36
-
37
26
  # TODO(jwysogla): Should this be restricted somehow?
38
27
  parser.add_argument(
39
28
  '--disable-rbac',
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-observabilityclient
3
- Version: 0.2.0
3
+ Version: 0.3.0
4
4
  Summary: OpenStack Observability Client
5
5
  Home-page: https://infrawatch.github.io/documentation/
6
6
  Author: OpenStack
@@ -27,14 +27,9 @@ Description-Content-Type: text/markdown; charset=UTF-8
27
27
  Requires-Dist: cliff (>=1.14.0)
28
28
  Requires-Dist: keystoneauth1 (>=1.0.0)
29
29
  Requires-Dist: osc-lib (>=1.0.1)
30
+ Provides-Extra: doc
31
+ Requires-Dist: reno (>=1.6.2) ; extra == 'doc'
30
32
  Provides-Extra: test
31
- Requires-Dist: SQLAlchemy (<=1.4.41) ; extra == 'test'
32
- Requires-Dist: coverage (>=3.6) ; extra == 'test'
33
- Requires-Dist: oslo.db (<=12.3.1) ; extra == 'test'
34
- Requires-Dist: oslotest (>=1.10.0) ; extra == 'test'
35
- Requires-Dist: pifpaf[gnocchi] (>=0.23) ; extra == 'test'
36
- Requires-Dist: reno (>=1.6.2) ; extra == 'test'
37
- Requires-Dist: stestr (>=2.0.0) ; extra == 'test'
38
33
  Requires-Dist: tempest (>=10) ; extra == 'test'
39
34
  Requires-Dist: testtools (>=1.4.0) ; extra == 'test'
40
35
 
@@ -2,7 +2,7 @@ observabilityclient/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSu
2
2
  observabilityclient/client.py,sha256=cfRb816p6Ips9t2cdWvmSJ1uGrtTEHXQnctoExrLA5A,828
3
3
  observabilityclient/i18n.py,sha256=PFo6BaOfyGQD5q7L3FunYJ8d4mwbRszG8wOrJIjki_4,790
4
4
  observabilityclient/plugin.py,sha256=hyxENjNO6NLrH6G4muyAeEEtFTBa9d5OozjwpzNpJVA,2262
5
- observabilityclient/prometheus_client.py,sha256=iVylMmgSDwBXuuGQjkixwrcfsHiS5NqEYrMB57R2pyQ,7467
5
+ observabilityclient/prometheus_client.py,sha256=NcZAJRZzcuNFVJGdROwZBdwzpaV98_Ywcw29QBf7g18,7052
6
6
  observabilityclient/tests/functional/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  observabilityclient/tests/functional/base.py,sha256=SXbPiksFH7aER-zZjIWxz5nwCqq5f1MYWth1tlFLwcs,6523
8
8
  observabilityclient/tests/functional/test_cli.py,sha256=QqU8BCGUnh4IlwnGr6hdDHjHp7TIM0jasDjReyZpz-Y,4856
@@ -16,16 +16,16 @@ observabilityclient/tests/unit/test_utils.py,sha256=-sYsiYTuvcb71SX2KewrxkPinMEG
16
16
  observabilityclient/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  observabilityclient/utils/metric_utils.py,sha256=K_G23krVIENNSPNsj2w9AkmCk2MDum9K3DkWNQl3Bro,3425
18
18
  observabilityclient/v1/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
- observabilityclient/v1/base.py,sha256=g7r0GrtbUR6BDWPPvTRL1pF0hZbcq1evYQTeXqlI7X8,2556
19
+ observabilityclient/v1/base.py,sha256=2AMQU8WKbERvfoiRdOPIlogzH1ds_Son4Gr7fjGdGQ4,2260
20
20
  observabilityclient/v1/cli.py,sha256=ln7GsnbW95n90oFGw4zLiwHDjY0YHBxkRBzID-j6ZmA,4028
21
21
  observabilityclient/v1/client.py,sha256=q5bH-N9uCWi9boVVYhLv6M7NYLxMnmgGBupg2uqvgRo,1643
22
22
  observabilityclient/v1/python_api.py,sha256=nTsaasNBMVNrGW5CNSf7-o2oOKsea_u38GEbs2-8Gkw,3916
23
23
  observabilityclient/v1/rbac.py,sha256=cnscaSzcbY7AEcLHcjpXBeHHZ12k5-hYmVwXsMTBSjQ,6115
24
- python_observabilityclient-0.2.0.dist-info/AUTHORS,sha256=BVS3DtpzGMTE2D4RpV_lVctcBfQHGK5G1yWrNcrI1hI,393
25
- python_observabilityclient-0.2.0.dist-info/LICENSE,sha256=qyh9xnj_IPtYWzClm5mZxCWRKTr2eUP_iLcU28DIvCw,11343
26
- python_observabilityclient-0.2.0.dist-info/METADATA,sha256=R4cRUoo7LAdA-Cp09cE_jK8yQx6EhAZnaPSjAMoOu4g,3440
27
- python_observabilityclient-0.2.0.dist-info/WHEEL,sha256=g4nMs7d-Xl9-xC9XovUrsDHGXt-FT0E17Yqo92DEfvY,92
28
- python_observabilityclient-0.2.0.dist-info/entry_points.txt,sha256=KVIgt6aQmLXBvbWakAMnBATcmYAd4U99I6UOyYpWD2c,425
29
- python_observabilityclient-0.2.0.dist-info/pbr.json,sha256=WS-7Hx84xzfqmQFMjGB5pTZKhFjhExgXQNhl-drJCAg,46
30
- python_observabilityclient-0.2.0.dist-info/top_level.txt,sha256=Lf7Fwm3hfK-X1JNRy19rVlrMUOyQShBBPwsCU3pz6yw,20
31
- python_observabilityclient-0.2.0.dist-info/RECORD,,
24
+ python_observabilityclient-0.3.0.dist-info/AUTHORS,sha256=BVS3DtpzGMTE2D4RpV_lVctcBfQHGK5G1yWrNcrI1hI,393
25
+ python_observabilityclient-0.3.0.dist-info/LICENSE,sha256=qyh9xnj_IPtYWzClm5mZxCWRKTr2eUP_iLcU28DIvCw,11343
26
+ python_observabilityclient-0.3.0.dist-info/METADATA,sha256=azqNTePrCEYxz8hgCJcy20HeqttqGBN-S5UStKBzt4A,3141
27
+ python_observabilityclient-0.3.0.dist-info/WHEEL,sha256=g4nMs7d-Xl9-xC9XovUrsDHGXt-FT0E17Yqo92DEfvY,92
28
+ python_observabilityclient-0.3.0.dist-info/entry_points.txt,sha256=KVIgt6aQmLXBvbWakAMnBATcmYAd4U99I6UOyYpWD2c,425
29
+ python_observabilityclient-0.3.0.dist-info/pbr.json,sha256=Nv5qWRdvkbJYBqsr_kIco4eu0YKVn4a7uHn6kRRNjUc,46
30
+ python_observabilityclient-0.3.0.dist-info/top_level.txt,sha256=Lf7Fwm3hfK-X1JNRy19rVlrMUOyQShBBPwsCU3pz6yw,20
31
+ python_observabilityclient-0.3.0.dist-info/RECORD,,
@@ -0,0 +1 @@
1
+ {"git_version": "e64b943", "is_release": true}
@@ -1 +0,0 @@
1
- {"git_version": "0dea42c", "is_release": true}