moira-python-client 4.3.1__py3-none-any.whl → 4.3.2__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.
moira_client/client.py CHANGED
@@ -68,7 +68,7 @@ class Client:
68
68
  :param kwargs: additional parameters for request
69
69
  :return: dict response
70
70
 
71
- :raises: HTTPError
71
+ :raises: MoiraApiError
72
72
  :raises: InvalidJSONError
73
73
  """
74
74
  r = requests.get(self._path_join(path), headers=self.headers, auth=self.auth, **kwargs)
@@ -90,7 +90,7 @@ class Client:
90
90
  :param kwargs: additional parameters for request
91
91
  :return: dict response
92
92
 
93
- :raises: HTTPError
93
+ :raises: MoiraApiError
94
94
  :raises: InvalidJSONError
95
95
  """
96
96
  r = requests.delete(self._path_join(path), headers=self.headers, auth=self.auth, **kwargs)
@@ -112,7 +112,7 @@ class Client:
112
112
  :param kwargs: additional parameters for request
113
113
  :return: dict response
114
114
 
115
- :raises: HTTPError
115
+ :raises: MoiraApiError
116
116
  :raises: InvalidJSONError
117
117
  """
118
118
  r = requests.put(self._path_join(path), headers=self.headers, auth=self.auth, **kwargs)
@@ -127,6 +127,28 @@ class Client:
127
127
  except ValueError:
128
128
  raise InvalidJSONError(r.content)
129
129
 
130
+ def patch(self, path='', **kwargs):
131
+ """
132
+
133
+ :param path: str api path
134
+ :param kwargs: additional parameters for request
135
+ :return: dict response
136
+
137
+ :raises: MoiraApiError
138
+ :raises: InvalidJSONError
139
+ """
140
+ r = requests.patch(self._path_join(path), headers=self.headers, auth=self.auth, **kwargs)
141
+
142
+ try:
143
+ r.raise_for_status()
144
+ except requests.exceptions.HTTPError as err:
145
+ raise MoiraApiError(r.content)
146
+
147
+ try:
148
+ return r.json()
149
+ except ValueError:
150
+ raise InvalidJSONError(r.content)
151
+
130
152
  def post(self, path='', **kwargs):
131
153
  """
132
154
 
@@ -134,7 +156,7 @@ class Client:
134
156
  :param kwargs: additional parameters for request
135
157
  :return: dict response
136
158
 
137
- :raises: HTTPError
159
+ :raises: MoiraApiError
138
160
  :raises: InvalidJSONError
139
161
  """
140
162
  r = requests.post(self._path_join(path), headers=self.headers, auth=self.auth, **kwargs)
@@ -52,7 +52,7 @@ class TeamManager:
52
52
  "description": team.description,
53
53
  }
54
54
 
55
- response = self._client.put(self._full_path(team_id), json=payload)
55
+ response = self._client.patch(self._full_path(team_id), json=payload)
56
56
 
57
57
  return SaveTeamResponse(**response)
58
58
 
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: moira-python-client
3
- Version: 4.3.1
3
+ Version: 4.3.2
4
4
  Summary: Client for Moira - Alerting system based on Graphite data
5
5
  Home-page: https://github.com/moira-alert/python-moira-client
6
6
  Author: Alexander Lukyanchenko
@@ -19,7 +19,15 @@ Classifier: Topic :: Utilities
19
19
  Classifier: Topic :: System :: Monitoring
20
20
  Classifier: License :: OSI Approved :: MIT License
21
21
  License-File: LICENSE
22
- Requires-Dist: requests >=2.4.3
22
+ Requires-Dist: requests>=2.4.3
23
+ Dynamic: author
24
+ Dynamic: author-email
25
+ Dynamic: classifier
26
+ Dynamic: description
27
+ Dynamic: home-page
28
+ Dynamic: keywords
29
+ Dynamic: requires-dist
30
+ Dynamic: summary
23
31
 
24
32
 
25
33
  Moira is a real-time alerting tool, based on Graphite data.
@@ -1,5 +1,5 @@
1
1
  moira_client/__init__.py,sha256=BUWUwGU1V5wvdi5-mUXd8AJlsGyrAvFKOjs8-vkUV4o,67
2
- moira_client/client.py,sha256=SGakaO2SB2EjsZPlfD1Dv2naIgwBr5F5QufYKm-Ro1w,4106
2
+ moira_client/client.py,sha256=JuEVNgEeiROuV46FPLVW7Vp4_gpcVUcRBQv9ecxmDJA,4732
3
3
  moira_client/moira.py,sha256=Pa3grEVhGu2gcPxWR8sdu7GGowNF3AXBYvK1nmRiZi8,3859
4
4
  moira_client/models/__init__.py,sha256=K3Kcjh8F_jV703ii-QMeN9cMwqcCfbfeNF7e9MfCD1c,126
5
5
  moira_client/models/base.py,sha256=cYVLxnc5PGjmUcoZRZ7AFx5f0Ij96HypJpOjpwr_D-Q,385
@@ -14,7 +14,7 @@ moira_client/models/tag.py,sha256=2sDmf9CKAzzZRqQykBdR3-jKgcfo62hGO7eivI1X_sc,43
14
14
  moira_client/models/trigger.py,sha256=61Gs4blN0pcPrCEnOzpaKkA_UgeChz3Kv2qV-zXySYE,17868
15
15
  moira_client/models/user.py,sha256=9zG7pbmEA9ESUWFMzvqfyLP0lqcjz1pc0n8U7mL1UMk,1767
16
16
  moira_client/models/team/__init__.py,sha256=hPeciH0IcuSdo3jY7EMyYaG85faZky4VvU9BsGDpZiY,118
17
- moira_client/models/team/_managers.py,sha256=plbYKrocnD7ae4E8K7_RtPeRjn2JXQcQaKVULw5jwIA,2991
17
+ moira_client/models/team/_managers.py,sha256=LJcXKK42hxoMIi-dw5P_Nhl098wa0VVWinAGoTHGqQ0,2993
18
18
  moira_client/models/team/_models.py,sha256=swwR1g7ZlxoV_wbmbEW_ADqnnaZXJLb5fyH8utptEx0,438
19
19
  moira_client/models/team/contact/__init__.py,sha256=JyUCAhv_KmTjzPz1Ej38uJdzcDvFFguemc1ZjpRs6fk,83
20
20
  moira_client/models/team/contact/_managers.py,sha256=zOEL4vXnUsD76I3I4aYa9dyeqIVvlIGKN2LBu8MhOaU,679
@@ -26,8 +26,8 @@ moira_client/models/team/subscription/_managers.py,sha256=lMWyWc8jibQcjLOBAXTKtC
26
26
  moira_client/models/team/user/__init__.py,sha256=XDgaELIXAcD8l0SBVjQ8OSaSknMd1qGJ_dRmT0VxyVI,129
27
27
  moira_client/models/team/user/_managers.py,sha256=9AeMrMVjek7hsHS9mGNeX9RaK6UCV5JU6GlFDouI_b0,1458
28
28
  moira_client/models/team/user/_models.py,sha256=E90MLjV4Xtbypy_LXatzJdmCy1MUs8NZfs0RlRneUsI,134
29
- moira_python_client-4.3.1.dist-info/LICENSE,sha256=HJk93uYDrJpwAa6G3ufYfC4ZgCKH2flOtdgOv1esxgI,1062
30
- moira_python_client-4.3.1.dist-info/METADATA,sha256=k58zTJCXroosf0-24sD2c6ezDI-q-dgTbuuUe_UXEJ0,1243
31
- moira_python_client-4.3.1.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
32
- moira_python_client-4.3.1.dist-info/top_level.txt,sha256=zBB6_FP28feugBNn2cLmi5nCniRPnuChI6HuXUqFdIA,13
33
- moira_python_client-4.3.1.dist-info/RECORD,,
29
+ moira_python_client-4.3.2.dist-info/LICENSE,sha256=HJk93uYDrJpwAa6G3ufYfC4ZgCKH2flOtdgOv1esxgI,1062
30
+ moira_python_client-4.3.2.dist-info/METADATA,sha256=BvkpIW3TvZ5mJnvu33QDryVIM0ECdmStbuRMS_UruNk,1398
31
+ moira_python_client-4.3.2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
32
+ moira_python_client-4.3.2.dist-info/top_level.txt,sha256=zBB6_FP28feugBNn2cLmi5nCniRPnuChI6HuXUqFdIA,13
33
+ moira_python_client-4.3.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.1.0)
2
+ Generator: setuptools (75.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5