Skip to content

Commit a4c5746

Browse files
authored
chore: update to the latest swagger API (#588)
1 parent 0be41d1 commit a4c5746

File tree

97 files changed

+2244
-1519
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+2244
-1519
lines changed

CHANGELOG.md

+11
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,20 @@ async with InfluxDBClientAsync(url="http://localhost:8086", token="my-token", or
1212
client_session_kwargs={'trust_env': True}) as client:
1313
pass
1414
```
15+
16+
This release introduces a support for new version of InfluxDB API definitions with following breaking changes:
17+
18+
- `User`, `UserResponse`, `ResourceMember` and `ResourceOwner` classes no longer supports `oauth_id` field
19+
- `Task` class no longer supports `type` field
20+
- `ScriptUpdateRequest` class no longer supports `name` field
21+
- `UsersService.get_flags` operation is moved to `ConfigService`
22+
1523
### Features
1624
1. [#586](https://github.com/influxdata/influxdb-client-python/pull/586): Add `config_name` key argument for ``from_config_file`` function to allow loading a specific configuration from a config file
1725

26+
### API
27+
1. [#588](https://github.com/influxdata/influxdb-client-python/pull/588): Use the latest InfluxDB API definitions for generated APIs
28+
1829
### Bug Fixes
1930
1. [#583](https://github.com/influxdata/influxdb-client-python/pull/583): Async HTTP client doesn't always use `HTTP_PROXY`/`HTTPS_PROXY` environment variables. [async/await]
2031
1. [#584](https://github.com/influxdata/influxdb-client-python/pull/584): Parsing empty query result value as `numpy.NaN`

influxdb_client/domain/add_resource_member_request_body.py

+8
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ def __init__(self, id=None, name=None): # noqa: E501,D401,D403
5353
def id(self):
5454
"""Get the id of this AddResourceMemberRequestBody.
5555
56+
The ID of the user to add to the resource.
57+
5658
:return: The id of this AddResourceMemberRequestBody.
5759
:rtype: str
5860
""" # noqa: E501
@@ -62,6 +64,8 @@ def id(self):
6264
def id(self, id):
6365
"""Set the id of this AddResourceMemberRequestBody.
6466
67+
The ID of the user to add to the resource.
68+
6569
:param id: The id of this AddResourceMemberRequestBody.
6670
:type: str
6771
""" # noqa: E501
@@ -73,6 +77,8 @@ def id(self, id):
7377
def name(self):
7478
"""Get the name of this AddResourceMemberRequestBody.
7579
80+
The name of the user to add to the resource.
81+
7682
:return: The name of this AddResourceMemberRequestBody.
7783
:rtype: str
7884
""" # noqa: E501
@@ -82,6 +88,8 @@ def name(self):
8288
def name(self, name):
8389
"""Set the name of this AddResourceMemberRequestBody.
8490
91+
The name of the user to add to the resource.
92+
8593
:param name: The name of this AddResourceMemberRequestBody.
8694
:type: str
8795
""" # noqa: E501

influxdb_client/domain/authorization.py

+16-12
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def updated_at(self, updated_at):
138138
def org_id(self):
139139
"""Get the org_id of this Authorization.
140140
141-
ID of the organization that the authorization is scoped to.
141+
The organization ID. Specifies the [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization) that the authorization is scoped to.
142142
143143
:return: The org_id of this Authorization.
144144
:rtype: str
@@ -149,7 +149,7 @@ def org_id(self):
149149
def org_id(self, org_id):
150150
"""Set the org_id of this Authorization.
151151
152-
ID of the organization that the authorization is scoped to.
152+
The organization ID. Specifies the [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization) that the authorization is scoped to.
153153
154154
:param org_id: The org_id of this Authorization.
155155
:type: str
@@ -160,7 +160,7 @@ def org_id(self, org_id):
160160
def permissions(self):
161161
"""Get the permissions of this Authorization.
162162
163-
List of permissions for an authorization. An authorization must have at least one permission.
163+
The list of permissions. An authorization must have at least one permission.
164164
165165
:return: The permissions of this Authorization.
166166
:rtype: list[Permission]
@@ -171,7 +171,7 @@ def permissions(self):
171171
def permissions(self, permissions):
172172
"""Set the permissions of this Authorization.
173173
174-
List of permissions for an authorization. An authorization must have at least one permission.
174+
The list of permissions. An authorization must have at least one permission.
175175
176176
:param permissions: The permissions of this Authorization.
177177
:type: list[Permission]
@@ -182,6 +182,8 @@ def permissions(self, permissions):
182182
def id(self):
183183
"""Get the id of this Authorization.
184184
185+
The authorization ID.
186+
185187
:return: The id of this Authorization.
186188
:rtype: str
187189
""" # noqa: E501
@@ -191,6 +193,8 @@ def id(self):
191193
def id(self, id):
192194
"""Set the id of this Authorization.
193195
196+
The authorization ID.
197+
194198
:param id: The id of this Authorization.
195199
:type: str
196200
""" # noqa: E501
@@ -200,7 +204,7 @@ def id(self, id):
200204
def token(self):
201205
"""Get the token of this Authorization.
202206
203-
Token used to authenticate API requests.
207+
The API token. The token value is unique to the authorization. [API tokens](https://docs.influxdata.com/influxdb/latest/reference/glossary/#token) are used to authenticate and authorize InfluxDB API requests and `influx` CLI commands--after receiving the request, InfluxDB checks that the token is valid and that the `permissions` allow the requested action(s).
204208
205209
:return: The token of this Authorization.
206210
:rtype: str
@@ -211,7 +215,7 @@ def token(self):
211215
def token(self, token):
212216
"""Set the token of this Authorization.
213217
214-
Token used to authenticate API requests.
218+
The API token. The token value is unique to the authorization. [API tokens](https://docs.influxdata.com/influxdb/latest/reference/glossary/#token) are used to authenticate and authorize InfluxDB API requests and `influx` CLI commands--after receiving the request, InfluxDB checks that the token is valid and that the `permissions` allow the requested action(s).
215219
216220
:param token: The token of this Authorization.
217221
:type: str
@@ -222,7 +226,7 @@ def token(self, token):
222226
def user_id(self):
223227
"""Get the user_id of this Authorization.
224228
225-
ID of the user that created and owns the token.
229+
The user ID. Specifies the [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) that owns the authorization. If _scoped_, the user that the authorization is scoped to; otherwise, the creator of the authorization.
226230
227231
:return: The user_id of this Authorization.
228232
:rtype: str
@@ -233,7 +237,7 @@ def user_id(self):
233237
def user_id(self, user_id):
234238
"""Set the user_id of this Authorization.
235239
236-
ID of the user that created and owns the token.
240+
The user ID. Specifies the [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) that owns the authorization. If _scoped_, the user that the authorization is scoped to; otherwise, the creator of the authorization.
237241
238242
:param user_id: The user_id of this Authorization.
239243
:type: str
@@ -244,7 +248,7 @@ def user_id(self, user_id):
244248
def user(self):
245249
"""Get the user of this Authorization.
246250
247-
Name of the user that created and owns the token.
251+
The user name. Specifies the [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) that owns the authorization. If the authorization is _scoped_ to a user, the user; otherwise, the creator of the authorization.
248252
249253
:return: The user of this Authorization.
250254
:rtype: str
@@ -255,7 +259,7 @@ def user(self):
255259
def user(self, user):
256260
"""Set the user of this Authorization.
257261
258-
Name of the user that created and owns the token.
262+
The user name. Specifies the [user](https://docs.influxdata.com/influxdb/latest/reference/glossary/#user) that owns the authorization. If the authorization is _scoped_ to a user, the user; otherwise, the creator of the authorization.
259263
260264
:param user: The user of this Authorization.
261265
:type: str
@@ -266,7 +270,7 @@ def user(self, user):
266270
def org(self):
267271
"""Get the org of this Authorization.
268272
269-
Name of the organization that the token is scoped to.
273+
The organization name. Specifies the [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization) that the token is scoped to.
270274
271275
:return: The org of this Authorization.
272276
:rtype: str
@@ -277,7 +281,7 @@ def org(self):
277281
def org(self, org):
278282
"""Set the org of this Authorization.
279283
280-
Name of the organization that the token is scoped to.
284+
The organization name. Specifies the [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization) that the token is scoped to.
281285
282286
:param org: The org of this Authorization.
283287
:type: str

influxdb_client/domain/authorization_post_request.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def __init__(self, org_id=None, user_id=None, permissions=None, status='active',
6767
def org_id(self):
6868
"""Get the org_id of this AuthorizationPostRequest.
6969
70-
ID of org that authorization is scoped to.
70+
An organization ID. Specifies the organization that owns the authorization.
7171
7272
:return: The org_id of this AuthorizationPostRequest.
7373
:rtype: str
@@ -78,7 +78,7 @@ def org_id(self):
7878
def org_id(self, org_id):
7979
"""Set the org_id of this AuthorizationPostRequest.
8080
81-
ID of org that authorization is scoped to.
81+
An organization ID. Specifies the organization that owns the authorization.
8282
8383
:param org_id: The org_id of this AuthorizationPostRequest.
8484
:type: str
@@ -89,7 +89,7 @@ def org_id(self, org_id):
8989
def user_id(self):
9090
"""Get the user_id of this AuthorizationPostRequest.
9191
92-
ID of user that authorization is scoped to.
92+
A user ID. Specifies the user that the authorization is scoped to. When a user authenticates with username and password, InfluxDB generates a _user session_ with all the permissions specified by all the user's authorizations.
9393
9494
:return: The user_id of this AuthorizationPostRequest.
9595
:rtype: str
@@ -100,7 +100,7 @@ def user_id(self):
100100
def user_id(self, user_id):
101101
"""Set the user_id of this AuthorizationPostRequest.
102102
103-
ID of user that authorization is scoped to.
103+
A user ID. Specifies the user that the authorization is scoped to. When a user authenticates with username and password, InfluxDB generates a _user session_ with all the permissions specified by all the user's authorizations.
104104
105105
:param user_id: The user_id of this AuthorizationPostRequest.
106106
:type: str
@@ -111,7 +111,7 @@ def user_id(self, user_id):
111111
def permissions(self):
112112
"""Get the permissions of this AuthorizationPostRequest.
113113
114-
List of permissions for an auth. An auth must have at least one Permission.
114+
A list of permissions for an authorization. In the list, provide at least one `permission` object. In a `permission`, the `resource.type` property grants access to all resources of the specified type. To grant access to only a specific resource, specify the `resource.id` property.
115115
116116
:return: The permissions of this AuthorizationPostRequest.
117117
:rtype: list[Permission]
@@ -122,7 +122,7 @@ def permissions(self):
122122
def permissions(self, permissions):
123123
"""Set the permissions of this AuthorizationPostRequest.
124124
125-
List of permissions for an auth. An auth must have at least one Permission.
125+
A list of permissions for an authorization. In the list, provide at least one `permission` object. In a `permission`, the `resource.type` property grants access to all resources of the specified type. To grant access to only a specific resource, specify the `resource.id` property.
126126
127127
:param permissions: The permissions of this AuthorizationPostRequest.
128128
:type: list[Permission]

influxdb_client/domain/authorization_update_request.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def __init__(self, status='active', description=None): # noqa: E501,D401,D403
5454
def status(self):
5555
"""Get the status of this AuthorizationUpdateRequest.
5656
57-
Status of the token. If `inactive`, requests using the token will be rejected.
57+
Status of the token. If `inactive`, InfluxDB rejects requests that use the token.
5858
5959
:return: The status of this AuthorizationUpdateRequest.
6060
:rtype: str
@@ -65,7 +65,7 @@ def status(self):
6565
def status(self, status):
6666
"""Set the status of this AuthorizationUpdateRequest.
6767
68-
Status of the token. If `inactive`, requests using the token will be rejected.
68+
Status of the token. If `inactive`, InfluxDB rejects requests that use the token.
6969
7070
:param status: The status of this AuthorizationUpdateRequest.
7171
:type: str

influxdb_client/domain/band_view_properties.py

+24-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class BandViewProperties(ViewProperties):
3232
and the value is json key in definition.
3333
"""
3434
openapi_types = {
35+
'adaptive_zoom_hide': 'bool',
3536
'time_format': 'str',
3637
'type': 'str',
3738
'queries': 'list[DashboardQuery]',
@@ -63,6 +64,7 @@ class BandViewProperties(ViewProperties):
6364
}
6465

6566
attribute_map = {
67+
'adaptive_zoom_hide': 'adaptiveZoomHide',
6668
'time_format': 'timeFormat',
6769
'type': 'type',
6870
'queries': 'queries',
@@ -93,10 +95,11 @@ class BandViewProperties(ViewProperties):
9395
'legend_orientation_threshold': 'legendOrientationThreshold'
9496
}
9597

96-
def __init__(self, time_format=None, type=None, queries=None, colors=None, shape=None, note=None, show_note_when_empty=None, axes=None, static_legend=None, x_column=None, generate_x_axis_ticks=None, x_total_ticks=None, x_tick_start=None, x_tick_step=None, y_column=None, generate_y_axis_ticks=None, y_total_ticks=None, y_tick_start=None, y_tick_step=None, upper_column=None, main_column=None, lower_column=None, hover_dimension=None, geom=None, legend_colorize_rows=None, legend_hide=None, legend_opacity=None, legend_orientation_threshold=None): # noqa: E501,D401,D403
98+
def __init__(self, adaptive_zoom_hide=None, time_format=None, type=None, queries=None, colors=None, shape=None, note=None, show_note_when_empty=None, axes=None, static_legend=None, x_column=None, generate_x_axis_ticks=None, x_total_ticks=None, x_tick_start=None, x_tick_step=None, y_column=None, generate_y_axis_ticks=None, y_total_ticks=None, y_tick_start=None, y_tick_step=None, upper_column=None, main_column=None, lower_column=None, hover_dimension=None, geom=None, legend_colorize_rows=None, legend_hide=None, legend_opacity=None, legend_orientation_threshold=None): # noqa: E501,D401,D403
9799
"""BandViewProperties - a model defined in OpenAPI.""" # noqa: E501
98100
ViewProperties.__init__(self) # noqa: E501
99101

102+
self._adaptive_zoom_hide = None
100103
self._time_format = None
101104
self._type = None
102105
self._queries = None
@@ -127,6 +130,8 @@ def __init__(self, time_format=None, type=None, queries=None, colors=None, shape
127130
self._legend_orientation_threshold = None
128131
self.discriminator = None
129132

133+
if adaptive_zoom_hide is not None:
134+
self.adaptive_zoom_hide = adaptive_zoom_hide
130135
if time_format is not None:
131136
self.time_format = time_format
132137
self.type = type
@@ -176,6 +181,24 @@ def __init__(self, time_format=None, type=None, queries=None, colors=None, shape
176181
if legend_orientation_threshold is not None:
177182
self.legend_orientation_threshold = legend_orientation_threshold
178183

184+
@property
185+
def adaptive_zoom_hide(self):
186+
"""Get the adaptive_zoom_hide of this BandViewProperties.
187+
188+
:return: The adaptive_zoom_hide of this BandViewProperties.
189+
:rtype: bool
190+
""" # noqa: E501
191+
return self._adaptive_zoom_hide
192+
193+
@adaptive_zoom_hide.setter
194+
def adaptive_zoom_hide(self, adaptive_zoom_hide):
195+
"""Set the adaptive_zoom_hide of this BandViewProperties.
196+
197+
:param adaptive_zoom_hide: The adaptive_zoom_hide of this BandViewProperties.
198+
:type: bool
199+
""" # noqa: E501
200+
self._adaptive_zoom_hide = adaptive_zoom_hide
201+
179202
@property
180203
def time_format(self):
181204
"""Get the time_format of this BandViewProperties.

influxdb_client/domain/bucket.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ def updated_at(self, updated_at):
284284
def retention_rules(self):
285285
"""Get the retention_rules of this Bucket.
286286
287-
Rules to expire or retain data. No rules means data never expires.
287+
Retention rules to expire or retain data. The InfluxDB `/api/v2` API uses `RetentionRules` to configure the [retention period](https://docs.influxdata.com/influxdb/latest/reference/glossary/#retention-period). #### InfluxDB Cloud - `retentionRules` is required. #### InfluxDB OSS - `retentionRules` isn't required.
288288
289289
:return: The retention_rules of this Bucket.
290290
:rtype: list[BucketRetentionRules]
@@ -295,7 +295,7 @@ def retention_rules(self):
295295
def retention_rules(self, retention_rules):
296296
"""Set the retention_rules of this Bucket.
297297
298-
Rules to expire or retain data. No rules means data never expires.
298+
Retention rules to expire or retain data. The InfluxDB `/api/v2` API uses `RetentionRules` to configure the [retention period](https://docs.influxdata.com/influxdb/latest/reference/glossary/#retention-period). #### InfluxDB Cloud - `retentionRules` is required. #### InfluxDB OSS - `retentionRules` isn't required.
299299
300300
:param retention_rules: The retention_rules of this Bucket.
301301
:type: list[BucketRetentionRules]

0 commit comments

Comments
 (0)